![]() |
Stan
2.10.0
probability, sampling & optimization
|
An array_var_context object represents a named arrays with dimensions constructed from an array, a vector of names, and a vector of all dimensions for each element. More...
#include <array_var_context.hpp>
Public Member Functions | |
array_var_context (const std::vector< std::string > &names_r, const std::vector< double > &values_r, const std::vector< std::vector< size_t > > &dim_r) | |
Construct an array_var_context from only real value arrays. More... | |
array_var_context (const std::vector< std::string > &names_i, const std::vector< int > &values_i, const std::vector< std::vector< size_t > > &dim_i) | |
Construct an array_var_context from only integer value arrays. More... | |
array_var_context (const std::vector< std::string > &names_r, const std::vector< double > &values_r, const std::vector< std::vector< size_t > > &dim_r, const std::vector< std::string > &names_i, const std::vector< int > &values_i, const std::vector< std::vector< size_t > > &dim_i) | |
Construct an array_var_context from arrays of both double and integer separately. 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... | |
![]() | |
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 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) |
An array_var_context object represents a named arrays with dimensions constructed from an array, a vector of names, and a vector of all dimensions for each element.
Definition at line 31 of file array_var_context.hpp.
|
inline |
Construct an array_var_context from only real value arrays.
names_r | names for each element |
values_r | a vector of double values for all elements |
dim_r | a vector of dimensions |
Definition at line 116 of file array_var_context.hpp.
|
inline |
Construct an array_var_context from only integer value arrays.
names_i | names for each element |
values_i | a vector of integer values for all elements |
dim_i | a vector of dimensions |
Definition at line 129 of file array_var_context.hpp.
|
inline |
Construct an array_var_context from arrays of both double and integer separately.
Definition at line 140 of file array_var_context.hpp.
|
inlinevirtual |
Return true
if this dump contains an integer valued array with the specified name.
name | Variable name to test. |
true
if the variable name has an integer array value. Implements stan::io::var_context.
Definition at line 170 of file array_var_context.hpp.
|
inlinevirtual |
Return true
if this dump contains the specified variable name is defined.
This method returns true
even if the values are all integers.
name | Variable name to test. |
true
if the variable exists. Implements stan::io::var_context.
Definition at line 158 of file array_var_context.hpp.
|
inlinevirtual |
Return the dimensions for the integer variable with the specified name.
name | Name of variable. |
Implements stan::io::var_context.
Definition at line 232 of file array_var_context.hpp.
|
inlinevirtual |
Return the dimensions for the double variable with the specified name.
name | Name of variable. |
Implements stan::io::var_context.
Definition at line 202 of file array_var_context.hpp.
|
inlinevirtual |
Return a list of the names of the integer variables in the dump.
names | Vector to store the list of names in. |
Implements stan::io::var_context.
Definition at line 261 of file array_var_context.hpp.
|
inlinevirtual |
Return a list of the names of the floating point variables in the dump.
names | Vector to store the list of names in. |
Implements stan::io::var_context.
Definition at line 245 of file array_var_context.hpp.
|
inline |
Remove variable from the object.
name | Name of the variable to remove. |
true
, else returns false
. Definition at line 278 of file array_var_context.hpp.
|
inlinevirtual |
Return the integer values for the variable with the specified name.
name | Name of variable. |
Implements stan::io::var_context.
Definition at line 218 of file array_var_context.hpp.
|
inlinevirtual |
Return the double values for the variable with the specified name or null.
name | Name of variable. |
Implements stan::io::var_context.
Definition at line 181 of file array_var_context.hpp.