|
virtual | ~var_context () |
|
virtual bool | contains_r (const std::string &name) const =0 |
| Return true if the specified variable name is defined. More...
|
|
virtual std::vector< double > | vals_r (const std::string &name) const =0 |
| Return the floating point values for the variable of the specified variable name in last-index-major order. More...
|
|
virtual std::vector< size_t > | dims_r (const std::string &name) const =0 |
| Return the dimensions for the specified floating point variable. More...
|
|
virtual bool | contains_i (const std::string &name) const =0 |
| Return true if the specified variable name has integer values. More...
|
|
virtual std::vector< int > | vals_i (const std::string &name) const =0 |
| 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...
|
|
virtual std::vector< size_t > | dims_i (const std::string &name) const =0 |
| Return the dimensions of the specified floating point variable. More...
|
|
virtual void | names_r (std::vector< std::string > &names) const =0 |
| Return a list of the names of the floating point variables in the context. More...
|
|
virtual void | names_i (std::vector< std::string > &names) const =0 |
| Return a list of the names of the integer variables in the context. More...
|
|
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 |
|
|
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) |
|
A var_reader
reads array variables of integer and floating point type by name and dimension.
An array's dimensionality is described by a sequence of (unsigned) integers. For instance, (7, 2, 3)
picks out a 7 by 2 by 3 array. The empty dimensionality sequence ()
is used for scalars.
Multidimensional arrays are stored in column-major order, meaning the first index changes the most quickly.
If a variable has integer variables, it should return those integer values cast to floating point values when accessed through the floating-point methods.
Definition at line 29 of file var_context.hpp.
virtual std::vector<double> stan::io::var_context::vals_r |
( |
const std::string & |
name | ) |
const |
|
pure virtual |
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
-
- Returns
- Sequence of values for the named variable.
Implemented in stan::io::dump, stan::io::array_var_context, stan::json::json_data, and stan::io::chained_var_context.