Stan  2.5.0
probability, sampling & optimization
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | List of all members
stan::io::dump_writer Class Reference

Writes data into the S-plus dump format. More...

#include <dump.hpp>

Public Member Functions

 dump_writer ()
 Construct a dump writer writing to standard output. More...
 
 dump_writer (std::ostream &out)
 Construct a dump writer writing to the specified output stream. More...
 
 ~dump_writer ()
 Destroy this writer. More...
 
template<typename T >
void write (const std::string &name, const T &x)
 Write a variable with the specified name and value. More...
 
template<typename T >
void dump_structure (std::string, std::vector< size_t > dims, std::vector< T > xs)
 Write a structure variable with the specified name, dimensions, and integer or double values. More...
 
template<typename T >
void dump_list (std::string name, std::vector< T > xs)
 Write a list variable with the specified name and integer or double values. More...
 
template<typename T >
void dump_var (std::string name, T x)
 Write a list variable with the specified name and integer or double values. More...
 

Detailed Description

Writes data into the S-plus dump format.

A dump_writer writes data into the S-plus dump format, a human-readable ASCII representation of arbitrarily dimensioned arrays of integers and arrays of floating point values.

Definition at line 42 of file dump.hpp.

Constructor & Destructor Documentation

stan::io::dump_writer::dump_writer ( )
inline

Construct a dump writer writing to standard output.

Definition at line 272 of file dump.hpp.

stan::io::dump_writer::dump_writer ( std::ostream &  out)
inline

Construct a dump writer writing to the specified output stream.

Parameters
outOutput stream for writing.

Definition at line 280 of file dump.hpp.

stan::io::dump_writer::~dump_writer ( )
inline

Destroy this writer.

Definition at line 285 of file dump.hpp.

Member Function Documentation

template<typename T >
void stan::io::dump_writer::dump_list ( std::string  name,
std::vector< T >  xs 
)
inline

Write a list variable with the specified name and integer or double values.

Parameters
nameName of variable.
xsValues of variable.
Template Parameters
Tdouble or int.

Definition at line 340 of file dump.hpp.

template<typename T >
void stan::io::dump_writer::dump_structure ( std::string  ,
std::vector< size_t >  dims,
std::vector< T >  xs 
)
inline

Write a structure variable with the specified name, dimensions, and integer or double values.

name Name of variable.

Parameters
dimsDimensions of variable.
xsValues of variable in last-index major format.
Template Parameters
Tdouble or int.

Definition at line 322 of file dump.hpp.

template<typename T >
void stan::io::dump_writer::dump_var ( std::string  name,
x 
)
inline

Write a list variable with the specified name and integer or double values.

Parameters
nameName of variable.
xValue of variable.
Template Parameters
Tdouble or int.

Definition at line 355 of file dump.hpp.

template<typename T >
void stan::io::dump_writer::write ( const std::string &  name,
const T &  x 
)
inline

Write a variable with the specified name and value.

This method will work for basic types consisting of doubles and integers, Eigen types for vectors, row vectors and matrices. If this method works for a type, it will work for a standard vector of that type.

Information concerning final type organization into Eigen vectors, row vectors and matrices is lost.

All data is written in final-index dominant ordering.

Parameters
nameName of variable to write.
xValue of variable.
Template Parameters
Typeof variable being written.

Definition at line 306 of file dump.hpp.


The documentation for this class was generated from the following file:

     [ Stan Home Page ] © 2011–2014, Stan Development Team.