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);
}
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.
the default constructorParameterList();
parses parameters from an std::istream.ParameterList(std::istream& is);
writes the ParameterList to a std::ostream. The above example will be written as:std::ostream& operator << (std::ostream& os, const ParameterList& p);
{
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.
reads from a std::istream.std::istream& operator >> (std::istream& is, ParameterList& p);
serialize and deserialize the ParameterList object.ODump& operator <<(ODump& od, const ParameterList& p); IDump& operator>>(IDump& id, ParameterList& p);