From e31b8824451f6437fc8c27c6fda7344633f8a541 Mon Sep 17 00:00:00 2001 From: Francesco Cozzuto Date: Thu, 24 Mar 2022 19:57:02 +0100 Subject: [PATCH] added comments and disclaimer to the readme --- README.md | 4 +++- src/lina.c | 6 +++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c2fbdeb..619307b 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,4 @@ # Lina -Lina (***Lin**ear **A**lgebra*) is a C library that implements common linear algebra operations. \ No newline at end of file +Lina (***Lin**ear **A**lgebra*) is a C library that implements common linear algebra operations. + +Note that this is still a work in progress. \ No newline at end of file diff --git a/src/lina.c b/src/lina.c index 5f91d26..2fe3a67 100644 --- a/src/lina.c +++ b/src/lina.c @@ -655,11 +655,15 @@ void lina_conv(double *A, double *B, double *C, int Ch = Ah - Bh + 1; assert(Cw > 0 && Ch > 0); + // Iterate over each pixel of the result matrix.. for(int j = 0; j < Ah - Bh + 1; j += 1) for(int i = 0; i < Aw - Bw + 1; i += 1) { - C[j * Cw + i] = 0; + // ..and calculate it's value as + // the scalar product between the + // mask B and a portion of A. + C[j * Cw + i] = 0; for(int v = 0; v < Bh; v += 1) for(int u = 0; u < Bw; u += 1) C[j * Cw + i] += A[(i - Bw/2 + u) * Aw + (i - Bh/2 + v)] * B[u * Bw + v];