![]() |
Stan
2.5.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... | |
| template<int R, int C> | |
| void | write_row_major (const Eigen::Matrix< double, R, C > &m) |
| Write a value. More... | |
| template<int R, int C> | |
| void | write_col_major (const Eigen::Matrix< double, R, C > &m) |
| Write a value in column-major order. More... | |
| template<int R, int C> | |
| void | write (const Eigen::Matrix< double, R, C > &m) |
| 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 23 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 51 of file csv_writer.hpp.
|
inline |
Write a comma.
On the first call do nothing, subsequently write a comma.
Definition at line 36 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 63 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 76 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 89 of file csv_writer.hpp.
|
inline |
Definition at line 133 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 146 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 122 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 104 of file csv_writer.hpp.