19 :
public boost::python::def_visitor<RealSchurVisitor<_MatrixType>> {
20 typedef _MatrixType MatrixType;
21 typedef typename MatrixType::Scalar Scalar;
22 typedef Eigen::RealSchur<MatrixType> Solver;
24 template <
class PyClass>
25 void visit(PyClass& cl)
const {
27 bp::init<Eigen::DenseIndex>(bp::arg(
"size"),
"Default constructor. "))
28 .def(bp::init<MatrixType, bp::optional<bool>>(
29 bp::args(
"matrix",
"computeU"),
30 "Constructor; computes real Schur decomposition of given matrix. "))
32 .def(
"compute", &RealSchurVisitor::compute_proxy<MatrixType>,
33 bp::args(
"self",
"matrix"),
34 "Computes Schur decomposition of given matrix. ",
38 (Solver::*)(
const Eigen::EigenBase<MatrixType>& matrix,
bool)) &
40 bp::args(
"self",
"matrix",
"computeEigenvectors"),
41 "Computes Schur decomposition of given matrix. ",
44 .def(
"computeFromHessenberg",
45 (Solver & (Solver::*)(
const MatrixType& matrixH,
46 const MatrixType& matrixQ,
bool)) &
47 Solver::computeFromHessenberg,
48 bp::args(
"self",
"matrixH",
"matrixQ",
"computeU"),
49 "Compute Schur decomposition from a given Hessenberg 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(
"matrixT", &Solver::matrixT, bp::arg(
"self"),
57 "Returns the quasi-triangular matrix in the Schur decomposition.",
58 bp::return_value_policy<bp::copy_const_reference>())
59 .def(
"matrixU", &Solver::matrixU, bp::arg(
"self"),
60 "Returns the orthogonal matrix in the Schur decomposition. ",
61 bp::return_value_policy<bp::copy_const_reference>())
63 .def(
"setMaxIterations", &Solver::setMaxIterations,
64 bp::args(
"self",
"max_iter"),
65 "Sets the maximum number of iterations allowed.",
67 .def(
"getMaxIterations", &Solver::getMaxIterations, bp::arg(
"self"),
68 "Returns the maximum number of iterations.");
72 static const std::string classname =
73 "RealSchurVisitor" + scalar_name<Scalar>::shortname();
77 static void expose(
const std::string& name) {
78 bp::class_<Solver>(name.c_str(), bp::no_init)
84 template <
typename MatrixType>
85 static Solver& compute_proxy(Solver& self,
const MatrixType& A) {
86 return self.compute(A);