5 #ifndef __pinocchio_python_math_lanczos_decomposition_hpp__
6 #define __pinocchio_python_math_lanczos_decomposition_hpp__
20 template<
typename LanczosDecomposition>
22 :
public boost::python::def_visitor<LanczosDecompositionPythonVisitor<LanczosDecomposition>>
26 typedef typename LanczosDecomposition::PlainMatrix
PlainMatrix;
29 template<
class PyClass>
34 cl.def(bp::init<const context::MatrixXs &, const Eigen::DenseIndex>(
35 (bp::arg(
"self"), bp::arg(
"mat"), bp::arg(
"decomposition_size")),
36 "Default constructor from a given matrix and a given decomposition size."))
39 "compute", &LanczosDecomposition::template compute<context::MatrixXs>,
40 bp::args(
"self",
"mat"),
41 "Computes the Lanczos decomposition for the given input matrix.")
44 "Ts", (
TridiagonalMatrix & (LanczosDecomposition::*)()) & LanczosDecomposition::Ts,
46 "Returns the tridiagonal matrix associated with the Lanczos decomposition.",
47 bp::return_internal_reference<>())
49 "Qs", (
PlainMatrix & (LanczosDecomposition::*)()) & LanczosDecomposition::Qs,
51 "Returns the orthogonal basis associated with the Lanczos decomposition.",
52 bp::return_internal_reference<>())
55 "rank", &LanczosDecomposition::rank, bp::arg(
"self"),
56 "Returns the rank of the decomposition.")
59 "computeDecompositionResidual",
60 &LanczosDecomposition::template computeDecompositionResidual<context::MatrixXs>,
61 bp::args(
"self",
"mat"),
62 "Computes the residual associated with the decomposition, namely, the quantity \f$ "
63 "A Q_s - Q_s T_s \f$")
65 #ifndef PINOCCHIO_PYTHON_SKIP_COMPARISON_OPERATIONS
66 .def(bp::self == bp::self)
67 .def(bp::self != bp::self)
75 #if PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION == 6 && EIGENPY_VERSION_AT_LEAST(2, 9, 0)
78 typedef ::boost::python::detail::not_specified HolderType;
80 bp::class_<LanczosDecomposition, HolderType>(
81 "LanczosDecomposition",
"Lanczos decomposition.", bp::no_init)
89 #endif // ifndef __pinocchio_python_math_lanczos_decomposition_hpp__