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

◆ IM2_MutableMatrix_row_permute()

M2_bool IM2_MutableMatrix_row_permute ( MutableMatrix * M,
int start,
M2_arrayint perm )

Definition at line 473 of file mutable-matrix.cpp.

478{
479 size_t nrows = M->n_rows();
480 if (start < 0 || start + perm->len > nrows)
481 {
482 ERROR("row indices out of range");
483 return false;
484 }
485 for (int i = 0; i < perm->len; i++)
486 {
487 int r = start + perm->array[i];
488 if (r < 0 || r >= nrows)
489 {
490 ERROR("row indices out of range");
491 return false;
492 }
493 }
494 return M->row_permute(start, perm);
495}
virtual size_t n_rows() const =0
virtual bool row_permute(size_t start_row, M2_arrayint perm)=0
const int ERROR
Definition m2-mem.cpp:55

References ERROR, MutableMatrix::n_rows(), and MutableMatrix::row_permute().