DiFfRG
Loading...
Searching...
No Matches
csv_output.hh
Go to the documentation of this file.
1#pragma once
2
3// standard library
4#include <fstream>
5#include <map>
6#include <vector>
7
8// DiFfRG
10
11namespace DiFfRG
12{
20 {
21 public:
29 CsvOutput(const std::string top_folder, const std::string output_name, const JSONValue &json);
30
37 void value(const std::string &name, const double value);
38
45 void flush(const double time);
46
52 void set_Lambda(const double Lambda);
53
54 private:
56 const std::string top_folder;
57 const std::string output_name;
58 std::ofstream output_stream;
59
60 std::vector<std::string> insertion_order;
61 std::map<std::string, std::vector<double>> values;
62
63 std::vector<std::string> header;
64 std::vector<double> time_values;
65 std::vector<double> k_values;
66
67 double Lambda;
68 };
69} // namespace DiFfRG
A class to output data to a CSV file.
Definition csv_output.hh:20
std::vector< std::string > insertion_order
Definition csv_output.hh:60
void flush(const double time)
Add a value to the output.
const JSONValue & json
Definition csv_output.hh:55
CsvOutput(const std::string top_folder, const std::string output_name, const JSONValue &json)
Construct a new Csv Output object.
std::ofstream output_stream
Definition csv_output.hh:58
const std::string output_name
Definition csv_output.hh:57
void value(const std::string &name, const double value)
Add a value to the output.
std::vector< std::string > header
Definition csv_output.hh:63
std::vector< double > k_values
Definition csv_output.hh:65
std::map< std::string, std::vector< double > > values
Definition csv_output.hh:61
void set_Lambda(const double Lambda)
Set the value of Lambda. If Lambda is set, the output will contain a column for k = exp(-t) * Lambda.
std::vector< double > time_values
Definition csv_output.hh:64
double Lambda
Definition csv_output.hh:67
const std::string top_folder
Definition csv_output.hh:56
A wrapper around the boost json value class.
Definition json.hh:19
Definition complex_math.hh:14