1 #ifndef CASM_VectorSymCompare_impl
2 #define CASM_VectorSymCompare_impl
16 template <
typename Derived>
18 Eigen::MatrixBase<Derived>
const &obj,
double _tol) {
19 typename Derived::PlainObject result =
23 .leftCols(obj.cols());
25 for (
CASM::Index row = 0; row < result.rows(); ++row) {
27 for (i = col; i < result.cols(); ++i) {
29 result.col(i) *= std::abs(result(row, i)) / result(row, i);
42 template <
typename Base>
48 template <
typename Base>
51 return InvariantsType{obj};
62 template <
typename Base>
64 InvariantsType
const &A_invariants,
65 InvariantsType
const &B_invariants)
const {
74 template <
typename Base>
85 template <
typename Base>
92 template <
typename Base>
94 return m_spatial_transform;
102 template <
typename Base>
103 std::unique_ptr<SymOpRepresentation>
105 return std::unique_ptr<SymOpRepresentation>(
116 template <
typename Element,
typename SymApply>
CRTP Base class for Vector comparisons.
double tol() const
Return tolerance.
InvariantsType make_invariants_impl(Element const &obj) const
Make orbit invariants from one element in the orbit.
typename traits< MostDerived >::Element Element
bool invariants_compare_impl(InvariantsType const &A_invariants, InvariantsType const &B_invariants) const
Orders 'prepared' elements in the same orbit.
bool compare_impl(const Element &A, const Element &B) const
Compares 'prepared' elements.
std::unique_ptr< SymOpRepresentation > canonical_transform_impl(Element const &obj) const
Returns transformation that takes 'obj' to its prepared (canonical) form.
SymOp const & spatial_transform_impl() const
Spatial prepare does not apply – transform is always identity.
Element spatial_prepare_impl(Element obj) const
Spatial prepare does not apply – element is returned unchanged.
Element representation_prepare_impl(Element obj) const
Prepare an element for comparison by rotating, sorting, and changing sign of column vectors.
typename traits< MostDerived >::Element Element
Generalized symmetry matrix representation for arbitrary dimension Can be used to describe applicatio...
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.
bool colmajor_lex_compare(const Eigen::MatrixBase< Derived > &A, const Eigen::MatrixBase< Derived > &B, double tol)
Floating point lexicographical comparison with tol.
bool almost_zero(const T &val, double tol=TOL)
If T is not integral, use std::abs(val) < tol;.
INDEX_TYPE Index
For long integer indexing:
Derived::PlainObject reduced_column_echelon(Eigen::MatrixBase< Derived > const &M, double _tol)
Derived::PlainObject representation_prepare_impl(Eigen::MatrixBase< Derived > const &obj, double _tol)
Prepare an element for comparison.