math/triangular-matrix.hpp
Go to the documentation of this file.
1 //
2 // Copyright (c) 2022-2023 INRIA
3 //
4 
5 #ifndef __pinocchio_math_triangular_matrix_hpp__
6 #define __pinocchio_math_triangular_matrix_hpp__
7 
8 #include "pinocchio/macros.hpp"
9 
10 #include <Eigen/Dense>
11 
12 namespace pinocchio
13 {
14 
15  namespace internal
16  {
17  template<
18  Eigen::UpLoType info,
19  typename RhsMatrix,
20  typename Scalar = typename RhsMatrix::Scalar,
21  bool is_vector_at_compile_time = RhsMatrix::IsVectorAtCompileTime>
23  {
24  template<typename LhsMatrix, typename ResMat>
25  static void run(
26  const Eigen::MatrixBase<LhsMatrix> & lhs_mat,
27  const Eigen::MatrixBase<RhsMatrix> & rhs_vec,
28  const Eigen::MatrixBase<ResMat> & res)
29  {
30  res.const_cast_derived().col(0).noalias() =
31  lhs_mat.derived().template triangularView<info>() * rhs_vec.derived();
32  }
33  };
34 
35  template<Eigen::UpLoType info, typename RhsMatrix, typename Scalar>
36  struct TriangularMatrixMatrixProduct<info, RhsMatrix, Scalar, false>
37  {
38  template<typename LhsMatrix, typename ResMat>
39  static void run(
40  const Eigen::MatrixBase<LhsMatrix> & lhs_mat,
41  const Eigen::MatrixBase<RhsMatrix> & rhs_mat,
42  const Eigen::MatrixBase<ResMat> & res)
43  {
44  res.const_cast_derived().noalias() =
45  lhs_mat.derived().template triangularView<info>() * rhs_mat.derived();
46  }
47  };
48  } // namespace internal
49 
58  template<Eigen::UpLoType info, typename LhsMatrix, typename RhsMatrix, typename ResMat>
60  const Eigen::MatrixBase<LhsMatrix> & lhs_mat,
61  const Eigen::MatrixBase<RhsMatrix> & rhs_mat,
62  const Eigen::MatrixBase<ResMat> & res)
63  {
65  lhs_mat.derived(), rhs_mat.derived(), res.const_cast_derived());
66  }
67 
68 } // namespace pinocchio
69 
70 #endif // #ifndef __pinocchio_math_triangular_matrix_hpp__
pinocchio::internal::TriangularMatrixMatrixProduct< info, RhsMatrix, Scalar, false >::run
static void run(const Eigen::MatrixBase< LhsMatrix > &lhs_mat, const Eigen::MatrixBase< RhsMatrix > &rhs_mat, const Eigen::MatrixBase< ResMat > &res)
Definition: math/triangular-matrix.hpp:39
pinocchio::triangularMatrixMatrixProduct
void triangularMatrixMatrixProduct(const Eigen::MatrixBase< LhsMatrix > &lhs_mat, const Eigen::MatrixBase< RhsMatrix > &rhs_mat, const Eigen::MatrixBase< ResMat > &res)
Evaluate the product of a triangular matrix times a matrix. Eigen showing a bug at this level,...
Definition: math/triangular-matrix.hpp:59
macros.hpp
pinocchio::python::Scalar
context::Scalar Scalar
Definition: admm-solver.cpp:29
pinocchio::internal::TriangularMatrixMatrixProduct::run
static void run(const Eigen::MatrixBase< LhsMatrix > &lhs_mat, const Eigen::MatrixBase< RhsMatrix > &rhs_vec, const Eigen::MatrixBase< ResMat > &res)
Definition: math/triangular-matrix.hpp:25
pinocchio::res
ReturnType res
Definition: spatial/classic-acceleration.hpp:57
ocp.info
info
Definition: ocp.py:80
pinocchio::internal::TriangularMatrixMatrixProduct
Definition: math/triangular-matrix.hpp:22
pinocchio
Main pinocchio namespace.
Definition: timings.cpp:27


pinocchio
Author(s):
autogenerated on Sun Dec 22 2024 03:41:12