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
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.global_parameters { parameters0 } global_parameters { parameters1 } ...
An example is:
This will be parsed into a vector of size four.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}
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);
This allows the output to be read again.{ 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 }
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);
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)