ALPS Project

Header file parameterlist.h

This header contains the ParameterList class a vector of Parameters.

Synopsis

namespace alps {
class ParameterList : public std::vector<Parameters>
{
public:
  ParameterList() {}
  ParameterList(std::istream& is);
};

std::ostream& operator << (oxstream& os, const ParameterList& p);

std::istream& operator >> (std::istream& is, ParameterList& p);

ODump& operator <<(ODump& od, const ParameterList& p);
IDump& operator>>(IDump& id, ParameterList& p);
}

The ParameterList class

is a std::vector of Parameters

A ParameterList can be read from a std::istream and be written to a std::ostream.

ParameterList are defined using a C++-like syntax

global_parameters
{
parameters0
}
global_parameters
{
parameters1
}
...
where the parameter definitions in global_parameters up to the opening brace { and all the parameter definitions in parametersn will define one entry of the ParameterList.

An example is:

Model = "Heisenberg"
L=10
{ T=0.1, measure=yes}
{
  T=0.2
  measure=no
}
L = 20;
{ T=0.1, measure=yes}
{ T=0.2, measure=no}
This will be parsed into a vector of size four.
ParameterList();
the default constructor
ParameterList(std::istream& is);
parses parameters from an std::istream.
std::ostream& operator << (std::ostream& os, const ParameterList& p);
writes the ParameterList to a std::ostream. The above example will be written as:
{
measure = true
Model = "Heisenberg"
L = 10
T = 0.1
}
{
measure = false
Model = "Heisenberg"
L = 10
T = 0.2
}
{
measure = true
Model = "Heisenberg"
L = 20
T = 0.2
}
{
measure = false
Model = "Heisenberg"
L = 20
T = 0.2
}
This allows the output to be read again.
std::istream& operator >> (std::istream& is, ParameterList& p);
reads from a std::istream.
ODump& operator <<(ODump& od, const ParameterList& p);
IDump& operator>>(IDump& id, ParameterList& p);
serialize and deserialize the ParameterList object.

copyright (c) 1994-2010 by Matthias Troyer

Distributed under the Boost Software License, Version 1.0. (See http://www.boost.org/LICENSE_1_0.txt)