Commits

Anonymous committed 0a4108c

fixing OpenMP doctest failures

Comments (0)

Files changed (1)

   }
 
 #ifdef HAVE_OPENMP
-  if (omp_get_max_threads()-omp_get_num_threads() > 0)
+  if (omp_get_max_threads()-omp_get_num_threads() > 0) {
     mzd_set_ui(C, 0);
     return _mzd_addmul_mp_even(C, A, B, cutoff);
+  }
 #endif
 
   /* adjust cutting numbers to work on words */
   }
 
   /* deal with rest */
-  if (B->ncols > (int)(2*bnc)) {
+  if (B->ncols > 2*bnc) {
     mzd_t *B_last_col = mzd_init_window(B, 0, 2*bnc, A->ncols, B->ncols); 
     mzd_t *C_last_col = mzd_init_window(C, 0, 2*bnc, A->nrows, C->ncols);
-    _mzd_mul_m4rm(C_last_col, A, B_last_col, 0, TRUE);
+    mzd_addmul_m4rm(C_last_col, A, B_last_col, 0);
     mzd_free_window(B_last_col);
     mzd_free_window(C_last_col);
   }
-  if (A->nrows > (int)(2*anr)) {
+  if (A->nrows > 2*anr) {
     mzd_t *A_last_row = mzd_init_window(A, 2*anr, 0, A->nrows, A->ncols);
-    mzd_t *C_last_row = mzd_init_window(C, 2*anr, 0, C->nrows, C->ncols);
-    _mzd_mul_m4rm(C_last_row, A_last_row, B, 0, TRUE);
+    mzd_t *B_bulk = mzd_init_window(B, 0, 0, B->nrows, 2*bnc);
+    mzd_t *C_last_row = mzd_init_window(C, 2*anr, 0, C->nrows, 2*bnc);
+    mzd_addmul_m4rm(C_last_row, A_last_row, B_bulk, 0);
     mzd_free_window(A_last_row);
+    mzd_free_window(B_bulk);
     mzd_free_window(C_last_row);
   }
-  if (A->ncols > (int)(2*anc)) {
+  if (A->ncols > 2*anc) {
     mzd_t *A_last_col = mzd_init_window(A,     0, 2*anc, 2*anr, A->ncols);
     mzd_t *B_last_row = mzd_init_window(B, 2*bnr,     0, B->nrows, 2*bnc);
     mzd_t *C_bulk = mzd_init_window(C, 0, 0, 2*anr, bnc*2);