Stan  2.5.0
probability, sampling & optimization
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Typedefs | Functions | Variables
stan::gm Namespace Reference

Directed graphical model compiler. More...

Classes

class  arg_adapt
 
class  arg_adapt_delta
 
class  arg_adapt_engaged
 
class  arg_adapt_gamma
 
class  arg_adapt_init_buffer
 
class  arg_adapt_kappa
 
class  arg_adapt_t0
 
class  arg_adapt_term_buffer
 
class  arg_adapt_window
 
class  arg_bfgs
 
class  arg_data
 
class  arg_data_file
 
class  arg_dense_e
 
class  arg_diag_e
 
class  arg_diagnose
 
class  arg_diagnostic_file
 
class  arg_engine
 
class  arg_fail
 
class  arg_fixed_param
 
class  arg_history_size
 
class  arg_hmc
 
class  arg_id
 
class  arg_init
 
class  arg_init_alpha
 
class  arg_int_time
 
class  arg_iter
 
class  arg_lbfgs
 
class  arg_max_depth
 
class  arg_method
 
class  arg_metric
 
class  arg_newton
 
class  arg_num_samples
 
class  arg_num_warmup
 
class  arg_nuts
 
class  arg_optimize
 
class  arg_optimize_algo
 
class  arg_output
 
class  arg_output_file
 
class  arg_random
 
class  arg_refresh
 
class  arg_rwm
 
class  arg_sample
 
class  arg_sample_algo
 
class  arg_save_iterations
 
class  arg_save_warmup
 
class  arg_seed
 
class  arg_static
 
class  arg_stepsize
 
class  arg_stepsize_jitter
 
class  arg_test
 
class  arg_test_grad_eps
 
class  arg_test_grad_err
 
class  arg_test_gradient
 
class  arg_thin
 
class  arg_tolerance
 
class  arg_unit_e
 
class  argument
 
class  argument_parser
 
class  argument_probe
 
class  categorical_argument
 
class  list_argument
 
struct  type_name
 
struct  type_name< int >
 
struct  type_name< unsigned int >
 
struct  type_name< double >
 
struct  type_name< bool >
 
struct  type_name< std::string >
 
class  singleton_argument
 
class  unvalued_argument
 
class  valued_argument
 
struct  nil
 Placeholder struct for boost::variant default ctors. More...
 
struct  expr_type
 
class  function_signatures
 
struct  statements
 
struct  distribution
 
struct  expression_type_vis
 
struct  expression
 
struct  printable
 
struct  is_nil_op
 
struct  variable_dims
 
struct  int_literal
 
struct  double_literal
 
struct  array_literal
 
struct  variable
 
struct  integrate_ode
 
struct  fun
 
struct  index_op
 
struct  binary_op
 
struct  unary_op
 
struct  range
 
struct  base_var_decl
 
struct  variable_map
 
struct  int_var_decl
 
struct  double_var_decl
 
struct  unit_vector_var_decl
 
struct  simplex_var_decl
 
struct  ordered_var_decl
 
struct  positive_ordered_var_decl
 
struct  vector_var_decl
 
struct  row_vector_var_decl
 
struct  matrix_var_decl
 
struct  cholesky_factor_var_decl
 
struct  cholesky_corr_var_decl
 
struct  cov_matrix_var_decl
 
struct  corr_matrix_var_decl
 
struct  name_vis
 
struct  var_decl
 
struct  statement
 
struct  is_no_op_statement_vis
 
struct  returns_type_vis
 
struct  increment_log_prob_statement
 
struct  for_statement
 
struct  conditional_statement
 
struct  while_statement
 
struct  print_statement
 
struct  reject_statement
 
struct  return_statement
 
struct  no_op_statement
 
struct  arg_decl
 
struct  function_decl_def
 
struct  function_decl_defs
 
struct  program
 
struct  sample
 
struct  assignment
 
struct  contains_var
 
struct  contains_nonparam_var
 
struct  error_codes
 
struct  visgen
 generic visitor with output for extension More...
 
struct  expression_visgen
 
struct  printable_visgen
 
struct  var_size_validating_visgen
 
struct  var_resizing_visgen
 
struct  init_local_var_visgen
 
struct  validate_var_decl_visgen
 
struct  member_var_decl_visgen
 
struct  local_var_decl_visgen
 
struct  generate_local_var_init_nan_visgen
 
struct  generate_init_vars_visgen
 
struct  validate_transformed_params_visgen
 
struct  statement_visgen
 
struct  dump_member_var_visgen
 
struct  set_param_ranges_visgen
 
struct  generate_init_visgen
 
struct  write_dims_visgen
 
struct  write_param_names_visgen
 
struct  write_csv_header_visgen
 
struct  constrained_param_names_visgen
 
struct  unconstrained_param_names_visgen
 
struct  write_csv_visgen
 
struct  write_csv_vars_visgen
 
struct  write_array_visgen
 
struct  write_array_vars_visgen
 
struct  bare_type_grammar
 
struct  term_grammar
 
struct  expression_grammar
 
struct  expression07_grammar
 
struct  validate_expr_type3
 
struct  set_fun_type3
 
struct  addition_expr3
 
struct  subtraction_expr3
 
struct  set_fun_type2
 
struct  binary_op_expr
 
struct  functions_grammar
 
struct  validate_non_void_arg_function
 
struct  set_void_function
 
struct  set_allows_sampling_origin
 
struct  validate_declarations
 
struct  add_function_signature
 
struct  validate_return_type
 
struct  scope_lp
 
struct  unscope_variables
 
struct  add_fun_var
 
struct  program_grammar
 
struct  statement_grammar
 
struct  statement_2_grammar
 
struct  add_conditional_condition
 
struct  add_conditional_body
 
struct  validate_return_allowed
 
struct  validate_void_return_allowed
 
struct  validate_assignment
 
struct  validate_sample
 
struct  expression_as_statement
 
struct  unscope_locals
 
struct  add_while_condition
 
struct  add_while_body
 
struct  add_loop_identifier
 
struct  remove_loop_identifier
 
struct  validate_int_expr2
 
struct  validate_allow_sample
 
struct  validate_non_void_expression
 
struct  validate_integrate_ode
 
struct  set_fun_type
 
struct  set_fun_type_named
 
struct  exponentiation_expr
 
struct  multiplication_expr
 
struct  division_expr
 
struct  modulus_expr
 
struct  left_division_expr
 
struct  elt_multiplication_expr
 
struct  elt_division_expr
 
struct  negate_expr
 
struct  logical_negate_expr
 
struct  transpose_expr
 
struct  add_expression_dimss
 
struct  set_var_type
 
struct  validate_int_expr3
 
struct  var_decls_grammar
 
struct  whitespace_grammar
 

Typedefs

typedef singleton_argument
< double > 
real_argument
 
typedef singleton_argument< int > int_argument
 
typedef singleton_argument
< unsigned int > 
u_int_argument
 
typedef singleton_argument< bool > bool_argument
 
typedef singleton_argument
< std::string > 
string_argument
 
typedef int base_expr_type
 
typedef std::pair< expr_type,
std::vector< expr_type > > 
function_signature_t
 
typedef int var_origin
 
typedef std::string::const_iterator input_iterator_t
 
typedef
boost::spirit::line_pos_iterator
< input_iterator_t
pos_iterator_t
 

Functions

std::ostream & write_base_expr_type (std::ostream &o, base_expr_type type)
 
std::ostream & operator<< (std::ostream &o, const expr_type &et)
 
expr_type promote_primitive (const expr_type &et)
 
expr_type promote_primitive (const expr_type &et1, const expr_type &et2)
 
bool is_nil (const expression &e)
 
size_t total_dims (const std::vector< std::vector< expression > > &dimss)
 
expr_type infer_type_indexing (const base_expr_type &expr_base_type, size_t num_expr_dims, size_t num_index_dims)
 
expr_type infer_type_indexing (const expression &expr, size_t num_index_dims)
 
void print_var_origin (std::ostream &o, const var_origin &vo)
 
bool returns_type (const expr_type &return_type, const statement &statement, std::ostream &error_msgs)
 
void generate_expression (const expression &e, std::ostream &o)
 
bool has_rng_suffix (const std::string &s)
 
bool has_lp_suffix (const std::string &s)
 
bool is_user_defined (const std::string &name, const std::vector< expression > &args)
 
bool is_user_defined_prob_function (const std::string &name, const expression &variate, const std::vector< expression > &params)
 
bool is_user_defined (const fun &fx)
 
bool has_var (const expression &e, const variable_map &var_map)
 
bool has_non_param_var (const expression &e, const variable_map &var_map)
 
bool is_assignable (const expr_type &l_type, const expr_type &r_type, const std::string &failure_message, std::ostream &error_msgs)
 
bool ends_with (const std::string &suffix, const std::string &s)
 
bool is_linear_function (const std::string &name)
 
bool compile (std::ostream *msgs, std::istream &stan_gm_in, std::ostream &cpp_out, const std::string &model_name, const std::string &in_file_name="input")
 Read a Stan model specification from the specified input, parse it, and write the C++ code for it to the specified output. More...
 
const std::string EOL ("\n")
 
const std::string EOL2 ("\n\n")
 
const std::string INDENT (" ")
 
const std::string INDENT2 (" ")
 
const std::string INDENT3 (" ")
 
template<typename D >
bool has_lub (const D &x)
 
template<typename D >
bool has_ub (const D &x)
 
template<typename D >
bool has_lb (const D &x)
 
template<typename T >
std::string to_string (T i)
 
void generate_indent (size_t indent, std::ostream &o)
 
void generate_void_statement (const std::string &name, const size_t indent, std::ostream &o)
 
void generate_start_namespace (std::string name, std::ostream &o)
 
void generate_end_namespace (std::ostream &o)
 
void generate_comment (std::string const &msg, int indent, std::ostream &o)
 
template<bool isLHS>
void generate_indexed_expr (const std::string &expr, const std::vector< expression > indexes, base_expr_type base_type, size_t e_num_dims, std::ostream &o)
 
void generate_type (const std::string &base_type, const std::vector< expression > &, size_t end, std::ostream &o)
 
static void print_string_literal (std::ostream &o, const std::string &s)
 
static void print_quoted_expression (std::ostream &o, const expression &e)
 
void generate_printable (const printable &p, std::ostream &o)
 
void generate_using (const std::string &type, std::ostream &o)
 
void generate_using_namespace (const std::string &ns, std::ostream &o)
 
void generate_usings (std::ostream &o)
 
void generate_typedef (const std::string &type, const std::string &abbrev, std::ostream &o)
 
void generate_typedefs (std::ostream &o)
 
void generate_include (const std::string &lib_name, std::ostream &o)
 
void generate_includes (std::ostream &o)
 
void generate_version_comment (std::ostream &o)
 
void generate_class_decl (const std::string &model_name, std::ostream &o)
 
void generate_end_class_decl (std::ostream &o)
 
void generate_initializer (std::ostream &o, const std::string &base_type, const std::vector< expression > &dims, const expression &type_arg1=expression(), const expression &type_arg2=expression())
 
void generate_validate_context_size (std::ostream &o, const std::string &stage, const std::string &var_name, const std::string &base_type, const std::vector< expression > &dims, const expression &type_arg1=expression(), const expression &type_arg2=expression())
 
void generate_validate_positive (const std::string &var_name, const expression &expr, std::ostream &o)
 
void generate_initialization (std::ostream &o, const std::string &var_name, const std::string &base_type, const std::vector< expression > &dims, const expression &type_arg1=expression(), const expression &type_arg2=expression())
 
void generate_var_resizing (const std::vector< var_decl > &vs, std::ostream &o)
 
const std::vector< expressionEMPTY_EXP_VECTOR (0)
 
void generate_local_var_inits (std::vector< var_decl > vs, bool is_var, bool declare_vars, std::ostream &o)
 
void generate_public_decl (std::ostream &o)
 
void generate_private_decl (std::ostream &o)
 
void generate_validate_var_decl (const var_decl &decl, int indent, std::ostream &o)
 
void generate_validate_var_decls (const std::vector< var_decl > decls, int indent, std::ostream &o)
 
void generate_member_var_decls (const std::vector< var_decl > &vs, int indent, std::ostream &o)
 
void generate_local_var_decls (const std::vector< var_decl > &vs, int indent, std::ostream &o, bool is_var, bool is_fun_return)
 
void generate_local_var_init_nan (const std::vector< var_decl > &vs, int indent, std::ostream &o, bool is_var, bool is_fun_return)
 
void generate_init_vars (const std::vector< var_decl > &vs, int indent, std::ostream &o)
 
void generate_validate_transformed_params (const std::vector< var_decl > &vs, int indent, std::ostream &o)
 
void generate_statement (statement const &s, int indent, std::ostream &o, bool include_sampling, bool is_var, bool is_fun_return)
 
void generate_statements (const std::vector< statement > &ss, int indent, std::ostream &o, bool include_sampling, bool is_var, bool is_fun_return)
 
void generate_log_prob (program const &p, std::ostream &o)
 
void suppress_warning (const std::string &indent, const std::string &var_name, std::ostream &o)
 
void generate_member_var_inits (const std::vector< var_decl > &vs, std::ostream &o)
 
void generate_destructor (const std::string &model_name, std::ostream &o)
 
void generate_set_param_ranges (const std::vector< var_decl > &var_decls, std::ostream &o)
 
void generate_constructor (const program &prog, const std::string &model_name, std::ostream &o)
 
void generate_init_method (const std::vector< var_decl > &vs, std::ostream &o)
 
void generate_dims_method (const program &prog, std::ostream &o)
 
void generate_param_names_method (const program &prog, std::ostream &o)
 
void generate_write_csv_header_method (const program &prog, std::ostream &o)
 
void generate_constrained_param_names_method (const program &prog, std::ostream &o)
 
void generate_unconstrained_param_names_method (const program &prog, std::ostream &o)
 
void generate_write_csv_method (const program &prog, const std::string &model_name, std::ostream &o)
 
void generate_write_array_method (const program &prog, const std::string &model_name, std::ostream &o)
 
void generate_model_name_method (const std::string &model_name, std::ostream &out)
 
void generate_model_typedef (const std::string &model_name, std::ostream &out)
 
void generate_bare_type (const expr_type &t, const std::string &scalar_t_name, std::ostream &out)
 
void generate_arg_decl (bool gen_const, bool gen_ref, const arg_decl &decl, const std::string &scalar_t_name, std::ostream &out)
 
bool has_only_int_args (const function_decl_def &fun)
 
std::string fun_scalar_type (const function_decl_def &fun, bool is_lp)
 
bool needs_template_params (const function_decl_def &fun)
 
void generate_function_template_parameters (const function_decl_def &fun, bool is_rng, bool is_lp, bool is_log, std::ostream &out)
 
void generate_function_inline_return_type (const function_decl_def &fun, const std::string &scalar_t_name, std::ostream &out)
 
void generate_function_name (const function_decl_def &fun, std::ostream &out)
 
void generate_function_arguments (const function_decl_def &fun, bool is_rng, bool is_lp, bool is_log, std::ostream &out)
 
void generate_functor_arguments (const function_decl_def &fun, bool is_rng, bool is_lp, bool is_log, std::ostream &out)
 
void generate_function_body (const function_decl_def &fun, const std::string &scalar_t_name, std::ostream &out)
 
void generate_propto_default_function_body (const function_decl_def &fun, std::ostream &out)
 
void generate_propto_default_function (const function_decl_def &fun, const std::string &scalar_t_name, std::ostream &out)
 
void generate_function (const function_decl_def &fun, std::ostream &out)
 Generate the specified function and optionally its default for propto=false for functions ending in _log. More...
 
void generate_function_functor (const function_decl_def &fun, std::ostream &out)
 
void generate_functions (const std::vector< function_decl_def > &funs, std::ostream &out)
 
void generate_cpp (const program &prog, const std::string &model_name, std::ostream &out)
 
bool is_space (char c)
 
bool is_nonempty (std::string &s)
 
bool parse (std::ostream *output_stream, std::istream &input, const std::string &filename, const std::string &model_name, program &result)
 

Variables

const int VOID_T = 0
 
const int INT_T = 1
 
const int DOUBLE_T = 2
 
const int VECTOR_T = 3
 
const int ROW_VECTOR_T = 4
 
const int MATRIX_T = 5
 
const int ILL_FORMED_T = 6
 
const int model_name_origin = 0
 
const int data_origin = 1
 
const int transformed_data_origin = 2
 
const int parameter_origin = 3
 
const int transformed_parameter_origin = 4
 
const int derived_origin = 5
 
const int local_origin = 6
 
const int function_argument_origin = 7
 
const int function_argument_origin_lp = 8
 
const int function_argument_origin_rng = 9
 
const int void_function_argument_origin = 10
 
const int void_function_argument_origin_lp = 11
 
const int void_function_argument_origin_rng = 12
 
boost::phoenix::function
< validate_expr_type3
validate_expr_type3_f
 
boost::phoenix::function
< set_fun_type3
set_fun_type3_f
 
boost::phoenix::function
< addition_expr3
addition3_f
 
boost::phoenix::function
< subtraction_expr3
subtraction3_f
 
boost::phoenix::function
< set_fun_type2
set_fun_type2_f
 
boost::phoenix::function
< binary_op_expr
binary_op_f
 
boost::phoenix::function
< validate_non_void_arg_function
validate_non_void_arg_f
 
boost::phoenix::function
< set_void_function
set_void_function_f
 
boost::phoenix::function
< set_allows_sampling_origin
set_allows_sampling_origin_f
 
boost::phoenix::function
< validate_declarations
validate_declarations_f
 
boost::phoenix::function
< add_function_signature
add_function_signature_f
 
boost::phoenix::function
< validate_return_type
validate_return_type_f
 
boost::phoenix::function
< scope_lp
scope_lp_f
 
boost::phoenix::function
< unscope_variables
unscope_variables_f
 
boost::phoenix::function
< add_fun_var
add_fun_var_f
 
boost::phoenix::function
< add_conditional_condition
add_conditional_condition_f
 
boost::phoenix::function
< add_conditional_body
add_conditional_body_f
 
boost::phoenix::function
< validate_return_allowed
validate_return_allowed_f
 
boost::phoenix::function
< validate_void_return_allowed
validate_void_return_allowed_f
 
boost::phoenix::function
< validate_assignment
validate_assignment_f
 
boost::phoenix::function
< validate_sample
validate_sample_f
 
boost::phoenix::function
< expression_as_statement
expression_as_statement_f
 
boost::phoenix::function
< unscope_locals
unscope_locals_f
 
boost::phoenix::function
< add_while_condition
add_while_condition_f
 
boost::phoenix::function
< add_while_body
add_while_body_f
 
boost::phoenix::function
< add_loop_identifier
add_loop_identifier_f
 
boost::phoenix::function
< remove_loop_identifier
remove_loop_identifier_f
 
boost::phoenix::function
< validate_int_expr2
validate_int_expr2_f
 
boost::phoenix::function
< validate_allow_sample
validate_allow_sample_f
 
boost::phoenix::function
< validate_non_void_expression
validate_non_void_expression_f
 
boost::phoenix::function
< validate_integrate_ode
validate_integrate_ode_f
 
boost::phoenix::function
< set_fun_type
set_fun_type_f
 
boost::phoenix::function
< set_fun_type_named
set_fun_type_named_f
 
boost::phoenix::function
< exponentiation_expr
exponentiation_f
 
boost::phoenix::function
< multiplication_expr
multiplication_f
 
boost::phoenix::function
< division_expr
division_f
 
boost::phoenix::function
< modulus_expr
modulus_f
 
boost::phoenix::function
< left_division_expr
left_division_f
 
boost::phoenix::function
< elt_multiplication_expr
elt_multiplication_f
 
boost::phoenix::function
< elt_division_expr
elt_division_f
 
boost::phoenix::function
< negate_expr
negate_expr_f
 
boost::phoenix::function
< logical_negate_expr
logical_negate_expr_f
 
boost::phoenix::function
< transpose_expr
transpose_f
 
boost::phoenix::function
< add_expression_dimss
add_expression_dimss_f
 
boost::phoenix::function
< set_var_type
set_var_type_f
 
boost::phoenix::function
< validate_int_expr3
validate_int_expr3_f
 

Detailed Description

Directed graphical model compiler.

Typedef Documentation

Definition at line 60 of file ast.hpp.

Definition at line 167 of file singleton_argument.hpp.

typedef std::pair<expr_type, std::vector<expr_type> > stan::gm::function_signature_t

Definition at line 104 of file ast.hpp.

typedef std::string::const_iterator stan::gm::input_iterator_t

Definition at line 9 of file iterator_typedefs.hpp.

Definition at line 165 of file singleton_argument.hpp.

typedef boost::spirit::line_pos_iterator<input_iterator_t> stan::gm::pos_iterator_t

Definition at line 10 of file iterator_typedefs.hpp.

Definition at line 164 of file singleton_argument.hpp.

Definition at line 168 of file singleton_argument.hpp.

Definition at line 166 of file singleton_argument.hpp.

typedef int stan::gm::var_origin

Definition at line 411 of file ast.hpp.

Function Documentation

bool stan::gm::compile ( std::ostream *  msgs,
std::istream &  stan_gm_in,
std::ostream &  cpp_out,
const std::string &  model_name,
const std::string &  in_file_name = "input" 
)

Read a Stan model specification from the specified input, parse it, and write the C++ code for it to the specified output.

Parameters
msgsOutput stream for warning messages
stan_gm_inStan model specification
cpp_outC++ code output stream
model_nameName of model class
include_mainIndicates whether to generate a main function
in_file_nameName of input file to use in error messages; defaults to input.
Returns
false if code could not be generated due to syntax error in the Stan model; true otherwise.
Parameters
msgs
stan_gm_in
cpp_out
model_name
in_file_name

Definition at line 37 of file compiler.hpp.

const std::vector<expression> stan::gm::EMPTY_EXP_VECTOR ( )
bool stan::gm::ends_with ( const std::string &  suffix,
const std::string &  s 
)

Definition at line 1477 of file ast_def.cpp.

const std::string stan::gm::EOL ( "\n"  )
const std::string stan::gm::EOL2 ( "\n\n"  )
std::string stan::gm::fun_scalar_type ( const function_decl_def &  fun,
bool  is_lp 
)

Definition at line 4309 of file generator.hpp.

void stan::gm::generate_arg_decl ( bool  gen_const,
bool  gen_ref,
const arg_decl &  decl,
const std::string &  scalar_t_name,
std::ostream &  out 
)

Definition at line 4289 of file generator.hpp.

void stan::gm::generate_bare_type ( const expr_type &  t,
const std::string &  scalar_t_name,
std::ostream &  out 
)

Definition at line 4241 of file generator.hpp.

void stan::gm::generate_class_decl ( const std::string &  model_name,
std::ostream &  o 
)

Definition at line 339 of file generator.hpp.

void stan::gm::generate_comment ( std::string const &  msg,
int  indent,
std::ostream &  o 
)

Definition at line 79 of file generator.hpp.

void stan::gm::generate_constrained_param_names_method ( const program &  prog,
std::ostream &  o 
)

Definition at line 3308 of file generator.hpp.

void stan::gm::generate_constructor ( const program &  prog,
const std::string &  model_name,
std::ostream &  o 
)

Definition at line 2517 of file generator.hpp.

void stan::gm::generate_cpp ( const program &  prog,
const std::string &  model_name,
std::ostream &  out 
)

Definition at line 4614 of file generator.hpp.

void stan::gm::generate_destructor ( const std::string &  model_name,
std::ostream &  o 
)

Definition at line 2320 of file generator.hpp.

void stan::gm::generate_dims_method ( const program &  prog,
std::ostream &  o 
)

Definition at line 2920 of file generator.hpp.

void stan::gm::generate_end_class_decl ( std::ostream &  o)

Definition at line 344 of file generator.hpp.

void stan::gm::generate_end_namespace ( std::ostream &  o)

Definition at line 75 of file generator.hpp.

void stan::gm::generate_expression ( const expression &  e,
std::ostream &  o 
)

Definition at line 249 of file generator.hpp.

void stan::gm::generate_function ( const function_decl_def &  fun,
std::ostream &  out 
)

Generate the specified function and optionally its default for propto=false for functions ending in _log.

Exact behavior differs for unmarked functions, and functions ending in one of "_rng", "_lp", or "_log".

Parameters
[in]funfunction AST object
[in,out]outoutput stream to which function definition is written

Definition at line 4543 of file generator.hpp.

void stan::gm::generate_function_arguments ( const function_decl_def &  fun,
bool  is_rng,
bool  is_lp,
bool  is_log,
std::ostream &  out 
)

Definition at line 4418 of file generator.hpp.

void stan::gm::generate_function_body ( const function_decl_def &  fun,
const std::string &  scalar_t_name,
std::ostream &  out 
)

Definition at line 4473 of file generator.hpp.

void stan::gm::generate_function_functor ( const function_decl_def &  fun,
std::ostream &  out 
)

Definition at line 4564 of file generator.hpp.

void stan::gm::generate_function_inline_return_type ( const function_decl_def &  fun,
const std::string &  scalar_t_name,
std::ostream &  out 
)

Definition at line 4404 of file generator.hpp.

void stan::gm::generate_function_name ( const function_decl_def &  fun,
std::ostream &  out 
)

Definition at line 4412 of file generator.hpp.

void stan::gm::generate_function_template_parameters ( const function_decl_def &  fun,
bool  is_rng,
bool  is_lp,
bool  is_log,
std::ostream &  out 
)

Definition at line 4356 of file generator.hpp.

void stan::gm::generate_functions ( const std::vector< function_decl_def > &  funs,
std::ostream &  out 
)

Definition at line 4606 of file generator.hpp.

void stan::gm::generate_functor_arguments ( const function_decl_def &  fun,
bool  is_rng,
bool  is_lp,
bool  is_log,
std::ostream &  out 
)

Definition at line 4447 of file generator.hpp.

void stan::gm::generate_include ( const std::string &  lib_name,
std::ostream &  o 
)

Definition at line 323 of file generator.hpp.

void stan::gm::generate_includes ( std::ostream &  o)

Definition at line 327 of file generator.hpp.

void stan::gm::generate_indent ( size_t  indent,
std::ostream &  o 
)

Definition at line 50 of file generator.hpp.

template<bool isLHS>
void stan::gm::generate_indexed_expr ( const std::string &  expr,
const std::vector< expression >  indexes,
base_expr_type  base_type,
size_t  e_num_dims,
std::ostream &  o 
)

Definition at line 87 of file generator.hpp.

void stan::gm::generate_init_method ( const std::vector< var_decl > &  vs,
std::ostream &  o 
)

Definition at line 2795 of file generator.hpp.

void stan::gm::generate_init_vars ( const std::vector< var_decl > &  vs,
int  indent,
std::ostream &  o 
)

Definition at line 1369 of file generator.hpp.

void stan::gm::generate_initialization ( std::ostream &  o,
const std::string &  var_name,
const std::string &  base_type,
const std::vector< expression > &  dims,
const expression &  type_arg1 = expression(),
const expression &  type_arg2 = expression() 
)

Definition at line 469 of file generator.hpp.

void stan::gm::generate_initializer ( std::ostream &  o,
const std::string &  base_type,
const std::vector< expression > &  dims,
const expression &  type_arg1 = expression(),
const expression &  type_arg2 = expression() 
)

Definition at line 348 of file generator.hpp.

void stan::gm::generate_local_var_decls ( const std::vector< var_decl > &  vs,
int  indent,
std::ostream &  o,
bool  is_var,
bool  is_fun_return 
)

Definition at line 1215 of file generator.hpp.

void stan::gm::generate_local_var_init_nan ( const std::vector< var_decl > &  vs,
int  indent,
std::ostream &  o,
bool  is_var,
bool  is_fun_return 
)

Definition at line 1295 of file generator.hpp.

void stan::gm::generate_local_var_inits ( std::vector< var_decl >  vs,
bool  is_var,
bool  declare_vars,
std::ostream &  o 
)

Definition at line 758 of file generator.hpp.

void stan::gm::generate_log_prob ( program const &  p,
std::ostream &  o 
)

Definition at line 1768 of file generator.hpp.

void stan::gm::generate_member_var_decls ( const std::vector< var_decl > &  vs,
int  indent,
std::ostream &  o 
)

Definition at line 987 of file generator.hpp.

void stan::gm::generate_member_var_inits ( const std::vector< var_decl > &  vs,
std::ostream &  o 
)

Definition at line 2313 of file generator.hpp.

void stan::gm::generate_model_name_method ( const std::string &  model_name,
std::ostream &  out 
)

Definition at line 4228 of file generator.hpp.

void stan::gm::generate_model_typedef ( const std::string &  model_name,
std::ostream &  out 
)

Definition at line 4235 of file generator.hpp.

void stan::gm::generate_param_names_method ( const program &  prog,
std::ostream &  o 
)

Definition at line 3001 of file generator.hpp.

void stan::gm::generate_printable ( const printable &  p,
std::ostream &  o 
)

Definition at line 283 of file generator.hpp.

void stan::gm::generate_private_decl ( std::ostream &  o)

Definition at line 778 of file generator.hpp.

void stan::gm::generate_propto_default_function ( const function_decl_def &  fun,
const std::string &  scalar_t_name,
std::ostream &  out 
)

Definition at line 4522 of file generator.hpp.

void stan::gm::generate_propto_default_function_body ( const function_decl_def &  fun,
std::ostream &  out 
)

Definition at line 4505 of file generator.hpp.

void stan::gm::generate_public_decl ( std::ostream &  o)

Definition at line 774 of file generator.hpp.

void stan::gm::generate_set_param_ranges ( const std::vector< var_decl > &  var_decls,
std::ostream &  o 
)

Definition at line 2505 of file generator.hpp.

void stan::gm::generate_start_namespace ( std::string  name,
std::ostream &  o 
)

Definition at line 70 of file generator.hpp.

void stan::gm::generate_statement ( statement const &  s,
int  indent,
std::ostream &  o,
bool  include_sampling,
bool  is_var,
bool  is_fun_return 
)

Definition at line 1746 of file generator.hpp.

void stan::gm::generate_statements ( const std::vector< statement > &  ss,
int  indent,
std::ostream &  o,
bool  include_sampling,
bool  is_var,
bool  is_fun_return 
)

Definition at line 1756 of file generator.hpp.

void stan::gm::generate_type ( const std::string &  base_type,
const std::vector< expression > &  ,
size_t  end,
std::ostream &  o 
)

Definition at line 126 of file generator.hpp.

void stan::gm::generate_typedef ( const std::string &  type,
const std::string &  abbrev,
std::ostream &  o 
)

Definition at line 310 of file generator.hpp.

void stan::gm::generate_typedefs ( std::ostream &  o)

Definition at line 316 of file generator.hpp.

void stan::gm::generate_unconstrained_param_names_method ( const program &  prog,
std::ostream &  o 
)

Definition at line 3491 of file generator.hpp.

void stan::gm::generate_using ( const std::string &  type,
std::ostream &  o 
)

Definition at line 288 of file generator.hpp.

void stan::gm::generate_using_namespace ( const std::string &  ns,
std::ostream &  o 
)

Definition at line 292 of file generator.hpp.

void stan::gm::generate_usings ( std::ostream &  o)

Definition at line 297 of file generator.hpp.

void stan::gm::generate_validate_context_size ( std::ostream &  o,
const std::string &  stage,
const std::string &  var_name,
const std::string &  base_type,
const std::vector< expression > &  dims,
const expression &  type_arg1 = expression(),
const expression &  type_arg2 = expression() 
)

Definition at line 380 of file generator.hpp.

void stan::gm::generate_validate_positive ( const std::string &  var_name,
const expression &  expr,
std::ostream &  o 
)

Definition at line 458 of file generator.hpp.

void stan::gm::generate_validate_transformed_params ( const std::vector< var_decl > &  vs,
int  indent,
std::ostream &  o 
)

Definition at line 1504 of file generator.hpp.

void stan::gm::generate_validate_var_decl ( const var_decl &  decl,
int  indent,
std::ostream &  o 
)

Definition at line 907 of file generator.hpp.

void stan::gm::generate_validate_var_decls ( const std::vector< var_decl >  decls,
int  indent,
std::ostream &  o 
)

Definition at line 914 of file generator.hpp.

void stan::gm::generate_var_resizing ( const std::vector< var_decl > &  vs,
std::ostream &  o 
)

Definition at line 537 of file generator.hpp.

void stan::gm::generate_version_comment ( std::ostream &  o)

Definition at line 334 of file generator.hpp.

void stan::gm::generate_void_statement ( const std::string &  name,
const size_t  indent,
std::ostream &  o 
)

Definition at line 55 of file generator.hpp.

void stan::gm::generate_write_array_method ( const program &  prog,
const std::string &  model_name,
std::ostream &  o 
)

Definition at line 4131 of file generator.hpp.

void stan::gm::generate_write_csv_header_method ( const program &  prog,
std::ostream &  o 
)

Definition at line 3173 of file generator.hpp.

void stan::gm::generate_write_csv_method ( const program &  prog,
const std::string &  model_name,
std::ostream &  o 
)

Definition at line 3771 of file generator.hpp.

template<typename D >
bool stan::gm::has_lb ( const D &  x)

Definition at line 39 of file generator.hpp.

bool stan::gm::has_lp_suffix ( const std::string &  s)

Definition at line 1415 of file ast_def.cpp.

template<typename D >
bool stan::gm::has_lub ( const D &  x)

Definition at line 31 of file generator.hpp.

bool stan::gm::has_non_param_var ( const expression &  e,
const variable_map &  var_map 
)

Definition at line 748 of file ast_def.cpp.

bool stan::gm::has_only_int_args ( const function_decl_def &  fun)

Definition at line 4302 of file generator.hpp.

bool stan::gm::has_rng_suffix ( const std::string &  s)

Definition at line 1406 of file ast_def.cpp.

template<typename D >
bool stan::gm::has_ub ( const D &  x)

Definition at line 35 of file generator.hpp.

bool stan::gm::has_var ( const expression &  e,
const variable_map &  var_map 
)

Definition at line 675 of file ast_def.cpp.

const std::string stan::gm::INDENT ( " "  )
const std::string stan::gm::INDENT2 ( " "  )
const std::string stan::gm::INDENT3 ( " "  )
expr_type stan::gm::infer_type_indexing ( const base_expr_type &  expr_base_type,
size_t  num_expr_dims,
size_t  num_index_dims 
)

Definition at line 873 of file ast_def.cpp.

expr_type stan::gm::infer_type_indexing ( const expression &  expr,
size_t  num_index_dims 
)

Definition at line 892 of file ast_def.cpp.

bool stan::gm::is_assignable ( const expr_type &  l_type,
const expr_type &  r_type,
const std::string &  failure_message,
std::ostream &  error_msgs 
)

Definition at line 1453 of file ast_def.cpp.

bool stan::gm::is_linear_function ( const std::string &  name)

Definition at line 644 of file ast_def.cpp.

bool stan::gm::is_nil ( const expression &  e)

Definition at line 768 of file ast_def.cpp.

bool stan::gm::is_nonempty ( std::string &  s)

Definition at line 54 of file parser.hpp.

bool stan::gm::is_space ( char  c)

Definition at line 50 of file parser.hpp.

bool stan::gm::is_user_defined ( const std::string &  name,
const std::vector< expression > &  args 
)

Definition at line 1423 of file ast_def.cpp.

bool stan::gm::is_user_defined ( const fun &  fx)

Definition at line 1449 of file ast_def.cpp.

bool stan::gm::is_user_defined_prob_function ( const std::string &  name,
const expression &  variate,
const std::vector< expression > &  params 
)

Definition at line 1439 of file ast_def.cpp.

bool stan::gm::needs_template_params ( const function_decl_def &  fun)

Definition at line 4346 of file generator.hpp.

std::ostream & stan::gm::operator<< ( std::ostream &  o,
const expr_type &  et 
)

Definition at line 118 of file ast_def.cpp.

bool stan::gm::parse ( std::ostream *  output_stream,
std::istream &  input,
const std::string &  filename,
const std::string &  model_name,
program &  result 
)
inline

Definition at line 61 of file parser.hpp.

static void stan::gm::print_quoted_expression ( std::ostream &  o,
const expression &  e 
)
static

Definition at line 265 of file generator.hpp.

static void stan::gm::print_string_literal ( std::ostream &  o,
const std::string &  s 
)
static

Definition at line 254 of file generator.hpp.

void stan::gm::print_var_origin ( std::ostream &  o,
const var_origin &  vo 
)

Definition at line 944 of file ast_def.cpp.

expr_type stan::gm::promote_primitive ( const expr_type &  et)

Definition at line 125 of file ast_def.cpp.

expr_type stan::gm::promote_primitive ( const expr_type &  et1,
const expr_type &  et2 
)

Definition at line 131 of file ast_def.cpp.

bool stan::gm::returns_type ( const expr_type &  return_type,
const statement &  statement,
std::ostream &  error_msgs 
)

Definition at line 515 of file ast_def.cpp.

void stan::gm::suppress_warning ( const std::string &  indent,
const std::string &  var_name,
std::ostream &  o 
)

Definition at line 2304 of file generator.hpp.

template<typename T >
std::string stan::gm::to_string ( i)

Definition at line 44 of file generator.hpp.

size_t stan::gm::total_dims ( const std::vector< std::vector< expression > > &  dimss)

Definition at line 865 of file ast_def.cpp.

std::ostream & stan::gm::write_base_expr_type ( std::ostream &  o,
base_expr_type  type 
)

Definition at line 23 of file ast_def.cpp.

Variable Documentation

boost::phoenix::function<add_conditional_body> stan::gm::add_conditional_body_f

Definition at line 83 of file statement_2_grammar_def.hpp.

boost::phoenix::function<add_conditional_condition> stan::gm::add_conditional_condition_f

Definition at line 73 of file statement_2_grammar_def.hpp.

boost::phoenix::function<add_expression_dimss> stan::gm::add_expression_dimss_f

Definition at line 574 of file term_grammar_def.hpp.

boost::phoenix::function<add_fun_var> stan::gm::add_fun_var_f

Definition at line 287 of file functions_grammar_def.hpp.

boost::phoenix::function<add_function_signature> stan::gm::add_function_signature_f

Definition at line 210 of file functions_grammar_def.hpp.

boost::phoenix::function<add_loop_identifier> stan::gm::add_loop_identifier_f

Definition at line 460 of file statement_grammar_def.hpp.

boost::phoenix::function<add_while_body> stan::gm::add_while_body_f

Definition at line 438 of file statement_grammar_def.hpp.

boost::phoenix::function<add_while_condition> stan::gm::add_while_condition_f

Definition at line 428 of file statement_grammar_def.hpp.

boost::phoenix::function<addition_expr3> stan::gm::addition3_f

Definition at line 108 of file expression07_grammar_def.hpp.

boost::phoenix::function<binary_op_expr> stan::gm::binary_op_f

Definition at line 102 of file expression_grammar_def.hpp.

const int stan::gm::data_origin = 1

Definition at line 413 of file ast.hpp.

const int stan::gm::derived_origin = 5

Definition at line 417 of file ast.hpp.

boost::phoenix::function<division_expr> stan::gm::division_f

Definition at line 382 of file term_grammar_def.hpp.

const int stan::gm::DOUBLE_T = 2

Definition at line 66 of file ast.hpp.

boost::phoenix::function<elt_division_expr> stan::gm::elt_division_f

Definition at line 487 of file term_grammar_def.hpp.

boost::phoenix::function<elt_multiplication_expr> stan::gm::elt_multiplication_f

Definition at line 463 of file term_grammar_def.hpp.

boost::phoenix::function<exponentiation_expr> stan::gm::exponentiation_f

Definition at line 304 of file term_grammar_def.hpp.

boost::phoenix::function<expression_as_statement> stan::gm::expression_as_statement_f

Definition at line 400 of file statement_grammar_def.hpp.

const int stan::gm::function_argument_origin = 7

Definition at line 419 of file ast.hpp.

const int stan::gm::function_argument_origin_lp = 8

Definition at line 420 of file ast.hpp.

const int stan::gm::function_argument_origin_rng = 9

Definition at line 421 of file ast.hpp.

const int stan::gm::ILL_FORMED_T = 6

Definition at line 70 of file ast.hpp.

const int stan::gm::INT_T = 1

Definition at line 65 of file ast.hpp.

boost::phoenix::function<left_division_expr> stan::gm::left_division_f

Definition at line 439 of file term_grammar_def.hpp.

const int stan::gm::local_origin = 6

Definition at line 418 of file ast.hpp.

boost::phoenix::function<logical_negate_expr> stan::gm::logical_negate_expr_f

Definition at line 535 of file term_grammar_def.hpp.

const int stan::gm::MATRIX_T = 5

Definition at line 69 of file ast.hpp.

const int stan::gm::model_name_origin = 0

Definition at line 412 of file ast.hpp.

boost::phoenix::function<modulus_expr> stan::gm::modulus_f

Definition at line 412 of file term_grammar_def.hpp.

boost::phoenix::function<multiplication_expr> stan::gm::multiplication_f

Definition at line 328 of file term_grammar_def.hpp.

boost::phoenix::function<negate_expr> stan::gm::negate_expr_f

Definition at line 514 of file term_grammar_def.hpp.

const int stan::gm::parameter_origin = 3

Definition at line 415 of file ast.hpp.

boost::phoenix::function<remove_loop_identifier> stan::gm::remove_loop_identifier_f

Definition at line 470 of file statement_grammar_def.hpp.

const int stan::gm::ROW_VECTOR_T = 4

Definition at line 68 of file ast.hpp.

boost::phoenix::function<scope_lp> stan::gm::scope_lp_f

Definition at line 242 of file functions_grammar_def.hpp.

boost::phoenix::function<set_allows_sampling_origin> stan::gm::set_allows_sampling_origin_f

Definition at line 109 of file functions_grammar_def.hpp.

boost::phoenix::function<set_fun_type2> stan::gm::set_fun_type2_f

Definition at line 71 of file expression_grammar_def.hpp.

boost::phoenix::function<set_fun_type3> stan::gm::set_fun_type3_f

Definition at line 85 of file expression07_grammar_def.hpp.

boost::phoenix::function<set_fun_type> stan::gm::set_fun_type_f

Definition at line 192 of file term_grammar_def.hpp.

boost::phoenix::function<set_fun_type_named> stan::gm::set_fun_type_named_f

Definition at line 270 of file term_grammar_def.hpp.

boost::phoenix::function<set_var_type> stan::gm::set_var_type_f

Definition at line 604 of file term_grammar_def.hpp.

boost::phoenix::function<set_void_function> stan::gm::set_void_function_f

Definition at line 82 of file functions_grammar_def.hpp.

boost::phoenix::function<subtraction_expr3> stan::gm::subtraction3_f

Definition at line 131 of file expression07_grammar_def.hpp.

const int stan::gm::transformed_data_origin = 2

Definition at line 414 of file ast.hpp.

const int stan::gm::transformed_parameter_origin = 4

Definition at line 416 of file ast.hpp.

boost::phoenix::function<transpose_expr> stan::gm::transpose_f

Definition at line 555 of file term_grammar_def.hpp.

boost::phoenix::function<unscope_locals> stan::gm::unscope_locals_f

Definition at line 411 of file statement_grammar_def.hpp.

boost::phoenix::function<unscope_variables> stan::gm::unscope_variables_f

Definition at line 255 of file functions_grammar_def.hpp.

boost::phoenix::function<validate_allow_sample> stan::gm::validate_allow_sample_f

Definition at line 508 of file statement_grammar_def.hpp.

boost::phoenix::function<validate_assignment> stan::gm::validate_assignment_f

Definition at line 217 of file statement_grammar_def.hpp.

boost::phoenix::function<validate_declarations> stan::gm::validate_declarations_f

Definition at line 136 of file functions_grammar_def.hpp.

boost::phoenix::function<validate_expr_type3> stan::gm::validate_expr_type3_f

Definition at line 67 of file expression07_grammar_def.hpp.

boost::phoenix::function<validate_int_expr2> stan::gm::validate_int_expr2_f

Definition at line 489 of file statement_grammar_def.hpp.

boost::phoenix::function<validate_int_expr3> stan::gm::validate_int_expr3_f

Definition at line 620 of file term_grammar_def.hpp.

boost::phoenix::function<validate_integrate_ode> stan::gm::validate_integrate_ode_f

Definition at line 175 of file term_grammar_def.hpp.

boost::phoenix::function<validate_non_void_arg_function> stan::gm::validate_non_void_arg_f

Definition at line 62 of file functions_grammar_def.hpp.

boost::phoenix::function<validate_non_void_expression> stan::gm::validate_non_void_expression_f

Definition at line 523 of file statement_grammar_def.hpp.

boost::phoenix::function<validate_return_allowed> stan::gm::validate_return_allowed_f

Definition at line 102 of file statement_grammar_def.hpp.

boost::phoenix::function<validate_return_type> stan::gm::validate_return_type_f

Definition at line 233 of file functions_grammar_def.hpp.

boost::phoenix::function<validate_sample> stan::gm::validate_sample_f

Definition at line 367 of file statement_grammar_def.hpp.

boost::phoenix::function<validate_void_return_allowed> stan::gm::validate_void_return_allowed_f

Definition at line 121 of file statement_grammar_def.hpp.

const int stan::gm::VECTOR_T = 3

Definition at line 67 of file ast.hpp.

const int stan::gm::void_function_argument_origin = 10

Definition at line 422 of file ast.hpp.

const int stan::gm::void_function_argument_origin_lp = 11

Definition at line 423 of file ast.hpp.

const int stan::gm::void_function_argument_origin_rng = 12

Definition at line 424 of file ast.hpp.

const int stan::gm::VOID_T = 0

Definition at line 64 of file ast.hpp.


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