Go to the documentation of this file.
5 #ifndef __pinocchio_math_tensor_hpp__
6 #define __pinocchio_math_tensor_hpp__
10 #if !EIGEN_VERSION_AT_LEAST(3,2,90)
11 #define EIGEN_DEVICE_FUNC
14 #ifndef PINOCCHIO_WITH_EIGEN_TENSOR_MODULE
15 #if (__cplusplus <= 199711L && EIGEN_COMP_MSVC < 1900) || defined(__CUDACC__) || defined(EIGEN_AVOID_STL_ARRAY)
17 template <
typename T, std::
size_t n>
38 static std::size_t
size() {
return n; }
43 template<
class T, std::
size_t n>
46 for (std::size_t
i = 0;
i <
n; ++
i) {
47 if (lhs[
i] != rhs[
i]) {
54 template<
class T, std::
size_t n>
63 template <
typename T, std::
size_t N>
using array = std::array<T, N>;
71 #ifndef PINOCCHIO_WITH_EIGEN_TENSOR_MODULE
74 template<
typename Scalar_,
int NumIndices_,
int Options_ = 0,
typename IndexType = Eigen::DenseIndex>
77 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
103 assert(
n <=
NumIndices &&
"n is larger than the dimension of the tensor.");
157 EIGEN_STATIC_ASSERT(1 ==
NumIndices, YOU_MADE_A_PROGRAMMING_MISTAKE)
165 EIGEN_STATIC_ASSERT(2 ==
NumIndices, YOU_MADE_A_PROGRAMMING_MISTAKE)
174 EIGEN_STATIC_ASSERT(3 ==
NumIndices, YOU_MADE_A_PROGRAMMING_MISTAKE)
184 EIGEN_STATIC_ASSERT(4 ==
NumIndices, YOU_MADE_A_PROGRAMMING_MISTAKE)
195 EIGEN_STATIC_ASSERT(5 ==
NumIndices, YOU_MADE_A_PROGRAMMING_MISTAKE)
201 EIGEN_STATIC_ASSERT(1 ==
NumIndices, YOU_MADE_A_PROGRAMMING_MISTAKE)
208 EIGEN_STATIC_ASSERT(2 ==
NumIndices, YOU_MADE_A_PROGRAMMING_MISTAKE)
215 EIGEN_STATIC_ASSERT(3 ==
NumIndices, YOU_MADE_A_PROGRAMMING_MISTAKE)
222 EIGEN_STATIC_ASSERT(4 ==
NumIndices, YOU_MADE_A_PROGRAMMING_MISTAKE)
229 EIGEN_STATIC_ASSERT(5 ==
NumIndices, YOU_MADE_A_PROGRAMMING_MISTAKE)
247 bool size_changed =
size != this->
size();
250 #ifdef EIGEN_INITIALIZE_COEFFS
253 #if defined(EIGEN_INITIALIZE_MATRICES_BY_ZERO)
255 #elif defined(EIGEN_INITIALIZE_MATRICES_BY_NAN)
256 m_storage.fill(std::numeric_limits<Scalar>::quiet_NaN());
274 typedef Eigen::Matrix<Scalar,Eigen::Dynamic,1,Options>
StorageType;
284 template<
typename Scalar_,
int NumIndices_,
int Options_ = 0,
typename IndexType = Eigen::DenseIndex>
285 using Tensor = Eigen::Tensor<Scalar_,NumIndices_,Options_,IndexType>;
287 #endif // ifndef PINOCCHIO_WITH_EIGEN_TENSOR_MODULE
291 #if !EIGEN_VERSION_AT_LEAST(3,2,90)
292 #undef EIGEN_DEVICE_FUNC
295 #endif // ifndef __pinocchio_math_tensor_hpp__
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Tensor(const Tensor &other)
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Tensor(Index dim1)
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Tensor & setRandom()
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef Scalar_ Scalar
EIGEN_DEVICE_FUNC void resize(const Eigen::array< Index, NumIndices > &dimensions)
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Tensor()
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Tensor(Index dim1, Index dim2, Index dim3)
const Tensor & base() const
EIGEN_DEVICE_FUNC const EIGEN_STRONG_INLINE Scalar * data() const
EIGEN_DEVICE_FUNC const EIGEN_STRONG_INLINE Scalar & operator()(Index i0, Index i1, Index i2, Index i3) const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Tensor(Index dim1, Index dim2, Index dim3, Index dim4)
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE T & operator[](size_t index)
EIGEN_DEVICE_FUNC bool operator!=(const Tensor &other) const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Tensor & setZero()
EIGEN_DEVICE_FUNC const EIGEN_STRONG_INLINE Scalar & operator()(Index i0) const
EIGEN_DEVICE_FUNC const EIGEN_STRONG_INLINE T & back() const
EIGEN_DEVICE_FUNC const EIGEN_STRONG_INLINE Scalar & operator()(Index i0, Index i1, Index i2, Index i3, Index i4) const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index size() const
EIGEN_DEVICE_FUNC const EIGEN_STRONG_INLINE Dimensions & dimensions() const
EIGEN_DEVICE_FUNC bool operator==(const Tensor &other) const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index rank() const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Tensor & setConstant(const Scalar &val)
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar * data()
EIGEN_DEVICE_FUNC bool operator==(const array< T, n > &lhs, const array< T, n > &rhs)
EIGEN_DEVICE_FUNC const EIGEN_STRONG_INLINE T & front() const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE T & front()
EIGEN_DEVICE_FUNC const EIGEN_STRONG_INLINE Scalar & operator()(Index i0, Index i1, Index i2) const
EIGEN_DEVICE_FUNC const EIGEN_STRONG_INLINE Scalar & operator()(Index i0, Index i1) const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index dimension(std::size_t n) const
Eigen::Matrix< Scalar, Eigen::Dynamic, 1, Options > StorageType
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Tensor(Index dim1, Index dim2, Index dim3, Index dim4, Index dim5)
EIGEN_DEVICE_FUNC bool operator!=(const array< T, n > &lhs, const array< T, n > &rhs)
Eigen::array< Index, NumIndices_ > Dimensions
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE T & back()
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Tensor(Index dim1, Index dim2)
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Dimensions & dimensions()
#define EIGEN_DEVICE_FUNC
Main pinocchio namespace.
EIGEN_DEVICE_FUNC static EIGEN_ALWAYS_INLINE std::size_t size()
pinocchio
Author(s):
autogenerated on Tue Feb 13 2024 03:44:00