| Directory: | ./ |
|---|---|
| File: | include/pinocchio/autodiff/casadi/math/matrix.hpp |
| Date: | 2025-02-12 21:03:38 |
| Exec | Total | Coverage | |
|---|---|---|---|
| Lines: | 6 | 6 | 100.0% |
| Branches: | 4 | 8 | 50.0% |
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | // | ||
| 2 | // Copyright (c) 2019-2020 INRIA | ||
| 3 | // | ||
| 4 | |||
| 5 | #ifndef __pinocchio_autodiff_casadi_math_matrix_hpp__ | ||
| 6 | #define __pinocchio_autodiff_casadi_math_matrix_hpp__ | ||
| 7 | |||
| 8 | #include "pinocchio/math/matrix.hpp" | ||
| 9 | |||
| 10 | namespace pinocchio | ||
| 11 | { | ||
| 12 | namespace internal | ||
| 13 | { | ||
| 14 | template<typename Scalar> | ||
| 15 | struct CallCorrectMatrixInverseAccordingToScalar<::casadi::Matrix<Scalar>> | ||
| 16 | { | ||
| 17 | typedef ::casadi::Matrix<Scalar> SX; | ||
| 18 | template<typename MatrixIn, typename MatrixOut> | ||
| 19 | static void | ||
| 20 | 220 | run(const Eigen::MatrixBase<MatrixIn> & mat, const Eigen::MatrixBase<MatrixOut> & dest) | |
| 21 | { | ||
| 22 |
1/2✓ Branch 3 taken 110 times.
✗ Branch 4 not taken.
|
220 | SX cs_mat(mat.rows(), mat.cols()); |
| 23 |
1/2✓ Branch 2 taken 110 times.
✗ Branch 3 not taken.
|
220 | casadi::copy(mat.derived(), cs_mat); |
| 24 | |||
| 25 |
1/2✓ Branch 1 taken 110 times.
✗ Branch 2 not taken.
|
220 | SX cs_mat_inv = SX::inv(cs_mat); |
| 26 | |||
| 27 | 220 | MatrixOut & dest_ = PINOCCHIO_EIGEN_CONST_CAST(MatrixOut, dest); | |
| 28 |
1/2✓ Branch 1 taken 110 times.
✗ Branch 2 not taken.
|
220 | casadi::copy(cs_mat_inv, dest_); |
| 29 | } | ||
| 30 | }; | ||
| 31 | } // namespace internal | ||
| 32 | } // namespace pinocchio | ||
| 33 | |||
| 34 | #endif // ifndef __pinocchio_autodiff_casadi_math_matrix_hpp__ | ||
| 35 |