![]() |
Stan
1.0
probability, sampling & optimization
|
Writes Stan variables in comma-separated-value format to an output stream. More...
#include <csv_writer.hpp>
Public Member Functions | |
| void | comma () |
| Write a comma. More... | |
| csv_writer (std::ostream &o) | |
| Construct a CSV writer that writes to the specified output stream. More... | |
| void | newline () |
| Write a newline character. More... | |
| void | write (int n) |
| Write a value. More... | |
| void | write (double x) |
| Write a value. More... | |
| void | write (const Eigen::Matrix< double, Eigen::Dynamic, 1 > &v) |
| Write a value. More... | |
| void | write (const Eigen::Matrix< double, 1, Eigen::Dynamic > &rv) |
| Write a value. More... | |
| void | write (const Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > &m) |
| Write a value. More... | |
| void | write_col_major (const Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > &m) |
| Write a value in column-major order. More... | |
| void | write (const std::string &s) |
| Write a value. More... | |
Writes Stan variables in comma-separated-value format to an output stream.
All output is written to the same line and separated by commas. Use the newline() method to advance to the next line of CSV output.
Definition at line 19 of file csv_writer.hpp.
|
inline |
Construct a CSV writer that writes to the specified output stream.
| o | Output stream on which to write. |
Definition at line 47 of file csv_writer.hpp.
|
inline |
Write a comma.
On the first call do nothing, subsequently write a comma.
Definition at line 32 of file csv_writer.hpp.
|
inline |
Write a newline character.
End a line of output and start a new line. This method needs to be called rather than writing a newline to the output stream because it resets the comma flag.
Definition at line 59 of file csv_writer.hpp.
|
inline |
Write a value.
Write the specified row vector to the output stream on the current line.
| rv | Row vector of doubles to write. |
Definition at line 112 of file csv_writer.hpp.
|
inline |
Write a value.
Write the specified vector to the output stream on the current line.
| v | Vector of doubles to write. |
Definition at line 98 of file csv_writer.hpp.
|
inline |
Write a value.
Write the specified matrix to the output stream in row-major order.
| m | Matrix to write. |
Definition at line 126 of file csv_writer.hpp.
|
inline |
Write a value.
Write the specified string to the output stream with quotes around it and quotes inside escaped to double quotes.
| s | String to write. |
Definition at line 157 of file csv_writer.hpp.
|
inline |
Write a value.
Write the specified double to the output stream on the current line.
| x | Double to write. |
Definition at line 85 of file csv_writer.hpp.
|
inline |
Write a value.
Write the specified integer to the output stream on the current line.
| n | Integer to write. |
Definition at line 72 of file csv_writer.hpp.
|
inline |
Write a value in column-major order.
Write the specified matrix to the output stream in column-major order.
| m | Matrix of doubles to write. |
Definition at line 141 of file csv_writer.hpp.