10 #ifndef EIGEN_CXX11_TENSORSYMMETRY_DYNAMICSYMMETRY_H 11 #define EIGEN_CXX11_TENSORSYMMETRY_DYNAMICSYMMETRY_H 24 void add(
int one,
int two,
int flags = 0);
26 template<
typename Gen_>
27 inline void add(Gen_) {
add(Gen_::One, Gen_::Two, Gen_::Flags); }
33 template<
typename Op,
typename RV,
typename Index,
std::size_t N,
typename... Args>
36 eigen_assert(N >=
m_numIndices &&
"Can only apply symmetry group to objects that have at least the required amount of indices.");
42 template<
typename Op,
typename RV,
typename Index,
typename... Args>
45 eigen_assert(idx.size() >=
m_numIndices &&
"Can only apply symmetry group to objects that have at least the required amount of indices.");
54 template<
typename Tensor_,
typename... IndexTypes>
57 static_assert(
sizeof...(otherIndices) + 1 == Tensor_::NumIndices,
"Number of indices used to access a tensor coefficient must be equal to the rank of the tensor.");
58 return operator()(tensor, std::array<typename Tensor_::Index, Tensor_::NumIndices>{{firstIndex, otherIndices...}});
61 template<
typename Tensor_>
73 if (
i != (
size_t)representation[
i])
82 constexpr
inline Generator(
int one_,
int two_,
int flags_) : one(one_), two(two_), flags(flags_) {}
93 return std::array<Index, N>{{ idx[
n >= m_numIndices ?
n : m_elements[which].representation[
n]]... }};
96 template<
typename Index>
100 result.reserve(idx.size());
102 result.push_back(idx[k]);
104 result.push_back(idx[
i]);
127 return mul(
ge(g1), g2);
132 return mul(g1,
ge(g2));
142 for (
auto ee : m_elements) {
144 return ee.flags ^ e.
flags;
153 template<
typename... Gen>
167 template<
typename Gen1,
typename... GenNext>
189 result.representation.push_back(v);
202 std::size_t newNumIndices = (one > two) ? one : two + 1;
204 gelem.representation.reserve(newNumIndices);
206 gelem.representation.push_back(
i);
256 coset_rep += coset_order;
262 switch (flagDiffOfSameGenerator) {
289 #endif // EIGEN_CXX11_TENSORSYMMETRY_DYNAMICSYMMETRY_H
GroupElement mul(GroupElement, GroupElement) const
std::vector< GroupElement > m_elements
GroupElement mul(GroupElement g1, Generator g2) const
void updateGlobalFlags(int flagDiffOfSameGenerator)
Namespace containing all symbols from the Eigen library.
std::array< Index, N > h_permute(std::size_t which, const std::array< Index, N > &idx, internal::numeric_list< int, n... >) const
DynamicSGroup & operator=(DynamicSGroup &&o)
DynamicSGroupFromTemplateArgs< Gen... > & operator=(DynamicSGroupFromTemplateArgs< Gen... > &&o)
RV apply(const std::vector< Index > &idx, RV initial, Args &&... args) const
DynamicSGroupFromTemplateArgs< Gen... > & operator=(const DynamicSGroupFromTemplateArgs< Gen... > &o)
DynamicSGroup & operator=(const DynamicSGroup &o)
void addAntiHermiticity(int one, int two)
std::vector< int > representation
void g(const string &key, int i)
GroupElement mul(Generator g1, Generator g2) const
RV apply(const std::array< Index, N > &idx, RV initial, Args &&... args) const
int findElement(GroupElement e) const
DynamicSGroupFromTemplateArgs(DynamicSGroupFromTemplateArgs &&other)
std::vector< Index > h_permute(std::size_t which, std::vector< Index > idx) const
internal::tensor_symmetry_value_setter< Tensor_, DynamicSGroup > operator()(Tensor_ &tensor, typename Tensor_::Index firstIndex, IndexTypes... otherIndices) const
DynamicSGroupFromTemplateArgs(DynamicSGroupFromTemplateArgs const &other)
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Array< int, Dynamic, 1 > v
std::vector< Generator > m_generators
Array< double, 1, 3 > e(1./3., 0.5, 2.)
void addSymmetry(int one, int two)
DynamicSGroup(const DynamicSGroup &o)
DynamicSGroup(DynamicSGroup &&o)
GroupElement mul(Generator g1, GroupElement g2) const
void swap(GeographicLib::NearestNeighbor< dist_t, pos_t, distfun_t > &a, GeographicLib::NearestNeighbor< dist_t, pos_t, distfun_t > &b)
void addHermiticity(int one, int two)
GroupElement ge(Generator const &g) const
void add_all(internal::type_list<>)
Pose3 g1(Rot3(), Point3(100.0, 0.0, 300.0))
void add_all(internal::type_list< Gen1, GenNext... >)
constexpr Generator(int one_, int two_, int flags_)
void add(int one, int two, int flags=0)
#define eigen_internal_assert(x)
DynamicSGroupFromTemplateArgs()
Pose3 g2(g1.expmap(h *V1_g1))
internal::tensor_symmetry_value_setter< Tensor_, DynamicSGroup > operator()(Tensor_ &tensor, std::array< typename Tensor_::Index, Tensor_::NumIndices > const &indices) const
void addAntiSymmetry(int one, int two)