CASM
1.1.0
A Clusters Approach to Statistical Mechanics
|
#include <GenericCluster.hh>
A CRTP base class for a cluster of anything.
GenericCluster provides a standard interface for clusters of various type. In particular, it is commonly necessary to iterate over elements in the cluster, access elements in the cluster, sort/permute elements in the cluster into a canonical representation, and compare clusters.
To implement this, there must be a traits class for the particular derived type of cluster with the following members:
The derived cluster type must implement public methods:
Optionally, the derived cluster type may specialize protected methods:
To implement the CRTP pattern:
Definition at line 47 of file GenericCluster.hh.
Public Types | |
typedef Base::MostDerived | MostDerived |
typedef traits< MostDerived >::Element | Element |
typedef Index | size_type |
typedef std::vector< Element >::value_type | value_type |
typedef std::vector< Element >::iterator | iterator |
typedef std::vector< Element >::const_iterator | const_iterator |
Public Member Functions | |
iterator | begin () |
Iterator to first element in the cluster. More... | |
const_iterator | begin () const |
Iterator to first element in the cluster. More... | |
iterator | end () |
Iterator to the past-the-last element in the cluster. More... | |
const_iterator | end () const |
Iterator to the past-the-last element in the cluster. More... | |
const_iterator | cbegin () const |
Iterator to first element in the cluster. More... | |
const_iterator | cend () const |
Iterator to the past-the-last element in the cluster. More... | |
size_type | size () const |
Number of elements in the cluster. More... | |
value_type & | operator[] (size_type index) |
Access an element in the cluster by index. More... | |
value_type const & | operator[] (size_type index) const |
Access an element in the cluster by index. More... | |
value_type & | element (size_type index) |
Access an element in the cluster by index. More... | |
value_type const & | element (size_type index) const |
Access a UnitCellCoord in the cluster by index. More... | |
MostDerived & | sort () |
MostDerived | sorted () const |
bool | is_sorted () const |
Permutation | sort_permutation () const |
bool | operator< (MostDerived const &B) const |
bool | operator> (const MostDerived &B) const |
bool | operator<= (const MostDerived &B) const |
bool | operator>= (const MostDerived &B) const |
bool | operator== (const MostDerived &B) const |
bool | operator!= (const MostDerived &B) const |
Protected Member Functions | |
GenericCluster () | |
Construct an empty GenericCluster. More... | |
MostDerived & | sort_impl () |
bool | is_sorted_impl () const |
Permutation | sort_permutation_impl () const |
bool | compare_impl (MostDerived const &B) const |
bool | eq_impl (const MostDerived &B) const |
bool | ne_impl (const MostDerived &B) const |
typedef std::vector<Element>::const_iterator CASM::GenericCluster< Base >::const_iterator |
Definition at line 57 of file GenericCluster.hh.
typedef traits<MostDerived>::Element CASM::GenericCluster< Base >::Element |
Definition at line 52 of file GenericCluster.hh.
typedef std::vector<Element>::iterator CASM::GenericCluster< Base >::iterator |
Definition at line 56 of file GenericCluster.hh.
typedef Base::MostDerived CASM::GenericCluster< Base >::MostDerived |
Definition at line 49 of file GenericCluster.hh.
typedef Index CASM::GenericCluster< Base >::size_type |
Definition at line 53 of file GenericCluster.hh.
typedef std::vector<Element>::value_type CASM::GenericCluster< Base >::value_type |
Definition at line 55 of file GenericCluster.hh.
|
inlineprotected |
Construct an empty GenericCluster.
Definition at line 115 of file GenericCluster.hh.
|
inline |
Iterator to first element in the cluster.
Definition at line 60 of file GenericCluster.hh.
|
inline |
Iterator to first element in the cluster.
Definition at line 63 of file GenericCluster.hh.
|
inline |
Iterator to first element in the cluster.
Definition at line 72 of file GenericCluster.hh.
|
inline |
Iterator to the past-the-last element in the cluster.
Definition at line 75 of file GenericCluster.hh.
|
inlineprotected |
Definition at line 135 of file GenericCluster.hh.
|
inline |
Access an element in the cluster by index.
Definition at line 89 of file GenericCluster.hh.
|
inline |
Access a UnitCellCoord in the cluster by index.
Definition at line 92 of file GenericCluster.hh.
|
inline |
Iterator to the past-the-last element in the cluster.
Definition at line 66 of file GenericCluster.hh.
|
inline |
Iterator to the past-the-last element in the cluster.
Definition at line 69 of file GenericCluster.hh.
|
inlineprotectedinherited |
Definition at line 40 of file Comparisons.hh.
|
inline |
Definition at line 103 of file GenericCluster.hh.
|
inlineprotected |
Definition at line 122 of file GenericCluster.hh.
|
inlineprotectedinherited |
Definition at line 44 of file Comparisons.hh.
|
inlineinherited |
Definition at line 37 of file Comparisons.hh.
|
inline |
Definition at line 109 of file GenericCluster.hh.
|
inlineinherited |
Definition at line 31 of file Comparisons.hh.
|
inlineinherited |
Definition at line 35 of file Comparisons.hh.
|
inlineinherited |
Definition at line 29 of file Comparisons.hh.
|
inlineinherited |
Definition at line 33 of file Comparisons.hh.
|
inline |
Access an element in the cluster by index.
Definition at line 81 of file GenericCluster.hh.
|
inline |
Access an element in the cluster by index.
Definition at line 84 of file GenericCluster.hh.
|
inline |
Number of elements in the cluster.
Definition at line 78 of file GenericCluster.hh.
|
inline |
Definition at line 96 of file GenericCluster.hh.
|
inlineprotected |
Definition at line 117 of file GenericCluster.hh.
|
inline |
Definition at line 105 of file GenericCluster.hh.
|
inlineprotected |
Definition at line 124 of file GenericCluster.hh.
|
inline |
Definition at line 98 of file GenericCluster.hh.