PSCF v1.1
Public Member Functions | List of all members
Pscf::SymmetryGroup< Symmetry > Class Template Reference

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

Detailed Description

template<class Symmetry>
class Pscf::SymmetryGroup< Symmetry >

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.

Constructor & Destructor Documentation

◆ SymmetryGroup() [1/2]

template<class Symmetry >
Pscf::SymmetryGroup< Symmetry >::SymmetryGroup

Default constructor.

After construction, the group contains only the identity element.

Definition at line 25 of file SymmetryGroup.tpp.

◆ SymmetryGroup() [2/2]

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

◆ ~SymmetryGroup()

template<class Symmetry >
Pscf::SymmetryGroup< Symmetry >::~SymmetryGroup

Destructor.

Definition at line 48 of file SymmetryGroup.tpp.

Member Function Documentation

◆ operator=()

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

◆ add()

template<class Symmetry >
bool Pscf::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 90 of file SymmetryGroup.tpp.

Referenced by Pscf::operator>>().

◆ makeCompleteGroup()

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

◆ clear()

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

◆ find()

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

◆ identity()

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

◆ size()

template<class Symmetry >
int Pscf::SymmetryGroup< Symmetry >::size
inline

◆ operator[]() [1/2]

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

Element access operator (by reference).

Parameters
iinteger id for a symmetry element.

Definition at line 177 of file SymmetryGroup.h.

◆ operator[]() [2/2]

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

Element access operator (by reference).

Parameters
iinteger id for a symmetry element.

Definition at line 185 of file SymmetryGroup.h.

◆ operator==()

template<class Symmetry >
bool Pscf::SymmetryGroup< Symmetry >::operator== ( SymmetryGroup< Symmetry > const &  other) const

Equality operator.

Return true if this and other are equivalent symmetry groups, false otherwise.

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

◆ operator!=()

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

Parameters
otherthe group to which this one is compared.

Definition at line 188 of file SymmetryGroup.tpp.

◆ isValid()

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


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