ALPS MPS Codes
Reference documentation.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Attributes | Friends | List of all members
ZqCharge< Q > Class Template Reference

#include <zq.h>

Public Member Functions

 ZqCharge (unsigned int c=0)
 
bool operator== (ZqCharge< Q > b) const
 
bool operator!= (ZqCharge< Q > b) const
 
ZqCharge operator- () const
 
unsigned int get ()
 
template<class Archive >
void save (Archive &ar) const
 
template<class Archive >
void load (Archive &ar)
 
template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 

Protected Attributes

unsigned int c_
 

Friends

ZqCharge< Q > operator+ (ZqCharge< Q > a, ZqCharge< Q > b)
 
std::ostream & operator<< (std::ostream &os, ZqCharge< Q > c)
 
bool operator< (ZqCharge< Q > a, ZqCharge< Q > b)
 
bool operator> (ZqCharge< Q > a, ZqCharge< Q > b)
 

Detailed Description

template<int Q>
class ZqCharge< Q >

Definition at line 42 of file zq.h.

Constructor & Destructor Documentation

template<int Q>
ZqCharge< Q >::ZqCharge ( unsigned int  c = 0)
inline

Definition at line 66 of file zq.h.

66 : c_(c) { }
unsigned int c_
Definition: zq.h:90

Member Function Documentation

template<int Q>
unsigned int ZqCharge< Q >::get ( )
inline

Definition at line 78 of file zq.h.

78 { return c_; }
unsigned int c_
Definition: zq.h:90
template<int Q>
template<class Archive >
void ZqCharge< Q >::load ( Archive &  ar)
inline

Definition at line 81 of file zq.h.

81 { ar["c"] >> c_; }
unsigned int c_
Definition: zq.h:90
template<int Q>
bool ZqCharge< Q >::operator!= ( ZqCharge< Q >  b) const
inline

Definition at line 69 of file zq.h.

69 { return c_ != b.c_; }
unsigned int c_
Definition: zq.h:90
template<int Q>
ZqCharge ZqCharge< Q >::operator- ( ) const
inline

Definition at line 70 of file zq.h.

71  {
72  if (c_ == 0)
73  return 0;
74  else
75  return Q-c_;
76  }
unsigned int c_
Definition: zq.h:90
template<int Q>
bool ZqCharge< Q >::operator== ( ZqCharge< Q >  b) const
inline

Definition at line 68 of file zq.h.

68 { return c_ == b.c_; }
unsigned int c_
Definition: zq.h:90
template<int Q>
template<class Archive >
void ZqCharge< Q >::save ( Archive &  ar) const
inline

Definition at line 80 of file zq.h.

80 { ar["c"] << c_; }
unsigned int c_
Definition: zq.h:90
template<int Q>
template<class Archive >
void ZqCharge< Q >::serialize ( Archive &  ar,
const unsigned int  version 
)
inline

Definition at line 84 of file zq.h.

85  {
86  ar & c_;
87  }
unsigned int c_
Definition: zq.h:90

Friends And Related Function Documentation

template<int Q>
ZqCharge<Q> operator+ ( ZqCharge< Q >  a,
ZqCharge< Q >  b 
)
friend

Definition at line 44 of file zq.h.

45  {
46  return ZqCharge<Q>((a.c_+b.c_)%Q);
47  }
Definition: zq.h:42
unsigned int c_
Definition: zq.h:90
template<int Q>
bool operator< ( ZqCharge< Q >  a,
ZqCharge< Q >  b 
)
friend

Definition at line 55 of file zq.h.

56  {
57  return a.c_ < b.c_;
58  }
unsigned int c_
Definition: zq.h:90
template<int Q>
std::ostream& operator<< ( std::ostream &  os,
ZqCharge< Q >  c 
)
friend

Definition at line 49 of file zq.h.

50  {
51  os << c.get();
52  return os;
53  }
unsigned int get()
Definition: zq.h:78
template<int Q>
bool operator> ( ZqCharge< Q >  a,
ZqCharge< Q >  b 
)
friend

Definition at line 60 of file zq.h.

61  {
62  return a.c_ > b.c_;
63  }
unsigned int c_
Definition: zq.h:90

Member Data Documentation

template<int Q>
unsigned int ZqCharge< Q >::c_
protected

Definition at line 90 of file zq.h.


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