1 #ifndef CASM_ConfigDoFIsEquivalent
2 #define CASM_ConfigDoFIsEquivalent
15 namespace ConfigDoFIsEquivalent {
55 std::unique_ptr<Base>
clone()
const {
56 return std::unique_ptr<Base>(this->
_clone());
77 [&](
Index i) {
return other.
occ(i); });
113 template <
typename F,
typename G>
117 if (!
_check(f(i), g(i))) {
128 template <
typename T>
129 bool _check(
const T &A,
const T &B)
const {
168 [&](
Index i) {
return other.
occ(i); });
219 template <
typename F,
typename G>
223 if (!
_check(f(i), g(i))) {
260 template <
typename T>
261 bool _check(
const T &A,
const T &B)
const {
297 template <
typename T>
298 bool _check(
const T &A,
const T &B)
const {
349 :
Local(_config.configdof(), _key, _tol) {}
362 [&](
Index i,
Index j) {
return (*other_ptr).values()(i, j); });
435 before.
sublat(b).topRows(rows);
449 before.
sublat(b).topRows(rows);
462 template <
typename F,
typename G>
467 if (!
_check(f(i, j), g(i, j))) {
515 :
Global(_config.configdof(), _key, _tol) {}
610 template <
typename F,
typename G>
614 if (!
_check(f(i), g(i))) {
Index size() const
Number of sites in the ConfigDoF.
Index n_vol() const
Integer volume of ConfigDoF.
bool has_local_dof(DoFKey const &_key) const
Index n_sublat() const
Number of sublattices in ConfigDoF.
bool has_global_dof(DoFKey const &_key) const
GlobalContinuousConfigDoFValues const & global_dof(DoFKey const &_key) const
int & occ(Index i)
Reference occupation value on site i.
LocalContinuousConfigDoFValues const & local_dof(DoFKey const &_key) const
AnisoOccupation * _clone() const override
bool _for_each(F f, G g) const
bool operator()(ConfigDoF const &other) const override
Return config == other, store config < other.
ConfigDoF const & configdof() const
void _update_B(PermuteIterator const &B, ConfigDoF const &before) const
bool operator()(PermuteIterator const &B) const override
Return config == B*config, store config < B*config.
Eigen::VectorXi m_new_occ_B
bool operator()(PermuteIterator const &A, PermuteIterator const &B, ConfigDoF const &other) const override
Return A*config == B*other, store A*config < B*other.
bool operator()(PermuteIterator const &A, PermuteIterator const &B) const override
Return A*config == B*config, store A*config < B*config.
void _update_A(PermuteIterator const &A, ConfigDoF const &before) const
bool _check(const T &A, const T &B) const
ConfigDoF const * m_configdof_ptr
bool operator()(PermuteIterator const &B, ConfigDoF const &other) const override
Return config == B*other, store config < B*other.
Eigen::VectorXi m_new_occ_A
AnisoOccupation(ConfigDoF const &_configdof)
Base class for functors that compare ConfigDoF.
bool operator()(Configuration const &other) const
Return config == other.
std::unique_ptr< Base > clone() const
virtual bool operator()(PermuteIterator const &A, PermuteIterator const &B, ConfigDoF const &other) const =0
Return A*config == B*other.
virtual bool operator()(PermuteIterator const &A) const =0
Return config == A*config.
virtual bool operator()(PermuteIterator const &A, PermuteIterator const &B) const =0
Return A*config == B*config.
virtual Base * _clone() const =0
bool is_less() const
Returns less than comparison.
virtual bool operator()(ConfigDoF const &other) const =0
Return config == other.
virtual bool operator()(PermuteIterator const &A, ConfigDoF const &other) const =0
Return config == A*other.
Abstract base class specialization of Base for floating point DoF types.
Float(double _tol, DoFKey const &_key)
DoFKey const & key() const
bool _check(const T &A, const T &B) const
double _new_dof_A(Index i) const
GlobalContinuousConfigDoFValues m_new_dof_A
bool operator()(PermuteIterator const &A, PermuteIterator const &B, ConfigDoF const &other) const override
Return A*config == B*other, store A*config < B*other.
bool operator()(PermuteIterator const &B, ConfigDoF const &other) const override
Return config == B*other, store config < B*other.
GlobalContinuousConfigDoFValues const & _values() const
double _new_dof_B(Index i) const
bool operator()(PermuteIterator const &B) const override
Return config == B*config, store config < B*config.
Base * _clone() const override
GlobalContinuousConfigDoFValues const * m_values_ptr
Global(Configuration const &_config, DoFKey const &_key, double _tol)
GlobalContinuousConfigDoFValues m_new_dof_B
GlobalContinuousConfigDoFValues m_zeros
bool operator()(PermuteIterator const &A, PermuteIterator const &B) const override
Return A*config == B*config, store A*config < B*config.
void _update_A(PermuteIterator const &A, GlobalContinuousConfigDoFValues const &before) const
void _update_B(PermuteIterator const &B, GlobalContinuousConfigDoFValues const &before) const
double _values(Index i) const
bool operator()(ConfigDoF const &other) const override
Return config == other, store config < other.
Global(ConfigDoF const &_configdof, DoFKey const &_key, double _tol)
bool _for_each(F f, G g) const
bool operator()(PermuteIterator const &A, PermuteIterator const &B) const override
Return A*config == B*config, store A*config < B*config.
bool operator()(PermuteIterator const &B) const override
Return config == B*config, store config < B*config.
LocalContinuousConfigDoFValues const & _values() const
bool operator()(PermuteIterator const &A, PermuteIterator const &B, ConfigDoF const &other) const override
Return A*config == B*other, store A*config < B*other.
double new_dof_B(Index i, Index j) const
bool operator()(PermuteIterator const &B, ConfigDoF const &other) const override
Return config == B*other, store config < B*other.
double new_dof_A(Index i, Index j) const
LocalContinuousConfigDoFValues m_new_dof_A
LocalContinuousConfigDoFValues m_zeros
LocalContinuousConfigDoFValues const * m_values_ptr
LocalContinuousConfigDoFValues m_new_dof_B
Local(ConfigDoF const &_configdof, DoFKey const &_key, double _tol)
bool operator()(ConfigDoF const &other) const override
Return config == other, store config < other.
void _update_A(PermuteIterator const &A, LocalContinuousConfigDoFValues const &before) const
Local(Configuration const &_config, DoFKey const &_key, double _tol)
Base * _clone() const override
void _update_B(PermuteIterator const &B, LocalContinuousConfigDoFValues const &before) const
bool _for_each(F f, G g) const
ConfigDoF const & configdof() const
Occupation * _clone() const override
bool operator()(PermuteIterator const &A, ConfigDoF const &other) const override
Return config == A*other, store config < A*other.
bool operator()(PermuteIterator const &A, PermuteIterator const &B, ConfigDoF const &other) const override
Return A*config == B*other, store A*config < B*other.
Occupation(ConfigDoF const &_configdof)
bool _for_each(F f, G g) const
bool _check(const T &A, const T &B) const
bool operator()(PermuteIterator const &A) const override
Return config == A*config, store config < A*config.
ConfigDoF const * m_configdof_ptr
bool operator()(PermuteIterator const &A, PermuteIterator const &B) const override
Return A*config == B*config, store A*config < B*config.
bool operator()(ConfigDoF const &other) const override
Return config == other, store config < other.
const ConfigDoF & configdof() const
const Access the DoF
Eigen::VectorXd const & values() const
Const access global DoF values.
void setZero()
Set DoF values to zero.
void set_values(Eigen::Ref< const Eigen::MatrixXd > const &_values)
Set global DoF values.
SublatReference sublat(Index b)
Access matrix block of values for all sites on one sublattice.
Eigen::MatrixXd const & values() const
Const access DoF values (prim DoF basis, matrix representing all sites)
void setZero()
Set DoF values to zero.
SymOpRepresentation const & global_dof_rep(DoFKey const &_key) const
Index factor_group_index() const
Return the supercell factor group index.
SymOpRepresentation const & local_dof_rep(DoFKey const &_key, Index b) const
SymOpRepresentation const & occ_rep(Index b) const
Index permute_ind(Index i) const
virtual Permutation const * permutation() const
virtual Eigen::MatrixXd const * MatrixXd() const
DoF_impl::OccupationDoFTraits occupation()
INDEX_TYPE Index
For long integer indexing: