18 :
public bp::def_visitor<BFGSPreconditionerBaseVisitor<Preconditioner>> {
19 typedef Eigen::VectorXd VectorType;
20 template <
class PyClass>
21 void visit(PyClass& cl)
const {
23 .def(
"rows", &Preconditioner::rows,
24 "Returns the number of rows in the preconditioner.")
25 .def(
"cols", &Preconditioner::cols,
26 "Returns the number of cols in the preconditioner.")
27 .def(
"dim", &Preconditioner::dim,
28 "Returns the dimension of the BFGS preconditioner")
30 (
const Preconditioner& (Preconditioner::*)(
const VectorType&,
33 Preconditioner::update,
34 bp::args(
"s",
"y"),
"Update the BFGS estimate of the matrix A.",
35 bp::return_value_policy<bp::reference_existing_object>())
36 .def(
"reset", &Preconditioner::reset,
"Reset the BFGS estimate.");
39 static void expose(
const std::string& name) {
40 bp::class_<Preconditioner>(name, bp::no_init)