pinocchio  2.4.4
A fast and flexible implementation of Rigid Body Dynamics algorithms and their analytical derivatives
cholesky.hpp
1 //
2 // Copyright (c) 2015-2019 CNRS INRIA
3 //
4 
5 #ifndef __pinocchio_cholesky_hpp__
6 #define __pinocchio_cholesky_hpp__
7 
8 #include "pinocchio/multibody/model.hpp"
9 #include "pinocchio/multibody/data.hpp"
10 
11 namespace pinocchio
12 {
13  namespace cholesky
14  {
15 
34  template<typename Scalar, int Options, template<typename,int> class JointCollectionTpl>
35  inline const typename DataTpl<Scalar,Options,JointCollectionTpl>::MatrixXs &
36  decompose(const ModelTpl<Scalar,Options,JointCollectionTpl> & model,
37  DataTpl<Scalar,Options,JointCollectionTpl> & data);
38 
53  template<typename Scalar, int Options, template<typename,int> class JointCollectionTpl, typename Mat>
54  Mat & solve(const ModelTpl<Scalar,Options,JointCollectionTpl> & model,
55  const DataTpl<Scalar,Options,JointCollectionTpl> & data,
56  const Eigen::MatrixBase<Mat> & y);
57 
69  template<typename Scalar, int Options, template<typename,int> class JointCollectionTpl, typename Mat>
70  typename PINOCCHIO_EIGEN_PLAIN_TYPE(Mat)
71  Mv(const ModelTpl<Scalar,Options,JointCollectionTpl> & model,
72  const DataTpl<Scalar,Options,JointCollectionTpl> & data,
73  const Eigen::MatrixBase<Mat> & min);
74 
87  template<typename Scalar, int Options, template<typename,int> class JointCollectionTpl, typename Mat, typename MatRes>
88  MatRes & Mv(const ModelTpl<Scalar,Options,JointCollectionTpl> & model,
89  const DataTpl<Scalar,Options,JointCollectionTpl> & data,
90  const Eigen::MatrixBase<Mat> & min,
91  const Eigen::MatrixBase<MatRes> & mout);
92 
93 
105  template<typename Scalar, int Options, template<typename,int> class JointCollectionTpl, typename Mat>
106  Mat & UDUtv(const ModelTpl<Scalar,Options,JointCollectionTpl> & model,
107  const DataTpl<Scalar,Options,JointCollectionTpl> & data,
108  const Eigen::MatrixBase<Mat> & m);
109 
121  template<typename Scalar, int Options, template<typename,int> class JointCollectionTpl, typename Mat>
122  Mat & Uv(const ModelTpl<Scalar,Options,JointCollectionTpl> & model,
123  const DataTpl<Scalar,Options,JointCollectionTpl> & data,
124  const Eigen::MatrixBase<Mat> & v);
125 
137  template<typename Scalar, int Options, template<typename,int> class JointCollectionTpl, typename Mat>
138  Mat & Utv(const ModelTpl<Scalar,Options,JointCollectionTpl> & model,
139  const DataTpl<Scalar,Options,JointCollectionTpl> & data,
140  const Eigen::MatrixBase<Mat> & v);
141 
155  template<typename Scalar, int Options, template<typename,int> class JointCollectionTpl, typename Mat>
156  Mat & Uiv(const ModelTpl<Scalar,Options,JointCollectionTpl> & model,
157  const DataTpl<Scalar,Options,JointCollectionTpl> & data ,
158  const Eigen::MatrixBase<Mat> & v);
159 
173  template<typename Scalar, int Options, template<typename,int> class JointCollectionTpl, typename Mat>
174  Mat & Utiv(const ModelTpl<Scalar,Options,JointCollectionTpl> & model,
175  const DataTpl<Scalar,Options,JointCollectionTpl> & data ,
176  const Eigen::MatrixBase<Mat> & v);
177 
189  template<typename Scalar, int Options, template<typename,int> class JointCollectionTpl, typename Mat>
190  Mat & solve(const ModelTpl<Scalar,Options,JointCollectionTpl> & model,
191  const DataTpl<Scalar,Options,JointCollectionTpl> & data ,
192  const Eigen::MatrixBase<Mat> & v);
193 
205  template<typename Scalar, int Options, template<typename,int> class JointCollectionTpl, typename Mat>
206  Mat & computeMinv(const ModelTpl<Scalar,Options,JointCollectionTpl> & model,
207  const DataTpl<Scalar,Options,JointCollectionTpl> & data,
208  const Eigen::MatrixBase<Mat> & Minv);
209 
221  template<typename Scalar, int Options, template<typename,int> class JointCollectionTpl>
222  const typename DataTpl<Scalar,Options,JointCollectionTpl>::RowMatrixXs &
225  {
226  return computeMinv(model,data,data.Minv);
227  }
228 
229  } // namespace cholesky
230 } // namespace pinocchio
231 
232 /* --- Details -------------------------------------------------------------------- */
233 /* --- Details -------------------------------------------------------------------- */
234 /* --- Details -------------------------------------------------------------------- */
235 #include "pinocchio/algorithm/cholesky.hxx"
236 
237 #endif // ifndef __pinocchio_cholesky_hpp__
RowMatrixXs Minv
The inverse of the joint space inertia matrix (a square matrix of dim model.nv).
Definition: data.hpp:154
Mat & computeMinv(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, const DataTpl< Scalar, Options, JointCollectionTpl > &data, const Eigen::MatrixBase< Mat > &Minv)
Computes the inverse of the joint space inertia matrix M from its Cholesky factorization.
const DataTpl< Scalar, Options, JointCollectionTpl >::MatrixXs & decompose(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, DataTpl< Scalar, Options, JointCollectionTpl > &data)
Compute the Cholesky decomposition of the joint space inertia matrix M contained in data...
Mat & Utiv(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, const DataTpl< Scalar, Options, JointCollectionTpl > &data, const Eigen::MatrixBase< Mat > &v)
Perform the pivot inversion using the Cholesky decomposition stored in data and acting in place...
Mat & solve(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, const DataTpl< Scalar, Options, JointCollectionTpl > &data, const Eigen::MatrixBase< Mat > &y)
Return the solution of using the Cholesky decomposition stored in data given the entry ...
Mat & Uv(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, const DataTpl< Scalar, Options, JointCollectionTpl > &data, const Eigen::MatrixBase< Mat > &v)
Perform the sparse multiplication using the Cholesky decomposition stored in data and acting in plac...
Main pinocchio namespace.
Definition: treeview.dox:24
Mat & UDUtv(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, const DataTpl< Scalar, Options, JointCollectionTpl > &data, const Eigen::MatrixBase< Mat > &m)
Performs the multiplication by using the Cholesky decomposition of M stored in data.
Mat & Uiv(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, const DataTpl< Scalar, Options, JointCollectionTpl > &data, const Eigen::MatrixBase< Mat > &v)
Perform the pivot inversion using the Cholesky decomposition stored in data and acting in place...
Mat Mv(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, const DataTpl< Scalar, Options, JointCollectionTpl > &data, const Eigen::MatrixBase< Mat > &min)
Performs the multiplication by using the sparsity pattern of the M matrix.
Mat & Utv(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, const DataTpl< Scalar, Options, JointCollectionTpl > &data, const Eigen::MatrixBase< Mat > &v)
Perform the sparse multiplication using the Cholesky decomposition stored in data and acting in plac...