@@ -26,19 +26,12 @@ struct IterativeSolverVisitor
2626 using IS = IterativeSolver;
2727 using namespace nb ::literals;
2828 cl //
29- .def (
30- " solve" ,
31- [](const IS& self, Eigen::Ref<const VectorType> vec) -> VectorType {
32- return self.solve (vec);
33- },
34- " Returns the solution x of Ax = b using the current decomposition "
35- " of A." )
36- .def (
37- " solve" ,
38- [](const IS& self, Eigen::Ref<const DenseMatrix> mat)
39- -> DenseMatrix { return self.solve (mat); },
40- " Returns the solution x of Ax = b using the current decomposition "
41- " of A." )
29+ .def (" solve" , &solve<VectorType>,
30+ " Returns the solution x of Ax = b using the current decomposition "
31+ " of A." )
32+ .def (" solve" , &solve<DenseMatrix>,
33+ " Returns the solution x of Ax = b using the current decomposition "
34+ " of A." )
4235 .def (" error" , &IS::error,
4336 " Returns the tolerance error reached during the last solve.\n "
4437 " It is a close approximation of the true relative residual error "
@@ -119,7 +112,12 @@ struct IterativeSolverVisitor
119112 }
120113
121114 template <typename T>
122- static T solveWithGuess (IterativeSolver& self, Eigen::Ref<const T> b,
115+ static T solve (const IterativeSolver& self, Eigen::Ref<const T> b) {
116+ return self.solve (b);
117+ }
118+
119+ template <typename T>
120+ static T solveWithGuess (const IterativeSolver& self, Eigen::Ref<const T> b,
123121 Eigen::Ref<const T> x0) {
124122 return self.solveWithGuess (b, x0);
125123 }
0 commit comments