Eigen::DSizes< DenseIndex, NumDims > Struct Template Reference

Inherits array< DenseIndex, NumDims >.

Public Types

typedef array< DenseIndex, NumDims > Base
 

Public Member Functions

 DSizes ()
 
 DSizes (const array< DenseIndex, NumDims > &a)
 
template<typename OtherIndex >
 DSizes (const array< OtherIndex, NumDims > &other, std::enable_if_t< internal::is_same< DenseIndex, typename internal::promote_index_type< DenseIndex, OtherIndex >::type >::value, void * >=0)
 
 DSizes (const DenseIndex i0)
 
 DSizes (const DimensionList< DenseIndex, NumDims > &a)
 
template<typename FirstType , typename... OtherTypes>
 DSizes (const Eigen::IndexList< FirstType, OtherTypes... > &dimensions)
 
template<typename std::ptrdiff_t... Indices>
 DSizes (const Sizes< Indices... > &a)
 
template<typename... IndexTypes>
 DSizes (DenseIndex firstDimension, DenseIndex secondDimension, IndexTypes... otherDimensions)
 
DenseIndex IndexOfColMajor (const array< DenseIndex, NumDims > &indices) const
 
DenseIndex IndexOfRowMajor (const array< DenseIndex, NumDims > &indices) const
 
DSizesoperator= (const array< DenseIndex, NumDims > &other)
 
Index rank () const
 
DenseIndex TotalSize () const
 

Static Public Attributes

static const int count
 

Detailed Description

template<typename DenseIndex, int NumDims>
struct Eigen::DSizes< DenseIndex, NumDims >

Definition at line 251 of file TensorDimensions.h.

Member Typedef Documentation

◆ Base

template<typename DenseIndex , int NumDims>
typedef array<DenseIndex, NumDims> Eigen::DSizes< DenseIndex, NumDims >::Base

Definition at line 252 of file TensorDimensions.h.

Constructor & Destructor Documentation

◆ DSizes() [1/8]

template<typename DenseIndex , int NumDims>
Eigen::DSizes< DenseIndex, NumDims >::DSizes ( )
inline

Definition at line 263 of file TensorDimensions.h.

263  {
264  for (int i = 0 ; i < NumDims; ++i) {
265  (*this)[i] = 0;
266  }
267  }
int i

◆ DSizes() [2/8]

template<typename DenseIndex , int NumDims>
Eigen::DSizes< DenseIndex, NumDims >::DSizes ( const array< DenseIndex, NumDims > &  a)
inlineexplicit

Definition at line 268 of file TensorDimensions.h.

268 : Base(a) { }
array< DenseIndex, NumDims > Base

◆ DSizes() [3/8]

template<typename DenseIndex , int NumDims>
Eigen::DSizes< DenseIndex, NumDims >::DSizes ( const DenseIndex  i0)
inlineexplicit

Definition at line 270 of file TensorDimensions.h.

270  {
271  eigen_assert(NumDims == 1);
272  (*this)[0] = i0;
273  }
#define eigen_assert(x)

◆ DSizes() [4/8]

template<typename DenseIndex , int NumDims>
Eigen::DSizes< DenseIndex, NumDims >::DSizes ( const DimensionList< DenseIndex, NumDims > &  a)
inline

Definition at line 275 of file TensorDimensions.h.

275  {
276  for (int i = 0 ; i < NumDims; ++i) {
277  (*this)[i] = a[i];
278  }
279  }
ArrayXXi a

◆ DSizes() [5/8]

template<typename DenseIndex , int NumDims>
template<typename OtherIndex >
Eigen::DSizes< DenseIndex, NumDims >::DSizes ( const array< OtherIndex, NumDims > &  other,
std::enable_if_t< internal::is_same< DenseIndex, typename internal::promote_index_type< DenseIndex, OtherIndex >::type >::value, void * >  = 0 
)
inlineexplicit

Definition at line 285 of file TensorDimensions.h.

294  {
295  for (int i = 0; i < NumDims; ++i) {
296  (*this)[i] = static_cast<DenseIndex>(other[i]);
297  }
298  }
EIGEN_DEFAULT_DENSE_INDEX_TYPE DenseIndex

◆ DSizes() [6/8]

template<typename DenseIndex , int NumDims>
template<typename FirstType , typename... OtherTypes>
Eigen::DSizes< DenseIndex, NumDims >::DSizes ( const Eigen::IndexList< FirstType, OtherTypes... > &  dimensions)
inlineexplicit

Definition at line 302 of file TensorDimensions.h.

302  {
303  for (int i = 0; i < dimensions.count; ++i) {
304  (*this)[i] = dimensions[i];
305  }
306  }

◆ DSizes() [7/8]

template<typename DenseIndex , int NumDims>
template<typename std::ptrdiff_t... Indices>
Eigen::DSizes< DenseIndex, NumDims >::DSizes ( const Sizes< Indices... > &  a)
inline

Definition at line 310 of file TensorDimensions.h.

310  {
311  for (int i = 0 ; i < NumDims; ++i) {
312  (*this)[i] = a[i];
313  }
314  }

◆ DSizes() [8/8]

template<typename DenseIndex , int NumDims>
template<typename... IndexTypes>
Eigen::DSizes< DenseIndex, NumDims >::DSizes ( DenseIndex  firstDimension,
DenseIndex  secondDimension,
IndexTypes...  otherDimensions 
)
inlineexplicit

Definition at line 325 of file TensorDimensions.h.

325  : Base({{firstDimension, secondDimension, otherDimensions...}}) {
326  EIGEN_STATIC_ASSERT(sizeof...(otherDimensions) + 2 == NumDims, YOU_MADE_A_PROGRAMMING_MISTAKE)
327  }
#define EIGEN_STATIC_ASSERT(X, MSG)

Member Function Documentation

◆ IndexOfColMajor()

template<typename DenseIndex , int NumDims>
DenseIndex Eigen::DSizes< DenseIndex, NumDims >::IndexOfColMajor ( const array< DenseIndex, NumDims > &  indices) const
inline

Definition at line 335 of file TensorDimensions.h.

335  {
336  return internal::tensor_index_linearization_helper<DenseIndex, NumDims, NumDims - 1, false>::run(indices, *static_cast<const Base*>(this));
337  }

◆ IndexOfRowMajor()

template<typename DenseIndex , int NumDims>
DenseIndex Eigen::DSizes< DenseIndex, NumDims >::IndexOfRowMajor ( const array< DenseIndex, NumDims > &  indices) const
inline

Definition at line 338 of file TensorDimensions.h.

338  {
339  return internal::tensor_index_linearization_helper<DenseIndex, NumDims, NumDims - 1, true>::run(indices, *static_cast<const Base*>(this));
340  }

◆ operator=()

template<typename DenseIndex , int NumDims>
DSizes& Eigen::DSizes< DenseIndex, NumDims >::operator= ( const array< DenseIndex, NumDims > &  other)
inline

Definition at line 329 of file TensorDimensions.h.

329  {
330  *static_cast<Base*>(this) = other;
331  return *this;
332  }

◆ rank()

template<typename DenseIndex , int NumDims>
Index Eigen::DSizes< DenseIndex, NumDims >::rank ( ) const
inline

Definition at line 255 of file TensorDimensions.h.

255  {
256  return NumDims;
257  }

◆ TotalSize()

template<typename DenseIndex , int NumDims>
DenseIndex Eigen::DSizes< DenseIndex, NumDims >::TotalSize ( ) const
inline

Definition at line 259 of file TensorDimensions.h.

259  {
260  return (NumDims == 0) ? 1 : internal::array_prod(*static_cast<const Base*>(this));
261  }
constexpr auto array_prod(const array< T, N > &arr) -> decltype(array_reduce< product_op, T, N >(arr, static_cast< T >(1)))

Member Data Documentation

◆ count

template<typename DenseIndex , int NumDims>
const int Eigen::DSizes< DenseIndex, NumDims >::count
static

Definition at line 253 of file TensorDimensions.h.


The documentation for this struct was generated from the following file: