Stan  2.14.0
probability, sampling & optimization
print_var_origin_def.hpp
Go to the documentation of this file.
1 #ifndef STAN_LANG_AST_FUN_PRINT_VAR_ORIGIN_DEF_HPP
2 #define STAN_LANG_AST_FUN_PRINT_VAR_ORIGIN_DEF_HPP
3 
4 #include <stan/lang/ast.hpp>
5 
6 namespace stan {
7  namespace lang {
8 
9  void print_var_origin(std::ostream& o, const var_origin& vo) {
10  if (vo == model_name_origin)
11  o << "model name";
12  else if (vo == data_origin)
13  o << "data";
14  else if (vo == transformed_data_origin)
15  o << "transformed data";
16  else if (vo == parameter_origin)
17  o << "parameter";
18  else if (vo == transformed_parameter_origin)
19  o << "transformed parameter";
20  else if (vo == derived_origin)
21  o << "generated quantities";
22  else if (vo == local_origin)
23  o << "local";
24  else if (vo == function_argument_origin)
25  o << "function argument";
26  else if (vo == function_argument_origin_lp)
27  o << "function argument '_lp' suffixed";
28  else if (vo == function_argument_origin_rng)
29  o << "function argument '_rng' suffixed";
30  else if (vo == void_function_argument_origin)
31  o << "void function argument";
32  else if (vo == void_function_argument_origin_lp)
33  o << "void function argument '_lp' suffixed";
34  else if (vo == void_function_argument_origin_rng)
35  o << "void function argument '_rng' suffixed";
36  else
37  o << "UNKNOWN ORIGIN=" << vo;
38  }
39 
40  }
41 }
42 #endif
const int function_argument_origin
The variable arose as a function argument to a non-void function that does not end in _lp or _rng...
Definition: var_origin.hpp:53
const int derived_origin
The origin of the variable is ???.
Definition: var_origin.hpp:42
const int parameter_origin
The origin of the variable is the parameter block.
Definition: var_origin.hpp:32
const int function_argument_origin_rng
The variable arose as an argument to a non-void function with the _rng suffix.
Definition: var_origin.hpp:65
Probability, optimization and sampling library.
const int transformed_parameter_origin
The origin of the variable is the transformed parameter block.
Definition: var_origin.hpp:37
const int function_argument_origin_lp
The variable arose as an argument to a non-void function with the _lp suffix.
Definition: var_origin.hpp:59
void print_var_origin(std::ostream &o, const var_origin &vo)
Write a user-readable version of the specified variable to origin to the specified output stream...
const int void_function_argument_origin_rng
The variable arose as an argument to a function returning void with an _rng suffix.
Definition: var_origin.hpp:83
const int model_name_origin
Origin of variable is the name of the model.
Definition: var_origin.hpp:17
int var_origin
The type of a variable indicating where a variable was declared.
Definition: var_origin.hpp:12
const int void_function_argument_origin
The variable arose as an argument to a function returning void that does not have the _lp or _rng suf...
Definition: var_origin.hpp:71
const int data_origin
The origin of the variable is the data block.
Definition: var_origin.hpp:22
const int void_function_argument_origin_lp
The variable arose as an argument to a function returning void with _lp suffix.
Definition: var_origin.hpp:77
const int local_origin
The origin of the variable is as a local variable.
Definition: var_origin.hpp:47
const int transformed_data_origin
The origin of the variable is the transformed data block.
Definition: var_origin.hpp:27

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