19 :
public boost::python::def_visitor<
20 GeneralizedEigenSolverVisitor<_MatrixType>> {
21 typedef _MatrixType MatrixType;
22 typedef typename MatrixType::Scalar Scalar;
23 typedef Eigen::GeneralizedEigenSolver<MatrixType> Solver;
25 template <
class PyClass>
26 void visit(PyClass& cl)
const {
27 cl.def(bp::init<>(
"Default constructor"))
28 .def(bp::init<Eigen::DenseIndex>(
29 bp::arg(
"size"),
"Default constructor with memory preallocation. "))
30 .def(bp::init<MatrixType, MatrixType, bp::optional<bool>>(
31 bp::args(
"A",
"B",
"computeEigenVectors"),
32 "Computes the generalized eigendecomposition of given matrix " 35 .def(
"eigenvectors", &Solver::eigenvectors, bp::arg(
"self"),
36 "Returns an expression of the computed generalized eigenvectors. ")
39 +[](
const Solver& c) {
return c.eigenvalues().eval(); },
40 "Returns the computed generalized eigenvalues.")
42 .def(
"alphas", &Solver::alphas, bp::arg(
"self"),
43 "Returns the vectors containing the alpha values. ")
44 .def(
"betas", &Solver::betas, bp::arg(
"self"),
45 "Returns the vectors containing the beta values. ")
48 &GeneralizedEigenSolverVisitor::compute_proxy<MatrixType>,
49 bp::args(
"self",
"A",
"B"),
50 "Computes generalized eigendecomposition of given matrix. ",
54 (Solver::*)(
const MatrixType& A,
const MatrixType& B,
bool)) &
56 bp::args(
"self",
"A",
"B",
"computeEigenvectors"),
57 "Computes generalized eigendecomposition of given matrix. .",
60 .def(
"info", &Solver::info, bp::arg(
"self"),
61 "NumericalIssue if the input contains INF or NaN values or " 62 "overflow occured. Returns Success otherwise.")
64 .def(
"setMaxIterations", &Solver::setMaxIterations,
65 bp::args(
"self",
"max_iter"),
66 "Sets the maximum number of iterations allowed.",
71 static const std::string classname =
72 "GeneralizedEigenSolver" + scalar_name<Scalar>::shortname();
76 static void expose(
const std::string& name) {
77 bp::class_<Solver>(name.c_str(), bp::no_init)
83 template <
typename MatrixType>
84 static Solver& compute_proxy(Solver& self,
const MatrixType& A,
85 const MatrixType& B) {
86 return self.compute(A, B);