![]() |
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. | |
| csv_writer (std::ostream &o) | |
| Construct a CSV writer that writes to the specified output stream. | |
| void | newline () |
| Write a newline character. | |
| void | write (int n) |
| Write a value. | |
| void | write (double x) |
| Write a value. | |
| void | write (const Eigen::Matrix< double, Eigen::Dynamic, 1 > &v) |
| Write a value. | |
| void | write (const Eigen::Matrix< double, 1, Eigen::Dynamic > &rv) |
| Write a value. | |
| void | write (const Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > &m) |
| Write a value. | |
| void | write_col_major (const Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > &m) |
| Write a value in column-major order. | |
| void | write (const std::string &s) |
| Write a value. | |
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 20 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 48 of file csv_writer.hpp.
|
inline |
Write a comma.
On the first call do nothing, subsequently write a comma.
Definition at line 33 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 60 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 73 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 86 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 99 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 113 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 127 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 158 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 142 of file csv_writer.hpp.