Stan  2.14.0
probability, sampling & optimization
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. More...
 
bool contains_r (const std::string &name) const
 Return true if this dump contains the specified variable name is defined. More...
 
bool contains_i (const std::string &name) const
 Return true if this dump contains an integer valued array with the specified name. More...
 
std::vector< double > vals_r (const std::string &name) const
 Return the double values for the variable with the specified name or null. More...
 
std::vector< size_t > dims_r (const std::string &name) const
 Return the dimensions for the double variable with the specified name. More...
 
std::vector< int > vals_i (const std::string &name) const
 Return the integer values for the variable with the specified name. More...
 
std::vector< size_t > dims_i (const std::string &name) const
 Return the dimensions for the integer variable with the specified name. More...
 
virtual void names_r (std::vector< std::string > &names) const
 Return a list of the names of the floating point variables in the dump. More...
 
virtual void names_i (std::vector< std::string > &names) const
 Return a list of the names of the integer variables in the dump. More...
 
bool remove (const std::string &name)
 Remove variable from the object. More...
 
- Public Member Functions inherited from stan::io::var_context
virtual ~var_context ()
 
void add_vec (std::stringstream &msg, const std::vector< size_t > &dims) const
 
void validate_dims (const std::string &stage, const std::string &name, const std::string &base_type, const std::vector< size_t > &dims_declared) const
 

Additional Inherited Members

- Static Public Member Functions inherited from stan::io::var_context
static std::vector< size_t > to_vec ()
 
static std::vector< size_t > to_vec (size_t n1)
 
static std::vector< size_t > to_vec (size_t n1, size_t n2)
 
static std::vector< size_t > to_vec (size_t n1, size_t n2, size_t n3)
 
static std::vector< size_t > to_vec (size_t n1, size_t n2, size_t n3, size_t n4)
 
static std::vector< size_t > to_vec (size_t n1, size_t n2, size_t n3, size_t n4, size_t n5)
 
static std::vector< size_t > to_vec (size_t n1, size_t n2, size_t n3, size_t n4, size_t n5, size_t n6)
 
static std::vector< size_t > to_vec (size_t n1, size_t n2, size_t n3, size_t n4, size_t n5, size_t n6, size_t n7)
 
static std::vector< size_t > to_vec (size_t n1, size_t n2, size_t n3, size_t n4, size_t n5, size_t n6, size_t n7, size_t n8)
 

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 599 of file dump.hpp.

Constructor & Destructor Documentation

§ dump()

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

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 631 of file dump.hpp.

Member Function Documentation

§ contains_i()

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 669 of file dump.hpp.

§ contains_r()

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 657 of file dump.hpp.

§ dims_i()

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 731 of file dump.hpp.

§ dims_r()

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 701 of file dump.hpp.

§ names_i()

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 760 of file dump.hpp.

§ names_r()

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 744 of file dump.hpp.

§ remove()

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 777 of file dump.hpp.

§ vals_i()

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 717 of file dump.hpp.

§ vals_r()

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 680 of file dump.hpp.


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

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