19 :
public boost::python::def_visitor<ComplexSchurVisitor<_MatrixType>> {
20 typedef _MatrixType MatrixType;
21 typedef typename MatrixType::Scalar Scalar;
22 typedef Eigen::ComplexSchur<MatrixType> Solver;
24 template <
class PyClass>
25 void visit(PyClass& cl)
const {
26 cl.def(bp::init<Eigen::DenseIndex>(bp::arg(
"size"),
"Default constructor"))
27 .def(bp::init<MatrixType, bp::optional<bool>>(
28 bp::args(
"matrix",
"computeU"),
"Computes Schur of given matrix"))
30 .def(
"matrixU", &Solver::matrixU, bp::arg(
"self"),
31 "Returns the unitary matrix in the Schur decomposition. ",
32 bp::return_value_policy<bp::copy_const_reference>())
33 .def(
"matrixT", &Solver::matrixT, bp::arg(
"self"),
34 "Returns the triangular matrix in the Schur decomposition. ",
35 bp::return_value_policy<bp::copy_const_reference>())
37 .def(
"compute", &ComplexSchurVisitor::compute_proxy<MatrixType>,
38 bp::args(
"self",
"matrix"),
"Computes the Schur of given matrix.",
42 (Solver::*)(
const Eigen::EigenBase<MatrixType>& matrix,
bool)) &
44 bp::args(
"self",
"matrix",
"computeU"),
45 "Computes the Schur of given matrix.", bp::return_self<>())
47 .def(
"computeFromHessenberg",
48 (Solver & (Solver::*)(
const Eigen::EigenBase<MatrixType>& matrixH,
49 const Eigen::EigenBase<MatrixType>& matrixQ,
51 Solver::computeFromHessenberg,
52 bp::args(
"self",
"matrixH",
"matrixQ",
"computeU"),
53 "Compute Schur decomposition from a given Hessenberg matrix. ",
56 .def(
"info", &Solver::info, bp::arg(
"self"),
57 "NumericalIssue if the input contains INF or NaN values or " 58 "overflow occured. Returns Success otherwise.")
60 .def(
"getMaxIterations", &Solver::getMaxIterations, bp::arg(
"self"),
61 "Returns the maximum number of iterations.")
62 .def(
"setMaxIterations", &Solver::setMaxIterations,
63 bp::args(
"self",
"max_iter"),
64 "Sets the maximum number of iterations allowed.",
69 static const std::string classname =
70 "ComplexSchur" + scalar_name<Scalar>::shortname();
74 static void expose(
const std::string& name) {
75 bp::class_<Solver>(name.c_str(), bp::no_init)
81 template <
typename MatrixType>
82 static Solver& compute_proxy(Solver& self,
83 const Eigen::EigenBase<MatrixType>& matrix) {
84 return self.compute(matrix);