33 :
public boost::python::def_visitor<DelassusOperatorBasePythonVisitor<DelassusOperator>>
35 typedef DelassusOperator Self;
36 typedef typename DelassusOperator::Scalar Scalar;
37 typedef context::MatrixXs MatrixXs;
38 typedef context::VectorXs VectorXs;
39 typedef typename traits<DelassusOperator>::getDampingReturnType getDampingReturnType;
41 template<
class PyClass>
42 void visit(PyClass & cl)
const 44 cl.def(bp::self * bp::other<MatrixXs>())
47 +[](
const DelassusOperator & self,
const MatrixXs & other) -> MatrixXs {
48 return MatrixXs(self * other);
50 bp::args(
"self",
"other"),
51 "Matrix multiplication between self and another matrix. Returns the result of Delassus " 55 "solve", &DelassusOperator::template solve<MatrixXs>, bp::args(
"self",
"mat"),
56 "Returns the solution x of Delassus * x = mat using the current decomposition of the " 61 (
void (DelassusOperator::*)(
const Scalar))&DelassusOperator::updateCompliance,
62 bp::args(
"self",
"mu"),
63 "Add a compliance term to the diagonal of the Delassus matrix. The compliance term " 67 "updateCompliance", &DelassusOperator::template updateCompliance<VectorXs>,
68 bp::args(
"self",
"mus"),
69 "Add a compliance term to the diagonal of the Delassus matrix. The compliance terms " 75 +[](
const DelassusOperator & self) -> VectorXs {
return self.getCompliance(); },
77 "Returns the value of the compliance terms contained in the Delassus operator")
81 (
void (DelassusOperator::*)(
const Scalar))&DelassusOperator::updateDamping,
82 bp::args(
"self",
"mu"),
83 "Add a damping term to the diagonal of the Delassus matrix. The damping term should be " 86 "updateDamping", &DelassusOperator::template updateDamping<VectorXs>,
87 bp::args(
"self",
"mus"),
88 "Add a damping term to the diagonal of the Delassus matrix. The damping terms should " 93 +[](
const DelassusOperator & self) -> std::remove_reference_t<getDampingReturnType> {
94 return self.getDamping();
97 "Returns the value of the damping terms contained in the Delassus operator")
99 "inverse", &DelassusOperator::inverse, bp::arg(
"self"),
100 "Returns the inverse of the Delassus expression as a dense matrix.")
103 "size", &DelassusOperator::size, bp::arg(
"self"),
104 "Returns the size of the decomposition.")
105 .def(
"rows", &DelassusOperator::rows, bp::arg(
"self"),
"Returns the number of rows.")
106 .def(
"cols", &DelassusOperator::cols, bp::arg(
"self"),
"Returns the number of columns.");
107 if constexpr (details::is_matrix_bool_bool_method<DelassusOperator>)
111 static_cast<MatrixXs (DelassusOperator::*)(
bool,
bool) const
>(
112 &DelassusOperator::matrix),
113 (bp::arg(
"self"), bp::arg(
"enforce_symmetry") =
false, bp::arg(
"with_damping") =
true),
114 "Returns the Delassus expression as a dense matrix.");