PSCF v1.1
|
Class template for a group of elements. More...
#include <SymmetryGroup.h>
Public Member Functions | |
SymmetryGroup () | |
Default constructor. More... | |
SymmetryGroup (const SymmetryGroup< Symmetry > &other) | |
Copy constructor. More... | |
~SymmetryGroup () | |
Destructor. More... | |
SymmetryGroup< Symmetry > & | operator= (const SymmetryGroup< Symmetry > &other) |
Assignment operator. More... | |
bool | add (Symmetry &symmetry) |
Add a new element to the group. More... | |
void | makeCompleteGroup () |
Generate a complete group from the current elements. More... | |
void | clear () |
Remove all elements except the identity. More... | |
const Symmetry * | find (const Symmetry &symmetry) const |
Find a symmetry within a group. More... | |
const Symmetry & | identity () const |
Return a reference to the identity element. More... | |
int | size () const |
Return number of elements in group (i.e., the order of the group). More... | |
Symmetry & | operator[] (int i) |
Element access operator (by reference). More... | |
const Symmetry & | operator[] (int i) const |
Element access operator (by reference). More... | |
bool | operator== (SymmetryGroup< Symmetry > const &other) const |
Equality operator. More... | |
bool | operator!= (SymmetryGroup< Symmetry > const &other) const |
Inequality operator. More... | |
bool | isValid () const |
Return true if valid complete group, or throw an Exception. More... | |
Class template for a group of elements.
This is written as a template to allow the creation of groups that use different types of objects to represent symmetry elements. The simplest distinction is between point groups and full space groups.
The algorithm requires only the template parameter class Symmetry satisfy the following requirements:
1) A Symmetry must be default constructible. 2) An operator * is provided to represent element multiplication. 3) Operators == and != are provided to represent equality & inequality. 4) A method Symmetry::inverse() must return the inverse of a Symmetry. 5) A static method Symmetry::identity() must return the identity.
Definition at line 36 of file SymmetryGroup.h.
Pscf::SymmetryGroup< Symmetry >::SymmetryGroup |
Default constructor.
After construction, the group contains only the identity element.
Definition at line 25 of file SymmetryGroup.tpp.
Pscf::SymmetryGroup< Symmetry >::SymmetryGroup | ( | const SymmetryGroup< Symmetry > & | other | ) |
Copy constructor.
Definition at line 35 of file SymmetryGroup.tpp.
References Pscf::SymmetryGroup< Symmetry >::identity(), and Pscf::SymmetryGroup< Symmetry >::size().
Pscf::SymmetryGroup< Symmetry >::~SymmetryGroup |
Destructor.
Definition at line 48 of file SymmetryGroup.tpp.
SymmetryGroup< Symmetry > & Pscf::SymmetryGroup< Symmetry >::operator= | ( | const SymmetryGroup< Symmetry > & | other | ) |
Assignment operator.
Definition at line 56 of file SymmetryGroup.tpp.
References Pscf::SymmetryGroup< Symmetry >::identity(), and Pscf::SymmetryGroup< Symmetry >::size().
bool Pscf::SymmetryGroup< Symmetry >::add | ( | Symmetry & | symmetry | ) |
Add a new element to the group.
Return false if the element was already present, true otherwise.
symmetry | new symmetry element. |
Definition at line 90 of file SymmetryGroup.tpp.
Referenced by Pscf::operator>>().
void Pscf::SymmetryGroup< Symmetry >::makeCompleteGroup |
Generate a complete group from the current elements.
Definition at line 110 of file SymmetryGroup.tpp.
Referenced by Pscf::Pspc::FilmIteratorBase< D, IteratorType >::checkSpaceGroup(), and Pscf::readGroup().
void Pscf::SymmetryGroup< Symmetry >::clear |
Remove all elements except the identity.
Return group to its state after default construction.
Definition at line 152 of file SymmetryGroup.tpp.
Referenced by Pscf::operator>>().
Symmetry const * Pscf::SymmetryGroup< Symmetry >::find | ( | const Symmetry & | symmetry | ) | const |
Find a symmetry within a group.
Return a pointer to a symmetry if it is in the group, or a null pointer if it is not.
Definition at line 74 of file SymmetryGroup.tpp.
Referenced by pscfpp.make.MakeMaker::find(), and Pscf::SymmetryGroup< Symmetry >::operator==().
|
inline |
Return a reference to the identity element.
Definition at line 169 of file SymmetryGroup.h.
Referenced by Pscf::SymmetryGroup< Symmetry >::operator=(), and Pscf::SymmetryGroup< Symmetry >::SymmetryGroup().
|
inline |
Return number of elements in group (i.e., the order of the group).
Definition at line 161 of file SymmetryGroup.h.
Referenced by pscfpp.file.File::__eq__(), pscfpp.text.Record::__init__(), pscfpp.file.File::__init__(), pscfpp.file.File::__repr__(), pscfpp.text.Record::__str__(), Pscf::Pspc::FilmIteratorBase< D, IteratorType >::checkSpaceGroup(), Pscf::operator<<(), Pscf::SymmetryGroup< Symmetry >::operator=(), Pscf::SymmetryGroup< Symmetry >::operator==(), and Pscf::SymmetryGroup< Symmetry >::SymmetryGroup().
|
inline |
Element access operator (by reference).
i | integer id for a symmetry element. |
Definition at line 177 of file SymmetryGroup.h.
|
inline |
Element access operator (by reference).
i | integer id for a symmetry element. |
Definition at line 185 of file SymmetryGroup.h.
bool Pscf::SymmetryGroup< Symmetry >::operator== | ( | SymmetryGroup< Symmetry > const & | other | ) | const |
Equality operator.
Return true if this and other are equivalent symmetry groups, false otherwise.
other | the group to which this one is compared. |
Definition at line 164 of file SymmetryGroup.tpp.
References Pscf::SymmetryGroup< Symmetry >::find(), and Pscf::SymmetryGroup< Symmetry >::size().
bool Pscf::SymmetryGroup< Symmetry >::operator!= | ( | SymmetryGroup< Symmetry > const & | other | ) | const |
Inequality operator.
Return true if this and other are inequivalent symmetry groups, and false if they are equivalent.
other | the group to which this one is compared. |
Definition at line 188 of file SymmetryGroup.tpp.
bool Pscf::SymmetryGroup< Symmetry >::isValid |
Return true if valid complete group, or throw an Exception.
Definition at line 196 of file SymmetryGroup.tpp.
References UTIL_THROW.