ALPS MPS Codes
Reference documentation.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Functions
z2.h File Reference
#include <iostream>
#include <boost/functional/hash.hpp>
#include <alps/hdf5.hpp>
#include <boost/serialization/serialization.hpp>
#include <boost/serialization/array.hpp>

Go to the source code of this file.

Classes

class  Ztwo
 

Functions

void save (alps::hdf5::archive &ar, std::string const &p, Ztwo::charge const &v, std::vector< std::size_t > size=std::vector< std::size_t >(), std::vector< std::size_t > chunk=std::vector< std::size_t >(), std::vector< std::size_t > offset=std::vector< std::size_t >())
 
void load (alps::hdf5::archive &ar, std::string const &p, Ztwo::charge &v, std::vector< std::size_t > size=std::vector< std::size_t >(), std::vector< std::size_t > chunk=std::vector< std::size_t >(), std::vector< std::size_t > offset=std::vector< std::size_t >())
 
template<class Archive >
void serialize (Archive &ar, Ztwo::charge &c, const unsigned int version)
 
Ztwo::charge operator- (Ztwo::charge a)
 
std::ostream & operator<< (std::ostream &ost, Ztwo::charge c)
 
std::ostream & operator<< (std::ostream &ost, const std::vector< Ztwo::charge > &c)
 

Function Documentation

void load ( alps::hdf5::archive &  ar,
std::string const &  p,
Ztwo::charge v,
std::vector< std::size_t >  size = std::vector<std::size_t>(),
std::vector< std::size_t >  chunk = std::vector<std::size_t>(),
std::vector< std::size_t >  offset = std::vector<std::size_t>() 
)
inline

Definition at line 75 of file z2.h.

81 {
82  int t;
83  ar[p] >> t;
84  v = (t == 0 ? Ztwo::Plus : Ztwo::Minus);
85 }
Definition: z2.h:41
Definition: z2.h:41
Ztwo::charge operator- ( Ztwo::charge  a)
inline

Definition at line 93 of file z2.h.

93 { return a; }
std::ostream& operator<< ( std::ostream &  ost,
Ztwo::charge  c 
)
inline

Definition at line 95 of file z2.h.

96 {
97  if (c == Ztwo::Plus)
98  ost << "Plus";
99  else if (c == Ztwo::Minus)
100  ost << "Minus";
101  else
102  ost << "???";
103  return ost;
104 }
Definition: z2.h:41
Definition: z2.h:41
std::ostream& operator<< ( std::ostream &  ost,
const std::vector< Ztwo::charge > &  c 
)
inline

Definition at line 105 of file z2.h.

106 {
107  ost << "[ ";
108  for (std::vector<Ztwo::charge>::const_iterator it = c.begin();
109  it != c.end();
110  it++)
111  ost << ", " << *it;
112  ost << " ]";
113  return ost;
114 }
void save ( alps::hdf5::archive &  ar,
std::string const &  p,
Ztwo::charge const &  v,
std::vector< std::size_t >  size = std::vector<std::size_t>(),
std::vector< std::size_t >  chunk = std::vector<std::size_t>(),
std::vector< std::size_t >  offset = std::vector<std::size_t>() 
)
inline

Definition at line 65 of file z2.h.

71 {
72  ar[p] << static_cast<int>(v);
73 }
template<class Archive >
void serialize ( Archive &  ar,
Ztwo::charge c,
const unsigned int  version 
)
inline

Definition at line 88 of file z2.h.

89 {
90  ar & c;
91 }