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

◆ submatrix() [1/2]

template<typename Mat>
virtual MutableMatrix * MutableMat< Mat >::submatrix ( M2_arrayint cols) const
inlinevirtual

Implements MutableMatrix.

Definition at line 606 of file mutablemat-defs.hpp.

607 {
608 for (size_t c = 0; c < cols->len; c++)
609 if (cols->array[c] < 0 || cols->array[c] >= n_cols())
610 {
611 ERROR("column index %d out of bounds 0..%d",
612 cols->array[c],
613 n_cols() - 1);
614 return 0;
615 }
618 return result;
619 }
virtual size_t n_rows() const
virtual size_t n_cols() const
MutableMat * makeZeroMatrix(size_t nrows, size_t ncols) const
const int ERROR
Definition m2-mem.cpp:55

References ERROR, getMat(), makeZeroMatrix(), MutableMat(), MutableMatrix::MutableMatrix(), n_cols(), n_rows(), and result().