|
PSCF v1.5.0
|
Class template for a group of elements. More...
#include <SymmetryGroup.h>
Public Member Functions | |
| SymmetryGroup () | |
| Default constructor. | |
| SymmetryGroup (const SymmetryGroup< Symmetry > &other) | |
| Copy constructor. | |
| virtual | ~SymmetryGroup ()=default |
| Destructor. | |
| SymmetryGroup< Symmetry > & | operator= (const SymmetryGroup< Symmetry > &other) |
| Assignment operator. | |
| bool | add (Symmetry &symmetry) |
| Add a new element to the group. | |
| void | makeCompleteGroup () |
| Generate a complete group from the current elements. | |
| void | clear () |
| Remove all elements except the identity. | |
| const Symmetry * | find (const Symmetry &symmetry) const |
| Find a symmetry within a group. | |
| const Symmetry & | identity () const |
| Return a reference to the identity element. | |
| int | size () const |
| Return number of elements in group (i.e., the order of the group). | |
| Symmetry & | operator[] (int i) |
| Element access operator (by reference). | |
| const Symmetry & | operator[] (int i) const |
| Element access operator (by reference). | |
| bool | operator== (SymmetryGroup< Symmetry > const &other) const |
| Equality operator. | |
| bool | operator!= (SymmetryGroup< Symmetry > const &other) const |
| Inequality operator. | |
| bool | isValid () const |
| Return true if valid complete group, or throw an Exception. | |
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:
Definition at line 35 of file SymmetryGroup.h.
| Pscf::SymmetryGroup< Symmetry >::SymmetryGroup | ( | ) |
Default constructor.
After construction, the group contains only the identity element.
Definition at line 24 of file SymmetryGroup.tpp.
Referenced by operator!=(), operator=(), operator==(), SymmetryGroup(), and ~SymmetryGroup().
| Pscf::SymmetryGroup< Symmetry >::SymmetryGroup | ( | const SymmetryGroup< Symmetry > & | other | ) |
Copy constructor.
Definition at line 34 of file SymmetryGroup.tpp.
References identity(), size(), and SymmetryGroup().
|
virtualdefault |
Destructor.
References add(), clear(), find(), makeCompleteGroup(), and SymmetryGroup().
| SymmetryGroup< Symmetry > & Pscf::SymmetryGroup< Symmetry >::operator= | ( | const SymmetryGroup< Symmetry > & | other | ) |
Assignment operator.
Definition at line 48 of file SymmetryGroup.tpp.
References identity(), size(), and SymmetryGroup().
| 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 82 of file SymmetryGroup.tpp.
Referenced by makeCompleteGroup(), Pscf::operator>>(), and ~SymmetryGroup().
| void Pscf::SymmetryGroup< Symmetry >::makeCompleteGroup | ( | ) |
Generate a complete group from the current elements.
Definition at line 102 of file SymmetryGroup.tpp.
Referenced by ~SymmetryGroup().
| void Pscf::SymmetryGroup< Symmetry >::clear | ( | ) |
Remove all elements except the identity.
Return group to its state after default construction.
Definition at line 144 of file SymmetryGroup.tpp.
Referenced by Pscf::operator>>(), Pscf::readGroup(), and ~SymmetryGroup().
| 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 66 of file SymmetryGroup.tpp.
References size().
Referenced by pscfpp.make.MakeMaker::find(), isValid(), operator==(), and ~SymmetryGroup().
|
inline |
Return a reference to the identity element.
Definition at line 168 of file SymmetryGroup.h.
Referenced by operator=(), and SymmetryGroup().
|
inline |
Return number of elements in group (i.e., the order of the group).
Definition at line 160 of file SymmetryGroup.h.
Referenced by Pscf::Rp::FilmFieldGenExtBase< D >::checkCompatibility(), Pscf::Rp::FilmFieldGenMaskBase< D >::checkSpaceGroup(), find(), isValid(), makeCompleteGroup(), Pscf::operator<<(), operator=(), operator==(), and SymmetryGroup().
|
inline |
Element access operator (by reference).
| i | integer id for a symmetry element. |
Definition at line 176 of file SymmetryGroup.h.
|
inline |
Element access operator (by reference).
| i | integer id for a symmetry element. |
Definition at line 184 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 156 of file SymmetryGroup.tpp.
References find(), size(), and SymmetryGroup().
| 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 180 of file SymmetryGroup.tpp.
References SymmetryGroup().
| bool Pscf::SymmetryGroup< Symmetry >::isValid | ( | ) | const |
Return true if valid complete group, or throw an Exception.
Definition at line 188 of file SymmetryGroup.tpp.
References find(), size(), and UTIL_THROW.