10 #ifndef EIGEN_CXX11_TENSOR_TENSOR_DIMENSIONS_H 11 #define EIGEN_CXX11_TENSOR_TENSOR_DIMENSIONS_H 35 template<std::
size_t n,
typename Dimension>
struct dget {
40 template<
typename Index, std::
size_t NumIndices, std::
size_t n,
bool RowMajor>
43 template <
typename Dimensions> EIGEN_DEVICE_FUNC
53 template<
typename Index, std::
size_t NumIndices,
bool RowMajor>
56 template <
typename Dimensions> EIGEN_DEVICE_FUNC
63 template<
typename Index, std::
size_t n>
66 template <
typename Dimensions> EIGEN_DEVICE_FUNC
70 const Index mult = (index ==
n-1) ? 1 : 0;
76 template<
typename Index>
79 template <
typename Dimensions> EIGEN_DEVICE_FUNC
91 #ifndef EIGEN_EMULATE_CXX11_META_H 92 template <
typename std::ptrdiff_t...
Indices>
93 struct Sizes : internal::numeric_list<std::ptrdiff_t, Indices...> {
94 typedef internal::numeric_list<std::ptrdiff_t,
Indices...>
Base;
106 template <
typename DenseIndex>
110 #if EIGEN_HAS_VARIADIC_TEMPLATES 112 explicit EIGEN_DEVICE_FUNC
Sizes(std::initializer_list<std::ptrdiff_t> ) {
117 template <
typename T>
Sizes& operator = (
const T& ) {
137 template <
typename std::ptrdiff_t...
Indices>
145 template <std::
size_t n>
146 struct non_zero_size {
150 struct non_zero_size<0> {
154 template <std::
size_t V1=0, std::
size_t V2=0, std::
size_t V3=0, std::
size_t V4=0, std::
size_t V5=0>
struct Sizes {
156 static const size_t count = Base::count;
168 template <
typename DenseIndex>
172 template <
typename T>
Sizes& operator = (
const T& ) {
177 #if EIGEN_HAS_VARIADIC_TEMPLATES 179 explicit Sizes(std::initializer_list<std::size_t>) {
209 return static_cast<Index>(-1);
224 template <std::
size_t V1, std::
size_t V2, std::
size_t V3, std::
size_t V4, std::
size_t V5>
234 template<
typename Index, std::
size_t NumIndices, std::
size_t n,
bool RowMajor>
246 template<
typename Index, std::
size_t NumIndices,
bool RowMajor>
260 template <
typename DenseIndex,
int NumDims>
263 static const int count = NumDims;
274 for (
int i = 0 ;
i < NumDims; ++
i) {
285 #if EIGEN_HAS_VARIADIC_TEMPLATES 286 template<
typename... IndexTypes> EIGEN_DEVICE_FUNC
288 EIGEN_STATIC_ASSERT(
sizeof...(otherDimensions) + 2 == NumDims, YOU_MADE_A_PROGRAMMING_MISTAKE)
320 *
static_cast<Base*
>(
this) = other;
338 template<
typename Index, std::
size_t NumIndices, std::
size_t n,
bool RowMajor>
350 template<
typename Index, std::
size_t NumIndices,
bool RowMajor>
365 static const size_t value = NumDims;
368 static const size_t value = NumDims;
370 #ifndef EIGEN_EMULATE_CXX11_META_H 385 template <std::
size_t V1, std::
size_t V2, std::
size_t V3, std::
size_t V4, std::
size_t V5>
struct array_size<const Sizes<V1,V2,V3,V4,V5> > {
388 template <std::
size_t V1, std::
size_t V2, std::
size_t V3, std::
size_t V4, std::
size_t V5>
struct array_size<Sizes<V1,V2,V3,V4,V5> > {
398 template <
typename Dims1,
typename Dims2,
size_t n,
size_t m>
400 static EIGEN_DEVICE_FUNC
inline bool run(Dims1&, Dims2&) {
404 template <
typename Dims1,
typename Dims2,
size_t n>
406 static EIGEN_DEVICE_FUNC
inline bool run(Dims1& dims1, Dims2& dims2) {
407 return (array_get<n-1>(dims1) == array_get<n-1>(dims2)) &
411 template <
typename Dims1,
typename Dims2>
413 static EIGEN_DEVICE_FUNC
inline bool run(Dims1&, Dims2&) {
421 template <
typename Dims1,
typename Dims2>
428 #endif // EIGEN_CXX11_TENSOR_TENSOR_DIMENSIONS_H
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE std::ptrdiff_t array_prod(const Sizes< Indices... > &)
#define EIGEN_STRONG_INLINE
internal::numeric_list< std::ptrdiff_t, Indices... > Base
static EIGEN_DEVICE_FUNC Index run(array< Index, NumIndices > const &, const Dimensions &)
EIGEN_DEVICE_FUNC DSizes(const DenseIndex i0, const DenseIndex i1, const DenseIndex i2)
EIGEN_DEVICE_FUNC DSizes(const DenseIndex i0, const DenseIndex i1, const DenseIndex i2, const DenseIndex i3, const DenseIndex i4)
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index run(array< Index, NumIndices > const &indices, array< Index, NumIndices > const &dimensions)
EIGEN_DEVICE_FUNC DSizes(const array< DenseIndex, NumDims > &a)
Namespace containing all symbols from the Eigen library.
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE size_t IndexOfColMajor(const array< DenseIndex, Base::count > &indices) const
array< DenseIndex, NumDims > Base
#define EIGEN_STATIC_ASSERT(CONDITION, MSG)
static EIGEN_DEVICE_FUNC bool run(Dims1 &, Dims2 &)
EIGEN_DEVICE_FUNC Sizes()
vector< size_t > dimensions(L.begin(), L.end())
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE size_t IndexOfRowMajor(const array< DenseIndex, Base::count > &indices) const
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index run(array< Index, NumIndices > const &indices, std::vector< DenseIndex > const &)
EIGEN_DEVICE_FUNC Sizes(const array< DenseIndex, Base::count > &)
EIGEN_DEVICE_FUNC DSizes(const DenseIndex i0, const DenseIndex i1)
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
static const std::size_t value
EIGEN_DEVICE_FUNC DSizes(const DenseIndex i0, const DenseIndex i1, const DenseIndex i2, const DenseIndex i3)
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index run(array< Index, NumIndices > const &indices, array< Index, NumIndices > const &)
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE DenseIndex TotalSize() const
static EIGEN_DEVICE_FUNC bool run(Dims1 &, Dims2 &)
EIGEN_DEVICE_FUNC bool dimensions_match(Dims1 &dims1, Dims2 &dims2)
static EIGEN_DEVICE_FUNC bool run(Dims1 &dims1, Dims2 &dims2)
EIGEN_DEFAULT_DENSE_INDEX_TYPE DenseIndex
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE DSizes()
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE std::ptrdiff_t TotalSize()
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE std::ptrdiff_t rank() const
EIGEN_DEVICE_FUNC DSizes(const DenseIndex i0)
const Index array_get(DimensionList< Index, Rank > &)
std::vector< size_t > Indices
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index run(array< Index, NumIndices > const &indices, std::vector< DenseIndex > const &dimensions)
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE size_t rank() const
void run(Expr &expr, Dev &dev)
static EIGEN_DEVICE_FUNC Index run(array< Index, NumIndices > const &indices, const Dimensions &dimensions)
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE DenseIndex IndexOfRowMajor(const array< DenseIndex, NumDims > &indices) const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE DenseIndex IndexOfColMajor(const array< DenseIndex, NumDims > &indices) const