spatial/symmetric3.hpp
Go to the documentation of this file.
1 //
2 // Copyright (c) 2014-2021 CNRS INRIA
3 //
4 
5 #ifndef __pinocchio_spatial_symmetric3__
6 #define __pinocchio_spatial_symmetric3__
7 
9 
11 
12 namespace pinocchio
13 {
14  template<typename _Scalar, int _Options>
15  struct traits<Symmetric3Tpl<_Scalar, _Options>>
16  {
17  typedef _Scalar Scalar;
18  };
19 
20  template<typename _Scalar, int _Options>
21  class Symmetric3Tpl : public NumericalBase<Symmetric3Tpl<_Scalar, _Options>>
22  {
23  public:
24  typedef _Scalar Scalar;
25  enum
26  {
27  Options = _Options
28  };
29  typedef Eigen::Matrix<Scalar, 3, 1, Options> Vector3;
30  typedef Eigen::Matrix<Scalar, 6, 1, Options> Vector6;
31  typedef Eigen::Matrix<Scalar, 3, 3, Options> Matrix3;
32  typedef Eigen::Matrix<Scalar, 2, 2, Options> Matrix2;
33  typedef Eigen::Matrix<Scalar, 3, 2, Options> Matrix32;
34 
35  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
36 
37  public:
39  {
40  }
41 
42  template<typename Sc, int Opt>
43  explicit Symmetric3Tpl(const Eigen::Matrix<Sc, 3, 3, Opt> & I)
44  {
45  assert(check_expression_if_real<Scalar>(pinocchio::isZero((I - I.transpose()))));
46  m_data(0) = I(0, 0);
47  m_data(1) = I(1, 0);
48  m_data(2) = I(1, 1);
49  m_data(3) = I(2, 0);
50  m_data(4) = I(2, 1);
51  m_data(5) = I(2, 2);
52  }
53 
54  explicit Symmetric3Tpl(const Vector6 & I)
55  : m_data(I)
56  {
57  }
58 
60  {
61  *this = other;
62  }
63 
64  template<typename S2, int O2>
65  explicit Symmetric3Tpl(const Symmetric3Tpl<S2, O2> & other)
66  {
67  *this = other.template cast<Scalar>();
68  }
69 
75  Symmetric3Tpl & operator=(const Symmetric3Tpl & clone) // Copy assignment operator
76  {
77  m_data = clone.m_data;
78  return *this;
79  }
80 
82  const Scalar & a0,
83  const Scalar & a1,
84  const Scalar & a2,
85  const Scalar & a3,
86  const Scalar & a4,
87  const Scalar & a5)
88  {
89  m_data << a0, a1, a2, a3, a4, a5;
90  }
91 
93  {
94  return Symmetric3Tpl(Vector6::Zero());
95  }
96  void setZero()
97  {
98  m_data.setZero();
99  }
100 
102  {
103  return RandomPositive();
104  }
105  void setRandom()
106  {
107  Scalar a = Scalar(std::rand()) / RAND_MAX * 2.0 - 1.0,
108  b = Scalar(std::rand()) / RAND_MAX * 2.0 - 1.0,
109  c = Scalar(std::rand()) / RAND_MAX * 2.0 - 1.0,
110  d = Scalar(std::rand()) / RAND_MAX * 2.0 - 1.0,
111  e = Scalar(std::rand()) / RAND_MAX * 2.0 - 1.0,
112  f = Scalar(std::rand()) / RAND_MAX * 2.0 - 1.0;
113 
114  m_data << a, b, c, d, e, f;
115  }
116 
118  {
119  return Symmetric3Tpl(Scalar(1), Scalar(0), Scalar(1), Scalar(0), Scalar(0), Scalar(1));
120  }
121  void setIdentity()
122  {
123  m_data << Scalar(1), Scalar(0), Scalar(1), Scalar(0), Scalar(0), Scalar(1);
124  }
125 
126  template<typename Vector3Like>
127  void setDiagonal(const Eigen::MatrixBase<Vector3Like> & diag)
128  {
129  EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(Vector3Like, 3);
130  m_data[0] = diag[0];
131  m_data[2] = diag[1];
132  m_data[5] = diag[2];
133  }
134 
135  /* Required by Inertia::operator== */
136  bool operator==(const Symmetric3Tpl & other) const
137  {
138  return m_data == other.m_data;
139  }
140 
141  bool operator!=(const Symmetric3Tpl & other) const
142  {
143  return !(*this == other);
144  }
145 
146  bool isApprox(
147  const Symmetric3Tpl & other,
148  const Scalar & prec = Eigen::NumTraits<Scalar>::dummy_precision()) const
149  {
150  return m_data.isApprox(other.m_data, prec);
151  }
152 
153  bool isZero(const Scalar & prec = Eigen::NumTraits<Scalar>::dummy_precision()) const
154  {
155  return m_data.isZero(prec);
156  }
157 
158  void fill(const Scalar value)
159  {
160  m_data.fill(value);
161  }
162 
163  template<typename Matrix3Like>
164  void inverse(const Eigen::MatrixBase<Matrix3Like> & res_) const
165  {
166  Matrix3Like & res = res_.const_cast_derived();
167  const Scalar &a11 = m_data[0], a21 = m_data[1], a22 = m_data[2], a31 = m_data[3],
168  a32 = m_data[4], a33 = m_data[5];
169 
170  res(0, 0) = a33 * a22 - a32 * a32;
171  res(1, 0) = res(0, 1) = -(a33 * a21 - a32 * a31);
172  res(2, 0) = res(0, 2) = a32 * a21 - a22 * a31;
173  res(1, 1) = a33 * a11 - a31 * a31;
174  res(2, 1) = res(1, 2) = -(a32 * a11 - a21 * a31);
175  res(2, 2) = a22 * a11 - a21 * a21;
176 
177  const Scalar det = a11 * res(0, 0) + a21 * res(0, 1) + a31 * res(0, 2);
178  res /= det;
179  }
180 
181  Matrix3 inverse() const
182  {
183  Matrix3 res;
184  inverse(res);
185  return res;
186  }
187 
188  struct SkewSquare
189  {
190  const Vector3 & v;
192  : v(v)
193  {
194  }
195  operator Symmetric3Tpl() const
196  {
197  const Scalar &x = v[0], &y = v[1], &z = v[2];
198  return Symmetric3Tpl(-y * y - z * z, x * y, -x * x - z * z, x * z, y * z, -x * x - y * y);
199  }
200  }; // struct SkewSquare
201 
202  Symmetric3Tpl operator-(const SkewSquare & v) const
203  {
204  const Scalar &x = v.v[0], &y = v.v[1], &z = v.v[2];
205  return Symmetric3Tpl(
206  m_data[0] + y * y + z * z, m_data[1] - x * y, m_data[2] + x * x + z * z, m_data[3] - x * z,
207  m_data[4] - y * z, m_data[5] + x * x + y * y);
208  }
209 
210  Symmetric3Tpl & operator-=(const SkewSquare & v)
211  {
212  const Scalar &x = v.v[0], &y = v.v[1], &z = v.v[2];
213  m_data[0] += y * y + z * z;
214  m_data[1] -= x * y;
215  m_data[2] += x * x + z * z;
216  m_data[3] -= x * z;
217  m_data[4] -= y * z;
218  m_data[5] += x * x + y * y;
219  return *this;
220  }
221 
223  {
224  const Scalar & m;
225  const Vector3 & v;
226 
227  AlphaSkewSquare(const Scalar & m, const SkewSquare & v)
228  : m(m)
229  , v(v.v)
230  {
231  }
232  AlphaSkewSquare(const Scalar & m, const Vector3 & v)
233  : m(m)
234  , v(v)
235  {
236  }
237 
238  operator Symmetric3Tpl() const
239  {
240  const Scalar &x = v[0], &y = v[1], &z = v[2];
241  return Symmetric3Tpl(
242  -m * (y * y + z * z), m * x * y, -m * (x * x + z * z), m * x * z, m * y * z,
243  -m * (x * x + y * y));
244  }
245  };
246 
247  friend AlphaSkewSquare operator*(const Scalar & m, const SkewSquare & sk)
248  {
249  return AlphaSkewSquare(m, sk);
250  }
251 
252  Symmetric3Tpl operator-(const AlphaSkewSquare & v) const
253  {
254  const Scalar &x = v.v[0], &y = v.v[1], &z = v.v[2];
255  return Symmetric3Tpl(
256  m_data[0] + v.m * (y * y + z * z), m_data[1] - v.m * x * y,
257  m_data[2] + v.m * (x * x + z * z), m_data[3] - v.m * x * z, m_data[4] - v.m * y * z,
258  m_data[5] + v.m * (x * x + y * y));
259  }
260 
261  Symmetric3Tpl & operator-=(const AlphaSkewSquare & v)
262  {
263  const Scalar &x = v.v[0], &y = v.v[1], &z = v.v[2];
264  m_data[0] += v.m * (y * y + z * z);
265  m_data[1] -= v.m * x * y;
266  m_data[2] += v.m * (x * x + z * z);
267  m_data[3] -= v.m * x * z;
268  m_data[4] -= v.m * y * z;
269  m_data[5] += v.m * (x * x + y * y);
270  return *this;
271  }
272 
273  const Vector6 & data() const
274  {
275  return m_data;
276  }
278  {
279  return m_data;
280  }
281 
282  // static Symmetric3Tpl SkewSq( const Vector3 & v )
283  // {
284  // const Scalar & x = v[0], & y = v[1], & z = v[2];
285  // return Symmetric3Tpl(-y*y-z*z,
286  // x*y, -x*x-z*z,
287  // x*z, y*z, -x*x-y*y );
288  // }
289 
290  /* Shoot a positive definite matrix. */
292  {
293  Scalar a = Scalar(std::rand()) / RAND_MAX * 2.0 - 1.0,
294  b = Scalar(std::rand()) / RAND_MAX * 2.0 - 1.0,
295  c = Scalar(std::rand()) / RAND_MAX * 2.0 - 1.0,
296  d = Scalar(std::rand()) / RAND_MAX * 2.0 - 1.0,
297  e = Scalar(std::rand()) / RAND_MAX * 2.0 - 1.0,
298  f = Scalar(std::rand()) / RAND_MAX * 2.0 - 1.0;
299  return Symmetric3Tpl(
300  a * a + b * b + d * d, a * b + b * c + d * e, b * b + c * c + e * e, a * d + b * e + d * f,
301  b * d + c * e + e * f, d * d + e * e + f * f);
302  }
303 
304  Matrix3 matrix() const
305  {
306  Matrix3 res;
307  res(0, 0) = m_data(0);
308  res(0, 1) = m_data(1);
309  res(0, 2) = m_data(3);
310  res(1, 0) = m_data(1);
311  res(1, 1) = m_data(2);
312  res(1, 2) = m_data(4);
313  res(2, 0) = m_data(3);
314  res(2, 1) = m_data(4);
315  res(2, 2) = m_data(5);
316  return res;
317  }
318  operator Matrix3() const
319  {
320  return matrix();
321  }
322 
323  Scalar vtiv(const Vector3 & v) const
324  {
325  const Scalar & x = v[0];
326  const Scalar & y = v[1];
327  const Scalar & z = v[2];
328 
329  const Scalar xx = x * x;
330  const Scalar xy = x * y;
331  const Scalar xz = x * z;
332  const Scalar yy = y * y;
333  const Scalar yz = y * z;
334  const Scalar zz = z * z;
335 
336  return m_data(0) * xx + m_data(2) * yy + m_data(5) * zz
337  + 2. * (m_data(1) * xy + m_data(3) * xz + m_data(4) * yz);
338  }
339 
350  template<typename Vector3, typename Matrix3>
351  static void vxs(
352  const Eigen::MatrixBase<Vector3> & v,
353  const Symmetric3Tpl & S3,
354  const Eigen::MatrixBase<Matrix3> & M)
355  {
356  EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(Vector3, 3);
357  EIGEN_STATIC_ASSERT_MATRIX_SPECIFIC_SIZE(Matrix3, 3, 3);
358 
359  const Scalar & a = S3.data()[0];
360  const Scalar & b = S3.data()[1];
361  const Scalar & c = S3.data()[2];
362  const Scalar & d = S3.data()[3];
363  const Scalar & e = S3.data()[4];
364  const Scalar & f = S3.data()[5];
365 
366  const typename Vector3::RealScalar & v0 = v[0];
367  const typename Vector3::RealScalar & v1 = v[1];
368  const typename Vector3::RealScalar & v2 = v[2];
369 
371  M_(0, 0) = d * v1 - b * v2;
372  M_(1, 0) = a * v2 - d * v0;
373  M_(2, 0) = b * v0 - a * v1;
374 
375  M_(0, 1) = e * v1 - c * v2;
376  M_(1, 1) = b * v2 - e * v0;
377  M_(2, 1) = c * v0 - b * v1;
378 
379  M_(0, 2) = f * v1 - e * v2;
380  M_(1, 2) = d * v2 - f * v0;
381  M_(2, 2) = e * v0 - d * v1;
382  }
383 
394  template<typename Vector3>
395  Matrix3 vxs(const Eigen::MatrixBase<Vector3> & v) const
396  {
397  Matrix3 M;
398  vxs(v, *this, M);
399  return M;
400  }
401 
411  template<typename Vector3, typename Matrix3>
412  static void svx(
413  const Eigen::MatrixBase<Vector3> & v,
414  const Symmetric3Tpl & S3,
415  const Eigen::MatrixBase<Matrix3> & M)
416  {
417  EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(Vector3, 3);
418  EIGEN_STATIC_ASSERT_MATRIX_SPECIFIC_SIZE(Matrix3, 3, 3);
419 
420  const Scalar & a = S3.data()[0];
421  const Scalar & b = S3.data()[1];
422  const Scalar & c = S3.data()[2];
423  const Scalar & d = S3.data()[3];
424  const Scalar & e = S3.data()[4];
425  const Scalar & f = S3.data()[5];
426 
427  const typename Vector3::RealScalar & v0 = v[0];
428  const typename Vector3::RealScalar & v1 = v[1];
429  const typename Vector3::RealScalar & v2 = v[2];
430 
432  M_(0, 0) = b * v2 - d * v1;
433  M_(1, 0) = c * v2 - e * v1;
434  M_(2, 0) = e * v2 - f * v1;
435 
436  M_(0, 1) = d * v0 - a * v2;
437  M_(1, 1) = e * v0 - b * v2;
438  M_(2, 1) = f * v0 - d * v2;
439 
440  M_(0, 2) = a * v1 - b * v0;
441  M_(1, 2) = b * v1 - c * v0;
442  M_(2, 2) = d * v1 - e * v0;
443  }
444 
453  template<typename Vector3>
454  Matrix3 svx(const Eigen::MatrixBase<Vector3> & v) const
455  {
456  Matrix3 M;
457  svx(v, *this, M);
458  return M;
459  }
460 
462  {
463  return Symmetric3Tpl(m_data + s2.m_data);
464  }
465 
467  {
468  return Symmetric3Tpl(m_data - s2.m_data);
469  }
470 
472  {
473  m_data += s2.m_data;
474  return *this;
475  }
476 
478  {
479  m_data -= s2.m_data;
480  return *this;
481  }
482 
484  {
485  m_data *= s;
486  return *this;
487  }
488 
489  template<typename V3in, typename V3out>
490  static void rhsMult(
491  const Symmetric3Tpl & S3,
492  const Eigen::MatrixBase<V3in> & vin,
493  const Eigen::MatrixBase<V3out> & vout)
494  {
495  EIGEN_STATIC_ASSERT_SAME_VECTOR_SIZE(V3in, Vector3);
496  EIGEN_STATIC_ASSERT_SAME_VECTOR_SIZE(V3out, Vector3);
497 
498  V3out & vout_ = PINOCCHIO_EIGEN_CONST_CAST(V3out, vout);
499 
500  vout_[0] = S3.m_data(0) * vin[0] + S3.m_data(1) * vin[1] + S3.m_data(3) * vin[2];
501  vout_[1] = S3.m_data(1) * vin[0] + S3.m_data(2) * vin[1] + S3.m_data(4) * vin[2];
502  vout_[2] = S3.m_data(3) * vin[0] + S3.m_data(4) * vin[1] + S3.m_data(5) * vin[2];
503  }
504 
505  template<typename V3>
506  Vector3 operator*(const Eigen::MatrixBase<V3> & v) const
507  {
508  Vector3 res;
509  rhsMult(*this, v, res);
510  return res;
511  }
512 
513  // Matrix3 operator*(const Matrix3 &a) const
514  // {
515  // Matrix3 r;
516  // for(unsigned int i=0; i<3; ++i)
517  // {
518  // r(0,i) = m_data(0) * a(0,i) + m_data(1) * a(1,i) + m_data(3) * a(2,i);
519  // r(1,i) = m_data(1) * a(0,i) + m_data(2) * a(1,i) + m_data(4) * a(2,i);
520  // r(2,i) = m_data(3) * a(0,i) + m_data(4) * a(1,i) + m_data(5) * a(2,i);
521  // }
522  // return r;
523  // }
524 
525  const Scalar & operator()(const int i, const int j) const
526  {
527  return ((i != 2) && (j != 2)) ? m_data[i + j] : m_data[i + j + 1];
528  }
529 
530  template<typename Matrix3Like>
531  Symmetric3Tpl operator-(const Eigen::MatrixBase<Matrix3Like> & S) const
532  {
533  assert(check_expression_if_real<Scalar>(pinocchio::isZero(S - S.transpose())));
534  return Symmetric3Tpl(
535  m_data(0) - S(0, 0), m_data(1) - S(1, 0), m_data(2) - S(1, 1), m_data(3) - S(2, 0),
536  m_data(4) - S(2, 1), m_data(5) - S(2, 2));
537  }
538 
539  template<typename Matrix3Like>
540  Symmetric3Tpl operator+(const Eigen::MatrixBase<Matrix3Like> & S) const
541  {
542  assert(check_expression_if_real<Scalar>(pinocchio::isZero(S - S.transpose())));
543  return Symmetric3Tpl(
544  m_data(0) + S(0, 0), m_data(1) + S(1, 0), m_data(2) + S(1, 1), m_data(3) + S(2, 0),
545  m_data(4) + S(2, 1), m_data(5) + S(2, 2));
546  }
547 
548  /* --- Symmetric R*S*R' and R'*S*R products --- */
549  public: // private:
553  {
554  Matrix32 L;
555  L << m_data(0) - m_data(5), m_data(1), m_data(1), m_data(2) - m_data(5), 2 * m_data(3),
556  m_data(4) + m_data(4);
557  return L;
558  }
559 
560  /* R*S*R' */
561  template<typename D>
562  Symmetric3Tpl rotate(const Eigen::MatrixBase<D> & R) const
563  {
564  EIGEN_STATIC_ASSERT_MATRIX_SPECIFIC_SIZE(D, 3, 3);
565  assert(
566  check_expression_if_real<Scalar>(isUnitary(R.transpose() * R))
567  && "R is not a Unitary matrix");
568 
569  Symmetric3Tpl Sres;
570 
571  // 4 a
572  const Matrix32 L(decomposeltI());
573 
574  // Y = R' L ===> (12 m + 8 a)
575  const Matrix2 Y(R.template block<2, 3>(1, 0) * L);
576 
577  // Sres= Y R ===> (16 m + 8a)
578  Sres.m_data(1) = Y(0, 0) * R(0, 0) + Y(0, 1) * R(0, 1);
579  Sres.m_data(2) = Y(0, 0) * R(1, 0) + Y(0, 1) * R(1, 1);
580  Sres.m_data(3) = Y(1, 0) * R(0, 0) + Y(1, 1) * R(0, 1);
581  Sres.m_data(4) = Y(1, 0) * R(1, 0) + Y(1, 1) * R(1, 1);
582  Sres.m_data(5) = Y(1, 0) * R(2, 0) + Y(1, 1) * R(2, 1);
583 
584  // r=R' v ( 6m + 3a)
585  const Vector3 r(
586  -R(0, 0) * m_data(4) + R(0, 1) * m_data(3), -R(1, 0) * m_data(4) + R(1, 1) * m_data(3),
587  -R(2, 0) * m_data(4) + R(2, 1) * m_data(3));
588 
589  // Sres_11 (3a)
590  Sres.m_data(0) = L(0, 0) + L(1, 1) - Sres.m_data(2) - Sres.m_data(5);
591 
592  // Sres + D + (Ev)x ( 9a)
593  Sres.m_data(0) += m_data(5);
594  Sres.m_data(1) += r(2);
595  Sres.m_data(2) += m_data(5);
596  Sres.m_data(3) -= r(1);
597  Sres.m_data(4) += r(0);
598  Sres.m_data(5) += m_data(5);
599 
600  return Sres;
601  }
602 
604  template<typename NewScalar>
606  {
607  return Symmetric3Tpl<NewScalar, Options>(m_data.template cast<NewScalar>());
608  }
609 
610  friend std::ostream & operator<<(std::ostream & os, const Symmetric3Tpl<Scalar, Options> & S3)
611  {
612  os << "m_data: " << S3.m_data.transpose() << "\n";
613  return os;
614  }
615 
616  // TODO: adjust code
617  // bool isValid() const
618  // {
619  // return
620  // m_data(0) >= Scalar(0)
621  // && m_data(2) >= Scalar(0)
622  // && m_data(5) >= Scalar(0);
623  // }
624 
625  protected:
627 
628  }; // class Symmetric3Tpl
629 
630 } // namespace pinocchio
631 
632 #endif // ifndef __pinocchio_spatial_symmetric3__
pinocchio::Symmetric3Tpl::inverse
Matrix3 inverse() const
Definition: spatial/symmetric3.hpp:181
fwd.hpp
pinocchio::NumericalBase
Definition: fwd.hpp:89
test-cpp2pybind11.m
m
Definition: test-cpp2pybind11.py:25
pinocchio::Symmetric3Tpl::Symmetric3Tpl
Symmetric3Tpl(const Vector6 &I)
Definition: spatial/symmetric3.hpp:54
pinocchio::Symmetric3Tpl::vxs
static void vxs(const Eigen::MatrixBase< Vector3 > &v, const Symmetric3Tpl &S3, const Eigen::MatrixBase< Matrix3 > &M)
Performs the operation . This operation is equivalent to applying the cross product of v on each colu...
Definition: spatial/symmetric3.hpp:351
pinocchio::Symmetric3Tpl::svx
Matrix3 svx(const Eigen::MatrixBase< Vector3 > &v) const
Performs the operation .
Definition: spatial/symmetric3.hpp:454
pinocchio::Symmetric3Tpl::cast
Symmetric3Tpl< NewScalar, Options > cast() const
Definition: spatial/symmetric3.hpp:605
pinocchio::Symmetric3Tpl::data
Vector6 & data()
Definition: spatial/symmetric3.hpp:277
pinocchio::Symmetric3Tpl::operator-
Symmetric3Tpl operator-(const SkewSquare &v) const
Definition: spatial/symmetric3.hpp:202
pinocchio::isUnitary
bool isUnitary(const Eigen::MatrixBase< MatrixLike > &mat, const typename MatrixLike::RealScalar &prec=Eigen::NumTraits< typename MatrixLike::Scalar >::dummy_precision())
Check whether the input matrix is Unitary within the given precision.
Definition: math/matrix.hpp:155
pinocchio::isZero
bool isZero(const Eigen::MatrixBase< MatrixLike > &m, const typename MatrixLike::RealScalar &prec=Eigen::NumTraits< typename MatrixLike::Scalar >::dummy_precision())
Definition: math/matrix.hpp:59
meshcat-viewer.v0
int v0
Definition: meshcat-viewer.py:88
pinocchio::Symmetric3Tpl::operator-=
Symmetric3Tpl & operator-=(const Symmetric3Tpl &s2)
Definition: spatial/symmetric3.hpp:477
pinocchio::Symmetric3Tpl::Symmetric3Tpl
Symmetric3Tpl(const Symmetric3Tpl &other)
Definition: spatial/symmetric3.hpp:59
pinocchio::Symmetric3Tpl::AlphaSkewSquare
Definition: spatial/symmetric3.hpp:222
y
y
c
Vec3f c
pinocchio::Symmetric3Tpl::operator==
bool operator==(const Symmetric3Tpl &other) const
Definition: spatial/symmetric3.hpp:136
pinocchio::Symmetric3Tpl::svx
static void svx(const Eigen::MatrixBase< Vector3 > &v, const Symmetric3Tpl &S3, const Eigen::MatrixBase< Matrix3 > &M)
Performs the operation .
Definition: spatial/symmetric3.hpp:412
PINOCCHIO_EIGEN_CONST_CAST
#define PINOCCHIO_EIGEN_CONST_CAST(TYPE, OBJ)
Macro for an automatic const_cast.
Definition: eigen-macros.hpp:51
L
L
pinocchio::Symmetric3Tpl::AlphaSkewSquare::AlphaSkewSquare
AlphaSkewSquare(const Scalar &m, const Vector3 &v)
Definition: spatial/symmetric3.hpp:232
pinocchio::Symmetric3Tpl::Vector3
Eigen::Matrix< Scalar, 3, 1, Options > Vector3
Definition: spatial/symmetric3.hpp:29
inverse-kinematics.i
int i
Definition: inverse-kinematics.py:17
pinocchio::Symmetric3Tpl::vxs
Matrix3 vxs(const Eigen::MatrixBase< Vector3 > &v) const
Performs the operation . This operation is equivalent to applying the cross product of v on each colu...
Definition: spatial/symmetric3.hpp:395
pinocchio::Symmetric3Tpl::isApprox
bool isApprox(const Symmetric3Tpl &other, const Scalar &prec=Eigen::NumTraits< Scalar >::dummy_precision()) const
Definition: spatial/symmetric3.hpp:146
pinocchio::Symmetric3Tpl::operator+
Symmetric3Tpl operator+(const Symmetric3Tpl &s2) const
Definition: spatial/symmetric3.hpp:461
pinocchio::Symmetric3Tpl::Scalar
_Scalar Scalar
Definition: spatial/symmetric3.hpp:24
pinocchio::Symmetric3Tpl::Symmetric3Tpl
Symmetric3Tpl(const Symmetric3Tpl< S2, O2 > &other)
Definition: spatial/symmetric3.hpp:65
pinocchio::Symmetric3Tpl::operator-
Symmetric3Tpl operator-(const Symmetric3Tpl &s2) const
Definition: spatial/symmetric3.hpp:466
pinocchio::Symmetric3Tpl::AlphaSkewSquare::AlphaSkewSquare
AlphaSkewSquare(const Scalar &m, const SkewSquare &v)
Definition: spatial/symmetric3.hpp:227
pinocchio::Symmetric3Tpl::setDiagonal
void setDiagonal(const Eigen::MatrixBase< Vector3Like > &diag)
Definition: spatial/symmetric3.hpp:127
pinocchio::res
ReturnType res
Definition: spatial/classic-acceleration.hpp:57
pinocchio::Symmetric3Tpl::setRandom
void setRandom()
Definition: spatial/symmetric3.hpp:105
R
R
autodiff-rnea.f
f
Definition: autodiff-rnea.py:24
pinocchio::Symmetric3Tpl::operator()
const Scalar & operator()(const int i, const int j) const
Definition: spatial/symmetric3.hpp:525
pinocchio::Symmetric3Tpl::Matrix3
Eigen::Matrix< Scalar, 3, 3, Options > Matrix3
Definition: spatial/symmetric3.hpp:31
b
Vec3f b
pinocchio::Symmetric3Tpl::vtiv
Scalar vtiv(const Vector3 &v) const
Definition: spatial/symmetric3.hpp:323
pinocchio::Symmetric3Tpl::Random
static Symmetric3Tpl Random()
Definition: spatial/symmetric3.hpp:101
r
FCL_REAL r
simulation-contact-dynamics.S
S
Definition: simulation-contact-dynamics.py:80
matrix.hpp
pinocchio::Symmetric3Tpl::operator+=
Symmetric3Tpl & operator+=(const Symmetric3Tpl &s2)
Definition: spatial/symmetric3.hpp:471
pinocchio::Symmetric3Tpl::Options
@ Options
Definition: spatial/symmetric3.hpp:27
pinocchio::Symmetric3Tpl::SkewSquare
Definition: spatial/symmetric3.hpp:188
pinocchio::Symmetric3Tpl::fill
void fill(const Scalar value)
Definition: spatial/symmetric3.hpp:158
pinocchio::Symmetric3Tpl::inverse
void inverse(const Eigen::MatrixBase< Matrix3Like > &res_) const
Definition: spatial/symmetric3.hpp:164
D
D
pinocchio::Symmetric3Tpl::SkewSquare::v
const Vector3 & v
Definition: spatial/symmetric3.hpp:190
pinocchio::Symmetric3Tpl::Symmetric3Tpl
Symmetric3Tpl(const Eigen::Matrix< Sc, 3, 3, Opt > &I)
Definition: spatial/symmetric3.hpp:43
value
float value
x
x
M
M
pinocchio::Symmetric3Tpl::isZero
bool isZero(const Scalar &prec=Eigen::NumTraits< Scalar >::dummy_precision()) const
Definition: spatial/symmetric3.hpp:153
pinocchio::Symmetric3Tpl::AlphaSkewSquare::m
const Scalar & m
Definition: spatial/symmetric3.hpp:224
pinocchio::Symmetric3Tpl::SkewSquare::SkewSquare
SkewSquare(const Vector3 &v)
Definition: spatial/symmetric3.hpp:191
pinocchio::Symmetric3Tpl::rhsMult
static void rhsMult(const Symmetric3Tpl &S3, const Eigen::MatrixBase< V3in > &vin, const Eigen::MatrixBase< V3out > &vout)
Definition: spatial/symmetric3.hpp:490
pinocchio::Symmetric3Tpl::operator*
friend AlphaSkewSquare operator*(const Scalar &m, const SkewSquare &sk)
Definition: spatial/symmetric3.hpp:247
pinocchio::Symmetric3Tpl::Symmetric3Tpl
Symmetric3Tpl()
Definition: spatial/symmetric3.hpp:38
pinocchio::Symmetric3Tpl::matrix
Matrix3 matrix() const
Definition: spatial/symmetric3.hpp:304
a
Vec3f a
pinocchio::Symmetric3Tpl::Matrix32
Eigen::Matrix< Scalar, 3, 2, Options > Matrix32
Definition: spatial/symmetric3.hpp:33
pinocchio::Symmetric3Tpl::Matrix2
Eigen::Matrix< Scalar, 2, 2, Options > Matrix2
Definition: spatial/symmetric3.hpp:32
clone
virtual CollisionGeometry * clone() const=0
pinocchio::v
JointCollectionTpl const Eigen::MatrixBase< ConfigVectorType > const Eigen::MatrixBase< TangentVectorType > & v
Definition: joint-configuration.hpp:1084
pinocchio::Symmetric3Tpl::operator-=
Symmetric3Tpl & operator-=(const SkewSquare &v)
Definition: spatial/symmetric3.hpp:210
pinocchio::Symmetric3Tpl::m_data
Vector6 m_data
Definition: spatial/symmetric3.hpp:626
pinocchio::Symmetric3Tpl::operator-
Symmetric3Tpl operator-(const Eigen::MatrixBase< Matrix3Like > &S) const
Definition: spatial/symmetric3.hpp:531
pinocchio::Symmetric3Tpl
Definition: spatial/fwd.hpp:60
pinocchio::Symmetric3Tpl::rotate
Symmetric3Tpl rotate(const Eigen::MatrixBase< D > &R) const
Definition: spatial/symmetric3.hpp:562
pinocchio::Symmetric3Tpl::AlphaSkewSquare::v
const Vector3 & v
Definition: spatial/symmetric3.hpp:225
pinocchio::Symmetric3Tpl::data
const Vector6 & data() const
Definition: spatial/symmetric3.hpp:273
pinocchio::Symmetric3Tpl::operator=
Symmetric3Tpl & operator=(const Symmetric3Tpl &clone)
Copy assignment operator.
Definition: spatial/symmetric3.hpp:75
pinocchio::Symmetric3Tpl::operator!=
bool operator!=(const Symmetric3Tpl &other) const
Definition: spatial/symmetric3.hpp:141
pinocchio::Symmetric3Tpl::Identity
static Symmetric3Tpl Identity()
Definition: spatial/symmetric3.hpp:117
pinocchio::Symmetric3Tpl::operator*
Vector3 operator*(const Eigen::MatrixBase< V3 > &v) const
Definition: spatial/symmetric3.hpp:506
pinocchio::traits< Symmetric3Tpl< _Scalar, _Options > >::Scalar
_Scalar Scalar
Definition: spatial/symmetric3.hpp:17
pinocchio::Symmetric3Tpl::decomposeltI
Matrix32 decomposeltI() const
Computes L for a symmetric matrix A.
Definition: spatial/symmetric3.hpp:552
pinocchio::Symmetric3Tpl::operator<<
friend std::ostream & operator<<(std::ostream &os, const Symmetric3Tpl< Scalar, Options > &S3)
Definition: spatial/symmetric3.hpp:610
Y
Y
pinocchio::Symmetric3Tpl::Symmetric3Tpl
Symmetric3Tpl(const Scalar &a0, const Scalar &a1, const Scalar &a2, const Scalar &a3, const Scalar &a4, const Scalar &a5)
Definition: spatial/symmetric3.hpp:81
pinocchio::traits
Common traits structure to fully define base classes for CRTP.
Definition: fwd.hpp:71
pinocchio::Symmetric3Tpl::setIdentity
void setIdentity()
Definition: spatial/symmetric3.hpp:121
pinocchio::Symmetric3Tpl::Zero
static Symmetric3Tpl Zero()
Definition: spatial/symmetric3.hpp:92
pinocchio.utils.rand
def rand(n)
Definition: bindings/python/pinocchio/utils.py:41
pinocchio::Symmetric3Tpl::RandomPositive
static Symmetric3Tpl RandomPositive()
Definition: spatial/symmetric3.hpp:291
pinocchio::Symmetric3Tpl::setZero
void setZero()
Definition: spatial/symmetric3.hpp:96
cartpole.a0
a0
Definition: cartpole.py:155
pinocchio::Symmetric3Tpl::operator*=
Symmetric3Tpl & operator*=(const Scalar s)
Definition: spatial/symmetric3.hpp:483
d
FCL_REAL d
pinocchio::Symmetric3Tpl::operator+
Symmetric3Tpl operator+(const Eigen::MatrixBase< Matrix3Like > &S) const
Definition: spatial/symmetric3.hpp:540
pinocchio::Symmetric3Tpl::operator-=
Symmetric3Tpl & operator-=(const AlphaSkewSquare &v)
Definition: spatial/symmetric3.hpp:261
pinocchio
Main pinocchio namespace.
Definition: timings.cpp:27
pinocchio::Symmetric3Tpl::operator-
Symmetric3Tpl operator-(const AlphaSkewSquare &v) const
Definition: spatial/symmetric3.hpp:252
pinocchio::Symmetric3Tpl::Vector6
Eigen::Matrix< Scalar, 6, 1, Options > Vector6
Definition: spatial/symmetric3.hpp:30


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