21#ifndef VOTCA_XTP_RESULTFILE_H
22#define VOTCA_XTP_RESULTFILE_H
45 text_ <<
"# " << title <<
"\n# key value unit\n";
46 text_ << std::setprecision(12);
49 void Add(
const std::string& key,
double value,
const std::string& unit) {
50 text_ << key <<
" " << value <<
" " << unit <<
"\n";
52 void Add(
const std::string& key,
Index value) {
53 text_ << key <<
" " << value <<
" -\n";
55 void Add(
const std::string& key,
const std::string& value) {
56 text_ << key <<
" " << value <<
" -\n";
59 void Write(
const std::string& filename)
const {
60 std::ofstream out(filename);
62 throw std::runtime_error(
"Cannot write " + filename);
void Add(const std::string &key, const std::string &value)
void Write(const std::string &filename) const
void Add(const std::string &key, Index value)
void Add(const std::string &key, double value, const std::string &unit)
ResultFile(const std::string &title)
Provides a means for comparing floating point numbers.