Definition at line 516 of file matrix.cpp.
520{
522 {
523 ERROR(
"reshape: expected same ring");
524 return nullptr;
525 }
527 {
528 ERROR(
"reshape: ranks of the free modules are incorrect");
529 return nullptr;
530 }
531
532
534 for (
int c = 0; c <
n_cols(); c++)
535 for (vecterm *
p =
elem(c);
p !=
nullptr;
p =
p->next)
536 {
537
538 int loc = c *
n_rows() +
p->comp;
539 int result_col = loc / F->rank();
540 int result_row = loc % F->rank();
541
542 mat.set_entry(result_row, result_col,
p->coeff);
543 }
544 return mat.to_matrix();
545}
const_monomial degree_shift() const
const Ring * get_ring() const
ring_elem elem(int i, int j) const
friend class MatrixConstructor
References degree_shift(), elem(), ERROR, FreeModule, G, get_ring(), Matrix(), MatrixConstructor, n_cols(), n_rows(), p, reshape(), MatrixConstructor::set_entry(), and MatrixConstructor::to_matrix().
Referenced by IM2_Matrix_reshape(), and reshape().