1 #ifndef STAN__IO__CSV_WRITER_HPP
2 #define STAN__IO__CSV_WRITER_HPP
52 : o_(o), at_bol_(true) {
91 o_ << std::setprecision (std::numeric_limits<double>::digits10 + 1)
103 template<
int R,
int C>
107 typedef typename index_type<Matrix<double,R,C> >::type idx_t;
108 for (idx_t i = 0; i < m.rows(); ++i)
109 for (idx_t j = 0; j < m.cols(); ++j)
121 template<
int R,
int C>
125 typedef typename index_type<Matrix<double,R,C> >::type idx_t;
127 for (idx_t j = 0; j < m.cols(); ++j)
128 for (idx_t i = 0; i < m.rows(); ++i)
132 template<
int R,
int C>
133 void write(
const Eigen::Matrix<double,R,C>& m) {
150 for (
size_t i = 0; i < s.size(); ++i) {
151 if (s.at(i) ==
'"') {
void newline()
Write a newline character.
void write_col_major(const Eigen::Matrix< double, R, C > &m)
Write a value in column-major order.
void write(const std::string &s)
Write a value.
Primary template class for the metaprogram to compute the index type of a container.
Writes Stan variables in comma-separated-value format to an output stream.
void write(int n)
Write a value.
csv_writer(std::ostream &o)
Construct a CSV writer that writes to the specified output stream.
void comma()
Write a comma.
void write_row_major(const Eigen::Matrix< double, R, C > &m)
Write a value.
void write(double x)
Write a value.
void write(const Eigen::Matrix< double, R, C > &m)