3
0
mirror of https://github.com/triqs/dft_tools synced 2024-12-25 13:53:40 +01:00

Work on documentation

This commit is contained in:
Olivier Parcollet 2013-11-19 08:32:56 +01:00
parent 17ab555213
commit b251929138

View File

@ -142,9 +142,9 @@ Parameter default value example
.. compileblock:: c .. compileblock:: c
#include <triqs/parameters/parameters.hpp> #include <triqs/parameters.hpp>
#include <triqs/parameters/defaults.hpp> using triqs::utility::parameters;
using namespace triqs::utility; using triqs::utility::parameter_defaults;
int main() { int main() {
@ -152,14 +152,10 @@ Parameter default value example
P["Beta"] = 3.14; P["Beta"] = 3.14;
parameter_defaults pdef; parameter_defaults pdef;
pdef.required pdef.required("Beta", double(), "Inverse temperature")
( "Beta", double(), "Inverse temperature") .optional("Alpha", int(1000), "An integer")
; .optional("Gamma", double(0.9), "A double");
pdef.optional
( "Alpha", int(1000), "An integer")
( "Gamma", double(0.9), "A double")
;
std::cout<<pdef<<std::endl; // print a comprehensive list of parameters: std::cout<<pdef<<std::endl; // print a comprehensive list of parameters:
std::cout<<P<<std::endl; std::cout<<P<<std::endl;
P.update(pdef); // check whether required parameters are present and update optional ones P.update(pdef); // check whether required parameters are present and update optional ones