diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..34a93a7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.swp +test \ No newline at end of file diff --git a/.swp b/.swp deleted file mode 100644 index 68379a2..0000000 Binary files a/.swp and /dev/null differ diff --git a/README.md b/README.md index 56b6515..62c13b9 100644 --- a/README.md +++ b/README.md @@ -1,2 +1 @@ -# lina -Great Code written in C. +# lina \ No newline at end of file diff --git a/lina.c b/lina.c index e122438..d4afa67 100644 --- a/lina.c +++ b/lina.c @@ -6,7 +6,7 @@ // NOTE: C can't be the same pointer of A or B. void lina_dot(double *A, double *B, double *C, int m, int n, int l){ - assert(m >= 0 && n >= 0 && l >= 0); + assert(m > 0 && n > 0 && l > 0); assert(A != NULL && B != NULL && C != NULL); assert(A != C && B != C); @@ -36,7 +36,7 @@ void lina_dot(double *A, double *B, double *C, int m, int n, int l){ // NOTE: C can be the same location of A or B. void lina_add(double *A, double *B, double *C, int m, int n){ - assert(m >= 0 && n >= 0); + assert(m > 0 && n > 0); assert(A != NULL && B != NULL && C != NULL); for(int i = 0; i < m; i++) @@ -50,7 +50,7 @@ void lina_add(double *A, double *B, double *C, int m, int n){ // NOTE: B can be the same location of A. void lina_scale(double *A, double *B, double k, int m, int n){ - assert(m >= 0 && n >= 0); + assert(m > 0 && n > 0); assert(A != NULL && B != NULL); for(int i = 0; i < m; i++) @@ -64,4 +64,20 @@ void lina_scale(double *A, double *B, double k, int m, int n){ // NOTE: B can be the same location of A. void lina_transpose(double *A, double *B, int m, int n){ + assert(m > 0 && n > 0); + assert(A != NULL && B != NULL); + +/* + | A B C | + | D E F | + | - - - | + + | A D - | + | B E - | + | C F - | + + | A B C D E F - - - | + | A D - B E - C F - | +*/ + #warning "TODO" } \ No newline at end of file