GCC Code Coverage Report


Directory: ./
File: bindings/python/algorithm/expose-cholesky.cpp
Date: 2025-04-30 16:14:33
Exec Total Coverage
Lines: 13 13 100.0%
Branches: 9 18 50.0%

Line Branch Exec Source
1 //
2 // Copyright (c) 2019-2020 CNRS INRIA
3 //
4
5 #include "pinocchio/bindings/python/algorithm/algorithms.hpp"
6 #include "pinocchio/bindings/python/utils/namespace.hpp"
7 #include "pinocchio/algorithm/cholesky.hpp"
8
9 #include "pinocchio/bindings/python/utils/model-checker.hpp"
10
11 namespace pinocchio
12 {
13 namespace python
14 {
15
16 72 void exposeCholesky()
17 {
18 using namespace Eigen;
19 using namespace pinocchio::cholesky;
20
21 {
22 typedef context::Scalar Scalar;
23 typedef context::VectorXs VectorXs;
24 enum
25 {
26 Options = context::Options
27 };
28
29 // using the cholesky scope
30
3/6
✓ Branch 2 taken 72 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 72 times.
✗ Branch 6 not taken.
✓ Branch 8 taken 72 times.
✗ Branch 9 not taken.
144 bp::scope current_scope = getOrCreatePythonNamespace("cholesky");
31
32
1/2
✓ Branch 1 taken 72 times.
✗ Branch 2 not taken.
72 bp::def(
33 "decompose", &decompose<Scalar, Options, JointCollectionDefaultTpl>,
34
1/2
✓ Branch 1 taken 72 times.
✗ Branch 2 not taken.
144 bp::args("Model", "Data"),
35 "Computes the Cholesky decomposition of the joint space inertia matrix M contained "
36 "in data.\n"
37 "The upper triangular part of data.M should have been filled first by calling "
38 "crba, or any related algorithms.",
39 72 mimic_not_supported_function<bp::return_value_policy<bp::return_by_value>>(0));
40
41
1/2
✓ Branch 1 taken 72 times.
✗ Branch 2 not taken.
72 bp::def(
42 "solve", &solve<Scalar, Options, JointCollectionDefaultTpl, VectorXs>,
43
1/2
✓ Branch 1 taken 72 times.
✗ Branch 2 not taken.
144 bp::args("Model", "Data", "v"),
44 "Returns the solution \f$x\f$ of \f$ M x = y \f$ using the Cholesky decomposition "
45 "stored in data given the entry \f$ y \f$.",
46 72 mimic_not_supported_function<bp::return_value_policy<bp::return_by_value>>(0));
47
48
1/2
✓ Branch 1 taken 72 times.
✗ Branch 2 not taken.
72 bp::def(
49 "computeMinv", &computeMinv<Scalar, Options, JointCollectionDefaultTpl>,
50
1/2
✓ Branch 1 taken 72 times.
✗ Branch 2 not taken.
144 bp::args("Model", "Data"),
51 "Returns the inverse of the joint space inertia matrix using the results of the "
52 "Cholesky decomposition\n"
53 "performed by cholesky.decompose. The result is stored in data.Minv.",
54 72 mimic_not_supported_function<bp::return_value_policy<bp::return_by_value>>(0));
55 72 }
56 72 }
57
58 } // namespace python
59 } // namespace pinocchio
60