11 using Scalar =
typename LDLTtype::Scalar;
12 using VectorXs = Eigen::Matrix<Scalar, -1, 1, Eigen::ColMajor>;
13 using MatrixXs = Eigen::Matrix<Scalar, -1, -1, Eigen::ColMajor>;
15 static LDLTtype &compute_proxy(LDLTtype &fac,
16 const context::ConstMatrixRef &mat) {
17 return fac.compute(mat);
20 static bool solveInPlace_proxy(
const LDLTtype &fac,
21 context::MatrixRef rhsAndX) {
22 return fac.solveInPlace(rhsAndX);
25 template <
typename RhsType>
26 static auto solve(
const LDLTtype &fac, RhsType &rhs) {
27 return fac.solve(rhs);
30 template <
typename... Args>
void visit(bp::class_<Args...> &cl)
const {
31 cl.def(
"compute", compute_proxy, bp::return_internal_reference<>(),
33 .def(
"solveInPlace", solveInPlace_proxy, (
"self"_a,
"rhsAndX"))
34 .def(
"solve", solve<Eigen::Ref<const VectorXs>>, (
"self"_a,
"rhs"))
35 .def(
"solve", solve<Eigen::Ref<const MatrixXs>>, (
"self"_a,
"rhs"))
36 .def(
"matrixLDLT", &LDLTtype::matrixLDLT,
37 bp::return_value_policy<bp::return_by_value>(),
"self"_a,
38 "Get the current value of the decomposition matrix. This makes a "