Skip to content

Commit 1c58d59

Browse files
committed
Add const in some lambda functions on Solver& to stick to definition
1 parent 4996734 commit 1c58d59

File tree

3 files changed

+15
-6
lines changed

3 files changed

+15
-6
lines changed

include/eigenpy/decompositions/SelfAdjointEigenSolver.hpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,16 @@ struct SelfAdjointEigenSolverVisitor
3535

3636
.def(
3737
"eigenvalues",
38-
+[](Solver& c) -> const VectorType& { return c.eigenvalues(); },
38+
+[](const Solver& c) -> const VectorType& {
39+
return c.eigenvalues();
40+
},
3941
"Returns the eigenvalues of given matrix.",
4042
bp::return_internal_reference<>())
4143
.def(
4244
"eigenvectors",
43-
+[](Solver& c) -> const MatrixType& { return c.eigenvectors(); },
45+
+[](const Solver& c) -> const MatrixType& {
46+
return c.eigenvectors();
47+
},
4448
"Returns the eigenvectors of given matrix.",
4549
bp::return_internal_reference<>())
4650

include/eigenpy/decompositions/Tridiagonalization.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ struct TridiagonalizationVisitor : public boost::python::def_visitor<
4949
+[](const Solver &c) -> MatrixType { return c.matrixQ(); },
5050
"Returns the unitary matrix Q in the decomposition.")
5151
.def(
52-
"matrixT", +[](Solver &c) -> MatrixType { return c.matrixT(); },
52+
"matrixT",
53+
+[](const Solver &c) -> MatrixType { return c.matrixT(); },
5354
"Returns an expression of the tridiagonal matrix T in the "
5455
"decomposition.")
5556

include/eigenpy/solvers/IncompleteCholesky.hpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,19 @@ struct IncompleteCholeskyVisitor : public boost::python::def_visitor<
6363

6464
.def(
6565
"matrixL",
66-
+[](Solver& self) -> const FactorType& { return self.matrixL(); },
66+
+[](const Solver& self) -> const FactorType& {
67+
return self.matrixL();
68+
},
6769
bp::return_value_policy<bp::copy_const_reference>())
6870
.def(
6971
"scalingS",
70-
+[](Solver& self) -> const VectorRx& { return self.scalingS(); },
72+
+[](const Solver& self) -> const VectorRx& {
73+
return self.scalingS();
74+
},
7175
bp::return_value_policy<bp::copy_const_reference>())
7276
.def(
7377
"permutationP",
74-
+[](Solver& self) -> const PermutationType& {
78+
+[](const Solver& self) -> const PermutationType& {
7579
return self.permutationP();
7680
},
7781
bp::return_value_policy<bp::copy_const_reference>())

0 commit comments

Comments
 (0)