Simpatico  v1.10
List of all members | Public Member Functions
Util::SymmetryGroup< Symmetry > Class Template Reference

Detailed Description

template<class Symmetry>
class Util::SymmetryGroup< Symmetry >

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...
 
SymmetryGroupoperator= (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...
 

Constructor & Destructor Documentation

template<class Symmetry >
Util::SymmetryGroup< Symmetry >::SymmetryGroup ( )

Default constructor.

Definition at line 117 of file SymmetryGroup.h.

template<class Symmetry >
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().

template<class Symmetry >
Util::SymmetryGroup< Symmetry >::~SymmetryGroup ( )

Destructor.

Definition at line 139 of file SymmetryGroup.h.

Member Function Documentation

template<class Symmetry>
bool Util::SymmetryGroup< Symmetry >::add ( Symmetry &  symmetry)

Add a new element to the group.

Return false if the element was already present, true otherwise.

Parameters
symmetrynew symmetry element.
Returns
true if this is a new element, false if already present.

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().

template<class Symmetry >
void Util::SymmetryGroup< Symmetry >::makeCompleteGroup ( )
template<class Symmetry>
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().

template<class Symmetry >
const Symmetry & Util::SymmetryGroup< Symmetry >::identity ( ) const
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().

template<class Symmetry >
int Util::SymmetryGroup< Symmetry >::size ( ) const
inline
template<class Symmetry >
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().

template<class Symmetry >
Symmetry & Util::SymmetryGroup< Symmetry >::operator[] ( int  i)
inline

Element access operator (by reference).

Definition at line 297 of file SymmetryGroup.h.

template<class Symmetry >
const Symmetry & Util::SymmetryGroup< Symmetry >::operator[] ( int  i) const
inline

Element access operator (by reference).

Definition at line 304 of file SymmetryGroup.h.

template<class Symmetry >
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.


The documentation for this class was generated from the following file: