Skip to content

Commit f4230df

Browse files
Debug Gaus. elim.
1 parent 54688ea commit f4230df

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

FindAFactor/_find_a_factor.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -913,13 +913,17 @@ struct Factorizer {
913913
// Pivot found, now eliminate entries in this column
914914
const boost::dynamic_bitset<size_t> &cm = *mColIt;
915915
const BigInteger &cn = *nColIt;
916+
auto emRowIt = mColIt;
917+
auto enRowIt = nColIt;
916918
const size_t maxLcv = std::min(colPlus1 + CpuCount, rows);
917919
for (unsigned cpu = colPlus1; cpu < maxLcv; ++cpu) {
918-
dispatch.dispatch([cpu, &cpuCount, &col, &rows, &cm, &cn, mRowIt, nRowIt]() -> bool {
920+
++emRowIt;
921+
++enRowIt;
922+
dispatch.dispatch([cpu, &cpuCount, &col, &rows, &cm, &cn, emRowIt, enRowIt]() -> bool {
919923
// Notice that each thread updates rows with space increments of cpuCount,
920924
// based on the same unchanged outer-loop row, and this covers the inner-loop set.
921-
auto mrIt = mRowIt;
922-
auto nrIt = nRowIt;
925+
auto mrIt = emRowIt;
926+
auto nrIt = enRowIt;
923927
for (size_t row = cpu; ; row += cpuCount) {
924928
boost::dynamic_bitset<size_t> &rm = *mrIt;
925929
BigInteger &rn = *nrIt;
@@ -940,8 +944,6 @@ struct Factorizer {
940944
return false;
941945
});
942946
// Next inner-loop row (all at once by dispatch).
943-
++mRowIt;
944-
++nRowIt;
945947
}
946948
// All dispatched work must complete.
947949
dispatch.finish();

0 commit comments

Comments
 (0)