fixed counting of valid cases in fill_covariance fc11-i386-build84 fc11-x64-build81 lenny-x64-build99 sid-i386-build151
authorJason H Stover <jhs@math.gcsu.edu>
Fri, 29 Jan 2010 19:25:09 +0000 (14:25 -0500)
committerJason H Stover <jhs@math.gcsu.edu>
Fri, 29 Jan 2010 19:25:09 +0000 (14:25 -0500)
src/language/stats/regression.q

index abb3bd353aebea6814d55c7b7c00ab0be926f95a..2b31158d5418c8009f2fbab38fad2c75dd216af3 100644 (file)
@@ -821,22 +821,17 @@ fill_covariance (gsl_matrix *cov, struct covariance *all_cov,
   
   for (i = 0; i < n_all_vars; i++)
     {
-      for (j = k; j < n_vars; j++)
+      for (j = 0; j < n_vars; j++)
        {
          if (vars[j] == all_vars[i])
            {
-             if (vars[j] != dep_var)
-               {
-                 rows[j] = i;
-               }
-             else
-               {
-                 dep_subscript = i;
-               }
-             k++;
-             break;
+             rows[j] = i;
            }
        }
+      if (all_vars[i] == dep_var)
+       {
+         dep_subscript = i;
+       }
     }
   for (i = 0; i < cov->size1 - 1; i++)
     {