13 std::string _name, _sep, _lend, _extension;
26 const std::string &
lend,
27 std::streamsize prec = 3)
31 , _extension{
"none" }
32 , precision{ prec } {}
43 const std::string &
sep,
44 const std::string &
lend,
45 const std::string &
ext,
46 std::streamsize prec = 3)
51 , precision{ prec } {}
57 inline auto operator()()
const {
return std::make_pair(_sep, _lend); }
66 void write_line(std::ostream &ofs,
const T &crow)
const {
68 for (
size_t idx = 1; idx < crow.size(); idx++) {
69 ofs << _sep << crow[idx];
80 template<
class X,
class... Y>
81 void as_rows(std::ostream &ofs,
const X &x,
const Y &... y)
const {
84 if constexpr (
sizeof...(y) > 0) {
86 for (
const auto &arg : { y... }) {
99 template<
class X,
class... Y>
100 void as_columns(std::ostream &ofs,
const X &x,
const Y &... y)
const {
101 for (
size_t idx = 0; idx < x.size(); idx++) {
103 if constexpr (
sizeof...(y) > 0) {
104 for (
const auto &arg : { y... }) {
105 ofs << _sep << arg[idx];
119 const size_t dim = data[0].size();
120 for (
size_t idx = 0; idx < dim; idx++) {
122 for (
size_t jdx = 1; jdx < data.size(); jdx++) {
123 ofs << _sep << data[jdx][idx];
134 ofs << std::scientific;
135 ofs.precision(precision);
139 inline const std::string &
sep()
const {
return _sep; }
140 inline const std::string &
lend()
const {
return _lend; }
141 inline const std::string &
name()
const {
return _name; }
142 inline const std::string &
ext()
const {
return _extension; }