27 #include <Reaktoro/Math/Matrix.hpp>
37 bool scientific =
false;
39 unsigned precision = 6;
43 std::string separator =
"|";
59 void addEntry(
const std::string& name);
61 void addEntries(
const std::string& prefix,
unsigned size);
63 void addEntries(
const std::string& prefix,
unsigned size,
const std::vector<std::string>&
names);
65 template<
typename Iter>
66 void addEntries(
const Iter&
begin,
const Iter&
end);
68 void addEntrySeparator();
71 void addValue(
const T& val);
73 template<
typename Iter>
74 void addValues(
const Iter&
begin,
const Iter&
end);
76 template<
typename Vec>
77 void addValues(
const Vec& vec);
79 void addValueSeparator();
85 void outputMessage(
const std::string& message);
88 void outputMessage(
const T& arg)
90 if(options.active) std::cout << arg;
93 template<
typename T,
typename... Args>
94 void outputMessage(
const T& arg,
const Args&... args)
99 outputMessage(args...);
104 std::list<std::string> entries;
106 std::list<std::string> values;
111 template<
typename Iter>
112 void Outputter::addEntries(
const Iter&
begin,
const Iter&
end)
114 entries.insert(entries.end(),
begin,
end);
118 void Outputter::addValue(
const T& val)
120 std::stringstream ss;
121 ss << std::setprecision(options.precision);
122 if(options.fixed) ss << std::fixed;
123 if(options.scientific) ss << std::scientific;
125 values.push_back(ss.str());
128 template<
typename Iter>
129 void Outputter::addValues(
const Iter&
begin,
const Iter&
end)
131 for(Iter iter =
begin; iter !=
end; ++iter)
135 template<
typename Vec>
136 void Outputter::addValues(
const Vec& vec)
138 for(
unsigned i = 0; i < vec.size(); ++i)
A utility class for printing the progress of iterative calculations.
Definition: Outputter.hpp:51
auto begin(const Reaktoro::ReactionEquation &equation) -> decltype(equation.equation().begin())
Return begin const iterator of a ReactionEquation instance.
Definition: ReactionEquation.hpp:86
auto names(const NamedValues &values) -> std::vector< std::string >
Return the names of the entries in a container.
Definition: Utils.hxx:22
auto end(const Reaktoro::ReactionEquation &equation) -> decltype(equation.equation().end())
Return end const iterator of a ReactionEquation instance.
Definition: ReactionEquation.hpp:98
auto operator=(bool active) -> OutputterOptions &
Assign a boolean value to active member.
Definition: Outputter.cpp:40
The namespace containing all components of the Reaktoro library.
Definition: ChemicalScalar.hpp:24
Definition: Outputter.hpp:32