19 ComplexEigenSolverVisitor<_MatrixType>> {
20 typedef _MatrixType MatrixType;
21 typedef typename MatrixType::Scalar Scalar;
22 typedef Eigen::ComplexEigenSolver<MatrixType> Solver;
24 template <
class PyClass>
25 void visit(PyClass& cl)
const {
26 cl.def(bp::init<>(
"Default constructor"))
27 .def(bp::init<Eigen::DenseIndex>(
28 bp::arg(
"size"),
"Default constructor with memory preallocation"))
29 .def(bp::init<MatrixType, bp::optional<bool>>(
30 bp::args(
"matrix",
"compute_eigen_vectors"),
31 "Computes eigendecomposition of given matrix"))
33 .def(
"eigenvalues", &Solver::eigenvalues, bp::arg(
"self"),
34 "Returns the eigenvalues of given matrix.",
35 bp::return_internal_reference<>())
36 .def(
"eigenvectors", &Solver::eigenvectors, bp::arg(
"self"),
37 "Returns the eigenvectors of given matrix.",
38 bp::return_internal_reference<>())
40 .def(
"compute", &ComplexEigenSolverVisitor::compute_proxy<MatrixType>,
41 bp::args(
"self",
"matrix"),
42 "Computes the eigendecomposition of given matrix.",
46 (Solver::*)(
const Eigen::EigenBase<MatrixType>& matrix,
bool)) &
48 bp::args(
"self",
"matrix",
"compute_eigen_vectors"),
49 "Computes the eigendecomposition of given matrix.",
52 .def(
"info", &Solver::info, bp::arg(
"self"),
53 "NumericalIssue if the input contains INF or NaN values or " 54 "overflow occured. Returns Success otherwise.")
56 .def(
"getMaxIterations", &Solver::getMaxIterations, bp::arg(
"self"),
57 "Returns the maximum number of iterations.")
58 .def(
"setMaxIterations", &Solver::setMaxIterations,
59 bp::args(
"self",
"max_iter"),
60 "Sets the maximum number of iterations allowed.",
65 static const std::string classname =
66 "ComplexEigenSolver" + scalar_name<Scalar>::shortname();
70 static void expose(
const std::string& name) {
71 bp::class_<Solver>(name.c_str(), bp::no_init)
77 template <
typename MatrixType>
78 static Solver& compute_proxy(Solver& self,
79 const Eigen::EigenBase<MatrixType>& matrix) {
80 return self.compute(matrix);