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_;
43 constexpr
static int Flags = 0;
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
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_>
241 possible_size == 0 || possible_size >= max_static_elements,
247 template<
bool instantiate,
std::size_t NumIndices,
typename... Gens>
257 template<
typename Tensor_>
264 static inline int run(
const std::array<Index, NumIndices>& transformed_indices,
int transformation_flags,
int dummy, Tensor_& tensor,
const Scalar& value_)
266 Scalar
value(value_);
271 tensor.coeffRef(transformed_indices) =
value;
276 template<
typename Tensor_>
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>
305 : m_tensor(tensor), m_symmetry(symmetry), m_indices(indices) { }
319 #ifdef EIGEN_TENSOR_SYMMETRY_CHECK_VALUES 320 int value_flags = m_symmetry.template apply<internal::tensor_symmetry_calculate_flags<Tensor_>,
int>(m_indices, m_symmetry.globalFlags(), m_indices);
326 m_symmetry.template apply<internal::tensor_symmetry_assign_value<Tensor_>,
int>(m_indices, 0, m_tensor,
value);
334 #endif // EIGEN_CXX11_TENSORSYMMETRY_SYMMETRY_H
static int run(const std::array< Index, NumIndices > &transformed_indices, int transformation_flags, int dummy, Tensor_ &tensor, const Scalar &value_)
helper::type::type root_type
tensor_symmetry_value_setter(Tensor_ &tensor, Symmetry_ const &symmetry, std::array< Index, NumIndices > const &indices)
static int run(const std::array< Index, NumIndices > &transformed_indices, int transform_flags, int current_flags, const std::array< Index, NumIndices > &orig_indices)
Symmetry group, initialized from template arguments.
Namespace containing all symbols from the Eigen library.
internal::tensor_symmetry_pre_analysis< NumIndices, Gen... >::root_type Base
SGroup< Gen... > & operator=(SGroup< Gen... > &&other)
SGroup(SGroup< Gen... > &&other)
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
SGroup< Gen... > & operator=(const SGroup< Gen... > &other)
void doAssign(Scalar const &value)
std::array< Index, NumIndices > m_indices
tensor_static_symgroup_if<(sizeof...(Gens_)+1<=max_static_generators), NumIndices, Gen_, Gens_... > helper
EIGEN_DEVICE_FUNC const ImagReturnType imag() const
SGroup(const SGroup< Gen... > &other)
tensor_symmetry_value_setter< Tensor_, Symmetry_, Flags > & operator=(Scalar const &value)
ScalarWithExceptions conj(const ScalarWithExceptions &x)