malb / M4RI (http://m4ri.sagemath.org/)

M4RI is a library for fast arithmetic with dense matrices over F2. It was started by Gregory Bard, is maintained by Martin Albrecht. Several people contributed to it. The name M4RI comes from the first implemented algorithm: The "Method of the Four Russians" inversion algorithm published by Gregory Bard. This algorithm in turn is named after the "Method of the Four Russians" multiplication algorithm which is probably better referred to as Kronrod's method. M4RI is used by the Sage mathematics software and the PolyBoRi library. M4RI is available under the General Public License Version 2 or later (GPLv2+).

Clone this repository (size: 730.9 KB): HTTPS / SSH
$ hg clone http://bitbucket.org/malb/m4ri/
commit 296: 2092e8719094
parent 295: 52b259b69678
branch: default
copy submatrix to temporary when switching to MMPF
Martin Albrecht / malb
9 months ago

Changed (Δ220 bytes):

raw changeset »

src/lqup.c (9 lines added, 2 lines removed)

Up to file-list src/lqup.c:

@@ -67,8 +67,15 @@ size_t _mzd_lqup(mzd_t *A, mzp_t * P, mz
67
67
  size_t nrows = A->nrows;
68
68
#endif
69
69
70
  if (ncols <= PLUQ_CUTOFF)
71
    return _mzd_lqup_mmpf(A, P, Q, 0);
70
  /*if (A->width*A->nrows <= CPU_L2_CACHE>>3) { */
71
  if(ncols <= PLUQ_CUTOFF) {
72
    /* this improves data locality and runtime considerably */
73
    mzd_t *Abar = mzd_copy(NULL, A);
74
    size_t r = _mzd_lqup_mmpf(Abar, P, Q, 0);
75
    mzd_copy(A, Abar);
76
    mzd_free(Abar);
77
    return r;
78
  }
72
79
73
80
  {
74
81
    /* Block divide and conquer algorithm */