![]() |
Stan
2.14.0
probability, sampling & optimization
|
A map from function names to their base declarations and their origin. More...
#include <variable_map.hpp>
Public Types | |
typedef std::pair< base_var_decl, var_origin > | range_t |
A variable type and the origin of its declaration. More... | |
Public Member Functions | |
bool | exists (const std::string &name) const |
Return true if a variable has been declared with the specified name. More... | |
base_var_decl | get (const std::string &name) const |
Return the type for the variable with the specified name. More... | |
base_expr_type | get_base_type (const std::string &name) const |
Return the type declared for the variable with the specified name. More... | |
std::size_t | get_num_dims (const std::string &name) const |
Return the number of dimensions declared for the variable with the specified name. More... | |
var_origin | get_origin (const std::string &name) const |
Return the origin of the variable declaration for the variable with the specified name. More... | |
void | add (const std::string &name, const base_var_decl &base_decl, const var_origin &vo) |
Add the specified declaration for a variable with the specified name originating in the specified block. More... | |
void | remove (const std::string &name) |
Remove the declaraiton for the variable with the specified name. More... | |
Public Attributes | |
std::map< std::string, range_t > | map_ |
The stored map from function names to their declarations and origins. More... | |
A map from function names to their base declarations and their origin.
Definition at line 18 of file variable_map.hpp.
typedef std::pair<base_var_decl, var_origin> stan::lang::variable_map::range_t |
A variable type and the origin of its declaration.
Definition at line 22 of file variable_map.hpp.
void stan::lang::variable_map::add | ( | const std::string & | name, |
const base_var_decl & | base_decl, | ||
const var_origin & | vo | ||
) |
Add the specified declaration for a variable with the specified name originating in the specified block.
Will destructively overwrite the declaration of an existing variable if called with a new declaration and origin.
name | variable name |
base_decl | variable declaration |
vo | origin |
Definition at line 34 of file variable_map_def.hpp.
bool stan::lang::variable_map::exists | ( | const std::string & | name | ) | const |
Return true if a variable has been declared with the specified name.
name | variable name |
Definition at line 10 of file variable_map_def.hpp.
base_var_decl stan::lang::variable_map::get | ( | const std::string & | name | ) | const |
Return the type for the variable with the specified name.
name | variable name |
std::invalid_argument | if the variable has not been declared |
Definition at line 14 of file variable_map_def.hpp.
base_expr_type stan::lang::variable_map::get_base_type | ( | const std::string & | name | ) | const |
Return the type declared for the variable with the specified name.
name | variable name |
std::invalid_argument | if the variable has not been declared |
Definition at line 20 of file variable_map_def.hpp.
size_t stan::lang::variable_map::get_num_dims | ( | const std::string & | name | ) | const |
Return the number of dimensions declared for the variable with the specified name.
name | variable name |
std::invalid_argument | if the variable has not been declared |
Definition at line 24 of file variable_map_def.hpp.
var_origin stan::lang::variable_map::get_origin | ( | const std::string & | name | ) | const |
Return the origin of the variable declaration for the variable with the specified name.
name | variable name |
std::invalid_argument | if the variable has not been declared |
Definition at line 28 of file variable_map_def.hpp.
void stan::lang::variable_map::remove | ( | const std::string & | name | ) |
Remove the declaraiton for the variable with the specified name.
If the variable had not already been declared, it the function exits silently.
name | name of variable to remove |
Definition at line 40 of file variable_map_def.hpp.
std::map<std::string, range_t> stan::lang::variable_map::map_ |
The stored map from function names to their declarations and origins.
Definition at line 103 of file variable_map.hpp.