added comments and disclaimer to the readme
This commit is contained in:
@@ -1,2 +1,4 @@
|
|||||||
# Lina
|
# Lina
|
||||||
Lina (***Lin**ear **A**lgebra*) is a C library that implements common linear algebra operations.
|
Lina (***Lin**ear **A**lgebra*) is a C library that implements common linear algebra operations.
|
||||||
|
|
||||||
|
Note that this is still a work in progress.
|
||||||
+5
-1
@@ -655,11 +655,15 @@ void lina_conv(double *A, double *B, double *C,
|
|||||||
int Ch = Ah - Bh + 1;
|
int Ch = Ah - Bh + 1;
|
||||||
assert(Cw > 0 && Ch > 0);
|
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 j = 0; j < Ah - Bh + 1; j += 1)
|
||||||
for(int i = 0; i < Aw - Bw + 1; i += 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 v = 0; v < Bh; v += 1)
|
||||||
for(int u = 0; u < Bw; u += 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];
|
C[j * Cw + i] += A[(i - Bw/2 + u) * Aw + (i - Bh/2 + v)] * B[u * Bw + v];
|
||||||
|
|||||||
Reference in New Issue
Block a user