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

◆ show_new_rows_matrix()

void F4GB::show_new_rows_matrix ( )

Definition at line 1306 of file f4.cpp.

1307{
1308 int ncols = INTSIZE(mat->columns);
1309 int nrows = 0;
1310 for (int nr = 0; nr < mat->rows.size(); nr++)
1311 if (is_new_GB_row(nr)) nrows++;
1312
1313 MutableMatrix *gbM =
1314 IM2_MutableMatrix_make(mVectorArithmetic->ring(), nrows, ncols, false);
1315
1316 int r = -1;
1317 for (int nr = 0; nr < mat->rows.size(); nr++)
1318 if (is_new_GB_row(nr))
1319 {
1320 r++;
1321 row_elem &row = mat->rows[nr];
1322 auto& coeffs = get_coeffs_array(row);
1323 for (int i = 0; i < row.len; i++)
1324 {
1325 int c = row.comps[i];
1326 ring_elem a = mVectorArithmetic->ringElemFromElementArray(coeffs, i);
1327 gbM->set_entry(r, c, a);
1328 }
1329 }
1330
1331 buffer o;
1332 gbM->text_out(o);
1333 emit(o.str());
1334}
const ElementArray & get_coeffs_array(row_elem &r)
Definition f4.cpp:591
coefficient_matrix * mat
Definition f4.hpp:186
bool is_new_GB_row(int row) const
Definition f4.cpp:603
const VectorArithmetic * mVectorArithmetic
Definition f4.hpp:156
void text_out(buffer &o) const
Definition mat.cpp:89
virtual bool set_entry(size_t r, size_t c, const ring_elem a)=0
char * str()
Definition buffer.hpp:72
MutableMatrix * IM2_MutableMatrix_make(const Ring *R, int nrows, int ncols, M2_bool is_dense)
int * comps
Definition f4-types.hpp:163
#define INTSIZE(a)
Definition style.hpp:37
void emit(const char *s)
Definition text-io.cpp:41

References row_elem::comps, emit(), get_coeffs_array(), IM2_MutableMatrix_make(), INTSIZE, is_new_GB_row(), row_elem::len, mat, mVectorArithmetic, MutableMatrix::set_entry(), buffer::str(), and MutableMatrix::text_out().