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

Represents named arrays with dimensions. More...

#include <dump.hpp>

Inheritance diagram for stan::io::dump:
stan::io::var_context

Public Member Functions

 dump (std::istream &in)
 Construct a dump object from the specified input stream.
 
bool contains_r (const std::string &name) const
 Return true if this dump contains the specified variable name is defined.
 
bool contains_i (const std::string &name) const
 Return true if this dump contains an integer valued array with the specified name.
 
std::vector< double > vals_r (const std::string &name) const
 Return the double values for the variable with the specified name or null.
 
std::vector< size_t > dims_r (const std::string &name) const
 Return the dimensions for the double variable with the specified name.
 
std::vector< int > vals_i (const std::string &name) const
 Return the integer values for the variable with the specified name.
 
std::vector< size_t > dims_i (const std::string &name) const
 Return the dimensions for the integer variable with the specified name.
 
virtual void names_r (std::vector< std::string > &names) const
 Return a list of the names of the floating point variables in the dump.
 
virtual void names_i (std::vector< std::string > &names) const
 Return a list of the names of the integer variables in the dump.
 
bool remove (const std::string &name)
 Remove variable from the object.
 

Detailed Description

Represents named arrays with dimensions.

A dump object represents a dump of named arrays with dimensions. The arrays may have any dimensionality. The values for an array are typed to double or int.

See dump_reader for more information on the format.

Dump objects are created from reading dump files from an input stream.

The dimensions and values of variables may be accessed by name.

Definition at line 799 of file dump.hpp.

Constructor & Destructor Documentation

stan::io::dump::dump ( std::istream &  in)
inline

Construct a dump object from the specified input stream.

Warning: This method does not close the input stream.

Parameters
inInput stream from which to read.

Definition at line 831 of file dump.hpp.

Member Function Documentation

bool stan::io::dump::contains_i ( const std::string &  name) const
inlinevirtual

Return true if this dump contains an integer valued array with the specified name.

Parameters
nameVariable name to test.
Returns
true if the variable name has an integer array value.

Implements stan::io::var_context.

Definition at line 869 of file dump.hpp.

bool stan::io::dump::contains_r ( const std::string &  name) const
inlinevirtual

Return true if this dump contains the specified variable name is defined.

This method returns true even if the values are all integers.

Parameters
nameVariable name to test.
Returns
true if the variable exists.

Implements stan::io::var_context.

Definition at line 857 of file dump.hpp.

std::vector<size_t> stan::io::dump::dims_i ( const std::string &  name) const
inlinevirtual

Return the dimensions for the integer variable with the specified name.

Parameters
nameName of variable.
Returns
Dimensions of variable.

Implements stan::io::var_context.

Definition at line 931 of file dump.hpp.

std::vector<size_t> stan::io::dump::dims_r ( const std::string &  name) const
inlinevirtual

Return the dimensions for the double variable with the specified name.

Parameters
nameName of variable.
Returns
Dimensions of variable.

Implements stan::io::var_context.

Definition at line 901 of file dump.hpp.

virtual void stan::io::dump::names_i ( std::vector< std::string > &  names) const
inlinevirtual

Return a list of the names of the integer variables in the dump.

Parameters
namesVector to store the list of names in.

Implements stan::io::var_context.

Definition at line 960 of file dump.hpp.

virtual void stan::io::dump::names_r ( std::vector< std::string > &  names) const
inlinevirtual

Return a list of the names of the floating point variables in the dump.

Parameters
namesVector to store the list of names in.

Implements stan::io::var_context.

Definition at line 944 of file dump.hpp.

bool stan::io::dump::remove ( const std::string &  name)
inline

Remove variable from the object.

Parameters
nameName of the variable to remove.
Returns
If variable is removed returns true, else returns false.

Definition at line 977 of file dump.hpp.

std::vector<int> stan::io::dump::vals_i ( const std::string &  name) const
inlinevirtual

Return the integer values for the variable with the specified name.

Parameters
nameName of variable.
Returns
Values.

Implements stan::io::var_context.

Definition at line 917 of file dump.hpp.

std::vector<double> stan::io::dump::vals_r ( const std::string &  name) const
inlinevirtual

Return the double values for the variable with the specified name or null.

Parameters
nameName of variable.
Returns
Values of variable.

Implements stan::io::var_context.

Definition at line 880 of file dump.hpp.


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

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