File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -182,6 +182,8 @@ class Matrix {
182182
183183 [[nodiscard]] Matrix getSubMatrix (const std::list<unsigned int > &indices) const ;
184184
185+ [[nodiscard]] virtual std::shared_ptr<Matrix> getSubMatrixPtr (const std::list<unsigned int > &indices) const ;
186+
185187 [[nodiscard]] Matrix getSubMatrixNonSquare (const std::list<unsigned int > &indices) const ;
186188
187189 /* *
Original file line number Diff line number Diff line change @@ -608,6 +608,12 @@ Matrix Matrix::getSubMatrix(const std::list<unsigned int> &indices) const {
608608 return this ->getSubMatrix (indices, indices);
609609}
610610
611+ std::shared_ptr<Matrix> Matrix::getSubMatrixPtr (const std::list<unsigned int > &indices) const {
612+ assert (this ->getRows () == this ->getCols ());
613+ return this ->getSubMatrixPtr (indices, indices);
614+ }
615+
616+
611617/* *
612618 * Make sub matrix with indices in list for non-square matrix. The new matrix only keeps the columns
613619 * of the original matrix with the selected indices.
You can’t perform that action at this time.
0 commit comments