1 #ifndef CASM_SymCompare
2 #define CASM_SymCompare
13 class SymOpRepresentation;
51 template <
typename Base>
122 template <
typename Base>
125 return derived().copy_apply_impl(op, obj);
141 template <
typename Base>
144 return derived().spatial_prepare_impl(obj);
153 template <
typename Base>
156 return derived().representation_prepare_impl(obj);
162 template <
typename Base>
165 return spatial_prepare(representation_prepare(obj));
172 template <
typename Base>
174 return derived().compare_impl(A, B);
182 template <
typename Base>
188 template <
typename Base>
191 return derived().make_invariants_impl(obj);
200 template <
typename Base>
203 return derived().invariants_compare_impl(A, B);
209 template <
typename Base>
212 return !invariants_compare(A, B) && !invariants_compare(B, A);
221 template <
typename Base>
225 return derived().inter_orbit_compare_impl(A, A_invariants, B, B_invariants);
234 template <
typename Base>
238 return !inter_orbit_compare(A, A_invariants, B, B_invariants) &&
239 !inter_orbit_compare(B, B_invariants, A, A_invariants);
243 template <
typename Base>
246 return derived().canonical_transform_impl(obj);
251 template <
typename Base>
253 return derived().spatial_transform_impl();
264 template <
typename Base>
269 if (this->invariants_compare(A_invariants, B_invariants)) {
272 if (this->invariants_compare(B_invariants, A_invariants)) {
CRTP base class for implementing element and orbit comparison.
Element spatial_prepare(Element obj) const
Prepare an element for comparison via an isometric affine transformation.
std::unique_ptr< SymOpRepresentation > canonical_transform(Element const &obj) const
Access transform that took cluster from unprepared to prepared state.
SymOp const & spatial_transform() const
Access spatial transform that was used during most recent spatial preparation of an element.
typename traits< MostDerived >::Element Element
bool inter_orbit_compare_impl(const Element &A, const InvariantsType &A_invariants, const Element &B, const InvariantsType &B_invariants) const
Orders orbit prototypes, breaking invariants_compare ties.
typename Base::MostDerived MostDerived
Element representation_prepare(Element obj) const
Prepare an element for comparison via transformation of its internal representation.
Element copy_apply(SymOp const &op, Element obj) const
Applies SymOp to Element.
bool inter_orbit_equal(const Element &A, const InvariantsType &A_invariants, const Element &B, const InvariantsType &B_invariants) const
Check equivalence of prototypes in different orbit.
InvariantsType make_invariants(const Element &element) const
Make orbit invariants from one element in the orbit.
bool invariants_compare(const InvariantsType &A, const InvariantsType &B) const
Defines an order for orbits that have different invariants.
bool compare(const Element &A, const Element &B) const
Orders 'prepared' elements.
bool equal(const Element &A, const Element &B) const
Check equivalence of 'prepared' elements.
typename traits< MostDerived >::InvariantsType InvariantsType
type InvariantsType is used to screen elements for equivalence and sort orbits
Element prepare(Element obj) const
Prepare an element for comparison via representation_prepare(), followed by spatial_prepare()
bool inter_orbit_compare(const Element &A, const InvariantsType &A_invariants, const Element &B, const InvariantsType &B_invariants) const
Orders orbit prototypes, breaking invariants_compare ties.
bool invariants_equal(const InvariantsType &A, const InvariantsType &B) const
Check equivalence of invariants.
SymOp is the Coordinate representation of a symmetry operation it keeps fraction (FRAC) and Cartesian...
bool compare(ClusterInvariants const &A, ClusterInvariants const &B, double tol)
Compare ClusterInvariants.