1 #ifndef CASM_InvariantSubgroup_impl
2 #define CASM_InvariantSubgroup_impl
27 template <
typename Element,
typename OpIterator,
typename SymCompareType,
28 typename OpOutputIterator>
30 OpIterator group_begin,
32 SymCompareType
const &sym_compare,
33 OpOutputIterator result) {
34 Element e{sym_compare.prepare(element)};
35 for (
auto group_it = group_begin; group_it != group_end; ++group_it) {
36 if (sym_compare.equal(
37 e, sym_compare.prepare(sym_compare.copy_apply(*group_it, e)))) {
38 *result++ = sym_compare.spatial_transform() * (*group_it);
57 template <
typename Element,
typename SymCompareType,
typename OutputIterator>
61 SymCompareType
const &sym_compare,
62 OutputIterator result) {
63 Element e{sym_compare.prepare(element)};
64 for (
auto permute_it = permute_begin; permute_it != permute_end;
66 if (sym_compare.equal(e, sym_compare.prepare(sym_compare.copy_apply(
67 permute_it->sym_op(), e)))) {
68 *result++ = permute_it;
91 template <
typename Element,
typename SymCompareType>
94 const SymCompareType &sym_compare) {
98 sym_compare, std::back_inserter(result));
99 if (result[0].index() != 0) {
100 throw std::runtime_error(
101 "Error in make_invariant_subgroup (0): First element is not identity.");
117 template <
typename OrbitType>
120 const auto &map = orbit.equivalence_map();
122 for (
Index i = 0; i < orbit.equivalence_map()[0].size(); ++i) {
123 result.
push_back(map[element_index][0] * map[0][i] *
124 map[element_index][0].
inverse());
126 if (result[0].index() != 0) {
127 throw std::runtime_error(
128 "Error in make_invariant_subgroup (1): First element is not identity.");
SymGroup is a collection of symmetry operations that satisfy the group property The symmetry operatio...
virtual void push_back(const SymOp &new_op)
void set_lattice(const Lattice &new_lat)
Lattice used for periodic comparisons (for instance, to generate multiplcation table)
std::vector< PermuteIterator > make_invariant_subgroup(ConfigEnumInput const &config_enum_input)
Eigen::Matrix< typename Derived::Scalar, Derived::RowsAtCompileTime, Derived::ColsAtCompileTime > inverse(const Eigen::MatrixBase< Derived > &M)
Return the integer inverse matrix of an invertible integer matrix.
GenericVectorXdScelFormatter lattice()
INDEX_TYPE Index
For long integer indexing: