17 :
public bp::def_visitor<PreconditionerBaseVisitor<Preconditioner>> {
18 typedef Eigen::MatrixXd MatrixType;
19 typedef Eigen::VectorXd VectorType;
21 template <
class PyClass>
22 void visit(PyClass& cl)
const {
23 cl.def(bp::init<>(
"Default constructor"))
24 .def(bp::init<MatrixType>(bp::args(
"self",
"A"),
25 "Initialize the preconditioner with matrix A " 26 "for further Az=b solving."))
27#if EIGEN_VERSION_AT_LEAST(3, 3, 0) 28 .def(
"info", &Preconditioner::info,
29 "Returns success if the Preconditioner has been well initialized.")
31 .def(
"solve", &solve, bp::arg(
"b"),
32 "Returns the solution A * z = b where the preconditioner is an " 35 .def(
"compute", &Preconditioner::template compute<MatrixType>,
37 "Initialize the preconditioner from the matrix value.",
38 bp::return_value_policy<bp::reference_existing_object>())
39 .def(
"factorize", &Preconditioner::template factorize<MatrixType>,
41 "Initialize the preconditioner from the matrix value, i.e " 42 "factorize the mat given as input to approximate its inverse.",
43 bp::return_value_policy<bp::reference_existing_object>());
47 static VectorType solve(Preconditioner& self,
const VectorType& b) {