5 #ifndef __eigenpy_decomposition_self_adjoint_eigen_solver_hpp__ 6 #define __eigenpy_decomposition_self_adjoint_eigen_solver_hpp__ 12 #include <Eigen/Eigenvalues> 19 template<
typename _MatrixType>
21 :
public boost::python::def_visitor< SelfAdjointEigenSolverVisitor<_MatrixType> >
25 typedef typename MatrixType::Scalar
Scalar;
26 typedef Eigen::SelfAdjointEigenSolver<MatrixType>
Solver;
28 template<
class PyClass>
33 .def(bp::init<>(
"Default constructor"))
34 .def(bp::init<Eigen::DenseIndex>(bp::arg(
"size"),
35 "Default constructor with memory preallocation"))
36 .def(bp::init<MatrixType,bp::optional<int> >(bp::args(
"matrix",
"options"),
37 "Computes eigendecomposition of given matrix"))
39 .def(
"eigenvalues",&Solver::eigenvalues,bp::arg(
"self"),
40 "Returns the eigenvalues of given matrix.",
41 bp::return_internal_reference<>())
42 .def(
"eigenvectors",&Solver::eigenvectors,bp::arg(
"self"),
43 "Returns the eigenvectors of given matrix.",
44 bp::return_internal_reference<>())
46 .def(
"compute",&SelfAdjointEigenSolverVisitor::compute_proxy<MatrixType>,
47 bp::args(
"self",
"matrix"),
48 "Computes the eigendecomposition of given matrix.",
49 bp::return_value_policy<bp::reference_existing_object>())
50 .def(
"compute",(Solver & (Solver::*)(
const Eigen::EigenBase<MatrixType> &
matrix,
int options))&Solver::compute,
51 bp::args(
"self",
"matrix",
"options"),
52 "Computes the eigendecomposition of given matrix.",
56 bp::args(
"self",
"matrix"),
57 "Computes eigendecomposition of given matrix using a closed-form algorithm.",
59 .def(
"computeDirect",(Solver & (Solver::*)(
const MatrixType & matrix,
int options))&Solver::computeDirect,
60 bp::args(
"self",
"matrix",
"options"),
61 "Computes eigendecomposition of given matrix using a closed-form algorithm.",
64 .def(
"operatorInverseSqrt",&Solver::operatorInverseSqrt,bp::arg(
"self"),
65 "Computes the inverse square root of the matrix.")
66 .def(
"operatorSqrt",&Solver::operatorSqrt,bp::arg(
"self"),
67 "Computes the inverse square root of the matrix.")
69 .def(
"info",&Solver::info,bp::arg(
"self"),
70 "NumericalIssue if the input contains INF or NaN values or overflow occured. Returns Success otherwise.")
83 bp::class_<Solver>(name.c_str(),
90 template<
typename MatrixType>
93 return self.compute(matrix);
98 return self.computeDirect(matrix);
105 #endif // ifndef __eigenpy_decomposition_self_adjoint_eigen_solver_hpp__ static void expose(const std::string &name)
boost::python::object matrix()
static Solver & compute_proxy(Solver &self, const Eigen::EigenBase< MatrixType > &matrix)
static std::string shortname()
void visit(PyClass &cl) const
Eigen::SelfAdjointEigenSolver< MatrixType > Solver
static Solver & computeDirect_proxy(Solver &self, const MatrixType &matrix)
MatrixType::Scalar Scalar