5 #ifndef __pinocchio_python_math_tridiagonal_matrix_hpp__
6 #define __pinocchio_python_math_tridiagonal_matrix_hpp__
20 template<
typename Tr
idiagonalSymmetricMatrix>
22 :
public boost::python::def_visitor<
23 TridiagonalSymmetricMatrixPythonVisitor<TridiagonalSymmetricMatrix>>
30 template<
class PyClass>
33 static const Scalar dummy_precision = Eigen::NumTraits<Scalar>::dummy_precision();
35 cl.def(bp::init<Eigen::DenseIndex>(
36 (bp::arg(
"self"), bp::arg(
"size")),
"Default constructor from a given size."))
37 #ifndef PINOCCHIO_PYTHON_SKIP_COMPARISON_OPERATIONS
38 .def(bp::self == bp::self)
39 .def(bp::self != bp::self)
44 & TridiagonalSymmetricMatrix::diagonal,
46 "Reference of the diagonal elements of the symmetric tridiagonal matrix.",
47 bp::return_internal_reference<>())
51 & TridiagonalSymmetricMatrix::subDiagonal,
53 "Reference of the sub diagonal elements of the symmetric tridiagonal matrix.",
54 bp::return_internal_reference<>())
57 "setIdentity", &TridiagonalSymmetricMatrix::setIdentity, bp::arg(
"self"),
58 "Set the current tridiagonal matrix to identity.")
60 "setZero", &TridiagonalSymmetricMatrix::setZero, bp::arg(
"self"),
61 "Set the current tridiagonal matrix to zero.")
63 "setDiagonal", &TridiagonalSymmetricMatrix::template setDiagonal<CoeffVectorType>,
64 bp::args(
"self",
"diagonal"),
65 "Set the current tridiagonal matrix to a diagonal matrix given by the entry vector "
68 "setRandom", &TridiagonalSymmetricMatrix::setRandom, bp::arg(
"self"),
69 "Set the current tridiagonal matrix to random.")
70 #ifndef PINOCCHIO_PYTHON_SKIP_COMPARISON_OPERATIONS
72 "isIdentity", &TridiagonalSymmetricMatrix::isIdentity,
73 (bp::arg(
"self"), bp::arg(
"prec") = dummy_precision),
74 "Returns true if *this is approximately equal to the identity matrix, within the "
75 "precision given by prec.")
78 (bp::arg(
"self"), bp::arg(
"prec") = dummy_precision),
79 "Returns true if *this is approximately equal to the zero matrix, within the "
80 "precision given by prec.")
82 "isDiagonal", &TridiagonalSymmetricMatrix::isDiagonal,
83 (bp::arg(
"self"), bp::arg(
"prec") = dummy_precision),
84 "Returns true if *this is approximately equal to the a diagonal matrix, within the "
85 "precision given by prec.")
86 #endif // PINOCCHIO_PYTHON_SKIP_COMPARISON_OPERATIONS
87 .def(
"rows", &TridiagonalSymmetricMatrix::rows, bp::arg(
"self"))
88 .def(
"cols", &TridiagonalSymmetricMatrix::cols, bp::arg(
"self"))
89 .def(
"matrix", &TridiagonalSymmetricMatrix::matrix, bp::arg(
"self"))
97 #if PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION == 6 && EIGENPY_VERSION_AT_LEAST(2, 9, 0)
100 typedef ::boost::python::detail::not_specified HolderType;
102 bp::class_<TridiagonalSymmetricMatrix, HolderType>(
103 "TridiagonalSymmetricMatrix",
"Tridiagonal symmetric matrix.", bp::no_init)
111 #endif // ifndef __pinocchio_python_math_tridiagonal_matrix_hpp__