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

◆ sub_matrix() [1/2]

Matrix * Matrix::sub_matrix ( M2_arrayint c) const

Definition at line 505 of file matrix.cpp.

506{
507 const FreeModule *G = cols()->sub_space(c);
508 if (G == nullptr) return nullptr;
509
511 for (unsigned int i = 0; i < c->len; i++)
512 mat.set_column(i, get_ring()->copy_vec(elem(c->array[i])));
513 return mat.to_matrix();
514}
FreeModule * sub_space(int n) const
Definition freemod.cpp:197
friend class FreeModule
Definition matrix.hpp:73
const_monomial degree_shift() const
Definition matrix.hpp:149
const Ring * get_ring() const
Definition matrix.hpp:134
ring_elem elem(int i, int j) const
Definition matrix.cpp:307
friend class MatrixConstructor
Definition matrix.hpp:76
const FreeModule * rows() const
Definition matrix.hpp:144
const FreeModule * cols() const
Definition matrix.hpp:145
tbb::flow::graph G

References cols(), degree_shift(), elem(), FreeModule, G, get_ring(), Matrix(), MatrixConstructor, rows(), MatrixConstructor::set_column(), sub_matrix(), and MatrixConstructor::to_matrix().