]> rtime.felk.cvut.cz Git - eurobot/public.git/commitdiff
ULoPoS: index bug in matrix.c corrected
authorMarek Peca <mp@duch.cz>
Mon, 6 Apr 2009 13:37:55 +0000 (15:37 +0200)
committerMarek Peca <mp@duch.cz>
Mon, 6 Apr 2009 13:37:55 +0000 (15:37 +0200)
src/uzv/ekf/matrix.c

index b0a5ea2ecabc3b418e06ded237cf8385c4fdb2f5..34ba660868819c702f139e78c3c2ed176676d955 100644 (file)
@@ -45,7 +45,7 @@ void mtx_add(int n, int m, double *a, double *b, double *c) {
   int i, jn;
 
   for (i = 0; i < n; i++)
-    for (jn = 0; jn < n*n; jn += n)
+    for (jn = 0; jn < m*n; jn += n)
       c[i+jn] = a[i+jn] + b[i+jn];
 }
 
@@ -53,7 +53,7 @@ void mtx_sub(int n, int m, double *a, double *b, double *c) {
   int i, jn;
 
   for (i = 0; i < n; i++)
-    for (jn = 0; jn < n*n; jn += n)
+    for (jn = 0; jn < m*n; jn += n)
       c[i+jn] = a[i+jn] - b[i+jn];
 }