469{
470 int i = index;
471
472#ifdef DEBUG_GAUSS
473 std::cout << "reducing row " << i << std::endl;
474#endif
475
476
477
478
480
484
486
487
488
489
490 if (!r.mComponents.empty())
491 {
494
495#ifdef DEBUG_GAUSS
496 std::cout << "about to fill from sparse " << i << std::endl;
497#endif
498
499 mRing.vectorArithmetic().fillDenseArray(gauss_row,
500 r.mCoeffs,
501 Range(&r.mComponents[0],
502 &r.mComponents[0] +
static_cast<ComponentIndex>(r.mComponents.size())));
503
504 while (firstcol <= lastcol)
505 {
506#ifdef DEBUG_GAUSS
507 std::cout << "about to reduce with col " << firstcol << std::endl;
508 std::cout << "gauss_row: "
509 << (gauss_row.isNull() ? "null" : "not-null")
510 << std::endl;
511 std::cout << "mReducers[" << firstcol << "]: "
512 << (
mReducers[firstcol].mCoeffs.isNull() ?
"null"
513 : "not-null")
514 << std::endl;
515 std::cout <<
"result: " << (
result.coefficientInserter().isNull()
516 ? "null"
517 : "not-null")
518 << std::endl;
519 std::cout << " dense: ";
520 mRing.vectorArithmetic().displayElementArray(std::cout, gauss_row)
521 << std::endl;
522 mRing.vectorArithmetic().displayElementArray(std::cout,
524 std::cout << std::endl;
525 mRing.vectorArithmetic().displayElementArray(std::cout,
526 result.coefficientInserter());
527 std::cout << std::endl;
528#endif
529
530 if (onlyConstantMaps and not track[firstcol])
531 {
532 mRing.vectorArithmetic().denseCancelFromSparse(gauss_row,
534 Range(
mReducers[firstcol].mComponents.data(),
537 }
538 else
539 {
540 mRing.vectorArithmetic().denseCancelFromSparse(gauss_row,
542 Range(
mReducers[firstcol].mComponents.data(),
545 result.coefficientInserter());
546
547#ifdef DEBUG_GAUSS
548 std::cout << " done with sparseCancel" << std::endl;
549 mRing.vectorArithmetic().displayElementArray(std::cout, gauss_row)
550 << std::endl;
551 mRing.vectorArithmetic().displayElementArray(std::cout,
553 << std::endl;
554 mRing.vectorArithmetic().displayElementArray(std::cout,
555 result.coefficientInserter())
556 << std::endl;
557 std::cout << " about to push back term" << std::endl;
558#endif
559
561
562#ifdef DEBUG_GAUSS
563 std::cout << "done with col " << firstcol << std::endl;
564#endif
565 }
566 firstcol =
mRing.vectorArithmetic().denseNextNonzero(gauss_row, firstcol + 1, lastcol);
567 }
568 }
569
570#ifdef DEBUG_GAUSS
571 std::cout << "about to set syz" << std::endl;
572#endif
574#ifdef DEBUG_GAUSS
575 std::cout << "just set syz" << std::endl;
576#endif
577}
std::vector< res_packed_monomial > mColumns
std::vector< Row > mReducers
const ResPolyRing & mRing
std::vector< long > mSPairComponents
std::vector< Row > mSPairs
VALGRIND_MAKE_MEM_DEFINED & result(result)
One row of the Macaulay matrix built by F4Res::construct.