Stan  2.10.0
probability, sampling & optimization
Public Member Functions | List of all members
stan::io::chained_var_context Class Reference

A chained_var_context object represents two objects of var_context as one. More...

#include <chained_var_context.hpp>

Inheritance diagram for stan::io::chained_var_context:
stan::io::var_context

Public Member Functions

 chained_var_context (const var_context &v1, const var_context &v2)
 
bool contains_i (const std::string &name) const
 Return true if the specified variable name has integer values. More...
 
bool contains_r (const std::string &name) const
 Return true if the specified variable name is defined. More...
 
std::vector< double > vals_r (const std::string &name) const
 Return the floating point values for the variable of the specified variable name in last-index-major order. More...
 
std::vector< int > vals_i (const std::string &name) const
 Return the integer values for the variable of the specified name in last-index-major order or the empty sequence if the variable is not defined. More...
 
std::vector< size_t > dims_r (const std::string &name) const
 Return the dimensions for the specified floating point variable. More...
 
std::vector< size_t > dims_i (const std::string &name) const
 Return the dimensions of the specified floating point variable. More...
 
void names_r (std::vector< std::string > &names) const
 Return a list of the names of the floating point variables in the context. More...
 
void names_i (std::vector< std::string > &names) const
 Return a list of the names of the integer variables in the context. 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

A chained_var_context object represents two objects of var_context as one.

Definition at line 15 of file chained_var_context.hpp.

Constructor & Destructor Documentation

stan::io::chained_var_context::chained_var_context ( const var_context v1,
const var_context v2 
)
inline

Definition at line 21 of file chained_var_context.hpp.

Member Function Documentation

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

Return true if the specified variable name has integer values.

Parameters
nameName of variable.
Returns
true if an integer variable of the specified name is defined.

Implements stan::io::var_context.

Definition at line 25 of file chained_var_context.hpp.

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

Return true if the specified variable name is defined.

This method should return true even if the values are all integers.

Parameters
nameName of variable.
Returns
true if the variable exists with real values.

Implements stan::io::var_context.

Definition at line 29 of file chained_var_context.hpp.

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

Return the dimensions of the specified floating point variable.

If the variable doesn't exist (or if it is a scalar), the return result should be the empty vector.

Parameters
nameName of variable.
Returns
Sequence of dimensions for the variable.

Implements stan::io::var_context.

Definition at line 45 of file chained_var_context.hpp.

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

Return the dimensions for the specified floating point variable.

If the variable doesn't exist or if it is a scalar, the return result should be the empty vector.

Parameters
nameName of variable.
Returns
Sequence of dimensions for the variable.

Implements stan::io::var_context.

Definition at line 41 of file chained_var_context.hpp.

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

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

Parameters
namesVector to store the list of names in.

Implements stan::io::var_context.

Definition at line 56 of file chained_var_context.hpp.

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

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

Parameters
namesVector to store the list of names in.

Implements stan::io::var_context.

Definition at line 49 of file chained_var_context.hpp.

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

Return the integer values for the variable of the specified name in last-index-major order or the empty sequence if the variable is not defined.

Parameters
nameName of variable.
Returns
Sequence of integer values.

Implements stan::io::var_context.

Definition at line 37 of file chained_var_context.hpp.

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

Return the floating point values for the variable of the specified variable name in last-index-major order.

This method should cast integers to floating point values if the values of the named variable are all integers.

If there is no variable of the specified name, the empty vector is returned.

Parameters
nameName of variable.
Returns
Sequence of values for the named variable.

Implements stan::io::var_context.

Definition at line 33 of file chained_var_context.hpp.


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

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