10 #ifndef EIGEN_CXX11_TENSORSYMMETRY_SYMMETRY_H
11 #define EIGEN_CXX11_TENSORSYMMETRY_SYMMETRY_H
37 template<
int One_,
int Two_>
40 static_assert(One_ != Two_,
"Symmetries must cover distinct indices.");
41 constexpr
static int One = One_;
42 constexpr
static int Two = Two_;
46 template<
int One_,
int Two_>
49 static_assert(One_ != Two_,
"Symmetries must cover distinct indices.");
50 constexpr
static int One = One_;
51 constexpr
static int Two = Two_;
55 template<
int One_,
int Two_>
58 static_assert(One_ != Two_,
"Symmetries must cover distinct indices.");
59 constexpr
static int One = One_;
60 constexpr
static int Two = Two_;
64 template<
int One_,
int Two_>
67 static_assert(One_ != Two_,
"Symmetries must cover distinct indices.");
68 constexpr
static int One = One_;
69 constexpr
static int Two = Two_;
98 template<
typename... Gen>
120 template<
typename... Gen>
135 template<
typename... Gen>
154 template<
typename... Sym>
struct tensor_symmetry_num_indices
156 constexpr
static std::size_t
value = 1;
162 constexpr
static std::size_t One =
static_cast<std::size_t
>(One_);
163 constexpr
static std::size_t Two =
static_cast<std::size_t
>(Two_);
167 constexpr
static std::size_t maxOneTwoPlusOne = ((One > Two) ? One : Two) + 1;
169 constexpr
static std::size_t
value = (maxOneTwoPlusOne > Three) ? maxOneTwoPlusOne : Three;
226 template<std::
size_t NumIndices>
232 template<std::size_t NumIndices,
typename Gen_,
typename... Gens_>
235 constexpr
static std::size_t max_static_generators = 4;
236 constexpr
static std::size_t max_static_elements = 16;
241 possible_size == 0 || possible_size >= max_static_elements,
247 template<
bool instantiate, std::size_t NumIndices,
typename... Gens>
250 constexpr
static std::size_t
size = 0;
254 template<std::size_t NumIndices,
typename... Gens>
257 template<
typename Tensor_>
262 constexpr
static std::size_t
NumIndices = Tensor_::NumIndices;
264 static inline int run(
const std::array<Index, NumIndices>& transformed_indices,
int transformation_flags,
int dummy, Tensor_& tensor,
const Scalar& value_)
271 tensor.coeffRef(transformed_indices) = value;
276 template<
typename Tensor_>
277 struct tensor_symmetry_calculate_flags
280 constexpr
static std::size_t
NumIndices = Tensor_::NumIndices;
282 static inline int run(
const std::array<Index, NumIndices>& transformed_indices,
int transform_flags,
int current_flags,
const std::array<Index, NumIndices>& orig_indices)
284 if (transformed_indices == orig_indices) {
292 return current_flags;
296 template<
typename Tensor_,
typename Symmetry_,
int Flags = 0>
302 constexpr
static std::size_t
NumIndices = Tensor_::NumIndices;
319 #ifdef EIGEN_TENSOR_SYMMETRY_CHECK_VALUES
334 #endif // EIGEN_CXX11_TENSORSYMMETRY_SYMMETRY_H