Macaulay2 Engine
Loading...
Searching...
No Matches

◆ macaulayMatrixStats()

auto F4GB::macaulayMatrixStats ( ) const
private

Definition at line 515 of file f4.cpp.

516{
517 // Want:
518 // sizes of A, B, C, D.
519 // number of elements in each part.
520 // loop through the rows, and for each row, determine: in A or C?
521 // loop through elements in a row: for each, determine: in A/C or B/D
522
524
525 // look at 'mat', determine number of rows, cols, etc.
526 long nrows = mat->rows.size();
527 long ncols = mat->columns.size();
528 for (long i=0; i<nrows; ++i)
529 {
530 bool is_pivot = is_pivot_row(i);
531 if (is_pivot)
532 ++stats.mTopAndLeft;
533
534 auto& r = mat->rows[i];
535 for (long j=0; j < r.len; ++j)
536 {
537 auto c = r.comps[j];
538 bool is_left = mat->columns[c].head >= 0;
539 if (is_pivot and is_left) ++stats.mAEntries;
540 if (is_pivot and not is_left) ++stats.mBEntries;
541 if (not is_pivot and is_left) ++stats.mCEntries;
542 if (not is_pivot and not is_left) ++stats.mDEntries;
543 }
544 }
545
546 stats.mAEntries -= stats.mTopAndLeft;
547 stats.mBottom = nrows - stats.mTopAndLeft;
548 stats.mRight = ncols - stats.mTopAndLeft;
549
550 stats.display();
551 return stats;
552}
coefficient_matrix * mat
Definition f4.hpp:186
bool is_pivot_row(int index) const
Definition f4.cpp:741
Per-degree counters describing the shape and density of the Macaulay matrix that F4GB just built.
Definition f4.hpp:218

References F4GB::MacaulayMatrixStats::display(), is_pivot_row(), F4GB::MacaulayMatrixStats::mAEntries, mat, F4GB::MacaulayMatrixStats::mBEntries, F4GB::MacaulayMatrixStats::mBottom, F4GB::MacaulayMatrixStats::mCEntries, F4GB::MacaulayMatrixStats::mDEntries, F4GB::MacaulayMatrixStats::mRight, and F4GB::MacaulayMatrixStats::mTopAndLeft.

Referenced by make_matrix().