TensorDimensionList.h
Go to the documentation of this file.
1 // This file is part of Eigen, a lightweight C++ template library
2 // for linear algebra.
3 //
4 // Copyright (C) 2015 Benoit Steiner <benoit.steiner.goog@gmail.com>
5 //
6 // This Source Code Form is subject to the terms of the Mozilla
7 // Public License v. 2.0. If a copy of the MPL was not distributed
8 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 
10 #ifndef EIGEN_CXX11_TENSOR_TENSOR_DIMENSION_LIST_H
11 #define EIGEN_CXX11_TENSOR_TENSOR_DIMENSION_LIST_H
12 
13 // IWYU pragma: private
14 #include "./InternalHeaderCheck.h"
15 
16 namespace Eigen {
17 
28 template <typename Index, std::size_t Rank>
29 struct DimensionList {
31 };
32 
33 namespace internal {
34 
35 template <typename Index, std::size_t Rank>
36 struct array_size<DimensionList<Index, Rank> > {
37  static const size_t value = Rank;
38 };
39 template <typename Index, std::size_t Rank>
40 struct array_size<const DimensionList<Index, Rank> > {
41  static const size_t value = Rank;
42 };
43 
44 template <DenseIndex n, typename Index, std::size_t Rank>
46  return n;
47 }
48 template <DenseIndex n, typename Index, std::size_t Rank>
50  return n;
51 }
52 
53 template <typename Index, std::size_t Rank>
55  EIGEN_DEVICE_FUNC static constexpr bool run(const DenseIndex) { return true; }
56 };
57 template <typename Index, std::size_t Rank>
59  EIGEN_DEVICE_FUNC static constexpr bool run(const DenseIndex) { return true; }
60 };
61 
62 template <typename Index, std::size_t Rank>
64  EIGEN_DEVICE_FUNC static constexpr bool run() { return true; }
65 };
66 template <typename Index, std::size_t Rank>
68  EIGEN_DEVICE_FUNC static constexpr bool run() { return true; }
69 };
70 
71 template <typename Index, std::size_t Rank>
73  EIGEN_DEVICE_FUNC static constexpr bool run() { return true; }
74 };
75 template <typename Index, std::size_t Rank>
77  EIGEN_DEVICE_FUNC static constexpr bool run() { return true; }
78 };
79 
80 template <typename Index, std::size_t Rank>
82  static constexpr bool run(const DenseIndex i, const DenseIndex value) { return i == value; }
83 };
84 template <typename Index, std::size_t Rank>
86  EIGEN_DEVICE_FUNC static constexpr bool run(const DenseIndex i, const DenseIndex value) { return i == value; }
87 };
88 
89 template <typename Index, std::size_t Rank>
91  EIGEN_DEVICE_FUNC static constexpr bool run(const DenseIndex i, const DenseIndex value) { return i != value; }
92 };
93 template <typename Index, std::size_t Rank>
95  static constexpr bool run(const DenseIndex i, const DenseIndex value) { return i != value; }
96 };
97 
98 template <typename Index, std::size_t Rank>
100  EIGEN_DEVICE_FUNC static constexpr bool run(const DenseIndex i, const DenseIndex value) { return i > value; }
101 };
102 template <typename Index, std::size_t Rank>
104  EIGEN_DEVICE_FUNC static constexpr bool run(const DenseIndex i, const DenseIndex value) { return i > value; }
105 };
106 
107 template <typename Index, std::size_t Rank>
109  EIGEN_DEVICE_FUNC static constexpr bool run(const DenseIndex i, const DenseIndex value) { return i < value; }
110 };
111 template <typename Index, std::size_t Rank>
113  EIGEN_DEVICE_FUNC static constexpr bool run(const DenseIndex i, const DenseIndex value) { return i < value; }
114 };
115 
116 } // end namespace internal
117 } // end namespace Eigen
118 
119 #endif // EIGEN_CXX11_TENSOR_TENSOR_DIMENSION_LIST_H
int i
Definition: BiCGSTAB_step_by_step.cpp:9
const unsigned n
Definition: CG3DPackingUnitTest.cpp:11
#define EIGEN_ALWAYS_INLINE
Definition: Macros.h:845
#define EIGEN_DEVICE_FUNC
Definition: Macros.h:892
constexpr T & array_get(std::array< T, N > &a)
Definition: EmulateArray.h:251
Namespace containing all symbols from the Eigen library.
Definition: bench_norm.cpp:70
squared absolute value
Definition: GlobalFunctions.h:87
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:83
EIGEN_DEFAULT_DENSE_INDEX_TYPE DenseIndex
Definition: Meta.h:75
Definition: Eigen_Colamd.h:49
Definition: TensorDimensionList.h:29
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE const Index operator[](const Index i) const
Definition: TensorDimensionList.h:30
static constexpr EIGEN_DEVICE_FUNC bool run()
Definition: TensorDimensionList.h:64
static constexpr EIGEN_DEVICE_FUNC bool run()
Definition: TensorDimensionList.h:68
Definition: Meta.h:305
static constexpr Index value
Definition: Meta.h:306
static constexpr EIGEN_DEVICE_FUNC bool run(const DenseIndex)
Definition: TensorDimensionList.h:55
static constexpr EIGEN_DEVICE_FUNC bool run(const DenseIndex)
Definition: TensorDimensionList.h:59
Definition: TensorIndexList.h:385
static constexpr bool run(const DenseIndex i, const DenseIndex value)
Definition: TensorDimensionList.h:82
static constexpr EIGEN_DEVICE_FUNC bool run(const DenseIndex i, const DenseIndex value)
Definition: TensorDimensionList.h:86
Definition: TensorIndexList.h:442
static constexpr EIGEN_DEVICE_FUNC bool run(const DenseIndex i, const DenseIndex value)
Definition: TensorDimensionList.h:100
static constexpr EIGEN_DEVICE_FUNC bool run(const DenseIndex i, const DenseIndex value)
Definition: TensorDimensionList.h:104
Definition: TensorIndexList.h:484
static constexpr EIGEN_DEVICE_FUNC bool run(const DenseIndex i, const DenseIndex value)
Definition: TensorDimensionList.h:109
static constexpr EIGEN_DEVICE_FUNC bool run(const DenseIndex i, const DenseIndex value)
Definition: TensorDimensionList.h:113
Definition: TensorIndexList.h:505
static constexpr EIGEN_DEVICE_FUNC bool run(const DenseIndex i, const DenseIndex value)
Definition: TensorDimensionList.h:91
static constexpr bool run(const DenseIndex i, const DenseIndex value)
Definition: TensorDimensionList.h:95
Definition: TensorIndexList.h:463
static constexpr EIGEN_DEVICE_FUNC bool run()
Definition: TensorDimensionList.h:73
static constexpr EIGEN_DEVICE_FUNC bool run()
Definition: TensorDimensionList.h:77