mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Add const to non-mutating member functions across remaining modules
libeigen/eigen!2222 Co-authored-by: Rasmus Munk Larsen <rmlarsen@gmail.com>
This commit is contained in:
@@ -53,7 +53,7 @@ class AMDOrdering {
|
||||
* This routine is much faster if the input matrix is column-major
|
||||
*/
|
||||
template <typename MatrixType>
|
||||
void operator()(const MatrixType& mat, PermutationType& perm) {
|
||||
void operator()(const MatrixType& mat, PermutationType& perm) const {
|
||||
// Compute the symmetric pattern
|
||||
SparseMatrix<typename MatrixType::Scalar, ColMajor, StorageIndex> symm;
|
||||
internal::ordering_helper_at_plus_a(mat, symm);
|
||||
@@ -65,7 +65,7 @@ class AMDOrdering {
|
||||
|
||||
/** Compute the permutation with a selfadjoint matrix */
|
||||
template <typename SrcType, unsigned int SrcUpLo>
|
||||
void operator()(const SparseSelfAdjointView<SrcType, SrcUpLo>& mat, PermutationType& perm) {
|
||||
void operator()(const SparseSelfAdjointView<SrcType, SrcUpLo>& mat, PermutationType& perm) const {
|
||||
SparseMatrix<typename SrcType::Scalar, ColMajor, StorageIndex> C;
|
||||
C = mat;
|
||||
|
||||
@@ -90,7 +90,7 @@ class NaturalOrdering {
|
||||
|
||||
/** Compute the permutation vector from a column-major sparse matrix */
|
||||
template <typename MatrixType>
|
||||
void operator()(const MatrixType& /*mat*/, PermutationType& perm) {
|
||||
void operator()(const MatrixType& /*mat*/, PermutationType& perm) const {
|
||||
perm.resize(0);
|
||||
}
|
||||
};
|
||||
@@ -113,7 +113,7 @@ class COLAMDOrdering {
|
||||
* \warning The input sparse matrix \a mat must be in compressed mode (see SparseMatrix::makeCompressed()).
|
||||
*/
|
||||
template <typename MatrixType>
|
||||
void operator()(const MatrixType& mat, PermutationType& perm) {
|
||||
void operator()(const MatrixType& mat, PermutationType& perm) const {
|
||||
eigen_assert(mat.isCompressed() &&
|
||||
"COLAMDOrdering requires a sparse matrix in compressed mode. Call .makeCompressed() before passing it "
|
||||
"to COLAMDOrdering");
|
||||
|
||||
Reference in New Issue
Block a user