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

◆ displayFullF4Matrix()

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

Definition at line 1162 of file NCF4.cpp.

1163{
1165 // Now column monomials
1166 for (auto i : mColumnMonomials)
1167 {
1168 buffer b;
1169 FreeMonoid::MonomialInserter monomInserter;
1170 freeAlgebra().monoid().monomInsertFromWord(monomInserter,i.first);
1171 Monom m(monomInserter.data());
1173 o << b.str() << "(" << i.second.first << ", " << i.second.second << ") ";
1174 // each i is a pair (const Monom, pair(int,int)).
1175 }
1176 o << std::endl;
1177 // For each row, and each overlap row, display the non-zero comps, non-zero coeffs.
1178 if (mRows.size() != mReducersTodo.size())
1179 {
1180 o << "***ERROR*** expected mRows and mReducersTodo to have the same length!" << std::endl;
1181 exit(1);
1182 }
1183 const Ring* kk = freeAlgebra().coefficientRing();
1184 for (auto count = 0; count < mRows.size(); ++count)
1185 {
1186 PreRow pr = mReducersTodo[count];
1187 o << count << " ("<< pr.left << ", "
1188 << pr.preRowIndex << ", "
1189 << pr.right << ")";
1190 size_t count2 = 0;
1191 for (auto i=0; i < mColumnMonomials.size(); i++)
1192 {
1193 if (count2 == mVectorArithmetic->size(mRows[count].coeffVector) or
1194 mRows[count].columnIndices[count2] != i)
1195 {
1196 o << " 0 ";
1197 }
1198 else
1199 {
1200 buffer b;
1201 kk->elem_text_out(b,mVectorArithmetic->ringElemFromElementArray(mRows[count].coeffVector,count2));
1202 o << " " << b.str() << " ";
1203 count2++;
1204 }
1205 }
1206 o << std::endl;
1207 }
1208}
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
std::vector< PreRow > mReducersTodo
Definition NCF4.hpp:238
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
Symbolic description of one row before it is materialised in the matrix: a left * (something) * right...
Definition NCF4.hpp:138

References FreeAlgebra::coefficientRing(), displayF4MatrixSize(), FreeMonoid::elem_text_out(), Ring::elem_text_out(), freeAlgebra(), NCF4::PreRow::left, mColumnMonomials, FreeAlgebra::monoid(), FreeMonoid::monomInsertFromWord(), mReducersTodo, mRows, mVectorArithmetic, NCF4::PreRow::preRowIndex, NCF4::PreRow::right, and buffer::str().

Referenced by process().