Stan  1.3
probability, sampling & optimization
 All Classes Namespaces Files Functions Variables Typedefs 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.
 
 dump_writer (std::ostream &out)
 Construct a dump writer writing to the specified output stream.
 
 ~dump_writer ()
 Destroy this writer.
 
template<typename T >
void write (const std::string &name, const T &x)
 Write a variable with the specified name and value.
 
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.
 
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.
 
template<typename T >
void dump_var (std::string name, T x)
 Write a list variable with the specified name and integer or double values.
 

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 36 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 265 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 273 of file dump.hpp.

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

Destroy this writer.

Definition at line 278 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 333 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.

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

Definition at line 315 of file dump.hpp.

template<typename T >
void stan::io::dump_writer::dump_var ( std::string  name,
T  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 348 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 299 of file dump.hpp.


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

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