Stan  2.10.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 545 of file dump.hpp.

Constructor & Destructor Documentation

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 577 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 615 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 603 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 677 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 647 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 706 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 690 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 723 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 663 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 626 of file dump.hpp.


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

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