From 2fd45dab7b0b81d4641d6c6cb971de244a6261fe Mon Sep 17 00:00:00 2001 From: cozis Date: Thu, 13 Jan 2022 18:03:25 +0100 Subject: [PATCH] added gitignore and removed editor artifacts --- .gitignore | 2 ++ .swp | Bin 12288 -> 0 bytes README.md | 3 +-- lina.c | 22 +++++++++++++++++++--- 4 files changed, 22 insertions(+), 5 deletions(-) create mode 100644 .gitignore delete mode 100644 .swp 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 68379a2ca3061a5caf52092b893b960c2511051f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12288 zcmeI%I|{-;5P;!{ot2^&@KM=FqA0c@7_?9%plBs4K2pSxh(bD#r 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