Simpatico
v1.10
|
Class template for a group of elements of type Symmetry.
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 29 of file SymmetryGroup.h.
#include <SymmetryGroup.h>
Public Member Functions | |
SymmetryGroup () | |
Default constructor. More... | |
SymmetryGroup (const SymmetryGroup &other) | |
Copy constructor. More... | |
~SymmetryGroup () | |
Destructor. More... | |
bool | add (Symmetry &symmetry) |
Add a new element to the group. More... | |
void | makeCompleteGroup () |
Generate a complete group from the current elements. 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. More... | |
SymmetryGroup & | operator= (const SymmetryGroup &other) |
Assignment operator. More... | |
Symmetry & | operator[] (int i) |
Element access operator (by reference). More... | |
const Symmetry & | operator[] (int i) const |
Element access operator (by reference). More... | |
bool | isValid () const |
Return true if valid complete group, or throw an Exception. More... | |
Util::SymmetryGroup< Symmetry >::SymmetryGroup | ( | ) |
Default constructor.
Definition at line 117 of file SymmetryGroup.h.
Util::SymmetryGroup< Symmetry >::SymmetryGroup | ( | const SymmetryGroup< Symmetry > & | other | ) |
Copy constructor.
Definition at line 127 of file SymmetryGroup.h.
References Util::SymmetryGroup< Symmetry >::identity(), and Util::SymmetryGroup< Symmetry >::size().
Util::SymmetryGroup< Symmetry >::~SymmetryGroup | ( | ) |
Destructor.
Definition at line 139 of file SymmetryGroup.h.
bool Util::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 180 of file SymmetryGroup.h.
References Util::SymmetryGroup< Symmetry >::find().
Referenced by Util::SymmetryGroup< Symmetry >::makeCompleteGroup(), McMd::StructureFactorPGrid::readParameters(), McMd::StructureFactorGrid::readParameters(), DdMd::StructureFactorGrid::readParameters(), McMd::IntraStructureFactorGrid::readParameters(), and McMd::StructureFactorPGrid::save().
void Util::SymmetryGroup< Symmetry >::makeCompleteGroup | ( | ) |
Generate a complete group from the current elements.
Definition at line 198 of file SymmetryGroup.h.
References Util::SymmetryGroup< Symmetry >::add(), and Util::SymmetryGroup< Symmetry >::size().
Referenced by McMd::StructureFactorGrid::readParameters(), McMd::StructureFactorPGrid::readParameters(), DdMd::StructureFactorGrid::readParameters(), McMd::IntraStructureFactorGrid::readParameters(), and McMd::StructureFactorPGrid::save().
const Symmetry * Util::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 165 of file SymmetryGroup.h.
References Util::SymmetryGroup< Symmetry >::size().
Referenced by Util::SymmetryGroup< Symmetry >::add(), and Util::SymmetryGroup< Symmetry >::isValid().
|
inline |
Return a reference to the identity element.
Definition at line 290 of file SymmetryGroup.h.
Referenced by Util::SymmetryGroup< Symmetry >::operator=(), and Util::SymmetryGroup< Symmetry >::SymmetryGroup().
|
inline |
Return number of elements in group.
Definition at line 283 of file SymmetryGroup.h.
Referenced by Util::SymmetryGroup< Symmetry >::find(), Util::SymmetryGroup< Symmetry >::isValid(), Util::SymmetryGroup< Symmetry >::makeCompleteGroup(), Util::operator<<(), Util::SymmetryGroup< Symmetry >::operator=(), and Util::SymmetryGroup< Symmetry >::SymmetryGroup().
SymmetryGroup< Symmetry > & Util::SymmetryGroup< Symmetry >::operator= | ( | const SymmetryGroup< Symmetry > & | other | ) |
Assignment operator.
Definition at line 147 of file SymmetryGroup.h.
References Util::SymmetryGroup< Symmetry >::identity(), and Util::SymmetryGroup< Symmetry >::size().
|
inline |
Element access operator (by reference).
Definition at line 297 of file SymmetryGroup.h.
|
inline |
Element access operator (by reference).
Definition at line 304 of file SymmetryGroup.h.
bool Util::SymmetryGroup< Symmetry >::isValid | ( | ) | const |
Return true if valid complete group, or throw an Exception.
Definition at line 241 of file SymmetryGroup.h.
References Util::SymmetryGroup< Symmetry >::find(), Util::SymmetryGroup< Symmetry >::size(), and UTIL_THROW.