Commits

Anonymous committed 02b2364

fixed PLUQ MMPF bug

  • Participants
  • Parent commits 048a94f

Comments (0)

Files changed (4)

     size_t r1, r2;
     /* First recursive call */
     r1 = _mzd_pluq(A0, P, Q, cutoff);
-    
+
     /*           r1           n1
      *   ------------------------------------------
      *   | A00    |           | A01               |
  * Crossover point for PLUQ factorization.
  */
 
-#define PLUQ_CUTOFF 64
+#define PLUQ_CUTOFF 512
 
 /**
  * \brief PLUQ matrix decomposition.

File src/packedmatrix.c

 }
 
 void mzd_print( const packedmatrix *M ) {
-  size_t i, j;
+  size_t i, j, wide;
   char temp[SAFECHAR];
   word *row;
 
+
   for (i=0; i< M->nrows; i++ ) {
     printf("[");
     row = M->values + M->rowswap[i];
         printf("%s ", temp);
       }
       row = row + M->width - 1;
-      for (j=0; j< (size_t)(M->ncols%RADIX); j++) {
+      if(M->ncols%RADIX)
+        wide = (size_t)M->ncols%RADIX;
+      else
+        wide = RADIX;
+      for (j=0; j< wide; j++) {
         if (GET_BIT(*row, j)) 
           printf("1");
         else

File src/pluq_mmpf.c

     kbar = _mzd_pluq_submatrix(A, curr_pos, curr_pos, kk, P, Q, done);
     /* 1.5. finish submatrix*/
     done_row = _max_value(done, kbar);
-    for(size_t c2=0; c2<kbar; c2++)
+    for(size_t c2=0; c2<kbar && curr_pos + c2 < A->ncols -1; c2++)
       for(size_t r2=done[c2]+1; r2<=done_row; r2++)
         if(mzd_read_bit(A, r2, curr_pos + c2))
           mzd_row_add_offset(A, r2, curr_pos + c2, curr_pos + c2 + 1);