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

◆ displayF4Matrix()

void NCF4::displayF4Matrix ( std::ostream & o) const

Definition at line 1098 of file NCF4.cpp.

1099{
1101 // Now column monomials
1102 for (auto i : mColumnMonomials)
1103 {
1104 // each i is a pair (const Monom, pair(int,int)).
1105 buffer b;
1106 FreeMonoid::MonomialInserter monomInserter;
1107 freeAlgebra().monoid().monomInsertFromWord(monomInserter,i.first);
1108 Monom m(monomInserter.data());
1110 o << b.str() << "(" << i.second.first << ", " << i.second.second << ") ";
1111 if (i.second.second != -1 and
1112 (mRows[i.second.second].columnIndices.begin() == nullptr or
1113 mRows[i.second.second].columnIndices[0] != i.second.first))
1114 {
1115 std::cout << "Oops (" << mRows[i.second.second].columnIndices.begin()
1116 << "," << mRows[i.second.second].columnIndices[0] << ","
1117 << i.second.first << ")";
1118 }
1119 }
1120 o << std::endl;
1121
1122 // For each row, and each overlap row, display the non-zero comps, non-zero coeffs.
1123 // if (mRows.size() != mReducersTodo.size())
1124 // {
1125 // o << std::endl;
1126 // o << "***ERROR*** expected mRows and mReducersTodo to have the same length!" << std::endl;
1127 // o << " mRows size: " << mRows.size() << std::endl;
1128 // o << "mReducersTodo size: " << mReducersTodo.size() << std::endl;
1129 // exit(1);
1130 // }
1131 const Ring* kk = freeAlgebra().coefficientRing();
1132 for (auto count = 0; count < mRows.size(); ++count)
1133 {
1134 // PreRow pr = mReducersTodo[count];
1135 // o << count << " ("<< std::get<0>(pr) << ", "
1136 // << std::get<1>(pr) << ", "
1137 // << std::get<2>(pr) << ", "
1138 // << std::get<3>(pr) << ") "
1139 if (mRows[count].columnIndices.begin() == nullptr)
1140 {
1141 o << "Row " << count
1142 << " is empty. This may indicate an error depending on the current state."
1143 << std::endl;
1144 continue;
1145 }
1146 o << "Row " << count << ";" << mRows[count].columnIndices.size() << ": ";
1147 if (mVectorArithmetic->size(mRows[count].coeffVector) != mRows[count].columnIndices.size())
1148 {
1149 o << "***ERROR*** expected coefficient array and components array to have the same length" << std::endl;
1150 exit(1);
1151 }
1152 for (auto i=0; i < mVectorArithmetic->size(mRows[count].coeffVector); ++i)
1153 {
1154 buffer b;
1155 kk->elem_text_out(b, mVectorArithmetic->ringElemFromElementArray(mRows[count].coeffVector,i));
1156 o << "[" << mRows[count].columnIndices[i] << "," << b.str() << "] ";
1157 }
1158 o << std::endl;
1159 }
1160}
const Ring * coefficientRing() const
const FreeMonoid & monoid() const
gc_vector< int > MonomialInserter
void monomInsertFromWord(MonomialInserter &result, const Word &w) const
void elem_text_out(buffer &o, const Monom &m1) const
MonomialHash mColumnMonomials
Definition NCF4.hpp:235
RowsVector mRows
Definition NCF4.hpp:243
void displayF4MatrixSize(std::ostream &o) const
Definition NCF4.cpp:1066
const VectorArithmetic * mVectorArithmetic
Definition NCF4.hpp:250
const FreeAlgebra & freeAlgebra() const
Definition NCF4.hpp:282
virtual void elem_text_out(buffer &o, const ring_elem f, bool p_one=true, bool p_plus=false, bool p_parens=false) const =0
char * str()
Definition buffer.hpp:72

References FreeAlgebra::coefficientRing(), displayF4MatrixSize(), FreeMonoid::elem_text_out(), Ring::elem_text_out(), freeAlgebra(), mColumnMonomials, FreeAlgebra::monoid(), FreeMonoid::monomInsertFromWord(), mRows, mVectorArithmetic, and buffer::str().

Referenced by process().