Typedefs | |
typedef int | origin_block |
typedef std::pair< expr_type, std::vector< function_arg_type > > | function_signature_t |
typedef std::string::const_iterator | input_iterator_t |
typedef boost::spirit::line_pos_iterator< input_iterator_t > | pos_iterator_t |
Functions | |
std::ostream & | operator<< (std::ostream &o, const expr_type &et) |
bool | ends_with (const std::string &suffix, const std::string &s) |
bool | fun_name_exists (const std::string &name) |
void | generate_expression (const expression &e, bool user_facing, std::ostream &o) |
std::string | get_ccdf (const std::string &dist_name) |
std::string | get_cdf (const std::string &dist_name) |
std::string | get_prob_fun (const std::string &dist_name) |
bool | has_ccdf_suffix (const std::string &name) |
bool | has_cdf_suffix (const std::string &name) |
bool | has_lp_suffix (const std::string &name) |
bool | has_non_param_var (const expression &e, const variable_map &var_map) |
bool | is_linear_function (const std::string &name) |
bool | has_prob_fun_suffix (const std::string &name) |
bool | has_rng_suffix (const std::string &name) |
bool | has_var (const expression &e, const variable_map &var_map) |
expr_type | indexed_type (const expression &e, const std::vector< idx > &idxs) |
expr_type | infer_type_indexing (const base_expr_type &base_type, std::size_t dims, std::size_t num_indexes) |
expr_type | infer_type_indexing (const expression &expr, std::size_t num_indexes) |
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) |
bool | is_assignable (const expr_type &l_type, const expr_type &r_type, const std::string &failure_message, std::ostream &error_msgs) |
bool | is_multi_index (const idx &idx) |
bool | is_nil (const expression &e) |
bool | is_nonempty (const std::string &s) |
bool | is_space (char c) |
bool | is_user_defined (const fun &fx) |
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 > ¶ms) |
std::ostream & | operator<< (std::ostream &o, const function_arg_type &fa_type) |
void | print_scope (std::ostream &o, const scope &var_scope) |
expr_type | promote_primitive (const expr_type &et) |
expr_type | promote_primitive (const expr_type &et1, const expr_type &et2) |
bool | returns_type (const expr_type &return_type, const statement &statement, std::ostream &error_msgs) |
std::string | strip_ccdf_suffix (const std::string &dist_fun) |
std::string | strip_cdf_suffix (const std::string &dist_fun) |
std::string | strip_prob_fun_suffix (const std::string &dist_fun) |
std::size_t | total_dims (const std::vector< std::vector< expression > > &dimss) |
std::ostream & | write_base_expr_type (std::ostream &o, base_expr_type type) |
bool | is_binary_operator (const std::string &name) |
bool | is_unary_operator (const std::string &name) |
bool | is_unary_postfix_operator (const std::string &name) |
bool | is_operator (const std::string &name) |
std::string | fun_name_to_operator (const std::string &name) |
void | print_signature (const std::string &name, const std::vector< expr_type > &arg_types, bool sampling_error_style, std::ostream &msgs) |
void | print_signature (const std::string &name, const std::vector< function_arg_type > &arg_types, bool sampling_error_style, std::ostream &msgs) |
bool | compile_functions (std::ostream *msgs, std::istream &stan_funcs_in, std::ostream &cpp_out, const std::vector< std::string > &namespaces, const bool allow_undefined=false, const std::string &filename="unknown file name", const std::vector< std::string > &include_paths=std::vector< std::string >()) |
bool | compile (std::ostream *msgs, std::istream &in, std::ostream &out, const std::string &name, const bool allow_undefined=false, const std::string &filename="unknown file name", const std::vector< std::string > &include_paths=std::vector< std::string >()) |
const std::string | EOL ("\n") |
const std::string | EOL2 ("\n\n") |
const std::string | INDENT (" ") |
const std::string | INDENT2 (" ") |
const std::string | INDENT3 (" ") |
const std::vector< expression > | EMPTY_EXP_VECTOR (0) |
const bool | USER_FACING (true) |
const bool | NOT_USER_FACING (false) |
void | generate_array_builder_adds (const std::vector< expression > &elements, bool user_facing, std::ostream &o) |
void | generate_idxs (const std::vector< idx > &idxs, std::ostream &o) |
void | generate_idxs_user (const std::vector< idx > &idxs, std::ostream &o) |
std::string | fun_scalar_type (const function_decl_def &fun, bool is_lp) |
void | generate_idx_user (const idx &i, std::ostream &o) |
void | generate_arg_decl (bool gen_const, bool gen_ref, const arg_decl &decl, const std::string &scalar_t_name, std::ostream &o) |
void | generate_array_var_type (const base_expr_type &base_type, const std::string &real_var_type, std::ostream &o) |
void | generate_bare_type (const expr_type &t, const std::string &scalar_t_name, std::ostream &o) |
void | generate_catch_throw_located (int indent, std::ostream &o) |
void | generate_class_decl (const std::string &model_name, std::ostream &o) |
void | generate_class_decl_end (std::ostream &o) |
void | generate_comment (const std::string &msg, int indent, std::ostream &o) |
void | generate_constrained_param_names_method (const program &prog, std::ostream &o) |
void | generate_constructor (const program &prog, const std::string &model_name, std::ostream &o) |
void | generate_cpp (const program &prog, const std::string &model_name, const std::vector< io::preproc_event > &history, std::ostream &o) |
void | generate_destructor (const std::string &model_name, std::ostream &o) |
void | generate_dims_method (const program &prog, std::ostream &o) |
void | generate_eigen_index_expression (const expression &e, std::ostream &o) |
void | generate_function_instantiation_template_parameters (const function_decl_def &fun, bool is_rng, bool is_lp, bool is_log, const std::string &rng_class, std::ostream &out) |
void | generate_function (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 &o, bool double_only=false, std::string rng_type="RNG", bool parameter_defaults=false) |
void | generate_function_body (const function_decl_def &fun, const std::string &scalar_t_name, std::ostream &o) |
void | generate_function_functor (const function_decl_def &fun, std::ostream &o) |
void | generate_function_inline_return_type (const function_decl_def &fun, const std::string &scalar_t_name, int indent, std::ostream &out) |
void | generate_function_instantiation (const function_decl_def &fun, const std::vector< std::string > &namespaces, std::ostream &out) |
void | generate_function_instantiation_body (const function_decl_def &fun, const std::vector< std::string > &namespaces, bool is_rng, bool is_lp, bool is_log, const std::string &rng_class, std::ostream &o) |
void | generate_function_instantiation_name (const function_decl_def &fun, std::ostream &out) |
void | generate_function_instantiations (const std::vector< function_decl_def > &funs, const std::vector< std::string > &namespaces, std::ostream &o) |
void | generate_function_name (const function_decl_def &fun, std::ostream &o) |
void | generate_function_template_parameters (const function_decl_def &fun, bool is_rng, bool is_lp, bool is_log, std::ostream &out) |
void | generate_functions (const std::vector< function_decl_def > &funs, std::ostream &o) |
void | generate_functor_arguments (const function_decl_def &fun, bool is_rng, bool is_lp, bool is_log, std::ostream &o) |
void | generate_globals (std::ostream &o) |
void | generate_idx (const idx &i, std::ostream &o) |
void | generate_idxs (size_t pos, const std::vector< idx > &idxs, std::ostream &o) |
void | generate_include (const std::string &lib_name, std::ostream &o) |
void | generate_includes (std::ostream &o) |
void | generate_indent (size_t 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, bool user_facing, std::ostream &o) |
void | generate_indexed_expr_user (const std::string &expr, const std::vector< expression > indexes, std::ostream &o) |
void | generate_init_method (const std::vector< var_decl > &vs, std::ostream &o) |
void | generate_initialization (std::ostream &o, size_t indent, 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_initializer (std::ostream &o, const std::string &base_type, const std::vector< expression > &dims, const expression &type_arg1=expression(), const expression &type_arg2=expression()) |
template<typename T > | |
void | generate_line_number (const T &line, int indent, std::ostream &o) |
template void | generate_line_number (const var_decl &, int indent, std::ostream &o) |
template void | generate_line_number (const statement &, int indent, std::ostream &o) |
void | generate_local_var_decls (const std::vector< var_decl > &vs, int indent, std::ostream &o) |
void | generate_local_var_inits (std::vector< var_decl > vs, bool declare_vars, int indent, std::ostream &o) |
void | generate_log_prob (const program &p, std::ostream &o) |
void | generate_member_var_decls (const std::vector< var_decl > &vs, int indent, std::ostream &o) |
void | generate_member_var_decls_all (const program &prog, std::ostream &o) |
void | generate_member_var_inits (const std::vector< var_decl > &vs, int indent, std::ostream &o) |
void | generate_model_name_method (const std::string &model_name, std::ostream &o) |
void | generate_model_typedef (const std::string &model_name, std::ostream &o) |
void | generate_namespace_end (std::ostream &o) |
void | generate_namespace_start (const std::string &name, std::ostream &o) |
void | generate_param_names_method (const program &prog, std::ostream &o) |
void | generate_printable (const printable &p, std::ostream &o) |
void | generate_private_decl (std::ostream &o) |
void | generate_program_reader_fun (const std::vector< io::preproc_event > &history, std::ostream &o) |
void | generate_propto_default_function (const function_decl_def &fun, const std::string &scalar_t_name, std::ostream &o) |
void | generate_propto_default_function_body (const function_decl_def &fun, std::ostream &o) |
void | generate_public_decl (std::ostream &o) |
void | generate_quoted_expression (const expression &e, std::ostream &o) |
void | generate_quoted_string (const std::string &s, std::ostream &o) |
void | generate_real_var_type (const scope &var_scope, bool has_var, std::ostream &o) |
void | generate_register_mpi (const std::string &model_name, std::ostream &o) |
void | generate_set_param_ranges (const std::vector< var_decl > &var_decls, int indent, std::ostream &o) |
void | generate_standalone_functions (const program &prog, const std::vector< std::string > &namespaces, const std::vector< io::preproc_event > &history, std::ostream &o) |
void | generate_statement (const statement &s, int indent, std::ostream &o) |
void | generate_statements (const std::vector< statement > statements, int indent, std::ostream &o) |
void | generate_try (int indent, std::ostream &o) |
void | generate_type (const std::string &base_type, const std::vector< expression > &, size_t end, 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_unconstrained_param_names_method (const program &prog, 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_usings_standalone_functions (std::ostream &o) |
void | generate_validate_context_size (size_t indent, 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, int indents, std::ostream &o) |
void | generate_validate_transformed_params (const std::vector< var_decl > &vs, int indent, 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_var_resizing (const std::vector< var_decl > &vs, int indent, std::ostream &o) |
void | generate_version_comment (std::ostream &o) |
void | generate_void_statement (const std::string &name, const size_t indent, std::ostream &o) |
void | generate_write_array_method (const program &prog, const std::string &model_name, std::ostream &o) |
template<typename D > | |
bool | has_lb (const D &x) |
template<typename D > | |
bool | has_lub (const D &x) |
bool | has_only_int_args (const function_decl_def &fun) |
template<typename D > | |
bool | has_ub (const D &x) |
void | generate_statement (const std::vector< statement > &ss, int indent, std::ostream &o) |
template<typename T > | |
std::string | to_string (const T &x) |
bool | has_prob_suffix (const std::string &s) |
void | replace_suffix (const std::string &old_suffix, const std::string &new_suffix, fun &f) |
void | set_fun_type (fun &fun, std::ostream &error_msgs) |
int | num_dimss (std::vector< std::vector< stan::lang::expression > > &dimss) |
template<class T > | |
void | validate_integrate_ode_non_control_args (const T &ode_fun, const variable_map &var_map, bool &pass, std::ostream &error_msgs) |
template<class T > | |
void | validate_algebra_solver_non_control_args (const T &alg_fun, const variable_map &var_map, bool &pass, std::ostream &error_msgs) |
void | qualify_builtins (fun &f) |
bool | has_rng_lp_suffix (const std::string &s) |
bool | deprecate_fun (const std::string &old_name, const std::string &new_name, fun &f, std::ostream &msgs) |
bool | deprecate_suffix (const std::string &deprecated_suffix, const std::string &replacement, fun &f, std::ostream &msgs) |
bool | is_double_return (const std::string &function_name, const std::vector< expr_type > &arg_types, std::ostream &error_msgs) |
bool | is_univariate (const expr_type &et) |
bool | can_assign_to_lhs_var (const std::string &lhs_var_name, const scope &var_scope, const variable_map &vm, std::ostream &error_msgs) |
expr_type | infer_var_dims_type (const base_var_decl &var_type, const variable_dims &var_dims) |
bool | has_same_shape (const expr_type &lhs_type, const expression &rhs_expr, const std::string &name, const std::string &stmt_type, std::ostream &error_msgs) |
bool | fun_exists (const std::set< std::pair< std::string, function_signature_t > > &existing, const std::pair< std::string, function_signature_t > &name_sig, bool name_only=true) |
void | dump_program_line (size_t idx_errline, int offset, const std::string &origin_file, size_t origin_line, const io::program_reader &reader, const std::vector< std::string > &program_lines, std::stringstream &error_msgs) |
bool | parse (std::ostream *out, std::istream &in, const std::string &name, const io::program_reader &reader, program &prog, const bool allow_undefined=false) |
template<typename E > | |
bool | is_type (const std::exception &e) |
void | rethrow_located (const std::exception &e, int line, const io::program_reader &reader=stan::io::program_reader()) |
typedef std::pair<expr_type, std::vector<function_arg_type> > stan::lang::function_signature_t |
The type of a function signature, mapping a vector of argument expression types to a result expression type.
Definition at line 17 of file function_signature_t.hpp.
typedef std::string::const_iterator stan::lang::input_iterator_t |
Definition at line 10 of file iterator_typedefs.hpp.
typedef int stan::lang::origin_block |
The type of a variable indicating where a variable was declared. This is a typedef rather than an enum to get around forward declaration issues with enums in header files.
Definition at line 11 of file origin_block.hpp.
typedef boost::spirit::line_pos_iterator<input_iterator_t> stan::lang::pos_iterator_t |
Definition at line 11 of file iterator_typedefs.hpp.
bool stan::lang::can_assign_to_lhs_var | ( | const std::string & | lhs_var_name, |
const scope & | var_scope, | ||
const variable_map & | vm, | ||
std::ostream & | error_msgs | ||
) |
Definition at line 148 of file semantic_actions_def.cpp.
References allTimeWatchdog::endl, stan::lang::variable_map::exists(), stan::lang::scope::fun(), stan::lang::variable_map::get_scope(), stan::lang::scope::is_local(), loop_identifier_origin, print_scope(), stan::lang::scope::program_block(), and string.
Referenced by stan::lang::validate_lhs_var_assgn::operator()().
bool stan::lang::compile | ( | std::ostream * | msgs, |
std::istream & | in, | ||
std::ostream & | out, | ||
const std::string & | name, | ||
const bool | allow_undefined = false , |
||
const std::string & | filename = "unknown file name" , |
||
const std::vector< std::string > & | include_paths = std::vector<std::string>() |
||
) |
Read a Stan model specification from the specified input, parse it, and write the C++ code for it to the specified output, allowing undefined function declarations if the flag is set to true and searching the specified include path for included files.
msgs | Output stream for warning messages |
in | Stan model specification |
out | C++ code output stream |
name | Name of model class |
allow_undefined | true if permits undefined functions |
filename | name of file or other source from which input stream was derived |
include_paths | array of paths to search for included files |
false
if code could not be generated due to syntax error in the Stan model; true
otherwise. Definition at line 35 of file compiler.hpp.
References shutoffs::filename, generate_cpp(), stan::io::program_reader::history(), confusionMatrixTree::out, parse(), cacheDefinitionData::prog, stan::io::program_reader::program(), ss, and string.
Referenced by expect_match(), stanc_helper(), and TEST().
bool stan::lang::compile_functions | ( | std::ostream * | msgs, |
std::istream & | stan_funcs_in, | ||
std::ostream & | cpp_out, | ||
const std::vector< std::string > & | namespaces, | ||
const bool | allow_undefined = false , |
||
const std::string & | filename = "unknown file name" , |
||
const std::vector< std::string > & | include_paths = std::vector<std::string>() |
||
) |
Read a Stan file with only the functions block from the specified input, parse it, and write the C++ code for it to the specified output.
[in] | msgs | Output stream for warning messages |
[in] | stan_funcs_in | Stan model specification |
[in] | cpp_out | C++ code output stream |
[in] | namespaces | Vector of namespace to generate the functions in |
[in] | allow_undefined | Permit undefined functions? |
filename | name of file or other source from which input stream was derived | |
include_paths | array of paths to search for included files |
false
if code could not be generated due to syntax error in the functions file; true
otherwise. Definition at line 31 of file compile_functions.hpp.
References shutoffs::filename, generate_standalone_functions(), stan::io::program_reader::history(), parse(), cacheDefinitionData::prog, stan::io::program_reader::program(), ss, and string.
Referenced by stanc_helper().
bool stan::lang::deprecate_fun | ( | const std::string & | old_name, |
const std::string & | new_name, | ||
fun & | f, | ||
std::ostream & | msgs | ||
) |
Definition at line 97 of file semantic_actions_def.cpp.
References allTimeWatchdog::endl, stan::lang::fun::name_, and stan::lang::fun::original_name_.
Referenced by stan::lang::set_fun_type_named::operator()().
bool stan::lang::deprecate_suffix | ( | const std::string & | deprecated_suffix, |
const std::string & | replacement, | ||
fun & | f, | ||
std::ostream & | msgs | ||
) |
Definition at line 108 of file semantic_actions_def.cpp.
References allTimeWatchdog::endl, ends_with(), and stan::lang::fun::name_.
Referenced by stan::lang::set_fun_type_named::operator()().
void stan::lang::dump_program_line | ( | size_t | idx_errline, |
int | offset, | ||
const std::string & | origin_file, | ||
size_t | origin_line, | ||
const io::program_reader & | reader, | ||
const std::vector< std::string > & | program_lines, | ||
std::stringstream & | error_msgs | ||
) |
Definition at line 844 of file semantic_actions_def.cpp.
References allTimeWatchdog::endl, novadaq::HexUtils::format(), submit_syst::str, string, and stan::io::program_reader::trace().
Referenced by stan::lang::program_error::operator()().
const std::vector<expression> stan::lang::EMPTY_EXP_VECTOR | ( | 0 | ) |
Size zero vector of expressions.
Referenced by stan::lang::write_dims_visgen::operator()(), stan::lang::unconstrained_param_names_visgen::operator()(), stan::lang::constrained_param_names_visgen::operator()(), stan::lang::write_array_vars_visgen::operator()(), stan::lang::write_array_visgen::operator()(), and stan::lang::init_local_var_visgen::operator()().
bool stan::lang::ends_with | ( | const std::string & | suffix, |
const std::string & | s | ||
) |
Returns true if the specified suffix appears at the end of the specified string.
suffix | suffix to test |
s | string in which to search |
Definition at line 10 of file ends_with_def.hpp.
Referenced by deprecate_suffix(), Expression::fetch(), generate_function(), generate_function_functor(), generate_function_instantiation(), stan::lang::function_signatures::get_result_type(), has_ccdf_suffix(), has_cdf_suffix(), has_prob_fun_suffix(), has_prob_suffix(), has_rng_lp_suffix(), stan::lang::set_allows_sampling_origin::operator()(), stan::lang::add_function_signature::operator()(), stan::lang::validate_return_type::operator()(), stan::lang::validate_pmf_pdf_variate::operator()(), stan::lang::validate_sample::operator()(), replace_suffix(), strip_ccdf_suffix(), strip_cdf_suffix(), and strip_prob_fun_suffix().
const std::string stan::lang::EOL | ( | "\n" | ) |
End-of-line marker.
Referenced by stan::lang::validate_var_decl_visgen::basic_validate(), stan::lang::member_var_decl_visgen::declare_array(), stan::lang::local_var_decl_visgen::declare_array(), stan::lang::init_vars_visgen::fill_real(), stan::lang::validate_var_decl_visgen::generate_begin_for_dims(), stan::lang::init_visgen::generate_buffer_loop(), generate_catch_throw_located(), stan::lang::init_visgen::generate_check_double(), stan::lang::init_visgen::generate_check_int(), generate_class_decl(), generate_comment(), generate_constrained_param_names_method(), generate_constructor(), generate_destructor(), stan::lang::write_dims_visgen::generate_dims_array(), stan::lang::init_visgen::generate_dims_loop_fwd(), generate_dims_method(), stan::lang::validate_var_decl_visgen::generate_end_for_dims(), generate_function(), generate_function_arguments(), generate_function_body(), generate_function_functor(), generate_function_inline_return_type(), generate_function_instantiation(), generate_function_instantiation_body(), generate_function_template_parameters(), generate_include(), generate_includes(), stan::lang::set_param_ranges_visgen::generate_increment(), stan::lang::set_param_ranges_visgen::generate_increment_i(), stan::lang::local_var_init_nan_visgen::generate_init(), generate_init_method(), stan::lang::write_array_visgen::generate_initialize_array(), stan::lang::init_local_var_visgen::generate_initialize_array(), generate_initializer(), generate_line_number(), generate_local_var_decls(), generate_log_prob(), generate_member_var_inits(), generate_model_name_method(), stan::lang::write_param_names_visgen::generate_param_names(), stan::lang::constrained_param_names_visgen::generate_param_names_array(), stan::lang::unconstrained_param_names_visgen::generate_param_names_array(), generate_param_names_method(), generate_private_decl(), generate_propto_default_function_body(), generate_public_decl(), generate_set_param_ranges(), generate_standalone_functions(), generate_statement(), generate_try(), generate_typedef(), generate_typedefs(), generate_unconstrained_param_names_method(), generate_using(), generate_using_namespace(), generate_usings(), generate_usings_standalone_functions(), generate_validate_context_size(), generate_validate_positive(), generate_validate_transformed_params(), generate_validate_var_decls(), generate_var_resizing(), generate_void_statement(), generate_write_array_method(), stan::lang::init_visgen::generate_write_loop(), stan::lang::validate_var_decl_visgen::nonbasic_validate(), stan::lang::init_vars_visgen::operator()(), stan::lang::dump_member_var_visgen::operator()(), stan::lang::set_param_ranges_visgen::operator()(), stan::lang::statement_visgen::operator()(), stan::lang::validate_transformed_params_visgen::validate_array(), and stan::lang::write_array_vars_visgen::write_array().
const std::string stan::lang::EOL2 | ( | "\n\n" | ) |
Sequence of two end-of-line markers.
Referenced by generate_class_decl_end(), generate_constrained_param_names_method(), generate_constructor(), generate_destructor(), generate_dims_method(), generate_function_body(), generate_function_functor(), generate_globals(), generate_init_method(), generate_local_var_inits(), generate_log_prob(), generate_model_name_method(), generate_model_typedef(), generate_namespace_end(), generate_namespace_start(), generate_param_names_method(), generate_unconstrained_param_names_method(), generate_version_comment(), and generate_write_array_method().
bool stan::lang::fun_exists | ( | const std::set< std::pair< std::string, function_signature_t > > & | existing, |
const std::pair< std::string, function_signature_t > & | name_sig, | ||
bool | name_only = true |
||
) |
Definition at line 511 of file semantic_actions_def.cpp.
Referenced by stan::lang::add_function_signature::operator()().
bool stan::lang::fun_name_exists | ( | const std::string & | name | ) |
Return true if the function name has been declared as a built-in or by the user.
name | name of function |
Definition at line 10 of file fun_name_exists_def.hpp.
References stan::lang::function_signatures::has_key(), and stan::lang::function_signatures::instance().
Referenced by stan::lang::validate_prob_fun::operator()().
std::string stan::lang::fun_name_to_operator | ( | const std::string & | name | ) |
Definition at line 321 of file function_signatures_def.hpp.
Referenced by stan::lang::function_signatures::get_result_type(), and TEST().
std::string stan::lang::fun_scalar_type | ( | const function_decl_def & | fun, |
bool | is_lp | ||
) |
Return the string representing the scalar type to use in the body of the specified function declaration, with a flag indicating if the function is a log probability function.
[in] | fun | function declaration |
[in] | is_lp | true if the function is a log probability function |
Definition at line 24 of file fun_scalar_type.hpp.
References stan::lang::function_decl_def::arg_decls_, has_only_int_args(), MECModelEnuComparisons::i, and ss.
Referenced by generate_function(), and generate_function_functor().
void stan::lang::generate_arg_decl | ( | bool | gen_const, |
bool | gen_ref, | ||
const arg_decl & | decl, | ||
const std::string & | scalar_t_name, | ||
std::ostream & | o | ||
) |
Generate the argument declaration for a function with flags indicating whether to generate a const
qualifer and whether to make the variable a reference, for the specified declaration and scalar type name from context, writing to the specified stream.
[in] | gen_const | true if declaration is for const |
[in] | gen_ref | true if declaration is for reference |
[in] | decl | argument declaration |
[in] | scalar_t_name | string representing context scalar type |
[in,out] | o | stream for writing |
Definition at line 26 of file generate_arg_decl.hpp.
References stan::lang::arg_decl::arg_type_, generate_bare_type(), and stan::lang::arg_decl::name_.
Referenced by generate_function_arguments().
void stan::lang::generate_array_builder_adds | ( | const std::vector< expression > & | elements, |
bool | user_facing, | ||
std::ostream & | o | ||
) |
Recursive helper function for array, matrix, and row_vector expressions which generates chain of calls to math lib array_builder add function for each of the contained elements.
[in] | elements | vector of expression elements to generate |
[in] | user_facing | true if expression might be reported to user |
[in,out] | o | stream for generating |
Definition at line 20 of file generate_array_builder_adds.hpp.
References generate_expression(), and MECModelEnuComparisons::i.
Referenced by stan::lang::expression_visgen::operator()(), and TEST().
void stan::lang::generate_array_var_type | ( | const base_expr_type & | base_type, |
const std::string & | real_var_type, | ||
std::ostream & | o | ||
) |
Generate C++ type for array expressions according to context in which expression appears.
[in] | base_type | expression base type |
[in] | real_var_type | context-dependent real type |
[in,out] | o | generated typename |
Definition at line 19 of file generate_array_var_type.hpp.
References stan::lang::base_expr_type::is_double_type(), stan::lang::base_expr_type::is_int_type(), stan::lang::base_expr_type::is_matrix_type(), stan::lang::base_expr_type::is_row_vector_type(), and stan::lang::base_expr_type::is_vector_type().
Referenced by stan::lang::expression_visgen::operator()(), and TEST().
void stan::lang::generate_bare_type | ( | const expr_type & | t, |
const std::string & | scalar_t_name, | ||
std::ostream & | o | ||
) |
Generate the basic type for the specified expression type without dimensions, using the specified scalar type string, writing to the specified stream.
[in] | t | expression type |
[in] | scalar_t_name | name of scalar type for double values and containers |
[in] | o | stream for generating |
Definition at line 22 of file generate_bare_type.hpp.
References stan::lang::expr_type::base_type_, d, stan::lang::base_expr_type::is_double_type(), stan::lang::base_expr_type::is_int_type(), stan::lang::base_expr_type::is_matrix_type(), stan::lang::base_expr_type::is_row_vector_type(), stan::lang::base_expr_type::is_vector_type(), stan::lang::base_expr_type::is_void_type(), and stan::lang::expr_type::num_dims_.
Referenced by generate_arg_decl(), and generate_function_inline_return_type().
Generate code to catch and rethrow an exception that includes location information read out of the generated context.
[in] | indent | indentation level |
[in,out] | o | stream for generating. |
Definition at line 20 of file generate_catch_throw_located.hpp.
References EOL(), generate_comment(), and generate_indent().
Referenced by generate_constructor(), generate_function_body(), generate_log_prob(), and generate_write_array_method().
void stan::lang::generate_class_decl | ( | const std::string & | model_name, |
std::ostream & | o | ||
) |
Generate the specified name for the model class to the specified stream.
[in] | model_name | name of class |
[in,out] | o | stream for generating |
Definition at line 19 of file generate_class_decl.hpp.
References EOL().
Referenced by generate_cpp().
void stan::lang::generate_class_decl_end | ( | std::ostream & | o | ) |
Definition at line 11 of file generate_class_decl_end.hpp.
References EOL2().
Referenced by generate_cpp().
void stan::lang::generate_comment | ( | const std::string & | msg, |
int | indent, | ||
std::ostream & | o | ||
) |
Generate the specified message as a comment with the specified indentation and an end-of-line.
[in] | msg | text of comment |
[in] | indent | indentation level |
[in,out] | o | stream for generating |
Definition at line 19 of file generate_comment.hpp.
References EOL(), and generate_indent().
Referenced by generate_catch_throw_located(), generate_constructor(), generate_log_prob(), generate_validate_transformed_params(), and generate_write_array_method().
Generate the constrained_param_names
method for the specified program on the specified stream.
[in] | prog | program from which to generate |
[in,out] | o | stream for generating |
Definition at line 20 of file generate_constrained_param_names_method.hpp.
References stan::lang::program::derived_decl_, EOL(), EOL2(), stan::lang::program::generated_decl_, MECModelEnuComparisons::i, INDENT(), INDENT2(), and stan::lang::program::parameter_decl_.
Referenced by generate_cpp().
void stan::lang::generate_constructor | ( | const program & | prog, |
const std::string & | model_name, | ||
std::ostream & | o | ||
) |
Generate the constructors for the specified program with the specified model name to the specified stream.
[in] | prog | program from which to generate |
[in] | model_name | name of model for class name |
[in,out] | o | stream for generating |
Definition at line 31 of file generate_constructor.hpp.
References stan::lang::program::data_decl_, stan::lang::program::derived_data_decl_, EOL(), EOL2(), generate_catch_throw_located(), generate_comment(), generate_member_var_inits(), generate_set_param_ranges(), generate_statements(), generate_try(), generate_validate_var_decls(), generate_var_resizing(), generate_void_statement(), INDENT(), INDENT2(), and stan::lang::program::parameter_decl_.
Referenced by generate_cpp().
void stan::lang::generate_cpp | ( | const program & | prog, |
const std::string & | model_name, | ||
const std::vector< io::preproc_event > & | history, | ||
std::ostream & | o | ||
) |
Generae the C++ code for the specified program, generating it in a class and namespace derived from the specified model name, writing to the specified stream.
[in] | prog | program from which to generate |
[in] | model_name | name of model for generating namespace and class name |
[in] | history | I/O include history for text underlying program |
[in,out] | o | stream for generating |
Definition at line 51 of file generate_cpp.hpp.
References stan::lang::program::function_decl_defs_, generate_class_decl(), generate_class_decl_end(), generate_constrained_param_names_method(), generate_constructor(), generate_destructor(), generate_dims_method(), generate_functions(), generate_globals(), generate_includes(), generate_init_method(), generate_log_prob(), generate_member_var_decls_all(), generate_model_name_method(), generate_model_typedef(), generate_namespace_end(), generate_namespace_start(), generate_param_names_method(), generate_private_decl(), generate_program_reader_fun(), generate_public_decl(), generate_register_mpi(), generate_unconstrained_param_names_method(), generate_usings(), generate_version_comment(), generate_write_array_method(), and stan::lang::program::parameter_decl_.
Referenced by compile(), model_to_cpp(), and TEST().
void stan::lang::generate_destructor | ( | const std::string & | model_name, |
std::ostream & | o | ||
) |
Generate the destructor for the class with name specified by the model name to the specified stream.
[in] | model_name | name of model to use as class name |
[in,out] | o | stream for generating. |
Definition at line 19 of file generate_destructor.hpp.
References EOL(), EOL2(), and INDENT().
Referenced by generate_cpp().
Generate the get_dims
method for the parameters, transformed parameters, and generated quantities, using the specified program and generating to the specified stream.
[in] | prog | program from which to generate |
[in,out] | o | stream for generating |
Definition at line 21 of file generate_dims_method.hpp.
References stan::lang::program::derived_decl_, EOL(), EOL2(), stan::lang::program::generated_decl_, MECModelEnuComparisons::i, INDENT(), INDENT2(), and stan::lang::program::parameter_decl_.
Referenced by generate_cpp().
void stan::lang::generate_eigen_index_expression | ( | const expression & | e, |
std::ostream & | o | ||
) |
Generate the specified expression cast to an Eigen index to disambiguate from pointer.
[in] | e | expression for size |
[in,out] | o | stream for generating |
Definition at line 19 of file generate_eigen_index_expression.hpp.
References stan::lang::expression::expr_, generate_expression(), and NOT_USER_FACING().
Referenced by stan::lang::local_var_decl_visgen::generate_init_args(), and generate_initializer().
void stan::lang::generate_expression | ( | const expression & | e, |
bool | user_facing, | ||
std::ostream & | o | ||
) |
Write the code generated by the specified expression to the specified output stream, putting it in a user-readable format if the user-facing flag is true. This is just the header for a forward declaration defined in the generator.
[in] | e | expression to write |
[in] | user_facing | true if expression should be written so that a user can understand it |
[in,out] | o | stream to which expression is written |
Generate the specified expression to the specified stream with user-facing/C++ format and parameter/data format controlled by the flags.
[in] | e | expression to generate |
[in] | user_facing | true if expression might be reported to user |
[in,out] | o | stream for generating |
Definition at line 21 of file generate_expression.hpp.
References stan::lang::expression::expr_.
Referenced by stan::lang::validate_var_decl_visgen::basic_validate(), stan::lang::init_visgen::function_args(), generate_array_builder_adds(), stan::lang::validate_var_decl_visgen::generate_begin_for_dims(), stan::lang::init_visgen::generate_buffer_loop(), stan::lang::write_dims_visgen::generate_dims_array(), stan::lang::init_visgen::generate_dims_loop_fwd(), generate_eigen_index_expression(), stan::lang::set_param_ranges_visgen::generate_increment(), stan::lang::set_param_ranges_visgen::generate_increment_i(), generate_indexed_expr(), generate_indexed_expr_user(), stan::lang::local_var_decl_visgen::generate_init_args(), stan::lang::write_array_visgen::generate_initialize_array(), stan::lang::init_local_var_visgen::generate_initialize_array(), generate_initializer(), generate_local_var_decls(), stan::lang::constrained_param_names_visgen::generate_param_names_array(), stan::lang::unconstrained_param_names_visgen::generate_param_names_array(), generate_quoted_expression(), stan::lang::statement_visgen::generate_truncation(), generate_validate_context_size(), generate_validate_positive(), generate_var_resizing(), stan::lang::idx_visgen::operator()(), stan::lang::idx_user_visgen::operator()(), stan::lang::printable_visgen::operator()(), stan::lang::dump_member_var_visgen::operator()(), stan::lang::expression_visgen::operator()(), stan::lang::set_param_ranges_visgen::operator()(), stan::lang::statement_visgen::operator()(), stan::lang::validate_sample::operator()(), stan::lang::expression_as_statement::operator()(), stan::lang::division_expr::operator()(), stan::lang::validate_transformed_params_visgen::validate_array(), and stan::lang::write_array_vars_visgen::write_array().
void stan::lang::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".
[in] | fun | function AST object |
[in,out] | out | output stream to which function definition is written |
Definition at line 30 of file generate_function.hpp.
References stan::lang::function_decl_def::body_, ends_with(), EOL(), fun_scalar_type(), generate_function_arguments(), generate_function_body(), generate_function_inline_return_type(), generate_function_name(), generate_function_template_parameters(), generate_propto_default_function(), stan::lang::statement::is_no_op_statement(), stan::lang::function_decl_def::name_, and string.
Referenced by generate_functions().
void stan::lang::generate_function_arguments | ( | const function_decl_def & | fun, |
bool | is_rng, | ||
bool | is_lp, | ||
bool | is_log, | ||
std::ostream & | o, | ||
bool | double_only = false , |
||
std::string | rng_type = "RNG" , |
||
bool | parameter_defaults = false |
||
) |
Generate the arguments for the specified function, with precalculated flags for whether it is an RNG, uses the log density accumulator or is a probability function, to the specified stream.
[in] | fun | function declaration |
[in] | is_rng | true if function is an RNG |
[in] | is_lp | true if function accesses log density accumulator |
[in] | is_log | true if function is log probability function |
[in,out] | o | stream for generating |
[in] | double_only | do not do any templating and make all arguments based on the standard double type |
[in] | rng_type | set a type of the rng argument in _rng functions |
[in] | parameter_defaults | if true, default values for the standard parameters (now only pstream__) will be generated |
Definition at line 33 of file generate_function_arguments.hpp.
References stan::lang::function_decl_def::arg_decls_, EOL(), generate_arg_decl(), MECModelEnuComparisons::i, INDENT(), stan::lang::function_decl_def::name_, and string.
Referenced by generate_function(), generate_function_functor(), generate_function_instantiation(), and generate_propto_default_function().
void stan::lang::generate_function_body | ( | const function_decl_def & | fun, |
const std::string & | scalar_t_name, | ||
std::ostream & | o | ||
) |
Generate the body of the specified function, with the specified local scalar type, writing to the specified stream.
[in] | fun | function declaration |
[in] | scalar_t_name | name of type to use for scalars in the function body |
[in,out] | o | stream for generating |
Definition at line 24 of file generate_function_body.hpp.
References stan::lang::expr_type::base_type_, stan::lang::function_decl_def::body_, EOL(), EOL2(), generate_catch_throw_located(), generate_statement(), generate_try(), INDENT(), INDENT2(), stan::lang::base_expr_type::is_int_type(), stan::lang::statement::is_no_op_statement(), and stan::lang::function_decl_def::return_type_.
Referenced by generate_function().
void stan::lang::generate_function_functor | ( | const function_decl_def & | fun, |
std::ostream & | o | ||
) |
Generate the functor to accompnay a function with the specified declaration, writing to the specified stream.
[in] | fun | function declaration |
[in,out] | o | stream for generating |
Definition at line 25 of file generate_function_functor.hpp.
References stan::lang::function_decl_def::body_, ends_with(), EOL(), EOL2(), fun_scalar_type(), generate_function_arguments(), generate_function_inline_return_type(), generate_function_name(), generate_function_template_parameters(), generate_functor_arguments(), INDENT(), INDENT2(), stan::lang::statement::is_no_op_statement(), stan::lang::function_decl_def::name_, and string.
Referenced by generate_functions().
void stan::lang::generate_function_inline_return_type | ( | const function_decl_def & | fun, |
const std::string & | scalar_t_name, | ||
int | indent, | ||
std::ostream & | out | ||
) |
Generate the return type for the specified function declaration in the context of the specified scalar type at the specified indentation level on the specified stream.
[in] | fun | function declaration |
[in] | scalar_t_name | string version of scalar type in context |
[in] | indent | indentation level |
[in,out] | out | stream for generating |
Definition at line 25 of file generate_function_inline_return_type.hpp.
References EOL(), generate_bare_type(), generate_indent(), and stan::lang::function_decl_def::return_type_.
Referenced by generate_function(), generate_function_functor(), generate_function_instantiation(), and generate_propto_default_function().
void stan::lang::generate_function_instantiation | ( | const function_decl_def & | fun, |
const std::vector< std::string > & | namespaces, | ||
std::ostream & | out | ||
) |
Generate a non-variable (double only) instantiation of 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".
[in] | fun | function AST object |
[in] | namespaces | vector of strings used to generate the namespaces generated code is nested in. |
[in,out] | out | output stream to which function definition is written |
Definition at line 31 of file generate_function_instantiation.hpp.
References stan::lang::function_decl_def::body_, ends_with(), EOL(), generate_function_arguments(), generate_function_inline_return_type(), generate_function_instantiation_body(), generate_function_instantiation_name(), stan::lang::statement::is_no_op_statement(), stan::lang::function_decl_def::name_, and string.
Referenced by generate_function_instantiations().
void stan::lang::generate_function_instantiation_body | ( | const function_decl_def & | fun, |
const std::vector< std::string > & | namespaces, | ||
bool | is_rng, | ||
bool | is_lp, | ||
bool | is_log, | ||
const std::string & | rng_class, | ||
std::ostream & | o | ||
) |
Generate the body for a function instantiation (e.g., the call to the templated function with all templated arguments based on double). Requires precalculated flags for whether it is an RNG, uses the log density accumulator or is a probability function, to the specified stream.
[in] | fun | function declaration |
[in] | namespaces | vector of strings used to generate the namespaces generated code is nested in. |
[in] | is_rng | true if function is an RNG |
[in] | is_lp | true if function accesses log density accumulator |
[in] | is_log | true if function is log probability function |
[in] | rng_class | class of the RNG being used (required by xxx_rng functions) |
[in,out] | o | stream for generating |
Definition at line 33 of file generate_function_instantiation_body.hpp.
References stan::lang::function_decl_def::arg_decls_, EOL(), generate_function_instantiation_template_parameters(), generate_function_name(), stan::lang::expr_type::is_void(), stan::lang::function_decl_def::return_type_, and string.
Referenced by generate_function_instantiation().
void stan::lang::generate_function_instantiation_name | ( | const function_decl_def & | fun, |
std::ostream & | out | ||
) |
Generate a name for a non-variable (double only) instantiation of specified function
[in] | fun | function AST object |
[in,out] | out | output stream to which function definition is written |
Definition at line 19 of file generate_function_instantiation_name.hpp.
References stan::lang::function_decl_def::name_.
Referenced by generate_function_instantiation().
void stan::lang::generate_function_instantiation_template_parameters | ( | const function_decl_def & | fun, |
bool | is_rng, | ||
bool | is_lp, | ||
bool | is_log, | ||
const std::string & | rng_class, | ||
std::ostream & | out | ||
) |
Generate the concrete template parameters for function instantiation.
[in] | fun | function declaration |
[in] | is_rng | true if function is a random number generator |
[in] | is_lp | true if function accesses log density accumulator |
[in] | is_log | true if function is a probability function |
[in] | rng_class | class of the RNG being used (required by xxx_rng functions) |
[in] | out | stream for generating |
Definition at line 27 of file generate_fun_inst_templ_params.hpp.
References stan::lang::function_decl_def::arg_decls_, MECModelEnuComparisons::i, and string.
Referenced by generate_function_instantiation_body().
void stan::lang::generate_function_instantiations | ( | const std::vector< function_decl_def > & | funs, |
const std::vector< std::string > & | namespaces, | ||
std::ostream & | o | ||
) |
Generate instantiations of templated functions with non-variable parametersfor standalone generation of functions.
[in] | funs | sequence of function declarations and definitions |
[in] | namespaces | vector of strings used to generate the namespaces generated code is nested in. |
[in,out] | o | stream for generating |
Definition at line 23 of file generate_function_instantiations.hpp.
References generate_function_instantiation(), and MECModelEnuComparisons::i.
Referenced by generate_standalone_functions().
void stan::lang::generate_function_name | ( | const function_decl_def & | fun, |
std::ostream & | o | ||
) |
Generate the function name from the specified declaration on the specified stream.
[in] | fun | function declaration |
[in,out] | o | stream for generating |
Definition at line 17 of file generate_function_name.hpp.
References stan::lang::function_decl_def::name_.
Referenced by generate_function(), generate_function_functor(), generate_function_instantiation_body(), and generate_propto_default_function().
void stan::lang::generate_function_template_parameters | ( | const function_decl_def & | fun, |
bool | is_rng, | ||
bool | is_lp, | ||
bool | is_log, | ||
std::ostream & | out | ||
) |
Generate the template declaration for functions.
[in] | fun | function declaration |
[in] | is_rng | true if function is a random number generator |
[in] | is_lp | true if function accesses log density accumulator |
[in] | is_log | true if function is a probability function |
[in] | out | stream for generating |
Definition at line 22 of file generate_function_template_parameters.hpp.
References stan::lang::function_decl_def::arg_decls_, EOL(), has_only_int_args(), and MECModelEnuComparisons::i.
Referenced by generate_function(), generate_function_functor(), and generate_propto_default_function().
void stan::lang::generate_functions | ( | const std::vector< function_decl_def > & | funs, |
std::ostream & | o | ||
) |
Generate function forward declarations, definitions, and functors for the the specified sequence of function declarations and definitions, writing to the specified stream.
[in] | funs | sequence of function declarations and definitions |
[in,out] | o | stream for generating are generated (for non-templated functions only) |
Definition at line 23 of file generate_functions.hpp.
References generate_function(), generate_function_functor(), and MECModelEnuComparisons::i.
Referenced by generate_cpp(), and generate_standalone_functions().
void stan::lang::generate_functor_arguments | ( | const function_decl_def & | fun, |
bool | is_rng, | ||
bool | is_lp, | ||
bool | is_log, | ||
std::ostream & | o | ||
) |
Generate the arguments for the functor for the specified function declaration, with flags indicating whether it is a random number generator, accesses the log density accumulator, or is a probability function, writing to the specified stream.
[in] | fun | function declaration |
[in] | is_rng | true if function is a random number generator |
[in] | is_lp | true if function acceses log density accumulator |
[in] | is_log | true if function is log probability function |
[in,out] | o | stream for generating |
Definition at line 23 of file generate_functor_arguments.hpp.
References stan::lang::function_decl_def::arg_decls_, and MECModelEnuComparisons::i.
Referenced by generate_function_functor().
void stan::lang::generate_globals | ( | std::ostream & | o | ) |
Generate the global variables to the specified stream.
[in] | o | stream for generating |
Definition at line 15 of file generate_globals.hpp.
References EOL2().
Referenced by generate_cpp().
Generate the specified multiple index on the specified stream.
[in] | i | multiple index to generate |
[in,out] | o | stream for generating |
Definition at line 18 of file generate_idx.hpp.
References stan::lang::idx::idx_.
Referenced by generate_idxs().
Generate the specified multiple index for users to the specified stream.
[in] | i | multiple index |
[in,out] | o | stream for writing |
Generate specified multiple index for user on specified stream.
[in] | i | multiple index |
[in,out] | o | stream for generating |
Definition at line 19 of file geneate_idx_user.hpp.
References stan::lang::idx::idx_.
Referenced by generate_idxs_user().
Recursive helper function tracking position to generate specified multiple indexes on the specified stream in order to terminate with a nil index properly.
[in] | pos | position in list to generate next |
[in] | idxs | multiple indexes to generate |
[in,out] | o | stream for generating |
Definition at line 21 of file generate_idxs.hpp.
References generate_idx(), and generate_idxs().
Generate the specified multiple indexes on the specified stream.
[in] | idxs | multiple indexes to generate |
[in,out] | o | stream for generating |
Definition at line 40 of file generate_idxs.hpp.
Referenced by generate_idxs(), stan::lang::expression_visgen::operator()(), stan::lang::statement_visgen::operator()(), and TEST().
Generate the specified multiple indexes for users to the specified stream.
[in] | idxs | multiple indexes |
[in,out] | o | stream for writing |
Definition at line 20 of file generate_idxs_user.hpp.
References generate_idx_user(), and MECModelEnuComparisons::i.
Referenced by stan::lang::expression_visgen::operator()().
void stan::lang::generate_include | ( | const std::string & | lib_name, |
std::ostream & | o | ||
) |
Generate an include statement for the specified library path.
lib_name | path to library |
o | stream for generating |
Definition at line 18 of file generate_include.hpp.
References EOL().
Referenced by generate_includes(), and generate_standalone_functions().
void stan::lang::generate_includes | ( | std::ostream & | o | ) |
Generate include statements for a Stan model class to the specified stream.
o | stream for generating |
Definition at line 18 of file generate_includes.hpp.
References EOL(), and generate_include().
Referenced by generate_cpp().
void stan::lang::generate_indent | ( | size_t | indent, |
std::ostream & | o | ||
) |
Write the specified number of indentations to the specified output stream.
indent | number of indentations | |
[in,out] | o | stream to which indentations are written |
Definition at line 17 of file generate_indent.hpp.
References art::detail::indent(), and INDENT().
Referenced by stan::lang::validate_var_decl_visgen::basic_validate(), stan::lang::local_var_decl_visgen::declare_array(), stan::lang::init_vars_visgen::fill_real(), stan::lang::validate_var_decl_visgen::generate_begin_for_dims(), stan::lang::init_visgen::generate_buffer_loop(), generate_catch_throw_located(), stan::lang::init_visgen::generate_check_double(), stan::lang::init_visgen::generate_check_int(), generate_comment(), stan::lang::init_visgen::generate_declaration(), stan::lang::init_visgen::generate_dims_loop_fwd(), stan::lang::validate_var_decl_visgen::generate_end_for_dims(), generate_function_inline_return_type(), stan::lang::set_param_ranges_visgen::generate_increment(), stan::lang::set_param_ranges_visgen::generate_increment_i(), stan::lang::init_visgen::generate_indent_num_dims(), stan::lang::local_var_init_nan_visgen::generate_init(), generate_initialization(), stan::lang::write_array_visgen::generate_initialize_array(), stan::lang::init_local_var_visgen::generate_initialize_array(), generate_local_var_decls(), generate_local_var_inits(), generate_member_var_inits(), stan::lang::constrained_param_names_visgen::generate_param_names_array(), stan::lang::unconstrained_param_names_visgen::generate_param_names_array(), generate_set_param_ranges(), generate_statement(), stan::lang::statement_visgen::generate_truncation(), generate_try(), generate_validate_context_size(), generate_validate_positive(), generate_validate_var_decls(), generate_var_resizing(), generate_void_statement(), stan::lang::init_visgen::generate_write_loop(), stan::lang::validate_var_decl_visgen::nonbasic_validate(), stan::lang::init_vars_visgen::operator()(), stan::lang::dump_member_var_visgen::operator()(), stan::lang::set_param_ranges_visgen::operator()(), stan::lang::statement_visgen::operator()(), stan::lang::validate_transformed_params_visgen::validate_array(), and stan::lang::write_array_vars_visgen::write_array().
void stan::lang::generate_indexed_expr | ( | const std::string & | expr, |
const std::vector< expression > & | indexes, | ||
base_expr_type | base_type, | ||
size_t | e_num_dims, | ||
bool | user_facing, | ||
std::ostream & | o | ||
) |
Generate the specified expression indexed with the specified indices with the specified base type of expression being indexed, number of dimensions, and a flag indicating whether the generation is for user output or C++ compilation. Depending on the base type, two layers of parens may be written in the underlying code.
isLHS | true if indexed expression appears on left-hand side of an assignment |
[in] | expr | string for expression |
[in] | indexes | indexes for expression |
[in] | base_type | base type of expression |
[in] | e_num_dims | number of array dimensions in expression |
[in] | user_facing | true if expression might be reported to user |
[in,out] | o | stream for generating |
Definition at line 32 of file generate_indexed_expr.hpp.
References generate_expression(), generate_indexed_expr_user(), generate_quoted_string(), stan::lang::base_expr_type::is_matrix_type(), and getGoodRuns4SAM::n.
void stan::lang::generate_indexed_expr_user | ( | const std::string & | expr, |
const std::vector< expression > | indexes, | ||
std::ostream & | o | ||
) |
Generate an expression with indices, writing brackets around indices and commas in between as necessary. If no indices are presents, no brackets will be written.
[in] | expr | expression for indexing |
[in] | indexes | sequence of indexes |
[in,out] | o | stream for writing |
Definition at line 24 of file generate_indexed_expr_user.hpp.
References generate_expression(), and MECModelEnuComparisons::i.
Referenced by generate_indexed_expr().
Generate the transform_inits
method for the specified variable declarations to the specified stream.
[in] | vs | variable declarations |
[in,out] | o | stream for generating |
Definition at line 22 of file generate_init_method.hpp.
References EOL(), EOL2(), MECModelEnuComparisons::i, INDENT(), and INDENT2().
Referenced by generate_cpp().
void stan::lang::generate_initialization | ( | std::ostream & | o, |
size_t | indent, | ||
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() |
||
) |
Generate varaible initialization, checking dimension sizes are all positive, gnerating to the specified stream for a variable with the specified name, type, dimension sizes, and optional matrix/vector size declarations.
[in,out] | o | stream for generating |
[in] | indent | indentation level |
[in] | var_name | name of variable being initialized |
[in] | base_type | base type of variable |
[in] | dims | dimension sizes |
[in] | type_arg1 | optional vector/row-vector size or matrix rows |
[in] | type_arg2 | optional size of matrix columns |
Definition at line 31 of file generate_initialization.hpp.
References generate_indent(), generate_initializer(), generate_type(), generate_validate_positive(), MECModelEnuComparisons::i, is_nil(), and msf_helper::o.
Referenced by stan::lang::var_resizing_visgen::operator()().
void stan::lang::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() |
||
) |
Generate an initializer for a variable of the specified base type with the specified dimension sizes with an additional size for vectors and row vectors and two additional sizes for matrices.
o | stream for generating |
base_type | base type of variable |
dims | sizes of dimensions for variable |
type_arg1 | size of vector or row vector or size of rows for matrix, not used otherwise |
type_arg2 | size of columns for matrix, not used otherwise |
Definition at line 28 of file generate_initializer.hpp.
References EOL(), generate_eigen_index_expression(), generate_expression(), generate_type(), MECModelEnuComparisons::i, is_nil(), NOT_USER_FACING(), and msf_helper::o.
Referenced by stan::lang::init_visgen::generate_declaration(), and generate_initialization().
void stan::lang::generate_line_number | ( | const T & | line, |
int | indent, | ||
std::ostream & | o | ||
) |
Definition at line 20 of file generate_line_number.hpp.
References EOL(), art::detail::indent(), and msf_helper::o.
void stan::lang::generate_local_var_decls | ( | const std::vector< var_decl > & | vs, |
int | indent, | ||
std::ostream & | o | ||
) |
Generate local variable declarations, including initializations, for the specified declarations, indentation level, writing to the specified stream. Generated code is preceeded by stmt updating global variable current_statement_begin__
to src file line number where variable is declared.
[in] | vs | variable declarations |
[in] | indent | indentation level |
[in,out] | o | stream for generating |
Definition at line 29 of file generate_local_var_decls.hpp.
References EOL(), generate_expression(), generate_indent(), MECModelEnuComparisons::i, and NOT_USER_FACING().
Referenced by generate_log_prob(), generate_write_array_method(), and stan::lang::statement_visgen::operator()().
void stan::lang::generate_local_var_inits | ( | std::vector< var_decl > | vs, |
bool | declare_vars, | ||
int | indent, | ||
std::ostream & | o | ||
) |
Generate initializations for the specified local variables, with flags indicating whether the generation is in a variable context and whether variables need to be declared, writing to the specified stream.
[in] | vs | variable declarations |
[in] | declare_vars | true if variables should be declared |
[in] | indent | indentation level |
[in,out] | o | stream for generating |
Definition at line 26 of file generate_local_var_inits.hpp.
References EOL2(), generate_indent(), and MECModelEnuComparisons::i.
Referenced by generate_log_prob().
Generate the log_prob method for the model class for the specified program on the specified stream.
p | program |
o | stream for generating |
Definition at line 27 of file generate_log_prob.hpp.
References stan::lang::program::derived_decl_, EOL(), EOL2(), generate_catch_throw_located(), generate_comment(), generate_local_var_decls(), generate_local_var_inits(), generate_statement(), generate_statements(), generate_try(), generate_validate_transformed_params(), generate_validate_var_decls(), INDENT(), INDENT2(), INDENT3(), stan::lang::program::parameter_decl_, and stan::lang::program::statement_.
Referenced by generate_cpp().
void stan::lang::generate_member_var_decls | ( | const std::vector< var_decl > & | vs, |
int | indent, | ||
std::ostream & | o | ||
) |
Generate member variable declarations for the specified variable declarations at the specified indentation level to the specified stream.
[in] | vs | variable declarations |
[in] | indent | indentation level |
[in] | o | stream for writing |
Definition at line 22 of file generate_member_var_decls.hpp.
References MECModelEnuComparisons::i.
Referenced by generate_member_var_decls_all().
Generate member variable declarations for the data and transformed data blocks for the specified program, writing to the specified stream.
[in] | prog | program from which to generate |
[in,out] | o | stream for generating |
Definition at line 19 of file generate_member_var_decls_all.hpp.
References stan::lang::program::data_decl_, stan::lang::program::derived_data_decl_, and generate_member_var_decls().
Referenced by generate_cpp().
void stan::lang::generate_member_var_inits | ( | const std::vector< var_decl > & | vs, |
int | indent, | ||
std::ostream & | o | ||
) |
Generate initializations for member variables by reading from constructor variable context. Generated initializations are preceeded by stmt updating global variable current_statement_begin__
to src file line number where variable is declared.
[in] | vs | member variable declarations |
[in] | indent | indentation level |
[in,out] | o | stream for generating |
Definition at line 26 of file generate_member_var_inits.hpp.
References EOL(), generate_indent(), and MECModelEnuComparisons::i.
Referenced by generate_constructor().
void stan::lang::generate_model_name_method | ( | const std::string & | model_name, |
std::ostream & | o | ||
) |
Generate the model_name
method for the specified name on the specified stream.
[in] | model_name | name of model |
[in,out] | o | stream for generating |
Definition at line 19 of file generate_model_name_method.hpp.
References EOL(), EOL2(), INDENT(), and INDENT2().
Referenced by generate_cpp().
void stan::lang::generate_model_typedef | ( | const std::string & | model_name, |
std::ostream & | o | ||
) |
Generate reusable typedef of stan_model
for specified model name writing to the specified stream.
model_name | name of model |
o | stream for generating |
Definition at line 19 of file generate_model_typedef.hpp.
References EOL2().
Referenced by generate_cpp(), and TEST().
void stan::lang::generate_namespace_end | ( | std::ostream & | o | ) |
Generate the end of a namespace to the specified stream.
[in,out] | o | stream for generating |
Definition at line 15 of file generate_namespace_end.hpp.
References EOL2().
Referenced by generate_cpp().
void stan::lang::generate_namespace_start | ( | const std::string & | name, |
std::ostream & | o | ||
) |
Generate the opening name and brace for a namespace, with two end of lines.
[in] | name | name of namespace |
[in,out] | o | stream for generating |
Definition at line 18 of file generate_namespace_start.hpp.
References EOL2().
Referenced by generate_cpp().
Generate the method to get_param_names
, which retrieves the parameter names for the specified program on the specified stream.
[in] | prog | program from which to generate |
[in,out] | o | stream for generating |
Definition at line 21 of file generate_param_names_method.hpp.
References stan::lang::program::derived_decl_, EOL(), EOL2(), stan::lang::program::generated_decl_, MECModelEnuComparisons::i, INDENT(), INDENT2(), and stan::lang::program::parameter_decl_.
Referenced by generate_cpp().
Generate the specified printable object to the specified stream.
p | object to print |
o | stream for printing |
Definition at line 18 of file generate_printable.hpp.
References stan::lang::printable::printable_.
Referenced by stan::lang::statement_visgen::operator()().
void stan::lang::generate_private_decl | ( | std::ostream & | o | ) |
Generate the private declaration scope for a class to the specified stream.
[in,out] | o | stream for generating |
Definition at line 17 of file generate_private_decl.hpp.
References EOL().
Referenced by generate_cpp().
void stan::lang::generate_program_reader_fun | ( | const std::vector< io::preproc_event > & | history, |
std::ostream & | o | ||
) |
Generate a top-level function that returns the program reader for the specified history.
Implementation note: Because this is only called when there is an error to report, reconstructing on each call has acceptable performance.
[in] | history | record of I/O path for lines in compound program |
[in,out] | o | stream to which generated code is written |
Definition at line 24 of file generate_program_reader_fun.hpp.
References allTimeWatchdog::endl, MECModelEnuComparisons::i, and INDENT().
Referenced by generate_cpp(), and generate_standalone_functions().
void stan::lang::generate_propto_default_function | ( | const function_decl_def & | fun, |
const std::string & | scalar_t_name, | ||
std::ostream & | o | ||
) |
Generate a version of the specified function with propto set to false, with the specified local scalar type, writing to the specified stream.
[in] | fun | function declaration |
[in] | scalar_t_name | string representation of scalar type for local scalar variables |
[in,out] | o | stream for generating |
Definition at line 26 of file generate_propto_default_function.hpp.
References generate_function_arguments(), generate_function_inline_return_type(), generate_function_name(), generate_function_template_parameters(), and generate_propto_default_function_body().
Referenced by generate_function().
void stan::lang::generate_propto_default_function_body | ( | const function_decl_def & | fun, |
std::ostream & | o | ||
) |
Generate the body of the specified function with propto
set to false, writing to the specified stream.
[in] | fun | function declaration |
[in,out] | o | stream for generating |
Definition at line 19 of file generate_propto_default_function_body.hpp.
References stan::lang::function_decl_def::arg_decls_, EOL(), MECModelEnuComparisons::i, INDENT(), and stan::lang::function_decl_def::name_.
Referenced by generate_propto_default_function().
void stan::lang::generate_public_decl | ( | std::ostream & | o | ) |
Generate the public declaration scope for a class to the specified stream.
[in,out] | o | stream for generating |
Definition at line 17 of file generate_public_decl.hpp.
References EOL().
Referenced by generate_cpp().
void stan::lang::generate_quoted_expression | ( | const expression & | e, |
std::ostream & | o | ||
) |
Definition at line 16 of file generate_quoted_expression.hpp.
References generate_expression(), generate_quoted_string(), NOT_USER_FACING(), msf_helper::o, and ss.
Referenced by generate_validate_positive(), and test_generate_quoted_expression().
void stan::lang::generate_quoted_string | ( | const std::string & | s, |
std::ostream & | o | ||
) |
Print the specified string to the specified output stream, wrapping in double quotes (") and inserting a backslash to escape double quotes, single quotes, and backslashes.
[in] | s | String to output |
[in,out] | o | Output stream |
Definition at line 18 of file generate_quoted_string.hpp.
References MECModelEnuComparisons::i.
Referenced by generate_indexed_expr(), generate_quoted_expression(), stan::lang::printable_visgen::operator()(), test_generate_quoted_string(), and test_generate_quoted_string_quote().
Generate correct C++ type for expressions which contain a Stan real
variable according to scope in which expression is used and expression contents.
[in] | var_scope | expression origin block |
[in] | has_var | does expression contains a variable? |
[in,out] | o | generated typename |
Definition at line 19 of file generate_real_var_type.hpp.
References stan::lang::scope::fun(), and has_var().
Referenced by stan::lang::expression_visgen::operator()(), and TEST().
void stan::lang::generate_register_mpi | ( | const std::string & | model_name, |
std::ostream & | o | ||
) |
Definition at line 13 of file generate_register_mpi.hpp.
References a, allTimeWatchdog::endl, stan::lang::map_rect::registered_calls(), and string.
Referenced by generate_cpp().
void stan::lang::generate_set_param_ranges | ( | const std::vector< var_decl > & | var_decls, |
int | indent, | ||
std::ostream & | o | ||
) |
Definition at line 28 of file generate_set_param_ranges.hpp.
References EOL(), generate_indent(), and MECModelEnuComparisons::i.
Referenced by generate_constructor().
void stan::lang::generate_standalone_functions | ( | const program & | prog, |
const std::vector< std::string > & | namespaces, | ||
const std::vector< io::preproc_event > & | history, | ||
std::ostream & | o | ||
) |
Generate the C++ code for standalone functions, generating it in the namespace provided, writing to the specified stream.
[in] | prog | program from which to generate |
[in] | namespaces | namespace to generate the functions in |
[in] | history | I/O include history for text underlying program |
[in,out] | o | stream for generating |
Definition at line 31 of file generate_standalone_functions.hpp.
References EOL(), stan::lang::program::function_decl_defs_, generate_function_instantiations(), generate_functions(), generate_include(), generate_program_reader_fun(), generate_typedefs(), generate_usings_standalone_functions(), and generate_version_comment().
Referenced by compile_functions().
Generate the specified statement with the specified indentation level on the specified output stream. Generated statement is preceeded by stmt updating global variable current_statement_begin__
to src file line number where stmt begins.
[in] | s | statement to generate |
[in] | indent | indentation level |
[in,out] | o | stream for generating |
Definition at line 25 of file generate_statement.hpp.
References stan::lang::statement::begin_line_, EOL(), generate_indent(), and stan::lang::statement::statement_.
Referenced by generate_function_body(), generate_log_prob(), generate_statements(), stan::lang::statement_visgen::operator()(), and TEST().
void stan::lang::generate_statement | ( | const std::vector< statement > & | ss, |
int | indent, | ||
std::ostream & | o | ||
) |
void stan::lang::generate_statements | ( | const std::vector< statement > | statements, |
int | indent, | ||
std::ostream & | o | ||
) |
Generate the set of statements in a program block with the specified indentation level on the specified stream.
[in] | statements | vector of statements |
[in] | indent | indentation level |
[in,out] | o | stream for generating |
Definition at line 20 of file generate_statements.hpp.
References generate_statement(), and MECModelEnuComparisons::i.
Referenced by generate_constructor(), generate_log_prob(), and generate_write_array_method().
Generate the opening for a try statement at the specified indentation level on the specified stream.
[in] | indent | indentation level |
[in,out] | o | stream for generating |
Definition at line 19 of file generate_try.hpp.
References EOL(), and generate_indent().
Referenced by generate_constructor(), generate_function_body(), generate_log_prob(), and generate_write_array_method().
void stan::lang::generate_type | ( | const std::string & | base_type, |
const std::vector< expression > & | , | ||
size_t | end, | ||
std::ostream & | o | ||
) |
Generate the base type for multi-dimensional arrays.
[in] | base_type | string representing bae type |
[in] | end | number of standard vector embeddings |
[in,out] | o | stream for generating |
Definition at line 19 of file generate_type.hpp.
References febshutoff_auto::end, and MECModelEnuComparisons::i.
Referenced by stan::lang::init_visgen::generate_declaration(), generate_initialization(), generate_initializer(), and stan::lang::expression_visgen::operator()().
void stan::lang::generate_typedef | ( | const std::string & | type, |
const std::string & | abbrev, | ||
std::ostream & | o | ||
) |
Generate a typedef statement for the specified type and abbreviation to the specified stream.
[in] | type | type for definition |
[in] | abbrev | abbreviation defined for type |
[in,out] | o | stream for writing |
Definition at line 20 of file generate_typedef.hpp.
References EOL().
Referenced by generate_typedefs().
void stan::lang::generate_typedefs | ( | std::ostream & | o | ) |
Generate the typedefs required for the Stan model class to the specified stream.
[in,out] | o | stream for generating |
Definition at line 17 of file generate_typedefs.hpp.
References EOL(), and generate_typedef().
Referenced by generate_standalone_functions().
void stan::lang::generate_unconstrained_param_names_method | ( | const program & | prog, |
std::ostream & | o | ||
) |
Generate the method unconstrained_param_names
for the specified program on the specified stream.
[in] | prog | progam from which to generate |
[in,out] | o | stream for generating |
Definition at line 20 of file generate_unconstrained_param_names_method.hpp.
References stan::lang::program::derived_decl_, EOL(), EOL2(), stan::lang::program::generated_decl_, MECModelEnuComparisons::i, INDENT(), INDENT2(), and stan::lang::program::parameter_decl_.
Referenced by generate_cpp().
void stan::lang::generate_using | ( | const std::string & | type, |
std::ostream & | o | ||
) |
Generate a using statement for the specified type to the specified stream.
[in] | type | type for which using statement is geneated |
[in,out] | o | stream for generation |
Definition at line 19 of file generate_using.hpp.
References EOL().
Referenced by generate_usings(), and generate_usings_standalone_functions().
void stan::lang::generate_using_namespace | ( | const std::string & | ns, |
std::ostream & | o | ||
) |
Generate using statement for the specified namespace to the specfied stream.
[in] | ns | namespace for which using statement is generated |
[in,out] | o | stream for generating |
Definition at line 19 of file generate_using_namespace.hpp.
References EOL().
Referenced by generate_usings(), and generate_usings_standalone_functions().
void stan::lang::generate_usings | ( | std::ostream & | o | ) |
Generate the using statements for a Stan model.
[in,out] | o | stream for generating |
Definition at line 18 of file generate_usings.hpp.
References EOL(), generate_using(), and generate_using_namespace().
Referenced by generate_cpp().
void stan::lang::generate_usings_standalone_functions | ( | std::ostream & | o | ) |
Generate the using statements for a Stan standalone functions file.
[in,out] | o | stream for generating |
Definition at line 18 of file generate_usings_standalone_functions.hpp.
References EOL(), generate_using(), and generate_using_namespace().
Referenced by generate_standalone_functions().
void stan::lang::generate_validate_context_size | ( | size_t | indent, |
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 30 of file generate_validate_context_size.hpp.
References EOL(), generate_expression(), generate_indent(), generate_validate_positive(), MECModelEnuComparisons::i, is_nil(), and NOT_USER_FACING().
Referenced by stan::lang::var_size_validating_visgen::operator()().
void stan::lang::generate_validate_positive | ( | const std::string & | var_name, |
const expression & | expr, | ||
int | indents, | ||
std::ostream & | o | ||
) |
Generate call to stan_math lib function validate_non_negative_index which will throw an informative error if dim size is < 0
This check should precede the variable declaration in order to avoid bad alloc runtime error. Called by
generate_validate_context_size - data variables
generate_initialization - transformed data declarations
generate_var_resiszing - initializes transformed data variables
generate_local_var_decls - local variables, transformed parameters write array, generated quantities
generate_set_param_ranges - parameter variables
[in] | var_name | variable name |
[in] | expr | declared dim size expression |
[in] | indents | indentation level |
[in,out] | o | output stream for generated code |
Definition at line 33 of file generate_validate_positive.hpp.
References EOL(), generate_expression(), generate_indent(), generate_quoted_expression(), and NOT_USER_FACING().
Referenced by stan::lang::local_var_decl_visgen::declare_array(), generate_initialization(), generate_validate_context_size(), stan::lang::set_param_ranges_visgen::operator()(), and stan::lang::local_var_decl_visgen::operator()().
void stan::lang::generate_validate_transformed_params | ( | const std::vector< var_decl > & | vs, |
int | indent, | ||
std::ostream & | o | ||
) |
Generate code to validate the specified transformed parameters, generating at the specified indentation level to the specified stream.
[in] | vs | variable declarations |
[in] | indent | indentation level |
[in,out] | o | stream for generating |
Definition at line 24 of file generate_validate_transformed_params.hpp.
References EOL(), generate_comment(), and MECModelEnuComparisons::i.
Referenced by generate_log_prob().
Generate code to validate the specified variable declaration at the specified indentation level to the specified stream.
[in] | decl | variable declaration |
[in] | indent | indentation level |
[in,out] | o | stream for generating |
Definition at line 20 of file generate_validate_var_decl.hpp.
References stan::lang::var_decl::decl_.
Referenced by generate_validate_var_decls().
void stan::lang::generate_validate_var_decls | ( | const std::vector< var_decl > | decls, |
int | indent, | ||
std::ostream & | o | ||
) |
Generate code to validate the specified variable declarations at the specified indentation level to the specified stream. Generated code is preceeded by stmt updating global variable current_statement_begin__
to src file line number where variable is declared.
[in] | decls | variable declarations |
[in] | indent | indentation level |
[in,out] | o | stream for generating |
Definition at line 24 of file generate_validate_var_decls.hpp.
References EOL(), generate_indent(), generate_validate_var_decl(), and MECModelEnuComparisons::i.
Referenced by generate_constructor(), generate_log_prob(), and generate_write_array_method().
void stan::lang::generate_var_resizing | ( | const std::vector< var_decl > & | vs, |
int | indent, | ||
std::ostream & | o | ||
) |
Generate code to to the specified stream to resize the variables in the specified declarations and fill them with dummy values. Generated code is preceeded by stmt updating global variable current_statement_begin__
to src file line number where variable is declared.
[in] | vs | variable declarations |
[in] | indent | indentation level |
[in,out] | o | stream for generating |
Definition at line 28 of file generate_var_resizing.hpp.
References EOL(), generate_expression(), generate_indent(), MECModelEnuComparisons::i, and NOT_USER_FACING().
Referenced by generate_constructor().
void stan::lang::generate_version_comment | ( | std::ostream & | o | ) |
Generate a comment indicating which version of Stan generated the model code to the specified stream.
[in,out] | o | stream for generating |
Definition at line 18 of file generate_version_comment.hpp.
References EOL2(), stan::MAJOR_VERSION, stan::MINOR_VERSION, and stan::PATCH_VERSION.
Referenced by generate_cpp(), and generate_standalone_functions().
void stan::lang::generate_void_statement | ( | const std::string & | name, |
const size_t | indent, | ||
std::ostream & | o | ||
) |
Generate a dummy void-cast statement for a variable of the specified name at the specified indentation level to the specified output stream.
[in] | name | variable name |
[in] | indent | indentation level |
[in,out] | o | stream for genering |
Definition at line 20 of file generate_void_statement.hpp.
References EOL(), and generate_indent().
Referenced by stan::lang::local_var_decl_visgen::declare_array(), generate_constructor(), stan::lang::init_local_var_visgen::generate_initialize_array(), generate_write_array_method(), and stan::lang::statement_visgen::operator()().
void stan::lang::generate_write_array_method | ( | const program & | prog, |
const std::string & | model_name, | ||
std::ostream & | o | ||
) |
Generate the write_array
method for the specified program, with specified model name to the specified stream.
[in] | prog | program from which to generate |
[in] | model_name | name of model |
[in,out] | o | stream for generating |
Definition at line 30 of file generate_write_array_method.hpp.
References stan::lang::program::derived_decl_, EOL(), EOL2(), generate_catch_throw_located(), generate_comment(), generate_local_var_decls(), generate_statements(), generate_try(), generate_validate_var_decls(), generate_void_statement(), stan::lang::program::generated_decl_, MECModelEnuComparisons::i, INDENT(), INDENT2(), INDENT3(), and stan::lang::program::parameter_decl_.
Referenced by generate_cpp().