From 252aadaf512235802623d0d96fe0dc69a4186595 Mon Sep 17 00:00:00 2001 From: Steve Bronder Date: Tue, 30 Mar 2021 00:35:10 -0400 Subject: [PATCH 1/7] cleanup some of the cpp meta functions --- src/stan_math_backend/Cpp_Json.ml | 2 +- src/stan_math_backend/Stan_math_code_gen.ml | 55 +- src/stan_math_backend/Statement_gen.ml | 13 +- .../cli-args/filename_good.expected | 19 +- test/integration/good/code-gen/cl.expected | 64 +- test/integration/good/code-gen/cpp.expected | 1649 +++++++---------- .../good/code-gen/expressions/cpp.expected | 19 +- .../good/code-gen/opencl/cpp.expected | 104 +- .../good/code-gen/profiling/cpp.expected | 30 +- .../good/compiler-optimizations/cpp.expected | 1287 ++++++------- 10 files changed, 1290 insertions(+), 1952 deletions(-) diff --git a/src/stan_math_backend/Cpp_Json.ml b/src/stan_math_backend/Cpp_Json.ml index 3899c914f5..ff17dc04b6 100644 --- a/src/stan_math_backend/Cpp_Json.ml +++ b/src/stan_math_backend/Cpp_Json.ml @@ -4,7 +4,7 @@ module Str = Re.Str let rec sizedtype_to_json (st : Expr.Typed.t SizedType.t) : Yojson.Basic.t = let emit_cpp_expr e = - Fmt.strf "<< %a >>" Expression_gen.pp_expr e + Fmt.strf "+ std::to_string(%a) +" Expression_gen.pp_expr e |> Str.global_replace (Str.regexp "[\n\r\t ]+") " " in match st with diff --git a/src/stan_math_backend/Stan_math_code_gen.ml b/src/stan_math_backend/Stan_math_code_gen.ml index b4b32ad69b..53b7537e50 100644 --- a/src/stan_math_backend/Stan_math_code_gen.ml +++ b/src/stan_math_backend/Stan_math_code_gen.ml @@ -392,8 +392,11 @@ let pp_ctor ppf p = match decl_type with | Sized st -> Locations.pp_smeta ppf meta ; - if Set.mem data_idents decl_id then pp_validate_data ppf (decl_id, st) ; - pp_set_size ppf (decl_id, st, DataOnly) + let is_input_data = Set.mem data_idents decl_id in + (match is_input_data with + | true -> pp_validate_data ppf (decl_id, st) ; + pp_set_size ppf (decl_id, st, DataOnly); + | false -> ()) | Unsized _ -> () ) | _ -> pp_statement ppf s in @@ -440,7 +443,7 @@ let pp_model_private ppf {Program.prepare_data; _} = @param cv_attr Optional parameter to add method attributes. @param ppbody (?A pretty printer of the method's body) *) -let pp_method ppf rt name params intro ?(outro = nop) ?(cv_attr = ["const"]) +let pp_method ppf rt name params intro ?(outro = nop) ?(cv_attr:string list = ["const"]) ppbody = pf ppf "@[inline %s %s(@[@,%a@]) %a " rt name (list ~sep:comma string) params (list ~sep:cut string) cv_attr ; @@ -453,11 +456,12 @@ let pp_method ppf rt name params intro ?(outro = nop) ?(cv_attr = ["const"]) @param ppf A pretty printer. *) let pp_get_param_names ppf {Program.output_vars; _} = - let add_param = fmt "names__.emplace_back(%S);" in + let add_param = fmt "%S" in pp_method ppf "void" "get_param_names" ["std::vector& names__"] nop (fun ppf -> - pf ppf "names__.clear();@ " ; - (list ~sep:cut add_param) ppf (List.map ~f:fst output_vars) ) + pf ppf "names__ = std::vector{%a};" + (list ~sep:comma add_param) (List.map ~f:fst output_vars) ) + ~cv_attr:["const"] (** Print the `get_dims` method of the model class. *) let pp_get_dims ppf {Program.output_vars; _} = @@ -469,23 +473,19 @@ let pp_get_dims ppf {Program.output_vars; _} = inner_dims in let pp_add_pack ppf dims = - pf ppf "dimss__.emplace_back(%a);@," pp_pack dims - in - let pp_output_var ppf = - (list ~sep:cut pp_add_pack) - ppf - List.( - map ~f:SizedType.get_dims - (map - ~f:(fun (_, {Program.out_constrained_st= st; _}) -> st) - output_vars)) - in - let params = ["std::vector>& dimss__"] in - let cv_attr = ["const"] in - pp_method ppf "void" "get_dims" params - (const string "dimss__.clear();") - (fun ppf -> pp_output_var ppf) - ~cv_attr + pf ppf "%a" pp_pack dims + in + let dim_list = List.(map ~f:( + fun (_, {Program.out_constrained_st= st; _}) -> st) output_vars + ) in + let pp_output_var ppf dims = + (list ~sep:comma pp_add_pack) ppf List.(map ~f:SizedType.get_dims dims) + in + pp_method ppf "void" "get_dims" ["std::vector>& dimss__"] + nop + (fun ppf ->pf ppf "dimss__ = std::vector>{%a};" + pp_output_var dim_list) + ~cv_attr:["const"] let pp_method_b ppf rt name params intro ?(outro = nop) ?(cv_attr = ["const"]) body = @@ -575,7 +575,6 @@ let pp_constrained_param_names ppf {Program.output_vars; _} = let dims = List.rev (SizedType.get_dims st) in pp_for_loop_iteratee ppf (decl_id, dims, emit_name) in - let cv_attr = ["const"; "final"] in pp_method ppf "void" "constrained_param_names" params nop (fun ppf -> (list ~sep:cut pp_param_names) ppf paramvars ; @@ -583,7 +582,7 @@ let pp_constrained_param_names ppf {Program.output_vars; _} = (list ~sep:cut pp_param_names, tparamvars) ; pf ppf "@,if (emit_generated_quantities__) %a@," pp_block (list ~sep:cut pp_param_names, gqvars) ) - ~cv_attr + ~cv_attr:["const"; "final"] (* Print the `unconstrained_param_names` method of the model class. This is just a copy of constrained, I need to figure out which one is wrong @@ -695,11 +694,9 @@ let pp_log_prob ppf Program.({prog_name; log_prob; _}) = @param outvars The parameters to gather the sizes for. *) let pp_outvar_metadata ppf (method_name, outvars) = - let intro = const string "std::stringstream s__;" in - let outro ppf () = pf ppf "@ return s__.str();" in let json_str = Cpp_Json.out_var_interpolated_json_str outvars in - let ppbody ppf = pf ppf "s__ << %s;" json_str in - pp_method ppf "std::string" method_name [] intro ~outro ppbody + let ppbody ppf = pf ppf "return std::string(%s);" json_str in + pp_method ppf "std::string" method_name [] nop ppbody ~cv_attr:["const"] (** Print the `get_unconstrained_sizedtypes` method of the model class *) let pp_unconstrained_types ppf {Program.output_vars; _} = diff --git a/src/stan_math_backend/Statement_gen.ml b/src/stan_math_backend/Statement_gen.ml index 7f152df399..69cf4d8e56 100644 --- a/src/stan_math_backend/Statement_gen.ml +++ b/src/stan_math_backend/Statement_gen.ml @@ -15,12 +15,13 @@ let pp_profile ppf (pp_body, name, body) = in pf ppf "{@;<1 2>@[%s@;@;%a@]@,}" profile pp_body body -let rec contains_eigen = function +let rec contains_eigen (ut : UnsizedType.t) : bool = + match ut with | UnsizedType.UArray t -> contains_eigen t | UMatrix | URowVector | UVector -> true | UInt | UReal | UMathLibraryFunction | UFun _ -> false -let pp_set_size ppf (decl_id, st, adtype) = +let pp_set_size ppf (decl_id, st, adtype) = (* TODO: generate optimal adtypes for expressions and declarations *) let real_nan = match adtype with @@ -38,9 +39,11 @@ let pp_set_size ppf (decl_id, st, adtype) = | SMatrix (d1, d2) -> pf ppf "%a(%a, %a)" pp_st st pp_expr d1 pp_expr d2 | SArray (t, d) -> pf ppf "%a(%a, %a)" pp_st st pp_expr d pp_size_ctor t in - pf ppf "@[%s = %a;@]@," decl_id pp_size_ctor st ; - if contains_eigen (SizedType.to_unsized st) then - pf ppf "@[stan::math::fill(%s, %s);@]@," decl_id real_nan + let print_fill ppf st = + match contains_eigen (SizedType.to_unsized st) with + | true -> pf ppf "stan::math::fill(%s, %s);" decl_id real_nan + | false -> () in + pf ppf "@[%s = %a;@,%a @]@," decl_id pp_size_ctor st print_fill st let%expect_test "set size mat array" = let int = Expr.Helpers.int in diff --git a/test/integration/cli-args/filename_good.expected b/test/integration/cli-args/filename_good.expected index b711d1f02c..ec3260df89 100644 --- a/test/integration/cli-args/filename_good.expected +++ b/test/integration/cli-args/filename_good.expected @@ -172,13 +172,12 @@ class filename_good_model final : public model_base_crtp { inline void get_param_names(std::vector& names__) const { - names__.clear(); - + names__ = std::vector{}; } // get_param_names() inline void get_dims(std::vector>& dimss__) const { - dimss__.clear(); + dimss__ = std::vector>{}; } // get_dims() inline void constrained_param_names( @@ -215,16 +214,14 @@ class filename_good_model final : public model_base_crtp { } // unconstrained_param_names() - inline std::string get_constrained_sizedtypes() const { - std::stringstream s__; - s__ << "[]"; - return s__.str(); + inline std::string get_constrained_sizedtypes() const final { + + return std::string("[]"); } // get_constrained_sizedtypes() - inline std::string get_unconstrained_sizedtypes() const { - std::stringstream s__; - s__ << "[]"; - return s__.str(); + inline std::string get_unconstrained_sizedtypes() const final { + + return std::string("[]"); } // get_unconstrained_sizedtypes() diff --git a/test/integration/good/code-gen/cl.expected b/test/integration/good/code-gen/cl.expected index 7f8b62af65..e813d2dac3 100644 --- a/test/integration/good/code-gen/cl.expected +++ b/test/integration/good/code-gen/cl.expected @@ -1548,40 +1548,30 @@ class optimize_glm_model final : public model_base_crtp { inline void get_param_names(std::vector& names__) const { - names__.clear(); - names__.emplace_back("alpha_v"); - names__.emplace_back("beta"); - names__.emplace_back("cuts"); - names__.emplace_back("sigma"); - names__.emplace_back("alpha"); - names__.emplace_back("phi"); - names__.emplace_back("X_p"); - names__.emplace_back("beta_m"); - names__.emplace_back("X_rv_p"); + names__ = std::vector{"alpha_v", + "beta", + "cuts", + "sigma", + "alpha", + "phi", + "X_p", + "beta_m", + "X_rv_p"}; } // get_param_names() inline void get_dims(std::vector>& dimss__) const { - dimss__.clear(); - dimss__.emplace_back(std::vector{static_cast(k)}); - - dimss__.emplace_back(std::vector{static_cast(k)}); - - dimss__.emplace_back(std::vector{static_cast(k)}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{static_cast(n), - static_cast(k)}); - - dimss__.emplace_back(std::vector{static_cast(n), - static_cast(k)}); - - dimss__.emplace_back(std::vector{static_cast(n)}); + dimss__ = std::vector>{std::vector{ + static_cast(k) + }, + std::vector{static_cast(k)}, + std::vector{static_cast(k)}, + std::vector{}, + std::vector{}, + std::vector{}, + std::vector{static_cast(n), static_cast(k)}, + std::vector{static_cast(n), static_cast(k)}, + std::vector{static_cast(n)}}; } // get_dims() inline void constrained_param_names( @@ -1682,16 +1672,14 @@ class optimize_glm_model final : public model_base_crtp { } // unconstrained_param_names() - inline std::string get_constrained_sizedtypes() const { - std::stringstream s__; - s__ << "[{\"name\":\"alpha_v\",\"type\":{\"name\":\"vector\",\"length\":" << k << "},\"block\":\"parameters\"},{\"name\":\"beta\",\"type\":{\"name\":\"vector\",\"length\":" << k << "},\"block\":\"parameters\"},{\"name\":\"cuts\",\"type\":{\"name\":\"vector\",\"length\":" << k << "},\"block\":\"parameters\"},{\"name\":\"sigma\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"alpha\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"phi\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"X_p\",\"type\":{\"name\":\"matrix\",\"rows\":" << n << ",\"cols\":" << k << "},\"block\":\"parameters\"},{\"name\":\"beta_m\",\"type\":{\"name\":\"matrix\",\"rows\":" << n << ",\"cols\":" << k << "},\"block\":\"parameters\"},{\"name\":\"X_rv_p\",\"type\":{\"name\":\"vector\",\"length\":" << n << "},\"block\":\"parameters\"}]"; - return s__.str(); + inline std::string get_constrained_sizedtypes() const final { + + return std::string("[{\"name\":\"alpha_v\",\"type\":{\"name\":\"vector\",\"length\":" << k << "},\"block\":\"parameters\"},{\"name\":\"beta\",\"type\":{\"name\":\"vector\",\"length\":" << k << "},\"block\":\"parameters\"},{\"name\":\"cuts\",\"type\":{\"name\":\"vector\",\"length\":" << k << "},\"block\":\"parameters\"},{\"name\":\"sigma\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"alpha\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"phi\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"X_p\",\"type\":{\"name\":\"matrix\",\"rows\":" << n << ",\"cols\":" << k << "},\"block\":\"parameters\"},{\"name\":\"beta_m\",\"type\":{\"name\":\"matrix\",\"rows\":" << n << ",\"cols\":" << k << "},\"block\":\"parameters\"},{\"name\":\"X_rv_p\",\"type\":{\"name\":\"vector\",\"length\":" << n << "},\"block\":\"parameters\"}]"); } // get_constrained_sizedtypes() - inline std::string get_unconstrained_sizedtypes() const { - std::stringstream s__; - s__ << "[{\"name\":\"alpha_v\",\"type\":{\"name\":\"vector\",\"length\":" << k << "},\"block\":\"parameters\"},{\"name\":\"beta\",\"type\":{\"name\":\"vector\",\"length\":" << k << "},\"block\":\"parameters\"},{\"name\":\"cuts\",\"type\":{\"name\":\"vector\",\"length\":" << k << "},\"block\":\"parameters\"},{\"name\":\"sigma\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"alpha\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"phi\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"X_p\",\"type\":{\"name\":\"matrix\",\"rows\":" << n << ",\"cols\":" << k << "},\"block\":\"parameters\"},{\"name\":\"beta_m\",\"type\":{\"name\":\"matrix\",\"rows\":" << n << ",\"cols\":" << k << "},\"block\":\"parameters\"},{\"name\":\"X_rv_p\",\"type\":{\"name\":\"vector\",\"length\":" << n << "},\"block\":\"parameters\"}]"; - return s__.str(); + inline std::string get_unconstrained_sizedtypes() const final { + + return std::string("[{\"name\":\"alpha_v\",\"type\":{\"name\":\"vector\",\"length\":" << k << "},\"block\":\"parameters\"},{\"name\":\"beta\",\"type\":{\"name\":\"vector\",\"length\":" << k << "},\"block\":\"parameters\"},{\"name\":\"cuts\",\"type\":{\"name\":\"vector\",\"length\":" << k << "},\"block\":\"parameters\"},{\"name\":\"sigma\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"alpha\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"phi\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"X_p\",\"type\":{\"name\":\"matrix\",\"rows\":" << n << ",\"cols\":" << k << "},\"block\":\"parameters\"},{\"name\":\"beta_m\",\"type\":{\"name\":\"matrix\",\"rows\":" << n << ",\"cols\":" << k << "},\"block\":\"parameters\"},{\"name\":\"X_rv_p\",\"type\":{\"name\":\"vector\",\"length\":" << n << "},\"block\":\"parameters\"}]"); } // get_unconstrained_sizedtypes() diff --git a/test/integration/good/code-gen/cpp.expected b/test/integration/good/code-gen/cpp.expected index 9a2f09d200..1056a56b51 100644 --- a/test/integration/good/code-gen/cpp.expected +++ b/test/integration/good/code-gen/cpp.expected @@ -322,23 +322,18 @@ class _8_schools_ncp_model final : public model_base_crtp<_8_schools_ncp_model> inline void get_param_names(std::vector& names__) const { - names__.clear(); - names__.emplace_back("mu"); - names__.emplace_back("tau"); - names__.emplace_back("theta_tilde"); - names__.emplace_back("theta"); + names__ = std::vector{"mu", + "tau", + "theta_tilde", + "theta"}; } // get_param_names() inline void get_dims(std::vector>& dimss__) const { - dimss__.clear(); - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{static_cast(J)}); - - dimss__.emplace_back(std::vector{static_cast(J)}); + dimss__ = std::vector>{std::vector{}, + std::vector{}, + std::vector{static_cast(J)}, + std::vector{static_cast(J)}}; } // get_dims() inline void constrained_param_names( @@ -391,16 +386,14 @@ class _8_schools_ncp_model final : public model_base_crtp<_8_schools_ncp_model> } // unconstrained_param_names() - inline std::string get_constrained_sizedtypes() const { - std::stringstream s__; - s__ << "[{\"name\":\"mu\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"tau\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"theta_tilde\",\"type\":{\"name\":\"vector\",\"length\":" << J << "},\"block\":\"parameters\"},{\"name\":\"theta\",\"type\":{\"name\":\"vector\",\"length\":" << J << "},\"block\":\"transformed_parameters\"}]"; - return s__.str(); + inline std::string get_constrained_sizedtypes() const final { + + return std::string("[{\"name\":\"mu\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"tau\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"theta_tilde\",\"type\":{\"name\":\"vector\",\"length\":" << J << "},\"block\":\"parameters\"},{\"name\":\"theta\",\"type\":{\"name\":\"vector\",\"length\":" << J << "},\"block\":\"transformed_parameters\"}]"); } // get_constrained_sizedtypes() - inline std::string get_unconstrained_sizedtypes() const { - std::stringstream s__; - s__ << "[{\"name\":\"mu\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"tau\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"theta_tilde\",\"type\":{\"name\":\"vector\",\"length\":" << J << "},\"block\":\"parameters\"},{\"name\":\"theta\",\"type\":{\"name\":\"vector\",\"length\":" << J << "},\"block\":\"transformed_parameters\"}]"; - return s__.str(); + inline std::string get_unconstrained_sizedtypes() const final { + + return std::string("[{\"name\":\"mu\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"tau\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"theta_tilde\",\"type\":{\"name\":\"vector\",\"length\":" << J << "},\"block\":\"parameters\"},{\"name\":\"theta\",\"type\":{\"name\":\"vector\",\"length\":" << J << "},\"block\":\"transformed_parameters\"}]"); } // get_unconstrained_sizedtypes() @@ -676,14 +669,12 @@ class _8start_with_number_model final : public model_base_crtp<_8start_with_numb inline void get_param_names(std::vector& names__) const { - names__.clear(); - names__.emplace_back("bar"); + names__ = std::vector{"bar"}; } // get_param_names() inline void get_dims(std::vector>& dimss__) const { - dimss__.clear(); - dimss__.emplace_back(std::vector{}); + dimss__ = std::vector>{std::vector{}}; } // get_dims() inline void constrained_param_names( @@ -720,16 +711,14 @@ class _8start_with_number_model final : public model_base_crtp<_8start_with_numb } // unconstrained_param_names() - inline std::string get_constrained_sizedtypes() const { - std::stringstream s__; - s__ << "[{\"name\":\"bar\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"}]"; - return s__.str(); + inline std::string get_constrained_sizedtypes() const final { + + return std::string("[{\"name\":\"bar\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"}]"); } // get_constrained_sizedtypes() - inline std::string get_unconstrained_sizedtypes() const { - std::stringstream s__; - s__ << "[{\"name\":\"bar\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"}]"; - return s__.str(); + inline std::string get_unconstrained_sizedtypes() const final { + + return std::string("[{\"name\":\"bar\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"}]"); } // get_unconstrained_sizedtypes() @@ -1142,23 +1131,18 @@ class eight_schools_ncp_model final : public model_base_crtp& names__) const { - names__.clear(); - names__.emplace_back("mu"); - names__.emplace_back("tau"); - names__.emplace_back("theta_tilde"); - names__.emplace_back("theta"); + names__ = std::vector{"mu", + "tau", + "theta_tilde", + "theta"}; } // get_param_names() inline void get_dims(std::vector>& dimss__) const { - dimss__.clear(); - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{static_cast(J)}); - - dimss__.emplace_back(std::vector{static_cast(J)}); + dimss__ = std::vector>{std::vector{}, + std::vector{}, + std::vector{static_cast(J)}, + std::vector{static_cast(J)}}; } // get_dims() inline void constrained_param_names( @@ -1211,16 +1195,14 @@ class eight_schools_ncp_model final : public model_base_crtp& names__) const { - names__.clear(); - names__.emplace_back("xx"); - names__.emplace_back("y"); - names__.emplace_back("w"); - names__.emplace_back("td_arr33"); + names__ = std::vector{"xx", + "y", + "w", + "td_arr33"}; } // get_param_names() inline void get_dims(std::vector>& dimss__) const { - dimss__.clear(); - dimss__.emplace_back(std::vector{static_cast(3)}); - - dimss__.emplace_back(std::vector{static_cast(3), - static_cast(3)}); - - dimss__.emplace_back(std::vector{static_cast(3), - static_cast(3)}); - - dimss__.emplace_back(std::vector{static_cast(3), - static_cast(3)}); + dimss__ = std::vector>{std::vector{ + static_cast(3) + }, + std::vector{static_cast(3), static_cast(3)}, + std::vector{static_cast(3), static_cast(3)}, + std::vector{static_cast(3), static_cast(3)}}; } // get_dims() inline void constrained_param_names( @@ -1669,16 +1645,14 @@ class mixed_type_arrays_model final : public model_base_crtp { inline void get_param_names(std::vector& names__) const { - names__.clear(); - names__.emplace_back("p_real"); - names__.emplace_back("p_upper"); - names__.emplace_back("p_lower"); - names__.emplace_back("offset_multiplier"); - names__.emplace_back("no_offset_multiplier"); - names__.emplace_back("offset_no_multiplier"); - names__.emplace_back("p_real_1d_ar"); - names__.emplace_back("p_real_3d_ar"); - names__.emplace_back("p_vec"); - names__.emplace_back("p_1d_vec"); - names__.emplace_back("p_3d_vec"); - names__.emplace_back("p_row_vec"); - names__.emplace_back("p_1d_row_vec"); - names__.emplace_back("p_3d_row_vec"); - names__.emplace_back("p_ar_mat"); - names__.emplace_back("p_simplex"); - names__.emplace_back("p_1d_simplex"); - names__.emplace_back("p_3d_simplex"); - names__.emplace_back("p_cfcov_54"); - names__.emplace_back("p_cfcov_33"); - names__.emplace_back("p_cfcov_33_ar"); - names__.emplace_back("x_p"); - names__.emplace_back("y_p"); - names__.emplace_back("tp_real_1d_ar"); - names__.emplace_back("tp_real_3d_ar"); - names__.emplace_back("tp_vec"); - names__.emplace_back("tp_1d_vec"); - names__.emplace_back("tp_3d_vec"); - names__.emplace_back("tp_row_vec"); - names__.emplace_back("tp_1d_row_vec"); - names__.emplace_back("tp_3d_row_vec"); - names__.emplace_back("tp_ar_mat"); - names__.emplace_back("tp_simplex"); - names__.emplace_back("tp_1d_simplex"); - names__.emplace_back("tp_3d_simplex"); - names__.emplace_back("tp_cfcov_54"); - names__.emplace_back("tp_cfcov_33"); - names__.emplace_back("tp_cfcov_33_ar"); - names__.emplace_back("theta_p"); - names__.emplace_back("tp_real"); - names__.emplace_back("gq_r1"); - names__.emplace_back("gq_r2"); - names__.emplace_back("gq_real_1d_ar"); - names__.emplace_back("gq_real_3d_ar"); - names__.emplace_back("gq_vec"); - names__.emplace_back("gq_1d_vec"); - names__.emplace_back("gq_3d_vec"); - names__.emplace_back("gq_row_vec"); - names__.emplace_back("gq_1d_row_vec"); - names__.emplace_back("gq_3d_row_vec"); - names__.emplace_back("gq_ar_mat"); - names__.emplace_back("gq_simplex"); - names__.emplace_back("gq_1d_simplex"); - names__.emplace_back("gq_3d_simplex"); - names__.emplace_back("gq_cfcov_54"); - names__.emplace_back("gq_cfcov_33"); - names__.emplace_back("gq_cfcov_33_ar"); - names__.emplace_back("indices"); - names__.emplace_back("indexing_mat"); - names__.emplace_back("idx_res1"); - names__.emplace_back("idx_res2"); - names__.emplace_back("idx_res3"); - names__.emplace_back("idx_res11"); - names__.emplace_back("idx_res21"); - names__.emplace_back("idx_res31"); - names__.emplace_back("idx_res4"); - names__.emplace_back("idx_res5"); + names__ = std::vector{"p_real", + "p_upper", + "p_lower", + "offset_multiplier", + "no_offset_multiplier", + "offset_no_multiplier", + "p_real_1d_ar", + "p_real_3d_ar", + "p_vec", + "p_1d_vec", + "p_3d_vec", + "p_row_vec", + "p_1d_row_vec", + "p_3d_row_vec", + "p_ar_mat", + "p_simplex", + "p_1d_simplex", + "p_3d_simplex", + "p_cfcov_54", + "p_cfcov_33", + "p_cfcov_33_ar", + "x_p", + "y_p", + "tp_real_1d_ar", + "tp_real_3d_ar", + "tp_vec", + "tp_1d_vec", + "tp_3d_vec", + "tp_row_vec", + "tp_1d_row_vec", + "tp_3d_row_vec", + "tp_ar_mat", + "tp_simplex", + "tp_1d_simplex", + "tp_3d_simplex", + "tp_cfcov_54", + "tp_cfcov_33", + "tp_cfcov_33_ar", + "theta_p", + "tp_real", + "gq_r1", + "gq_r2", + "gq_real_1d_ar", + "gq_real_3d_ar", + "gq_vec", + "gq_1d_vec", + "gq_3d_vec", + "gq_row_vec", + "gq_1d_row_vec", + "gq_3d_row_vec", + "gq_ar_mat", + "gq_simplex", + "gq_1d_simplex", + "gq_3d_simplex", + "gq_cfcov_54", + "gq_cfcov_33", + "gq_cfcov_33_ar", + "indices", + "indexing_mat", + "idx_res1", + "idx_res2", + "idx_res3", + "idx_res11", + "idx_res21", + "idx_res31", + "idx_res4", + "idx_res5"}; } // get_param_names() inline void get_dims(std::vector>& dimss__) const { - dimss__.clear(); - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{static_cast(5)}); - - dimss__.emplace_back(std::vector{static_cast(5)}); - - dimss__.emplace_back(std::vector{static_cast(5)}); - - dimss__.emplace_back(std::vector{static_cast(N)}); - - dimss__.emplace_back(std::vector{static_cast(N), - static_cast(M), - static_cast(K)}); - - dimss__.emplace_back(std::vector{static_cast(N)}); - - dimss__.emplace_back(std::vector{static_cast(N), - static_cast(N)}); - - dimss__.emplace_back(std::vector{static_cast(N), - static_cast(M), - static_cast(K), - static_cast(N)}); - - dimss__.emplace_back(std::vector{static_cast(N)}); - - dimss__.emplace_back(std::vector{static_cast(N), - static_cast(N)}); - - dimss__.emplace_back(std::vector{static_cast(N), - static_cast(M), - static_cast(K), - static_cast(N)}); - - dimss__.emplace_back(std::vector{static_cast(4), - static_cast(5), - static_cast(2), - static_cast(3)}); - - dimss__.emplace_back(std::vector{static_cast(N)}); - - dimss__.emplace_back(std::vector{static_cast(N), - static_cast(N)}); - - dimss__.emplace_back(std::vector{static_cast(N), - static_cast(M), - static_cast(K), - static_cast(N)}); - - dimss__.emplace_back(std::vector{static_cast(5), - static_cast(4)}); - - dimss__.emplace_back(std::vector{static_cast(3), - static_cast(3)}); - - dimss__.emplace_back(std::vector{static_cast(K), - static_cast(3), - static_cast(3)}); - - dimss__.emplace_back(std::vector{static_cast(2)}); - - dimss__.emplace_back(std::vector{static_cast(2)}); - - dimss__.emplace_back(std::vector{static_cast(N)}); - - dimss__.emplace_back(std::vector{static_cast(N), - static_cast(M), - static_cast(K)}); - - dimss__.emplace_back(std::vector{static_cast(N)}); - - dimss__.emplace_back(std::vector{static_cast(N), - static_cast(N)}); - - dimss__.emplace_back(std::vector{static_cast(N), - static_cast(M), - static_cast(K), - static_cast(N)}); - - dimss__.emplace_back(std::vector{static_cast(N)}); - - dimss__.emplace_back(std::vector{static_cast(N), - static_cast(N)}); - - dimss__.emplace_back(std::vector{static_cast(N), - static_cast(M), - static_cast(K), - static_cast(N)}); - - dimss__.emplace_back(std::vector{static_cast(4), - static_cast(5), - static_cast(2), - static_cast(3)}); - - dimss__.emplace_back(std::vector{static_cast(N)}); - - dimss__.emplace_back(std::vector{static_cast(N), - static_cast(N)}); - - dimss__.emplace_back(std::vector{static_cast(N), - static_cast(M), - static_cast(K), - static_cast(N)}); - - dimss__.emplace_back(std::vector{static_cast(5), - static_cast(4)}); - - dimss__.emplace_back(std::vector{static_cast(3), - static_cast(3)}); - - dimss__.emplace_back(std::vector{static_cast(K), - static_cast(3), - static_cast(3)}); - - dimss__.emplace_back(std::vector{static_cast(2)}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{static_cast(N)}); - - dimss__.emplace_back(std::vector{static_cast(N), - static_cast(M), - static_cast(K)}); - - dimss__.emplace_back(std::vector{static_cast(N)}); - - dimss__.emplace_back(std::vector{static_cast(N), - static_cast(N)}); - - dimss__.emplace_back(std::vector{static_cast(N), - static_cast(M), - static_cast(K), - static_cast(N)}); - - dimss__.emplace_back(std::vector{static_cast(N)}); - - dimss__.emplace_back(std::vector{static_cast(N), - static_cast(N)}); - - dimss__.emplace_back(std::vector{static_cast(N), - static_cast(M), - static_cast(K), - static_cast(N)}); - - dimss__.emplace_back(std::vector{static_cast(4), - static_cast(5), - static_cast(2), - static_cast(3)}); - - dimss__.emplace_back(std::vector{static_cast(N)}); - - dimss__.emplace_back(std::vector{static_cast(N), - static_cast(N)}); - - dimss__.emplace_back(std::vector{static_cast(N), - static_cast(M), - static_cast(K), - static_cast(N)}); - - dimss__.emplace_back(std::vector{static_cast(5), - static_cast(4)}); - - dimss__.emplace_back(std::vector{static_cast(3), - static_cast(3)}); - - dimss__.emplace_back(std::vector{static_cast(K), - static_cast(3), - static_cast(3)}); - - dimss__.emplace_back(std::vector{static_cast(3)}); - - dimss__.emplace_back(std::vector{static_cast(5), - static_cast(3), - static_cast(4)}); - - dimss__.emplace_back(std::vector{static_cast(3), - static_cast(3), - static_cast(4)}); - - dimss__.emplace_back(std::vector{static_cast(5), - static_cast(3), - static_cast(4)}); - - dimss__.emplace_back(std::vector{static_cast(3), - static_cast(3), - static_cast(3)}); - - dimss__.emplace_back(std::vector{static_cast(3), - static_cast(3), - static_cast(4)}); - - dimss__.emplace_back(std::vector{static_cast(5), - static_cast(3), - static_cast(4)}); - - dimss__.emplace_back(std::vector{static_cast(3), - static_cast(3), - static_cast(3)}); - - dimss__.emplace_back(std::vector{static_cast(3), - static_cast(4)}); - - dimss__.emplace_back(std::vector{static_cast(2), - static_cast(2)}); + dimss__ = std::vector>{std::vector{}, + std::vector{}, + std::vector{}, + std::vector{static_cast(5)}, + std::vector{static_cast(5)}, + std::vector{static_cast(5)}, + std::vector{static_cast(N)}, + std::vector{static_cast(N), static_cast(M), + static_cast(K)}, + std::vector{static_cast(N)}, + std::vector{static_cast(N), static_cast(N)}, + std::vector{static_cast(N), static_cast(M), + static_cast(K), static_cast(N)}, + std::vector{static_cast(N)}, + std::vector{static_cast(N), static_cast(N)}, + std::vector{static_cast(N), static_cast(M), + static_cast(K), static_cast(N)}, + std::vector{static_cast(4), static_cast(5), + static_cast(2), static_cast(3)}, + std::vector{static_cast(N)}, + std::vector{static_cast(N), static_cast(N)}, + std::vector{static_cast(N), static_cast(M), + static_cast(K), static_cast(N)}, + std::vector{static_cast(5), static_cast(4)}, + std::vector{static_cast(3), static_cast(3)}, + std::vector{static_cast(K), static_cast(3), + static_cast(3)}, + std::vector{static_cast(2)}, + std::vector{static_cast(2)}, + std::vector{static_cast(N)}, + std::vector{static_cast(N), static_cast(M), + static_cast(K)}, + std::vector{static_cast(N)}, + std::vector{static_cast(N), static_cast(N)}, + std::vector{static_cast(N), static_cast(M), + static_cast(K), static_cast(N)}, + std::vector{static_cast(N)}, + std::vector{static_cast(N), static_cast(N)}, + std::vector{static_cast(N), static_cast(M), + static_cast(K), static_cast(N)}, + std::vector{static_cast(4), static_cast(5), + static_cast(2), static_cast(3)}, + std::vector{static_cast(N)}, + std::vector{static_cast(N), static_cast(N)}, + std::vector{static_cast(N), static_cast(M), + static_cast(K), static_cast(N)}, + std::vector{static_cast(5), static_cast(4)}, + std::vector{static_cast(3), static_cast(3)}, + std::vector{static_cast(K), static_cast(3), + static_cast(3)}, + std::vector{static_cast(2)}, + std::vector{}, + std::vector{}, + std::vector{}, + std::vector{static_cast(N)}, + std::vector{static_cast(N), static_cast(M), + static_cast(K)}, + std::vector{static_cast(N)}, + std::vector{static_cast(N), static_cast(N)}, + std::vector{static_cast(N), static_cast(M), + static_cast(K), static_cast(N)}, + std::vector{static_cast(N)}, + std::vector{static_cast(N), static_cast(N)}, + std::vector{static_cast(N), static_cast(M), + static_cast(K), static_cast(N)}, + std::vector{static_cast(4), static_cast(5), + static_cast(2), static_cast(3)}, + std::vector{static_cast(N)}, + std::vector{static_cast(N), static_cast(N)}, + std::vector{static_cast(N), static_cast(M), + static_cast(K), static_cast(N)}, + std::vector{static_cast(5), static_cast(4)}, + std::vector{static_cast(3), static_cast(3)}, + std::vector{static_cast(K), static_cast(3), + static_cast(3)}, + std::vector{static_cast(3)}, + std::vector{static_cast(5), static_cast(3), + static_cast(4)}, + std::vector{static_cast(3), static_cast(3), + static_cast(4)}, + std::vector{static_cast(5), static_cast(3), + static_cast(4)}, + std::vector{static_cast(3), static_cast(3), + static_cast(3)}, + std::vector{static_cast(3), static_cast(3), + static_cast(4)}, + std::vector{static_cast(5), static_cast(3), + static_cast(4)}, + std::vector{static_cast(3), static_cast(3), + static_cast(3)}, + std::vector{static_cast(3), static_cast(4)}, + std::vector{static_cast(2), static_cast(2)}}; } // get_dims() inline void constrained_param_names( @@ -10152,16 +10004,14 @@ class mother_model final : public model_base_crtp { } // unconstrained_param_names() - inline std::string get_constrained_sizedtypes() const { - std::stringstream s__; - s__ << "[{\"name\":\"p_real\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"p_upper\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"p_lower\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"offset_multiplier\",\"type\":{\"name\":\"array\",\"length\":" << 5 << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"no_offset_multiplier\",\"type\":{\"name\":\"array\",\"length\":" << 5 << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"offset_no_multiplier\",\"type\":{\"name\":\"array\",\"length\":" << 5 << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"p_real_1d_ar\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"p_real_3d_ar\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << M << ",\"element_type\":{\"name\":\"array\",\"length\":" << K << ",\"element_type\":{\"name\":\"real\"}}}},\"block\":\"parameters\"},{\"name\":\"p_vec\",\"type\":{\"name\":\"vector\",\"length\":" << N << "},\"block\":\"parameters\"},{\"name\":\"p_1d_vec\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}},\"block\":\"parameters\"},{\"name\":\"p_3d_vec\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << M << ",\"element_type\":{\"name\":\"array\",\"length\":" << K << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}}}},\"block\":\"parameters\"},{\"name\":\"p_row_vec\",\"type\":{\"name\":\"vector\",\"length\":" << N << "},\"block\":\"parameters\"},{\"name\":\"p_1d_row_vec\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}},\"block\":\"parameters\"},{\"name\":\"p_3d_row_vec\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << M << ",\"element_type\":{\"name\":\"array\",\"length\":" << K << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}}}},\"block\":\"parameters\"},{\"name\":\"p_ar_mat\",\"type\":{\"name\":\"array\",\"length\":" << 4 << ",\"element_type\":{\"name\":\"array\",\"length\":" << 5 << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << 2 << ",\"cols\":" << 3 << "}}},\"block\":\"parameters\"},{\"name\":\"p_simplex\",\"type\":{\"name\":\"vector\",\"length\":" << N << "},\"block\":\"parameters\"},{\"name\":\"p_1d_simplex\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}},\"block\":\"parameters\"},{\"name\":\"p_3d_simplex\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << M << ",\"element_type\":{\"name\":\"array\",\"length\":" << K << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}}}},\"block\":\"parameters\"},{\"name\":\"p_cfcov_54\",\"type\":{\"name\":\"matrix\",\"rows\":" << 5 << ",\"cols\":" << 4 << "},\"block\":\"parameters\"},{\"name\":\"p_cfcov_33\",\"type\":{\"name\":\"matrix\",\"rows\":" << 3 << ",\"cols\":" << 3 << "},\"block\":\"parameters\"},{\"name\":\"p_cfcov_33_ar\",\"type\":{\"name\":\"array\",\"length\":" << K << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << 3 << ",\"cols\":" << 3 << "}},\"block\":\"parameters\"},{\"name\":\"x_p\",\"type\":{\"name\":\"vector\",\"length\":" << 2 << "},\"block\":\"parameters\"},{\"name\":\"y_p\",\"type\":{\"name\":\"vector\",\"length\":" << 2 << "},\"block\":\"parameters\"},{\"name\":\"tp_real_1d_ar\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_real_3d_ar\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << M << ",\"element_type\":{\"name\":\"array\",\"length\":" << K << ",\"element_type\":{\"name\":\"real\"}}}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_vec\",\"type\":{\"name\":\"vector\",\"length\":" << N << "},\"block\":\"transformed_parameters\"},{\"name\":\"tp_1d_vec\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_3d_vec\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << M << ",\"element_type\":{\"name\":\"array\",\"length\":" << K << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}}}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_row_vec\",\"type\":{\"name\":\"vector\",\"length\":" << N << "},\"block\":\"transformed_parameters\"},{\"name\":\"tp_1d_row_vec\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_3d_row_vec\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << M << ",\"element_type\":{\"name\":\"array\",\"length\":" << K << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}}}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_ar_mat\",\"type\":{\"name\":\"array\",\"length\":" << 4 << ",\"element_type\":{\"name\":\"array\",\"length\":" << 5 << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << 2 << ",\"cols\":" << 3 << "}}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_simplex\",\"type\":{\"name\":\"vector\",\"length\":" << N << "},\"block\":\"transformed_parameters\"},{\"name\":\"tp_1d_simplex\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_3d_simplex\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << M << ",\"element_type\":{\"name\":\"array\",\"length\":" << K << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}}}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_cfcov_54\",\"type\":{\"name\":\"matrix\",\"rows\":" << 5 << ",\"cols\":" << 4 << "},\"block\":\"transformed_parameters\"},{\"name\":\"tp_cfcov_33\",\"type\":{\"name\":\"matrix\",\"rows\":" << 3 << ",\"cols\":" << 3 << "},\"block\":\"transformed_parameters\"},{\"name\":\"tp_cfcov_33_ar\",\"type\":{\"name\":\"array\",\"length\":" << K << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << 3 << ",\"cols\":" << 3 << "}},\"block\":\"transformed_parameters\"},{\"name\":\"theta_p\",\"type\":{\"name\":\"vector\",\"length\":" << 2 << "},\"block\":\"transformed_parameters\"},{\"name\":\"tp_real\",\"type\":{\"name\":\"real\"},\"block\":\"transformed_parameters\"},{\"name\":\"gq_r1\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"gq_r2\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"gq_real_1d_ar\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"generated_quantities\"},{\"name\":\"gq_real_3d_ar\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << M << ",\"element_type\":{\"name\":\"array\",\"length\":" << K << ",\"element_type\":{\"name\":\"real\"}}}},\"block\":\"generated_quantities\"},{\"name\":\"gq_vec\",\"type\":{\"name\":\"vector\",\"length\":" << N << "},\"block\":\"generated_quantities\"},{\"name\":\"gq_1d_vec\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}},\"block\":\"generated_quantities\"},{\"name\":\"gq_3d_vec\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << M << ",\"element_type\":{\"name\":\"array\",\"length\":" << K << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}}}},\"block\":\"generated_quantities\"},{\"name\":\"gq_row_vec\",\"type\":{\"name\":\"vector\",\"length\":" << N << "},\"block\":\"generated_quantities\"},{\"name\":\"gq_1d_row_vec\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}},\"block\":\"generated_quantities\"},{\"name\":\"gq_3d_row_vec\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << M << ",\"element_type\":{\"name\":\"array\",\"length\":" << K << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}}}},\"block\":\"generated_quantities\"},{\"name\":\"gq_ar_mat\",\"type\":{\"name\":\"array\",\"length\":" << 4 << ",\"element_type\":{\"name\":\"array\",\"length\":" << 5 << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << 2 << ",\"cols\":" << 3 << "}}},\"block\":\"generated_quantities\"},{\"name\":\"gq_simplex\",\"type\":{\"name\":\"vector\",\"length\":" << N << "},\"block\":\"generated_quantities\"},{\"name\":\"gq_1d_simplex\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}},\"block\":\"generated_quantities\"},{\"name\":\"gq_3d_simplex\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << M << ",\"element_type\":{\"name\":\"array\",\"length\":" << K << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}}}},\"block\":\"generated_quantities\"},{\"name\":\"gq_cfcov_54\",\"type\":{\"name\":\"matrix\",\"rows\":" << 5 << ",\"cols\":" << 4 << "},\"block\":\"generated_quantities\"},{\"name\":\"gq_cfcov_33\",\"type\":{\"name\":\"matrix\",\"rows\":" << 3 << ",\"cols\":" << 3 << "},\"block\":\"generated_quantities\"},{\"name\":\"gq_cfcov_33_ar\",\"type\":{\"name\":\"array\",\"length\":" << K << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << 3 << ",\"cols\":" << 3 << "}},\"block\":\"generated_quantities\"},{\"name\":\"indices\",\"type\":{\"name\":\"array\",\"length\":" << 3 << ",\"element_type\":{\"name\":\"int\"}},\"block\":\"generated_quantities\"},{\"name\":\"indexing_mat\",\"type\":{\"name\":\"array\",\"length\":" << 5 << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << 3 << ",\"cols\":" << 4 << "}},\"block\":\"generated_quantities\"},{\"name\":\"idx_res1\",\"type\":{\"name\":\"array\",\"length\":" << 3 << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << 3 << ",\"cols\":" << 4 << "}},\"block\":\"generated_quantities\"},{\"name\":\"idx_res2\",\"type\":{\"name\":\"array\",\"length\":" << 5 << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << 3 << ",\"cols\":" << 4 << "}},\"block\":\"generated_quantities\"},{\"name\":\"idx_res3\",\"type\":{\"name\":\"array\",\"length\":" << 3 << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << 3 << ",\"cols\":" << 3 << "}},\"block\":\"generated_quantities\"},{\"name\":\"idx_res11\",\"type\":{\"name\":\"array\",\"length\":" << 3 << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << 3 << ",\"cols\":" << 4 << "}},\"block\":\"generated_quantities\"},{\"name\":\"idx_res21\",\"type\":{\"name\":\"array\",\"length\":" << 5 << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << 3 << ",\"cols\":" << 4 << "}},\"block\":\"generated_quantities\"},{\"name\":\"idx_res31\",\"type\":{\"name\":\"array\",\"length\":" << 3 << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << 3 << ",\"cols\":" << 3 << "}},\"block\":\"generated_quantities\"},{\"name\":\"idx_res4\",\"type\":{\"name\":\"array\",\"length\":" << 3 << ",\"element_type\":{\"name\":\"vector\",\"length\":" << 4 << "}},\"block\":\"generated_quantities\"},{\"name\":\"idx_res5\",\"type\":{\"name\":\"array\",\"length\":" << 2 << ",\"element_type\":{\"name\":\"vector\",\"length\":" << 2 << "}},\"block\":\"generated_quantities\"}]"; - return s__.str(); + inline std::string get_constrained_sizedtypes() const final { + + return std::string("[{\"name\":\"p_real\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"p_upper\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"p_lower\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"offset_multiplier\",\"type\":{\"name\":\"array\",\"length\":" << 5 << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"no_offset_multiplier\",\"type\":{\"name\":\"array\",\"length\":" << 5 << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"offset_no_multiplier\",\"type\":{\"name\":\"array\",\"length\":" << 5 << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"p_real_1d_ar\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"p_real_3d_ar\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << M << ",\"element_type\":{\"name\":\"array\",\"length\":" << K << ",\"element_type\":{\"name\":\"real\"}}}},\"block\":\"parameters\"},{\"name\":\"p_vec\",\"type\":{\"name\":\"vector\",\"length\":" << N << "},\"block\":\"parameters\"},{\"name\":\"p_1d_vec\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}},\"block\":\"parameters\"},{\"name\":\"p_3d_vec\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << M << ",\"element_type\":{\"name\":\"array\",\"length\":" << K << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}}}},\"block\":\"parameters\"},{\"name\":\"p_row_vec\",\"type\":{\"name\":\"vector\",\"length\":" << N << "},\"block\":\"parameters\"},{\"name\":\"p_1d_row_vec\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}},\"block\":\"parameters\"},{\"name\":\"p_3d_row_vec\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << M << ",\"element_type\":{\"name\":\"array\",\"length\":" << K << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}}}},\"block\":\"parameters\"},{\"name\":\"p_ar_mat\",\"type\":{\"name\":\"array\",\"length\":" << 4 << ",\"element_type\":{\"name\":\"array\",\"length\":" << 5 << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << 2 << ",\"cols\":" << 3 << "}}},\"block\":\"parameters\"},{\"name\":\"p_simplex\",\"type\":{\"name\":\"vector\",\"length\":" << N << "},\"block\":\"parameters\"},{\"name\":\"p_1d_simplex\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}},\"block\":\"parameters\"},{\"name\":\"p_3d_simplex\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << M << ",\"element_type\":{\"name\":\"array\",\"length\":" << K << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}}}},\"block\":\"parameters\"},{\"name\":\"p_cfcov_54\",\"type\":{\"name\":\"matrix\",\"rows\":" << 5 << ",\"cols\":" << 4 << "},\"block\":\"parameters\"},{\"name\":\"p_cfcov_33\",\"type\":{\"name\":\"matrix\",\"rows\":" << 3 << ",\"cols\":" << 3 << "},\"block\":\"parameters\"},{\"name\":\"p_cfcov_33_ar\",\"type\":{\"name\":\"array\",\"length\":" << K << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << 3 << ",\"cols\":" << 3 << "}},\"block\":\"parameters\"},{\"name\":\"x_p\",\"type\":{\"name\":\"vector\",\"length\":" << 2 << "},\"block\":\"parameters\"},{\"name\":\"y_p\",\"type\":{\"name\":\"vector\",\"length\":" << 2 << "},\"block\":\"parameters\"},{\"name\":\"tp_real_1d_ar\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_real_3d_ar\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << M << ",\"element_type\":{\"name\":\"array\",\"length\":" << K << ",\"element_type\":{\"name\":\"real\"}}}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_vec\",\"type\":{\"name\":\"vector\",\"length\":" << N << "},\"block\":\"transformed_parameters\"},{\"name\":\"tp_1d_vec\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_3d_vec\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << M << ",\"element_type\":{\"name\":\"array\",\"length\":" << K << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}}}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_row_vec\",\"type\":{\"name\":\"vector\",\"length\":" << N << "},\"block\":\"transformed_parameters\"},{\"name\":\"tp_1d_row_vec\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_3d_row_vec\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << M << ",\"element_type\":{\"name\":\"array\",\"length\":" << K << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}}}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_ar_mat\",\"type\":{\"name\":\"array\",\"length\":" << 4 << ",\"element_type\":{\"name\":\"array\",\"length\":" << 5 << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << 2 << ",\"cols\":" << 3 << "}}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_simplex\",\"type\":{\"name\":\"vector\",\"length\":" << N << "},\"block\":\"transformed_parameters\"},{\"name\":\"tp_1d_simplex\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_3d_simplex\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << M << ",\"element_type\":{\"name\":\"array\",\"length\":" << K << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}}}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_cfcov_54\",\"type\":{\"name\":\"matrix\",\"rows\":" << 5 << ",\"cols\":" << 4 << "},\"block\":\"transformed_parameters\"},{\"name\":\"tp_cfcov_33\",\"type\":{\"name\":\"matrix\",\"rows\":" << 3 << ",\"cols\":" << 3 << "},\"block\":\"transformed_parameters\"},{\"name\":\"tp_cfcov_33_ar\",\"type\":{\"name\":\"array\",\"length\":" << K << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << 3 << ",\"cols\":" << 3 << "}},\"block\":\"transformed_parameters\"},{\"name\":\"theta_p\",\"type\":{\"name\":\"vector\",\"length\":" << 2 << "},\"block\":\"transformed_parameters\"},{\"name\":\"tp_real\",\"type\":{\"name\":\"real\"},\"block\":\"transformed_parameters\"},{\"name\":\"gq_r1\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"gq_r2\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"gq_real_1d_ar\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"generated_quantities\"},{\"name\":\"gq_real_3d_ar\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << M << ",\"element_type\":{\"name\":\"array\",\"length\":" << K << ",\"element_type\":{\"name\":\"real\"}}}},\"block\":\"generated_quantities\"},{\"name\":\"gq_vec\",\"type\":{\"name\":\"vector\",\"length\":" << N << "},\"block\":\"generated_quantities\"},{\"name\":\"gq_1d_vec\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}},\"block\":\"generated_quantities\"},{\"name\":\"gq_3d_vec\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << M << ",\"element_type\":{\"name\":\"array\",\"length\":" << K << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}}}},\"block\":\"generated_quantities\"},{\"name\":\"gq_row_vec\",\"type\":{\"name\":\"vector\",\"length\":" << N << "},\"block\":\"generated_quantities\"},{\"name\":\"gq_1d_row_vec\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}},\"block\":\"generated_quantities\"},{\"name\":\"gq_3d_row_vec\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << M << ",\"element_type\":{\"name\":\"array\",\"length\":" << K << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}}}},\"block\":\"generated_quantities\"},{\"name\":\"gq_ar_mat\",\"type\":{\"name\":\"array\",\"length\":" << 4 << ",\"element_type\":{\"name\":\"array\",\"length\":" << 5 << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << 2 << ",\"cols\":" << 3 << "}}},\"block\":\"generated_quantities\"},{\"name\":\"gq_simplex\",\"type\":{\"name\":\"vector\",\"length\":" << N << "},\"block\":\"generated_quantities\"},{\"name\":\"gq_1d_simplex\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}},\"block\":\"generated_quantities\"},{\"name\":\"gq_3d_simplex\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << M << ",\"element_type\":{\"name\":\"array\",\"length\":" << K << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}}}},\"block\":\"generated_quantities\"},{\"name\":\"gq_cfcov_54\",\"type\":{\"name\":\"matrix\",\"rows\":" << 5 << ",\"cols\":" << 4 << "},\"block\":\"generated_quantities\"},{\"name\":\"gq_cfcov_33\",\"type\":{\"name\":\"matrix\",\"rows\":" << 3 << ",\"cols\":" << 3 << "},\"block\":\"generated_quantities\"},{\"name\":\"gq_cfcov_33_ar\",\"type\":{\"name\":\"array\",\"length\":" << K << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << 3 << ",\"cols\":" << 3 << "}},\"block\":\"generated_quantities\"},{\"name\":\"indices\",\"type\":{\"name\":\"array\",\"length\":" << 3 << ",\"element_type\":{\"name\":\"int\"}},\"block\":\"generated_quantities\"},{\"name\":\"indexing_mat\",\"type\":{\"name\":\"array\",\"length\":" << 5 << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << 3 << ",\"cols\":" << 4 << "}},\"block\":\"generated_quantities\"},{\"name\":\"idx_res1\",\"type\":{\"name\":\"array\",\"length\":" << 3 << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << 3 << ",\"cols\":" << 4 << "}},\"block\":\"generated_quantities\"},{\"name\":\"idx_res2\",\"type\":{\"name\":\"array\",\"length\":" << 5 << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << 3 << ",\"cols\":" << 4 << "}},\"block\":\"generated_quantities\"},{\"name\":\"idx_res3\",\"type\":{\"name\":\"array\",\"length\":" << 3 << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << 3 << ",\"cols\":" << 3 << "}},\"block\":\"generated_quantities\"},{\"name\":\"idx_res11\",\"type\":{\"name\":\"array\",\"length\":" << 3 << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << 3 << ",\"cols\":" << 4 << "}},\"block\":\"generated_quantities\"},{\"name\":\"idx_res21\",\"type\":{\"name\":\"array\",\"length\":" << 5 << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << 3 << ",\"cols\":" << 4 << "}},\"block\":\"generated_quantities\"},{\"name\":\"idx_res31\",\"type\":{\"name\":\"array\",\"length\":" << 3 << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << 3 << ",\"cols\":" << 3 << "}},\"block\":\"generated_quantities\"},{\"name\":\"idx_res4\",\"type\":{\"name\":\"array\",\"length\":" << 3 << ",\"element_type\":{\"name\":\"vector\",\"length\":" << 4 << "}},\"block\":\"generated_quantities\"},{\"name\":\"idx_res5\",\"type\":{\"name\":\"array\",\"length\":" << 2 << ",\"element_type\":{\"name\":\"vector\",\"length\":" << 2 << "}},\"block\":\"generated_quantities\"}]"); } // get_constrained_sizedtypes() - inline std::string get_unconstrained_sizedtypes() const { - std::stringstream s__; - s__ << "[{\"name\":\"p_real\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"p_upper\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"p_lower\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"offset_multiplier\",\"type\":{\"name\":\"array\",\"length\":" << 5 << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"no_offset_multiplier\",\"type\":{\"name\":\"array\",\"length\":" << 5 << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"offset_no_multiplier\",\"type\":{\"name\":\"array\",\"length\":" << 5 << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"p_real_1d_ar\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"p_real_3d_ar\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << M << ",\"element_type\":{\"name\":\"array\",\"length\":" << K << ",\"element_type\":{\"name\":\"real\"}}}},\"block\":\"parameters\"},{\"name\":\"p_vec\",\"type\":{\"name\":\"vector\",\"length\":" << N << "},\"block\":\"parameters\"},{\"name\":\"p_1d_vec\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}},\"block\":\"parameters\"},{\"name\":\"p_3d_vec\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << M << ",\"element_type\":{\"name\":\"array\",\"length\":" << K << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}}}},\"block\":\"parameters\"},{\"name\":\"p_row_vec\",\"type\":{\"name\":\"vector\",\"length\":" << N << "},\"block\":\"parameters\"},{\"name\":\"p_1d_row_vec\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}},\"block\":\"parameters\"},{\"name\":\"p_3d_row_vec\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << M << ",\"element_type\":{\"name\":\"array\",\"length\":" << K << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}}}},\"block\":\"parameters\"},{\"name\":\"p_ar_mat\",\"type\":{\"name\":\"array\",\"length\":" << 4 << ",\"element_type\":{\"name\":\"array\",\"length\":" << 5 << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << 2 << ",\"cols\":" << 3 << "}}},\"block\":\"parameters\"},{\"name\":\"p_simplex\",\"type\":{\"name\":\"vector\",\"length\":" << (N - 1) << "},\"block\":\"parameters\"},{\"name\":\"p_1d_simplex\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << (N - 1) << "}},\"block\":\"parameters\"},{\"name\":\"p_3d_simplex\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << M << ",\"element_type\":{\"name\":\"array\",\"length\":" << K << ",\"element_type\":{\"name\":\"vector\",\"length\":" << (N - 1) << "}}}},\"block\":\"parameters\"},{\"name\":\"p_cfcov_54\",\"type\":{\"name\":\"vector\",\"length\":" << ((((4 * (4 - 1)) / 2) + 4) + ((5 - 4) * 4)) << "},\"block\":\"parameters\"},{\"name\":\"p_cfcov_33\",\"type\":{\"name\":\"vector\",\"length\":" << ((((3 * (3 - 1)) / 2) + 3) + ((3 - 3) * 3)) << "},\"block\":\"parameters\"},{\"name\":\"p_cfcov_33_ar\",\"type\":{\"name\":\"array\",\"length\":" << K << ",\"element_type\":{\"name\":\"vector\",\"length\":" << ((((3 * (3 - 1)) / 2) + 3) + ((3 - 3) * 3)) << "}},\"block\":\"parameters\"},{\"name\":\"x_p\",\"type\":{\"name\":\"vector\",\"length\":" << 2 << "},\"block\":\"parameters\"},{\"name\":\"y_p\",\"type\":{\"name\":\"vector\",\"length\":" << 2 << "},\"block\":\"parameters\"},{\"name\":\"tp_real_1d_ar\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_real_3d_ar\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << M << ",\"element_type\":{\"name\":\"array\",\"length\":" << K << ",\"element_type\":{\"name\":\"real\"}}}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_vec\",\"type\":{\"name\":\"vector\",\"length\":" << N << "},\"block\":\"transformed_parameters\"},{\"name\":\"tp_1d_vec\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_3d_vec\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << M << ",\"element_type\":{\"name\":\"array\",\"length\":" << K << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}}}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_row_vec\",\"type\":{\"name\":\"vector\",\"length\":" << N << "},\"block\":\"transformed_parameters\"},{\"name\":\"tp_1d_row_vec\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_3d_row_vec\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << M << ",\"element_type\":{\"name\":\"array\",\"length\":" << K << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}}}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_ar_mat\",\"type\":{\"name\":\"array\",\"length\":" << 4 << ",\"element_type\":{\"name\":\"array\",\"length\":" << 5 << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << 2 << ",\"cols\":" << 3 << "}}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_simplex\",\"type\":{\"name\":\"vector\",\"length\":" << (N - 1) << "},\"block\":\"transformed_parameters\"},{\"name\":\"tp_1d_simplex\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << (N - 1) << "}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_3d_simplex\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << M << ",\"element_type\":{\"name\":\"array\",\"length\":" << K << ",\"element_type\":{\"name\":\"vector\",\"length\":" << (N - 1) << "}}}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_cfcov_54\",\"type\":{\"name\":\"vector\",\"length\":" << ((((4 * (4 - 1)) / 2) + 4) + ((5 - 4) * 4)) << "},\"block\":\"transformed_parameters\"},{\"name\":\"tp_cfcov_33\",\"type\":{\"name\":\"vector\",\"length\":" << ((((3 * (3 - 1)) / 2) + 3) + ((3 - 3) * 3)) << "},\"block\":\"transformed_parameters\"},{\"name\":\"tp_cfcov_33_ar\",\"type\":{\"name\":\"array\",\"length\":" << K << ",\"element_type\":{\"name\":\"vector\",\"length\":" << ((((3 * (3 - 1)) / 2) + 3) + ((3 - 3) * 3)) << "}},\"block\":\"transformed_parameters\"},{\"name\":\"theta_p\",\"type\":{\"name\":\"vector\",\"length\":" << 2 << "},\"block\":\"transformed_parameters\"},{\"name\":\"tp_real\",\"type\":{\"name\":\"real\"},\"block\":\"transformed_parameters\"},{\"name\":\"gq_r1\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"gq_r2\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"gq_real_1d_ar\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"generated_quantities\"},{\"name\":\"gq_real_3d_ar\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << M << ",\"element_type\":{\"name\":\"array\",\"length\":" << K << ",\"element_type\":{\"name\":\"real\"}}}},\"block\":\"generated_quantities\"},{\"name\":\"gq_vec\",\"type\":{\"name\":\"vector\",\"length\":" << N << "},\"block\":\"generated_quantities\"},{\"name\":\"gq_1d_vec\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}},\"block\":\"generated_quantities\"},{\"name\":\"gq_3d_vec\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << M << ",\"element_type\":{\"name\":\"array\",\"length\":" << K << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}}}},\"block\":\"generated_quantities\"},{\"name\":\"gq_row_vec\",\"type\":{\"name\":\"vector\",\"length\":" << N << "},\"block\":\"generated_quantities\"},{\"name\":\"gq_1d_row_vec\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}},\"block\":\"generated_quantities\"},{\"name\":\"gq_3d_row_vec\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << M << ",\"element_type\":{\"name\":\"array\",\"length\":" << K << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}}}},\"block\":\"generated_quantities\"},{\"name\":\"gq_ar_mat\",\"type\":{\"name\":\"array\",\"length\":" << 4 << ",\"element_type\":{\"name\":\"array\",\"length\":" << 5 << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << 2 << ",\"cols\":" << 3 << "}}},\"block\":\"generated_quantities\"},{\"name\":\"gq_simplex\",\"type\":{\"name\":\"vector\",\"length\":" << (N - 1) << "},\"block\":\"generated_quantities\"},{\"name\":\"gq_1d_simplex\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << (N - 1) << "}},\"block\":\"generated_quantities\"},{\"name\":\"gq_3d_simplex\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << M << ",\"element_type\":{\"name\":\"array\",\"length\":" << K << ",\"element_type\":{\"name\":\"vector\",\"length\":" << (N - 1) << "}}}},\"block\":\"generated_quantities\"},{\"name\":\"gq_cfcov_54\",\"type\":{\"name\":\"vector\",\"length\":" << ((((4 * (4 - 1)) / 2) + 4) + ((5 - 4) * 4)) << "},\"block\":\"generated_quantities\"},{\"name\":\"gq_cfcov_33\",\"type\":{\"name\":\"vector\",\"length\":" << ((((3 * (3 - 1)) / 2) + 3) + ((3 - 3) * 3)) << "},\"block\":\"generated_quantities\"},{\"name\":\"gq_cfcov_33_ar\",\"type\":{\"name\":\"array\",\"length\":" << K << ",\"element_type\":{\"name\":\"vector\",\"length\":" << ((((3 * (3 - 1)) / 2) + 3) + ((3 - 3) * 3)) << "}},\"block\":\"generated_quantities\"},{\"name\":\"indices\",\"type\":{\"name\":\"array\",\"length\":" << 3 << ",\"element_type\":{\"name\":\"int\"}},\"block\":\"generated_quantities\"},{\"name\":\"indexing_mat\",\"type\":{\"name\":\"array\",\"length\":" << 5 << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << 3 << ",\"cols\":" << 4 << "}},\"block\":\"generated_quantities\"},{\"name\":\"idx_res1\",\"type\":{\"name\":\"array\",\"length\":" << 3 << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << 3 << ",\"cols\":" << 4 << "}},\"block\":\"generated_quantities\"},{\"name\":\"idx_res2\",\"type\":{\"name\":\"array\",\"length\":" << 5 << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << 3 << ",\"cols\":" << 4 << "}},\"block\":\"generated_quantities\"},{\"name\":\"idx_res3\",\"type\":{\"name\":\"array\",\"length\":" << 3 << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << 3 << ",\"cols\":" << 3 << "}},\"block\":\"generated_quantities\"},{\"name\":\"idx_res11\",\"type\":{\"name\":\"array\",\"length\":" << 3 << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << 3 << ",\"cols\":" << 4 << "}},\"block\":\"generated_quantities\"},{\"name\":\"idx_res21\",\"type\":{\"name\":\"array\",\"length\":" << 5 << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << 3 << ",\"cols\":" << 4 << "}},\"block\":\"generated_quantities\"},{\"name\":\"idx_res31\",\"type\":{\"name\":\"array\",\"length\":" << 3 << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << 3 << ",\"cols\":" << 3 << "}},\"block\":\"generated_quantities\"},{\"name\":\"idx_res4\",\"type\":{\"name\":\"array\",\"length\":" << 3 << ",\"element_type\":{\"name\":\"vector\",\"length\":" << 4 << "}},\"block\":\"generated_quantities\"},{\"name\":\"idx_res5\",\"type\":{\"name\":\"array\",\"length\":" << 2 << ",\"element_type\":{\"name\":\"vector\",\"length\":" << 2 << "}},\"block\":\"generated_quantities\"}]"; - return s__.str(); + inline std::string get_unconstrained_sizedtypes() const final { + + return std::string("[{\"name\":\"p_real\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"p_upper\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"p_lower\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"offset_multiplier\",\"type\":{\"name\":\"array\",\"length\":" << 5 << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"no_offset_multiplier\",\"type\":{\"name\":\"array\",\"length\":" << 5 << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"offset_no_multiplier\",\"type\":{\"name\":\"array\",\"length\":" << 5 << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"p_real_1d_ar\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"p_real_3d_ar\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << M << ",\"element_type\":{\"name\":\"array\",\"length\":" << K << ",\"element_type\":{\"name\":\"real\"}}}},\"block\":\"parameters\"},{\"name\":\"p_vec\",\"type\":{\"name\":\"vector\",\"length\":" << N << "},\"block\":\"parameters\"},{\"name\":\"p_1d_vec\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}},\"block\":\"parameters\"},{\"name\":\"p_3d_vec\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << M << ",\"element_type\":{\"name\":\"array\",\"length\":" << K << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}}}},\"block\":\"parameters\"},{\"name\":\"p_row_vec\",\"type\":{\"name\":\"vector\",\"length\":" << N << "},\"block\":\"parameters\"},{\"name\":\"p_1d_row_vec\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}},\"block\":\"parameters\"},{\"name\":\"p_3d_row_vec\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << M << ",\"element_type\":{\"name\":\"array\",\"length\":" << K << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}}}},\"block\":\"parameters\"},{\"name\":\"p_ar_mat\",\"type\":{\"name\":\"array\",\"length\":" << 4 << ",\"element_type\":{\"name\":\"array\",\"length\":" << 5 << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << 2 << ",\"cols\":" << 3 << "}}},\"block\":\"parameters\"},{\"name\":\"p_simplex\",\"type\":{\"name\":\"vector\",\"length\":" << (N - 1) << "},\"block\":\"parameters\"},{\"name\":\"p_1d_simplex\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << (N - 1) << "}},\"block\":\"parameters\"},{\"name\":\"p_3d_simplex\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << M << ",\"element_type\":{\"name\":\"array\",\"length\":" << K << ",\"element_type\":{\"name\":\"vector\",\"length\":" << (N - 1) << "}}}},\"block\":\"parameters\"},{\"name\":\"p_cfcov_54\",\"type\":{\"name\":\"vector\",\"length\":" << ((((4 * (4 - 1)) / 2) + 4) + ((5 - 4) * 4)) << "},\"block\":\"parameters\"},{\"name\":\"p_cfcov_33\",\"type\":{\"name\":\"vector\",\"length\":" << ((((3 * (3 - 1)) / 2) + 3) + ((3 - 3) * 3)) << "},\"block\":\"parameters\"},{\"name\":\"p_cfcov_33_ar\",\"type\":{\"name\":\"array\",\"length\":" << K << ",\"element_type\":{\"name\":\"vector\",\"length\":" << ((((3 * (3 - 1)) / 2) + 3) + ((3 - 3) * 3)) << "}},\"block\":\"parameters\"},{\"name\":\"x_p\",\"type\":{\"name\":\"vector\",\"length\":" << 2 << "},\"block\":\"parameters\"},{\"name\":\"y_p\",\"type\":{\"name\":\"vector\",\"length\":" << 2 << "},\"block\":\"parameters\"},{\"name\":\"tp_real_1d_ar\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_real_3d_ar\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << M << ",\"element_type\":{\"name\":\"array\",\"length\":" << K << ",\"element_type\":{\"name\":\"real\"}}}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_vec\",\"type\":{\"name\":\"vector\",\"length\":" << N << "},\"block\":\"transformed_parameters\"},{\"name\":\"tp_1d_vec\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_3d_vec\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << M << ",\"element_type\":{\"name\":\"array\",\"length\":" << K << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}}}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_row_vec\",\"type\":{\"name\":\"vector\",\"length\":" << N << "},\"block\":\"transformed_parameters\"},{\"name\":\"tp_1d_row_vec\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_3d_row_vec\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << M << ",\"element_type\":{\"name\":\"array\",\"length\":" << K << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}}}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_ar_mat\",\"type\":{\"name\":\"array\",\"length\":" << 4 << ",\"element_type\":{\"name\":\"array\",\"length\":" << 5 << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << 2 << ",\"cols\":" << 3 << "}}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_simplex\",\"type\":{\"name\":\"vector\",\"length\":" << (N - 1) << "},\"block\":\"transformed_parameters\"},{\"name\":\"tp_1d_simplex\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << (N - 1) << "}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_3d_simplex\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << M << ",\"element_type\":{\"name\":\"array\",\"length\":" << K << ",\"element_type\":{\"name\":\"vector\",\"length\":" << (N - 1) << "}}}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_cfcov_54\",\"type\":{\"name\":\"vector\",\"length\":" << ((((4 * (4 - 1)) / 2) + 4) + ((5 - 4) * 4)) << "},\"block\":\"transformed_parameters\"},{\"name\":\"tp_cfcov_33\",\"type\":{\"name\":\"vector\",\"length\":" << ((((3 * (3 - 1)) / 2) + 3) + ((3 - 3) * 3)) << "},\"block\":\"transformed_parameters\"},{\"name\":\"tp_cfcov_33_ar\",\"type\":{\"name\":\"array\",\"length\":" << K << ",\"element_type\":{\"name\":\"vector\",\"length\":" << ((((3 * (3 - 1)) / 2) + 3) + ((3 - 3) * 3)) << "}},\"block\":\"transformed_parameters\"},{\"name\":\"theta_p\",\"type\":{\"name\":\"vector\",\"length\":" << 2 << "},\"block\":\"transformed_parameters\"},{\"name\":\"tp_real\",\"type\":{\"name\":\"real\"},\"block\":\"transformed_parameters\"},{\"name\":\"gq_r1\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"gq_r2\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"gq_real_1d_ar\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"generated_quantities\"},{\"name\":\"gq_real_3d_ar\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << M << ",\"element_type\":{\"name\":\"array\",\"length\":" << K << ",\"element_type\":{\"name\":\"real\"}}}},\"block\":\"generated_quantities\"},{\"name\":\"gq_vec\",\"type\":{\"name\":\"vector\",\"length\":" << N << "},\"block\":\"generated_quantities\"},{\"name\":\"gq_1d_vec\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}},\"block\":\"generated_quantities\"},{\"name\":\"gq_3d_vec\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << M << ",\"element_type\":{\"name\":\"array\",\"length\":" << K << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}}}},\"block\":\"generated_quantities\"},{\"name\":\"gq_row_vec\",\"type\":{\"name\":\"vector\",\"length\":" << N << "},\"block\":\"generated_quantities\"},{\"name\":\"gq_1d_row_vec\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}},\"block\":\"generated_quantities\"},{\"name\":\"gq_3d_row_vec\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << M << ",\"element_type\":{\"name\":\"array\",\"length\":" << K << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}}}},\"block\":\"generated_quantities\"},{\"name\":\"gq_ar_mat\",\"type\":{\"name\":\"array\",\"length\":" << 4 << ",\"element_type\":{\"name\":\"array\",\"length\":" << 5 << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << 2 << ",\"cols\":" << 3 << "}}},\"block\":\"generated_quantities\"},{\"name\":\"gq_simplex\",\"type\":{\"name\":\"vector\",\"length\":" << (N - 1) << "},\"block\":\"generated_quantities\"},{\"name\":\"gq_1d_simplex\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << (N - 1) << "}},\"block\":\"generated_quantities\"},{\"name\":\"gq_3d_simplex\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << M << ",\"element_type\":{\"name\":\"array\",\"length\":" << K << ",\"element_type\":{\"name\":\"vector\",\"length\":" << (N - 1) << "}}}},\"block\":\"generated_quantities\"},{\"name\":\"gq_cfcov_54\",\"type\":{\"name\":\"vector\",\"length\":" << ((((4 * (4 - 1)) / 2) + 4) + ((5 - 4) * 4)) << "},\"block\":\"generated_quantities\"},{\"name\":\"gq_cfcov_33\",\"type\":{\"name\":\"vector\",\"length\":" << ((((3 * (3 - 1)) / 2) + 3) + ((3 - 3) * 3)) << "},\"block\":\"generated_quantities\"},{\"name\":\"gq_cfcov_33_ar\",\"type\":{\"name\":\"array\",\"length\":" << K << ",\"element_type\":{\"name\":\"vector\",\"length\":" << ((((3 * (3 - 1)) / 2) + 3) + ((3 - 3) * 3)) << "}},\"block\":\"generated_quantities\"},{\"name\":\"indices\",\"type\":{\"name\":\"array\",\"length\":" << 3 << ",\"element_type\":{\"name\":\"int\"}},\"block\":\"generated_quantities\"},{\"name\":\"indexing_mat\",\"type\":{\"name\":\"array\",\"length\":" << 5 << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << 3 << ",\"cols\":" << 4 << "}},\"block\":\"generated_quantities\"},{\"name\":\"idx_res1\",\"type\":{\"name\":\"array\",\"length\":" << 3 << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << 3 << ",\"cols\":" << 4 << "}},\"block\":\"generated_quantities\"},{\"name\":\"idx_res2\",\"type\":{\"name\":\"array\",\"length\":" << 5 << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << 3 << ",\"cols\":" << 4 << "}},\"block\":\"generated_quantities\"},{\"name\":\"idx_res3\",\"type\":{\"name\":\"array\",\"length\":" << 3 << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << 3 << ",\"cols\":" << 3 << "}},\"block\":\"generated_quantities\"},{\"name\":\"idx_res11\",\"type\":{\"name\":\"array\",\"length\":" << 3 << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << 3 << ",\"cols\":" << 4 << "}},\"block\":\"generated_quantities\"},{\"name\":\"idx_res21\",\"type\":{\"name\":\"array\",\"length\":" << 5 << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << 3 << ",\"cols\":" << 4 << "}},\"block\":\"generated_quantities\"},{\"name\":\"idx_res31\",\"type\":{\"name\":\"array\",\"length\":" << 3 << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << 3 << ",\"cols\":" << 3 << "}},\"block\":\"generated_quantities\"},{\"name\":\"idx_res4\",\"type\":{\"name\":\"array\",\"length\":" << 3 << ",\"element_type\":{\"name\":\"vector\",\"length\":" << 4 << "}},\"block\":\"generated_quantities\"},{\"name\":\"idx_res5\",\"type\":{\"name\":\"array\",\"length\":" << 2 << ",\"element_type\":{\"name\":\"vector\",\"length\":" << 2 << "}},\"block\":\"generated_quantities\"}]"); } // get_unconstrained_sizedtypes() @@ -11785,88 +11635,62 @@ class motherHOF_model final : public model_base_crtp { inline void get_param_names(std::vector& names__) const { - names__.clear(); - names__.emplace_back("y0_p"); - names__.emplace_back("theta_p"); - names__.emplace_back("x_p"); - names__.emplace_back("x_p_v"); - names__.emplace_back("shared_params_p"); - names__.emplace_back("job_params_p"); - names__.emplace_back("x_r"); - names__.emplace_back("abc1_p"); - names__.emplace_back("abc2_p"); - names__.emplace_back("abc3_p"); - names__.emplace_back("y_hat_tp1"); - names__.emplace_back("y_hat_tp2"); - names__.emplace_back("y_hat_tp3"); - names__.emplace_back("theta_p_as"); - names__.emplace_back("x_v"); - names__.emplace_back("y_v"); - names__.emplace_back("y_p"); - names__.emplace_back("y_hat"); - names__.emplace_back("y_1d"); - names__.emplace_back("z_1d"); - names__.emplace_back("abc1_gq"); - names__.emplace_back("abc2_gq"); - names__.emplace_back("y_hat_gq"); - names__.emplace_back("yy_hat_gq"); - names__.emplace_back("theta_dbl"); + names__ = std::vector{"y0_p", + "theta_p", + "x_p", + "x_p_v", + "shared_params_p", + "job_params_p", + "x_r", + "abc1_p", + "abc2_p", + "abc3_p", + "y_hat_tp1", + "y_hat_tp2", + "y_hat_tp3", + "theta_p_as", + "x_v", + "y_v", + "y_p", + "y_hat", + "y_1d", + "z_1d", + "abc1_gq", + "abc2_gq", + "y_hat_gq", + "yy_hat_gq", + "theta_dbl"}; } // get_param_names() inline void get_dims(std::vector>& dimss__) const { - dimss__.clear(); - dimss__.emplace_back(std::vector{static_cast(2)}); - - dimss__.emplace_back(std::vector{static_cast(1)}); - - dimss__.emplace_back(std::vector{static_cast(1)}); - - dimss__.emplace_back(std::vector{static_cast(2)}); - - dimss__.emplace_back(std::vector{static_cast(3)}); - - dimss__.emplace_back(std::vector{static_cast(3), - static_cast(3)}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{static_cast(3)}); - - dimss__.emplace_back(std::vector{static_cast(3)}); - - dimss__.emplace_back(std::vector{static_cast(3)}); - - dimss__.emplace_back(std::vector{static_cast(2)}); - - dimss__.emplace_back(std::vector{static_cast(2)}); - - dimss__.emplace_back(std::vector{static_cast(2)}); - - dimss__.emplace_back(std::vector{static_cast(2)}); - - dimss__.emplace_back(std::vector{static_cast(T), - static_cast(2)}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{static_cast(3)}); - - dimss__.emplace_back(std::vector{static_cast(3)}); - - dimss__.emplace_back(std::vector{static_cast(2)}); + dimss__ = std::vector>{std::vector{ + static_cast(2) + }, + std::vector{static_cast(1)}, + std::vector{static_cast(1)}, + std::vector{static_cast(2)}, + std::vector{static_cast(3)}, + std::vector{static_cast(3), static_cast(3)}, + std::vector{}, + std::vector{}, + std::vector{}, + std::vector{}, + std::vector{static_cast(3)}, + std::vector{static_cast(3)}, + std::vector{static_cast(3)}, + std::vector{static_cast(2)}, + std::vector{static_cast(2)}, + std::vector{static_cast(2)}, + std::vector{static_cast(2)}, + std::vector{static_cast(T), static_cast(2)}, + std::vector{}, + std::vector{}, + std::vector{}, + std::vector{}, + std::vector{static_cast(3)}, + std::vector{static_cast(3)}, + std::vector{static_cast(2)}}; } // get_dims() inline void constrained_param_names( @@ -12061,16 +11885,14 @@ class motherHOF_model final : public model_base_crtp { } // unconstrained_param_names() - inline std::string get_constrained_sizedtypes() const { - std::stringstream s__; - s__ << "[{\"name\":\"y0_p\",\"type\":{\"name\":\"array\",\"length\":" << 2 << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"theta_p\",\"type\":{\"name\":\"array\",\"length\":" << 1 << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"x_p\",\"type\":{\"name\":\"array\",\"length\":" << 1 << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"x_p_v\",\"type\":{\"name\":\"vector\",\"length\":" << 2 << "},\"block\":\"parameters\"},{\"name\":\"shared_params_p\",\"type\":{\"name\":\"vector\",\"length\":" << 3 << "},\"block\":\"parameters\"},{\"name\":\"job_params_p\",\"type\":{\"name\":\"array\",\"length\":" << 3 << ",\"element_type\":{\"name\":\"vector\",\"length\":" << 3 << "}},\"block\":\"parameters\"},{\"name\":\"x_r\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"abc1_p\",\"type\":{\"name\":\"real\"},\"block\":\"transformed_parameters\"},{\"name\":\"abc2_p\",\"type\":{\"name\":\"real\"},\"block\":\"transformed_parameters\"},{\"name\":\"abc3_p\",\"type\":{\"name\":\"real\"},\"block\":\"transformed_parameters\"},{\"name\":\"y_hat_tp1\",\"type\":{\"name\":\"vector\",\"length\":" << 3 << "},\"block\":\"transformed_parameters\"},{\"name\":\"y_hat_tp2\",\"type\":{\"name\":\"vector\",\"length\":" << 3 << "},\"block\":\"transformed_parameters\"},{\"name\":\"y_hat_tp3\",\"type\":{\"name\":\"vector\",\"length\":" << 3 << "},\"block\":\"transformed_parameters\"},{\"name\":\"theta_p_as\",\"type\":{\"name\":\"vector\",\"length\":" << 2 << "},\"block\":\"transformed_parameters\"},{\"name\":\"x_v\",\"type\":{\"name\":\"vector\",\"length\":" << 2 << "},\"block\":\"transformed_parameters\"},{\"name\":\"y_v\",\"type\":{\"name\":\"vector\",\"length\":" << 2 << "},\"block\":\"transformed_parameters\"},{\"name\":\"y_p\",\"type\":{\"name\":\"vector\",\"length\":" << 2 << "},\"block\":\"transformed_parameters\"},{\"name\":\"y_hat\",\"type\":{\"name\":\"array\",\"length\":" << T << ",\"element_type\":{\"name\":\"array\",\"length\":" << 2 << ",\"element_type\":{\"name\":\"real\"}}},\"block\":\"generated_quantities\"},{\"name\":\"y_1d\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"z_1d\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"abc1_gq\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"abc2_gq\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"y_hat_gq\",\"type\":{\"name\":\"vector\",\"length\":" << 3 << "},\"block\":\"generated_quantities\"},{\"name\":\"yy_hat_gq\",\"type\":{\"name\":\"vector\",\"length\":" << 3 << "},\"block\":\"generated_quantities\"},{\"name\":\"theta_dbl\",\"type\":{\"name\":\"vector\",\"length\":" << 2 << "},\"block\":\"generated_quantities\"}]"; - return s__.str(); + inline std::string get_constrained_sizedtypes() const final { + + return std::string("[{\"name\":\"y0_p\",\"type\":{\"name\":\"array\",\"length\":" << 2 << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"theta_p\",\"type\":{\"name\":\"array\",\"length\":" << 1 << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"x_p\",\"type\":{\"name\":\"array\",\"length\":" << 1 << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"x_p_v\",\"type\":{\"name\":\"vector\",\"length\":" << 2 << "},\"block\":\"parameters\"},{\"name\":\"shared_params_p\",\"type\":{\"name\":\"vector\",\"length\":" << 3 << "},\"block\":\"parameters\"},{\"name\":\"job_params_p\",\"type\":{\"name\":\"array\",\"length\":" << 3 << ",\"element_type\":{\"name\":\"vector\",\"length\":" << 3 << "}},\"block\":\"parameters\"},{\"name\":\"x_r\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"abc1_p\",\"type\":{\"name\":\"real\"},\"block\":\"transformed_parameters\"},{\"name\":\"abc2_p\",\"type\":{\"name\":\"real\"},\"block\":\"transformed_parameters\"},{\"name\":\"abc3_p\",\"type\":{\"name\":\"real\"},\"block\":\"transformed_parameters\"},{\"name\":\"y_hat_tp1\",\"type\":{\"name\":\"vector\",\"length\":" << 3 << "},\"block\":\"transformed_parameters\"},{\"name\":\"y_hat_tp2\",\"type\":{\"name\":\"vector\",\"length\":" << 3 << "},\"block\":\"transformed_parameters\"},{\"name\":\"y_hat_tp3\",\"type\":{\"name\":\"vector\",\"length\":" << 3 << "},\"block\":\"transformed_parameters\"},{\"name\":\"theta_p_as\",\"type\":{\"name\":\"vector\",\"length\":" << 2 << "},\"block\":\"transformed_parameters\"},{\"name\":\"x_v\",\"type\":{\"name\":\"vector\",\"length\":" << 2 << "},\"block\":\"transformed_parameters\"},{\"name\":\"y_v\",\"type\":{\"name\":\"vector\",\"length\":" << 2 << "},\"block\":\"transformed_parameters\"},{\"name\":\"y_p\",\"type\":{\"name\":\"vector\",\"length\":" << 2 << "},\"block\":\"transformed_parameters\"},{\"name\":\"y_hat\",\"type\":{\"name\":\"array\",\"length\":" << T << ",\"element_type\":{\"name\":\"array\",\"length\":" << 2 << ",\"element_type\":{\"name\":\"real\"}}},\"block\":\"generated_quantities\"},{\"name\":\"y_1d\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"z_1d\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"abc1_gq\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"abc2_gq\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"y_hat_gq\",\"type\":{\"name\":\"vector\",\"length\":" << 3 << "},\"block\":\"generated_quantities\"},{\"name\":\"yy_hat_gq\",\"type\":{\"name\":\"vector\",\"length\":" << 3 << "},\"block\":\"generated_quantities\"},{\"name\":\"theta_dbl\",\"type\":{\"name\":\"vector\",\"length\":" << 2 << "},\"block\":\"generated_quantities\"}]"); } // get_constrained_sizedtypes() - inline std::string get_unconstrained_sizedtypes() const { - std::stringstream s__; - s__ << "[{\"name\":\"y0_p\",\"type\":{\"name\":\"array\",\"length\":" << 2 << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"theta_p\",\"type\":{\"name\":\"array\",\"length\":" << 1 << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"x_p\",\"type\":{\"name\":\"array\",\"length\":" << 1 << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"x_p_v\",\"type\":{\"name\":\"vector\",\"length\":" << 2 << "},\"block\":\"parameters\"},{\"name\":\"shared_params_p\",\"type\":{\"name\":\"vector\",\"length\":" << 3 << "},\"block\":\"parameters\"},{\"name\":\"job_params_p\",\"type\":{\"name\":\"array\",\"length\":" << 3 << ",\"element_type\":{\"name\":\"vector\",\"length\":" << 3 << "}},\"block\":\"parameters\"},{\"name\":\"x_r\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"abc1_p\",\"type\":{\"name\":\"real\"},\"block\":\"transformed_parameters\"},{\"name\":\"abc2_p\",\"type\":{\"name\":\"real\"},\"block\":\"transformed_parameters\"},{\"name\":\"abc3_p\",\"type\":{\"name\":\"real\"},\"block\":\"transformed_parameters\"},{\"name\":\"y_hat_tp1\",\"type\":{\"name\":\"vector\",\"length\":" << 3 << "},\"block\":\"transformed_parameters\"},{\"name\":\"y_hat_tp2\",\"type\":{\"name\":\"vector\",\"length\":" << 3 << "},\"block\":\"transformed_parameters\"},{\"name\":\"y_hat_tp3\",\"type\":{\"name\":\"vector\",\"length\":" << 3 << "},\"block\":\"transformed_parameters\"},{\"name\":\"theta_p_as\",\"type\":{\"name\":\"vector\",\"length\":" << 2 << "},\"block\":\"transformed_parameters\"},{\"name\":\"x_v\",\"type\":{\"name\":\"vector\",\"length\":" << 2 << "},\"block\":\"transformed_parameters\"},{\"name\":\"y_v\",\"type\":{\"name\":\"vector\",\"length\":" << 2 << "},\"block\":\"transformed_parameters\"},{\"name\":\"y_p\",\"type\":{\"name\":\"vector\",\"length\":" << 2 << "},\"block\":\"transformed_parameters\"},{\"name\":\"y_hat\",\"type\":{\"name\":\"array\",\"length\":" << T << ",\"element_type\":{\"name\":\"array\",\"length\":" << 2 << ",\"element_type\":{\"name\":\"real\"}}},\"block\":\"generated_quantities\"},{\"name\":\"y_1d\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"z_1d\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"abc1_gq\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"abc2_gq\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"y_hat_gq\",\"type\":{\"name\":\"vector\",\"length\":" << 3 << "},\"block\":\"generated_quantities\"},{\"name\":\"yy_hat_gq\",\"type\":{\"name\":\"vector\",\"length\":" << 3 << "},\"block\":\"generated_quantities\"},{\"name\":\"theta_dbl\",\"type\":{\"name\":\"vector\",\"length\":" << 2 << "},\"block\":\"generated_quantities\"}]"; - return s__.str(); + inline std::string get_unconstrained_sizedtypes() const final { + + return std::string("[{\"name\":\"y0_p\",\"type\":{\"name\":\"array\",\"length\":" << 2 << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"theta_p\",\"type\":{\"name\":\"array\",\"length\":" << 1 << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"x_p\",\"type\":{\"name\":\"array\",\"length\":" << 1 << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"x_p_v\",\"type\":{\"name\":\"vector\",\"length\":" << 2 << "},\"block\":\"parameters\"},{\"name\":\"shared_params_p\",\"type\":{\"name\":\"vector\",\"length\":" << 3 << "},\"block\":\"parameters\"},{\"name\":\"job_params_p\",\"type\":{\"name\":\"array\",\"length\":" << 3 << ",\"element_type\":{\"name\":\"vector\",\"length\":" << 3 << "}},\"block\":\"parameters\"},{\"name\":\"x_r\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"abc1_p\",\"type\":{\"name\":\"real\"},\"block\":\"transformed_parameters\"},{\"name\":\"abc2_p\",\"type\":{\"name\":\"real\"},\"block\":\"transformed_parameters\"},{\"name\":\"abc3_p\",\"type\":{\"name\":\"real\"},\"block\":\"transformed_parameters\"},{\"name\":\"y_hat_tp1\",\"type\":{\"name\":\"vector\",\"length\":" << 3 << "},\"block\":\"transformed_parameters\"},{\"name\":\"y_hat_tp2\",\"type\":{\"name\":\"vector\",\"length\":" << 3 << "},\"block\":\"transformed_parameters\"},{\"name\":\"y_hat_tp3\",\"type\":{\"name\":\"vector\",\"length\":" << 3 << "},\"block\":\"transformed_parameters\"},{\"name\":\"theta_p_as\",\"type\":{\"name\":\"vector\",\"length\":" << 2 << "},\"block\":\"transformed_parameters\"},{\"name\":\"x_v\",\"type\":{\"name\":\"vector\",\"length\":" << 2 << "},\"block\":\"transformed_parameters\"},{\"name\":\"y_v\",\"type\":{\"name\":\"vector\",\"length\":" << 2 << "},\"block\":\"transformed_parameters\"},{\"name\":\"y_p\",\"type\":{\"name\":\"vector\",\"length\":" << 2 << "},\"block\":\"transformed_parameters\"},{\"name\":\"y_hat\",\"type\":{\"name\":\"array\",\"length\":" << T << ",\"element_type\":{\"name\":\"array\",\"length\":" << 2 << ",\"element_type\":{\"name\":\"real\"}}},\"block\":\"generated_quantities\"},{\"name\":\"y_1d\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"z_1d\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"abc1_gq\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"abc2_gq\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"y_hat_gq\",\"type\":{\"name\":\"vector\",\"length\":" << 3 << "},\"block\":\"generated_quantities\"},{\"name\":\"yy_hat_gq\",\"type\":{\"name\":\"vector\",\"length\":" << 3 << "},\"block\":\"generated_quantities\"},{\"name\":\"theta_dbl\",\"type\":{\"name\":\"vector\",\"length\":" << 2 << "},\"block\":\"generated_quantities\"}]"); } // get_unconstrained_sizedtypes() @@ -16124,28 +15946,20 @@ class new_integrate_interface_model final : public model_base_crtp& names__) const { - names__.clear(); - names__.emplace_back("r"); - names__.emplace_back("ra"); - names__.emplace_back("v"); - names__.emplace_back("z"); - names__.emplace_back("zg"); + names__ = std::vector{"r", + "ra", + "v", + "z", + "zg"}; } // get_param_names() inline void get_dims(std::vector>& dimss__) const { - dimss__.clear(); - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{static_cast(N)}); - - dimss__.emplace_back(std::vector{static_cast(N)}); - - dimss__.emplace_back(std::vector{static_cast(N), - static_cast(N)}); - - dimss__.emplace_back(std::vector{static_cast(N), - static_cast(N)}); + dimss__ = std::vector>{std::vector{}, + std::vector{static_cast(N)}, + std::vector{static_cast(N)}, + std::vector{static_cast(N), static_cast(N)}, + std::vector{static_cast(N), static_cast(N)}}; } // get_dims() inline void constrained_param_names( @@ -16222,16 +16036,14 @@ class new_integrate_interface_model final : public model_base_crtp& names__) const { - names__.clear(); - names__.emplace_back("alpha"); - names__.emplace_back("beta"); - names__.emplace_back("gamma"); - names__.emplace_back("delta"); - names__.emplace_back("z_init"); - names__.emplace_back("sigma"); - names__.emplace_back("z"); + names__ = std::vector{"alpha", + "beta", + "gamma", + "delta", + "z_init", + "sigma", + "z"}; } // get_param_names() inline void get_dims(std::vector>& dimss__) const { - dimss__.clear(); - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{static_cast(2)}); - - dimss__.emplace_back(std::vector{static_cast(2)}); - - dimss__.emplace_back(std::vector{static_cast(N), - static_cast(2)}); + dimss__ = std::vector>{std::vector{}, + std::vector{}, + std::vector{}, + std::vector{}, + std::vector{static_cast(2)}, + std::vector{static_cast(2)}, + std::vector{static_cast(N), static_cast(2)}}; } // get_dims() inline void constrained_param_names( @@ -16959,16 +16762,14 @@ class old_integrate_interface_model final : public model_base_crtp { inline void get_param_names(std::vector& names__) const { - names__.clear(); - names__.emplace_back("alpha_v"); - names__.emplace_back("beta"); - names__.emplace_back("cuts"); - names__.emplace_back("sigma"); - names__.emplace_back("alpha"); - names__.emplace_back("phi"); - names__.emplace_back("X_p"); - names__.emplace_back("beta_m"); - names__.emplace_back("X_rv_p"); + names__ = std::vector{"alpha_v", + "beta", + "cuts", + "sigma", + "alpha", + "phi", + "X_p", + "beta_m", + "X_rv_p"}; } // get_param_names() inline void get_dims(std::vector>& dimss__) const { - dimss__.clear(); - dimss__.emplace_back(std::vector{static_cast(k)}); - - dimss__.emplace_back(std::vector{static_cast(k)}); - - dimss__.emplace_back(std::vector{static_cast(k)}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{static_cast(n), - static_cast(k)}); - - dimss__.emplace_back(std::vector{static_cast(n), - static_cast(k)}); - - dimss__.emplace_back(std::vector{static_cast(n)}); + dimss__ = std::vector>{std::vector{ + static_cast(k) + }, + std::vector{static_cast(k)}, + std::vector{static_cast(k)}, + std::vector{}, + std::vector{}, + std::vector{}, + std::vector{static_cast(n), static_cast(k)}, + std::vector{static_cast(n), static_cast(k)}, + std::vector{static_cast(n)}}; } // get_dims() inline void constrained_param_names( @@ -18631,16 +18422,14 @@ class optimize_glm_model final : public model_base_crtp { } // unconstrained_param_names() - inline std::string get_constrained_sizedtypes() const { - std::stringstream s__; - s__ << "[{\"name\":\"alpha_v\",\"type\":{\"name\":\"vector\",\"length\":" << k << "},\"block\":\"parameters\"},{\"name\":\"beta\",\"type\":{\"name\":\"vector\",\"length\":" << k << "},\"block\":\"parameters\"},{\"name\":\"cuts\",\"type\":{\"name\":\"vector\",\"length\":" << k << "},\"block\":\"parameters\"},{\"name\":\"sigma\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"alpha\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"phi\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"X_p\",\"type\":{\"name\":\"matrix\",\"rows\":" << n << ",\"cols\":" << k << "},\"block\":\"parameters\"},{\"name\":\"beta_m\",\"type\":{\"name\":\"matrix\",\"rows\":" << n << ",\"cols\":" << k << "},\"block\":\"parameters\"},{\"name\":\"X_rv_p\",\"type\":{\"name\":\"vector\",\"length\":" << n << "},\"block\":\"parameters\"}]"; - return s__.str(); + inline std::string get_constrained_sizedtypes() const final { + + return std::string("[{\"name\":\"alpha_v\",\"type\":{\"name\":\"vector\",\"length\":" << k << "},\"block\":\"parameters\"},{\"name\":\"beta\",\"type\":{\"name\":\"vector\",\"length\":" << k << "},\"block\":\"parameters\"},{\"name\":\"cuts\",\"type\":{\"name\":\"vector\",\"length\":" << k << "},\"block\":\"parameters\"},{\"name\":\"sigma\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"alpha\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"phi\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"X_p\",\"type\":{\"name\":\"matrix\",\"rows\":" << n << ",\"cols\":" << k << "},\"block\":\"parameters\"},{\"name\":\"beta_m\",\"type\":{\"name\":\"matrix\",\"rows\":" << n << ",\"cols\":" << k << "},\"block\":\"parameters\"},{\"name\":\"X_rv_p\",\"type\":{\"name\":\"vector\",\"length\":" << n << "},\"block\":\"parameters\"}]"); } // get_constrained_sizedtypes() - inline std::string get_unconstrained_sizedtypes() const { - std::stringstream s__; - s__ << "[{\"name\":\"alpha_v\",\"type\":{\"name\":\"vector\",\"length\":" << k << "},\"block\":\"parameters\"},{\"name\":\"beta\",\"type\":{\"name\":\"vector\",\"length\":" << k << "},\"block\":\"parameters\"},{\"name\":\"cuts\",\"type\":{\"name\":\"vector\",\"length\":" << k << "},\"block\":\"parameters\"},{\"name\":\"sigma\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"alpha\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"phi\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"X_p\",\"type\":{\"name\":\"matrix\",\"rows\":" << n << ",\"cols\":" << k << "},\"block\":\"parameters\"},{\"name\":\"beta_m\",\"type\":{\"name\":\"matrix\",\"rows\":" << n << ",\"cols\":" << k << "},\"block\":\"parameters\"},{\"name\":\"X_rv_p\",\"type\":{\"name\":\"vector\",\"length\":" << n << "},\"block\":\"parameters\"}]"; - return s__.str(); + inline std::string get_unconstrained_sizedtypes() const final { + + return std::string("[{\"name\":\"alpha_v\",\"type\":{\"name\":\"vector\",\"length\":" << k << "},\"block\":\"parameters\"},{\"name\":\"beta\",\"type\":{\"name\":\"vector\",\"length\":" << k << "},\"block\":\"parameters\"},{\"name\":\"cuts\",\"type\":{\"name\":\"vector\",\"length\":" << k << "},\"block\":\"parameters\"},{\"name\":\"sigma\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"alpha\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"phi\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"X_p\",\"type\":{\"name\":\"matrix\",\"rows\":" << n << ",\"cols\":" << k << "},\"block\":\"parameters\"},{\"name\":\"beta_m\",\"type\":{\"name\":\"matrix\",\"rows\":" << n << ",\"cols\":" << k << "},\"block\":\"parameters\"},{\"name\":\"X_rv_p\",\"type\":{\"name\":\"vector\",\"length\":" << n << "},\"block\":\"parameters\"}]"); } // get_unconstrained_sizedtypes() @@ -19024,19 +18813,20 @@ class param_constraint_model final : public model_base_crtp& names__) const { - names__.clear(); - names__.emplace_back("L_Omega"); - names__.emplace_back("z1"); + names__ = std::vector{"L_Omega", + "z1"}; } // get_param_names() inline void get_dims(std::vector>& dimss__) const { - dimss__.clear(); - dimss__.emplace_back(std::vector{static_cast(nt), - static_cast(2), - static_cast(2)}); - - dimss__.emplace_back(std::vector{static_cast(NS)}); + dimss__ = std::vector>{std::vector{ + static_cast(nt) + , + static_cast(2) + , + static_cast(2) + }, + std::vector{static_cast(NS)}}; } // get_dims() inline void constrained_param_names( @@ -19096,16 +18886,14 @@ class param_constraint_model final : public model_base_crtp { inline void get_param_names(std::vector& names__) const { - names__.clear(); - names__.emplace_back("y1"); - names__.emplace_back("y2"); - names__.emplace_back("y3"); + names__ = std::vector{"y1", + "y2", + "y3"}; } // get_param_names() inline void get_dims(std::vector>& dimss__) const { - dimss__.clear(); - dimss__.emplace_back(std::vector{static_cast(N)}); - - dimss__.emplace_back(std::vector{static_cast(N)}); - - dimss__.emplace_back(std::vector{static_cast(N)}); + dimss__ = std::vector>{std::vector{ + static_cast(N) + }, + std::vector{static_cast(N)}, + std::vector{static_cast(N)}}; } // get_dims() inline void constrained_param_names( @@ -19679,16 +19465,14 @@ class reduce_sum_m1_model final : public model_base_crtp { } // unconstrained_param_names() - inline std::string get_constrained_sizedtypes() const { - std::stringstream s__; - s__ << "[{\"name\":\"y1\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"y2\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"y3\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"}]"; - return s__.str(); + inline std::string get_constrained_sizedtypes() const final { + + return std::string("[{\"name\":\"y1\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"y2\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"y3\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"}]"); } // get_constrained_sizedtypes() - inline std::string get_unconstrained_sizedtypes() const { - std::stringstream s__; - s__ << "[{\"name\":\"y1\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"y2\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"y3\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"}]"; - return s__.str(); + inline std::string get_unconstrained_sizedtypes() const final { + + return std::string("[{\"name\":\"y1\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"y2\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"y3\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"}]"); } // get_unconstrained_sizedtypes() @@ -21844,83 +21628,57 @@ class reduce_sum_m2_model final : public model_base_crtp { inline void get_param_names(std::vector& names__) const { - names__.clear(); - names__.emplace_back("a8"); - names__.emplace_back("a7"); - names__.emplace_back("a6"); - names__.emplace_back("a5"); - names__.emplace_back("a4"); - names__.emplace_back("a3"); - names__.emplace_back("a2"); - names__.emplace_back("a1"); - names__.emplace_back("y8"); - names__.emplace_back("y7"); - names__.emplace_back("y6"); - names__.emplace_back("y5"); - names__.emplace_back("y4"); - names__.emplace_back("y3"); - names__.emplace_back("y2"); - names__.emplace_back("y1"); + names__ = std::vector{"a8", + "a7", + "a6", + "a5", + "a4", + "a3", + "a2", + "a1", + "y8", + "y7", + "y6", + "y5", + "y4", + "y3", + "y2", + "y1"}; } // get_param_names() inline void get_dims(std::vector>& dimss__) const { - dimss__.clear(); - dimss__.emplace_back(std::vector{static_cast(N), - static_cast(N), - static_cast(N), - static_cast(N)}); - - dimss__.emplace_back(std::vector{static_cast(N), - static_cast(N), - static_cast(N)}); - - dimss__.emplace_back(std::vector{static_cast(N), - static_cast(N), - static_cast(N)}); - - dimss__.emplace_back(std::vector{static_cast(N), - static_cast(N)}); - - dimss__.emplace_back(std::vector{static_cast(N), - static_cast(N), - static_cast(N)}); - - dimss__.emplace_back(std::vector{static_cast(N), - static_cast(N)}); - - dimss__.emplace_back(std::vector{static_cast(N), - static_cast(N)}); - - dimss__.emplace_back(std::vector{static_cast(N)}); - - dimss__.emplace_back(std::vector{static_cast(N), - static_cast(N), - static_cast(N), - static_cast(N)}); - - dimss__.emplace_back(std::vector{static_cast(N), - static_cast(N), - static_cast(N)}); - - dimss__.emplace_back(std::vector{static_cast(N), - static_cast(N), - static_cast(N)}); - - dimss__.emplace_back(std::vector{static_cast(N), - static_cast(N)}); - - dimss__.emplace_back(std::vector{static_cast(N), - static_cast(N), - static_cast(N)}); - - dimss__.emplace_back(std::vector{static_cast(N), - static_cast(N)}); - - dimss__.emplace_back(std::vector{static_cast(N), - static_cast(N)}); - - dimss__.emplace_back(std::vector{static_cast(N)}); + dimss__ = std::vector>{std::vector{ + static_cast(N) + , + static_cast(N) + , + static_cast(N) + , + static_cast(N) + }, + std::vector{static_cast(N), static_cast(N), + static_cast(N)}, + std::vector{static_cast(N), static_cast(N), + static_cast(N)}, + std::vector{static_cast(N), static_cast(N)}, + std::vector{static_cast(N), static_cast(N), + static_cast(N)}, + std::vector{static_cast(N), static_cast(N)}, + std::vector{static_cast(N), static_cast(N)}, + std::vector{static_cast(N)}, + std::vector{static_cast(N), static_cast(N), + static_cast(N), static_cast(N)}, + std::vector{static_cast(N), static_cast(N), + static_cast(N)}, + std::vector{static_cast(N), static_cast(N), + static_cast(N)}, + std::vector{static_cast(N), static_cast(N)}, + std::vector{static_cast(N), static_cast(N), + static_cast(N)}, + std::vector{static_cast(N), static_cast(N)}, + std::vector{static_cast(N), static_cast(N)}, + std::vector{static_cast(N)}}; } // get_dims() inline void constrained_param_names( @@ -22227,16 +21985,14 @@ class reduce_sum_m2_model final : public model_base_crtp { } // unconstrained_param_names() - inline std::string get_constrained_sizedtypes() const { - std::stringstream s__; - s__ << "[{\"name\":\"a8\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << N << ",\"cols\":" << N << "}}},\"block\":\"parameters\"},{\"name\":\"a7\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}}},\"block\":\"parameters\"},{\"name\":\"a6\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}}},\"block\":\"parameters\"},{\"name\":\"a5\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"real\"}}},\"block\":\"parameters\"},{\"name\":\"a4\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << N << ",\"cols\":" << N << "}},\"block\":\"parameters\"},{\"name\":\"a3\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}},\"block\":\"parameters\"},{\"name\":\"a2\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}},\"block\":\"parameters\"},{\"name\":\"a1\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"y8\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << N << ",\"cols\":" << N << "}}},\"block\":\"parameters\"},{\"name\":\"y7\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}}},\"block\":\"parameters\"},{\"name\":\"y6\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}}},\"block\":\"parameters\"},{\"name\":\"y5\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"real\"}}},\"block\":\"parameters\"},{\"name\":\"y4\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << N << ",\"cols\":" << N << "}},\"block\":\"parameters\"},{\"name\":\"y3\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}},\"block\":\"parameters\"},{\"name\":\"y2\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}},\"block\":\"parameters\"},{\"name\":\"y1\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"}]"; - return s__.str(); + inline std::string get_constrained_sizedtypes() const final { + + return std::string("[{\"name\":\"a8\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << N << ",\"cols\":" << N << "}}},\"block\":\"parameters\"},{\"name\":\"a7\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}}},\"block\":\"parameters\"},{\"name\":\"a6\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}}},\"block\":\"parameters\"},{\"name\":\"a5\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"real\"}}},\"block\":\"parameters\"},{\"name\":\"a4\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << N << ",\"cols\":" << N << "}},\"block\":\"parameters\"},{\"name\":\"a3\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}},\"block\":\"parameters\"},{\"name\":\"a2\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}},\"block\":\"parameters\"},{\"name\":\"a1\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"y8\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << N << ",\"cols\":" << N << "}}},\"block\":\"parameters\"},{\"name\":\"y7\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}}},\"block\":\"parameters\"},{\"name\":\"y6\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}}},\"block\":\"parameters\"},{\"name\":\"y5\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"real\"}}},\"block\":\"parameters\"},{\"name\":\"y4\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << N << ",\"cols\":" << N << "}},\"block\":\"parameters\"},{\"name\":\"y3\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}},\"block\":\"parameters\"},{\"name\":\"y2\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}},\"block\":\"parameters\"},{\"name\":\"y1\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"}]"); } // get_constrained_sizedtypes() - inline std::string get_unconstrained_sizedtypes() const { - std::stringstream s__; - s__ << "[{\"name\":\"a8\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << N << ",\"cols\":" << N << "}}},\"block\":\"parameters\"},{\"name\":\"a7\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}}},\"block\":\"parameters\"},{\"name\":\"a6\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}}},\"block\":\"parameters\"},{\"name\":\"a5\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"real\"}}},\"block\":\"parameters\"},{\"name\":\"a4\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << N << ",\"cols\":" << N << "}},\"block\":\"parameters\"},{\"name\":\"a3\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}},\"block\":\"parameters\"},{\"name\":\"a2\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}},\"block\":\"parameters\"},{\"name\":\"a1\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"y8\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << N << ",\"cols\":" << N << "}}},\"block\":\"parameters\"},{\"name\":\"y7\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}}},\"block\":\"parameters\"},{\"name\":\"y6\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}}},\"block\":\"parameters\"},{\"name\":\"y5\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"real\"}}},\"block\":\"parameters\"},{\"name\":\"y4\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << N << ",\"cols\":" << N << "}},\"block\":\"parameters\"},{\"name\":\"y3\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}},\"block\":\"parameters\"},{\"name\":\"y2\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}},\"block\":\"parameters\"},{\"name\":\"y1\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"}]"; - return s__.str(); + inline std::string get_unconstrained_sizedtypes() const final { + + return std::string("[{\"name\":\"a8\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << N << ",\"cols\":" << N << "}}},\"block\":\"parameters\"},{\"name\":\"a7\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}}},\"block\":\"parameters\"},{\"name\":\"a6\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}}},\"block\":\"parameters\"},{\"name\":\"a5\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"real\"}}},\"block\":\"parameters\"},{\"name\":\"a4\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << N << ",\"cols\":" << N << "}},\"block\":\"parameters\"},{\"name\":\"a3\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}},\"block\":\"parameters\"},{\"name\":\"a2\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}},\"block\":\"parameters\"},{\"name\":\"a1\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"y8\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << N << ",\"cols\":" << N << "}}},\"block\":\"parameters\"},{\"name\":\"y7\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}}},\"block\":\"parameters\"},{\"name\":\"y6\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}}},\"block\":\"parameters\"},{\"name\":\"y5\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"real\"}}},\"block\":\"parameters\"},{\"name\":\"y4\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << N << ",\"cols\":" << N << "}},\"block\":\"parameters\"},{\"name\":\"y3\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}},\"block\":\"parameters\"},{\"name\":\"y2\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}},\"block\":\"parameters\"},{\"name\":\"y1\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"}]"); } // get_unconstrained_sizedtypes() @@ -25918,143 +25674,95 @@ class reduce_sum_m3_model final : public model_base_crtp { inline void get_param_names(std::vector& names__) const { - names__.clear(); - names__.emplace_back("y1"); - names__.emplace_back("y2"); - names__.emplace_back("y3"); - names__.emplace_back("y4"); - names__.emplace_back("y5"); - names__.emplace_back("y6"); - names__.emplace_back("y7"); - names__.emplace_back("y8"); - names__.emplace_back("y9"); - names__.emplace_back("y10"); - names__.emplace_back("y11"); - names__.emplace_back("y12"); - names__.emplace_back("y17"); - names__.emplace_back("t1"); - names__.emplace_back("t1a"); - names__.emplace_back("t2"); - names__.emplace_back("t3"); - names__.emplace_back("t4"); - names__.emplace_back("t5"); - names__.emplace_back("t6"); - names__.emplace_back("t7"); - names__.emplace_back("t8"); - names__.emplace_back("t9"); - names__.emplace_back("t10"); - names__.emplace_back("t11"); - names__.emplace_back("t12"); - names__.emplace_back("tg1"); - names__.emplace_back("tg2"); - names__.emplace_back("tg3"); - names__.emplace_back("tg4"); - names__.emplace_back("tg5"); - names__.emplace_back("tg6"); - names__.emplace_back("tg7"); - names__.emplace_back("tg8"); - names__.emplace_back("tg9"); - names__.emplace_back("tg10"); - names__.emplace_back("tg11"); - names__.emplace_back("tg12"); - names__.emplace_back("tgs"); + names__ = std::vector{"y1", + "y2", + "y3", + "y4", + "y5", + "y6", + "y7", + "y8", + "y9", + "y10", + "y11", + "y12", + "y17", + "t1", + "t1a", + "t2", + "t3", + "t4", + "t5", + "t6", + "t7", + "t8", + "t9", + "t10", + "t11", + "t12", + "tg1", + "tg2", + "tg3", + "tg4", + "tg5", + "tg6", + "tg7", + "tg8", + "tg9", + "tg10", + "tg11", + "tg12", + "tgs"}; } // get_param_names() inline void get_dims(std::vector>& dimss__) const { - dimss__.clear(); - dimss__.emplace_back(std::vector{static_cast(N)}); - - dimss__.emplace_back(std::vector{static_cast(N), - static_cast(N)}); - - dimss__.emplace_back(std::vector{static_cast(N), - static_cast(N)}); - - dimss__.emplace_back(std::vector{static_cast(N), - static_cast(N), - static_cast(N)}); - - dimss__.emplace_back(std::vector{static_cast(N), - static_cast(N)}); - - dimss__.emplace_back(std::vector{static_cast(N), - static_cast(N), - static_cast(N)}); - - dimss__.emplace_back(std::vector{static_cast(N), - static_cast(N), - static_cast(N)}); - - dimss__.emplace_back(std::vector{static_cast(N), - static_cast(N), - static_cast(N), - static_cast(N)}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{static_cast(N)}); - - dimss__.emplace_back(std::vector{static_cast(N)}); - - dimss__.emplace_back(std::vector{static_cast(N), - static_cast(N)}); - - dimss__.emplace_back(std::vector{static_cast(N), - static_cast(N), - static_cast(N)}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{}); + dimss__ = std::vector>{std::vector{ + static_cast(N) + }, + std::vector{static_cast(N), static_cast(N)}, + std::vector{static_cast(N), static_cast(N)}, + std::vector{static_cast(N), static_cast(N), + static_cast(N)}, + std::vector{static_cast(N), static_cast(N)}, + std::vector{static_cast(N), static_cast(N), + static_cast(N)}, + std::vector{static_cast(N), static_cast(N), + static_cast(N)}, + std::vector{static_cast(N), static_cast(N), + static_cast(N), static_cast(N)}, + std::vector{}, + std::vector{static_cast(N)}, + std::vector{static_cast(N)}, + std::vector{static_cast(N), static_cast(N)}, + std::vector{static_cast(N), static_cast(N), + static_cast(N)}, + std::vector{}, + std::vector{}, + std::vector{}, + std::vector{}, + std::vector{}, + std::vector{}, + std::vector{}, + std::vector{}, + std::vector{}, + std::vector{}, + std::vector{}, + std::vector{}, + std::vector{}, + std::vector{}, + std::vector{}, + std::vector{}, + std::vector{}, + std::vector{}, + std::vector{}, + std::vector{}, + std::vector{}, + std::vector{}, + std::vector{}, + std::vector{}, + std::vector{}, + std::vector{}}; } // get_dims() inline void constrained_param_names( @@ -26327,16 +26035,14 @@ class reduce_sum_m3_model final : public model_base_crtp { } // unconstrained_param_names() - inline std::string get_constrained_sizedtypes() const { - std::stringstream s__; - s__ << "[{\"name\":\"y1\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"y2\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}},\"block\":\"parameters\"},{\"name\":\"y3\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}},\"block\":\"parameters\"},{\"name\":\"y4\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << N << ",\"cols\":" << N << "}},\"block\":\"parameters\"},{\"name\":\"y5\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"real\"}}},\"block\":\"parameters\"},{\"name\":\"y6\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}}},\"block\":\"parameters\"},{\"name\":\"y7\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}}},\"block\":\"parameters\"},{\"name\":\"y8\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << N << ",\"cols\":" << N << "}}},\"block\":\"parameters\"},{\"name\":\"y9\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"y10\",\"type\":{\"name\":\"vector\",\"length\":" << N << "},\"block\":\"parameters\"},{\"name\":\"y11\",\"type\":{\"name\":\"vector\",\"length\":" << N << "},\"block\":\"parameters\"},{\"name\":\"y12\",\"type\":{\"name\":\"matrix\",\"rows\":" << N << ",\"cols\":" << N << "},\"block\":\"parameters\"},{\"name\":\"y17\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"real\"}}}},\"block\":\"parameters\"},{\"name\":\"t1\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"t1a\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"t2\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"t3\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"t4\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"t5\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"t6\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"t7\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"t8\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"t9\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"t10\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"t11\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"t12\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tg1\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tg2\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tg3\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tg4\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tg5\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tg6\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tg7\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tg8\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tg9\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tg10\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tg11\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tg12\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tgs\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"}]"; - return s__.str(); + inline std::string get_constrained_sizedtypes() const final { + + return std::string("[{\"name\":\"y1\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"y2\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}},\"block\":\"parameters\"},{\"name\":\"y3\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}},\"block\":\"parameters\"},{\"name\":\"y4\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << N << ",\"cols\":" << N << "}},\"block\":\"parameters\"},{\"name\":\"y5\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"real\"}}},\"block\":\"parameters\"},{\"name\":\"y6\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}}},\"block\":\"parameters\"},{\"name\":\"y7\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}}},\"block\":\"parameters\"},{\"name\":\"y8\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << N << ",\"cols\":" << N << "}}},\"block\":\"parameters\"},{\"name\":\"y9\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"y10\",\"type\":{\"name\":\"vector\",\"length\":" << N << "},\"block\":\"parameters\"},{\"name\":\"y11\",\"type\":{\"name\":\"vector\",\"length\":" << N << "},\"block\":\"parameters\"},{\"name\":\"y12\",\"type\":{\"name\":\"matrix\",\"rows\":" << N << ",\"cols\":" << N << "},\"block\":\"parameters\"},{\"name\":\"y17\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"real\"}}}},\"block\":\"parameters\"},{\"name\":\"t1\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"t1a\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"t2\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"t3\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"t4\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"t5\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"t6\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"t7\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"t8\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"t9\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"t10\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"t11\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"t12\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tg1\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tg2\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tg3\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tg4\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tg5\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tg6\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tg7\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tg8\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tg9\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tg10\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tg11\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tg12\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tgs\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"}]"); } // get_constrained_sizedtypes() - inline std::string get_unconstrained_sizedtypes() const { - std::stringstream s__; - s__ << "[{\"name\":\"y1\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"y2\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}},\"block\":\"parameters\"},{\"name\":\"y3\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}},\"block\":\"parameters\"},{\"name\":\"y4\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << N << ",\"cols\":" << N << "}},\"block\":\"parameters\"},{\"name\":\"y5\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"real\"}}},\"block\":\"parameters\"},{\"name\":\"y6\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}}},\"block\":\"parameters\"},{\"name\":\"y7\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}}},\"block\":\"parameters\"},{\"name\":\"y8\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << N << ",\"cols\":" << N << "}}},\"block\":\"parameters\"},{\"name\":\"y9\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"y10\",\"type\":{\"name\":\"vector\",\"length\":" << N << "},\"block\":\"parameters\"},{\"name\":\"y11\",\"type\":{\"name\":\"vector\",\"length\":" << N << "},\"block\":\"parameters\"},{\"name\":\"y12\",\"type\":{\"name\":\"matrix\",\"rows\":" << N << ",\"cols\":" << N << "},\"block\":\"parameters\"},{\"name\":\"y17\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"real\"}}}},\"block\":\"parameters\"},{\"name\":\"t1\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"t1a\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"t2\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"t3\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"t4\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"t5\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"t6\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"t7\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"t8\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"t9\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"t10\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"t11\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"t12\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tg1\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tg2\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tg3\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tg4\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tg5\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tg6\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tg7\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tg8\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tg9\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tg10\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tg11\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tg12\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tgs\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"}]"; - return s__.str(); + inline std::string get_unconstrained_sizedtypes() const final { + + return std::string("[{\"name\":\"y1\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"y2\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}},\"block\":\"parameters\"},{\"name\":\"y3\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}},\"block\":\"parameters\"},{\"name\":\"y4\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << N << ",\"cols\":" << N << "}},\"block\":\"parameters\"},{\"name\":\"y5\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"real\"}}},\"block\":\"parameters\"},{\"name\":\"y6\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}}},\"block\":\"parameters\"},{\"name\":\"y7\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}}},\"block\":\"parameters\"},{\"name\":\"y8\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << N << ",\"cols\":" << N << "}}},\"block\":\"parameters\"},{\"name\":\"y9\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"y10\",\"type\":{\"name\":\"vector\",\"length\":" << N << "},\"block\":\"parameters\"},{\"name\":\"y11\",\"type\":{\"name\":\"vector\",\"length\":" << N << "},\"block\":\"parameters\"},{\"name\":\"y12\",\"type\":{\"name\":\"matrix\",\"rows\":" << N << ",\"cols\":" << N << "},\"block\":\"parameters\"},{\"name\":\"y17\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"real\"}}}},\"block\":\"parameters\"},{\"name\":\"t1\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"t1a\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"t2\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"t3\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"t4\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"t5\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"t6\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"t7\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"t8\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"t9\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"t10\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"t11\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"t12\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tg1\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tg2\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tg3\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tg4\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tg5\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tg6\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tg7\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tg8\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tg9\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tg10\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tg11\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tg12\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tgs\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"}]"); } // get_unconstrained_sizedtypes() @@ -26766,13 +26472,12 @@ class single_argument_lpmf_model final : public model_base_crtp& names__) const { - names__.clear(); - + names__ = std::vector{}; } // get_param_names() inline void get_dims(std::vector>& dimss__) const { - dimss__.clear(); + dimss__ = std::vector>{}; } // get_dims() inline void constrained_param_names( @@ -26809,16 +26514,14 @@ class single_argument_lpmf_model final : public model_base_crtp { inline void get_param_names(std::vector& names__) const { - names__.clear(); - names__.emplace_back("x"); + names__ = std::vector{"x"}; } // get_param_names() inline void get_dims(std::vector>& dimss__) const { - dimss__.clear(); - dimss__.emplace_back(std::vector{}); + dimss__ = std::vector>{std::vector{}}; } // get_dims() inline void constrained_param_names( @@ -27177,16 +26878,14 @@ class tilde_block_model final : public model_base_crtp { } // unconstrained_param_names() - inline std::string get_constrained_sizedtypes() const { - std::stringstream s__; - s__ << "[{\"name\":\"x\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"}]"; - return s__.str(); + inline std::string get_constrained_sizedtypes() const final { + + return std::string("[{\"name\":\"x\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"}]"); } // get_constrained_sizedtypes() - inline std::string get_unconstrained_sizedtypes() const { - std::stringstream s__; - s__ << "[{\"name\":\"x\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"}]"; - return s__.str(); + inline std::string get_unconstrained_sizedtypes() const final { + + return std::string("[{\"name\":\"x\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"}]"); } // get_unconstrained_sizedtypes() @@ -29656,143 +29355,92 @@ class transform_model final : public model_base_crtp { inline void get_param_names(std::vector& names__) const { - names__.clear(); - names__.emplace_back("p_1"); - names__.emplace_back("p_2"); - names__.emplace_back("p_3"); - names__.emplace_back("p_4"); - names__.emplace_back("p_5"); - names__.emplace_back("p_6"); - names__.emplace_back("p_7"); - names__.emplace_back("p_8"); - names__.emplace_back("p_9"); - names__.emplace_back("p_10"); - names__.emplace_back("pv_1"); - names__.emplace_back("pv_2"); - names__.emplace_back("pv_3"); - names__.emplace_back("pr_1"); - names__.emplace_back("pr_2"); - names__.emplace_back("pr_3"); - names__.emplace_back("pm_1"); - names__.emplace_back("pm_2"); - names__.emplace_back("tp_1"); - names__.emplace_back("tp_2"); - names__.emplace_back("tp_3"); - names__.emplace_back("tp_4"); - names__.emplace_back("tp_5"); - names__.emplace_back("tp_6"); - names__.emplace_back("tp_7"); - names__.emplace_back("tp_8"); - names__.emplace_back("tp_9"); - names__.emplace_back("tp_10"); - names__.emplace_back("tpv_1"); - names__.emplace_back("tpv_2"); - names__.emplace_back("tpv_3"); - names__.emplace_back("tpr_1"); - names__.emplace_back("tpr_2"); - names__.emplace_back("tpr_3"); - names__.emplace_back("tpm_1"); - names__.emplace_back("tpm_2"); + names__ = std::vector{"p_1", + "p_2", + "p_3", + "p_4", + "p_5", + "p_6", + "p_7", + "p_8", + "p_9", + "p_10", + "pv_1", + "pv_2", + "pv_3", + "pr_1", + "pr_2", + "pr_3", + "pm_1", + "pm_2", + "tp_1", + "tp_2", + "tp_3", + "tp_4", + "tp_5", + "tp_6", + "tp_7", + "tp_8", + "tp_9", + "tp_10", + "tpv_1", + "tpv_2", + "tpv_3", + "tpr_1", + "tpr_2", + "tpr_3", + "tpm_1", + "tpm_2"}; } // get_param_names() inline void get_dims(std::vector>& dimss__) const { - dimss__.clear(); - dimss__.emplace_back(std::vector{static_cast(k)}); - - dimss__.emplace_back(std::vector{static_cast(k)}); - - dimss__.emplace_back(std::vector{static_cast(k)}); - - dimss__.emplace_back(std::vector{static_cast(k)}); - - dimss__.emplace_back(std::vector{static_cast(k)}); - - dimss__.emplace_back(std::vector{static_cast(k)}); - - dimss__.emplace_back(std::vector{static_cast(k)}); - - dimss__.emplace_back(std::vector{static_cast(k)}); - - dimss__.emplace_back(std::vector{static_cast(m), - static_cast(k)}); - - dimss__.emplace_back(std::vector{static_cast(n), - static_cast(m), - static_cast(k)}); - - dimss__.emplace_back(std::vector{static_cast(k)}); - - dimss__.emplace_back(std::vector{static_cast(m), - static_cast(k)}); - - dimss__.emplace_back(std::vector{static_cast(n), - static_cast(m), - static_cast(k)}); - - dimss__.emplace_back(std::vector{static_cast(k)}); - - dimss__.emplace_back(std::vector{static_cast(m), - static_cast(k)}); - - dimss__.emplace_back(std::vector{static_cast(n), - static_cast(m), - static_cast(k)}); - - dimss__.emplace_back(std::vector{static_cast(m), - static_cast(k)}); - - dimss__.emplace_back(std::vector{static_cast(n), - static_cast(m), - static_cast(k)}); - - dimss__.emplace_back(std::vector{static_cast(k)}); - - dimss__.emplace_back(std::vector{static_cast(k)}); - - dimss__.emplace_back(std::vector{static_cast(k)}); - - dimss__.emplace_back(std::vector{static_cast(k)}); - - dimss__.emplace_back(std::vector{static_cast(k)}); - - dimss__.emplace_back(std::vector{static_cast(k)}); - - dimss__.emplace_back(std::vector{static_cast(k)}); - - dimss__.emplace_back(std::vector{static_cast(k)}); - - dimss__.emplace_back(std::vector{static_cast(m), - static_cast(k)}); - - dimss__.emplace_back(std::vector{static_cast(n), - static_cast(m), - static_cast(k)}); - - dimss__.emplace_back(std::vector{static_cast(k)}); - - dimss__.emplace_back(std::vector{static_cast(m), - static_cast(k)}); - - dimss__.emplace_back(std::vector{static_cast(n), - static_cast(m), - static_cast(k)}); - - dimss__.emplace_back(std::vector{static_cast(k)}); - - dimss__.emplace_back(std::vector{static_cast(m), - static_cast(k)}); - - dimss__.emplace_back(std::vector{static_cast(n), - static_cast(m), - static_cast(k)}); - - dimss__.emplace_back(std::vector{static_cast(m), - static_cast(k)}); - - dimss__.emplace_back(std::vector{static_cast(n), - static_cast(m), - static_cast(k)}); + dimss__ = std::vector>{std::vector{ + static_cast(k) + }, + std::vector{static_cast(k)}, + std::vector{static_cast(k)}, + std::vector{static_cast(k)}, + std::vector{static_cast(k)}, + std::vector{static_cast(k)}, + std::vector{static_cast(k)}, + std::vector{static_cast(k)}, + std::vector{static_cast(m), static_cast(k)}, + std::vector{static_cast(n), static_cast(m), + static_cast(k)}, + std::vector{static_cast(k)}, + std::vector{static_cast(m), static_cast(k)}, + std::vector{static_cast(n), static_cast(m), + static_cast(k)}, + std::vector{static_cast(k)}, + std::vector{static_cast(m), static_cast(k)}, + std::vector{static_cast(n), static_cast(m), + static_cast(k)}, + std::vector{static_cast(m), static_cast(k)}, + std::vector{static_cast(n), static_cast(m), + static_cast(k)}, + std::vector{static_cast(k)}, + std::vector{static_cast(k)}, + std::vector{static_cast(k)}, + std::vector{static_cast(k)}, + std::vector{static_cast(k)}, + std::vector{static_cast(k)}, + std::vector{static_cast(k)}, + std::vector{static_cast(k)}, + std::vector{static_cast(m), static_cast(k)}, + std::vector{static_cast(n), static_cast(m), + static_cast(k)}, + std::vector{static_cast(k)}, + std::vector{static_cast(m), static_cast(k)}, + std::vector{static_cast(n), static_cast(m), + static_cast(k)}, + std::vector{static_cast(k)}, + std::vector{static_cast(m), static_cast(k)}, + std::vector{static_cast(n), static_cast(m), + static_cast(k)}, + std::vector{static_cast(m), static_cast(k)}, + std::vector{static_cast(n), static_cast(m), + static_cast(k)}}; } // get_dims() inline void constrained_param_names( @@ -30257,16 +29905,14 @@ class transform_model final : public model_base_crtp { } // unconstrained_param_names() - inline std::string get_constrained_sizedtypes() const { - std::stringstream s__; - s__ << "[{\"name\":\"p_1\",\"type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"p_2\",\"type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"p_3\",\"type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"p_4\",\"type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"p_5\",\"type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"p_6\",\"type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"p_7\",\"type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"p_8\",\"type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"p_9\",\"type\":{\"name\":\"array\",\"length\":" << m << ",\"element_type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}}},\"block\":\"parameters\"},{\"name\":\"p_10\",\"type\":{\"name\":\"array\",\"length\":" << n << ",\"element_type\":{\"name\":\"array\",\"length\":" << m << ",\"element_type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}}}},\"block\":\"parameters\"},{\"name\":\"pv_1\",\"type\":{\"name\":\"vector\",\"length\":" << k << "},\"block\":\"parameters\"},{\"name\":\"pv_2\",\"type\":{\"name\":\"array\",\"length\":" << m << ",\"element_type\":{\"name\":\"vector\",\"length\":" << k << "}},\"block\":\"parameters\"},{\"name\":\"pv_3\",\"type\":{\"name\":\"array\",\"length\":" << n << ",\"element_type\":{\"name\":\"array\",\"length\":" << m << ",\"element_type\":{\"name\":\"vector\",\"length\":" << k << "}}},\"block\":\"parameters\"},{\"name\":\"pr_1\",\"type\":{\"name\":\"vector\",\"length\":" << k << "},\"block\":\"parameters\"},{\"name\":\"pr_2\",\"type\":{\"name\":\"array\",\"length\":" << m << ",\"element_type\":{\"name\":\"vector\",\"length\":" << k << "}},\"block\":\"parameters\"},{\"name\":\"pr_3\",\"type\":{\"name\":\"array\",\"length\":" << n << ",\"element_type\":{\"name\":\"array\",\"length\":" << m << ",\"element_type\":{\"name\":\"vector\",\"length\":" << k << "}}},\"block\":\"parameters\"},{\"name\":\"pm_1\",\"type\":{\"name\":\"matrix\",\"rows\":" << m << ",\"cols\":" << k << "},\"block\":\"parameters\"},{\"name\":\"pm_2\",\"type\":{\"name\":\"array\",\"length\":" << n << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << m << ",\"cols\":" << k << "}},\"block\":\"parameters\"},{\"name\":\"tp_1\",\"type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_2\",\"type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_3\",\"type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_4\",\"type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_5\",\"type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_6\",\"type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_7\",\"type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_8\",\"type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_9\",\"type\":{\"name\":\"array\",\"length\":" << m << ",\"element_type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_10\",\"type\":{\"name\":\"array\",\"length\":" << n << ",\"element_type\":{\"name\":\"array\",\"length\":" << m << ",\"element_type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}}}},\"block\":\"transformed_parameters\"},{\"name\":\"tpv_1\",\"type\":{\"name\":\"vector\",\"length\":" << k << "},\"block\":\"transformed_parameters\"},{\"name\":\"tpv_2\",\"type\":{\"name\":\"array\",\"length\":" << m << ",\"element_type\":{\"name\":\"vector\",\"length\":" << k << "}},\"block\":\"transformed_parameters\"},{\"name\":\"tpv_3\",\"type\":{\"name\":\"array\",\"length\":" << n << ",\"element_type\":{\"name\":\"array\",\"length\":" << m << ",\"element_type\":{\"name\":\"vector\",\"length\":" << k << "}}},\"block\":\"transformed_parameters\"},{\"name\":\"tpr_1\",\"type\":{\"name\":\"vector\",\"length\":" << k << "},\"block\":\"transformed_parameters\"},{\"name\":\"tpr_2\",\"type\":{\"name\":\"array\",\"length\":" << m << ",\"element_type\":{\"name\":\"vector\",\"length\":" << k << "}},\"block\":\"transformed_parameters\"},{\"name\":\"tpr_3\",\"type\":{\"name\":\"array\",\"length\":" << n << ",\"element_type\":{\"name\":\"array\",\"length\":" << m << ",\"element_type\":{\"name\":\"vector\",\"length\":" << k << "}}},\"block\":\"transformed_parameters\"},{\"name\":\"tpm_1\",\"type\":{\"name\":\"matrix\",\"rows\":" << m << ",\"cols\":" << k << "},\"block\":\"transformed_parameters\"},{\"name\":\"tpm_2\",\"type\":{\"name\":\"array\",\"length\":" << n << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << m << ",\"cols\":" << k << "}},\"block\":\"transformed_parameters\"}]"; - return s__.str(); + inline std::string get_constrained_sizedtypes() const final { + + return std::string("[{\"name\":\"p_1\",\"type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"p_2\",\"type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"p_3\",\"type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"p_4\",\"type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"p_5\",\"type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"p_6\",\"type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"p_7\",\"type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"p_8\",\"type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"p_9\",\"type\":{\"name\":\"array\",\"length\":" << m << ",\"element_type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}}},\"block\":\"parameters\"},{\"name\":\"p_10\",\"type\":{\"name\":\"array\",\"length\":" << n << ",\"element_type\":{\"name\":\"array\",\"length\":" << m << ",\"element_type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}}}},\"block\":\"parameters\"},{\"name\":\"pv_1\",\"type\":{\"name\":\"vector\",\"length\":" << k << "},\"block\":\"parameters\"},{\"name\":\"pv_2\",\"type\":{\"name\":\"array\",\"length\":" << m << ",\"element_type\":{\"name\":\"vector\",\"length\":" << k << "}},\"block\":\"parameters\"},{\"name\":\"pv_3\",\"type\":{\"name\":\"array\",\"length\":" << n << ",\"element_type\":{\"name\":\"array\",\"length\":" << m << ",\"element_type\":{\"name\":\"vector\",\"length\":" << k << "}}},\"block\":\"parameters\"},{\"name\":\"pr_1\",\"type\":{\"name\":\"vector\",\"length\":" << k << "},\"block\":\"parameters\"},{\"name\":\"pr_2\",\"type\":{\"name\":\"array\",\"length\":" << m << ",\"element_type\":{\"name\":\"vector\",\"length\":" << k << "}},\"block\":\"parameters\"},{\"name\":\"pr_3\",\"type\":{\"name\":\"array\",\"length\":" << n << ",\"element_type\":{\"name\":\"array\",\"length\":" << m << ",\"element_type\":{\"name\":\"vector\",\"length\":" << k << "}}},\"block\":\"parameters\"},{\"name\":\"pm_1\",\"type\":{\"name\":\"matrix\",\"rows\":" << m << ",\"cols\":" << k << "},\"block\":\"parameters\"},{\"name\":\"pm_2\",\"type\":{\"name\":\"array\",\"length\":" << n << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << m << ",\"cols\":" << k << "}},\"block\":\"parameters\"},{\"name\":\"tp_1\",\"type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_2\",\"type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_3\",\"type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_4\",\"type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_5\",\"type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_6\",\"type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_7\",\"type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_8\",\"type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_9\",\"type\":{\"name\":\"array\",\"length\":" << m << ",\"element_type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_10\",\"type\":{\"name\":\"array\",\"length\":" << n << ",\"element_type\":{\"name\":\"array\",\"length\":" << m << ",\"element_type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}}}},\"block\":\"transformed_parameters\"},{\"name\":\"tpv_1\",\"type\":{\"name\":\"vector\",\"length\":" << k << "},\"block\":\"transformed_parameters\"},{\"name\":\"tpv_2\",\"type\":{\"name\":\"array\",\"length\":" << m << ",\"element_type\":{\"name\":\"vector\",\"length\":" << k << "}},\"block\":\"transformed_parameters\"},{\"name\":\"tpv_3\",\"type\":{\"name\":\"array\",\"length\":" << n << ",\"element_type\":{\"name\":\"array\",\"length\":" << m << ",\"element_type\":{\"name\":\"vector\",\"length\":" << k << "}}},\"block\":\"transformed_parameters\"},{\"name\":\"tpr_1\",\"type\":{\"name\":\"vector\",\"length\":" << k << "},\"block\":\"transformed_parameters\"},{\"name\":\"tpr_2\",\"type\":{\"name\":\"array\",\"length\":" << m << ",\"element_type\":{\"name\":\"vector\",\"length\":" << k << "}},\"block\":\"transformed_parameters\"},{\"name\":\"tpr_3\",\"type\":{\"name\":\"array\",\"length\":" << n << ",\"element_type\":{\"name\":\"array\",\"length\":" << m << ",\"element_type\":{\"name\":\"vector\",\"length\":" << k << "}}},\"block\":\"transformed_parameters\"},{\"name\":\"tpm_1\",\"type\":{\"name\":\"matrix\",\"rows\":" << m << ",\"cols\":" << k << "},\"block\":\"transformed_parameters\"},{\"name\":\"tpm_2\",\"type\":{\"name\":\"array\",\"length\":" << n << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << m << ",\"cols\":" << k << "}},\"block\":\"transformed_parameters\"}]"); } // get_constrained_sizedtypes() - inline std::string get_unconstrained_sizedtypes() const { - std::stringstream s__; - s__ << "[{\"name\":\"p_1\",\"type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"p_2\",\"type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"p_3\",\"type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"p_4\",\"type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"p_5\",\"type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"p_6\",\"type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"p_7\",\"type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"p_8\",\"type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"p_9\",\"type\":{\"name\":\"array\",\"length\":" << m << ",\"element_type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}}},\"block\":\"parameters\"},{\"name\":\"p_10\",\"type\":{\"name\":\"array\",\"length\":" << n << ",\"element_type\":{\"name\":\"array\",\"length\":" << m << ",\"element_type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}}}},\"block\":\"parameters\"},{\"name\":\"pv_1\",\"type\":{\"name\":\"vector\",\"length\":" << k << "},\"block\":\"parameters\"},{\"name\":\"pv_2\",\"type\":{\"name\":\"array\",\"length\":" << m << ",\"element_type\":{\"name\":\"vector\",\"length\":" << k << "}},\"block\":\"parameters\"},{\"name\":\"pv_3\",\"type\":{\"name\":\"array\",\"length\":" << n << ",\"element_type\":{\"name\":\"array\",\"length\":" << m << ",\"element_type\":{\"name\":\"vector\",\"length\":" << k << "}}},\"block\":\"parameters\"},{\"name\":\"pr_1\",\"type\":{\"name\":\"vector\",\"length\":" << k << "},\"block\":\"parameters\"},{\"name\":\"pr_2\",\"type\":{\"name\":\"array\",\"length\":" << m << ",\"element_type\":{\"name\":\"vector\",\"length\":" << k << "}},\"block\":\"parameters\"},{\"name\":\"pr_3\",\"type\":{\"name\":\"array\",\"length\":" << n << ",\"element_type\":{\"name\":\"array\",\"length\":" << m << ",\"element_type\":{\"name\":\"vector\",\"length\":" << k << "}}},\"block\":\"parameters\"},{\"name\":\"pm_1\",\"type\":{\"name\":\"matrix\",\"rows\":" << m << ",\"cols\":" << k << "},\"block\":\"parameters\"},{\"name\":\"pm_2\",\"type\":{\"name\":\"array\",\"length\":" << n << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << m << ",\"cols\":" << k << "}},\"block\":\"parameters\"},{\"name\":\"tp_1\",\"type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_2\",\"type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_3\",\"type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_4\",\"type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_5\",\"type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_6\",\"type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_7\",\"type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_8\",\"type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_9\",\"type\":{\"name\":\"array\",\"length\":" << m << ",\"element_type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_10\",\"type\":{\"name\":\"array\",\"length\":" << n << ",\"element_type\":{\"name\":\"array\",\"length\":" << m << ",\"element_type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}}}},\"block\":\"transformed_parameters\"},{\"name\":\"tpv_1\",\"type\":{\"name\":\"vector\",\"length\":" << k << "},\"block\":\"transformed_parameters\"},{\"name\":\"tpv_2\",\"type\":{\"name\":\"array\",\"length\":" << m << ",\"element_type\":{\"name\":\"vector\",\"length\":" << k << "}},\"block\":\"transformed_parameters\"},{\"name\":\"tpv_3\",\"type\":{\"name\":\"array\",\"length\":" << n << ",\"element_type\":{\"name\":\"array\",\"length\":" << m << ",\"element_type\":{\"name\":\"vector\",\"length\":" << k << "}}},\"block\":\"transformed_parameters\"},{\"name\":\"tpr_1\",\"type\":{\"name\":\"vector\",\"length\":" << k << "},\"block\":\"transformed_parameters\"},{\"name\":\"tpr_2\",\"type\":{\"name\":\"array\",\"length\":" << m << ",\"element_type\":{\"name\":\"vector\",\"length\":" << k << "}},\"block\":\"transformed_parameters\"},{\"name\":\"tpr_3\",\"type\":{\"name\":\"array\",\"length\":" << n << ",\"element_type\":{\"name\":\"array\",\"length\":" << m << ",\"element_type\":{\"name\":\"vector\",\"length\":" << k << "}}},\"block\":\"transformed_parameters\"},{\"name\":\"tpm_1\",\"type\":{\"name\":\"matrix\",\"rows\":" << m << ",\"cols\":" << k << "},\"block\":\"transformed_parameters\"},{\"name\":\"tpm_2\",\"type\":{\"name\":\"array\",\"length\":" << n << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << m << ",\"cols\":" << k << "}},\"block\":\"transformed_parameters\"}]"; - return s__.str(); + inline std::string get_unconstrained_sizedtypes() const final { + + return std::string("[{\"name\":\"p_1\",\"type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"p_2\",\"type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"p_3\",\"type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"p_4\",\"type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"p_5\",\"type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"p_6\",\"type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"p_7\",\"type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"p_8\",\"type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"p_9\",\"type\":{\"name\":\"array\",\"length\":" << m << ",\"element_type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}}},\"block\":\"parameters\"},{\"name\":\"p_10\",\"type\":{\"name\":\"array\",\"length\":" << n << ",\"element_type\":{\"name\":\"array\",\"length\":" << m << ",\"element_type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}}}},\"block\":\"parameters\"},{\"name\":\"pv_1\",\"type\":{\"name\":\"vector\",\"length\":" << k << "},\"block\":\"parameters\"},{\"name\":\"pv_2\",\"type\":{\"name\":\"array\",\"length\":" << m << ",\"element_type\":{\"name\":\"vector\",\"length\":" << k << "}},\"block\":\"parameters\"},{\"name\":\"pv_3\",\"type\":{\"name\":\"array\",\"length\":" << n << ",\"element_type\":{\"name\":\"array\",\"length\":" << m << ",\"element_type\":{\"name\":\"vector\",\"length\":" << k << "}}},\"block\":\"parameters\"},{\"name\":\"pr_1\",\"type\":{\"name\":\"vector\",\"length\":" << k << "},\"block\":\"parameters\"},{\"name\":\"pr_2\",\"type\":{\"name\":\"array\",\"length\":" << m << ",\"element_type\":{\"name\":\"vector\",\"length\":" << k << "}},\"block\":\"parameters\"},{\"name\":\"pr_3\",\"type\":{\"name\":\"array\",\"length\":" << n << ",\"element_type\":{\"name\":\"array\",\"length\":" << m << ",\"element_type\":{\"name\":\"vector\",\"length\":" << k << "}}},\"block\":\"parameters\"},{\"name\":\"pm_1\",\"type\":{\"name\":\"matrix\",\"rows\":" << m << ",\"cols\":" << k << "},\"block\":\"parameters\"},{\"name\":\"pm_2\",\"type\":{\"name\":\"array\",\"length\":" << n << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << m << ",\"cols\":" << k << "}},\"block\":\"parameters\"},{\"name\":\"tp_1\",\"type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_2\",\"type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_3\",\"type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_4\",\"type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_5\",\"type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_6\",\"type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_7\",\"type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_8\",\"type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_9\",\"type\":{\"name\":\"array\",\"length\":" << m << ",\"element_type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_10\",\"type\":{\"name\":\"array\",\"length\":" << n << ",\"element_type\":{\"name\":\"array\",\"length\":" << m << ",\"element_type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}}}},\"block\":\"transformed_parameters\"},{\"name\":\"tpv_1\",\"type\":{\"name\":\"vector\",\"length\":" << k << "},\"block\":\"transformed_parameters\"},{\"name\":\"tpv_2\",\"type\":{\"name\":\"array\",\"length\":" << m << ",\"element_type\":{\"name\":\"vector\",\"length\":" << k << "}},\"block\":\"transformed_parameters\"},{\"name\":\"tpv_3\",\"type\":{\"name\":\"array\",\"length\":" << n << ",\"element_type\":{\"name\":\"array\",\"length\":" << m << ",\"element_type\":{\"name\":\"vector\",\"length\":" << k << "}}},\"block\":\"transformed_parameters\"},{\"name\":\"tpr_1\",\"type\":{\"name\":\"vector\",\"length\":" << k << "},\"block\":\"transformed_parameters\"},{\"name\":\"tpr_2\",\"type\":{\"name\":\"array\",\"length\":" << m << ",\"element_type\":{\"name\":\"vector\",\"length\":" << k << "}},\"block\":\"transformed_parameters\"},{\"name\":\"tpr_3\",\"type\":{\"name\":\"array\",\"length\":" << n << ",\"element_type\":{\"name\":\"array\",\"length\":" << m << ",\"element_type\":{\"name\":\"vector\",\"length\":" << k << "}}},\"block\":\"transformed_parameters\"},{\"name\":\"tpm_1\",\"type\":{\"name\":\"matrix\",\"rows\":" << m << ",\"cols\":" << k << "},\"block\":\"transformed_parameters\"},{\"name\":\"tpm_2\",\"type\":{\"name\":\"array\",\"length\":" << n << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << m << ",\"cols\":" << k << "}},\"block\":\"transformed_parameters\"}]"); } // get_unconstrained_sizedtypes() @@ -30675,17 +30321,14 @@ class truncate_model final : public model_base_crtp { inline void get_param_names(std::vector& names__) const { - names__.clear(); - names__.emplace_back("m"); - names__.emplace_back("y"); + names__ = std::vector{"m", + "y"}; } // get_param_names() inline void get_dims(std::vector>& dimss__) const { - dimss__.clear(); - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{}); + dimss__ = std::vector>{std::vector{}, + std::vector{}}; } // get_dims() inline void constrained_param_names( @@ -30724,16 +30367,14 @@ class truncate_model final : public model_base_crtp { } // unconstrained_param_names() - inline std::string get_constrained_sizedtypes() const { - std::stringstream s__; - s__ << "[{\"name\":\"m\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"y\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"}]"; - return s__.str(); + inline std::string get_constrained_sizedtypes() const final { + + return std::string("[{\"name\":\"m\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"y\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"}]"); } // get_constrained_sizedtypes() - inline std::string get_unconstrained_sizedtypes() const { - std::stringstream s__; - s__ << "[{\"name\":\"m\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"y\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"}]"; - return s__.str(); + inline std::string get_unconstrained_sizedtypes() const final { + + return std::string("[{\"name\":\"m\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"y\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"}]"); } // get_unconstrained_sizedtypes() @@ -31036,14 +30677,12 @@ class udf_tilde_stmt_conflict_model final : public model_base_crtp& names__) const { - names__.clear(); - names__.emplace_back("x"); + names__ = std::vector{"x"}; } // get_param_names() inline void get_dims(std::vector>& dimss__) const { - dimss__.clear(); - dimss__.emplace_back(std::vector{}); + dimss__ = std::vector>{std::vector{}}; } // get_dims() inline void constrained_param_names( @@ -31080,16 +30719,14 @@ class udf_tilde_stmt_conflict_model final : public model_base_crtp inline void get_param_names(std::vector& names__) const { - names__.clear(); - names__.emplace_back("x"); + names__ = std::vector{"x"}; } // get_param_names() inline void get_dims(std::vector>& dimss__) const { - dimss__.clear(); - dimss__.emplace_back(std::vector{}); + dimss__ = std::vector>{std::vector{}}; } // get_dims() inline void constrained_param_names( @@ -31446,16 +31081,14 @@ class user_constrain_model final : public model_base_crtp } // unconstrained_param_names() - inline std::string get_constrained_sizedtypes() const { - std::stringstream s__; - s__ << "[{\"name\":\"x\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"}]"; - return s__.str(); + inline std::string get_constrained_sizedtypes() const final { + + return std::string("[{\"name\":\"x\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"}]"); } // get_constrained_sizedtypes() - inline std::string get_unconstrained_sizedtypes() const { - std::stringstream s__; - s__ << "[{\"name\":\"x\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"}]"; - return s__.str(); + inline std::string get_unconstrained_sizedtypes() const final { + + return std::string("[{\"name\":\"x\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"}]"); } // get_unconstrained_sizedtypes() diff --git a/test/integration/good/code-gen/expressions/cpp.expected b/test/integration/good/code-gen/expressions/cpp.expected index 1e01ac2ac7..bfd0cee2db 100644 --- a/test/integration/good/code-gen/expressions/cpp.expected +++ b/test/integration/good/code-gen/expressions/cpp.expected @@ -322,13 +322,12 @@ class simple_function_model final : public model_base_crtp& names__) const { - names__.clear(); - + names__ = std::vector{}; } // get_param_names() inline void get_dims(std::vector>& dimss__) const { - dimss__.clear(); + dimss__ = std::vector>{}; } // get_dims() inline void constrained_param_names( @@ -365,16 +364,14 @@ class simple_function_model final : public model_base_crtp { inline void get_param_names(std::vector& names__) const { - names__.clear(); - names__.emplace_back("p_real"); - names__.emplace_back("p_real_array"); - names__.emplace_back("p_matrix"); - names__.emplace_back("p_vector"); - names__.emplace_back("p_row_vector"); - names__.emplace_back("y_p"); - names__.emplace_back("transformed_param_real"); + names__ = std::vector{"p_real", + "p_real_array", + "p_matrix", + "p_vector", + "p_row_vector", + "y_p", + "transformed_param_real"}; } // get_param_names() inline void get_dims(std::vector>& dimss__) const { - dimss__.clear(); - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{static_cast(d_int)}); - - dimss__.emplace_back(std::vector{static_cast(d_int), - static_cast(d_int)}); - - dimss__.emplace_back(std::vector{static_cast(d_int)}); - - dimss__.emplace_back(std::vector{static_cast(d_int)}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{}); + dimss__ = std::vector>{std::vector{}, + std::vector{static_cast(d_int)}, + std::vector{static_cast(d_int), + static_cast(d_int)}, + std::vector{static_cast(d_int)}, + std::vector{static_cast(d_int)}, + std::vector{}, + std::vector{}}; } // get_dims() inline void constrained_param_names( @@ -6262,16 +6254,14 @@ class distributions_model final : public model_base_crtp { } // unconstrained_param_names() - inline std::string get_constrained_sizedtypes() const { - std::stringstream s__; - s__ << "[{\"name\":\"p_real\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"p_real_array\",\"type\":{\"name\":\"array\",\"length\":" << d_int << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"p_matrix\",\"type\":{\"name\":\"matrix\",\"rows\":" << d_int << ",\"cols\":" << d_int << "},\"block\":\"parameters\"},{\"name\":\"p_vector\",\"type\":{\"name\":\"vector\",\"length\":" << d_int << "},\"block\":\"parameters\"},{\"name\":\"p_row_vector\",\"type\":{\"name\":\"vector\",\"length\":" << d_int << "},\"block\":\"parameters\"},{\"name\":\"y_p\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"transformed_param_real\",\"type\":{\"name\":\"real\"},\"block\":\"transformed_parameters\"}]"; - return s__.str(); + inline std::string get_constrained_sizedtypes() const final { + + return std::string("[{\"name\":\"p_real\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"p_real_array\",\"type\":{\"name\":\"array\",\"length\":" << d_int << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"p_matrix\",\"type\":{\"name\":\"matrix\",\"rows\":" << d_int << ",\"cols\":" << d_int << "},\"block\":\"parameters\"},{\"name\":\"p_vector\",\"type\":{\"name\":\"vector\",\"length\":" << d_int << "},\"block\":\"parameters\"},{\"name\":\"p_row_vector\",\"type\":{\"name\":\"vector\",\"length\":" << d_int << "},\"block\":\"parameters\"},{\"name\":\"y_p\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"transformed_param_real\",\"type\":{\"name\":\"real\"},\"block\":\"transformed_parameters\"}]"); } // get_constrained_sizedtypes() - inline std::string get_unconstrained_sizedtypes() const { - std::stringstream s__; - s__ << "[{\"name\":\"p_real\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"p_real_array\",\"type\":{\"name\":\"array\",\"length\":" << d_int << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"p_matrix\",\"type\":{\"name\":\"matrix\",\"rows\":" << d_int << ",\"cols\":" << d_int << "},\"block\":\"parameters\"},{\"name\":\"p_vector\",\"type\":{\"name\":\"vector\",\"length\":" << d_int << "},\"block\":\"parameters\"},{\"name\":\"p_row_vector\",\"type\":{\"name\":\"vector\",\"length\":" << d_int << "},\"block\":\"parameters\"},{\"name\":\"y_p\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"transformed_param_real\",\"type\":{\"name\":\"real\"},\"block\":\"transformed_parameters\"}]"; - return s__.str(); + inline std::string get_unconstrained_sizedtypes() const final { + + return std::string("[{\"name\":\"p_real\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"p_real_array\",\"type\":{\"name\":\"array\",\"length\":" << d_int << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"p_matrix\",\"type\":{\"name\":\"matrix\",\"rows\":" << d_int << ",\"cols\":" << d_int << "},\"block\":\"parameters\"},{\"name\":\"p_vector\",\"type\":{\"name\":\"vector\",\"length\":" << d_int << "},\"block\":\"parameters\"},{\"name\":\"p_row_vector\",\"type\":{\"name\":\"vector\",\"length\":" << d_int << "},\"block\":\"parameters\"},{\"name\":\"y_p\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"transformed_param_real\",\"type\":{\"name\":\"real\"},\"block\":\"transformed_parameters\"}]"); } // get_unconstrained_sizedtypes() @@ -6918,33 +6908,25 @@ class restricted_model final : public model_base_crtp { inline void get_param_names(std::vector& names__) const { - names__.clear(); - names__.emplace_back("p_real"); - names__.emplace_back("p_real_array"); - names__.emplace_back("p_matrix"); - names__.emplace_back("p_vector"); - names__.emplace_back("p_row_vector"); - names__.emplace_back("y_p"); - names__.emplace_back("transformed_param_real"); + names__ = std::vector{"p_real", + "p_real_array", + "p_matrix", + "p_vector", + "p_row_vector", + "y_p", + "transformed_param_real"}; } // get_param_names() inline void get_dims(std::vector>& dimss__) const { - dimss__.clear(); - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{static_cast(d_int)}); - - dimss__.emplace_back(std::vector{static_cast(d_int), - static_cast(d_int)}); - - dimss__.emplace_back(std::vector{static_cast(d_int)}); - - dimss__.emplace_back(std::vector{static_cast(d_int)}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{}); + dimss__ = std::vector>{std::vector{}, + std::vector{static_cast(d_int)}, + std::vector{static_cast(d_int), + static_cast(d_int)}, + std::vector{static_cast(d_int)}, + std::vector{static_cast(d_int)}, + std::vector{}, + std::vector{}}; } // get_dims() inline void constrained_param_names( @@ -7021,16 +7003,14 @@ class restricted_model final : public model_base_crtp { } // unconstrained_param_names() - inline std::string get_constrained_sizedtypes() const { - std::stringstream s__; - s__ << "[{\"name\":\"p_real\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"p_real_array\",\"type\":{\"name\":\"array\",\"length\":" << d_int << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"p_matrix\",\"type\":{\"name\":\"matrix\",\"rows\":" << d_int << ",\"cols\":" << d_int << "},\"block\":\"parameters\"},{\"name\":\"p_vector\",\"type\":{\"name\":\"vector\",\"length\":" << d_int << "},\"block\":\"parameters\"},{\"name\":\"p_row_vector\",\"type\":{\"name\":\"vector\",\"length\":" << d_int << "},\"block\":\"parameters\"},{\"name\":\"y_p\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"transformed_param_real\",\"type\":{\"name\":\"real\"},\"block\":\"transformed_parameters\"}]"; - return s__.str(); + inline std::string get_constrained_sizedtypes() const final { + + return std::string("[{\"name\":\"p_real\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"p_real_array\",\"type\":{\"name\":\"array\",\"length\":" << d_int << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"p_matrix\",\"type\":{\"name\":\"matrix\",\"rows\":" << d_int << ",\"cols\":" << d_int << "},\"block\":\"parameters\"},{\"name\":\"p_vector\",\"type\":{\"name\":\"vector\",\"length\":" << d_int << "},\"block\":\"parameters\"},{\"name\":\"p_row_vector\",\"type\":{\"name\":\"vector\",\"length\":" << d_int << "},\"block\":\"parameters\"},{\"name\":\"y_p\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"transformed_param_real\",\"type\":{\"name\":\"real\"},\"block\":\"transformed_parameters\"}]"); } // get_constrained_sizedtypes() - inline std::string get_unconstrained_sizedtypes() const { - std::stringstream s__; - s__ << "[{\"name\":\"p_real\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"p_real_array\",\"type\":{\"name\":\"array\",\"length\":" << d_int << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"p_matrix\",\"type\":{\"name\":\"matrix\",\"rows\":" << d_int << ",\"cols\":" << d_int << "},\"block\":\"parameters\"},{\"name\":\"p_vector\",\"type\":{\"name\":\"vector\",\"length\":" << d_int << "},\"block\":\"parameters\"},{\"name\":\"p_row_vector\",\"type\":{\"name\":\"vector\",\"length\":" << d_int << "},\"block\":\"parameters\"},{\"name\":\"y_p\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"transformed_param_real\",\"type\":{\"name\":\"real\"},\"block\":\"transformed_parameters\"}]"; - return s__.str(); + inline std::string get_unconstrained_sizedtypes() const final { + + return std::string("[{\"name\":\"p_real\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"p_real_array\",\"type\":{\"name\":\"array\",\"length\":" << d_int << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"p_matrix\",\"type\":{\"name\":\"matrix\",\"rows\":" << d_int << ",\"cols\":" << d_int << "},\"block\":\"parameters\"},{\"name\":\"p_vector\",\"type\":{\"name\":\"vector\",\"length\":" << d_int << "},\"block\":\"parameters\"},{\"name\":\"p_row_vector\",\"type\":{\"name\":\"vector\",\"length\":" << d_int << "},\"block\":\"parameters\"},{\"name\":\"y_p\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"transformed_param_real\",\"type\":{\"name\":\"real\"},\"block\":\"transformed_parameters\"}]"); } // get_unconstrained_sizedtypes() diff --git a/test/integration/good/code-gen/profiling/cpp.expected b/test/integration/good/code-gen/profiling/cpp.expected index 393eed5204..0b702b58f3 100644 --- a/test/integration/good/code-gen/profiling/cpp.expected +++ b/test/integration/good/code-gen/profiling/cpp.expected @@ -375,20 +375,16 @@ class simple_function_model final : public model_base_crtp& names__) const { - names__.clear(); - names__.emplace_back("rho"); - names__.emplace_back("alpha"); - names__.emplace_back("sigma"); + names__ = std::vector{"rho", + "alpha", + "sigma"}; } // get_param_names() inline void get_dims(std::vector>& dimss__) const { - dimss__.clear(); - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{}); + dimss__ = std::vector>{std::vector{}, + std::vector{}, + std::vector{}}; } // get_dims() inline void constrained_param_names( @@ -429,16 +425,14 @@ class simple_function_model final : public model_base_crtp& names__) const { - names__.clear(); - names__.emplace_back("beta"); - names__.emplace_back("gamma"); - names__.emplace_back("xi"); - names__.emplace_back("delta"); - names__.emplace_back("y"); + names__ = std::vector{"beta", + "gamma", + "xi", + "delta", + "y"}; } // get_param_names() inline void get_dims(std::vector>& dimss__) const { - dimss__.clear(); - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{static_cast(N_t), - static_cast(4)}); + dimss__ = std::vector>{std::vector{}, + std::vector{}, + std::vector{}, + std::vector{}, + std::vector{static_cast(N_t), static_cast(4)}}; } // get_dims() inline void constrained_param_names( @@ -773,16 +766,14 @@ class ad_level_failing_model final : public model_base_crtp { inline void get_param_names(std::vector& names__) const { - names__.clear(); - names__.emplace_back("mean_p"); - names__.emplace_back("beta"); - names__.emplace_back("phi"); - names__.emplace_back("p"); - names__.emplace_back("chi"); + names__ = std::vector{"mean_p", + "beta", + "phi", + "p", + "chi"}; } // get_param_names() inline void get_dims(std::vector>& dimss__) const { - dimss__.clear(); - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{static_cast(max_age)}); - - dimss__.emplace_back(std::vector{static_cast(nind), - static_cast(n_occ_minus_1) - }); - - dimss__.emplace_back(std::vector{static_cast(nind), - static_cast(n_occ_minus_1) - }); - - dimss__.emplace_back(std::vector{static_cast(nind), - static_cast(n_occasions)}); + dimss__ = std::vector>{std::vector{}, + std::vector{static_cast(max_age)}, + std::vector{static_cast(nind), + static_cast(n_occ_minus_1)}, + std::vector{static_cast(nind), + static_cast(n_occ_minus_1)}, + std::vector{static_cast(nind), + static_cast(n_occasions)}}; } // get_dims() inline void constrained_param_names( @@ -3048,16 +3031,14 @@ class copy_fail_model final : public model_base_crtp { } // unconstrained_param_names() - inline std::string get_constrained_sizedtypes() const { - std::stringstream s__; - s__ << "[{\"name\":\"mean_p\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"beta\",\"type\":{\"name\":\"vector\",\"length\":" << max_age << "},\"block\":\"parameters\"},{\"name\":\"phi\",\"type\":{\"name\":\"matrix\",\"rows\":" << nind << ",\"cols\":" << n_occ_minus_1 << "},\"block\":\"transformed_parameters\"},{\"name\":\"p\",\"type\":{\"name\":\"matrix\",\"rows\":" << nind << ",\"cols\":" << n_occ_minus_1 << "},\"block\":\"transformed_parameters\"},{\"name\":\"chi\",\"type\":{\"name\":\"matrix\",\"rows\":" << nind << ",\"cols\":" << n_occasions << "},\"block\":\"transformed_parameters\"}]"; - return s__.str(); + inline std::string get_constrained_sizedtypes() const final { + + return std::string("[{\"name\":\"mean_p\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"beta\",\"type\":{\"name\":\"vector\",\"length\":" << max_age << "},\"block\":\"parameters\"},{\"name\":\"phi\",\"type\":{\"name\":\"matrix\",\"rows\":" << nind << ",\"cols\":" << n_occ_minus_1 << "},\"block\":\"transformed_parameters\"},{\"name\":\"p\",\"type\":{\"name\":\"matrix\",\"rows\":" << nind << ",\"cols\":" << n_occ_minus_1 << "},\"block\":\"transformed_parameters\"},{\"name\":\"chi\",\"type\":{\"name\":\"matrix\",\"rows\":" << nind << ",\"cols\":" << n_occasions << "},\"block\":\"transformed_parameters\"}]"); } // get_constrained_sizedtypes() - inline std::string get_unconstrained_sizedtypes() const { - std::stringstream s__; - s__ << "[{\"name\":\"mean_p\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"beta\",\"type\":{\"name\":\"vector\",\"length\":" << max_age << "},\"block\":\"parameters\"},{\"name\":\"phi\",\"type\":{\"name\":\"matrix\",\"rows\":" << nind << ",\"cols\":" << n_occ_minus_1 << "},\"block\":\"transformed_parameters\"},{\"name\":\"p\",\"type\":{\"name\":\"matrix\",\"rows\":" << nind << ",\"cols\":" << n_occ_minus_1 << "},\"block\":\"transformed_parameters\"},{\"name\":\"chi\",\"type\":{\"name\":\"matrix\",\"rows\":" << nind << ",\"cols\":" << n_occasions << "},\"block\":\"transformed_parameters\"}]"; - return s__.str(); + inline std::string get_unconstrained_sizedtypes() const final { + + return std::string("[{\"name\":\"mean_p\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"beta\",\"type\":{\"name\":\"vector\",\"length\":" << max_age << "},\"block\":\"parameters\"},{\"name\":\"phi\",\"type\":{\"name\":\"matrix\",\"rows\":" << nind << ",\"cols\":" << n_occ_minus_1 << "},\"block\":\"transformed_parameters\"},{\"name\":\"p\",\"type\":{\"name\":\"matrix\",\"rows\":" << nind << ",\"cols\":" << n_occ_minus_1 << "},\"block\":\"transformed_parameters\"},{\"name\":\"chi\",\"type\":{\"name\":\"matrix\",\"rows\":" << nind << ",\"cols\":" << n_occasions << "},\"block\":\"transformed_parameters\"}]"); } // get_unconstrained_sizedtypes() @@ -4487,60 +4468,43 @@ class dce_fail_model final : public model_base_crtp { inline void get_param_names(std::vector& names__) const { - names__.clear(); - names__.emplace_back("sigma"); - names__.emplace_back("sigma_age"); - names__.emplace_back("sigma_edu"); - names__.emplace_back("sigma_state"); - names__.emplace_back("sigma_region"); - names__.emplace_back("sigma_age_edu"); - names__.emplace_back("b_0"); - names__.emplace_back("b_female"); - names__.emplace_back("b_black"); - names__.emplace_back("b_female_black"); - names__.emplace_back("b_v_prev"); - names__.emplace_back("b_age"); - names__.emplace_back("b_edu"); - names__.emplace_back("b_region"); - names__.emplace_back("b_age_edu"); - names__.emplace_back("b_hat"); + names__ = std::vector{"sigma", + "sigma_age", + "sigma_edu", + "sigma_state", + "sigma_region", + "sigma_age_edu", + "b_0", + "b_female", + "b_black", + "b_female_black", + "b_v_prev", + "b_age", + "b_edu", + "b_region", + "b_age_edu", + "b_hat"}; } // get_param_names() inline void get_dims(std::vector>& dimss__) const { - dimss__.clear(); - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{static_cast(n_age)}); - - dimss__.emplace_back(std::vector{static_cast(n_edu)}); - - dimss__.emplace_back(std::vector{static_cast(n_region)}); - - dimss__.emplace_back(std::vector{static_cast(n_age), - static_cast(n_edu)}); - - dimss__.emplace_back(std::vector{static_cast(n_state)}); + dimss__ = std::vector>{std::vector{}, + std::vector{}, + std::vector{}, + std::vector{}, + std::vector{}, + std::vector{}, + std::vector{}, + std::vector{}, + std::vector{}, + std::vector{}, + std::vector{}, + std::vector{static_cast(n_age)}, + std::vector{static_cast(n_edu)}, + std::vector{static_cast(n_region)}, + std::vector{static_cast(n_age), + static_cast(n_edu)}, + std::vector{static_cast(n_state)}}; } // get_dims() inline void constrained_param_names( @@ -4643,16 +4607,14 @@ class dce_fail_model final : public model_base_crtp { } // unconstrained_param_names() - inline std::string get_constrained_sizedtypes() const { - std::stringstream s__; - s__ << "[{\"name\":\"sigma\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"sigma_age\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"sigma_edu\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"sigma_state\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"sigma_region\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"sigma_age_edu\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"b_0\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"b_female\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"b_black\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"b_female_black\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"b_v_prev\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"b_age\",\"type\":{\"name\":\"vector\",\"length\":" << n_age << "},\"block\":\"parameters\"},{\"name\":\"b_edu\",\"type\":{\"name\":\"vector\",\"length\":" << n_edu << "},\"block\":\"parameters\"},{\"name\":\"b_region\",\"type\":{\"name\":\"vector\",\"length\":" << n_region << "},\"block\":\"parameters\"},{\"name\":\"b_age_edu\",\"type\":{\"name\":\"matrix\",\"rows\":" << n_age << ",\"cols\":" << n_edu << "},\"block\":\"parameters\"},{\"name\":\"b_hat\",\"type\":{\"name\":\"vector\",\"length\":" << n_state << "},\"block\":\"parameters\"}]"; - return s__.str(); + inline std::string get_constrained_sizedtypes() const final { + + return std::string("[{\"name\":\"sigma\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"sigma_age\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"sigma_edu\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"sigma_state\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"sigma_region\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"sigma_age_edu\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"b_0\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"b_female\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"b_black\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"b_female_black\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"b_v_prev\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"b_age\",\"type\":{\"name\":\"vector\",\"length\":" << n_age << "},\"block\":\"parameters\"},{\"name\":\"b_edu\",\"type\":{\"name\":\"vector\",\"length\":" << n_edu << "},\"block\":\"parameters\"},{\"name\":\"b_region\",\"type\":{\"name\":\"vector\",\"length\":" << n_region << "},\"block\":\"parameters\"},{\"name\":\"b_age_edu\",\"type\":{\"name\":\"matrix\",\"rows\":" << n_age << ",\"cols\":" << n_edu << "},\"block\":\"parameters\"},{\"name\":\"b_hat\",\"type\":{\"name\":\"vector\",\"length\":" << n_state << "},\"block\":\"parameters\"}]"); } // get_constrained_sizedtypes() - inline std::string get_unconstrained_sizedtypes() const { - std::stringstream s__; - s__ << "[{\"name\":\"sigma\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"sigma_age\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"sigma_edu\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"sigma_state\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"sigma_region\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"sigma_age_edu\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"b_0\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"b_female\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"b_black\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"b_female_black\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"b_v_prev\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"b_age\",\"type\":{\"name\":\"vector\",\"length\":" << n_age << "},\"block\":\"parameters\"},{\"name\":\"b_edu\",\"type\":{\"name\":\"vector\",\"length\":" << n_edu << "},\"block\":\"parameters\"},{\"name\":\"b_region\",\"type\":{\"name\":\"vector\",\"length\":" << n_region << "},\"block\":\"parameters\"},{\"name\":\"b_age_edu\",\"type\":{\"name\":\"matrix\",\"rows\":" << n_age << ",\"cols\":" << n_edu << "},\"block\":\"parameters\"},{\"name\":\"b_hat\",\"type\":{\"name\":\"vector\",\"length\":" << n_state << "},\"block\":\"parameters\"}]"; - return s__.str(); + inline std::string get_unconstrained_sizedtypes() const final { + + return std::string("[{\"name\":\"sigma\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"sigma_age\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"sigma_edu\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"sigma_state\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"sigma_region\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"sigma_age_edu\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"b_0\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"b_female\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"b_black\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"b_female_black\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"b_v_prev\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"b_age\",\"type\":{\"name\":\"vector\",\"length\":" << n_age << "},\"block\":\"parameters\"},{\"name\":\"b_edu\",\"type\":{\"name\":\"vector\",\"length\":" << n_edu << "},\"block\":\"parameters\"},{\"name\":\"b_region\",\"type\":{\"name\":\"vector\",\"length\":" << n_region << "},\"block\":\"parameters\"},{\"name\":\"b_age_edu\",\"type\":{\"name\":\"matrix\",\"rows\":" << n_age << ",\"cols\":" << n_edu << "},\"block\":\"parameters\"},{\"name\":\"b_hat\",\"type\":{\"name\":\"vector\",\"length\":" << n_state << "},\"block\":\"parameters\"}]"); } // get_unconstrained_sizedtypes() @@ -4948,13 +4910,12 @@ class expr_prop_experiment_model final : public model_base_crtp& names__) const { - names__.clear(); - + names__ = std::vector{}; } // get_param_names() inline void get_dims(std::vector>& dimss__) const { - dimss__.clear(); + dimss__ = std::vector>{}; } // get_dims() inline void constrained_param_names( @@ -4991,16 +4952,14 @@ class expr_prop_experiment_model final : public model_base_crtp& names__) const { - names__.clear(); - + names__ = std::vector{}; } // get_param_names() inline void get_dims(std::vector>& dimss__) const { - dimss__.clear(); + dimss__ = std::vector>{}; } // get_dims() inline void constrained_param_names( @@ -5336,16 +5294,14 @@ class expr_prop_experiment2_model final : public model_base_crtp inline void get_param_names(std::vector& names__) const { - names__.clear(); - names__.emplace_back("mu"); - names__.emplace_back("sigma"); - names__.emplace_back("theta"); + names__ = std::vector{"mu", + "sigma", + "theta"}; } // get_param_names() inline void get_dims(std::vector>& dimss__) const { - dimss__.clear(); - dimss__.emplace_back(std::vector{static_cast(2)}); - - dimss__.emplace_back(std::vector{static_cast(2)}); - - dimss__.emplace_back(std::vector{}); + dimss__ = std::vector>{std::vector{ + static_cast(2) + }, + std::vector{static_cast(2)}, + std::vector{}}; } // get_dims() inline void constrained_param_names( @@ -5902,16 +5856,14 @@ class expr_prop_fail_model final : public model_base_crtp } // unconstrained_param_names() - inline std::string get_constrained_sizedtypes() const { - std::stringstream s__; - s__ << "[{\"name\":\"mu\",\"type\":{\"name\":\"vector\",\"length\":" << 2 << "},\"block\":\"parameters\"},{\"name\":\"sigma\",\"type\":{\"name\":\"array\",\"length\":" << 2 << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"theta\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"}]"; - return s__.str(); + inline std::string get_constrained_sizedtypes() const final { + + return std::string("[{\"name\":\"mu\",\"type\":{\"name\":\"vector\",\"length\":" << 2 << "},\"block\":\"parameters\"},{\"name\":\"sigma\",\"type\":{\"name\":\"array\",\"length\":" << 2 << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"theta\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"}]"); } // get_constrained_sizedtypes() - inline std::string get_unconstrained_sizedtypes() const { - std::stringstream s__; - s__ << "[{\"name\":\"mu\",\"type\":{\"name\":\"vector\",\"length\":" << 2 << "},\"block\":\"parameters\"},{\"name\":\"sigma\",\"type\":{\"name\":\"array\",\"length\":" << 2 << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"theta\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"}]"; - return s__.str(); + inline std::string get_unconstrained_sizedtypes() const final { + + return std::string("[{\"name\":\"mu\",\"type\":{\"name\":\"vector\",\"length\":" << 2 << "},\"block\":\"parameters\"},{\"name\":\"sigma\",\"type\":{\"name\":\"array\",\"length\":" << 2 << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"theta\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"}]"); } // get_unconstrained_sizedtypes() @@ -6306,20 +6258,16 @@ class expr_prop_fail2_model final : public model_base_crtp& names__) const { - names__.clear(); - names__.emplace_back("mu"); - names__.emplace_back("theta"); - names__.emplace_back("tau"); + names__ = std::vector{"mu", + "theta", + "tau"}; } // get_param_names() inline void get_dims(std::vector>& dimss__) const { - dimss__.clear(); - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{static_cast(J)}); - - dimss__.emplace_back(std::vector{}); + dimss__ = std::vector>{std::vector{}, + std::vector{static_cast(J)}, + std::vector{}}; } // get_dims() inline void constrained_param_names( @@ -6366,16 +6314,14 @@ class expr_prop_fail2_model final : public model_base_crtp& names__) const { - names__.clear(); - names__.emplace_back("a"); - names__.emplace_back("b"); - names__.emplace_back("c"); - names__.emplace_back("d"); - names__.emplace_back("e"); - names__.emplace_back("beta"); - names__.emplace_back("sigma_a"); - names__.emplace_back("sigma_b"); - names__.emplace_back("sigma_c"); - names__.emplace_back("sigma_d"); - names__.emplace_back("sigma_e"); - names__.emplace_back("y_hat"); + names__ = std::vector{"a", + "b", + "c", + "d", + "e", + "beta", + "sigma_a", + "sigma_b", + "sigma_c", + "sigma_d", + "sigma_e", + "y_hat"}; } // get_param_names() inline void get_dims(std::vector>& dimss__) const { - dimss__.clear(); - dimss__.emplace_back(std::vector{static_cast(n_age)}); - - dimss__.emplace_back(std::vector{static_cast(n_edu)}); - - dimss__.emplace_back(std::vector{static_cast(n_age_edu)}); - - dimss__.emplace_back(std::vector{static_cast(n_state)}); - - dimss__.emplace_back(std::vector{ - static_cast(n_region_full) - }); - - dimss__.emplace_back(std::vector{static_cast(5)}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{static_cast(N)}); + dimss__ = std::vector>{std::vector{ + static_cast(n_age) + }, + std::vector{static_cast(n_edu)}, + std::vector{static_cast(n_age_edu)}, + std::vector{static_cast(n_state)}, + std::vector{static_cast(n_region_full)}, + std::vector{static_cast(5)}, + std::vector{}, + std::vector{}, + std::vector{}, + std::vector{}, + std::vector{}, + std::vector{static_cast(N)}}; } // get_dims() inline void constrained_param_names( @@ -7942,16 +7875,14 @@ class expr_prop_fail3_model final : public model_base_crtp& names__) const { - names__.clear(); - names__.emplace_back("tau_phi"); - names__.emplace_back("phi_std_raw"); - names__.emplace_back("sigma_phi"); - names__.emplace_back("phi"); - names__.emplace_back("beta0"); - names__.emplace_back("beta1"); - names__.emplace_back("tau_theta"); - names__.emplace_back("sigma_theta"); - names__.emplace_back("theta"); - names__.emplace_back("theta_std"); - names__.emplace_back("x"); - names__.emplace_back("y"); + names__ = std::vector{"tau_phi", + "phi_std_raw", + "sigma_phi", + "phi", + "beta0", + "beta1", + "tau_theta", + "sigma_theta", + "theta", + "theta_std", + "x", + "y"}; } // get_param_names() inline void get_dims(std::vector>& dimss__) const { - dimss__.clear(); - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{ - static_cast(phi_std_raw_1dim__) - }); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{static_cast(N)}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{static_cast(N)}); - - dimss__.emplace_back(std::vector{static_cast(N)}); - - dimss__.emplace_back(std::vector{static_cast(N)}); - - dimss__.emplace_back(std::vector{static_cast(N)}); + dimss__ = std::vector>{std::vector{}, + std::vector{static_cast(phi_std_raw_1dim__)}, + std::vector{}, + std::vector{static_cast(N)}, + std::vector{}, + std::vector{}, + std::vector{}, + std::vector{}, + std::vector{static_cast(N)}, + std::vector{static_cast(N)}, + std::vector{static_cast(N)}, + std::vector{static_cast(N)}}; } // get_dims() inline void constrained_param_names( @@ -8844,16 +8760,14 @@ class expr_prop_fail4_model final : public model_base_crtp& names__) const { - names__.clear(); - names__.emplace_back("mean_phi"); - names__.emplace_back("mean_p"); - names__.emplace_back("epsilon"); - names__.emplace_back("sigma"); - names__.emplace_back("phi"); - names__.emplace_back("p"); - names__.emplace_back("chi"); - names__.emplace_back("mu"); - names__.emplace_back("sigma2"); + names__ = std::vector{"mean_phi", + "mean_p", + "epsilon", + "sigma", + "phi", + "p", + "chi", + "mu", + "sigma2"}; } // get_param_names() inline void get_dims(std::vector>& dimss__) const { - dimss__.clear(); - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{static_cast(nind)}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{static_cast(nind), - static_cast(n_occ_minus_1) - }); - - dimss__.emplace_back(std::vector{static_cast(nind), - static_cast(n_occ_minus_1) - }); - - dimss__.emplace_back(std::vector{static_cast(nind), - static_cast(n_occasions)}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{}); + dimss__ = std::vector>{std::vector{}, + std::vector{}, + std::vector{static_cast(nind)}, + std::vector{}, + std::vector{static_cast(nind), + static_cast(n_occ_minus_1)}, + std::vector{static_cast(nind), + static_cast(n_occ_minus_1)}, + std::vector{static_cast(nind), + static_cast(n_occasions)}, + std::vector{}, + std::vector{}}; } // get_dims() inline void constrained_param_names( @@ -11044,16 +10946,14 @@ class expr_prop_fail5_model final : public model_base_crtp& names__) const { - names__.clear(); - names__.emplace_back("mean_phi"); - names__.emplace_back("mean_p"); - names__.emplace_back("psi"); - names__.emplace_back("beta"); - names__.emplace_back("epsilon"); - names__.emplace_back("sigma"); - names__.emplace_back("phi"); - names__.emplace_back("p"); - names__.emplace_back("b"); - names__.emplace_back("nu"); - names__.emplace_back("chi"); - names__.emplace_back("sigma2"); - names__.emplace_back("Nsuper"); - names__.emplace_back("N"); - names__.emplace_back("B"); - names__.emplace_back("z"); + names__ = std::vector{"mean_phi", + "mean_p", + "psi", + "beta", + "epsilon", + "sigma", + "phi", + "p", + "b", + "nu", + "chi", + "sigma2", + "Nsuper", + "N", + "B", + "z"}; } // get_param_names() inline void get_dims(std::vector>& dimss__) const { - dimss__.clear(); - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{static_cast(n_occasions)}); - - dimss__.emplace_back(std::vector{static_cast(M)}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{static_cast(M), - static_cast(phi_2dim__)}); - - dimss__.emplace_back(std::vector{static_cast(M), - static_cast(n_occasions)}); - - dimss__.emplace_back(std::vector{static_cast(n_occasions)}); - - dimss__.emplace_back(std::vector{static_cast(n_occasions)}); - - dimss__.emplace_back(std::vector{static_cast(M), - static_cast(n_occasions)}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{static_cast(n_occasions)}); - - dimss__.emplace_back(std::vector{static_cast(n_occasions)}); - - dimss__.emplace_back(std::vector{static_cast(M), - static_cast(n_occasions)}); + dimss__ = std::vector>{std::vector{}, + std::vector{}, + std::vector{}, + std::vector{static_cast(n_occasions)}, + std::vector{static_cast(M)}, + std::vector{}, + std::vector{static_cast(M), + static_cast(phi_2dim__)}, + std::vector{static_cast(M), + static_cast(n_occasions)}, + std::vector{static_cast(n_occasions)}, + std::vector{static_cast(n_occasions)}, + std::vector{static_cast(M), + static_cast(n_occasions)}, + std::vector{}, + std::vector{}, + std::vector{static_cast(n_occasions)}, + std::vector{static_cast(n_occasions)}, + std::vector{static_cast(M), + static_cast(n_occasions)}}; } // get_dims() inline void constrained_param_names( @@ -14795,16 +14678,14 @@ class expr_prop_fail6_model final : public model_base_crtp& names__) const { - names__.clear(); - names__.emplace_back("pi"); - names__.emplace_back("theta"); - names__.emplace_back("log_Pr_z"); + names__ = std::vector{"pi", + "theta", + "log_Pr_z"}; } // get_param_names() inline void get_dims(std::vector>& dimss__) const { - dimss__.clear(); - dimss__.emplace_back(std::vector{static_cast(K)}); - - dimss__.emplace_back(std::vector{static_cast(J), - static_cast(K), - static_cast(K)}); - - dimss__.emplace_back(std::vector{static_cast(I), - static_cast(K)}); + dimss__ = std::vector>{std::vector{ + static_cast(K) + }, + std::vector{static_cast(J), static_cast(K), + static_cast(K)}, + std::vector{static_cast(I), static_cast(K)}}; } // get_dims() inline void constrained_param_names( @@ -16072,16 +15949,14 @@ class expr_prop_fail7_model final : public model_base_crtp& names__) const { - names__.clear(); - names__.emplace_back("beta0"); - names__.emplace_back("beta1"); - names__.emplace_back("tau_theta"); - names__.emplace_back("tau_phi"); - names__.emplace_back("theta_std"); - names__.emplace_back("phi_std_raw"); - names__.emplace_back("sigma_phi"); - names__.emplace_back("phi"); + names__ = std::vector{"beta0", + "beta1", + "tau_theta", + "tau_phi", + "theta_std", + "phi_std_raw", + "sigma_phi", + "phi"}; } // get_param_names() inline void get_dims(std::vector>& dimss__) const { - dimss__.clear(); - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{static_cast(N)}); - - dimss__.emplace_back(std::vector{static_cast(N)}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{static_cast(N)}); + dimss__ = std::vector>{std::vector{}, + std::vector{}, + std::vector{}, + std::vector{}, + std::vector{static_cast(N)}, + std::vector{static_cast(N)}, + std::vector{}, + std::vector{static_cast(N)}}; } // get_dims() inline void constrained_param_names( @@ -16879,16 +16745,14 @@ class expr_prop_fail8_model final : public model_base_crtp { inline void get_param_names(std::vector& names__) const { - names__.clear(); - names__.emplace_back("mean_p"); - names__.emplace_back("beta"); - names__.emplace_back("phi"); - names__.emplace_back("p"); - names__.emplace_back("chi"); + names__ = std::vector{"mean_p", + "beta", + "phi", + "p", + "chi"}; } // get_param_names() inline void get_dims(std::vector>& dimss__) const { - dimss__.clear(); - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{static_cast(max_age)}); - - dimss__.emplace_back(std::vector{static_cast(nind), - static_cast(n_occ_minus_1) - }); - - dimss__.emplace_back(std::vector{static_cast(nind), - static_cast(n_occ_minus_1) - }); - - dimss__.emplace_back(std::vector{static_cast(nind), - static_cast(n_occasions)}); + dimss__ = std::vector>{std::vector{}, + std::vector{static_cast(max_age)}, + std::vector{static_cast(nind), + static_cast(n_occ_minus_1)}, + std::vector{static_cast(nind), + static_cast(n_occ_minus_1)}, + std::vector{static_cast(nind), + static_cast(n_occasions)}}; } // get_dims() inline void constrained_param_names( @@ -19151,16 +19007,14 @@ class fails_test_model final : public model_base_crtp { } // unconstrained_param_names() - inline std::string get_constrained_sizedtypes() const { - std::stringstream s__; - s__ << "[{\"name\":\"mean_p\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"beta\",\"type\":{\"name\":\"vector\",\"length\":" << max_age << "},\"block\":\"parameters\"},{\"name\":\"phi\",\"type\":{\"name\":\"matrix\",\"rows\":" << nind << ",\"cols\":" << n_occ_minus_1 << "},\"block\":\"transformed_parameters\"},{\"name\":\"p\",\"type\":{\"name\":\"matrix\",\"rows\":" << nind << ",\"cols\":" << n_occ_minus_1 << "},\"block\":\"transformed_parameters\"},{\"name\":\"chi\",\"type\":{\"name\":\"matrix\",\"rows\":" << nind << ",\"cols\":" << n_occasions << "},\"block\":\"transformed_parameters\"}]"; - return s__.str(); + inline std::string get_constrained_sizedtypes() const final { + + return std::string("[{\"name\":\"mean_p\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"beta\",\"type\":{\"name\":\"vector\",\"length\":" << max_age << "},\"block\":\"parameters\"},{\"name\":\"phi\",\"type\":{\"name\":\"matrix\",\"rows\":" << nind << ",\"cols\":" << n_occ_minus_1 << "},\"block\":\"transformed_parameters\"},{\"name\":\"p\",\"type\":{\"name\":\"matrix\",\"rows\":" << nind << ",\"cols\":" << n_occ_minus_1 << "},\"block\":\"transformed_parameters\"},{\"name\":\"chi\",\"type\":{\"name\":\"matrix\",\"rows\":" << nind << ",\"cols\":" << n_occasions << "},\"block\":\"transformed_parameters\"}]"); } // get_constrained_sizedtypes() - inline std::string get_unconstrained_sizedtypes() const { - std::stringstream s__; - s__ << "[{\"name\":\"mean_p\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"beta\",\"type\":{\"name\":\"vector\",\"length\":" << max_age << "},\"block\":\"parameters\"},{\"name\":\"phi\",\"type\":{\"name\":\"matrix\",\"rows\":" << nind << ",\"cols\":" << n_occ_minus_1 << "},\"block\":\"transformed_parameters\"},{\"name\":\"p\",\"type\":{\"name\":\"matrix\",\"rows\":" << nind << ",\"cols\":" << n_occ_minus_1 << "},\"block\":\"transformed_parameters\"},{\"name\":\"chi\",\"type\":{\"name\":\"matrix\",\"rows\":" << nind << ",\"cols\":" << n_occasions << "},\"block\":\"transformed_parameters\"}]"; - return s__.str(); + inline std::string get_unconstrained_sizedtypes() const final { + + return std::string("[{\"name\":\"mean_p\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"beta\",\"type\":{\"name\":\"vector\",\"length\":" << max_age << "},\"block\":\"parameters\"},{\"name\":\"phi\",\"type\":{\"name\":\"matrix\",\"rows\":" << nind << ",\"cols\":" << n_occ_minus_1 << "},\"block\":\"transformed_parameters\"},{\"name\":\"p\",\"type\":{\"name\":\"matrix\",\"rows\":" << nind << ",\"cols\":" << n_occ_minus_1 << "},\"block\":\"transformed_parameters\"},{\"name\":\"chi\",\"type\":{\"name\":\"matrix\",\"rows\":" << nind << ",\"cols\":" << n_occasions << "},\"block\":\"transformed_parameters\"}]"); } // get_unconstrained_sizedtypes() @@ -22602,62 +22456,44 @@ class inlining_fail2_model final : public model_base_crtp inline void get_param_names(std::vector& names__) const { - names__.clear(); - names__.emplace_back("mean_phi"); - names__.emplace_back("mean_p"); - names__.emplace_back("gamma"); - names__.emplace_back("epsilon"); - names__.emplace_back("sigma"); - names__.emplace_back("phi"); - names__.emplace_back("p"); - names__.emplace_back("chi"); - names__.emplace_back("sigma2"); - names__.emplace_back("psi"); - names__.emplace_back("b"); - names__.emplace_back("Nsuper"); - names__.emplace_back("N"); - names__.emplace_back("B"); - names__.emplace_back("z"); + names__ = std::vector{"mean_phi", + "mean_p", + "gamma", + "epsilon", + "sigma", + "phi", + "p", + "chi", + "sigma2", + "psi", + "b", + "Nsuper", + "N", + "B", + "z"}; } // get_param_names() inline void get_dims(std::vector>& dimss__) const { - dimss__.clear(); - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{static_cast(n_occasions)}); - - dimss__.emplace_back(std::vector{ - static_cast(epsilon_1dim__) - }); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{static_cast(M), - static_cast(phi_2dim__)}); - - dimss__.emplace_back(std::vector{static_cast(M), - static_cast(n_occasions)}); - - dimss__.emplace_back(std::vector{static_cast(M), - static_cast(n_occasions)}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{static_cast(n_occasions)}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{static_cast(n_occasions)}); - - dimss__.emplace_back(std::vector{static_cast(n_occasions)}); - - dimss__.emplace_back(std::vector{static_cast(M), - static_cast(n_occasions)}); + dimss__ = std::vector>{std::vector{}, + std::vector{}, + std::vector{static_cast(n_occasions)}, + std::vector{static_cast(epsilon_1dim__)}, + std::vector{}, + std::vector{static_cast(M), + static_cast(phi_2dim__)}, + std::vector{static_cast(M), + static_cast(n_occasions)}, + std::vector{static_cast(M), + static_cast(n_occasions)}, + std::vector{}, + std::vector{}, + std::vector{static_cast(n_occasions)}, + std::vector{}, + std::vector{static_cast(n_occasions)}, + std::vector{static_cast(n_occasions)}, + std::vector{static_cast(M), + static_cast(n_occasions)}}; } // get_dims() inline void constrained_param_names( @@ -22796,16 +22632,14 @@ class inlining_fail2_model final : public model_base_crtp } // unconstrained_param_names() - inline std::string get_constrained_sizedtypes() const { - std::stringstream s__; - s__ << "[{\"name\":\"mean_phi\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"mean_p\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"gamma\",\"type\":{\"name\":\"vector\",\"length\":" << n_occasions << "},\"block\":\"parameters\"},{\"name\":\"epsilon\",\"type\":{\"name\":\"vector\",\"length\":" << epsilon_1dim__ << "},\"block\":\"parameters\"},{\"name\":\"sigma\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"phi\",\"type\":{\"name\":\"matrix\",\"rows\":" << M << ",\"cols\":" << phi_2dim__ << "},\"block\":\"transformed_parameters\"},{\"name\":\"p\",\"type\":{\"name\":\"matrix\",\"rows\":" << M << ",\"cols\":" << n_occasions << "},\"block\":\"transformed_parameters\"},{\"name\":\"chi\",\"type\":{\"name\":\"matrix\",\"rows\":" << M << ",\"cols\":" << n_occasions << "},\"block\":\"transformed_parameters\"},{\"name\":\"sigma2\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"psi\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"b\",\"type\":{\"name\":\"vector\",\"length\":" << n_occasions << "},\"block\":\"generated_quantities\"},{\"name\":\"Nsuper\",\"type\":{\"name\":\"int\"},\"block\":\"generated_quantities\"},{\"name\":\"N\",\"type\":{\"name\":\"array\",\"length\":" << n_occasions << ",\"element_type\":{\"name\":\"int\"}},\"block\":\"generated_quantities\"},{\"name\":\"B\",\"type\":{\"name\":\"array\",\"length\":" << n_occasions << ",\"element_type\":{\"name\":\"int\"}},\"block\":\"generated_quantities\"},{\"name\":\"z\",\"type\":{\"name\":\"array\",\"length\":" << M << ",\"element_type\":{\"name\":\"array\",\"length\":" << n_occasions << ",\"element_type\":{\"name\":\"int\"}}},\"block\":\"generated_quantities\"}]"; - return s__.str(); + inline std::string get_constrained_sizedtypes() const final { + + return std::string("[{\"name\":\"mean_phi\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"mean_p\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"gamma\",\"type\":{\"name\":\"vector\",\"length\":" << n_occasions << "},\"block\":\"parameters\"},{\"name\":\"epsilon\",\"type\":{\"name\":\"vector\",\"length\":" << epsilon_1dim__ << "},\"block\":\"parameters\"},{\"name\":\"sigma\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"phi\",\"type\":{\"name\":\"matrix\",\"rows\":" << M << ",\"cols\":" << phi_2dim__ << "},\"block\":\"transformed_parameters\"},{\"name\":\"p\",\"type\":{\"name\":\"matrix\",\"rows\":" << M << ",\"cols\":" << n_occasions << "},\"block\":\"transformed_parameters\"},{\"name\":\"chi\",\"type\":{\"name\":\"matrix\",\"rows\":" << M << ",\"cols\":" << n_occasions << "},\"block\":\"transformed_parameters\"},{\"name\":\"sigma2\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"psi\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"b\",\"type\":{\"name\":\"vector\",\"length\":" << n_occasions << "},\"block\":\"generated_quantities\"},{\"name\":\"Nsuper\",\"type\":{\"name\":\"int\"},\"block\":\"generated_quantities\"},{\"name\":\"N\",\"type\":{\"name\":\"array\",\"length\":" << n_occasions << ",\"element_type\":{\"name\":\"int\"}},\"block\":\"generated_quantities\"},{\"name\":\"B\",\"type\":{\"name\":\"array\",\"length\":" << n_occasions << ",\"element_type\":{\"name\":\"int\"}},\"block\":\"generated_quantities\"},{\"name\":\"z\",\"type\":{\"name\":\"array\",\"length\":" << M << ",\"element_type\":{\"name\":\"array\",\"length\":" << n_occasions << ",\"element_type\":{\"name\":\"int\"}}},\"block\":\"generated_quantities\"}]"); } // get_constrained_sizedtypes() - inline std::string get_unconstrained_sizedtypes() const { - std::stringstream s__; - s__ << "[{\"name\":\"mean_phi\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"mean_p\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"gamma\",\"type\":{\"name\":\"vector\",\"length\":" << n_occasions << "},\"block\":\"parameters\"},{\"name\":\"epsilon\",\"type\":{\"name\":\"vector\",\"length\":" << epsilon_1dim__ << "},\"block\":\"parameters\"},{\"name\":\"sigma\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"phi\",\"type\":{\"name\":\"matrix\",\"rows\":" << M << ",\"cols\":" << phi_2dim__ << "},\"block\":\"transformed_parameters\"},{\"name\":\"p\",\"type\":{\"name\":\"matrix\",\"rows\":" << M << ",\"cols\":" << n_occasions << "},\"block\":\"transformed_parameters\"},{\"name\":\"chi\",\"type\":{\"name\":\"matrix\",\"rows\":" << M << ",\"cols\":" << n_occasions << "},\"block\":\"transformed_parameters\"},{\"name\":\"sigma2\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"psi\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"b\",\"type\":{\"name\":\"vector\",\"length\":" << n_occasions << "},\"block\":\"generated_quantities\"},{\"name\":\"Nsuper\",\"type\":{\"name\":\"int\"},\"block\":\"generated_quantities\"},{\"name\":\"N\",\"type\":{\"name\":\"array\",\"length\":" << n_occasions << ",\"element_type\":{\"name\":\"int\"}},\"block\":\"generated_quantities\"},{\"name\":\"B\",\"type\":{\"name\":\"array\",\"length\":" << n_occasions << ",\"element_type\":{\"name\":\"int\"}},\"block\":\"generated_quantities\"},{\"name\":\"z\",\"type\":{\"name\":\"array\",\"length\":" << M << ",\"element_type\":{\"name\":\"array\",\"length\":" << n_occasions << ",\"element_type\":{\"name\":\"int\"}}},\"block\":\"generated_quantities\"}]"; - return s__.str(); + inline std::string get_unconstrained_sizedtypes() const final { + + return std::string("[{\"name\":\"mean_phi\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"mean_p\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"gamma\",\"type\":{\"name\":\"vector\",\"length\":" << n_occasions << "},\"block\":\"parameters\"},{\"name\":\"epsilon\",\"type\":{\"name\":\"vector\",\"length\":" << epsilon_1dim__ << "},\"block\":\"parameters\"},{\"name\":\"sigma\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"phi\",\"type\":{\"name\":\"matrix\",\"rows\":" << M << ",\"cols\":" << phi_2dim__ << "},\"block\":\"transformed_parameters\"},{\"name\":\"p\",\"type\":{\"name\":\"matrix\",\"rows\":" << M << ",\"cols\":" << n_occasions << "},\"block\":\"transformed_parameters\"},{\"name\":\"chi\",\"type\":{\"name\":\"matrix\",\"rows\":" << M << ",\"cols\":" << n_occasions << "},\"block\":\"transformed_parameters\"},{\"name\":\"sigma2\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"psi\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"b\",\"type\":{\"name\":\"vector\",\"length\":" << n_occasions << "},\"block\":\"generated_quantities\"},{\"name\":\"Nsuper\",\"type\":{\"name\":\"int\"},\"block\":\"generated_quantities\"},{\"name\":\"N\",\"type\":{\"name\":\"array\",\"length\":" << n_occasions << ",\"element_type\":{\"name\":\"int\"}},\"block\":\"generated_quantities\"},{\"name\":\"B\",\"type\":{\"name\":\"array\",\"length\":" << n_occasions << ",\"element_type\":{\"name\":\"int\"}},\"block\":\"generated_quantities\"},{\"name\":\"z\",\"type\":{\"name\":\"array\",\"length\":" << M << ",\"element_type\":{\"name\":\"array\",\"length\":" << n_occasions << ",\"element_type\":{\"name\":\"int\"}}},\"block\":\"generated_quantities\"}]"); } // get_unconstrained_sizedtypes() @@ -23095,13 +22929,12 @@ class lcm_experiment_model final : public model_base_crtp inline void get_param_names(std::vector& names__) const { - names__.clear(); - + names__ = std::vector{}; } // get_param_names() inline void get_dims(std::vector>& dimss__) const { - dimss__.clear(); + dimss__ = std::vector>{}; } // get_dims() inline void constrained_param_names( @@ -23138,16 +22971,14 @@ class lcm_experiment_model final : public model_base_crtp } // unconstrained_param_names() - inline std::string get_constrained_sizedtypes() const { - std::stringstream s__; - s__ << "[]"; - return s__.str(); + inline std::string get_constrained_sizedtypes() const final { + + return std::string("[]"); } // get_constrained_sizedtypes() - inline std::string get_unconstrained_sizedtypes() const { - std::stringstream s__; - s__ << "[]"; - return s__.str(); + inline std::string get_unconstrained_sizedtypes() const final { + + return std::string("[]"); } // get_unconstrained_sizedtypes() @@ -23442,14 +23273,12 @@ class lcm_experiment2_model final : public model_base_crtp& names__) const { - names__.clear(); - names__.emplace_back("x"); + names__ = std::vector{"x"}; } // get_param_names() inline void get_dims(std::vector>& dimss__) const { - dimss__.clear(); - dimss__.emplace_back(std::vector{}); + dimss__ = std::vector>{std::vector{}}; } // get_dims() inline void constrained_param_names( @@ -23486,16 +23315,14 @@ class lcm_experiment2_model final : public model_base_crtp { inline void get_param_names(std::vector& names__) const { - names__.clear(); - names__.emplace_back("theta"); + names__ = std::vector{"theta"}; } // get_param_names() inline void get_dims(std::vector>& dimss__) const { - dimss__.clear(); - dimss__.emplace_back(std::vector{static_cast(J)}); + dimss__ = std::vector>{std::vector{ + static_cast(J) + }}; } // get_dims() inline void constrained_param_names( @@ -23861,16 +23688,14 @@ class lcm_fails_model final : public model_base_crtp { } // unconstrained_param_names() - inline std::string get_constrained_sizedtypes() const { - std::stringstream s__; - s__ << "[{\"name\":\"theta\",\"type\":{\"name\":\"array\",\"length\":" << J << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"}]"; - return s__.str(); + inline std::string get_constrained_sizedtypes() const final { + + return std::string("[{\"name\":\"theta\",\"type\":{\"name\":\"array\",\"length\":" << J << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"}]"); } // get_constrained_sizedtypes() - inline std::string get_unconstrained_sizedtypes() const { - std::stringstream s__; - s__ << "[{\"name\":\"theta\",\"type\":{\"name\":\"array\",\"length\":" << J << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"}]"; - return s__.str(); + inline std::string get_unconstrained_sizedtypes() const final { + + return std::string("[{\"name\":\"theta\",\"type\":{\"name\":\"array\",\"length\":" << J << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"}]"); } // get_unconstrained_sizedtypes() @@ -25802,31 +25627,23 @@ class lcm_fails2_model final : public model_base_crtp { inline void get_param_names(std::vector& names__) const { - names__.clear(); - names__.emplace_back("mean_phi"); - names__.emplace_back("mean_p"); - names__.emplace_back("phi"); - names__.emplace_back("p"); - names__.emplace_back("chi"); + names__ = std::vector{"mean_phi", + "mean_p", + "phi", + "p", + "chi"}; } // get_param_names() inline void get_dims(std::vector>& dimss__) const { - dimss__.clear(); - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{static_cast(nind), - static_cast(n_occ_minus_1) - }); - - dimss__.emplace_back(std::vector{static_cast(nind), - static_cast(n_occ_minus_1) - }); - - dimss__.emplace_back(std::vector{static_cast(nind), - static_cast(n_occasions)}); + dimss__ = std::vector>{std::vector{}, + std::vector{}, + std::vector{static_cast(nind), + static_cast(n_occ_minus_1)}, + std::vector{static_cast(nind), + static_cast(n_occ_minus_1)}, + std::vector{static_cast(nind), + static_cast(n_occasions)}}; } // get_dims() inline void constrained_param_names( @@ -25905,16 +25722,14 @@ class lcm_fails2_model final : public model_base_crtp { } // unconstrained_param_names() - inline std::string get_constrained_sizedtypes() const { - std::stringstream s__; - s__ << "[{\"name\":\"mean_phi\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"mean_p\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"phi\",\"type\":{\"name\":\"matrix\",\"rows\":" << nind << ",\"cols\":" << n_occ_minus_1 << "},\"block\":\"transformed_parameters\"},{\"name\":\"p\",\"type\":{\"name\":\"matrix\",\"rows\":" << nind << ",\"cols\":" << n_occ_minus_1 << "},\"block\":\"transformed_parameters\"},{\"name\":\"chi\",\"type\":{\"name\":\"matrix\",\"rows\":" << nind << ",\"cols\":" << n_occasions << "},\"block\":\"transformed_parameters\"}]"; - return s__.str(); + inline std::string get_constrained_sizedtypes() const final { + + return std::string("[{\"name\":\"mean_phi\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"mean_p\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"phi\",\"type\":{\"name\":\"matrix\",\"rows\":" << nind << ",\"cols\":" << n_occ_minus_1 << "},\"block\":\"transformed_parameters\"},{\"name\":\"p\",\"type\":{\"name\":\"matrix\",\"rows\":" << nind << ",\"cols\":" << n_occ_minus_1 << "},\"block\":\"transformed_parameters\"},{\"name\":\"chi\",\"type\":{\"name\":\"matrix\",\"rows\":" << nind << ",\"cols\":" << n_occasions << "},\"block\":\"transformed_parameters\"}]"); } // get_constrained_sizedtypes() - inline std::string get_unconstrained_sizedtypes() const { - std::stringstream s__; - s__ << "[{\"name\":\"mean_phi\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"mean_p\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"phi\",\"type\":{\"name\":\"matrix\",\"rows\":" << nind << ",\"cols\":" << n_occ_minus_1 << "},\"block\":\"transformed_parameters\"},{\"name\":\"p\",\"type\":{\"name\":\"matrix\",\"rows\":" << nind << ",\"cols\":" << n_occ_minus_1 << "},\"block\":\"transformed_parameters\"},{\"name\":\"chi\",\"type\":{\"name\":\"matrix\",\"rows\":" << nind << ",\"cols\":" << n_occasions << "},\"block\":\"transformed_parameters\"}]"; - return s__.str(); + inline std::string get_unconstrained_sizedtypes() const final { + + return std::string("[{\"name\":\"mean_phi\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"mean_p\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"phi\",\"type\":{\"name\":\"matrix\",\"rows\":" << nind << ",\"cols\":" << n_occ_minus_1 << "},\"block\":\"transformed_parameters\"},{\"name\":\"p\",\"type\":{\"name\":\"matrix\",\"rows\":" << nind << ",\"cols\":" << n_occ_minus_1 << "},\"block\":\"transformed_parameters\"},{\"name\":\"chi\",\"type\":{\"name\":\"matrix\",\"rows\":" << nind << ",\"cols\":" << n_occasions << "},\"block\":\"transformed_parameters\"}]"); } // get_unconstrained_sizedtypes() @@ -26390,23 +26205,18 @@ class lupdf_inlining_model final : public model_base_crtp inline void get_param_names(std::vector& names__) const { - names__.clear(); - names__.emplace_back("mu"); - names__.emplace_back("tp"); - names__.emplace_back("lbaz"); - names__.emplace_back("lbar"); + names__ = std::vector{"mu", + "tp", + "lbaz", + "lbar"}; } // get_param_names() inline void get_dims(std::vector>& dimss__) const { - dimss__.clear(); - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{}); + dimss__ = std::vector>{std::vector{}, + std::vector{}, + std::vector{}, + std::vector{}}; } // get_dims() inline void constrained_param_names( @@ -26445,16 +26255,14 @@ class lupdf_inlining_model final : public model_base_crtp } // unconstrained_param_names() - inline std::string get_constrained_sizedtypes() const { - std::stringstream s__; - s__ << "[{\"name\":\"mu\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"tp\",\"type\":{\"name\":\"real\"},\"block\":\"transformed_parameters\"},{\"name\":\"lbaz\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"lbar\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"}]"; - return s__.str(); + inline std::string get_constrained_sizedtypes() const final { + + return std::string("[{\"name\":\"mu\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"tp\",\"type\":{\"name\":\"real\"},\"block\":\"transformed_parameters\"},{\"name\":\"lbaz\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"lbar\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"}]"); } // get_constrained_sizedtypes() - inline std::string get_unconstrained_sizedtypes() const { - std::stringstream s__; - s__ << "[{\"name\":\"mu\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"tp\",\"type\":{\"name\":\"real\"},\"block\":\"transformed_parameters\"},{\"name\":\"lbaz\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"lbar\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"}]"; - return s__.str(); + inline std::string get_unconstrained_sizedtypes() const final { + + return std::string("[{\"name\":\"mu\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"tp\",\"type\":{\"name\":\"real\"},\"block\":\"transformed_parameters\"},{\"name\":\"lbaz\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"lbar\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"}]"); } // get_unconstrained_sizedtypes() @@ -27347,39 +27155,28 @@ class off_dce_model final : public model_base_crtp { inline void get_param_names(std::vector& names__) const { - names__.clear(); - names__.emplace_back("alpha_occ"); - names__.emplace_back("beta_occ"); - names__.emplace_back("alpha_p"); - names__.emplace_back("beta_p"); - names__.emplace_back("logit_psi"); - names__.emplace_back("logit_p"); - names__.emplace_back("occ_fs"); - names__.emplace_back("psi_con"); - names__.emplace_back("z"); + names__ = std::vector{"alpha_occ", + "beta_occ", + "alpha_p", + "beta_p", + "logit_psi", + "logit_p", + "occ_fs", + "psi_con", + "z"}; } // get_param_names() inline void get_dims(std::vector>& dimss__) const { - dimss__.clear(); - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{static_cast(R)}); - - dimss__.emplace_back(std::vector{static_cast(R), - static_cast(T)}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{static_cast(R)}); - - dimss__.emplace_back(std::vector{static_cast(R)}); + dimss__ = std::vector>{std::vector{}, + std::vector{}, + std::vector{}, + std::vector{}, + std::vector{static_cast(R)}, + std::vector{static_cast(R), static_cast(T)}, + std::vector{}, + std::vector{static_cast(R)}, + std::vector{static_cast(R)}}; } // get_dims() inline void constrained_param_names( @@ -27458,16 +27255,14 @@ class off_dce_model final : public model_base_crtp { } // unconstrained_param_names() - inline std::string get_constrained_sizedtypes() const { - std::stringstream s__; - s__ << "[{\"name\":\"alpha_occ\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"beta_occ\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"alpha_p\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"beta_p\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"logit_psi\",\"type\":{\"name\":\"vector\",\"length\":" << R << "},\"block\":\"transformed_parameters\"},{\"name\":\"logit_p\",\"type\":{\"name\":\"matrix\",\"rows\":" << R << ",\"cols\":" << T << "},\"block\":\"transformed_parameters\"},{\"name\":\"occ_fs\",\"type\":{\"name\":\"int\"},\"block\":\"generated_quantities\"},{\"name\":\"psi_con\",\"type\":{\"name\":\"array\",\"length\":" << R << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"generated_quantities\"},{\"name\":\"z\",\"type\":{\"name\":\"array\",\"length\":" << R << ",\"element_type\":{\"name\":\"int\"}},\"block\":\"generated_quantities\"}]"; - return s__.str(); + inline std::string get_constrained_sizedtypes() const final { + + return std::string("[{\"name\":\"alpha_occ\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"beta_occ\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"alpha_p\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"beta_p\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"logit_psi\",\"type\":{\"name\":\"vector\",\"length\":" << R << "},\"block\":\"transformed_parameters\"},{\"name\":\"logit_p\",\"type\":{\"name\":\"matrix\",\"rows\":" << R << ",\"cols\":" << T << "},\"block\":\"transformed_parameters\"},{\"name\":\"occ_fs\",\"type\":{\"name\":\"int\"},\"block\":\"generated_quantities\"},{\"name\":\"psi_con\",\"type\":{\"name\":\"array\",\"length\":" << R << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"generated_quantities\"},{\"name\":\"z\",\"type\":{\"name\":\"array\",\"length\":" << R << ",\"element_type\":{\"name\":\"int\"}},\"block\":\"generated_quantities\"}]"); } // get_constrained_sizedtypes() - inline std::string get_unconstrained_sizedtypes() const { - std::stringstream s__; - s__ << "[{\"name\":\"alpha_occ\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"beta_occ\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"alpha_p\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"beta_p\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"logit_psi\",\"type\":{\"name\":\"vector\",\"length\":" << R << "},\"block\":\"transformed_parameters\"},{\"name\":\"logit_p\",\"type\":{\"name\":\"matrix\",\"rows\":" << R << ",\"cols\":" << T << "},\"block\":\"transformed_parameters\"},{\"name\":\"occ_fs\",\"type\":{\"name\":\"int\"},\"block\":\"generated_quantities\"},{\"name\":\"psi_con\",\"type\":{\"name\":\"array\",\"length\":" << R << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"generated_quantities\"},{\"name\":\"z\",\"type\":{\"name\":\"array\",\"length\":" << R << ",\"element_type\":{\"name\":\"int\"}},\"block\":\"generated_quantities\"}]"; - return s__.str(); + inline std::string get_unconstrained_sizedtypes() const final { + + return std::string("[{\"name\":\"alpha_occ\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"beta_occ\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"alpha_p\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"beta_p\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"logit_psi\",\"type\":{\"name\":\"vector\",\"length\":" << R << "},\"block\":\"transformed_parameters\"},{\"name\":\"logit_p\",\"type\":{\"name\":\"matrix\",\"rows\":" << R << ",\"cols\":" << T << "},\"block\":\"transformed_parameters\"},{\"name\":\"occ_fs\",\"type\":{\"name\":\"int\"},\"block\":\"generated_quantities\"},{\"name\":\"psi_con\",\"type\":{\"name\":\"array\",\"length\":" << R << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"generated_quantities\"},{\"name\":\"z\",\"type\":{\"name\":\"array\",\"length\":" << R << ",\"element_type\":{\"name\":\"int\"}},\"block\":\"generated_quantities\"}]"); } // get_unconstrained_sizedtypes() @@ -28312,44 +28107,32 @@ class off_small_model final : public model_base_crtp { inline void get_param_names(std::vector& names__) const { - names__.clear(); - names__.emplace_back("beta"); - names__.emplace_back("eta1"); - names__.emplace_back("eta2"); - names__.emplace_back("mu_a1"); - names__.emplace_back("mu_a2"); - names__.emplace_back("sigma_a1"); - names__.emplace_back("sigma_a2"); - names__.emplace_back("sigma_y"); - names__.emplace_back("a1"); - names__.emplace_back("a2"); - names__.emplace_back("y_hat"); + names__ = std::vector{"beta", + "eta1", + "eta2", + "mu_a1", + "mu_a2", + "sigma_a1", + "sigma_a2", + "sigma_y", + "a1", + "a2", + "y_hat"}; } // get_param_names() inline void get_dims(std::vector>& dimss__) const { - dimss__.clear(); - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{static_cast(J)}); - - dimss__.emplace_back(std::vector{static_cast(J)}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{static_cast(J)}); - - dimss__.emplace_back(std::vector{static_cast(J)}); - - dimss__.emplace_back(std::vector{static_cast(N)}); + dimss__ = std::vector>{std::vector{}, + std::vector{static_cast(J)}, + std::vector{static_cast(J)}, + std::vector{}, + std::vector{}, + std::vector{}, + std::vector{}, + std::vector{}, + std::vector{static_cast(J)}, + std::vector{static_cast(J)}, + std::vector{static_cast(N)}}; } // get_dims() inline void constrained_param_names( @@ -28434,16 +28217,14 @@ class off_small_model final : public model_base_crtp { } // unconstrained_param_names() - inline std::string get_constrained_sizedtypes() const { - std::stringstream s__; - s__ << "[{\"name\":\"beta\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"eta1\",\"type\":{\"name\":\"vector\",\"length\":" << J << "},\"block\":\"parameters\"},{\"name\":\"eta2\",\"type\":{\"name\":\"vector\",\"length\":" << J << "},\"block\":\"parameters\"},{\"name\":\"mu_a1\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"mu_a2\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"sigma_a1\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"sigma_a2\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"sigma_y\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"a1\",\"type\":{\"name\":\"vector\",\"length\":" << J << "},\"block\":\"transformed_parameters\"},{\"name\":\"a2\",\"type\":{\"name\":\"vector\",\"length\":" << J << "},\"block\":\"transformed_parameters\"},{\"name\":\"y_hat\",\"type\":{\"name\":\"vector\",\"length\":" << N << "},\"block\":\"transformed_parameters\"}]"; - return s__.str(); + inline std::string get_constrained_sizedtypes() const final { + + return std::string("[{\"name\":\"beta\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"eta1\",\"type\":{\"name\":\"vector\",\"length\":" << J << "},\"block\":\"parameters\"},{\"name\":\"eta2\",\"type\":{\"name\":\"vector\",\"length\":" << J << "},\"block\":\"parameters\"},{\"name\":\"mu_a1\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"mu_a2\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"sigma_a1\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"sigma_a2\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"sigma_y\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"a1\",\"type\":{\"name\":\"vector\",\"length\":" << J << "},\"block\":\"transformed_parameters\"},{\"name\":\"a2\",\"type\":{\"name\":\"vector\",\"length\":" << J << "},\"block\":\"transformed_parameters\"},{\"name\":\"y_hat\",\"type\":{\"name\":\"vector\",\"length\":" << N << "},\"block\":\"transformed_parameters\"}]"); } // get_constrained_sizedtypes() - inline std::string get_unconstrained_sizedtypes() const { - std::stringstream s__; - s__ << "[{\"name\":\"beta\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"eta1\",\"type\":{\"name\":\"vector\",\"length\":" << J << "},\"block\":\"parameters\"},{\"name\":\"eta2\",\"type\":{\"name\":\"vector\",\"length\":" << J << "},\"block\":\"parameters\"},{\"name\":\"mu_a1\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"mu_a2\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"sigma_a1\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"sigma_a2\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"sigma_y\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"a1\",\"type\":{\"name\":\"vector\",\"length\":" << J << "},\"block\":\"transformed_parameters\"},{\"name\":\"a2\",\"type\":{\"name\":\"vector\",\"length\":" << J << "},\"block\":\"transformed_parameters\"},{\"name\":\"y_hat\",\"type\":{\"name\":\"vector\",\"length\":" << N << "},\"block\":\"transformed_parameters\"}]"; - return s__.str(); + inline std::string get_unconstrained_sizedtypes() const final { + + return std::string("[{\"name\":\"beta\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"eta1\",\"type\":{\"name\":\"vector\",\"length\":" << J << "},\"block\":\"parameters\"},{\"name\":\"eta2\",\"type\":{\"name\":\"vector\",\"length\":" << J << "},\"block\":\"parameters\"},{\"name\":\"mu_a1\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"mu_a2\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"sigma_a1\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"sigma_a2\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"sigma_y\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"a1\",\"type\":{\"name\":\"vector\",\"length\":" << J << "},\"block\":\"transformed_parameters\"},{\"name\":\"a2\",\"type\":{\"name\":\"vector\",\"length\":" << J << "},\"block\":\"transformed_parameters\"},{\"name\":\"y_hat\",\"type\":{\"name\":\"vector\",\"length\":" << N << "},\"block\":\"transformed_parameters\"}]"); } // get_unconstrained_sizedtypes() @@ -29741,28 +29522,20 @@ class optimizations_model final : public model_base_crtp { inline void get_param_names(std::vector& names__) const { - names__.clear(); - names__.emplace_back("theta"); - names__.emplace_back("phi"); - names__.emplace_back("x_matrix"); - names__.emplace_back("x_vector"); - names__.emplace_back("x_cov"); + names__ = std::vector{"theta", + "phi", + "x_matrix", + "x_vector", + "x_cov"}; } // get_param_names() inline void get_dims(std::vector>& dimss__) const { - dimss__.clear(); - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{static_cast(3), - static_cast(2)}); - - dimss__.emplace_back(std::vector{static_cast(2)}); - - dimss__.emplace_back(std::vector{static_cast(2), - static_cast(2)}); + dimss__ = std::vector>{std::vector{}, + std::vector{}, + std::vector{static_cast(3), static_cast(2)}, + std::vector{static_cast(2)}, + std::vector{static_cast(2), static_cast(2)}}; } // get_dims() inline void constrained_param_names( @@ -29834,16 +29607,14 @@ class optimizations_model final : public model_base_crtp { } // unconstrained_param_names() - inline std::string get_constrained_sizedtypes() const { - std::stringstream s__; - s__ << "[{\"name\":\"theta\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"phi\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"x_matrix\",\"type\":{\"name\":\"matrix\",\"rows\":" << 3 << ",\"cols\":" << 2 << "},\"block\":\"parameters\"},{\"name\":\"x_vector\",\"type\":{\"name\":\"vector\",\"length\":" << 2 << "},\"block\":\"parameters\"},{\"name\":\"x_cov\",\"type\":{\"name\":\"matrix\",\"rows\":" << 2 << ",\"cols\":" << 2 << "},\"block\":\"parameters\"}]"; - return s__.str(); + inline std::string get_constrained_sizedtypes() const final { + + return std::string("[{\"name\":\"theta\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"phi\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"x_matrix\",\"type\":{\"name\":\"matrix\",\"rows\":" << 3 << ",\"cols\":" << 2 << "},\"block\":\"parameters\"},{\"name\":\"x_vector\",\"type\":{\"name\":\"vector\",\"length\":" << 2 << "},\"block\":\"parameters\"},{\"name\":\"x_cov\",\"type\":{\"name\":\"matrix\",\"rows\":" << 2 << ",\"cols\":" << 2 << "},\"block\":\"parameters\"}]"); } // get_constrained_sizedtypes() - inline std::string get_unconstrained_sizedtypes() const { - std::stringstream s__; - s__ << "[{\"name\":\"theta\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"phi\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"x_matrix\",\"type\":{\"name\":\"matrix\",\"rows\":" << 3 << ",\"cols\":" << 2 << "},\"block\":\"parameters\"},{\"name\":\"x_vector\",\"type\":{\"name\":\"vector\",\"length\":" << 2 << "},\"block\":\"parameters\"},{\"name\":\"x_cov\",\"type\":{\"name\":\"vector\",\"length\":" << 3 << "},\"block\":\"parameters\"}]"; - return s__.str(); + inline std::string get_unconstrained_sizedtypes() const final { + + return std::string("[{\"name\":\"theta\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"phi\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"x_matrix\",\"type\":{\"name\":\"matrix\",\"rows\":" << 3 << ",\"cols\":" << 2 << "},\"block\":\"parameters\"},{\"name\":\"x_vector\",\"type\":{\"name\":\"vector\",\"length\":" << 2 << "},\"block\":\"parameters\"},{\"name\":\"x_cov\",\"type\":{\"name\":\"vector\",\"length\":" << 3 << "},\"block\":\"parameters\"}]"); } // get_unconstrained_sizedtypes() @@ -30576,29 +30347,24 @@ class partial_eval_model final : public model_base_crtp { inline void get_param_names(std::vector& names__) const { - names__.clear(); - names__.emplace_back("a"); - names__.emplace_back("beta"); - names__.emplace_back("mu_a"); - names__.emplace_back("sigma_a"); - names__.emplace_back("sigma_y"); - names__.emplace_back("y_hat"); + names__ = std::vector{"a", + "beta", + "mu_a", + "sigma_a", + "sigma_y", + "y_hat"}; } // get_param_names() inline void get_dims(std::vector>& dimss__) const { - dimss__.clear(); - dimss__.emplace_back(std::vector{static_cast(n_pair)}); - - dimss__.emplace_back(std::vector{static_cast(2)}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{static_cast(N)}); + dimss__ = std::vector>{std::vector{ + static_cast(n_pair) + }, + std::vector{static_cast(2)}, + std::vector{}, + std::vector{}, + std::vector{}, + std::vector{static_cast(N)}}; } // get_dims() inline void constrained_param_names( @@ -30661,16 +30427,14 @@ class partial_eval_model final : public model_base_crtp { } // unconstrained_param_names() - inline std::string get_constrained_sizedtypes() const { - std::stringstream s__; - s__ << "[{\"name\":\"a\",\"type\":{\"name\":\"vector\",\"length\":" << n_pair << "},\"block\":\"parameters\"},{\"name\":\"beta\",\"type\":{\"name\":\"vector\",\"length\":" << 2 << "},\"block\":\"parameters\"},{\"name\":\"mu_a\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"sigma_a\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"sigma_y\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"y_hat\",\"type\":{\"name\":\"vector\",\"length\":" << N << "},\"block\":\"transformed_parameters\"}]"; - return s__.str(); + inline std::string get_constrained_sizedtypes() const final { + + return std::string("[{\"name\":\"a\",\"type\":{\"name\":\"vector\",\"length\":" << n_pair << "},\"block\":\"parameters\"},{\"name\":\"beta\",\"type\":{\"name\":\"vector\",\"length\":" << 2 << "},\"block\":\"parameters\"},{\"name\":\"mu_a\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"sigma_a\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"sigma_y\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"y_hat\",\"type\":{\"name\":\"vector\",\"length\":" << N << "},\"block\":\"transformed_parameters\"}]"); } // get_constrained_sizedtypes() - inline std::string get_unconstrained_sizedtypes() const { - std::stringstream s__; - s__ << "[{\"name\":\"a\",\"type\":{\"name\":\"vector\",\"length\":" << n_pair << "},\"block\":\"parameters\"},{\"name\":\"beta\",\"type\":{\"name\":\"vector\",\"length\":" << 2 << "},\"block\":\"parameters\"},{\"name\":\"mu_a\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"sigma_a\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"sigma_y\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"y_hat\",\"type\":{\"name\":\"vector\",\"length\":" << N << "},\"block\":\"transformed_parameters\"}]"; - return s__.str(); + inline std::string get_unconstrained_sizedtypes() const final { + + return std::string("[{\"name\":\"a\",\"type\":{\"name\":\"vector\",\"length\":" << n_pair << "},\"block\":\"parameters\"},{\"name\":\"beta\",\"type\":{\"name\":\"vector\",\"length\":" << 2 << "},\"block\":\"parameters\"},{\"name\":\"mu_a\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"sigma_a\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"sigma_y\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"y_hat\",\"type\":{\"name\":\"vector\",\"length\":" << N << "},\"block\":\"transformed_parameters\"}]"); } // get_unconstrained_sizedtypes() @@ -31567,33 +31331,24 @@ class stalled1_failure_model final : public model_base_crtp& names__) const { - names__.clear(); - names__.emplace_back("alpha0"); - names__.emplace_back("alpha1"); - names__.emplace_back("alpha2"); - names__.emplace_back("alpha12"); - names__.emplace_back("tau"); - names__.emplace_back("b"); - names__.emplace_back("sigma"); + names__ = std::vector{"alpha0", + "alpha1", + "alpha2", + "alpha12", + "tau", + "b", + "sigma"}; } // get_param_names() inline void get_dims(std::vector>& dimss__) const { - dimss__.clear(); - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{}); - - dimss__.emplace_back(std::vector{static_cast(I), - static_cast(K)}); - - dimss__.emplace_back(std::vector{}); + dimss__ = std::vector>{std::vector{}, + std::vector{}, + std::vector{}, + std::vector{}, + std::vector{}, + std::vector{static_cast(I), static_cast(K)}, + std::vector{}}; } // get_dims() inline void constrained_param_names( @@ -31652,16 +31407,14 @@ class stalled1_failure_model final : public model_base_crtp { inline void get_param_names(std::vector& names__) const { - names__.clear(); - names__.emplace_back("x"); + names__ = std::vector{"x"}; } // get_param_names() inline void get_dims(std::vector>& dimss__) const { - dimss__.clear(); - dimss__.emplace_back(std::vector{}); + dimss__ = std::vector>{std::vector{}}; } // get_dims() inline void constrained_param_names( @@ -32260,16 +32011,14 @@ class unroll_limit_model final : public model_base_crtp { } // unconstrained_param_names() - inline std::string get_constrained_sizedtypes() const { - std::stringstream s__; - s__ << "[{\"name\":\"x\",\"type\":{\"name\":\"int\"},\"block\":\"generated_quantities\"}]"; - return s__.str(); + inline std::string get_constrained_sizedtypes() const final { + + return std::string("[{\"name\":\"x\",\"type\":{\"name\":\"int\"},\"block\":\"generated_quantities\"}]"); } // get_constrained_sizedtypes() - inline std::string get_unconstrained_sizedtypes() const { - std::stringstream s__; - s__ << "[{\"name\":\"x\",\"type\":{\"name\":\"int\"},\"block\":\"generated_quantities\"}]"; - return s__.str(); + inline std::string get_unconstrained_sizedtypes() const final { + + return std::string("[{\"name\":\"x\",\"type\":{\"name\":\"int\"},\"block\":\"generated_quantities\"}]"); } // get_unconstrained_sizedtypes() From 31282639a301aea85e0ad5357a0ec12ae239b5c1 Mon Sep 17 00:00:00 2001 From: Steve Bronder Date: Mon, 5 Apr 2021 14:43:18 -0400 Subject: [PATCH 2/7] fixup for loops to print nicer looking C++ --- src/stan_math_backend/Cpp_Json.ml | 13 +- src/stan_math_backend/Stan_math_code_gen.ml | 121 +- src/stan_math_backend/Statement_gen.ml | 15 +- .../cli-args/filename_good.expected | 42 +- test/integration/good/code-gen/cl.expected | 310 +- test/integration/good/code-gen/cpp.expected | 7590 ++++++++++------- .../good/code-gen/expressions/cpp.expected | 53 +- .../good/code-gen/opencl/cpp.expected | 410 +- .../good/code-gen/profiling/cpp.expected | 95 +- .../standalone_functions/cpp.expected | 8 +- .../good/compiler-optimizations/cpp.expected | 6876 ++++++++------- 11 files changed, 8856 insertions(+), 6677 deletions(-) diff --git a/src/stan_math_backend/Cpp_Json.ml b/src/stan_math_backend/Cpp_Json.ml index ff17dc04b6..784094af0d 100644 --- a/src/stan_math_backend/Cpp_Json.ml +++ b/src/stan_math_backend/Cpp_Json.ml @@ -5,7 +5,6 @@ module Str = Re.Str let rec sizedtype_to_json (st : Expr.Typed.t SizedType.t) : Yojson.Basic.t = let emit_cpp_expr e = Fmt.strf "+ std::to_string(%a) +" Expression_gen.pp_expr e - |> Str.global_replace (Str.regexp "[\n\r\t ]+") " " in match st with | SInt -> `Assoc [("name", `String "int")] @@ -44,17 +43,19 @@ let%expect_test "outvar to json pretty" = "name": "var_one", "type": { "name": "array", - "length": "<< K >>", - "element_type": { "name": "vector", "length": "<< N >>" } + "length": "+ std::to_string(K) +", + "element_type": { "name": "vector", "length": "+ std::to_string(N) +" } }, "block": "parameters" } |}] +(*Adds a backslash to all the inner quotes and then + unblash the ones near a plus*) let replace_cpp_expr s = s |> Str.global_replace (Str.regexp {|"|}) {|\"|} - |> Str.global_replace (Str.regexp {|\\"<<|}) {|" <<|} - |> Str.global_replace (Str.regexp {|>>\\"|}) {|<< "|} + |> Str.global_replace (Str.regexp {|\\"\+|}) {|" +|} + |> Str.global_replace (Str.regexp {|\+\\"|}) {|+ "|} let wrap_in_quotes s = "\"" ^ s ^ "\"" @@ -70,4 +71,4 @@ let%expect_test "outvar to json" = |> out_var_interpolated_json_str |> print_endline ; [%expect {| - "[{\"name\":\"var_one\",\"type\":{\"name\":\"array\",\"length\":" << K << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}},\"block\":\"parameters\"}]" |}] + "[{\"name\":\"var_one\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(K) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(N) + "}},\"block\":\"parameters\"}]" |}] diff --git a/src/stan_math_backend/Stan_math_code_gen.ml b/src/stan_math_backend/Stan_math_code_gen.ml index 53b7537e50..280333805f 100644 --- a/src/stan_math_backend/Stan_math_code_gen.ml +++ b/src/stan_math_backend/Stan_math_code_gen.ml @@ -354,11 +354,15 @@ let includes = "#include " let pp_validate_data ppf (name, st) = if String.is_suffix ~suffix:"__" name then () else + let pp_stdvector ppf args = + let pp_cast ppf x = pf ppf "static_cast(%a)" pp_expr x in + pf ppf "@[ std::vector{@,%a}@]" (list ~sep:comma pp_cast) + args + in pf ppf "@[context__.validate_dims(@,%S,@,%S,@,%S,@,%a);@]@ " "data initialization" name (stantype_prim_str (SizedType.to_unsized st)) - pp_call - ("context__.to_vec", pp_expr, SizedType.get_dims st) + pp_stdvector (SizedType.get_dims st) (** Print the constructor of the model class. Read in data steps: @@ -374,29 +378,19 @@ let pp_ctor ppf p = in pf ppf "%s(@[%a) : model_base_crtp(0) @]" p.Program.prog_name (list ~sep:comma string) params ; - let pp_mul ppf () = pf ppf " * " in - let pp_num_param ppf dims = - pf ppf "num_params_r__ += %a;" (list ~sep:pp_mul pp_expr) dims - in - let get_param_st = function - | _, {Program.out_block= Parameters; out_unconstrained_st= st; _} -> ( - match SizedType.get_dims st with - | [] -> Some [Expr.Helpers.loop_bottom] - | ls -> Some ls ) - | _ -> None - in let data_idents = List.map ~f:fst p.input_vars |> String.Set.of_list in let pp_stmt_topdecl_size_only ppf (Stmt.Fixed.({pattern; meta}) as s) = match pattern with | Decl {decl_id; decl_type; _} when decl_id <> "pos__" -> ( match decl_type with - | Sized st -> + | Sized st -> ( Locations.pp_smeta ppf meta ; let is_input_data = Set.mem data_idents decl_id in - (match is_input_data with - | true -> pp_validate_data ppf (decl_id, st) ; - pp_set_size ppf (decl_id, st, DataOnly); - | false -> ()) + match is_input_data with + | true -> + pp_validate_data ppf (decl_id, st) ; + pp_set_size ppf (decl_id, st, DataOnly); + | false -> () ) | Unsized _ -> () ) | _ -> pp_statement ppf s in @@ -415,11 +409,29 @@ let pp_ctor ppf p = pp_located_error ppf (pp_block, (list ~sep:cut pp_stmt_topdecl_size_only, prepare_data)) ; cut ppf () ; - pf ppf "num_params_r__ = 0U;@ " ; - pp_located_error ppf - ( pp_block - , ( list ~sep:cut pp_num_param - , List.filter_map ~f:get_param_st output_vars ) ) ) + let get_param_st = function + | _, {Program.out_block= Parameters; out_unconstrained_st= st; _} -> ( + match SizedType.get_dims st with + | [] -> Some [Expr.Helpers.loop_bottom] + | ls -> Some ls ) + | _ -> None + in + let output_params = List.filter_map ~f:get_param_st output_vars in + let pp_mul ppf () = pf ppf " * " in + let pp_num_param ppf (dims : Expr.Typed.t list) = + match dims with + | [a] -> pf ppf "@[%a@]@," (list ~sep:pp_mul pp_expr) [a] + | _ -> pf ppf "@[(%a)@]@," (list ~sep:pp_mul pp_expr) dims + in + let pp_plus ppf () = pf ppf " + " in + let pp_set_params ppf pars = + (list ~sep:pp_plus pp_num_param) ppf pars + in + match output_params with + | [] -> pf ppf "num_params_r__ = 0U;@," + | _ -> + pf ppf "@[num_params_r__ = %a;@]@," pp_set_params + output_params ) , p ) let rec top_level_decls Stmt.Fixed.({pattern; _}) = @@ -443,8 +455,8 @@ let pp_model_private ppf {Program.prepare_data; _} = @param cv_attr Optional parameter to add method attributes. @param ppbody (?A pretty printer of the method's body) *) -let pp_method ppf rt name params intro ?(outro = nop) ?(cv_attr:string list = ["const"]) - ppbody = +let pp_method ppf rt name params intro ?(outro = nop) + ?(cv_attr : string list = ["const"]) ppbody = pf ppf "@[inline %s %s(@[@,%a@]) %a " rt name (list ~sep:comma string) params (list ~sep:cut string) cv_attr ; pf ppf "{@,%a@ " intro () ; @@ -457,34 +469,38 @@ let pp_method ppf rt name params intro ?(outro = nop) ?(cv_attr:string list = [" *) let pp_get_param_names ppf {Program.output_vars; _} = let add_param = fmt "%S" in - pp_method ppf "void" "get_param_names" ["std::vector& names__"] - nop (fun ppf -> - pf ppf "names__ = std::vector{%a};" - (list ~sep:comma add_param) (List.map ~f:fst output_vars) ) - ~cv_attr:["const"] + pp_method ppf "void" "get_param_names" + ["std::vector& names__"] + nop + (fun ppf -> + pf ppf "@[names__ = std::vector{%a};@]@," + (list ~sep:comma add_param) + (List.map ~f:fst output_vars) ) + ~cv_attr:["const"] (** Print the `get_dims` method of the model class. *) let pp_get_dims ppf {Program.output_vars; _} = let pp_cast ppf cast_dims = - pf ppf "static_cast(%a)@," pp_expr cast_dims + pf ppf "@[static_cast(%a)@]@," pp_expr cast_dims in let pp_pack ppf inner_dims = pf ppf "std::vector{@[@,%a@]}" (list ~sep:comma pp_cast) inner_dims in - let pp_add_pack ppf dims = - pf ppf "%a" pp_pack dims + let pp_add_pack ppf dims = pf ppf "%a" pp_pack dims in + let dim_list = + List.( + map ~f:(fun (_, {Program.out_constrained_st= st; _}) -> st) output_vars) in - let dim_list = List.(map ~f:( - fun (_, {Program.out_constrained_st= st; _}) -> st) output_vars - ) in let pp_output_var ppf dims = (list ~sep:comma pp_add_pack) ppf List.(map ~f:SizedType.get_dims dims) in - pp_method ppf "void" "get_dims" ["std::vector>& dimss__"] - nop - (fun ppf ->pf ppf "dimss__ = std::vector>{%a};" - pp_output_var dim_list) + pp_method ppf "void" "get_dims" + ["std::vector>& dimss__"] + nop + (fun ppf -> + pf ppf "@[dimss__ = std::vector>{%a};@]@," pp_output_var + dim_list ) ~cv_attr:["const"] let pp_method_b ppf rt name params intro ?(outro = nop) ?(cv_attr = ["const"]) @@ -544,7 +560,7 @@ let rec pp_for_loop_iteratee ?(index_ids = []) ppf (iteratee, dims, pp_body) = | [] -> pp_body ppf (iteratee, index_ids) | dim :: dims -> iter dim (fun ppf (i, idcs) -> - pf ppf "%a" pp_block + pf ppf "@[%a @]" pp_block (pp_for_loop_iteratee ~index_ids:idcs, (i, dims, pp_body)) ) (** Print the `constrained_param_names` method of the model class. *) @@ -695,7 +711,7 @@ let pp_log_prob ppf Program.({prog_name; log_prob; _}) = *) let pp_outvar_metadata ppf (method_name, outvars) = let json_str = Cpp_Json.out_var_interpolated_json_str outvars in - let ppbody ppf = pf ppf "return std::string(%s);" json_str in + let ppbody ppf = pf ppf "@[return std::string(%s);@]@," json_str in pp_method ppf "std::string" method_name [] nop ppbody ~cv_attr:["const"] (** Print the `get_unconstrained_sizedtypes` method of the model class *) @@ -726,14 +742,13 @@ let pp_overloads ppf () = const bool emit_transformed_parameters = true, const bool emit_generated_quantities = true, std::ostream* pstream = nullptr) const { - std::vector vars_vec(vars.size()); + std::vector vars_vec; + vars_vec.reserve(vars.size()); std::vector params_i; write_array_impl(base_rng, params_r, params_i, vars_vec, emit_transformed_parameters, emit_generated_quantities, pstream); - vars.resize(vars_vec.size()); - for (int i = 0; i < vars.size(); ++i) { - vars.coeffRef(i) = vars_vec[i]; - } + vars = Eigen::Map>( + vars_vec.data(), vars_vec.size()); } template @@ -743,7 +758,8 @@ let pp_overloads ppf () = bool emit_transformed_parameters = true, bool emit_generated_quantities = true, std::ostream* pstream = nullptr) const { - write_array_impl(base_rng, params_r, params_i, vars, emit_transformed_parameters, emit_generated_quantities, pstream); + write_array_impl(base_rng, params_r, params_i, vars, + emit_transformed_parameters, emit_generated_quantities, pstream); } template @@ -764,13 +780,12 @@ let pp_overloads ppf () = inline void transform_inits(const stan::io::var_context& context, Eigen::Matrix& params_r, std::ostream* pstream = nullptr) const final { - std::vector params_r_vec(params_r.size()); + std::vector params_r_vec; + params_r_vec.reserve(params_r.size()); std::vector params_i; transform_inits_impl(context, params_i, params_r_vec, pstream); - params_r.resize(params_r_vec.size()); - for (int i = 0; i < params_r.size(); ++i) { - params_r.coeffRef(i) = params_r_vec[i]; - } + params_r = Eigen::Map>( + params_r_vec.data(), params_r_vec.size()); } inline void transform_inits(const stan::io::var_context& context, std::vector& params_i, diff --git a/src/stan_math_backend/Statement_gen.ml b/src/stan_math_backend/Statement_gen.ml index 69cf4d8e56..9b9464c39b 100644 --- a/src/stan_math_backend/Statement_gen.ml +++ b/src/stan_math_backend/Statement_gen.ml @@ -15,13 +15,13 @@ let pp_profile ppf (pp_body, name, body) = in pf ppf "{@;<1 2>@[%s@;@;%a@]@,}" profile pp_body body -let rec contains_eigen (ut : UnsizedType.t) : bool = +let rec contains_eigen (ut : UnsizedType.t) : bool = match ut with | UnsizedType.UArray t -> contains_eigen t | UMatrix | URowVector | UVector -> true | UInt | UReal | UMathLibraryFunction | UFun _ -> false -let pp_set_size ppf (decl_id, st, adtype) = +let pp_set_size ppf (decl_id, st, adtype) = (* TODO: generate optimal adtypes for expressions and declarations *) let real_nan = match adtype with @@ -40,10 +40,13 @@ let pp_set_size ppf (decl_id, st, adtype) = | SArray (t, d) -> pf ppf "%a(%a, %a)" pp_st st pp_expr d pp_size_ctor t in let print_fill ppf st = - match contains_eigen (SizedType.to_unsized st) with + match contains_eigen (SizedType.to_unsized st) with | true -> pf ppf "stan::math::fill(%s, %s);" decl_id real_nan - | false -> () in - pf ppf "@[%s = %a;@,%a @]@," decl_id pp_size_ctor st print_fill st + | false -> () + in + pf ppf "@[%s = %a;@,%a @]@," decl_id pp_size_ctor st print_fill st + + let%expect_test "set size mat array" = let int = Expr.Helpers.int in @@ -58,7 +61,7 @@ let%expect_test "set size mat array" = (** [pp_for_loop ppf (loopvar, lower, upper, pp_body, body)] tries to pretty print a for-loop from lower to upper given some loopvar.*) let pp_for_loop ppf (loopvar, lower, upper, pp_body, body) = - pf ppf "@[for (@[int %s = %a;@ %s <= %a;@ ++%s@])" loopvar pp_expr + pf ppf "@[for (@[int %s = %a;@ %s <= %a;@ ++%s@])" loopvar pp_expr lower loopvar pp_expr upper loopvar ; pf ppf " %a@]" pp_body body diff --git a/test/integration/cli-args/filename_good.expected b/test/integration/cli-args/filename_good.expected index ec3260df89..f476efb5ba 100644 --- a/test/integration/cli-args/filename_good.expected +++ b/test/integration/cli-args/filename_good.expected @@ -55,14 +55,12 @@ class filename_good_model final : public model_base_crtp { (void) DUMMY_VAR__; // suppress unused var warning try { int pos__; - pos__ = std::numeric_limits::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; current_statement__ = 1; - p = std::numeric_limits::quiet_NaN(); current_statement__ = 2; - q = std::numeric_limits::quiet_NaN(); current_statement__ = 2; q = (p + 5); @@ -73,13 +71,6 @@ class filename_good_model final : public model_base_crtp { } num_params_r__ = 0U; - try { - - } catch (const std::exception& e) { - stan::lang::rethrow_located(e, locations_array__[current_statement__]); - // Next line prevents compiler griping about no return - throw std::runtime_error("*** IF YOU SEE THIS, PLEASE REPORT A BUG ***"); - } } template { try { int pos__; - pos__ = std::numeric_limits::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; } catch (const std::exception& e) { @@ -173,11 +164,13 @@ class filename_good_model final : public model_base_crtp { inline void get_param_names(std::vector& names__) const { names__ = std::vector{}; + } // get_param_names() inline void get_dims(std::vector>& dimss__) const { dimss__ = std::vector>{}; + } // get_dims() inline void constrained_param_names( @@ -214,14 +207,16 @@ class filename_good_model final : public model_base_crtp { } // unconstrained_param_names() - inline std::string get_constrained_sizedtypes() const final { + inline std::string get_constrained_sizedtypes() const { return std::string("[]"); + } // get_constrained_sizedtypes() - inline std::string get_unconstrained_sizedtypes() const final { + inline std::string get_unconstrained_sizedtypes() const { return std::string("[]"); + } // get_unconstrained_sizedtypes() @@ -233,14 +228,13 @@ class filename_good_model final : public model_base_crtp { const bool emit_transformed_parameters = true, const bool emit_generated_quantities = true, std::ostream* pstream = nullptr) const { - std::vector vars_vec(vars.size()); + std::vector vars_vec; + vars_vec.reserve(vars.size()); std::vector params_i; write_array_impl(base_rng, params_r, params_i, vars_vec, emit_transformed_parameters, emit_generated_quantities, pstream); - vars.resize(vars_vec.size()); - for (int i = 0; i < vars.size(); ++i) { - vars.coeffRef(i) = vars_vec[i]; - } + vars = Eigen::Map>( + vars_vec.data(), vars_vec.size()); } template @@ -250,7 +244,8 @@ class filename_good_model final : public model_base_crtp { bool emit_transformed_parameters = true, bool emit_generated_quantities = true, std::ostream* pstream = nullptr) const { - write_array_impl(base_rng, params_r, params_i, vars, emit_transformed_parameters, emit_generated_quantities, pstream); + write_array_impl(base_rng, params_r, params_i, vars, + emit_transformed_parameters, emit_generated_quantities, pstream); } template @@ -271,13 +266,12 @@ class filename_good_model final : public model_base_crtp { inline void transform_inits(const stan::io::var_context& context, Eigen::Matrix& params_r, std::ostream* pstream = nullptr) const final { - std::vector params_r_vec(params_r.size()); + std::vector params_r_vec; + params_r_vec.reserve(params_r.size()); std::vector params_i; transform_inits_impl(context, params_i, params_r_vec, pstream); - params_r.resize(params_r_vec.size()); - for (int i = 0; i < params_r.size(); ++i) { - params_r.coeffRef(i) = params_r_vec[i]; - } + params_r = Eigen::Map>( + params_r_vec.data(), params_r_vec.size()); } inline void transform_inits(const stan::io::var_context& context, std::vector& params_i, diff --git a/test/integration/good/code-gen/cl.expected b/test/integration/good/code-gen/cl.expected index e813d2dac3..83677f5094 100644 --- a/test/integration/good/code-gen/cl.expected +++ b/test/integration/good/code-gen/cl.expected @@ -292,13 +292,13 @@ class optimize_glm_model final : public model_base_crtp { (void) DUMMY_VAR__; // suppress unused var warning try { int pos__; - pos__ = std::numeric_limits::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; current_statement__ = 176; context__.validate_dims("data initialization","k","int", - context__.to_vec()); - k = std::numeric_limits::min(); + std::vector{}); + k = std::numeric_limits::min(); current_statement__ = 176; k = context__.vals_i("k")[(1 - 1)]; @@ -307,8 +307,8 @@ class optimize_glm_model final : public model_base_crtp { check_greater_or_equal(function__, "k", k, 1); current_statement__ = 177; context__.validate_dims("data initialization","n","int", - context__.to_vec()); - n = std::numeric_limits::min(); + std::vector{}); + n = std::numeric_limits::min(); current_statement__ = 177; n = context__.vals_i("n")[(1 - 1)]; @@ -321,9 +321,10 @@ class optimize_glm_model final : public model_base_crtp { validate_non_negative_index("X_d", "k", k); current_statement__ = 180; context__.validate_dims("data initialization","X_d","double", - context__.to_vec(n, k)); + std::vector{static_cast(n), + static_cast(k)}); X_d = Eigen::Matrix(n, k); - stan::math::fill(X_d, std::numeric_limits::quiet_NaN()); + stan::math::fill(X_d, std::numeric_limits::quiet_NaN()); { std::vector X_d_flat__; @@ -339,7 +340,9 @@ class optimize_glm_model final : public model_base_crtp { assign(X_d, X_d_flat__[(pos__ - 1)], "assigning variable X_d", index_uni(sym2__), index_uni(sym1__)); current_statement__ = 180; - pos__ = (pos__ + 1);}} + pos__ = (pos__ + 1); + } + } } current_statement__ = 181; validate_non_negative_index("X_d_a", "n", n); @@ -347,9 +350,10 @@ class optimize_glm_model final : public model_base_crtp { validate_non_negative_index("X_d_a", "k", k); current_statement__ = 183; context__.validate_dims("data initialization","X_d_a","double", - context__.to_vec(2, n, k)); + std::vector{static_cast(2), + static_cast(n), static_cast(k)}); X_d_a = std::vector>(2, Eigen::Matrix(n, k)); - stan::math::fill(X_d_a, std::numeric_limits::quiet_NaN()); + stan::math::fill(X_d_a, std::numeric_limits::quiet_NaN()); { std::vector X_d_a_flat__; @@ -369,15 +373,18 @@ class optimize_glm_model final : public model_base_crtp { index_uni(sym2__), index_uni(sym1__)); current_statement__ = 183; - pos__ = (pos__ + 1);}}} + pos__ = (pos__ + 1); + } + } + } } current_statement__ = 184; validate_non_negative_index("y_v_d", "n", n); current_statement__ = 185; context__.validate_dims("data initialization","y_v_d","double", - context__.to_vec(n)); + std::vector{static_cast(n)}); y_v_d = Eigen::Matrix(n); - stan::math::fill(y_v_d, std::numeric_limits::quiet_NaN()); + stan::math::fill(y_v_d, std::numeric_limits::quiet_NaN()); { std::vector y_v_d_flat__; @@ -391,15 +398,16 @@ class optimize_glm_model final : public model_base_crtp { assign(y_v_d, y_v_d_flat__[(pos__ - 1)], "assigning variable y_v_d", index_uni(sym1__)); current_statement__ = 185; - pos__ = (pos__ + 1);} + pos__ = (pos__ + 1); + } } current_statement__ = 186; validate_non_negative_index("X_rv_d", "n", n); current_statement__ = 187; context__.validate_dims("data initialization","X_rv_d","double", - context__.to_vec(n)); + std::vector{static_cast(n)}); X_rv_d = Eigen::Matrix(n); - stan::math::fill(X_rv_d, std::numeric_limits::quiet_NaN()); + stan::math::fill(X_rv_d, std::numeric_limits::quiet_NaN()); { std::vector X_rv_d_flat__; @@ -413,14 +421,15 @@ class optimize_glm_model final : public model_base_crtp { assign(X_rv_d, X_rv_d_flat__[(pos__ - 1)], "assigning variable X_rv_d", index_uni(sym1__)); current_statement__ = 187; - pos__ = (pos__ + 1);} + pos__ = (pos__ + 1); + } } current_statement__ = 188; validate_non_negative_index("y_vi_d", "n", n); current_statement__ = 189; context__.validate_dims("data initialization","y_vi_d","int", - context__.to_vec(n)); - y_vi_d = std::vector(n, std::numeric_limits::min()); + std::vector{static_cast(n)}); + y_vi_d = std::vector(n, std::numeric_limits::min()); current_statement__ = 189; y_vi_d = context__.vals_i("y_vi_d"); @@ -428,66 +437,54 @@ class optimize_glm_model final : public model_base_crtp { validate_non_negative_index("y2_vi_d", "n", n); current_statement__ = 191; context__.validate_dims("data initialization","y2_vi_d","int", - context__.to_vec(n)); - y2_vi_d = std::vector(n, std::numeric_limits::min()); + std::vector{static_cast(n)}); + y2_vi_d = std::vector(n, std::numeric_limits::min()); current_statement__ = 191; y2_vi_d = context__.vals_i("y2_vi_d"); current_statement__ = 192; context__.validate_dims("data initialization","y_s_d","int", - context__.to_vec()); - y_s_d = std::numeric_limits::min(); + std::vector{}); + y_s_d = std::numeric_limits::min(); current_statement__ = 192; y_s_d = context__.vals_i("y_s_d")[(1 - 1)]; current_statement__ = 193; context__.validate_dims("data initialization","y_r_d","double", - context__.to_vec()); - y_r_d = std::numeric_limits::quiet_NaN(); + std::vector{}); + y_r_d = std::numeric_limits::quiet_NaN(); current_statement__ = 193; y_r_d = context__.vals_r("y_r_d")[(1 - 1)]; current_statement__ = 194; - k_td = std::numeric_limits::min(); current_statement__ = 195; - n_td = std::numeric_limits::min(); current_statement__ = 196; validate_non_negative_index("X_d_td", "n", n); current_statement__ = 197; validate_non_negative_index("X_d_td", "k", k); current_statement__ = 198; - X_d_td = Eigen::Matrix(n, k); - stan::math::fill(X_d_td, std::numeric_limits::quiet_NaN()); current_statement__ = 199; validate_non_negative_index("y_v_d_td", "n", n); current_statement__ = 200; - y_v_d_td = Eigen::Matrix(n); - stan::math::fill(y_v_d_td, std::numeric_limits::quiet_NaN()); current_statement__ = 201; validate_non_negative_index("X_rv_d_td", "n", n); current_statement__ = 202; - X_rv_d_td = Eigen::Matrix(n); - stan::math::fill(X_rv_d_td, std::numeric_limits::quiet_NaN()); current_statement__ = 203; validate_non_negative_index("y_vi_d_td", "n", n); current_statement__ = 204; - y_vi_d_td = std::vector(n, std::numeric_limits::min()); current_statement__ = 205; validate_non_negative_index("y2_vi_d_td", "n", n); current_statement__ = 206; - y2_vi_d_td = std::vector(n, std::numeric_limits::min()); current_statement__ = 207; - y_s_d_td = std::numeric_limits::min(); current_statement__ = 208; - y_r_d_td = std::numeric_limits::quiet_NaN(); current_statement__ = 194; current_statement__ = 194; @@ -528,23 +525,8 @@ class optimize_glm_model final : public model_base_crtp { // Next line prevents compiler griping about no return throw std::runtime_error("*** IF YOU SEE THIS, PLEASE REPORT A BUG ***"); } - num_params_r__ = 0U; + num_params_r__ = k + k + k + 1 + 1 + 1 + (n * k) + (n * k) + n; - try { - num_params_r__ += k; - num_params_r__ += k; - num_params_r__ += k; - num_params_r__ += 1; - num_params_r__ += 1; - num_params_r__ += 1; - num_params_r__ += n * k; - num_params_r__ += n * k; - num_params_r__ += n; - } catch (const std::exception& e) { - stan::lang::rethrow_located(e, locations_array__[current_statement__]); - // Next line prevents compiler griping about no return - throw std::runtime_error("*** IF YOU SEE THIS, PLEASE REPORT A BUG ***"); - } } template { try { Eigen::Matrix alpha_v; alpha_v = Eigen::Matrix(k); - stan::math::fill(alpha_v, DUMMY_VAR__); + stan::math::fill(alpha_v, DUMMY_VAR__); current_statement__ = 1; alpha_v = in__.template read>(k); Eigen::Matrix beta; beta = Eigen::Matrix(k); - stan::math::fill(beta, DUMMY_VAR__); + stan::math::fill(beta, DUMMY_VAR__); current_statement__ = 2; beta = in__.template read>(k); Eigen::Matrix cuts; cuts = Eigen::Matrix(k); - stan::math::fill(cuts, DUMMY_VAR__); + stan::math::fill(cuts, DUMMY_VAR__); current_statement__ = 3; cuts = in__.template read>(k); local_scalar_t__ sigma; - sigma = DUMMY_VAR__; + sigma = DUMMY_VAR__; current_statement__ = 4; sigma = in__.template read_constrain_lb( 0, lp__); local_scalar_t__ alpha; - alpha = DUMMY_VAR__; + alpha = DUMMY_VAR__; current_statement__ = 5; alpha = in__.template read(); local_scalar_t__ phi; - phi = DUMMY_VAR__; + phi = DUMMY_VAR__; current_statement__ = 6; phi = in__.template read(); Eigen::Matrix X_p; X_p = Eigen::Matrix(n, k); - stan::math::fill(X_p, DUMMY_VAR__); + stan::math::fill(X_p, DUMMY_VAR__); current_statement__ = 7; X_p = in__.template read>(n, k); Eigen::Matrix beta_m; beta_m = Eigen::Matrix(n, k); - stan::math::fill(beta_m, DUMMY_VAR__); + stan::math::fill(beta_m, DUMMY_VAR__); current_statement__ = 8; beta_m = in__.template read>(n, k); Eigen::Matrix X_rv_p; X_rv_p = Eigen::Matrix(n); - stan::math::fill(X_rv_p, DUMMY_VAR__); + stan::math::fill(X_rv_p, DUMMY_VAR__); current_statement__ = 9; X_rv_p = in__.template read>(n); @@ -1285,77 +1267,84 @@ class optimize_glm_model final : public model_base_crtp { try { Eigen::Matrix alpha_v; alpha_v = Eigen::Matrix(k); - stan::math::fill(alpha_v, std::numeric_limits::quiet_NaN()); + stan::math::fill(alpha_v, std::numeric_limits::quiet_NaN()); current_statement__ = 1; alpha_v = in__.template read>(k); Eigen::Matrix beta; beta = Eigen::Matrix(k); - stan::math::fill(beta, std::numeric_limits::quiet_NaN()); + stan::math::fill(beta, std::numeric_limits::quiet_NaN()); current_statement__ = 2; beta = in__.template read>(k); Eigen::Matrix cuts; cuts = Eigen::Matrix(k); - stan::math::fill(cuts, std::numeric_limits::quiet_NaN()); + stan::math::fill(cuts, std::numeric_limits::quiet_NaN()); current_statement__ = 3; cuts = in__.template read>(k); double sigma; - sigma = std::numeric_limits::quiet_NaN(); + sigma = std::numeric_limits::quiet_NaN(); current_statement__ = 4; sigma = in__.template read_constrain_lb( 0, lp__); double alpha; - alpha = std::numeric_limits::quiet_NaN(); + alpha = std::numeric_limits::quiet_NaN(); current_statement__ = 5; alpha = in__.template read(); double phi; - phi = std::numeric_limits::quiet_NaN(); + phi = std::numeric_limits::quiet_NaN(); current_statement__ = 6; phi = in__.template read(); Eigen::Matrix X_p; X_p = Eigen::Matrix(n, k); - stan::math::fill(X_p, std::numeric_limits::quiet_NaN()); + stan::math::fill(X_p, std::numeric_limits::quiet_NaN()); current_statement__ = 7; X_p = in__.template read>(n, k); Eigen::Matrix beta_m; beta_m = Eigen::Matrix(n, k); - stan::math::fill(beta_m, std::numeric_limits::quiet_NaN()); + stan::math::fill(beta_m, std::numeric_limits::quiet_NaN()); current_statement__ = 8; beta_m = in__.template read>(n, k); Eigen::Matrix X_rv_p; X_rv_p = Eigen::Matrix(n); - stan::math::fill(X_rv_p, std::numeric_limits::quiet_NaN()); + stan::math::fill(X_rv_p, std::numeric_limits::quiet_NaN()); current_statement__ = 9; X_rv_p = in__.template read>(n); for (int sym1__ = 1; sym1__ <= k; ++sym1__) { - vars__.emplace_back(alpha_v[(sym1__ - 1)]);} + vars__.emplace_back(alpha_v[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { - vars__.emplace_back(beta[(sym1__ - 1)]);} + vars__.emplace_back(beta[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { - vars__.emplace_back(cuts[(sym1__ - 1)]);} + vars__.emplace_back(cuts[(sym1__ - 1)]); + } vars__.emplace_back(sigma); vars__.emplace_back(alpha); vars__.emplace_back(phi); for (int sym1__ = 1; sym1__ <= k; ++sym1__) { for (int sym2__ = 1; sym2__ <= n; ++sym2__) { vars__.emplace_back( - rvalue(X_p, "X_p", index_uni(sym2__), index_uni(sym1__)));}} + rvalue(X_p, "X_p", index_uni(sym2__), index_uni(sym1__))); + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { for (int sym2__ = 1; sym2__ <= n; ++sym2__) { vars__.emplace_back( - rvalue(beta_m, "beta_m", index_uni(sym2__), index_uni(sym1__)));} + rvalue(beta_m, "beta_m", index_uni(sym2__), index_uni(sym1__))); + } } for (int sym1__ = 1; sym1__ <= n; ++sym1__) { - vars__.emplace_back(X_rv_p[(sym1__ - 1)]);} + vars__.emplace_back(X_rv_p[(sym1__ - 1)]); + } if (logical_negation((primitive_value(emit_transformed_parameters__) || primitive_value(emit_generated_quantities__)))) { return ; @@ -1383,12 +1372,12 @@ class optimize_glm_model final : public model_base_crtp { try { int pos__; - pos__ = std::numeric_limits::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; Eigen::Matrix alpha_v; alpha_v = Eigen::Matrix(k); - stan::math::fill(alpha_v, std::numeric_limits::quiet_NaN()); + stan::math::fill(alpha_v, std::numeric_limits::quiet_NaN()); { std::vector alpha_v_flat__; @@ -1402,11 +1391,12 @@ class optimize_glm_model final : public model_base_crtp { assign(alpha_v, alpha_v_flat__[(pos__ - 1)], "assigning variable alpha_v", index_uni(sym1__)); current_statement__ = 1; - pos__ = (pos__ + 1);} + pos__ = (pos__ + 1); + } } Eigen::Matrix beta; beta = Eigen::Matrix(k); - stan::math::fill(beta, std::numeric_limits::quiet_NaN()); + stan::math::fill(beta, std::numeric_limits::quiet_NaN()); { std::vector beta_flat__; @@ -1420,11 +1410,12 @@ class optimize_glm_model final : public model_base_crtp { assign(beta, beta_flat__[(pos__ - 1)], "assigning variable beta", index_uni(sym1__)); current_statement__ = 2; - pos__ = (pos__ + 1);} + pos__ = (pos__ + 1); + } } Eigen::Matrix cuts; cuts = Eigen::Matrix(k); - stan::math::fill(cuts, std::numeric_limits::quiet_NaN()); + stan::math::fill(cuts, std::numeric_limits::quiet_NaN()); { std::vector cuts_flat__; @@ -1438,31 +1429,32 @@ class optimize_glm_model final : public model_base_crtp { assign(cuts, cuts_flat__[(pos__ - 1)], "assigning variable cuts", index_uni(sym1__)); current_statement__ = 3; - pos__ = (pos__ + 1);} + pos__ = (pos__ + 1); + } } double sigma; - sigma = std::numeric_limits::quiet_NaN(); + sigma = std::numeric_limits::quiet_NaN(); current_statement__ = 4; sigma = context__.vals_r("sigma")[(1 - 1)]; double sigma_free__; - sigma_free__ = std::numeric_limits::quiet_NaN(); + sigma_free__ = std::numeric_limits::quiet_NaN(); current_statement__ = 4; sigma_free__ = stan::math::lb_free(sigma, 0); double alpha; - alpha = std::numeric_limits::quiet_NaN(); + alpha = std::numeric_limits::quiet_NaN(); current_statement__ = 5; alpha = context__.vals_r("alpha")[(1 - 1)]; double phi; - phi = std::numeric_limits::quiet_NaN(); + phi = std::numeric_limits::quiet_NaN(); current_statement__ = 6; phi = context__.vals_r("phi")[(1 - 1)]; Eigen::Matrix X_p; X_p = Eigen::Matrix(n, k); - stan::math::fill(X_p, std::numeric_limits::quiet_NaN()); + stan::math::fill(X_p, std::numeric_limits::quiet_NaN()); { std::vector X_p_flat__; @@ -1478,11 +1470,13 @@ class optimize_glm_model final : public model_base_crtp { assign(X_p, X_p_flat__[(pos__ - 1)], "assigning variable X_p", index_uni(sym2__), index_uni(sym1__)); current_statement__ = 7; - pos__ = (pos__ + 1);}} + pos__ = (pos__ + 1); + } + } } Eigen::Matrix beta_m; beta_m = Eigen::Matrix(n, k); - stan::math::fill(beta_m, std::numeric_limits::quiet_NaN()); + stan::math::fill(beta_m, std::numeric_limits::quiet_NaN()); { std::vector beta_m_flat__; @@ -1499,11 +1493,13 @@ class optimize_glm_model final : public model_base_crtp { "assigning variable beta_m", index_uni(sym2__), index_uni(sym1__)); current_statement__ = 8; - pos__ = (pos__ + 1);}} + pos__ = (pos__ + 1); + } + } } Eigen::Matrix X_rv_p; X_rv_p = Eigen::Matrix(n); - stan::math::fill(X_rv_p, std::numeric_limits::quiet_NaN()); + stan::math::fill(X_rv_p, std::numeric_limits::quiet_NaN()); { std::vector X_rv_p_flat__; @@ -1517,28 +1513,36 @@ class optimize_glm_model final : public model_base_crtp { assign(X_rv_p, X_rv_p_flat__[(pos__ - 1)], "assigning variable X_rv_p", index_uni(sym1__)); current_statement__ = 9; - pos__ = (pos__ + 1);} + pos__ = (pos__ + 1); + } } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { - vars__.emplace_back(alpha_v[(sym1__ - 1)]);} + vars__.emplace_back(alpha_v[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { - vars__.emplace_back(beta[(sym1__ - 1)]);} + vars__.emplace_back(beta[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { - vars__.emplace_back(cuts[(sym1__ - 1)]);} + vars__.emplace_back(cuts[(sym1__ - 1)]); + } vars__.emplace_back(sigma_free__); vars__.emplace_back(alpha); vars__.emplace_back(phi); for (int sym1__ = 1; sym1__ <= k; ++sym1__) { for (int sym2__ = 1; sym2__ <= n; ++sym2__) { vars__.emplace_back( - rvalue(X_p, "X_p", index_uni(sym2__), index_uni(sym1__)));}} + rvalue(X_p, "X_p", index_uni(sym2__), index_uni(sym1__))); + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { for (int sym2__ = 1; sym2__ <= n; ++sym2__) { vars__.emplace_back( - rvalue(beta_m, "beta_m", index_uni(sym2__), index_uni(sym1__)));} + rvalue(beta_m, "beta_m", index_uni(sym2__), index_uni(sym1__))); + } } for (int sym1__ = 1; sym1__ <= n; ++sym1__) { - vars__.emplace_back(X_rv_p[(sym1__ - 1)]);} + vars__.emplace_back(X_rv_p[(sym1__ - 1)]); + } } catch (const std::exception& e) { stan::lang::rethrow_located(e, locations_array__[current_statement__]); // Next line prevents compiler griping about no return @@ -1548,15 +1552,9 @@ class optimize_glm_model final : public model_base_crtp { inline void get_param_names(std::vector& names__) const { - names__ = std::vector{"alpha_v", - "beta", - "cuts", - "sigma", - "alpha", - "phi", - "X_p", - "beta_m", - "X_rv_p"}; + names__ = std::vector{"alpha_v", "beta", "cuts", "sigma", + "alpha", "phi", "X_p", "beta_m", "X_rv_p"}; + } // get_param_names() inline void get_dims(std::vector>& dimss__) const { @@ -1564,14 +1562,13 @@ class optimize_glm_model final : public model_base_crtp { dimss__ = std::vector>{std::vector{ static_cast(k) }, - std::vector{static_cast(k)}, - std::vector{static_cast(k)}, - std::vector{}, - std::vector{}, - std::vector{}, - std::vector{static_cast(n), static_cast(k)}, - std::vector{static_cast(n), static_cast(k)}, - std::vector{static_cast(n)}}; + std::vector{static_cast(k)}, + std::vector{static_cast(k)}, std::vector{ + }, std::vector{}, std::vector{}, + std::vector{static_cast(n), static_cast(k)}, + std::vector{static_cast(n), static_cast(k)}, + std::vector{static_cast(n)}}; + } // get_dims() inline void constrained_param_names( @@ -1583,15 +1580,18 @@ class optimize_glm_model final : public model_base_crtp { for (int sym1__ = 1; sym1__ <= k; ++sym1__) { { param_names__.emplace_back(std::string() + "alpha_v" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { { param_names__.emplace_back(std::string() + "beta" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { { param_names__.emplace_back(std::string() + "cuts" + '.' + std::to_string(sym1__)); - }} + } + } param_names__.emplace_back(std::string() + "sigma"); param_names__.emplace_back(std::string() + "alpha"); param_names__.emplace_back(std::string() + "phi"); @@ -1600,19 +1600,24 @@ class optimize_glm_model final : public model_base_crtp { for (int sym2__ = 1; sym2__ <= n; ++sym2__) { { param_names__.emplace_back(std::string() + "X_p" + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} + } + } + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { { for (int sym2__ = 1; sym2__ <= n; ++sym2__) { { param_names__.emplace_back(std::string() + "beta_m" + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} + } + } + } + } for (int sym1__ = 1; sym1__ <= n; ++sym1__) { { param_names__.emplace_back(std::string() + "X_rv_p" + '.' + std::to_string(sym1__)); - }} + } + } if (emit_transformed_parameters__) { } @@ -1632,15 +1637,18 @@ class optimize_glm_model final : public model_base_crtp { for (int sym1__ = 1; sym1__ <= k; ++sym1__) { { param_names__.emplace_back(std::string() + "alpha_v" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { { param_names__.emplace_back(std::string() + "beta" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { { param_names__.emplace_back(std::string() + "cuts" + '.' + std::to_string(sym1__)); - }} + } + } param_names__.emplace_back(std::string() + "sigma"); param_names__.emplace_back(std::string() + "alpha"); param_names__.emplace_back(std::string() + "phi"); @@ -1649,19 +1657,24 @@ class optimize_glm_model final : public model_base_crtp { for (int sym2__ = 1; sym2__ <= n; ++sym2__) { { param_names__.emplace_back(std::string() + "X_p" + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} + } + } + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { { for (int sym2__ = 1; sym2__ <= n; ++sym2__) { { param_names__.emplace_back(std::string() + "beta_m" + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} + } + } + } + } for (int sym1__ = 1; sym1__ <= n; ++sym1__) { { param_names__.emplace_back(std::string() + "X_rv_p" + '.' + std::to_string(sym1__)); - }} + } + } if (emit_transformed_parameters__) { } @@ -1672,14 +1685,16 @@ class optimize_glm_model final : public model_base_crtp { } // unconstrained_param_names() - inline std::string get_constrained_sizedtypes() const final { + inline std::string get_constrained_sizedtypes() const { + + return std::string("[{\"name\":\"alpha_v\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(k) + "},\"block\":\"parameters\"},{\"name\":\"beta\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(k) + "},\"block\":\"parameters\"},{\"name\":\"cuts\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(k) + "},\"block\":\"parameters\"},{\"name\":\"sigma\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"alpha\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"phi\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"X_p\",\"type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(n) + ",\"cols\":" + std::to_string(k) + "},\"block\":\"parameters\"},{\"name\":\"beta_m\",\"type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(n) + ",\"cols\":" + std::to_string(k) + "},\"block\":\"parameters\"},{\"name\":\"X_rv_p\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(n) + "},\"block\":\"parameters\"}]"); - return std::string("[{\"name\":\"alpha_v\",\"type\":{\"name\":\"vector\",\"length\":" << k << "},\"block\":\"parameters\"},{\"name\":\"beta\",\"type\":{\"name\":\"vector\",\"length\":" << k << "},\"block\":\"parameters\"},{\"name\":\"cuts\",\"type\":{\"name\":\"vector\",\"length\":" << k << "},\"block\":\"parameters\"},{\"name\":\"sigma\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"alpha\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"phi\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"X_p\",\"type\":{\"name\":\"matrix\",\"rows\":" << n << ",\"cols\":" << k << "},\"block\":\"parameters\"},{\"name\":\"beta_m\",\"type\":{\"name\":\"matrix\",\"rows\":" << n << ",\"cols\":" << k << "},\"block\":\"parameters\"},{\"name\":\"X_rv_p\",\"type\":{\"name\":\"vector\",\"length\":" << n << "},\"block\":\"parameters\"}]"); } // get_constrained_sizedtypes() - inline std::string get_unconstrained_sizedtypes() const final { + inline std::string get_unconstrained_sizedtypes() const { + + return std::string("[{\"name\":\"alpha_v\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(k) + "},\"block\":\"parameters\"},{\"name\":\"beta\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(k) + "},\"block\":\"parameters\"},{\"name\":\"cuts\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(k) + "},\"block\":\"parameters\"},{\"name\":\"sigma\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"alpha\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"phi\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"X_p\",\"type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(n) + ",\"cols\":" + std::to_string(k) + "},\"block\":\"parameters\"},{\"name\":\"beta_m\",\"type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(n) + ",\"cols\":" + std::to_string(k) + "},\"block\":\"parameters\"},{\"name\":\"X_rv_p\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(n) + "},\"block\":\"parameters\"}]"); - return std::string("[{\"name\":\"alpha_v\",\"type\":{\"name\":\"vector\",\"length\":" << k << "},\"block\":\"parameters\"},{\"name\":\"beta\",\"type\":{\"name\":\"vector\",\"length\":" << k << "},\"block\":\"parameters\"},{\"name\":\"cuts\",\"type\":{\"name\":\"vector\",\"length\":" << k << "},\"block\":\"parameters\"},{\"name\":\"sigma\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"alpha\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"phi\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"X_p\",\"type\":{\"name\":\"matrix\",\"rows\":" << n << ",\"cols\":" << k << "},\"block\":\"parameters\"},{\"name\":\"beta_m\",\"type\":{\"name\":\"matrix\",\"rows\":" << n << ",\"cols\":" << k << "},\"block\":\"parameters\"},{\"name\":\"X_rv_p\",\"type\":{\"name\":\"vector\",\"length\":" << n << "},\"block\":\"parameters\"}]"); } // get_unconstrained_sizedtypes() @@ -1691,14 +1706,13 @@ class optimize_glm_model final : public model_base_crtp { const bool emit_transformed_parameters = true, const bool emit_generated_quantities = true, std::ostream* pstream = nullptr) const { - std::vector vars_vec(vars.size()); + std::vector vars_vec; + vars_vec.reserve(vars.size()); std::vector params_i; write_array_impl(base_rng, params_r, params_i, vars_vec, emit_transformed_parameters, emit_generated_quantities, pstream); - vars.resize(vars_vec.size()); - for (int i = 0; i < vars.size(); ++i) { - vars.coeffRef(i) = vars_vec[i]; - } + vars = Eigen::Map>( + vars_vec.data(), vars_vec.size()); } template @@ -1708,7 +1722,8 @@ class optimize_glm_model final : public model_base_crtp { bool emit_transformed_parameters = true, bool emit_generated_quantities = true, std::ostream* pstream = nullptr) const { - write_array_impl(base_rng, params_r, params_i, vars, emit_transformed_parameters, emit_generated_quantities, pstream); + write_array_impl(base_rng, params_r, params_i, vars, + emit_transformed_parameters, emit_generated_quantities, pstream); } template @@ -1729,13 +1744,12 @@ class optimize_glm_model final : public model_base_crtp { inline void transform_inits(const stan::io::var_context& context, Eigen::Matrix& params_r, std::ostream* pstream = nullptr) const final { - std::vector params_r_vec(params_r.size()); + std::vector params_r_vec; + params_r_vec.reserve(params_r.size()); std::vector params_i; transform_inits_impl(context, params_i, params_r_vec, pstream); - params_r.resize(params_r_vec.size()); - for (int i = 0; i < params_r.size(); ++i) { - params_r.coeffRef(i) = params_r_vec[i]; - } + params_r = Eigen::Map>( + params_r_vec.data(), params_r_vec.size()); } inline void transform_inits(const stan::io::var_context& context, std::vector& params_i, diff --git a/test/integration/good/code-gen/cpp.expected b/test/integration/good/code-gen/cpp.expected index 1056a56b51..d3392845e3 100644 --- a/test/integration/good/code-gen/cpp.expected +++ b/test/integration/good/code-gen/cpp.expected @@ -69,13 +69,13 @@ class _8_schools_ncp_model final : public model_base_crtp<_8_schools_ncp_model> (void) DUMMY_VAR__; // suppress unused var warning try { int pos__; - pos__ = std::numeric_limits::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; current_statement__ = 9; context__.validate_dims("data initialization","J","int", - context__.to_vec()); - J = std::numeric_limits::min(); + std::vector{}); + J = std::numeric_limits::min(); current_statement__ = 9; J = context__.vals_i("J")[(1 - 1)]; @@ -86,8 +86,8 @@ class _8_schools_ncp_model final : public model_base_crtp<_8_schools_ncp_model> validate_non_negative_index("y", "J", J); current_statement__ = 11; context__.validate_dims("data initialization","y","double", - context__.to_vec(J)); - y = std::vector(J, std::numeric_limits::quiet_NaN()); + std::vector{static_cast(J)}); + y = std::vector(J, std::numeric_limits::quiet_NaN()); current_statement__ = 11; y = context__.vals_r("y"); @@ -95,8 +95,9 @@ class _8_schools_ncp_model final : public model_base_crtp<_8_schools_ncp_model> validate_non_negative_index("sigma", "J", J); current_statement__ = 13; context__.validate_dims("data initialization","sigma","double", - context__.to_vec(J)); + std::vector{static_cast(J)}); sigma = std::vector(J, std::numeric_limits::quiet_NaN()); + current_statement__ = 13; sigma = context__.vals_r("sigma"); @@ -105,7 +106,8 @@ class _8_schools_ncp_model final : public model_base_crtp<_8_schools_ncp_model> current_statement__ = 13; current_statement__ = 13; check_greater_or_equal(function__, "sigma[sym1__]", - sigma[(sym1__ - 1)], 0);} + sigma[(sym1__ - 1)], 0); + } current_statement__ = 14; validate_non_negative_index("theta_tilde", "J", J); current_statement__ = 15; @@ -115,17 +117,8 @@ class _8_schools_ncp_model final : public model_base_crtp<_8_schools_ncp_model> // Next line prevents compiler griping about no return throw std::runtime_error("*** IF YOU SEE THIS, PLEASE REPORT A BUG ***"); } - num_params_r__ = 0U; + num_params_r__ = 1 + 1 + J; - try { - num_params_r__ += 1; - num_params_r__ += 1; - num_params_r__ += J; - } catch (const std::exception& e) { - stan::lang::rethrow_located(e, locations_array__[current_statement__]); - // Next line prevents compiler griping about no return - throw std::runtime_error("*** IF YOU SEE THIS, PLEASE REPORT A BUG ***"); - } } template try { local_scalar_t__ mu; - mu = DUMMY_VAR__; + mu = DUMMY_VAR__; current_statement__ = 1; mu = in__.template read(); local_scalar_t__ tau; - tau = DUMMY_VAR__; + tau = DUMMY_VAR__; current_statement__ = 2; tau = in__.template read_constrain_lb(0, lp__); Eigen::Matrix theta_tilde; theta_tilde = Eigen::Matrix(J); - stan::math::fill(theta_tilde, DUMMY_VAR__); + stan::math::fill(theta_tilde, DUMMY_VAR__); current_statement__ = 3; theta_tilde = in__.template read>( J); Eigen::Matrix theta; theta = Eigen::Matrix(J); - stan::math::fill(theta, DUMMY_VAR__); + stan::math::fill(theta, DUMMY_VAR__); current_statement__ = 4; assign(theta, add(mu, multiply(tau, theta_tilde)), @@ -214,31 +207,32 @@ class _8_schools_ncp_model final : public model_base_crtp<_8_schools_ncp_model> try { double mu; - mu = std::numeric_limits::quiet_NaN(); + mu = std::numeric_limits::quiet_NaN(); current_statement__ = 1; mu = in__.template read(); double tau; - tau = std::numeric_limits::quiet_NaN(); + tau = std::numeric_limits::quiet_NaN(); current_statement__ = 2; tau = in__.template read_constrain_lb(0, lp__); Eigen::Matrix theta_tilde; theta_tilde = Eigen::Matrix(J); - stan::math::fill(theta_tilde, std::numeric_limits::quiet_NaN()); + stan::math::fill(theta_tilde, std::numeric_limits::quiet_NaN()); current_statement__ = 3; theta_tilde = in__.template read>( J); Eigen::Matrix theta; theta = Eigen::Matrix(J); - stan::math::fill(theta, std::numeric_limits::quiet_NaN()); + stan::math::fill(theta, std::numeric_limits::quiet_NaN()); vars__.emplace_back(mu); vars__.emplace_back(tau); for (int sym1__ = 1; sym1__ <= J; ++sym1__) { - vars__.emplace_back(theta_tilde[(sym1__ - 1)]);} + vars__.emplace_back(theta_tilde[(sym1__ - 1)]); + } if (logical_negation((primitive_value(emit_transformed_parameters__) || primitive_value(emit_generated_quantities__)))) { return ; @@ -248,7 +242,8 @@ class _8_schools_ncp_model final : public model_base_crtp<_8_schools_ncp_model> "assigning variable theta"); if (emit_transformed_parameters__) { for (int sym1__ = 1; sym1__ <= J; ++sym1__) { - vars__.emplace_back(theta[(sym1__ - 1)]);} + vars__.emplace_back(theta[(sym1__ - 1)]); + } } if (logical_negation(emit_generated_quantities__)) { return ; @@ -273,27 +268,27 @@ class _8_schools_ncp_model final : public model_base_crtp<_8_schools_ncp_model> try { int pos__; - pos__ = std::numeric_limits::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; double mu; - mu = std::numeric_limits::quiet_NaN(); + mu = std::numeric_limits::quiet_NaN(); current_statement__ = 1; mu = context__.vals_r("mu")[(1 - 1)]; double tau; - tau = std::numeric_limits::quiet_NaN(); + tau = std::numeric_limits::quiet_NaN(); current_statement__ = 2; tau = context__.vals_r("tau")[(1 - 1)]; double tau_free__; - tau_free__ = std::numeric_limits::quiet_NaN(); + tau_free__ = std::numeric_limits::quiet_NaN(); current_statement__ = 2; tau_free__ = stan::math::lb_free(tau, 0); Eigen::Matrix theta_tilde; theta_tilde = Eigen::Matrix(J); - stan::math::fill(theta_tilde, std::numeric_limits::quiet_NaN()); + stan::math::fill(theta_tilde, std::numeric_limits::quiet_NaN()); { std::vector theta_tilde_flat__; @@ -307,12 +302,14 @@ class _8_schools_ncp_model final : public model_base_crtp<_8_schools_ncp_model> assign(theta_tilde, theta_tilde_flat__[(pos__ - 1)], "assigning variable theta_tilde", index_uni(sym1__)); current_statement__ = 3; - pos__ = (pos__ + 1);} + pos__ = (pos__ + 1); + } } vars__.emplace_back(mu); vars__.emplace_back(tau_free__); for (int sym1__ = 1; sym1__ <= J; ++sym1__) { - vars__.emplace_back(theta_tilde[(sym1__ - 1)]);} + vars__.emplace_back(theta_tilde[(sym1__ - 1)]); + } } catch (const std::exception& e) { stan::lang::rethrow_located(e, locations_array__[current_statement__]); // Next line prevents compiler griping about no return @@ -322,18 +319,16 @@ class _8_schools_ncp_model final : public model_base_crtp<_8_schools_ncp_model> inline void get_param_names(std::vector& names__) const { - names__ = std::vector{"mu", - "tau", - "theta_tilde", - "theta"}; + names__ = std::vector{"mu", "tau", "theta_tilde", "theta"}; + } // get_param_names() inline void get_dims(std::vector>& dimss__) const { dimss__ = std::vector>{std::vector{}, - std::vector{}, - std::vector{static_cast(J)}, - std::vector{static_cast(J)}}; + std::vector{}, std::vector{static_cast(J)}, + std::vector{static_cast(J)}}; + } // get_dims() inline void constrained_param_names( @@ -347,12 +342,14 @@ class _8_schools_ncp_model final : public model_base_crtp<_8_schools_ncp_model> for (int sym1__ = 1; sym1__ <= J; ++sym1__) { { param_names__.emplace_back(std::string() + "theta_tilde" + '.' + std::to_string(sym1__)); - }} + } + } if (emit_transformed_parameters__) { for (int sym1__ = 1; sym1__ <= J; ++sym1__) { { param_names__.emplace_back(std::string() + "theta" + '.' + std::to_string(sym1__)); - }} + } + } } if (emit_generated_quantities__) { @@ -372,12 +369,14 @@ class _8_schools_ncp_model final : public model_base_crtp<_8_schools_ncp_model> for (int sym1__ = 1; sym1__ <= J; ++sym1__) { { param_names__.emplace_back(std::string() + "theta_tilde" + '.' + std::to_string(sym1__)); - }} + } + } if (emit_transformed_parameters__) { for (int sym1__ = 1; sym1__ <= J; ++sym1__) { { param_names__.emplace_back(std::string() + "theta" + '.' + std::to_string(sym1__)); - }} + } + } } if (emit_generated_quantities__) { @@ -386,14 +385,16 @@ class _8_schools_ncp_model final : public model_base_crtp<_8_schools_ncp_model> } // unconstrained_param_names() - inline std::string get_constrained_sizedtypes() const final { + inline std::string get_constrained_sizedtypes() const { + + return std::string("[{\"name\":\"mu\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"tau\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"theta_tilde\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(J) + "},\"block\":\"parameters\"},{\"name\":\"theta\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(J) + "},\"block\":\"transformed_parameters\"}]"); - return std::string("[{\"name\":\"mu\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"tau\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"theta_tilde\",\"type\":{\"name\":\"vector\",\"length\":" << J << "},\"block\":\"parameters\"},{\"name\":\"theta\",\"type\":{\"name\":\"vector\",\"length\":" << J << "},\"block\":\"transformed_parameters\"}]"); } // get_constrained_sizedtypes() - inline std::string get_unconstrained_sizedtypes() const final { + inline std::string get_unconstrained_sizedtypes() const { + + return std::string("[{\"name\":\"mu\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"tau\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"theta_tilde\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(J) + "},\"block\":\"parameters\"},{\"name\":\"theta\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(J) + "},\"block\":\"transformed_parameters\"}]"); - return std::string("[{\"name\":\"mu\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"tau\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"theta_tilde\",\"type\":{\"name\":\"vector\",\"length\":" << J << "},\"block\":\"parameters\"},{\"name\":\"theta\",\"type\":{\"name\":\"vector\",\"length\":" << J << "},\"block\":\"transformed_parameters\"}]"); } // get_unconstrained_sizedtypes() @@ -405,14 +406,13 @@ class _8_schools_ncp_model final : public model_base_crtp<_8_schools_ncp_model> const bool emit_transformed_parameters = true, const bool emit_generated_quantities = true, std::ostream* pstream = nullptr) const { - std::vector vars_vec(vars.size()); + std::vector vars_vec; + vars_vec.reserve(vars.size()); std::vector params_i; write_array_impl(base_rng, params_r, params_i, vars_vec, emit_transformed_parameters, emit_generated_quantities, pstream); - vars.resize(vars_vec.size()); - for (int i = 0; i < vars.size(); ++i) { - vars.coeffRef(i) = vars_vec[i]; - } + vars = Eigen::Map>( + vars_vec.data(), vars_vec.size()); } template @@ -422,7 +422,8 @@ class _8_schools_ncp_model final : public model_base_crtp<_8_schools_ncp_model> bool emit_transformed_parameters = true, bool emit_generated_quantities = true, std::ostream* pstream = nullptr) const { - write_array_impl(base_rng, params_r, params_i, vars, emit_transformed_parameters, emit_generated_quantities, pstream); + write_array_impl(base_rng, params_r, params_i, vars, + emit_transformed_parameters, emit_generated_quantities, pstream); } template @@ -443,13 +444,12 @@ class _8_schools_ncp_model final : public model_base_crtp<_8_schools_ncp_model> inline void transform_inits(const stan::io::var_context& context, Eigen::Matrix& params_r, std::ostream* pstream = nullptr) const final { - std::vector params_r_vec(params_r.size()); + std::vector params_r_vec; + params_r_vec.reserve(params_r.size()); std::vector params_i; transform_inits_impl(context, params_i, params_r_vec, pstream); - params_r.resize(params_r_vec.size()); - for (int i = 0; i < params_r.size(); ++i) { - params_r.coeffRef(i) = params_r_vec[i]; - } + params_r = Eigen::Map>( + params_r_vec.data(), params_r_vec.size()); } inline void transform_inits(const stan::io::var_context& context, std::vector& params_i, @@ -537,13 +537,13 @@ class _8start_with_number_model final : public model_base_crtp<_8start_with_numb (void) DUMMY_VAR__; // suppress unused var warning try { int pos__; - pos__ = std::numeric_limits::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; current_statement__ = 2; context__.validate_dims("data initialization","good_model","int", - context__.to_vec()); - good_model = std::numeric_limits::min(); + std::vector{}); + good_model = std::numeric_limits::min(); current_statement__ = 2; good_model = context__.vals_i("good_model")[(1 - 1)]; @@ -552,15 +552,8 @@ class _8start_with_number_model final : public model_base_crtp<_8start_with_numb // Next line prevents compiler griping about no return throw std::runtime_error("*** IF YOU SEE THIS, PLEASE REPORT A BUG ***"); } - num_params_r__ = 0U; + num_params_r__ = 1; - try { - num_params_r__ += 1; - } catch (const std::exception& e) { - stan::lang::rethrow_located(e, locations_array__[current_statement__]); - // Next line prevents compiler griping about no return - throw std::runtime_error("*** IF YOU SEE THIS, PLEASE REPORT A BUG ***"); - } } template (); @@ -619,7 +612,7 @@ class _8start_with_number_model final : public model_base_crtp<_8start_with_numb try { double bar; - bar = std::numeric_limits::quiet_NaN(); + bar = std::numeric_limits::quiet_NaN(); current_statement__ = 1; bar = in__.template read(); @@ -651,11 +644,11 @@ class _8start_with_number_model final : public model_base_crtp<_8start_with_numb try { int pos__; - pos__ = std::numeric_limits::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; double bar; - bar = std::numeric_limits::quiet_NaN(); + bar = std::numeric_limits::quiet_NaN(); current_statement__ = 1; bar = context__.vals_r("bar")[(1 - 1)]; @@ -670,11 +663,13 @@ class _8start_with_number_model final : public model_base_crtp<_8start_with_numb inline void get_param_names(std::vector& names__) const { names__ = std::vector{"bar"}; + } // get_param_names() inline void get_dims(std::vector>& dimss__) const { dimss__ = std::vector>{std::vector{}}; + } // get_dims() inline void constrained_param_names( @@ -711,14 +706,16 @@ class _8start_with_number_model final : public model_base_crtp<_8start_with_numb } // unconstrained_param_names() - inline std::string get_constrained_sizedtypes() const final { + inline std::string get_constrained_sizedtypes() const { return std::string("[{\"name\":\"bar\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"}]"); + } // get_constrained_sizedtypes() - inline std::string get_unconstrained_sizedtypes() const final { + inline std::string get_unconstrained_sizedtypes() const { return std::string("[{\"name\":\"bar\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"}]"); + } // get_unconstrained_sizedtypes() @@ -730,14 +727,13 @@ class _8start_with_number_model final : public model_base_crtp<_8start_with_numb const bool emit_transformed_parameters = true, const bool emit_generated_quantities = true, std::ostream* pstream = nullptr) const { - std::vector vars_vec(vars.size()); + std::vector vars_vec; + vars_vec.reserve(vars.size()); std::vector params_i; write_array_impl(base_rng, params_r, params_i, vars_vec, emit_transformed_parameters, emit_generated_quantities, pstream); - vars.resize(vars_vec.size()); - for (int i = 0; i < vars.size(); ++i) { - vars.coeffRef(i) = vars_vec[i]; - } + vars = Eigen::Map>( + vars_vec.data(), vars_vec.size()); } template @@ -747,7 +743,8 @@ class _8start_with_number_model final : public model_base_crtp<_8start_with_numb bool emit_transformed_parameters = true, bool emit_generated_quantities = true, std::ostream* pstream = nullptr) const { - write_array_impl(base_rng, params_r, params_i, vars, emit_transformed_parameters, emit_generated_quantities, pstream); + write_array_impl(base_rng, params_r, params_i, vars, + emit_transformed_parameters, emit_generated_quantities, pstream); } template @@ -768,13 +765,12 @@ class _8start_with_number_model final : public model_base_crtp<_8start_with_numb inline void transform_inits(const stan::io::var_context& context, Eigen::Matrix& params_r, std::ostream* pstream = nullptr) const final { - std::vector params_r_vec(params_r.size()); + std::vector params_r_vec; + params_r_vec.reserve(params_r.size()); std::vector params_i; transform_inits_impl(context, params_i, params_r_vec, pstream); - params_r.resize(params_r_vec.size()); - for (int i = 0; i < params_r.size(); ++i) { - params_r.coeffRef(i) = params_r_vec[i]; - } + params_r = Eigen::Map>( + params_r_vec.data(), params_r_vec.size()); } inline void transform_inits(const stan::io::var_context& context, std::vector& params_i, @@ -878,13 +874,13 @@ class eight_schools_ncp_model final : public model_base_crtp::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; current_statement__ = 9; context__.validate_dims("data initialization","J","int", - context__.to_vec()); - J = std::numeric_limits::min(); + std::vector{}); + J = std::numeric_limits::min(); current_statement__ = 9; J = context__.vals_i("J")[(1 - 1)]; @@ -895,8 +891,8 @@ class eight_schools_ncp_model final : public model_base_crtp(J, std::numeric_limits::quiet_NaN()); + std::vector{static_cast(J)}); + y = std::vector(J, std::numeric_limits::quiet_NaN()); current_statement__ = 11; y = context__.vals_r("y"); @@ -904,8 +900,9 @@ class eight_schools_ncp_model final : public model_base_crtp{static_cast(J)}); sigma = std::vector(J, std::numeric_limits::quiet_NaN()); + current_statement__ = 13; sigma = context__.vals_r("sigma"); @@ -914,7 +911,8 @@ class eight_schools_ncp_model final : public model_base_crtp(); local_scalar_t__ tau; - tau = DUMMY_VAR__; + tau = DUMMY_VAR__; current_statement__ = 2; tau = in__.template read_constrain_lb(0, lp__); Eigen::Matrix theta_tilde; theta_tilde = Eigen::Matrix(J); - stan::math::fill(theta_tilde, DUMMY_VAR__); + stan::math::fill(theta_tilde, DUMMY_VAR__); current_statement__ = 3; theta_tilde = in__.template read>( J); Eigen::Matrix theta; theta = Eigen::Matrix(J); - stan::math::fill(theta, DUMMY_VAR__); + stan::math::fill(theta, DUMMY_VAR__); current_statement__ = 4; assign(theta, add(mu, multiply(tau, theta_tilde)), @@ -1023,31 +1012,32 @@ class eight_schools_ncp_model final : public model_base_crtp::quiet_NaN(); + mu = std::numeric_limits::quiet_NaN(); current_statement__ = 1; mu = in__.template read(); double tau; - tau = std::numeric_limits::quiet_NaN(); + tau = std::numeric_limits::quiet_NaN(); current_statement__ = 2; tau = in__.template read_constrain_lb(0, lp__); Eigen::Matrix theta_tilde; theta_tilde = Eigen::Matrix(J); - stan::math::fill(theta_tilde, std::numeric_limits::quiet_NaN()); + stan::math::fill(theta_tilde, std::numeric_limits::quiet_NaN()); current_statement__ = 3; theta_tilde = in__.template read>( J); Eigen::Matrix theta; theta = Eigen::Matrix(J); - stan::math::fill(theta, std::numeric_limits::quiet_NaN()); + stan::math::fill(theta, std::numeric_limits::quiet_NaN()); vars__.emplace_back(mu); vars__.emplace_back(tau); for (int sym1__ = 1; sym1__ <= J; ++sym1__) { - vars__.emplace_back(theta_tilde[(sym1__ - 1)]);} + vars__.emplace_back(theta_tilde[(sym1__ - 1)]); + } if (logical_negation((primitive_value(emit_transformed_parameters__) || primitive_value(emit_generated_quantities__)))) { return ; @@ -1057,7 +1047,8 @@ class eight_schools_ncp_model final : public model_base_crtp::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; double mu; - mu = std::numeric_limits::quiet_NaN(); + mu = std::numeric_limits::quiet_NaN(); current_statement__ = 1; mu = context__.vals_r("mu")[(1 - 1)]; double tau; - tau = std::numeric_limits::quiet_NaN(); + tau = std::numeric_limits::quiet_NaN(); current_statement__ = 2; tau = context__.vals_r("tau")[(1 - 1)]; double tau_free__; - tau_free__ = std::numeric_limits::quiet_NaN(); + tau_free__ = std::numeric_limits::quiet_NaN(); current_statement__ = 2; tau_free__ = stan::math::lb_free(tau, 0); Eigen::Matrix theta_tilde; theta_tilde = Eigen::Matrix(J); - stan::math::fill(theta_tilde, std::numeric_limits::quiet_NaN()); + stan::math::fill(theta_tilde, std::numeric_limits::quiet_NaN()); { std::vector theta_tilde_flat__; @@ -1116,12 +1107,14 @@ class eight_schools_ncp_model final : public model_base_crtp& names__) const { - names__ = std::vector{"mu", - "tau", - "theta_tilde", - "theta"}; + names__ = std::vector{"mu", "tau", "theta_tilde", "theta"}; + } // get_param_names() inline void get_dims(std::vector>& dimss__) const { dimss__ = std::vector>{std::vector{}, - std::vector{}, - std::vector{static_cast(J)}, - std::vector{static_cast(J)}}; + std::vector{}, std::vector{static_cast(J)}, + std::vector{static_cast(J)}}; + } // get_dims() inline void constrained_param_names( @@ -1156,12 +1147,14 @@ class eight_schools_ncp_model final : public model_base_crtp vars_vec(vars.size()); + std::vector vars_vec; + vars_vec.reserve(vars.size()); std::vector params_i; write_array_impl(base_rng, params_r, params_i, vars_vec, emit_transformed_parameters, emit_generated_quantities, pstream); - vars.resize(vars_vec.size()); - for (int i = 0; i < vars.size(); ++i) { - vars.coeffRef(i) = vars_vec[i]; - } + vars = Eigen::Map>( + vars_vec.data(), vars_vec.size()); } template @@ -1231,7 +1227,8 @@ class eight_schools_ncp_model final : public model_base_crtp @@ -1252,13 +1249,12 @@ class eight_schools_ncp_model final : public model_base_crtp& params_r, std::ostream* pstream = nullptr) const final { - std::vector params_r_vec(params_r.size()); + std::vector params_r_vec; + params_r_vec.reserve(params_r.size()); std::vector params_i; transform_inits_impl(context, params_i, params_r_vec, pstream); - params_r.resize(params_r_vec.size()); - for (int i = 0; i < params_r.size(); ++i) { - params_r.coeffRef(i) = params_r_vec[i]; - } + params_r = Eigen::Map>( + params_r_vec.data(), params_r_vec.size()); } inline void transform_inits(const stan::io::var_context& context, std::vector& params_i, @@ -1350,26 +1346,18 @@ class mixed_type_arrays_model final : public model_base_crtp::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; current_statement__ = 5; - x = std::vector(3, std::numeric_limits::quiet_NaN()); } catch (const std::exception& e) { stan::lang::rethrow_located(e, locations_array__[current_statement__]); // Next line prevents compiler griping about no return throw std::runtime_error("*** IF YOU SEE THIS, PLEASE REPORT A BUG ***"); } - num_params_r__ = 0U; + num_params_r__ = 3; - try { - num_params_r__ += 3; - } catch (const std::exception& e) { - stan::lang::rethrow_located(e, locations_array__[current_statement__]); - // Next line prevents compiler griping about no return - throw std::runtime_error("*** IF YOU SEE THIS, PLEASE REPORT A BUG ***"); - } } template xx; - xx = std::vector(3, DUMMY_VAR__); + xx = std::vector(3, DUMMY_VAR__); current_statement__ = 1; xx = in__.template read>(3); std::vector> y; y = std::vector>(3, std::vector(3, DUMMY_VAR__)); + current_statement__ = 2; assign(y, std::vector>{ @@ -1404,6 +1393,7 @@ class mixed_type_arrays_model final : public model_base_crtp> w; w = std::vector>(3, std::vector(3, DUMMY_VAR__)); + current_statement__ = 3; assign(w, std::vector>{ @@ -1414,6 +1404,7 @@ class mixed_type_arrays_model final : public model_base_crtp> td_arr33; td_arr33 = std::vector>(3, std::vector(3, DUMMY_VAR__)); + current_statement__ = 4; assign(td_arr33, std::vector>{std::vector{ @@ -1457,21 +1448,25 @@ class mixed_type_arrays_model final : public model_base_crtp xx; - xx = std::vector(3, std::numeric_limits::quiet_NaN()); + xx = std::vector(3, std::numeric_limits::quiet_NaN()); current_statement__ = 1; xx = in__.template read>(3); std::vector> y; y = std::vector>(3, std::vector(3, std::numeric_limits::quiet_NaN())); + std::vector> w; w = std::vector>(3, std::vector(3, std::numeric_limits::quiet_NaN())); + std::vector> td_arr33; td_arr33 = std::vector>(3, std::vector(3, std::numeric_limits::quiet_NaN())); + for (int sym1__ = 1; sym1__ <= 3; ++sym1__) { - vars__.emplace_back(xx[(sym1__ - 1)]);} + vars__.emplace_back(xx[(sym1__ - 1)]); + } if (logical_negation((primitive_value(emit_transformed_parameters__) || primitive_value(emit_generated_quantities__)))) { return ; @@ -1499,13 +1494,19 @@ class mixed_type_arrays_model final : public model_base_crtp::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; std::vector xx; - xx = std::vector(3, std::numeric_limits::quiet_NaN()); + xx = std::vector(3, std::numeric_limits::quiet_NaN()); current_statement__ = 1; xx = context__.vals_r("xx"); for (int sym1__ = 1; sym1__ <= 3; ++sym1__) { - vars__.emplace_back(xx[(sym1__ - 1)]);} + vars__.emplace_back(xx[(sym1__ - 1)]); + } } catch (const std::exception& e) { stan::lang::rethrow_located(e, locations_array__[current_statement__]); // Next line prevents compiler griping about no return @@ -1549,10 +1551,8 @@ class mixed_type_arrays_model final : public model_base_crtp& names__) const { - names__ = std::vector{"xx", - "y", - "w", - "td_arr33"}; + names__ = std::vector{"xx", "y", "w", "td_arr33"}; + } // get_param_names() inline void get_dims(std::vector>& dimss__) const { @@ -1560,9 +1560,10 @@ class mixed_type_arrays_model final : public model_base_crtp>{std::vector{ static_cast(3) }, - std::vector{static_cast(3), static_cast(3)}, - std::vector{static_cast(3), static_cast(3)}, - std::vector{static_cast(3), static_cast(3)}}; + std::vector{static_cast(3), static_cast(3)}, + std::vector{static_cast(3), static_cast(3)}, + std::vector{static_cast(3), static_cast(3)}}; + } // get_dims() inline void constrained_param_names( @@ -1574,29 +1575,36 @@ class mixed_type_arrays_model final : public model_base_crtp vars_vec(vars.size()); + std::vector vars_vec; + vars_vec.reserve(vars.size()); std::vector params_i; write_array_impl(base_rng, params_r, params_i, vars_vec, emit_transformed_parameters, emit_generated_quantities, pstream); - vars.resize(vars_vec.size()); - for (int i = 0; i < vars.size(); ++i) { - vars.coeffRef(i) = vars_vec[i]; - } + vars = Eigen::Map>( + vars_vec.data(), vars_vec.size()); } template @@ -1681,7 +1697,8 @@ class mixed_type_arrays_model final : public model_base_crtp @@ -1702,13 +1719,12 @@ class mixed_type_arrays_model final : public model_base_crtp& params_r, std::ostream* pstream = nullptr) const final { - std::vector params_r_vec(params_r.size()); + std::vector params_r_vec; + params_r_vec.reserve(params_r.size()); std::vector params_i; transform_inits_impl(context, params_i, params_r_vec, pstream); - params_r.resize(params_r_vec.size()); - for (int i = 0; i < params_r.size(); ++i) { - params_r.coeffRef(i) = params_r_vec[i]; - } + params_r = Eigen::Map>( + params_r_vec.data(), params_r_vec.size()); } inline void transform_inits(const stan::io::var_context& context, std::vector& params_i, @@ -2596,7 +2612,7 @@ sho(const T0__& t, const std::vector& y, (void) DUMMY_VAR__; // suppress unused var warning try { std::vector dydt; - dydt = std::vector(2, DUMMY_VAR__); + dydt = std::vector(2, DUMMY_VAR__); current_statement__ = 586; assign(dydt, rvalue(y, "y", index_uni(2)), @@ -2890,7 +2906,7 @@ foo_1(const int& a, std::ostream* pstream__) { current_statement__ = 619; while (1) { int b; - b = std::numeric_limits::min(); + b = std::numeric_limits::min(); current_statement__ = 616; b = 5; @@ -2926,9 +2942,10 @@ foo_1(const int& a, std::ostream* pstream__) { while (1) { std::vector> vs; vs = std::vector>(2, std::vector(3, std::numeric_limits::min())); + int z; - z = std::numeric_limits::min(); + z = std::numeric_limits::min(); current_statement__ = 636; for (int sym1__ = 1; sym1__ <= stan::math::size(vs); ++sym1__) { @@ -2939,7 +2956,8 @@ foo_1(const int& a, std::ostream* pstream__) { current_statement__ = 637; z = 0; break; - }} + } + } current_statement__ = 639; for (int sym1__ = 1; sym1__ <= stan::math::size(vs); ++sym1__) { { @@ -2949,7 +2967,8 @@ foo_1(const int& a, std::ostream* pstream__) { current_statement__ = 640; z = 0; continue; - }} + } + } current_statement__ = 642; for (int sym1__ = 1; sym1__ <= stan::math::size(vs); ++sym1__) { { @@ -2965,19 +2984,21 @@ foo_1(const int& a, std::ostream* pstream__) { current_statement__ = 644; z = 0; break; - }} + } + } current_statement__ = 646; z = 1; - }} + } + } } current_statement__ = 658; while (1) { local_scalar_t__ z; - z = DUMMY_VAR__; + z = DUMMY_VAR__; Eigen::Matrix vs; vs = Eigen::Matrix(2, 3); - stan::math::fill(vs, DUMMY_VAR__); + stan::math::fill(vs, DUMMY_VAR__); current_statement__ = 651; for (int sym1__ = 1; sym1__ <= rows(vs); ++sym1__) { @@ -2992,7 +3013,9 @@ foo_1(const int& a, std::ostream* pstream__) { current_statement__ = 652; z = 0; break; - }}} + } + } + } current_statement__ = 654; for (int sym1__ = 1; sym1__ <= rows(vs); ++sym1__) { current_statement__ = 654; @@ -3006,16 +3029,18 @@ foo_1(const int& a, std::ostream* pstream__) { current_statement__ = 655; z = 3.1; continue; - }}} + } + } + } } current_statement__ = 668; while (1) { local_scalar_t__ z; - z = DUMMY_VAR__; + z = DUMMY_VAR__; Eigen::Matrix vs; vs = Eigen::Matrix(2); - stan::math::fill(vs, DUMMY_VAR__); + stan::math::fill(vs, DUMMY_VAR__); current_statement__ = 661; for (int sym1__ = 1; sym1__ <= stan::math::size(vs); ++sym1__) { @@ -3026,7 +3051,8 @@ foo_1(const int& a, std::ostream* pstream__) { current_statement__ = 662; z = 0; break; - }} + } + } current_statement__ = 664; for (int sym1__ = 1; sym1__ <= stan::math::size(vs); ++sym1__) { { @@ -3036,16 +3062,17 @@ foo_1(const int& a, std::ostream* pstream__) { current_statement__ = 665; z = 3.2; continue; - }} + } + } } current_statement__ = 678; while (1) { local_scalar_t__ z; - z = DUMMY_VAR__; + z = DUMMY_VAR__; Eigen::Matrix vs; vs = Eigen::Matrix(2); - stan::math::fill(vs, DUMMY_VAR__); + stan::math::fill(vs, DUMMY_VAR__); current_statement__ = 671; for (int sym1__ = 1; sym1__ <= stan::math::size(vs); ++sym1__) { @@ -3056,7 +3083,8 @@ foo_1(const int& a, std::ostream* pstream__) { current_statement__ = 672; z = 0; break; - }} + } + } current_statement__ = 674; for (int sym1__ = 1; sym1__ <= stan::math::size(vs); ++sym1__) { { @@ -3066,18 +3094,19 @@ foo_1(const int& a, std::ostream* pstream__) { current_statement__ = 675; z = 3.3; continue; - }} + } + } } current_statement__ = 686; while (1) { int b; - b = std::numeric_limits::min(); + b = std::numeric_limits::min(); current_statement__ = 680; b = 5; { int c; - c = std::numeric_limits::min(); + c = std::numeric_limits::min(); current_statement__ = 682; c = 6; @@ -3112,10 +3141,10 @@ foo_2(const int& a, std::ostream* pstream__) { (void) DUMMY_VAR__; // suppress unused var warning try { std::vector vs; - vs = std::vector(2, std::numeric_limits::min()); + vs = std::vector(2, std::numeric_limits::min()); int y; - y = std::numeric_limits::min(); + y = std::numeric_limits::min(); current_statement__ = 691; for (int sym1__ = 1; sym1__ <= stan::math::size(vs); ++sym1__) { @@ -3125,7 +3154,8 @@ foo_2(const int& a, std::ostream* pstream__) { v = vs[(sym1__ - 1)]; current_statement__ = 692; y = v; - }} + } + } current_statement__ = 693; return 0; } catch (const std::exception& e) { @@ -3249,10 +3279,10 @@ relative_diff(const T0__& x, const T1__& y, const T2__& max_, (void) DUMMY_VAR__; // suppress unused var warning try { local_scalar_t__ abs_diff; - abs_diff = DUMMY_VAR__; + abs_diff = DUMMY_VAR__; local_scalar_t__ avg_scale; - avg_scale = DUMMY_VAR__; + avg_scale = DUMMY_VAR__; current_statement__ = 703; abs_diff = stan::math::fabs((x - y)); @@ -3441,7 +3471,7 @@ covsqrt2corsqrt(const T0__& mat_arg__, const int& invert, validate_non_negative_index("o", "cols(mat)", cols(mat)); Eigen::Matrix o; o = Eigen::Matrix(rows(mat), cols(mat)); - stan::math::fill(o, DUMMY_VAR__); + stan::math::fill(o, DUMMY_VAR__); current_statement__ = 720; assign(o, mat, "assigning variable o"); @@ -4260,17 +4290,18 @@ foo_6(std::ostream* pstream__) { (void) DUMMY_VAR__; // suppress unused var warning try { int a; - a = std::numeric_limits::min(); + a = std::numeric_limits::min(); local_scalar_t__ b; - b = DUMMY_VAR__; + b = DUMMY_VAR__; std::vector> c; c = std::vector>(20, std::vector(30, DUMMY_VAR__)); + std::vector>> ar_mat; ar_mat = std::vector>>(60, std::vector>(70, Eigen::Matrix(40, 50))); - stan::math::fill(ar_mat, DUMMY_VAR__); + stan::math::fill(ar_mat, DUMMY_VAR__); current_statement__ = 755; assign(ar_mat, b, @@ -4363,7 +4394,7 @@ vecmufoo(const T0__& mu, std::ostream* pstream__) { try { Eigen::Matrix l; l = Eigen::Matrix(10); - stan::math::fill(l, DUMMY_VAR__); + stan::math::fill(l, DUMMY_VAR__); current_statement__ = 761; assign(l, multiply(mu, vecfoo(pstream__)), "assigning variable l"); @@ -4398,7 +4429,7 @@ vecmubar(const T0__& mu, std::ostream* pstream__) { try { Eigen::Matrix l; l = Eigen::Matrix(10); - stan::math::fill(l, DUMMY_VAR__); + stan::math::fill(l, DUMMY_VAR__); current_statement__ = 764; assign(l, @@ -4442,7 +4473,7 @@ algebra_system(const T0__& x_arg__, const T1__& y_arg__, try { Eigen::Matrix f_x; f_x = Eigen::Matrix(2); - stan::math::fill(f_x, DUMMY_VAR__); + stan::math::fill(f_x, DUMMY_VAR__); current_statement__ = 768; assign(f_x, @@ -4491,7 +4522,7 @@ binomialf(const T0__& phi_arg__, const T1__& theta_arg__, try { Eigen::Matrix lpmf; lpmf = Eigen::Matrix(1); - stan::math::fill(lpmf, DUMMY_VAR__); + stan::math::fill(lpmf, DUMMY_VAR__); current_statement__ = 773; assign(lpmf, 0.0, "assigning variable lpmf", index_uni(1)); @@ -4622,13 +4653,13 @@ class mother_model final : public model_base_crtp { (void) DUMMY_VAR__; // suppress unused var warning try { int pos__; - pos__ = std::numeric_limits::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; current_statement__ = 186; context__.validate_dims("data initialization","N","int", - context__.to_vec()); - N = std::numeric_limits::min(); + std::vector{}); + N = std::numeric_limits::min(); current_statement__ = 186; N = context__.vals_i("N")[(1 - 1)]; @@ -4637,8 +4668,8 @@ class mother_model final : public model_base_crtp { check_greater_or_equal(function__, "N", N, 0); current_statement__ = 187; context__.validate_dims("data initialization","M","int", - context__.to_vec()); - M = std::numeric_limits::min(); + std::vector{}); + M = std::numeric_limits::min(); current_statement__ = 187; M = context__.vals_i("M")[(1 - 1)]; @@ -4647,8 +4678,8 @@ class mother_model final : public model_base_crtp { check_greater_or_equal(function__, "M", M, 0); current_statement__ = 188; context__.validate_dims("data initialization","K","int", - context__.to_vec()); - K = std::numeric_limits::min(); + std::vector{}); + K = std::numeric_limits::min(); current_statement__ = 188; K = context__.vals_i("K")[(1 - 1)]; @@ -4662,8 +4693,8 @@ class mother_model final : public model_base_crtp { validate_non_negative_index("d_int_1d_ar", "N", N); current_statement__ = 190; context__.validate_dims("data initialization","d_int_1d_ar","int", - context__.to_vec(N)); - d_int_1d_ar = std::vector(N, std::numeric_limits::min()); + std::vector{static_cast(N)}); + d_int_1d_ar = std::vector(N, std::numeric_limits::min()); current_statement__ = 190; d_int_1d_ar = context__.vals_i("d_int_1d_ar"); @@ -4672,7 +4703,8 @@ class mother_model final : public model_base_crtp { current_statement__ = 190; current_statement__ = 190; check_less_or_equal(function__, "d_int_1d_ar[sym1__]", - d_int_1d_ar[(sym1__ - 1)], N);} + d_int_1d_ar[(sym1__ - 1)], N); + } current_statement__ = 191; validate_non_negative_index("d_int_3d_ar", "N", N); current_statement__ = 192; @@ -4681,8 +4713,10 @@ class mother_model final : public model_base_crtp { validate_non_negative_index("d_int_3d_ar", "K", K); current_statement__ = 194; context__.validate_dims("data initialization","d_int_3d_ar","int", - context__.to_vec(N, M, K)); + std::vector{static_cast(N), + static_cast(M), static_cast(K)}); d_int_3d_ar = std::vector>>(N, std::vector>(M, std::vector(K, std::numeric_limits::min()))); + { std::vector d_int_3d_ar_flat__; @@ -4702,7 +4736,10 @@ class mother_model final : public model_base_crtp { index_uni(sym2__), index_uni(sym1__)); current_statement__ = 194; - pos__ = (pos__ + 1);}}} + pos__ = (pos__ + 1); + } + } + } } current_statement__ = 194; for (int sym1__ = 1; sym1__ <= N; ++sym1__) { @@ -4715,11 +4752,14 @@ class mother_model final : public model_base_crtp { check_less_or_equal(function__, "d_int_3d_ar[sym1__, sym2__, sym3__]", d_int_3d_ar[(sym1__ - 1)][(sym2__ - 1)][ - (sym3__ - 1)], N);}}} + (sym3__ - 1)], N); + } + } + } current_statement__ = 195; context__.validate_dims("data initialization","J","double", - context__.to_vec()); - J = std::numeric_limits::quiet_NaN(); + std::vector{}); + J = std::numeric_limits::quiet_NaN(); current_statement__ = 195; J = context__.vals_r("J")[(1 - 1)]; @@ -4733,8 +4773,9 @@ class mother_model final : public model_base_crtp { validate_non_negative_index("d_real_1d_ar", "N", N); current_statement__ = 197; context__.validate_dims("data initialization","d_real_1d_ar","double", - context__.to_vec(N)); + std::vector{static_cast(N)}); d_real_1d_ar = std::vector(N, std::numeric_limits::quiet_NaN()); + current_statement__ = 197; d_real_1d_ar = context__.vals_r("d_real_1d_ar"); @@ -4746,8 +4787,10 @@ class mother_model final : public model_base_crtp { validate_non_negative_index("d_real_3d_ar", "K", K); current_statement__ = 201; context__.validate_dims("data initialization","d_real_3d_ar","double", - context__.to_vec(N, M, K)); + std::vector{static_cast(N), + static_cast(M), static_cast(K)}); d_real_3d_ar = std::vector>>(N, std::vector>(M, std::vector(K, std::numeric_limits::quiet_NaN()))); + { std::vector d_real_3d_ar_flat__; @@ -4767,15 +4810,18 @@ class mother_model final : public model_base_crtp { index_uni(sym2__), index_uni(sym1__)); current_statement__ = 201; - pos__ = (pos__ + 1);}}} + pos__ = (pos__ + 1); + } + } + } } current_statement__ = 202; validate_non_negative_index("d_vec", "N", N); current_statement__ = 203; context__.validate_dims("data initialization","d_vec","double", - context__.to_vec(N)); + std::vector{static_cast(N)}); d_vec = Eigen::Matrix(N); - stan::math::fill(d_vec, std::numeric_limits::quiet_NaN()); + stan::math::fill(d_vec, std::numeric_limits::quiet_NaN()); { std::vector d_vec_flat__; @@ -4789,7 +4835,8 @@ class mother_model final : public model_base_crtp { assign(d_vec, d_vec_flat__[(pos__ - 1)], "assigning variable d_vec", index_uni(sym1__)); current_statement__ = 203; - pos__ = (pos__ + 1);} + pos__ = (pos__ + 1); + } } current_statement__ = 204; validate_non_negative_index("d_1d_vec", "N", N); @@ -4797,9 +4844,10 @@ class mother_model final : public model_base_crtp { validate_non_negative_index("d_1d_vec", "N", N); current_statement__ = 206; context__.validate_dims("data initialization","d_1d_vec","double", - context__.to_vec(N, N)); + std::vector{static_cast(N), + static_cast(N)}); d_1d_vec = std::vector>(N, Eigen::Matrix(N)); - stan::math::fill(d_1d_vec, std::numeric_limits::quiet_NaN()); + stan::math::fill(d_1d_vec, std::numeric_limits::quiet_NaN()); { std::vector d_1d_vec_flat__; @@ -4816,7 +4864,9 @@ class mother_model final : public model_base_crtp { "assigning variable d_1d_vec", index_uni(sym2__), index_uni(sym1__)); current_statement__ = 206; - pos__ = (pos__ + 1);}} + pos__ = (pos__ + 1); + } + } } current_statement__ = 207; validate_non_negative_index("d_3d_vec", "N", N); @@ -4828,9 +4878,11 @@ class mother_model final : public model_base_crtp { validate_non_negative_index("d_3d_vec", "N", N); current_statement__ = 211; context__.validate_dims("data initialization","d_3d_vec","double", - context__.to_vec(N, M, K, N)); + std::vector{static_cast(N), + static_cast(M), static_cast(K), + static_cast(N)}); d_3d_vec = std::vector>>>(N, std::vector>>(M, std::vector>(K, Eigen::Matrix(N)))); - stan::math::fill(d_3d_vec, std::numeric_limits::quiet_NaN()); + stan::math::fill(d_3d_vec, std::numeric_limits::quiet_NaN()); { std::vector d_3d_vec_flat__; @@ -4853,15 +4905,19 @@ class mother_model final : public model_base_crtp { index_uni(sym2__), index_uni(sym1__)); current_statement__ = 211; - pos__ = (pos__ + 1);}}}} + pos__ = (pos__ + 1); + } + } + } + } } current_statement__ = 212; validate_non_negative_index("d_row_vec", "N", N); current_statement__ = 213; context__.validate_dims("data initialization","d_row_vec","double", - context__.to_vec(N)); + std::vector{static_cast(N)}); d_row_vec = Eigen::Matrix(N); - stan::math::fill(d_row_vec, std::numeric_limits::quiet_NaN()); + stan::math::fill(d_row_vec, std::numeric_limits::quiet_NaN()); { std::vector d_row_vec_flat__; @@ -4875,7 +4931,8 @@ class mother_model final : public model_base_crtp { assign(d_row_vec, d_row_vec_flat__[(pos__ - 1)], "assigning variable d_row_vec", index_uni(sym1__)); current_statement__ = 213; - pos__ = (pos__ + 1);} + pos__ = (pos__ + 1); + } } current_statement__ = 214; validate_non_negative_index("d_1d_row_vec", "N", N); @@ -4883,9 +4940,10 @@ class mother_model final : public model_base_crtp { validate_non_negative_index("d_1d_row_vec", "N", N); current_statement__ = 216; context__.validate_dims("data initialization","d_1d_row_vec","double", - context__.to_vec(N, N)); + std::vector{static_cast(N), + static_cast(N)}); d_1d_row_vec = std::vector>(N, Eigen::Matrix(N)); - stan::math::fill(d_1d_row_vec, std::numeric_limits::quiet_NaN()); + stan::math::fill(d_1d_row_vec, std::numeric_limits::quiet_NaN()); { std::vector d_1d_row_vec_flat__; @@ -4902,7 +4960,9 @@ class mother_model final : public model_base_crtp { "assigning variable d_1d_row_vec", index_uni(sym2__), index_uni(sym1__)); current_statement__ = 216; - pos__ = (pos__ + 1);}} + pos__ = (pos__ + 1); + } + } } current_statement__ = 217; validate_non_negative_index("d_3d_row_vec", "N", N); @@ -4914,9 +4974,11 @@ class mother_model final : public model_base_crtp { validate_non_negative_index("d_3d_row_vec", "N", N); current_statement__ = 221; context__.validate_dims("data initialization","d_3d_row_vec","double", - context__.to_vec(N, M, K, N)); + std::vector{static_cast(N), + static_cast(M), static_cast(K), + static_cast(N)}); d_3d_row_vec = std::vector>>>(N, std::vector>>(M, std::vector>(K, Eigen::Matrix(N)))); - stan::math::fill(d_3d_row_vec, std::numeric_limits::quiet_NaN()); + stan::math::fill(d_3d_row_vec, std::numeric_limits::quiet_NaN()); { std::vector d_3d_row_vec_flat__; @@ -4939,13 +5001,19 @@ class mother_model final : public model_base_crtp { index_uni(sym2__), index_uni(sym1__)); current_statement__ = 221; - pos__ = (pos__ + 1);}}}} + pos__ = (pos__ + 1); + } + } + } + } } current_statement__ = 222; context__.validate_dims("data initialization","d_ar_mat","double", - context__.to_vec(4, 5, 2, 3)); + std::vector{static_cast(4), + static_cast(5), static_cast(2), + static_cast(3)}); d_ar_mat = std::vector>>(4, std::vector>(5, Eigen::Matrix(2, 3))); - stan::math::fill(d_ar_mat, std::numeric_limits::quiet_NaN()); + stan::math::fill(d_ar_mat, std::numeric_limits::quiet_NaN()); { std::vector d_ar_mat_flat__; @@ -4968,7 +5036,11 @@ class mother_model final : public model_base_crtp { index_uni(sym2__), index_uni(sym1__)); current_statement__ = 222; - pos__ = (pos__ + 1);}}}} + pos__ = (pos__ + 1); + } + } + } + } } current_statement__ = 222; for (int sym1__ = 1; sym1__ <= 4; ++sym1__) { @@ -4985,7 +5057,11 @@ class mother_model final : public model_base_crtp { rvalue(d_ar_mat, "d_ar_mat", index_uni(sym1__), index_uni(sym2__), index_uni(sym3__), index_uni(sym4__)), - 0);}}}} + 0); + } + } + } + } current_statement__ = 222; for (int sym1__ = 1; sym1__ <= 4; ++sym1__) { current_statement__ = 222; @@ -5001,14 +5077,18 @@ class mother_model final : public model_base_crtp { rvalue(d_ar_mat, "d_ar_mat", index_uni(sym1__), index_uni(sym2__), index_uni(sym3__), index_uni(sym4__)), - 1);}}}} + 1); + } + } + } + } current_statement__ = 223; validate_non_negative_index("d_simplex", "N", N); current_statement__ = 224; context__.validate_dims("data initialization","d_simplex","double", - context__.to_vec(N)); + std::vector{static_cast(N)}); d_simplex = Eigen::Matrix(N); - stan::math::fill(d_simplex, std::numeric_limits::quiet_NaN()); + stan::math::fill(d_simplex, std::numeric_limits::quiet_NaN()); { std::vector d_simplex_flat__; @@ -5022,7 +5102,8 @@ class mother_model final : public model_base_crtp { assign(d_simplex, d_simplex_flat__[(pos__ - 1)], "assigning variable d_simplex", index_uni(sym1__)); current_statement__ = 224; - pos__ = (pos__ + 1);} + pos__ = (pos__ + 1); + } } current_statement__ = 224; current_statement__ = 224; @@ -5033,9 +5114,10 @@ class mother_model final : public model_base_crtp { validate_non_negative_index("d_1d_simplex", "N", N); current_statement__ = 227; context__.validate_dims("data initialization","d_1d_simplex","double", - context__.to_vec(N, N)); + std::vector{static_cast(N), + static_cast(N)}); d_1d_simplex = std::vector>(N, Eigen::Matrix(N)); - stan::math::fill(d_1d_simplex, std::numeric_limits::quiet_NaN()); + stan::math::fill(d_1d_simplex, std::numeric_limits::quiet_NaN()); { std::vector d_1d_simplex_flat__; @@ -5052,14 +5134,17 @@ class mother_model final : public model_base_crtp { "assigning variable d_1d_simplex", index_uni(sym2__), index_uni(sym1__)); current_statement__ = 227; - pos__ = (pos__ + 1);}} + pos__ = (pos__ + 1); + } + } } current_statement__ = 227; for (int sym1__ = 1; sym1__ <= N; ++sym1__) { current_statement__ = 227; current_statement__ = 227; check_simplex(function__, "d_1d_simplex[sym1__]", - d_1d_simplex[(sym1__ - 1)]);} + d_1d_simplex[(sym1__ - 1)]); + } current_statement__ = 228; validate_non_negative_index("d_3d_simplex", "N", N); current_statement__ = 229; @@ -5070,9 +5155,11 @@ class mother_model final : public model_base_crtp { validate_non_negative_index("d_3d_simplex", "N", N); current_statement__ = 232; context__.validate_dims("data initialization","d_3d_simplex","double", - context__.to_vec(N, M, K, N)); + std::vector{static_cast(N), + static_cast(M), static_cast(K), + static_cast(N)}); d_3d_simplex = std::vector>>>(N, std::vector>>(M, std::vector>(K, Eigen::Matrix(N)))); - stan::math::fill(d_3d_simplex, std::numeric_limits::quiet_NaN()); + stan::math::fill(d_3d_simplex, std::numeric_limits::quiet_NaN()); { std::vector d_3d_simplex_flat__; @@ -5095,7 +5182,11 @@ class mother_model final : public model_base_crtp { index_uni(sym2__), index_uni(sym1__)); current_statement__ = 232; - pos__ = (pos__ + 1);}}}} + pos__ = (pos__ + 1); + } + } + } + } } current_statement__ = 232; for (int sym1__ = 1; sym1__ <= N; ++sym1__) { @@ -5107,12 +5198,16 @@ class mother_model final : public model_base_crtp { current_statement__ = 232; check_simplex(function__, "d_3d_simplex[sym1__, sym2__, sym3__]", d_3d_simplex[(sym1__ - 1)][(sym2__ - 1)][(sym3__ - - 1)]);}}} + 1)]); + } + } + } current_statement__ = 233; context__.validate_dims("data initialization","d_cfcov_54","double", - context__.to_vec(5, 4)); + std::vector{static_cast(5), + static_cast(4)}); d_cfcov_54 = Eigen::Matrix(5, 4); - stan::math::fill(d_cfcov_54, std::numeric_limits::quiet_NaN()); + stan::math::fill(d_cfcov_54, std::numeric_limits::quiet_NaN()); { std::vector d_cfcov_54_flat__; @@ -5129,16 +5224,19 @@ class mother_model final : public model_base_crtp { "assigning variable d_cfcov_54", index_uni(sym2__), index_uni(sym1__)); current_statement__ = 233; - pos__ = (pos__ + 1);}} + pos__ = (pos__ + 1); + } + } } current_statement__ = 233; current_statement__ = 233; check_cholesky_factor(function__, "d_cfcov_54", d_cfcov_54); current_statement__ = 234; context__.validate_dims("data initialization","d_cfcov_33","double", - context__.to_vec(3, 3)); + std::vector{static_cast(3), + static_cast(3)}); d_cfcov_33 = Eigen::Matrix(3, 3); - stan::math::fill(d_cfcov_33, std::numeric_limits::quiet_NaN()); + stan::math::fill(d_cfcov_33, std::numeric_limits::quiet_NaN()); { std::vector d_cfcov_33_flat__; @@ -5155,7 +5253,9 @@ class mother_model final : public model_base_crtp { "assigning variable d_cfcov_33", index_uni(sym2__), index_uni(sym1__)); current_statement__ = 234; - pos__ = (pos__ + 1);}} + pos__ = (pos__ + 1); + } + } } current_statement__ = 234; current_statement__ = 234; @@ -5164,9 +5264,10 @@ class mother_model final : public model_base_crtp { validate_non_negative_index("d_cfcov_33_ar", "K", K); current_statement__ = 236; context__.validate_dims("data initialization","d_cfcov_33_ar","double", - context__.to_vec(K, 3, 3)); + std::vector{static_cast(K), + static_cast(3), static_cast(3)}); d_cfcov_33_ar = std::vector>(K, Eigen::Matrix(3, 3)); - stan::math::fill(d_cfcov_33_ar, std::numeric_limits::quiet_NaN()); + stan::math::fill(d_cfcov_33_ar, std::numeric_limits::quiet_NaN()); { std::vector d_cfcov_33_ar_flat__; @@ -5186,18 +5287,22 @@ class mother_model final : public model_base_crtp { index_uni(sym2__), index_uni(sym1__)); current_statement__ = 236; - pos__ = (pos__ + 1);}}} + pos__ = (pos__ + 1); + } + } + } } current_statement__ = 236; for (int sym1__ = 1; sym1__ <= K; ++sym1__) { current_statement__ = 236; current_statement__ = 236; check_cholesky_factor(function__, "d_cfcov_33_ar[sym1__]", - d_cfcov_33_ar[(sym1__ - 1)]);} + d_cfcov_33_ar[(sym1__ - 1)]); + } current_statement__ = 237; context__.validate_dims("data initialization","d_int","int", - context__.to_vec()); - d_int = std::numeric_limits::min(); + std::vector{}); + d_int = std::numeric_limits::min(); current_statement__ = 237; d_int = context__.vals_i("d_int")[(1 - 1)]; @@ -5205,8 +5310,9 @@ class mother_model final : public model_base_crtp { validate_non_negative_index("d_int_array", "d_int", d_int); current_statement__ = 239; context__.validate_dims("data initialization","d_int_array","int", - context__.to_vec(d_int)); + std::vector{static_cast(d_int)}); d_int_array = std::vector(d_int, std::numeric_limits::min()); + current_statement__ = 239; d_int_array = context__.vals_i("d_int_array"); @@ -5214,8 +5320,10 @@ class mother_model final : public model_base_crtp { validate_non_negative_index("d_int_array_2d", "d_int", d_int); current_statement__ = 241; context__.validate_dims("data initialization","d_int_array_2d","int", - context__.to_vec(d_int, 2)); + std::vector{static_cast(d_int), + static_cast(2)}); d_int_array_2d = std::vector>(d_int, std::vector(2, std::numeric_limits::min())); + { std::vector d_int_array_2d_flat__; @@ -5232,14 +5340,18 @@ class mother_model final : public model_base_crtp { "assigning variable d_int_array_2d", index_uni(sym2__), index_uni(sym1__)); current_statement__ = 241; - pos__ = (pos__ + 1);}} + pos__ = (pos__ + 1); + } + } } current_statement__ = 242; validate_non_negative_index("d_int_array_3d", "d_int", d_int); current_statement__ = 243; context__.validate_dims("data initialization","d_int_array_3d","int", - context__.to_vec(d_int, 2, 3)); + std::vector{static_cast(d_int), + static_cast(2), static_cast(3)}); d_int_array_3d = std::vector>>(d_int, std::vector>(2, std::vector(3, std::numeric_limits::min()))); + { std::vector d_int_array_3d_flat__; @@ -5259,12 +5371,15 @@ class mother_model final : public model_base_crtp { index_uni(sym2__), index_uni(sym1__)); current_statement__ = 243; - pos__ = (pos__ + 1);}}} + pos__ = (pos__ + 1); + } + } + } } current_statement__ = 244; context__.validate_dims("data initialization","d_real","double", - context__.to_vec()); - d_real = std::numeric_limits::quiet_NaN(); + std::vector{}); + d_real = std::numeric_limits::quiet_NaN(); current_statement__ = 244; d_real = context__.vals_r("d_real")[(1 - 1)]; @@ -5272,8 +5387,9 @@ class mother_model final : public model_base_crtp { validate_non_negative_index("d_real_array", "d_int", d_int); current_statement__ = 246; context__.validate_dims("data initialization","d_real_array","double", - context__.to_vec(d_int)); + std::vector{static_cast(d_int)}); d_real_array = std::vector(d_int, std::numeric_limits::quiet_NaN()); + current_statement__ = 246; d_real_array = context__.vals_r("d_real_array"); @@ -5281,8 +5397,11 @@ class mother_model final : public model_base_crtp { validate_non_negative_index("d_real_array_2d", "d_int", d_int); current_statement__ = 248; context__.validate_dims("data initialization","d_real_array_2d", - "double",context__.to_vec(d_int, 2)); + "double", + std::vector{static_cast(d_int), + static_cast(2)}); d_real_array_2d = std::vector>(d_int, std::vector(2, std::numeric_limits::quiet_NaN())); + { std::vector d_real_array_2d_flat__; @@ -5299,14 +5418,19 @@ class mother_model final : public model_base_crtp { "assigning variable d_real_array_2d", index_uni(sym2__), index_uni(sym1__)); current_statement__ = 248; - pos__ = (pos__ + 1);}} + pos__ = (pos__ + 1); + } + } } current_statement__ = 249; validate_non_negative_index("d_real_array_3d", "d_int", d_int); current_statement__ = 250; context__.validate_dims("data initialization","d_real_array_3d", - "double",context__.to_vec(d_int, 2, 3)); + "double", + std::vector{static_cast(d_int), + static_cast(2), static_cast(3)}); d_real_array_3d = std::vector>>(d_int, std::vector>(2, std::vector(3, std::numeric_limits::quiet_NaN()))); + { std::vector d_real_array_3d_flat__; @@ -5326,7 +5450,10 @@ class mother_model final : public model_base_crtp { index_uni(sym2__), index_uni(sym1__)); current_statement__ = 250; - pos__ = (pos__ + 1);}}} + pos__ = (pos__ + 1); + } + } + } } current_statement__ = 251; validate_non_negative_index("d_matrix", "d_int", d_int); @@ -5334,9 +5461,10 @@ class mother_model final : public model_base_crtp { validate_non_negative_index("d_matrix", "d_int", d_int); current_statement__ = 253; context__.validate_dims("data initialization","d_matrix","double", - context__.to_vec(d_int, d_int)); + std::vector{static_cast(d_int), + static_cast(d_int)}); d_matrix = Eigen::Matrix(d_int, d_int); - stan::math::fill(d_matrix, std::numeric_limits::quiet_NaN()); + stan::math::fill(d_matrix, std::numeric_limits::quiet_NaN()); { std::vector d_matrix_flat__; @@ -5353,7 +5481,9 @@ class mother_model final : public model_base_crtp { "assigning variable d_matrix", index_uni(sym2__), index_uni(sym1__)); current_statement__ = 253; - pos__ = (pos__ + 1);}} + pos__ = (pos__ + 1); + } + } } current_statement__ = 254; validate_non_negative_index("d_matrix_array", "d_int", d_int); @@ -5363,9 +5493,11 @@ class mother_model final : public model_base_crtp { validate_non_negative_index("d_matrix_array", "d_int", d_int); current_statement__ = 257; context__.validate_dims("data initialization","d_matrix_array", - "double",context__.to_vec(d_int, d_int, d_int)); + "double", + std::vector{static_cast(d_int), + static_cast(d_int), static_cast(d_int)}); d_matrix_array = std::vector>(d_int, Eigen::Matrix(d_int, d_int)); - stan::math::fill(d_matrix_array, std::numeric_limits::quiet_NaN()); + stan::math::fill(d_matrix_array, std::numeric_limits::quiet_NaN()); { std::vector d_matrix_array_flat__; @@ -5385,7 +5517,10 @@ class mother_model final : public model_base_crtp { index_uni(sym2__), index_uni(sym1__)); current_statement__ = 257; - pos__ = (pos__ + 1);}}} + pos__ = (pos__ + 1); + } + } + } } current_statement__ = 258; validate_non_negative_index("d_matrix_array_2d", "d_int", d_int); @@ -5395,9 +5530,12 @@ class mother_model final : public model_base_crtp { validate_non_negative_index("d_matrix_array_2d", "d_int", d_int); current_statement__ = 261; context__.validate_dims("data initialization","d_matrix_array_2d", - "double",context__.to_vec(d_int, 2, d_int, d_int)); + "double", + std::vector{static_cast(d_int), + static_cast(2), static_cast(d_int), + static_cast(d_int)}); d_matrix_array_2d = std::vector>>(d_int, std::vector>(2, Eigen::Matrix(d_int, d_int))); - stan::math::fill(d_matrix_array_2d, std::numeric_limits::quiet_NaN()); + stan::math::fill(d_matrix_array_2d, std::numeric_limits::quiet_NaN()); { std::vector d_matrix_array_2d_flat__; @@ -5421,7 +5559,11 @@ class mother_model final : public model_base_crtp { index_uni(sym2__), index_uni(sym1__)); current_statement__ = 261; - pos__ = (pos__ + 1);}}}} + pos__ = (pos__ + 1); + } + } + } + } } current_statement__ = 262; validate_non_negative_index("d_matrix_array_3d", "d_int", d_int); @@ -5431,9 +5573,12 @@ class mother_model final : public model_base_crtp { validate_non_negative_index("d_matrix_array_3d", "d_int", d_int); current_statement__ = 265; context__.validate_dims("data initialization","d_matrix_array_3d", - "double",context__.to_vec(d_int, 2, 3, d_int, d_int)); + "double", + std::vector{static_cast(d_int), + static_cast(2), static_cast(3), + static_cast(d_int), static_cast(d_int)}); d_matrix_array_3d = std::vector>>>(d_int, std::vector>>(2, std::vector>(3, Eigen::Matrix(d_int, d_int)))); - stan::math::fill(d_matrix_array_3d, std::numeric_limits::quiet_NaN()); + stan::math::fill(d_matrix_array_3d, std::numeric_limits::quiet_NaN()); { std::vector d_matrix_array_3d_flat__; @@ -5460,15 +5605,20 @@ class mother_model final : public model_base_crtp { index_uni(sym2__), index_uni(sym1__)); current_statement__ = 265; - pos__ = (pos__ + 1);}}}}} + pos__ = (pos__ + 1); + } + } + } + } + } } current_statement__ = 266; validate_non_negative_index("d_vector", "d_int", d_int); current_statement__ = 267; context__.validate_dims("data initialization","d_vector","double", - context__.to_vec(d_int)); + std::vector{static_cast(d_int)}); d_vector = Eigen::Matrix(d_int); - stan::math::fill(d_vector, std::numeric_limits::quiet_NaN()); + stan::math::fill(d_vector, std::numeric_limits::quiet_NaN()); { std::vector d_vector_flat__; @@ -5482,7 +5632,8 @@ class mother_model final : public model_base_crtp { assign(d_vector, d_vector_flat__[(pos__ - 1)], "assigning variable d_vector", index_uni(sym1__)); current_statement__ = 267; - pos__ = (pos__ + 1);} + pos__ = (pos__ + 1); + } } current_statement__ = 268; validate_non_negative_index("d_vector_array", "d_int", d_int); @@ -5490,9 +5641,11 @@ class mother_model final : public model_base_crtp { validate_non_negative_index("d_vector_array", "d_int", d_int); current_statement__ = 270; context__.validate_dims("data initialization","d_vector_array", - "double",context__.to_vec(d_int, d_int)); + "double", + std::vector{static_cast(d_int), + static_cast(d_int)}); d_vector_array = std::vector>(d_int, Eigen::Matrix(d_int)); - stan::math::fill(d_vector_array, std::numeric_limits::quiet_NaN()); + stan::math::fill(d_vector_array, std::numeric_limits::quiet_NaN()); { std::vector d_vector_array_flat__; @@ -5509,7 +5662,9 @@ class mother_model final : public model_base_crtp { "assigning variable d_vector_array", index_uni(sym2__), index_uni(sym1__)); current_statement__ = 270; - pos__ = (pos__ + 1);}} + pos__ = (pos__ + 1); + } + } } current_statement__ = 271; validate_non_negative_index("d_vector_array_2d", "d_int", d_int); @@ -5517,9 +5672,11 @@ class mother_model final : public model_base_crtp { validate_non_negative_index("d_vector_array_2d", "d_int", d_int); current_statement__ = 273; context__.validate_dims("data initialization","d_vector_array_2d", - "double",context__.to_vec(d_int, 2, d_int)); + "double", + std::vector{static_cast(d_int), + static_cast(2), static_cast(d_int)}); d_vector_array_2d = std::vector>>(d_int, std::vector>(2, Eigen::Matrix(d_int))); - stan::math::fill(d_vector_array_2d, std::numeric_limits::quiet_NaN()); + stan::math::fill(d_vector_array_2d, std::numeric_limits::quiet_NaN()); { std::vector d_vector_array_2d_flat__; @@ -5540,7 +5697,10 @@ class mother_model final : public model_base_crtp { index_uni(sym2__), index_uni(sym1__)); current_statement__ = 273; - pos__ = (pos__ + 1);}}} + pos__ = (pos__ + 1); + } + } + } } current_statement__ = 274; validate_non_negative_index("d_vector_array_3d", "d_int", d_int); @@ -5548,9 +5708,12 @@ class mother_model final : public model_base_crtp { validate_non_negative_index("d_vector_array_3d", "d_int", d_int); current_statement__ = 276; context__.validate_dims("data initialization","d_vector_array_3d", - "double",context__.to_vec(d_int, 2, 3, d_int)); + "double", + std::vector{static_cast(d_int), + static_cast(2), static_cast(3), + static_cast(d_int)}); d_vector_array_3d = std::vector>>>(d_int, std::vector>>(2, std::vector>(3, Eigen::Matrix(d_int)))); - stan::math::fill(d_vector_array_3d, std::numeric_limits::quiet_NaN()); + stan::math::fill(d_vector_array_3d, std::numeric_limits::quiet_NaN()); { std::vector d_vector_array_3d_flat__; @@ -5574,15 +5737,19 @@ class mother_model final : public model_base_crtp { index_uni(sym2__), index_uni(sym1__)); current_statement__ = 276; - pos__ = (pos__ + 1);}}}} + pos__ = (pos__ + 1); + } + } + } + } } current_statement__ = 277; validate_non_negative_index("d_row_vector", "d_int", d_int); current_statement__ = 278; context__.validate_dims("data initialization","d_row_vector","double", - context__.to_vec(d_int)); + std::vector{static_cast(d_int)}); d_row_vector = Eigen::Matrix(d_int); - stan::math::fill(d_row_vector, std::numeric_limits::quiet_NaN()); + stan::math::fill(d_row_vector, std::numeric_limits::quiet_NaN()); { std::vector d_row_vector_flat__; @@ -5596,7 +5763,8 @@ class mother_model final : public model_base_crtp { assign(d_row_vector, d_row_vector_flat__[(pos__ - 1)], "assigning variable d_row_vector", index_uni(sym1__)); current_statement__ = 278; - pos__ = (pos__ + 1);} + pos__ = (pos__ + 1); + } } current_statement__ = 279; validate_non_negative_index("d_row_vector_array", "d_int", d_int); @@ -5604,9 +5772,11 @@ class mother_model final : public model_base_crtp { validate_non_negative_index("d_row_vector_array", "d_int", d_int); current_statement__ = 281; context__.validate_dims("data initialization","d_row_vector_array", - "double",context__.to_vec(d_int, d_int)); + "double", + std::vector{static_cast(d_int), + static_cast(d_int)}); d_row_vector_array = std::vector>(d_int, Eigen::Matrix(d_int)); - stan::math::fill(d_row_vector_array, std::numeric_limits::quiet_NaN()); + stan::math::fill(d_row_vector_array, std::numeric_limits::quiet_NaN()); { std::vector d_row_vector_array_flat__; @@ -5624,7 +5794,9 @@ class mother_model final : public model_base_crtp { "assigning variable d_row_vector_array", index_uni(sym2__), index_uni(sym1__)); current_statement__ = 281; - pos__ = (pos__ + 1);}} + pos__ = (pos__ + 1); + } + } } current_statement__ = 282; validate_non_negative_index("d_row_vector_array_2d", "d_int", d_int); @@ -5632,9 +5804,11 @@ class mother_model final : public model_base_crtp { validate_non_negative_index("d_row_vector_array_2d", "d_int", d_int); current_statement__ = 284; context__.validate_dims("data initialization","d_row_vector_array_2d", - "double",context__.to_vec(d_int, 2, d_int)); + "double", + std::vector{static_cast(d_int), + static_cast(2), static_cast(d_int)}); d_row_vector_array_2d = std::vector>>(d_int, std::vector>(2, Eigen::Matrix(d_int))); - stan::math::fill(d_row_vector_array_2d, std::numeric_limits::quiet_NaN()); + stan::math::fill(d_row_vector_array_2d, std::numeric_limits::quiet_NaN()); { std::vector d_row_vector_array_2d_flat__; @@ -5655,7 +5829,10 @@ class mother_model final : public model_base_crtp { index_uni(sym2__), index_uni(sym1__)); current_statement__ = 284; - pos__ = (pos__ + 1);}}} + pos__ = (pos__ + 1); + } + } + } } current_statement__ = 285; validate_non_negative_index("d_row_vector_array_3d", "d_int", d_int); @@ -5663,9 +5840,12 @@ class mother_model final : public model_base_crtp { validate_non_negative_index("d_row_vector_array_3d", "d_int", d_int); current_statement__ = 287; context__.validate_dims("data initialization","d_row_vector_array_3d", - "double",context__.to_vec(d_int, 2, 3, d_int)); + "double", + std::vector{static_cast(d_int), + static_cast(2), static_cast(3), + static_cast(d_int)}); d_row_vector_array_3d = std::vector>>>(d_int, std::vector>>(2, std::vector>(3, Eigen::Matrix(d_int)))); - stan::math::fill(d_row_vector_array_3d, std::numeric_limits::quiet_NaN()); + stan::math::fill(d_row_vector_array_3d, std::numeric_limits::quiet_NaN()); { std::vector d_row_vector_array_3d_flat__; @@ -5689,55 +5869,47 @@ class mother_model final : public model_base_crtp { index_uni(sym2__), index_uni(sym1__)); current_statement__ = 287; - pos__ = (pos__ + 1);}}}} + pos__ = (pos__ + 1); + } + } + } + } } current_statement__ = 288; - td_int = std::numeric_limits::min(); current_statement__ = 289; validate_non_negative_index("td_1d", "N", N); current_statement__ = 290; - td_1d = std::vector(N, std::numeric_limits::min()); current_statement__ = 291; validate_non_negative_index("td_1dk", "M", M); current_statement__ = 292; - td_1dk = std::vector(M, std::numeric_limits::min()); current_statement__ = 292; assign(td_1dk, rep_array(1, M), "assigning variable td_1dk"); current_statement__ = 293; - td_a = std::numeric_limits::min(); current_statement__ = 293; td_a = N; current_statement__ = 294; - td_b = std::numeric_limits::quiet_NaN(); current_statement__ = 294; td_b = (N * J); current_statement__ = 295; - td_c = std::numeric_limits::quiet_NaN(); current_statement__ = 295; td_c = foo_bar1(td_b, pstream__); current_statement__ = 296; - td_ar_mat = std::vector>>(4, std::vector>(5, Eigen::Matrix(2, 3))); - stan::math::fill(td_ar_mat, std::numeric_limits::quiet_NaN()); current_statement__ = 297; validate_non_negative_index("td_simplex", "N", N); current_statement__ = 298; - td_simplex = Eigen::Matrix(N); - stan::math::fill(td_simplex, std::numeric_limits::quiet_NaN()); current_statement__ = 299; validate_non_negative_index("td_1d_simplex", "N", N); current_statement__ = 300; validate_non_negative_index("td_1d_simplex", "N", N); current_statement__ = 301; - td_1d_simplex = std::vector>(N, Eigen::Matrix(N)); - stan::math::fill(td_1d_simplex, std::numeric_limits::quiet_NaN()); current_statement__ = 302; validate_non_negative_index("td_3d_simplex", "N", N); @@ -5748,36 +5920,22 @@ class mother_model final : public model_base_crtp { current_statement__ = 305; validate_non_negative_index("td_3d_simplex", "N", N); current_statement__ = 306; - td_3d_simplex = std::vector>>>(N, std::vector>>(M, std::vector>(K, Eigen::Matrix(N)))); - stan::math::fill(td_3d_simplex, std::numeric_limits::quiet_NaN()); current_statement__ = 307; - td_cfcov_54 = Eigen::Matrix(5, 5); - stan::math::fill(td_cfcov_54, std::numeric_limits::quiet_NaN()); current_statement__ = 308; - td_cfcov_33 = Eigen::Matrix(3, 3); - stan::math::fill(td_cfcov_33, std::numeric_limits::quiet_NaN()); current_statement__ = 309; - x = Eigen::Matrix(2); - stan::math::fill(x, std::numeric_limits::quiet_NaN()); current_statement__ = 310; - y = Eigen::Matrix(2); - stan::math::fill(y, std::numeric_limits::quiet_NaN()); current_statement__ = 311; - dat = std::vector(0, std::numeric_limits::quiet_NaN()); current_statement__ = 312; - dat_int = std::vector(0, std::numeric_limits::min()); current_statement__ = 313; - x_r = std::vector>(0, std::vector(0, std::numeric_limits::quiet_NaN())); current_statement__ = 314; - x_i = std::vector>(0, std::vector(0, std::numeric_limits::min())); current_statement__ = 315; td_int = (primitive_value(1) || primitive_value(2)); @@ -5795,7 +5953,10 @@ class mother_model final : public model_base_crtp { assign(td_ar_mat, 0.4, "assigning variable td_ar_mat", index_uni(m), index_uni(n), index_uni(i), index_uni(j)); - }}}} + } + } + } + } current_statement__ = 336; for (int i = 1; i <= N; ++i) { current_statement__ = 326; @@ -5815,14 +5976,18 @@ class mother_model final : public model_base_crtp { "assigning variable td_3d_simplex", index_uni(n), index_uni(m), index_uni(k), - index_uni(i));}}}} + index_uni(i)); + } + } + } + } current_statement__ = 342; for (int i = 1; i <= 4; ++i) { current_statement__ = 340; for (int j = 1; j <= 5; ++j) { Eigen::Matrix l_mat; l_mat = Eigen::Matrix(2, 3); - stan::math::fill(l_mat, std::numeric_limits::quiet_NaN()); + stan::math::fill(l_mat, std::numeric_limits::quiet_NaN()); current_statement__ = 337; assign(l_mat, @@ -5837,7 +6002,9 @@ class mother_model final : public model_base_crtp { stan_print(pstream__, " matrix: "); stan_print(pstream__, l_mat); stan_print(pstream__, "\n"); - }}} + } + } + } current_statement__ = 343; assign(td_cfcov_54, diag_matrix(rep_vector(1, rows(td_cfcov_54))), "assigning variable td_cfcov_54"); @@ -5846,11 +6013,11 @@ class mother_model final : public model_base_crtp { "assigning variable td_cfcov_33"); { double z; - z = std::numeric_limits::quiet_NaN(); + z = std::numeric_limits::quiet_NaN(); Eigen::Matrix blocked_tdata_vs; blocked_tdata_vs = Eigen::Matrix(2); - stan::math::fill(blocked_tdata_vs, std::numeric_limits::quiet_NaN()); + stan::math::fill(blocked_tdata_vs, std::numeric_limits::quiet_NaN()); current_statement__ = 347; for (int sym1__ = 1; sym1__ <= stan::math::size(blocked_tdata_vs); @@ -5861,9 +6028,10 @@ class mother_model final : public model_base_crtp { v = blocked_tdata_vs[(sym1__ - 1)]; current_statement__ = 348; z = 0; - }} + } + } std::vector indices; - indices = std::vector(4, std::numeric_limits::min()); + indices = std::vector(4, std::numeric_limits::min()); current_statement__ = 349; assign(indices, std::vector{1, 2, 3, 4}, @@ -5881,7 +6049,8 @@ class mother_model final : public model_base_crtp { i = sym1__[(sym2__ - 1)]; current_statement__ = 351; z = i; - }} + } + } } } current_statement__ = 353; @@ -5901,45 +6070,37 @@ class mother_model final : public model_base_crtp { rvalue(td_1d_simplex, "td_1d_simplex", index_uni(1), index_min_max(1, N)), "assigning variable td_simplex"); current_statement__ = 357; - arr_mul_ind = std::vector>(2, std::vector(2, std::numeric_limits::min())); current_statement__ = 358; assign(arr_mul_ind, std::vector{1, 1}, "assigning variable arr_mul_ind", index_uni(1), index_min_max(1, 2)); current_statement__ = 359; - x_mul_ind = std::vector(2, std::numeric_limits::quiet_NaN()); current_statement__ = 359; assign(x_mul_ind, std::vector{1, 2}, "assigning variable x_mul_ind"); current_statement__ = 360; - transformed_data_real = std::numeric_limits::quiet_NaN(); current_statement__ = 361; validate_non_negative_index("transformed_data_real_array", "d_int", d_int); current_statement__ = 362; - transformed_data_real_array = std::vector(d_int, std::numeric_limits::quiet_NaN()); current_statement__ = 363; validate_non_negative_index("transformed_data_real_array_2d", "d_int", d_int); current_statement__ = 364; - transformed_data_real_array_2d = std::vector>(d_int, std::vector(2, std::numeric_limits::quiet_NaN())); current_statement__ = 365; validate_non_negative_index("transformed_data_real_array_3d", "d_int", d_int); current_statement__ = 366; - transformed_data_real_array_3d = std::vector>>(d_int, std::vector>(2, std::vector(3, std::numeric_limits::quiet_NaN()))); current_statement__ = 367; validate_non_negative_index("transformed_data_matrix", "d_int", d_int); current_statement__ = 368; validate_non_negative_index("transformed_data_matrix", "d_int", d_int); current_statement__ = 369; - transformed_data_matrix = Eigen::Matrix(d_int, d_int); - stan::math::fill(transformed_data_matrix, std::numeric_limits::quiet_NaN()); current_statement__ = 370; validate_non_negative_index("transformed_data_matrix_array", "d_int", @@ -5951,8 +6112,6 @@ class mother_model final : public model_base_crtp { validate_non_negative_index("transformed_data_matrix_array", "d_int", d_int); current_statement__ = 373; - transformed_data_matrix_array = std::vector>(d_int, Eigen::Matrix(d_int, d_int)); - stan::math::fill(transformed_data_matrix_array, std::numeric_limits::quiet_NaN()); current_statement__ = 374; validate_non_negative_index("transformed_data_matrix_array_2d", @@ -5964,8 +6123,6 @@ class mother_model final : public model_base_crtp { validate_non_negative_index("transformed_data_matrix_array_2d", "d_int", d_int); current_statement__ = 377; - transformed_data_matrix_array_2d = std::vector>>(d_int, std::vector>(2, Eigen::Matrix(d_int, d_int))); - stan::math::fill(transformed_data_matrix_array_2d, std::numeric_limits::quiet_NaN()); current_statement__ = 378; validate_non_negative_index("transformed_data_matrix_array_3d", @@ -5977,14 +6134,10 @@ class mother_model final : public model_base_crtp { validate_non_negative_index("transformed_data_matrix_array_3d", "d_int", d_int); current_statement__ = 381; - transformed_data_matrix_array_3d = std::vector>>>(d_int, std::vector>>(2, std::vector>(3, Eigen::Matrix(d_int, d_int)))); - stan::math::fill(transformed_data_matrix_array_3d, std::numeric_limits::quiet_NaN()); current_statement__ = 382; validate_non_negative_index("transformed_data_vector", "d_int", d_int); current_statement__ = 383; - transformed_data_vector = Eigen::Matrix(d_int); - stan::math::fill(transformed_data_vector, std::numeric_limits::quiet_NaN()); current_statement__ = 384; validate_non_negative_index("transformed_data_vector_array", "d_int", @@ -5993,8 +6146,6 @@ class mother_model final : public model_base_crtp { validate_non_negative_index("transformed_data_vector_array", "d_int", d_int); current_statement__ = 386; - transformed_data_vector_array = std::vector>(d_int, Eigen::Matrix(d_int)); - stan::math::fill(transformed_data_vector_array, std::numeric_limits::quiet_NaN()); current_statement__ = 387; validate_non_negative_index("transformed_data_vector_array_2d", @@ -6003,8 +6154,6 @@ class mother_model final : public model_base_crtp { validate_non_negative_index("transformed_data_vector_array_2d", "d_int", d_int); current_statement__ = 389; - transformed_data_vector_array_2d = std::vector>>(d_int, std::vector>(2, Eigen::Matrix(d_int))); - stan::math::fill(transformed_data_vector_array_2d, std::numeric_limits::quiet_NaN()); current_statement__ = 390; validate_non_negative_index("transformed_data_vector_array_3d", @@ -6013,15 +6162,11 @@ class mother_model final : public model_base_crtp { validate_non_negative_index("transformed_data_vector_array_3d", "d_int", d_int); current_statement__ = 392; - transformed_data_vector_array_3d = std::vector>>>(d_int, std::vector>>(2, std::vector>(3, Eigen::Matrix(d_int)))); - stan::math::fill(transformed_data_vector_array_3d, std::numeric_limits::quiet_NaN()); current_statement__ = 393; validate_non_negative_index("transformed_data_row_vector", "d_int", d_int); current_statement__ = 394; - transformed_data_row_vector = Eigen::Matrix(d_int); - stan::math::fill(transformed_data_row_vector, std::numeric_limits::quiet_NaN()); current_statement__ = 395; validate_non_negative_index("transformed_data_row_vector_array", @@ -6030,8 +6175,6 @@ class mother_model final : public model_base_crtp { validate_non_negative_index("transformed_data_row_vector_array", "d_int", d_int); current_statement__ = 397; - transformed_data_row_vector_array = std::vector>(d_int, Eigen::Matrix(d_int)); - stan::math::fill(transformed_data_row_vector_array, std::numeric_limits::quiet_NaN()); current_statement__ = 398; validate_non_negative_index("transformed_data_row_vector_array_2d", @@ -6040,8 +6183,6 @@ class mother_model final : public model_base_crtp { validate_non_negative_index("transformed_data_row_vector_array_2d", "d_int", d_int); current_statement__ = 400; - transformed_data_row_vector_array_2d = std::vector>>(d_int, std::vector>(2, Eigen::Matrix(d_int))); - stan::math::fill(transformed_data_row_vector_array_2d, std::numeric_limits::quiet_NaN()); current_statement__ = 401; validate_non_negative_index("transformed_data_row_vector_array_3d", @@ -6050,8 +6191,6 @@ class mother_model final : public model_base_crtp { validate_non_negative_index("transformed_data_row_vector_array_3d", "d_int", d_int); current_statement__ = 403; - transformed_data_row_vector_array_3d = std::vector>>>(d_int, std::vector>>(2, std::vector>(3, Eigen::Matrix(d_int)))); - stan::math::fill(transformed_data_row_vector_array_3d, std::numeric_limits::quiet_NaN()); current_statement__ = 404; transformed_data_real = pow(d_int, d_int); @@ -6383,7 +6522,11 @@ class mother_model final : public model_base_crtp { rvalue(td_ar_mat, "td_ar_mat", index_uni(sym1__), index_uni(sym2__), index_uni(sym3__), index_uni(sym4__)), - 0);}}}} + 0); + } + } + } + } current_statement__ = 296; for (int sym1__ = 1; sym1__ <= 4; ++sym1__) { current_statement__ = 296; @@ -6399,7 +6542,11 @@ class mother_model final : public model_base_crtp { rvalue(td_ar_mat, "td_ar_mat", index_uni(sym1__), index_uni(sym2__), index_uni(sym3__), index_uni(sym4__)), - 1);}}}} + 1); + } + } + } + } current_statement__ = 298; current_statement__ = 298; check_simplex(function__, "td_simplex", td_simplex); @@ -6408,7 +6555,8 @@ class mother_model final : public model_base_crtp { current_statement__ = 301; current_statement__ = 301; check_simplex(function__, "td_1d_simplex[sym1__]", - td_1d_simplex[(sym1__ - 1)]);} + td_1d_simplex[(sym1__ - 1)]); + } current_statement__ = 306; for (int sym1__ = 1; sym1__ <= N; ++sym1__) { current_statement__ = 306; @@ -6420,7 +6568,10 @@ class mother_model final : public model_base_crtp { check_simplex(function__, "td_3d_simplex[sym1__, sym2__, sym3__]", td_3d_simplex[(sym1__ - 1)][(sym2__ - 1)][(sym3__ - - 1)]);}}} + 1)]); + } + } + } current_statement__ = 307; current_statement__ = 307; check_cholesky_factor(function__, "td_cfcov_54", td_cfcov_54); @@ -6600,37 +6751,13 @@ class mother_model final : public model_base_crtp { // Next line prevents compiler griping about no return throw std::runtime_error("*** IF YOU SEE THIS, PLEASE REPORT A BUG ***"); } - num_params_r__ = 0U; + num_params_r__ = 1 + 1 + 1 + 5 + 5 + 5 + N + (N * M * K) + N + (N * N) + + (N * M * K * N) + N + (N * N) + (N * M * K * N) + (4 * 5 * 2 * 3) + + (N - 1) + (N * (N - 1)) + (N * M * K * (N - 1)) + + ((((4 * (4 - 1)) / 2) + 4) + ((5 - 4) * 4)) + + ((((3 * (3 - 1)) / 2) + 3) + ((3 - 3) * 3)) + + (K * ((((3 * (3 - 1)) / 2) + 3) + ((3 - 3) * 3))) + 2 + 2; - try { - num_params_r__ += 1; - num_params_r__ += 1; - num_params_r__ += 1; - num_params_r__ += 5; - num_params_r__ += 5; - num_params_r__ += 5; - num_params_r__ += N; - num_params_r__ += N * M * K; - num_params_r__ += N; - num_params_r__ += N * N; - num_params_r__ += N * M * K * N; - num_params_r__ += N; - num_params_r__ += N * N; - num_params_r__ += N * M * K * N; - num_params_r__ += 4 * 5 * 2 * 3; - num_params_r__ += (N - 1); - num_params_r__ += N * (N - 1); - num_params_r__ += N * M * K * (N - 1); - num_params_r__ += ((((4 * (4 - 1)) / 2) + 4) + ((5 - 4) * 4)); - num_params_r__ += ((((3 * (3 - 1)) / 2) + 3) + ((3 - 3) * 3)); - num_params_r__ += K * ((((3 * (3 - 1)) / 2) + 3) + ((3 - 3) * 3)); - num_params_r__ += 2; - num_params_r__ += 2; - } catch (const std::exception& e) { - stan::lang::rethrow_located(e, locations_array__[current_statement__]); - // Next line prevents compiler griping about no return - throw std::runtime_error("*** IF YOU SEE THIS, PLEASE REPORT A BUG ***"); - } } template { try { local_scalar_t__ p_real; - p_real = DUMMY_VAR__; + p_real = DUMMY_VAR__; current_statement__ = 1; p_real = in__.template read(); local_scalar_t__ p_upper; - p_upper = DUMMY_VAR__; + p_upper = DUMMY_VAR__; current_statement__ = 2; p_upper = in__.template read_constrain_lb( p_real, lp__); local_scalar_t__ p_lower; - p_lower = DUMMY_VAR__; + p_lower = DUMMY_VAR__; current_statement__ = 3; p_lower = in__.template read_constrain_ub( p_upper, lp__); std::vector offset_multiplier; - offset_multiplier = std::vector(5, DUMMY_VAR__); + offset_multiplier = std::vector(5, DUMMY_VAR__); current_statement__ = 4; offset_multiplier = in__.template read_constrain_offset_multiplier, jacobian__>( 1, 2, lp__, 5); std::vector no_offset_multiplier; - no_offset_multiplier = std::vector(5, DUMMY_VAR__); + no_offset_multiplier = std::vector(5, DUMMY_VAR__); current_statement__ = 5; no_offset_multiplier = in__.template read_constrain_offset_multiplier, jacobian__>( 0, 2, lp__, 5); std::vector offset_no_multiplier; - offset_no_multiplier = std::vector(5, DUMMY_VAR__); + offset_no_multiplier = std::vector(5, DUMMY_VAR__); current_statement__ = 6; offset_no_multiplier = in__.template read_constrain_offset_multiplier, jacobian__>( 3, 1, lp__, 5); std::vector p_real_1d_ar; - p_real_1d_ar = std::vector(N, DUMMY_VAR__); + p_real_1d_ar = std::vector(N, DUMMY_VAR__); current_statement__ = 7; p_real_1d_ar = in__.template read_constrain_lb, jacobian__>( 0, lp__, N); std::vector>> p_real_3d_ar; p_real_3d_ar = std::vector>>(N, std::vector>(M, std::vector(K, DUMMY_VAR__))); + current_statement__ = 8; p_real_3d_ar = in__.template read_constrain_lb>>, jacobian__>( 0, lp__, N, M, K); Eigen::Matrix p_vec; p_vec = Eigen::Matrix(N); - stan::math::fill(p_vec, DUMMY_VAR__); + stan::math::fill(p_vec, DUMMY_VAR__); current_statement__ = 9; p_vec = in__.template read_constrain_lb, jacobian__>( 0, lp__, N); std::vector> p_1d_vec; p_1d_vec = std::vector>(N, Eigen::Matrix(N)); - stan::math::fill(p_1d_vec, DUMMY_VAR__); + stan::math::fill(p_1d_vec, DUMMY_VAR__); current_statement__ = 10; p_1d_vec = in__.template read>>( N, N); std::vector>>> p_3d_vec; p_3d_vec = std::vector>>>(N, std::vector>>(M, std::vector>(K, Eigen::Matrix(N)))); - stan::math::fill(p_3d_vec, DUMMY_VAR__); + stan::math::fill(p_3d_vec, DUMMY_VAR__); current_statement__ = 11; p_3d_vec = in__.template read>>>>( N, M, K, N); Eigen::Matrix p_row_vec; p_row_vec = Eigen::Matrix(N); - stan::math::fill(p_row_vec, DUMMY_VAR__); + stan::math::fill(p_row_vec, DUMMY_VAR__); current_statement__ = 12; p_row_vec = in__.template read>( N); std::vector> p_1d_row_vec; p_1d_row_vec = std::vector>(N, Eigen::Matrix(N)); - stan::math::fill(p_1d_row_vec, DUMMY_VAR__); + stan::math::fill(p_1d_row_vec, DUMMY_VAR__); current_statement__ = 13; p_1d_row_vec = in__.template read>>( N, N); std::vector>>> p_3d_row_vec; p_3d_row_vec = std::vector>>>(N, std::vector>>(M, std::vector>(K, Eigen::Matrix(N)))); - stan::math::fill(p_3d_row_vec, DUMMY_VAR__); + stan::math::fill(p_3d_row_vec, DUMMY_VAR__); current_statement__ = 14; p_3d_row_vec = in__.template read>>>>( N, M, K, N); std::vector>> p_ar_mat; p_ar_mat = std::vector>>(4, std::vector>(5, Eigen::Matrix(2, 3))); - stan::math::fill(p_ar_mat, DUMMY_VAR__); + stan::math::fill(p_ar_mat, DUMMY_VAR__); current_statement__ = 15; p_ar_mat = in__.template read_constrain_lub>>, jacobian__>( 0, 1, lp__, 4, 5, 2, 3); Eigen::Matrix p_simplex; p_simplex = Eigen::Matrix(N); - stan::math::fill(p_simplex, DUMMY_VAR__); + stan::math::fill(p_simplex, DUMMY_VAR__); current_statement__ = 16; p_simplex = in__.template read_constrain_simplex, jacobian__>( lp__, N); std::vector> p_1d_simplex; p_1d_simplex = std::vector>(N, Eigen::Matrix(N)); - stan::math::fill(p_1d_simplex, DUMMY_VAR__); + stan::math::fill(p_1d_simplex, DUMMY_VAR__); current_statement__ = 17; p_1d_simplex = in__.template read_constrain_simplex>, jacobian__>( lp__, N, N); std::vector>>> p_3d_simplex; p_3d_simplex = std::vector>>>(N, std::vector>>(M, std::vector>(K, Eigen::Matrix(N)))); - stan::math::fill(p_3d_simplex, DUMMY_VAR__); + stan::math::fill(p_3d_simplex, DUMMY_VAR__); current_statement__ = 18; p_3d_simplex = in__.template read_constrain_simplex>>>, jacobian__>( lp__, N, M, K, N); Eigen::Matrix p_cfcov_54; p_cfcov_54 = Eigen::Matrix(5, 4); - stan::math::fill(p_cfcov_54, DUMMY_VAR__); + stan::math::fill(p_cfcov_54, DUMMY_VAR__); current_statement__ = 19; p_cfcov_54 = in__.template read_constrain_cholesky_factor_cov, jacobian__>( lp__, 5, 4); Eigen::Matrix p_cfcov_33; p_cfcov_33 = Eigen::Matrix(3, 3); - stan::math::fill(p_cfcov_33, DUMMY_VAR__); + stan::math::fill(p_cfcov_33, DUMMY_VAR__); current_statement__ = 20; p_cfcov_33 = in__.template read_constrain_cholesky_factor_cov, jacobian__>( lp__, 3, 3); std::vector> p_cfcov_33_ar; p_cfcov_33_ar = std::vector>(K, Eigen::Matrix(3, 3)); - stan::math::fill(p_cfcov_33_ar, DUMMY_VAR__); + stan::math::fill(p_cfcov_33_ar, DUMMY_VAR__); current_statement__ = 21; p_cfcov_33_ar = in__.template read_constrain_cholesky_factor_cov>, jacobian__>( lp__, K, 3, 3); Eigen::Matrix x_p; x_p = Eigen::Matrix(2); - stan::math::fill(x_p, DUMMY_VAR__); + stan::math::fill(x_p, DUMMY_VAR__); current_statement__ = 22; x_p = in__.template read>(2); Eigen::Matrix y_p; y_p = Eigen::Matrix(2); - stan::math::fill(y_p, DUMMY_VAR__); + stan::math::fill(y_p, DUMMY_VAR__); current_statement__ = 23; y_p = in__.template read>(2); std::vector tp_real_1d_ar; - tp_real_1d_ar = std::vector(N, DUMMY_VAR__); + tp_real_1d_ar = std::vector(N, DUMMY_VAR__); std::vector>> tp_real_3d_ar; tp_real_3d_ar = std::vector>>(N, std::vector>(M, std::vector(K, DUMMY_VAR__))); + Eigen::Matrix tp_vec; tp_vec = Eigen::Matrix(N); - stan::math::fill(tp_vec, DUMMY_VAR__); + stan::math::fill(tp_vec, DUMMY_VAR__); std::vector> tp_1d_vec; tp_1d_vec = std::vector>(N, Eigen::Matrix(N)); - stan::math::fill(tp_1d_vec, DUMMY_VAR__); + stan::math::fill(tp_1d_vec, DUMMY_VAR__); std::vector>>> tp_3d_vec; tp_3d_vec = std::vector>>>(N, std::vector>>(M, std::vector>(K, Eigen::Matrix(N)))); - stan::math::fill(tp_3d_vec, DUMMY_VAR__); + stan::math::fill(tp_3d_vec, DUMMY_VAR__); Eigen::Matrix tp_row_vec; tp_row_vec = Eigen::Matrix(N); - stan::math::fill(tp_row_vec, DUMMY_VAR__); + stan::math::fill(tp_row_vec, DUMMY_VAR__); std::vector> tp_1d_row_vec; tp_1d_row_vec = std::vector>(N, Eigen::Matrix(N)); - stan::math::fill(tp_1d_row_vec, DUMMY_VAR__); + stan::math::fill(tp_1d_row_vec, DUMMY_VAR__); std::vector>>> tp_3d_row_vec; tp_3d_row_vec = std::vector>>>(N, std::vector>>(M, std::vector>(K, Eigen::Matrix(N)))); - stan::math::fill(tp_3d_row_vec, DUMMY_VAR__); + stan::math::fill(tp_3d_row_vec, DUMMY_VAR__); std::vector>> tp_ar_mat; tp_ar_mat = std::vector>>(4, std::vector>(5, Eigen::Matrix(2, 3))); - stan::math::fill(tp_ar_mat, DUMMY_VAR__); + stan::math::fill(tp_ar_mat, DUMMY_VAR__); Eigen::Matrix tp_simplex; tp_simplex = Eigen::Matrix(N); - stan::math::fill(tp_simplex, DUMMY_VAR__); + stan::math::fill(tp_simplex, DUMMY_VAR__); std::vector> tp_1d_simplex; tp_1d_simplex = std::vector>(N, Eigen::Matrix(N)); - stan::math::fill(tp_1d_simplex, DUMMY_VAR__); + stan::math::fill(tp_1d_simplex, DUMMY_VAR__); std::vector>>> tp_3d_simplex; tp_3d_simplex = std::vector>>>(N, std::vector>>(M, std::vector>(K, Eigen::Matrix(N)))); - stan::math::fill(tp_3d_simplex, DUMMY_VAR__); + stan::math::fill(tp_3d_simplex, DUMMY_VAR__); Eigen::Matrix tp_cfcov_54; tp_cfcov_54 = Eigen::Matrix(5, 4); - stan::math::fill(tp_cfcov_54, DUMMY_VAR__); + stan::math::fill(tp_cfcov_54, DUMMY_VAR__); Eigen::Matrix tp_cfcov_33; tp_cfcov_33 = Eigen::Matrix(3, 3); - stan::math::fill(tp_cfcov_33, DUMMY_VAR__); + stan::math::fill(tp_cfcov_33, DUMMY_VAR__); std::vector> tp_cfcov_33_ar; tp_cfcov_33_ar = std::vector>(K, Eigen::Matrix(3, 3)); - stan::math::fill(tp_cfcov_33_ar, DUMMY_VAR__); + stan::math::fill(tp_cfcov_33_ar, DUMMY_VAR__); Eigen::Matrix theta_p; theta_p = Eigen::Matrix(2); - stan::math::fill(theta_p, DUMMY_VAR__); + stan::math::fill(theta_p, DUMMY_VAR__); local_scalar_t__ tp_real; - tp_real = DUMMY_VAR__; + tp_real = DUMMY_VAR__; current_statement__ = 41; assign(tp_real_1d_ar, p_real_1d_ar, "assigning variable tp_real_1d_ar"); @@ -6899,12 +7028,16 @@ class mother_model final : public model_base_crtp { assign(tp_ar_mat, 0.4, "assigning variable tp_ar_mat", index_uni(m), index_uni(n), index_uni(i), index_uni(j)); - }}}} + } + } + } + } current_statement__ = 61; for (int i = 1; i <= N; ++i) { current_statement__ = 60; assign(tp_vec, (-1.0 * rvalue(p_vec, "p_vec", index_uni(i))), - "assigning variable tp_vec", index_uni(i));} + "assigning variable tp_vec", index_uni(i)); + } current_statement__ = 62; assign(tp_row_vec, transpose(rvalue(tp_1d_vec, "tp_1d_vec", index_uni(1))), @@ -6950,7 +7083,8 @@ class mother_model final : public model_base_crtp { current_statement__ = 24; current_statement__ = 24; check_greater_or_equal(function__, "tp_real_1d_ar[sym1__]", - tp_real_1d_ar[(sym1__ - 1)], 0);} + tp_real_1d_ar[(sym1__ - 1)], 0); + } current_statement__ = 25; for (int sym1__ = 1; sym1__ <= N; ++sym1__) { current_statement__ = 25; @@ -6962,13 +7096,17 @@ class mother_model final : public model_base_crtp { check_greater_or_equal(function__, "tp_real_3d_ar[sym1__, sym2__, sym3__]", tp_real_3d_ar[(sym1__ - 1)][(sym2__ - 1)][ - (sym3__ - 1)], 0);}}} + (sym3__ - 1)], 0); + } + } + } current_statement__ = 26; for (int sym1__ = 1; sym1__ <= N; ++sym1__) { current_statement__ = 26; current_statement__ = 26; check_less_or_equal(function__, "tp_vec[sym1__]", - tp_vec[(sym1__ - 1)], 0);} + tp_vec[(sym1__ - 1)], 0); + } current_statement__ = 32; for (int sym1__ = 1; sym1__ <= 4; ++sym1__) { current_statement__ = 32; @@ -6984,7 +7122,11 @@ class mother_model final : public model_base_crtp { rvalue(tp_ar_mat, "tp_ar_mat", index_uni(sym1__), index_uni(sym2__), index_uni(sym3__), index_uni(sym4__)), - 0);}}}} + 0); + } + } + } + } current_statement__ = 32; for (int sym1__ = 1; sym1__ <= 4; ++sym1__) { current_statement__ = 32; @@ -7000,7 +7142,11 @@ class mother_model final : public model_base_crtp { rvalue(tp_ar_mat, "tp_ar_mat", index_uni(sym1__), index_uni(sym2__), index_uni(sym3__), index_uni(sym4__)), - 1);}}}} + 1); + } + } + } + } current_statement__ = 33; current_statement__ = 33; check_simplex(function__, "tp_simplex", tp_simplex); @@ -7009,7 +7155,8 @@ class mother_model final : public model_base_crtp { current_statement__ = 34; current_statement__ = 34; check_simplex(function__, "tp_1d_simplex[sym1__]", - tp_1d_simplex[(sym1__ - 1)]);} + tp_1d_simplex[(sym1__ - 1)]); + } current_statement__ = 35; for (int sym1__ = 1; sym1__ <= N; ++sym1__) { current_statement__ = 35; @@ -7021,7 +7168,10 @@ class mother_model final : public model_base_crtp { check_simplex(function__, "tp_3d_simplex[sym1__, sym2__, sym3__]", tp_3d_simplex[(sym1__ - 1)][(sym2__ - 1)][(sym3__ - - 1)]);}}} + 1)]); + } + } + } current_statement__ = 36; current_statement__ = 36; check_cholesky_factor(function__, "tp_cfcov_54", tp_cfcov_54); @@ -7033,23 +7183,24 @@ class mother_model final : public model_base_crtp { current_statement__ = 38; current_statement__ = 38; check_cholesky_factor(function__, "tp_cfcov_33_ar[sym1__]", - tp_cfcov_33_ar[(sym1__ - 1)]);} + tp_cfcov_33_ar[(sym1__ - 1)]); + } { Eigen::Matrix tmp; tmp = Eigen::Matrix(0); - stan::math::fill(tmp, DUMMY_VAR__); + stan::math::fill(tmp, DUMMY_VAR__); std::vector> tmp2; tmp2 = std::vector>(0, Eigen::Matrix(0)); - stan::math::fill(tmp2, DUMMY_VAR__); + stan::math::fill(tmp2, DUMMY_VAR__); local_scalar_t__ r1; - r1 = DUMMY_VAR__; + r1 = DUMMY_VAR__; current_statement__ = 152; r1 = foo_bar1(p_real, pstream__); local_scalar_t__ r2; - r2 = DUMMY_VAR__; + r2 = DUMMY_VAR__; current_statement__ = 153; r2 = foo_bar1(J, pstream__); @@ -7113,7 +7264,10 @@ class mother_model final : public model_base_crtp { rvalue(p_real_3d_ar, "p_real_3d_ar", index_uni(n), index_uni(m), index_uni(k)), rvalue(p_real_3d_ar, "p_real_3d_ar", - index_uni(n), index_uni(m), index_uni(k)), 1));}}} + index_uni(n), index_uni(m), index_uni(k)), 1)); + } + } + } current_statement__ = 176; for (int i = 1; i <= 4; ++i) { current_statement__ = 174; @@ -7123,14 +7277,17 @@ class mother_model final : public model_base_crtp { normal_lpdf( to_vector( rvalue(p_ar_mat, "p_ar_mat", index_uni(i), index_uni(j))), - 0, 1));}} + 0, 1)); + } + } current_statement__ = 179; for (int k = 1; k <= K; ++k) { current_statement__ = 177; lp_accum__.add( normal_lpdf( to_vector(rvalue(p_cfcov_33_ar, "p_cfcov_33_ar", index_uni(k))), - 0, 1));} + 0, 1)); + } current_statement__ = 180; lp_accum__.add(normal_lpdf(to_vector(p_vec), d_vec, 1)); current_statement__ = 181; @@ -7178,260 +7335,288 @@ class mother_model final : public model_base_crtp { try { double p_real; - p_real = std::numeric_limits::quiet_NaN(); + p_real = std::numeric_limits::quiet_NaN(); current_statement__ = 1; p_real = in__.template read(); double p_upper; - p_upper = std::numeric_limits::quiet_NaN(); + p_upper = std::numeric_limits::quiet_NaN(); current_statement__ = 2; p_upper = in__.template read_constrain_lb( p_real, lp__); double p_lower; - p_lower = std::numeric_limits::quiet_NaN(); + p_lower = std::numeric_limits::quiet_NaN(); current_statement__ = 3; p_lower = in__.template read_constrain_ub( p_upper, lp__); std::vector offset_multiplier; offset_multiplier = std::vector(5, std::numeric_limits::quiet_NaN()); + current_statement__ = 4; offset_multiplier = in__.template read_constrain_offset_multiplier, jacobian__>( 1, 2, lp__, 5); std::vector no_offset_multiplier; no_offset_multiplier = std::vector(5, std::numeric_limits::quiet_NaN()); + current_statement__ = 5; no_offset_multiplier = in__.template read_constrain_offset_multiplier, jacobian__>( 0, 2, lp__, 5); std::vector offset_no_multiplier; offset_no_multiplier = std::vector(5, std::numeric_limits::quiet_NaN()); + current_statement__ = 6; offset_no_multiplier = in__.template read_constrain_offset_multiplier, jacobian__>( 3, 1, lp__, 5); std::vector p_real_1d_ar; p_real_1d_ar = std::vector(N, std::numeric_limits::quiet_NaN()); + current_statement__ = 7; p_real_1d_ar = in__.template read_constrain_lb, jacobian__>( 0, lp__, N); std::vector>> p_real_3d_ar; p_real_3d_ar = std::vector>>(N, std::vector>(M, std::vector(K, std::numeric_limits::quiet_NaN()))); + current_statement__ = 8; p_real_3d_ar = in__.template read_constrain_lb>>, jacobian__>( 0, lp__, N, M, K); Eigen::Matrix p_vec; p_vec = Eigen::Matrix(N); - stan::math::fill(p_vec, std::numeric_limits::quiet_NaN()); + stan::math::fill(p_vec, std::numeric_limits::quiet_NaN()); current_statement__ = 9; p_vec = in__.template read_constrain_lb, jacobian__>( 0, lp__, N); std::vector> p_1d_vec; p_1d_vec = std::vector>(N, Eigen::Matrix(N)); - stan::math::fill(p_1d_vec, std::numeric_limits::quiet_NaN()); + stan::math::fill(p_1d_vec, std::numeric_limits::quiet_NaN()); current_statement__ = 10; p_1d_vec = in__.template read>>( N, N); std::vector>>> p_3d_vec; p_3d_vec = std::vector>>>(N, std::vector>>(M, std::vector>(K, Eigen::Matrix(N)))); - stan::math::fill(p_3d_vec, std::numeric_limits::quiet_NaN()); + stan::math::fill(p_3d_vec, std::numeric_limits::quiet_NaN()); current_statement__ = 11; p_3d_vec = in__.template read>>>>( N, M, K, N); Eigen::Matrix p_row_vec; p_row_vec = Eigen::Matrix(N); - stan::math::fill(p_row_vec, std::numeric_limits::quiet_NaN()); + stan::math::fill(p_row_vec, std::numeric_limits::quiet_NaN()); current_statement__ = 12; p_row_vec = in__.template read>( N); std::vector> p_1d_row_vec; p_1d_row_vec = std::vector>(N, Eigen::Matrix(N)); - stan::math::fill(p_1d_row_vec, std::numeric_limits::quiet_NaN()); + stan::math::fill(p_1d_row_vec, std::numeric_limits::quiet_NaN()); current_statement__ = 13; p_1d_row_vec = in__.template read>>( N, N); std::vector>>> p_3d_row_vec; p_3d_row_vec = std::vector>>>(N, std::vector>>(M, std::vector>(K, Eigen::Matrix(N)))); - stan::math::fill(p_3d_row_vec, std::numeric_limits::quiet_NaN()); + stan::math::fill(p_3d_row_vec, std::numeric_limits::quiet_NaN()); current_statement__ = 14; p_3d_row_vec = in__.template read>>>>( N, M, K, N); std::vector>> p_ar_mat; p_ar_mat = std::vector>>(4, std::vector>(5, Eigen::Matrix(2, 3))); - stan::math::fill(p_ar_mat, std::numeric_limits::quiet_NaN()); + stan::math::fill(p_ar_mat, std::numeric_limits::quiet_NaN()); current_statement__ = 15; p_ar_mat = in__.template read_constrain_lub>>, jacobian__>( 0, 1, lp__, 4, 5, 2, 3); Eigen::Matrix p_simplex; p_simplex = Eigen::Matrix(N); - stan::math::fill(p_simplex, std::numeric_limits::quiet_NaN()); + stan::math::fill(p_simplex, std::numeric_limits::quiet_NaN()); current_statement__ = 16; p_simplex = in__.template read_constrain_simplex, jacobian__>( lp__, N); std::vector> p_1d_simplex; p_1d_simplex = std::vector>(N, Eigen::Matrix(N)); - stan::math::fill(p_1d_simplex, std::numeric_limits::quiet_NaN()); + stan::math::fill(p_1d_simplex, std::numeric_limits::quiet_NaN()); current_statement__ = 17; p_1d_simplex = in__.template read_constrain_simplex>, jacobian__>( lp__, N, N); std::vector>>> p_3d_simplex; p_3d_simplex = std::vector>>>(N, std::vector>>(M, std::vector>(K, Eigen::Matrix(N)))); - stan::math::fill(p_3d_simplex, std::numeric_limits::quiet_NaN()); + stan::math::fill(p_3d_simplex, std::numeric_limits::quiet_NaN()); current_statement__ = 18; p_3d_simplex = in__.template read_constrain_simplex>>>, jacobian__>( lp__, N, M, K, N); Eigen::Matrix p_cfcov_54; p_cfcov_54 = Eigen::Matrix(5, 4); - stan::math::fill(p_cfcov_54, std::numeric_limits::quiet_NaN()); + stan::math::fill(p_cfcov_54, std::numeric_limits::quiet_NaN()); current_statement__ = 19; p_cfcov_54 = in__.template read_constrain_cholesky_factor_cov, jacobian__>( lp__, 5, 4); Eigen::Matrix p_cfcov_33; p_cfcov_33 = Eigen::Matrix(3, 3); - stan::math::fill(p_cfcov_33, std::numeric_limits::quiet_NaN()); + stan::math::fill(p_cfcov_33, std::numeric_limits::quiet_NaN()); current_statement__ = 20; p_cfcov_33 = in__.template read_constrain_cholesky_factor_cov, jacobian__>( lp__, 3, 3); std::vector> p_cfcov_33_ar; p_cfcov_33_ar = std::vector>(K, Eigen::Matrix(3, 3)); - stan::math::fill(p_cfcov_33_ar, std::numeric_limits::quiet_NaN()); + stan::math::fill(p_cfcov_33_ar, std::numeric_limits::quiet_NaN()); current_statement__ = 21; p_cfcov_33_ar = in__.template read_constrain_cholesky_factor_cov>, jacobian__>( lp__, K, 3, 3); Eigen::Matrix x_p; x_p = Eigen::Matrix(2); - stan::math::fill(x_p, std::numeric_limits::quiet_NaN()); + stan::math::fill(x_p, std::numeric_limits::quiet_NaN()); current_statement__ = 22; x_p = in__.template read>(2); Eigen::Matrix y_p; y_p = Eigen::Matrix(2); - stan::math::fill(y_p, std::numeric_limits::quiet_NaN()); + stan::math::fill(y_p, std::numeric_limits::quiet_NaN()); current_statement__ = 23; y_p = in__.template read>(2); std::vector tp_real_1d_ar; tp_real_1d_ar = std::vector(N, std::numeric_limits::quiet_NaN()); + std::vector>> tp_real_3d_ar; tp_real_3d_ar = std::vector>>(N, std::vector>(M, std::vector(K, std::numeric_limits::quiet_NaN()))); + Eigen::Matrix tp_vec; tp_vec = Eigen::Matrix(N); - stan::math::fill(tp_vec, std::numeric_limits::quiet_NaN()); + stan::math::fill(tp_vec, std::numeric_limits::quiet_NaN()); std::vector> tp_1d_vec; tp_1d_vec = std::vector>(N, Eigen::Matrix(N)); - stan::math::fill(tp_1d_vec, std::numeric_limits::quiet_NaN()); + stan::math::fill(tp_1d_vec, std::numeric_limits::quiet_NaN()); std::vector>>> tp_3d_vec; tp_3d_vec = std::vector>>>(N, std::vector>>(M, std::vector>(K, Eigen::Matrix(N)))); - stan::math::fill(tp_3d_vec, std::numeric_limits::quiet_NaN()); + stan::math::fill(tp_3d_vec, std::numeric_limits::quiet_NaN()); Eigen::Matrix tp_row_vec; tp_row_vec = Eigen::Matrix(N); - stan::math::fill(tp_row_vec, std::numeric_limits::quiet_NaN()); + stan::math::fill(tp_row_vec, std::numeric_limits::quiet_NaN()); std::vector> tp_1d_row_vec; tp_1d_row_vec = std::vector>(N, Eigen::Matrix(N)); - stan::math::fill(tp_1d_row_vec, std::numeric_limits::quiet_NaN()); + stan::math::fill(tp_1d_row_vec, std::numeric_limits::quiet_NaN()); std::vector>>> tp_3d_row_vec; tp_3d_row_vec = std::vector>>>(N, std::vector>>(M, std::vector>(K, Eigen::Matrix(N)))); - stan::math::fill(tp_3d_row_vec, std::numeric_limits::quiet_NaN()); + stan::math::fill(tp_3d_row_vec, std::numeric_limits::quiet_NaN()); std::vector>> tp_ar_mat; tp_ar_mat = std::vector>>(4, std::vector>(5, Eigen::Matrix(2, 3))); - stan::math::fill(tp_ar_mat, std::numeric_limits::quiet_NaN()); + stan::math::fill(tp_ar_mat, std::numeric_limits::quiet_NaN()); Eigen::Matrix tp_simplex; tp_simplex = Eigen::Matrix(N); - stan::math::fill(tp_simplex, std::numeric_limits::quiet_NaN()); + stan::math::fill(tp_simplex, std::numeric_limits::quiet_NaN()); std::vector> tp_1d_simplex; tp_1d_simplex = std::vector>(N, Eigen::Matrix(N)); - stan::math::fill(tp_1d_simplex, std::numeric_limits::quiet_NaN()); + stan::math::fill(tp_1d_simplex, std::numeric_limits::quiet_NaN()); std::vector>>> tp_3d_simplex; tp_3d_simplex = std::vector>>>(N, std::vector>>(M, std::vector>(K, Eigen::Matrix(N)))); - stan::math::fill(tp_3d_simplex, std::numeric_limits::quiet_NaN()); + stan::math::fill(tp_3d_simplex, std::numeric_limits::quiet_NaN()); Eigen::Matrix tp_cfcov_54; tp_cfcov_54 = Eigen::Matrix(5, 4); - stan::math::fill(tp_cfcov_54, std::numeric_limits::quiet_NaN()); + stan::math::fill(tp_cfcov_54, std::numeric_limits::quiet_NaN()); Eigen::Matrix tp_cfcov_33; tp_cfcov_33 = Eigen::Matrix(3, 3); - stan::math::fill(tp_cfcov_33, std::numeric_limits::quiet_NaN()); + stan::math::fill(tp_cfcov_33, std::numeric_limits::quiet_NaN()); std::vector> tp_cfcov_33_ar; tp_cfcov_33_ar = std::vector>(K, Eigen::Matrix(3, 3)); - stan::math::fill(tp_cfcov_33_ar, std::numeric_limits::quiet_NaN()); + stan::math::fill(tp_cfcov_33_ar, std::numeric_limits::quiet_NaN()); Eigen::Matrix theta_p; theta_p = Eigen::Matrix(2); - stan::math::fill(theta_p, std::numeric_limits::quiet_NaN()); + stan::math::fill(theta_p, std::numeric_limits::quiet_NaN()); double tp_real; - tp_real = std::numeric_limits::quiet_NaN(); + tp_real = std::numeric_limits::quiet_NaN(); vars__.emplace_back(p_real); vars__.emplace_back(p_upper); vars__.emplace_back(p_lower); for (int sym1__ = 1; sym1__ <= 5; ++sym1__) { - vars__.emplace_back(offset_multiplier[(sym1__ - 1)]);} + vars__.emplace_back(offset_multiplier[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= 5; ++sym1__) { - vars__.emplace_back(no_offset_multiplier[(sym1__ - 1)]);} + vars__.emplace_back(no_offset_multiplier[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= 5; ++sym1__) { - vars__.emplace_back(offset_no_multiplier[(sym1__ - 1)]);} + vars__.emplace_back(offset_no_multiplier[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { - vars__.emplace_back(p_real_1d_ar[(sym1__ - 1)]);} + vars__.emplace_back(p_real_1d_ar[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= K; ++sym1__) { for (int sym2__ = 1; sym2__ <= M; ++sym2__) { for (int sym3__ = 1; sym3__ <= N; ++sym3__) { vars__.emplace_back( - p_real_3d_ar[(sym3__ - 1)][(sym2__ - 1)][(sym1__ - 1)]);}}} + p_real_3d_ar[(sym3__ - 1)][(sym2__ - 1)][(sym1__ - 1)]); + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { - vars__.emplace_back(p_vec[(sym1__ - 1)]);} + vars__.emplace_back(p_vec[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { - vars__.emplace_back(p_1d_vec[(sym2__ - 1)][(sym1__ - 1)]);}} + vars__.emplace_back(p_1d_vec[(sym2__ - 1)][(sym1__ - 1)]); + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { for (int sym2__ = 1; sym2__ <= K; ++sym2__) { for (int sym3__ = 1; sym3__ <= M; ++sym3__) { for (int sym4__ = 1; sym4__ <= N; ++sym4__) { vars__.emplace_back( p_3d_vec[(sym4__ - 1)][(sym3__ - 1)][(sym2__ - 1)][(sym1__ - - 1)]);}}}} + 1)]); + } + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { - vars__.emplace_back(p_row_vec[(sym1__ - 1)]);} + vars__.emplace_back(p_row_vec[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { - vars__.emplace_back(p_1d_row_vec[(sym2__ - 1)][(sym1__ - 1)]);}} + vars__.emplace_back(p_1d_row_vec[(sym2__ - 1)][(sym1__ - 1)]); + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { for (int sym2__ = 1; sym2__ <= K; ++sym2__) { for (int sym3__ = 1; sym3__ <= M; ++sym3__) { for (int sym4__ = 1; sym4__ <= N; ++sym4__) { vars__.emplace_back( p_3d_row_vec[(sym4__ - 1)][(sym3__ - 1)][(sym2__ - 1)][ - (sym1__ - 1)]);}}}} + (sym1__ - 1)]); + } + } + } + } for (int sym1__ = 1; sym1__ <= 3; ++sym1__) { for (int sym2__ = 1; sym2__ <= 2; ++sym2__) { for (int sym3__ = 1; sym3__ <= 5; ++sym3__) { @@ -7439,39 +7624,59 @@ class mother_model final : public model_base_crtp { vars__.emplace_back( rvalue(p_ar_mat, "p_ar_mat", index_uni(sym4__), index_uni(sym3__), index_uni(sym2__), - index_uni(sym1__)));}}}} + index_uni(sym1__))); + } + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { - vars__.emplace_back(p_simplex[(sym1__ - 1)]);} + vars__.emplace_back(p_simplex[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { - vars__.emplace_back(p_1d_simplex[(sym2__ - 1)][(sym1__ - 1)]);}} + vars__.emplace_back(p_1d_simplex[(sym2__ - 1)][(sym1__ - 1)]); + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { for (int sym2__ = 1; sym2__ <= K; ++sym2__) { for (int sym3__ = 1; sym3__ <= M; ++sym3__) { for (int sym4__ = 1; sym4__ <= N; ++sym4__) { vars__.emplace_back( p_3d_simplex[(sym4__ - 1)][(sym3__ - 1)][(sym2__ - 1)][ - (sym1__ - 1)]);}}}} + (sym1__ - 1)]); + } + } + } + } for (int sym1__ = 1; sym1__ <= 4; ++sym1__) { for (int sym2__ = 1; sym2__ <= 5; ++sym2__) { vars__.emplace_back( rvalue(p_cfcov_54, "p_cfcov_54", - index_uni(sym2__), index_uni(sym1__)));}} + index_uni(sym2__), index_uni(sym1__))); + } + } for (int sym1__ = 1; sym1__ <= 3; ++sym1__) { for (int sym2__ = 1; sym2__ <= 3; ++sym2__) { vars__.emplace_back( rvalue(p_cfcov_33, "p_cfcov_33", - index_uni(sym2__), index_uni(sym1__)));}} + index_uni(sym2__), index_uni(sym1__))); + } + } for (int sym1__ = 1; sym1__ <= 3; ++sym1__) { for (int sym2__ = 1; sym2__ <= 3; ++sym2__) { for (int sym3__ = 1; sym3__ <= K; ++sym3__) { vars__.emplace_back( rvalue(p_cfcov_33_ar, "p_cfcov_33_ar", - index_uni(sym3__), index_uni(sym2__), index_uni(sym1__)));}}} + index_uni(sym3__), index_uni(sym2__), index_uni(sym1__))); + } + } + } for (int sym1__ = 1; sym1__ <= 2; ++sym1__) { - vars__.emplace_back(x_p[(sym1__ - 1)]);} + vars__.emplace_back(x_p[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= 2; ++sym1__) { - vars__.emplace_back(y_p[(sym1__ - 1)]);} + vars__.emplace_back(y_p[(sym1__ - 1)]); + } if (logical_negation((primitive_value(emit_transformed_parameters__) || primitive_value(emit_generated_quantities__)))) { return ; @@ -7509,12 +7714,16 @@ class mother_model final : public model_base_crtp { assign(tp_ar_mat, 0.4, "assigning variable tp_ar_mat", index_uni(m), index_uni(n), index_uni(i), index_uni(j)); - }}}} + } + } + } + } current_statement__ = 61; for (int i = 1; i <= N; ++i) { current_statement__ = 60; assign(tp_vec, (-1.0 * rvalue(p_vec, "p_vec", index_uni(i))), - "assigning variable tp_vec", index_uni(i));} + "assigning variable tp_vec", index_uni(i)); + } current_statement__ = 62; assign(tp_row_vec, transpose(rvalue(tp_1d_vec, "tp_1d_vec", index_uni(1))), @@ -7560,7 +7769,8 @@ class mother_model final : public model_base_crtp { current_statement__ = 24; current_statement__ = 24; check_greater_or_equal(function__, "tp_real_1d_ar[sym1__]", - tp_real_1d_ar[(sym1__ - 1)], 0);} + tp_real_1d_ar[(sym1__ - 1)], 0); + } current_statement__ = 25; for (int sym1__ = 1; sym1__ <= N; ++sym1__) { current_statement__ = 25; @@ -7572,13 +7782,17 @@ class mother_model final : public model_base_crtp { check_greater_or_equal(function__, "tp_real_3d_ar[sym1__, sym2__, sym3__]", tp_real_3d_ar[(sym1__ - 1)][(sym2__ - 1)][ - (sym3__ - 1)], 0);}}} + (sym3__ - 1)], 0); + } + } + } current_statement__ = 26; for (int sym1__ = 1; sym1__ <= N; ++sym1__) { current_statement__ = 26; current_statement__ = 26; check_less_or_equal(function__, "tp_vec[sym1__]", - tp_vec[(sym1__ - 1)], 0);} + tp_vec[(sym1__ - 1)], 0); + } current_statement__ = 32; for (int sym1__ = 1; sym1__ <= 4; ++sym1__) { current_statement__ = 32; @@ -7594,7 +7808,11 @@ class mother_model final : public model_base_crtp { rvalue(tp_ar_mat, "tp_ar_mat", index_uni(sym1__), index_uni(sym2__), index_uni(sym3__), index_uni(sym4__)), - 0);}}}} + 0); + } + } + } + } current_statement__ = 32; for (int sym1__ = 1; sym1__ <= 4; ++sym1__) { current_statement__ = 32; @@ -7610,7 +7828,11 @@ class mother_model final : public model_base_crtp { rvalue(tp_ar_mat, "tp_ar_mat", index_uni(sym1__), index_uni(sym2__), index_uni(sym3__), index_uni(sym4__)), - 1);}}}} + 1); + } + } + } + } current_statement__ = 33; current_statement__ = 33; check_simplex(function__, "tp_simplex", tp_simplex); @@ -7619,7 +7841,8 @@ class mother_model final : public model_base_crtp { current_statement__ = 34; current_statement__ = 34; check_simplex(function__, "tp_1d_simplex[sym1__]", - tp_1d_simplex[(sym1__ - 1)]);} + tp_1d_simplex[(sym1__ - 1)]); + } current_statement__ = 35; for (int sym1__ = 1; sym1__ <= N; ++sym1__) { current_statement__ = 35; @@ -7631,7 +7854,10 @@ class mother_model final : public model_base_crtp { check_simplex(function__, "tp_3d_simplex[sym1__, sym2__, sym3__]", tp_3d_simplex[(sym1__ - 1)][(sym2__ - 1)][(sym3__ - - 1)]);}}} + 1)]); + } + } + } current_statement__ = 36; current_statement__ = 36; check_cholesky_factor(function__, "tp_cfcov_54", tp_cfcov_54); @@ -7643,39 +7869,58 @@ class mother_model final : public model_base_crtp { current_statement__ = 38; current_statement__ = 38; check_cholesky_factor(function__, "tp_cfcov_33_ar[sym1__]", - tp_cfcov_33_ar[(sym1__ - 1)]);} + tp_cfcov_33_ar[(sym1__ - 1)]); + } if (emit_transformed_parameters__) { for (int sym1__ = 1; sym1__ <= N; ++sym1__) { - vars__.emplace_back(tp_real_1d_ar[(sym1__ - 1)]);} + vars__.emplace_back(tp_real_1d_ar[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= K; ++sym1__) { for (int sym2__ = 1; sym2__ <= M; ++sym2__) { for (int sym3__ = 1; sym3__ <= N; ++sym3__) { vars__.emplace_back( - tp_real_3d_ar[(sym3__ - 1)][(sym2__ - 1)][(sym1__ - 1)]);}}} + tp_real_3d_ar[(sym3__ - 1)][(sym2__ - 1)][(sym1__ - 1)]); + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { - vars__.emplace_back(tp_vec[(sym1__ - 1)]);} + vars__.emplace_back(tp_vec[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { - vars__.emplace_back(tp_1d_vec[(sym2__ - 1)][(sym1__ - 1)]);}} + vars__.emplace_back(tp_1d_vec[(sym2__ - 1)][(sym1__ - 1)]); + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { for (int sym2__ = 1; sym2__ <= K; ++sym2__) { for (int sym3__ = 1; sym3__ <= M; ++sym3__) { for (int sym4__ = 1; sym4__ <= N; ++sym4__) { vars__.emplace_back( tp_3d_vec[(sym4__ - 1)][(sym3__ - 1)][(sym2__ - 1)][ - (sym1__ - 1)]);}}}} + (sym1__ - 1)]); + } + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { - vars__.emplace_back(tp_row_vec[(sym1__ - 1)]);} + vars__.emplace_back(tp_row_vec[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { - vars__.emplace_back(tp_1d_row_vec[(sym2__ - 1)][(sym1__ - 1)]);}} + vars__.emplace_back(tp_1d_row_vec[(sym2__ - 1)][(sym1__ - 1)]); + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { for (int sym2__ = 1; sym2__ <= K; ++sym2__) { for (int sym3__ = 1; sym3__ <= M; ++sym3__) { for (int sym4__ = 1; sym4__ <= N; ++sym4__) { vars__.emplace_back( tp_3d_row_vec[(sym4__ - 1)][(sym3__ - 1)][(sym2__ - 1)][ - (sym1__ - 1)]);}}}} + (sym1__ - 1)]); + } + } + } + } for (int sym1__ = 1; sym1__ <= 3; ++sym1__) { for (int sym2__ = 1; sym2__ <= 2; ++sym2__) { for (int sym3__ = 1; sym3__ <= 5; ++sym3__) { @@ -7683,151 +7928,171 @@ class mother_model final : public model_base_crtp { vars__.emplace_back( rvalue(tp_ar_mat, "tp_ar_mat", index_uni(sym4__), index_uni(sym3__), index_uni(sym2__), - index_uni(sym1__)));}}}} + index_uni(sym1__))); + } + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { - vars__.emplace_back(tp_simplex[(sym1__ - 1)]);} + vars__.emplace_back(tp_simplex[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { - vars__.emplace_back(tp_1d_simplex[(sym2__ - 1)][(sym1__ - 1)]);}} + vars__.emplace_back(tp_1d_simplex[(sym2__ - 1)][(sym1__ - 1)]); + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { for (int sym2__ = 1; sym2__ <= K; ++sym2__) { for (int sym3__ = 1; sym3__ <= M; ++sym3__) { for (int sym4__ = 1; sym4__ <= N; ++sym4__) { vars__.emplace_back( tp_3d_simplex[(sym4__ - 1)][(sym3__ - 1)][(sym2__ - 1)][ - (sym1__ - 1)]);}}}} + (sym1__ - 1)]); + } + } + } + } for (int sym1__ = 1; sym1__ <= 4; ++sym1__) { for (int sym2__ = 1; sym2__ <= 5; ++sym2__) { vars__.emplace_back( rvalue(tp_cfcov_54, "tp_cfcov_54", - index_uni(sym2__), index_uni(sym1__)));}} + index_uni(sym2__), index_uni(sym1__))); + } + } for (int sym1__ = 1; sym1__ <= 3; ++sym1__) { for (int sym2__ = 1; sym2__ <= 3; ++sym2__) { vars__.emplace_back( rvalue(tp_cfcov_33, "tp_cfcov_33", - index_uni(sym2__), index_uni(sym1__)));}} + index_uni(sym2__), index_uni(sym1__))); + } + } for (int sym1__ = 1; sym1__ <= 3; ++sym1__) { for (int sym2__ = 1; sym2__ <= 3; ++sym2__) { for (int sym3__ = 1; sym3__ <= K; ++sym3__) { vars__.emplace_back( rvalue(tp_cfcov_33_ar, "tp_cfcov_33_ar", - index_uni(sym3__), index_uni(sym2__), index_uni(sym1__)));} - }} + index_uni(sym3__), index_uni(sym2__), index_uni(sym1__))); + } + } + } for (int sym1__ = 1; sym1__ <= 2; ++sym1__) { - vars__.emplace_back(theta_p[(sym1__ - 1)]);} + vars__.emplace_back(theta_p[(sym1__ - 1)]); + } vars__.emplace_back(tp_real); } if (logical_negation(emit_generated_quantities__)) { return ; } double gq_r1; - gq_r1 = std::numeric_limits::quiet_NaN(); + gq_r1 = std::numeric_limits::quiet_NaN(); current_statement__ = 74; gq_r1 = foo_bar1(p_real, pstream__); double gq_r2; - gq_r2 = std::numeric_limits::quiet_NaN(); + gq_r2 = std::numeric_limits::quiet_NaN(); current_statement__ = 75; gq_r2 = foo_bar1(J, pstream__); std::vector gq_real_1d_ar; gq_real_1d_ar = std::vector(N, std::numeric_limits::quiet_NaN()); + std::vector>> gq_real_3d_ar; gq_real_3d_ar = std::vector>>(N, std::vector>(M, std::vector(K, std::numeric_limits::quiet_NaN()))); + Eigen::Matrix gq_vec; gq_vec = Eigen::Matrix(N); - stan::math::fill(gq_vec, std::numeric_limits::quiet_NaN()); + stan::math::fill(gq_vec, std::numeric_limits::quiet_NaN()); std::vector> gq_1d_vec; gq_1d_vec = std::vector>(N, Eigen::Matrix(N)); - stan::math::fill(gq_1d_vec, std::numeric_limits::quiet_NaN()); + stan::math::fill(gq_1d_vec, std::numeric_limits::quiet_NaN()); std::vector>>> gq_3d_vec; gq_3d_vec = std::vector>>>(N, std::vector>>(M, std::vector>(K, Eigen::Matrix(N)))); - stan::math::fill(gq_3d_vec, std::numeric_limits::quiet_NaN()); + stan::math::fill(gq_3d_vec, std::numeric_limits::quiet_NaN()); Eigen::Matrix gq_row_vec; gq_row_vec = Eigen::Matrix(N); - stan::math::fill(gq_row_vec, std::numeric_limits::quiet_NaN()); + stan::math::fill(gq_row_vec, std::numeric_limits::quiet_NaN()); std::vector> gq_1d_row_vec; gq_1d_row_vec = std::vector>(N, Eigen::Matrix(N)); - stan::math::fill(gq_1d_row_vec, std::numeric_limits::quiet_NaN()); + stan::math::fill(gq_1d_row_vec, std::numeric_limits::quiet_NaN()); std::vector>>> gq_3d_row_vec; gq_3d_row_vec = std::vector>>>(N, std::vector>>(M, std::vector>(K, Eigen::Matrix(N)))); - stan::math::fill(gq_3d_row_vec, std::numeric_limits::quiet_NaN()); + stan::math::fill(gq_3d_row_vec, std::numeric_limits::quiet_NaN()); std::vector>> gq_ar_mat; gq_ar_mat = std::vector>>(4, std::vector>(5, Eigen::Matrix(2, 3))); - stan::math::fill(gq_ar_mat, std::numeric_limits::quiet_NaN()); + stan::math::fill(gq_ar_mat, std::numeric_limits::quiet_NaN()); Eigen::Matrix gq_simplex; gq_simplex = Eigen::Matrix(N); - stan::math::fill(gq_simplex, std::numeric_limits::quiet_NaN()); + stan::math::fill(gq_simplex, std::numeric_limits::quiet_NaN()); std::vector> gq_1d_simplex; gq_1d_simplex = std::vector>(N, Eigen::Matrix(N)); - stan::math::fill(gq_1d_simplex, std::numeric_limits::quiet_NaN()); + stan::math::fill(gq_1d_simplex, std::numeric_limits::quiet_NaN()); std::vector>>> gq_3d_simplex; gq_3d_simplex = std::vector>>>(N, std::vector>>(M, std::vector>(K, Eigen::Matrix(N)))); - stan::math::fill(gq_3d_simplex, std::numeric_limits::quiet_NaN()); + stan::math::fill(gq_3d_simplex, std::numeric_limits::quiet_NaN()); Eigen::Matrix gq_cfcov_54; gq_cfcov_54 = Eigen::Matrix(5, 4); - stan::math::fill(gq_cfcov_54, std::numeric_limits::quiet_NaN()); + stan::math::fill(gq_cfcov_54, std::numeric_limits::quiet_NaN()); Eigen::Matrix gq_cfcov_33; gq_cfcov_33 = Eigen::Matrix(3, 3); - stan::math::fill(gq_cfcov_33, std::numeric_limits::quiet_NaN()); + stan::math::fill(gq_cfcov_33, std::numeric_limits::quiet_NaN()); std::vector> gq_cfcov_33_ar; gq_cfcov_33_ar = std::vector>(K, Eigen::Matrix(3, 3)); - stan::math::fill(gq_cfcov_33_ar, std::numeric_limits::quiet_NaN()); + stan::math::fill(gq_cfcov_33_ar, std::numeric_limits::quiet_NaN()); std::vector indices; - indices = std::vector(3, std::numeric_limits::min()); + indices = std::vector(3, std::numeric_limits::min()); current_statement__ = 91; assign(indices, std::vector{2, 3, 1}, "assigning variable indices"); std::vector> indexing_mat; indexing_mat = std::vector>(5, Eigen::Matrix(3, 4)); - stan::math::fill(indexing_mat, std::numeric_limits::quiet_NaN()); + stan::math::fill(indexing_mat, std::numeric_limits::quiet_NaN()); std::vector> idx_res1; idx_res1 = std::vector>(3, Eigen::Matrix(3, 4)); - stan::math::fill(idx_res1, std::numeric_limits::quiet_NaN()); + stan::math::fill(idx_res1, std::numeric_limits::quiet_NaN()); std::vector> idx_res2; idx_res2 = std::vector>(5, Eigen::Matrix(3, 4)); - stan::math::fill(idx_res2, std::numeric_limits::quiet_NaN()); + stan::math::fill(idx_res2, std::numeric_limits::quiet_NaN()); std::vector> idx_res3; idx_res3 = std::vector>(3, Eigen::Matrix(3, 3)); - stan::math::fill(idx_res3, std::numeric_limits::quiet_NaN()); + stan::math::fill(idx_res3, std::numeric_limits::quiet_NaN()); std::vector> idx_res11; idx_res11 = std::vector>(3, Eigen::Matrix(3, 4)); - stan::math::fill(idx_res11, std::numeric_limits::quiet_NaN()); + stan::math::fill(idx_res11, std::numeric_limits::quiet_NaN()); std::vector> idx_res21; idx_res21 = std::vector>(5, Eigen::Matrix(3, 4)); - stan::math::fill(idx_res21, std::numeric_limits::quiet_NaN()); + stan::math::fill(idx_res21, std::numeric_limits::quiet_NaN()); std::vector> idx_res31; idx_res31 = std::vector>(3, Eigen::Matrix(3, 3)); - stan::math::fill(idx_res31, std::numeric_limits::quiet_NaN()); + stan::math::fill(idx_res31, std::numeric_limits::quiet_NaN()); std::vector> idx_res4; idx_res4 = std::vector>(3, Eigen::Matrix(4)); - stan::math::fill(idx_res4, std::numeric_limits::quiet_NaN()); + stan::math::fill(idx_res4, std::numeric_limits::quiet_NaN()); std::vector> idx_res5; idx_res5 = std::vector>(2, Eigen::Matrix(2)); - stan::math::fill(idx_res5, std::numeric_limits::quiet_NaN()); + stan::math::fill(idx_res5, std::numeric_limits::quiet_NaN()); current_statement__ = 101; assign(gq_real_1d_ar, @@ -7872,12 +8137,16 @@ class mother_model final : public model_base_crtp { assign(gq_ar_mat, 0.4, "assigning variable gq_ar_mat", index_uni(m), index_uni(n), index_uni(i), index_uni(j)); - }}}} + } + } + } + } current_statement__ = 124; for (int i = 1; i <= N; ++i) { current_statement__ = 123; assign(gq_vec, (-1.0 * rvalue(p_vec, "p_vec", index_uni(i))), - "assigning variable gq_vec", index_uni(i));} + "assigning variable gq_vec", index_uni(i)); + } current_statement__ = 128; for (int i = 1; i <= 3; ++i) { current_statement__ = 127; @@ -7887,7 +8156,10 @@ class mother_model final : public model_base_crtp { current_statement__ = 125; assign(indexing_mat, normal_rng(0, 1, base_rng__), "assigning variable indexing_mat", index_uni(k), index_uni(i), - index_uni(j));}}} + index_uni(j)); + } + } + } current_statement__ = 131; for (int i = 1; i <= size(indices); ++i) { current_statement__ = 130; @@ -7897,7 +8169,9 @@ class mother_model final : public model_base_crtp { rvalue(indexing_mat, "indexing_mat", index_uni(rvalue(indices, "indices", index_uni(i))), index_uni(rvalue(indices, "indices", index_uni(j)))), - "assigning variable idx_res1", index_uni(i), index_uni(j));}} + "assigning variable idx_res1", index_uni(i), index_uni(j)); + } + } current_statement__ = 132; assign(idx_res11, rvalue(indexing_mat, "indexing_mat", @@ -7926,7 +8200,9 @@ class mother_model final : public model_base_crtp { rvalue(indexing_mat, "indexing_mat", index_uni(i), index_uni(rvalue(indices, "indices", index_uni(j)))), - "assigning variable idx_res2", index_uni(i), index_uni(j));}} + "assigning variable idx_res2", index_uni(i), index_uni(j)); + } + } current_statement__ = 138; assign(idx_res21, rvalue(indexing_mat, "indexing_mat", @@ -7957,7 +8233,10 @@ class mother_model final : public model_base_crtp { index_uni(j), index_uni(rvalue(indices, "indices", index_uni(k)))), "assigning variable idx_res3", index_uni(i), index_uni(j), - index_uni(k));}}} + index_uni(k)); + } + } + } current_statement__ = 145; assign(idx_res31, rvalue(indexing_mat, "indexing_mat", @@ -7992,7 +8271,8 @@ class mother_model final : public model_base_crtp { current_statement__ = 76; current_statement__ = 76; check_greater_or_equal(function__, "gq_real_1d_ar[sym1__]", - gq_real_1d_ar[(sym1__ - 1)], 0);} + gq_real_1d_ar[(sym1__ - 1)], 0); + } current_statement__ = 77; for (int sym1__ = 1; sym1__ <= N; ++sym1__) { current_statement__ = 77; @@ -8004,13 +8284,17 @@ class mother_model final : public model_base_crtp { check_greater_or_equal(function__, "gq_real_3d_ar[sym1__, sym2__, sym3__]", gq_real_3d_ar[(sym1__ - 1)][(sym2__ - 1)][ - (sym3__ - 1)], 0);}}} + (sym3__ - 1)], 0); + } + } + } current_statement__ = 78; for (int sym1__ = 1; sym1__ <= N; ++sym1__) { current_statement__ = 78; current_statement__ = 78; check_less_or_equal(function__, "gq_vec[sym1__]", - gq_vec[(sym1__ - 1)], 1);} + gq_vec[(sym1__ - 1)], 1); + } current_statement__ = 84; for (int sym1__ = 1; sym1__ <= 4; ++sym1__) { current_statement__ = 84; @@ -8026,7 +8310,11 @@ class mother_model final : public model_base_crtp { rvalue(gq_ar_mat, "gq_ar_mat", index_uni(sym1__), index_uni(sym2__), index_uni(sym3__), index_uni(sym4__)), - 0);}}}} + 0); + } + } + } + } current_statement__ = 84; for (int sym1__ = 1; sym1__ <= 4; ++sym1__) { current_statement__ = 84; @@ -8042,7 +8330,11 @@ class mother_model final : public model_base_crtp { rvalue(gq_ar_mat, "gq_ar_mat", index_uni(sym1__), index_uni(sym2__), index_uni(sym3__), index_uni(sym4__)), - 1);}}}} + 1); + } + } + } + } current_statement__ = 85; current_statement__ = 85; check_simplex(function__, "gq_simplex", gq_simplex); @@ -8051,7 +8343,8 @@ class mother_model final : public model_base_crtp { current_statement__ = 86; current_statement__ = 86; check_simplex(function__, "gq_1d_simplex[sym1__]", - gq_1d_simplex[(sym1__ - 1)]);} + gq_1d_simplex[(sym1__ - 1)]); + } current_statement__ = 87; for (int sym1__ = 1; sym1__ <= N; ++sym1__) { current_statement__ = 87; @@ -8063,7 +8356,10 @@ class mother_model final : public model_base_crtp { check_simplex(function__, "gq_3d_simplex[sym1__, sym2__, sym3__]", gq_3d_simplex[(sym1__ - 1)][(sym2__ - 1)][(sym3__ - - 1)]);}}} + 1)]); + } + } + } current_statement__ = 88; current_statement__ = 88; check_cholesky_factor(function__, "gq_cfcov_54", gq_cfcov_54); @@ -8075,40 +8371,59 @@ class mother_model final : public model_base_crtp { current_statement__ = 90; current_statement__ = 90; check_cholesky_factor(function__, "gq_cfcov_33_ar[sym1__]", - gq_cfcov_33_ar[(sym1__ - 1)]);} + gq_cfcov_33_ar[(sym1__ - 1)]); + } vars__.emplace_back(gq_r1); vars__.emplace_back(gq_r2); for (int sym1__ = 1; sym1__ <= N; ++sym1__) { - vars__.emplace_back(gq_real_1d_ar[(sym1__ - 1)]);} + vars__.emplace_back(gq_real_1d_ar[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= K; ++sym1__) { for (int sym2__ = 1; sym2__ <= M; ++sym2__) { for (int sym3__ = 1; sym3__ <= N; ++sym3__) { vars__.emplace_back( - gq_real_3d_ar[(sym3__ - 1)][(sym2__ - 1)][(sym1__ - 1)]);}}} + gq_real_3d_ar[(sym3__ - 1)][(sym2__ - 1)][(sym1__ - 1)]); + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { - vars__.emplace_back(gq_vec[(sym1__ - 1)]);} + vars__.emplace_back(gq_vec[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { - vars__.emplace_back(gq_1d_vec[(sym2__ - 1)][(sym1__ - 1)]);}} + vars__.emplace_back(gq_1d_vec[(sym2__ - 1)][(sym1__ - 1)]); + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { for (int sym2__ = 1; sym2__ <= K; ++sym2__) { for (int sym3__ = 1; sym3__ <= M; ++sym3__) { for (int sym4__ = 1; sym4__ <= N; ++sym4__) { vars__.emplace_back( gq_3d_vec[(sym4__ - 1)][(sym3__ - 1)][(sym2__ - 1)][(sym1__ - - 1)]);}}}} + 1)]); + } + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { - vars__.emplace_back(gq_row_vec[(sym1__ - 1)]);} + vars__.emplace_back(gq_row_vec[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { - vars__.emplace_back(gq_1d_row_vec[(sym2__ - 1)][(sym1__ - 1)]);}} + vars__.emplace_back(gq_1d_row_vec[(sym2__ - 1)][(sym1__ - 1)]); + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { for (int sym2__ = 1; sym2__ <= K; ++sym2__) { for (int sym3__ = 1; sym3__ <= M; ++sym3__) { for (int sym4__ = 1; sym4__ <= N; ++sym4__) { vars__.emplace_back( gq_3d_row_vec[(sym4__ - 1)][(sym3__ - 1)][(sym2__ - 1)][ - (sym1__ - 1)]);}}}} + (sym1__ - 1)]); + } + } + } + } for (int sym1__ = 1; sym1__ <= 3; ++sym1__) { for (int sym2__ = 1; sym2__ <= 2; ++sym2__) { for (int sym3__ = 1; sym3__ <= 5; ++sym3__) { @@ -8116,85 +8431,129 @@ class mother_model final : public model_base_crtp { vars__.emplace_back( rvalue(gq_ar_mat, "gq_ar_mat", index_uni(sym4__), index_uni(sym3__), index_uni(sym2__), - index_uni(sym1__)));}}}} + index_uni(sym1__))); + } + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { - vars__.emplace_back(gq_simplex[(sym1__ - 1)]);} + vars__.emplace_back(gq_simplex[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { - vars__.emplace_back(gq_1d_simplex[(sym2__ - 1)][(sym1__ - 1)]);}} + vars__.emplace_back(gq_1d_simplex[(sym2__ - 1)][(sym1__ - 1)]); + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { for (int sym2__ = 1; sym2__ <= K; ++sym2__) { for (int sym3__ = 1; sym3__ <= M; ++sym3__) { for (int sym4__ = 1; sym4__ <= N; ++sym4__) { vars__.emplace_back( gq_3d_simplex[(sym4__ - 1)][(sym3__ - 1)][(sym2__ - 1)][ - (sym1__ - 1)]);}}}} + (sym1__ - 1)]); + } + } + } + } for (int sym1__ = 1; sym1__ <= 4; ++sym1__) { for (int sym2__ = 1; sym2__ <= 5; ++sym2__) { vars__.emplace_back( rvalue(gq_cfcov_54, "gq_cfcov_54", - index_uni(sym2__), index_uni(sym1__)));}} + index_uni(sym2__), index_uni(sym1__))); + } + } for (int sym1__ = 1; sym1__ <= 3; ++sym1__) { for (int sym2__ = 1; sym2__ <= 3; ++sym2__) { vars__.emplace_back( rvalue(gq_cfcov_33, "gq_cfcov_33", - index_uni(sym2__), index_uni(sym1__)));}} + index_uni(sym2__), index_uni(sym1__))); + } + } for (int sym1__ = 1; sym1__ <= 3; ++sym1__) { for (int sym2__ = 1; sym2__ <= 3; ++sym2__) { for (int sym3__ = 1; sym3__ <= K; ++sym3__) { vars__.emplace_back( rvalue(gq_cfcov_33_ar, "gq_cfcov_33_ar", - index_uni(sym3__), index_uni(sym2__), index_uni(sym1__)));}}} + index_uni(sym3__), index_uni(sym2__), index_uni(sym1__))); + } + } + } for (int sym1__ = 1; sym1__ <= 3; ++sym1__) { - vars__.emplace_back(indices[(sym1__ - 1)]);} + vars__.emplace_back(indices[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= 4; ++sym1__) { for (int sym2__ = 1; sym2__ <= 3; ++sym2__) { for (int sym3__ = 1; sym3__ <= 5; ++sym3__) { vars__.emplace_back( rvalue(indexing_mat, "indexing_mat", - index_uni(sym3__), index_uni(sym2__), index_uni(sym1__)));}}} + index_uni(sym3__), index_uni(sym2__), index_uni(sym1__))); + } + } + } for (int sym1__ = 1; sym1__ <= 4; ++sym1__) { for (int sym2__ = 1; sym2__ <= 3; ++sym2__) { for (int sym3__ = 1; sym3__ <= 3; ++sym3__) { vars__.emplace_back( rvalue(idx_res1, "idx_res1", - index_uni(sym3__), index_uni(sym2__), index_uni(sym1__)));}}} + index_uni(sym3__), index_uni(sym2__), index_uni(sym1__))); + } + } + } for (int sym1__ = 1; sym1__ <= 4; ++sym1__) { for (int sym2__ = 1; sym2__ <= 3; ++sym2__) { for (int sym3__ = 1; sym3__ <= 5; ++sym3__) { vars__.emplace_back( rvalue(idx_res2, "idx_res2", - index_uni(sym3__), index_uni(sym2__), index_uni(sym1__)));}}} + index_uni(sym3__), index_uni(sym2__), index_uni(sym1__))); + } + } + } for (int sym1__ = 1; sym1__ <= 3; ++sym1__) { for (int sym2__ = 1; sym2__ <= 3; ++sym2__) { for (int sym3__ = 1; sym3__ <= 3; ++sym3__) { vars__.emplace_back( rvalue(idx_res3, "idx_res3", - index_uni(sym3__), index_uni(sym2__), index_uni(sym1__)));}}} + index_uni(sym3__), index_uni(sym2__), index_uni(sym1__))); + } + } + } for (int sym1__ = 1; sym1__ <= 4; ++sym1__) { for (int sym2__ = 1; sym2__ <= 3; ++sym2__) { for (int sym3__ = 1; sym3__ <= 3; ++sym3__) { vars__.emplace_back( rvalue(idx_res11, "idx_res11", - index_uni(sym3__), index_uni(sym2__), index_uni(sym1__)));}}} + index_uni(sym3__), index_uni(sym2__), index_uni(sym1__))); + } + } + } for (int sym1__ = 1; sym1__ <= 4; ++sym1__) { for (int sym2__ = 1; sym2__ <= 3; ++sym2__) { for (int sym3__ = 1; sym3__ <= 5; ++sym3__) { vars__.emplace_back( rvalue(idx_res21, "idx_res21", - index_uni(sym3__), index_uni(sym2__), index_uni(sym1__)));}}} + index_uni(sym3__), index_uni(sym2__), index_uni(sym1__))); + } + } + } for (int sym1__ = 1; sym1__ <= 3; ++sym1__) { for (int sym2__ = 1; sym2__ <= 3; ++sym2__) { for (int sym3__ = 1; sym3__ <= 3; ++sym3__) { vars__.emplace_back( rvalue(idx_res31, "idx_res31", - index_uni(sym3__), index_uni(sym2__), index_uni(sym1__)));}}} + index_uni(sym3__), index_uni(sym2__), index_uni(sym1__))); + } + } + } for (int sym1__ = 1; sym1__ <= 4; ++sym1__) { for (int sym2__ = 1; sym2__ <= 3; ++sym2__) { - vars__.emplace_back(idx_res4[(sym2__ - 1)][(sym1__ - 1)]);}} + vars__.emplace_back(idx_res4[(sym2__ - 1)][(sym1__ - 1)]); + } + } for (int sym1__ = 1; sym1__ <= 2; ++sym1__) { for (int sym2__ = 1; sym2__ <= 2; ++sym2__) { - vars__.emplace_back(idx_res5[(sym2__ - 1)][(sym1__ - 1)]);}} + vars__.emplace_back(idx_res5[(sym2__ - 1)][(sym1__ - 1)]); + } + } } catch (const std::exception& e) { stan::lang::rethrow_located(e, locations_array__[current_statement__]); // Next line prevents compiler griping about no return @@ -8215,41 +8574,43 @@ class mother_model final : public model_base_crtp { try { int pos__; - pos__ = std::numeric_limits::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; double p_real; - p_real = std::numeric_limits::quiet_NaN(); + p_real = std::numeric_limits::quiet_NaN(); current_statement__ = 1; p_real = context__.vals_r("p_real")[(1 - 1)]; double p_upper; - p_upper = std::numeric_limits::quiet_NaN(); + p_upper = std::numeric_limits::quiet_NaN(); current_statement__ = 2; p_upper = context__.vals_r("p_upper")[(1 - 1)]; double p_upper_free__; - p_upper_free__ = std::numeric_limits::quiet_NaN(); + p_upper_free__ = std::numeric_limits::quiet_NaN(); current_statement__ = 2; p_upper_free__ = stan::math::lb_free(p_upper, p_real); double p_lower; - p_lower = std::numeric_limits::quiet_NaN(); + p_lower = std::numeric_limits::quiet_NaN(); current_statement__ = 3; p_lower = context__.vals_r("p_lower")[(1 - 1)]; double p_lower_free__; - p_lower_free__ = std::numeric_limits::quiet_NaN(); + p_lower_free__ = std::numeric_limits::quiet_NaN(); current_statement__ = 3; p_lower_free__ = stan::math::ub_free(p_lower, p_upper); std::vector offset_multiplier; offset_multiplier = std::vector(5, std::numeric_limits::quiet_NaN()); + current_statement__ = 4; offset_multiplier = context__.vals_r("offset_multiplier"); std::vector offset_multiplier_free__; offset_multiplier_free__ = std::vector(5, std::numeric_limits::quiet_NaN()); + current_statement__ = 4; for (int sym1__ = 1; sym1__ <= 5; ++sym1__) { @@ -8257,14 +8618,17 @@ class mother_model final : public model_base_crtp { assign(offset_multiplier_free__, stan::math::offset_multiplier_free(offset_multiplier[(sym1__ - 1)], 1, 2), - "assigning variable offset_multiplier_free__", index_uni(sym1__));} + "assigning variable offset_multiplier_free__", index_uni(sym1__)); + } std::vector no_offset_multiplier; no_offset_multiplier = std::vector(5, std::numeric_limits::quiet_NaN()); + current_statement__ = 5; no_offset_multiplier = context__.vals_r("no_offset_multiplier"); std::vector no_offset_multiplier_free__; no_offset_multiplier_free__ = std::vector(5, std::numeric_limits::quiet_NaN()); + current_statement__ = 5; for (int sym1__ = 1; sym1__ <= 5; ++sym1__) { @@ -8276,11 +8640,13 @@ class mother_model final : public model_base_crtp { } std::vector offset_no_multiplier; offset_no_multiplier = std::vector(5, std::numeric_limits::quiet_NaN()); + current_statement__ = 6; offset_no_multiplier = context__.vals_r("offset_no_multiplier"); std::vector offset_no_multiplier_free__; offset_no_multiplier_free__ = std::vector(5, std::numeric_limits::quiet_NaN()); + current_statement__ = 6; for (int sym1__ = 1; sym1__ <= 5; ++sym1__) { @@ -8292,20 +8658,24 @@ class mother_model final : public model_base_crtp { } std::vector p_real_1d_ar; p_real_1d_ar = std::vector(N, std::numeric_limits::quiet_NaN()); + current_statement__ = 7; p_real_1d_ar = context__.vals_r("p_real_1d_ar"); std::vector p_real_1d_ar_free__; p_real_1d_ar_free__ = std::vector(N, std::numeric_limits::quiet_NaN()); + current_statement__ = 7; for (int sym1__ = 1; sym1__ <= N; ++sym1__) { current_statement__ = 7; assign(p_real_1d_ar_free__, stan::math::lb_free(p_real_1d_ar[(sym1__ - 1)], 0), - "assigning variable p_real_1d_ar_free__", index_uni(sym1__));} + "assigning variable p_real_1d_ar_free__", index_uni(sym1__)); + } std::vector>> p_real_3d_ar; p_real_3d_ar = std::vector>>(N, std::vector>(M, std::vector(K, std::numeric_limits::quiet_NaN()))); + { std::vector p_real_3d_ar_flat__; @@ -8325,10 +8695,14 @@ class mother_model final : public model_base_crtp { index_uni(sym2__), index_uni(sym1__)); current_statement__ = 8; - pos__ = (pos__ + 1);}}} + pos__ = (pos__ + 1); + } + } + } } std::vector>> p_real_3d_ar_free__; p_real_3d_ar_free__ = std::vector>>(N, std::vector>(M, std::vector(K, std::numeric_limits::quiet_NaN()))); + current_statement__ = 8; for (int sym1__ = 1; sym1__ <= N; ++sym1__) { @@ -8343,10 +8717,12 @@ class mother_model final : public model_base_crtp { "assigning variable p_real_3d_ar_free__", index_uni(sym1__), index_uni(sym2__), index_uni(sym3__)); - }}} + } + } + } Eigen::Matrix p_vec; p_vec = Eigen::Matrix(N); - stan::math::fill(p_vec, std::numeric_limits::quiet_NaN()); + stan::math::fill(p_vec, std::numeric_limits::quiet_NaN()); { std::vector p_vec_flat__; @@ -8360,20 +8736,22 @@ class mother_model final : public model_base_crtp { assign(p_vec, p_vec_flat__[(pos__ - 1)], "assigning variable p_vec", index_uni(sym1__)); current_statement__ = 9; - pos__ = (pos__ + 1);} + pos__ = (pos__ + 1); + } } Eigen::Matrix p_vec_free__; p_vec_free__ = Eigen::Matrix(N); - stan::math::fill(p_vec_free__, std::numeric_limits::quiet_NaN()); + stan::math::fill(p_vec_free__, std::numeric_limits::quiet_NaN()); current_statement__ = 9; for (int sym1__ = 1; sym1__ <= N; ++sym1__) { current_statement__ = 9; assign(p_vec_free__, stan::math::lb_free(p_vec[(sym1__ - 1)], 0), - "assigning variable p_vec_free__", index_uni(sym1__));} + "assigning variable p_vec_free__", index_uni(sym1__)); + } std::vector> p_1d_vec; p_1d_vec = std::vector>(N, Eigen::Matrix(N)); - stan::math::fill(p_1d_vec, std::numeric_limits::quiet_NaN()); + stan::math::fill(p_1d_vec, std::numeric_limits::quiet_NaN()); { std::vector p_1d_vec_flat__; @@ -8390,11 +8768,13 @@ class mother_model final : public model_base_crtp { "assigning variable p_1d_vec", index_uni(sym2__), index_uni(sym1__)); current_statement__ = 10; - pos__ = (pos__ + 1);}} + pos__ = (pos__ + 1); + } + } } std::vector>>> p_3d_vec; p_3d_vec = std::vector>>>(N, std::vector>>(M, std::vector>(K, Eigen::Matrix(N)))); - stan::math::fill(p_3d_vec, std::numeric_limits::quiet_NaN()); + stan::math::fill(p_3d_vec, std::numeric_limits::quiet_NaN()); { std::vector p_3d_vec_flat__; @@ -8417,11 +8797,15 @@ class mother_model final : public model_base_crtp { index_uni(sym2__), index_uni(sym1__)); current_statement__ = 11; - pos__ = (pos__ + 1);}}}} + pos__ = (pos__ + 1); + } + } + } + } } Eigen::Matrix p_row_vec; p_row_vec = Eigen::Matrix(N); - stan::math::fill(p_row_vec, std::numeric_limits::quiet_NaN()); + stan::math::fill(p_row_vec, std::numeric_limits::quiet_NaN()); { std::vector p_row_vec_flat__; @@ -8435,11 +8819,12 @@ class mother_model final : public model_base_crtp { assign(p_row_vec, p_row_vec_flat__[(pos__ - 1)], "assigning variable p_row_vec", index_uni(sym1__)); current_statement__ = 12; - pos__ = (pos__ + 1);} + pos__ = (pos__ + 1); + } } std::vector> p_1d_row_vec; p_1d_row_vec = std::vector>(N, Eigen::Matrix(N)); - stan::math::fill(p_1d_row_vec, std::numeric_limits::quiet_NaN()); + stan::math::fill(p_1d_row_vec, std::numeric_limits::quiet_NaN()); { std::vector p_1d_row_vec_flat__; @@ -8456,11 +8841,13 @@ class mother_model final : public model_base_crtp { "assigning variable p_1d_row_vec", index_uni(sym2__), index_uni(sym1__)); current_statement__ = 13; - pos__ = (pos__ + 1);}} + pos__ = (pos__ + 1); + } + } } std::vector>>> p_3d_row_vec; p_3d_row_vec = std::vector>>>(N, std::vector>>(M, std::vector>(K, Eigen::Matrix(N)))); - stan::math::fill(p_3d_row_vec, std::numeric_limits::quiet_NaN()); + stan::math::fill(p_3d_row_vec, std::numeric_limits::quiet_NaN()); { std::vector p_3d_row_vec_flat__; @@ -8483,11 +8870,15 @@ class mother_model final : public model_base_crtp { index_uni(sym2__), index_uni(sym1__)); current_statement__ = 14; - pos__ = (pos__ + 1);}}}} + pos__ = (pos__ + 1); + } + } + } + } } std::vector>> p_ar_mat; p_ar_mat = std::vector>>(4, std::vector>(5, Eigen::Matrix(2, 3))); - stan::math::fill(p_ar_mat, std::numeric_limits::quiet_NaN()); + stan::math::fill(p_ar_mat, std::numeric_limits::quiet_NaN()); { std::vector p_ar_mat_flat__; @@ -8510,11 +8901,15 @@ class mother_model final : public model_base_crtp { index_uni(sym2__), index_uni(sym1__)); current_statement__ = 15; - pos__ = (pos__ + 1);}}}} + pos__ = (pos__ + 1); + } + } + } + } } std::vector>> p_ar_mat_free__; p_ar_mat_free__ = std::vector>>(4, std::vector>(5, Eigen::Matrix(2, 3))); - stan::math::fill(p_ar_mat_free__, std::numeric_limits::quiet_NaN()); + stan::math::fill(p_ar_mat_free__, std::numeric_limits::quiet_NaN()); current_statement__ = 15; for (int sym1__ = 1; sym1__ <= 4; ++sym1__) { @@ -8533,11 +8928,14 @@ class mother_model final : public model_base_crtp { "assigning variable p_ar_mat_free__", index_uni(sym1__), index_uni(sym2__), index_uni(sym3__), - index_uni(sym4__));}} - }} + index_uni(sym4__)); + } + } + } + } Eigen::Matrix p_simplex; p_simplex = Eigen::Matrix(N); - stan::math::fill(p_simplex, std::numeric_limits::quiet_NaN()); + stan::math::fill(p_simplex, std::numeric_limits::quiet_NaN()); { std::vector p_simplex_flat__; @@ -8551,18 +8949,19 @@ class mother_model final : public model_base_crtp { assign(p_simplex, p_simplex_flat__[(pos__ - 1)], "assigning variable p_simplex", index_uni(sym1__)); current_statement__ = 16; - pos__ = (pos__ + 1);} + pos__ = (pos__ + 1); + } } Eigen::Matrix p_simplex_free__; p_simplex_free__ = Eigen::Matrix((N - 1)); - stan::math::fill(p_simplex_free__, std::numeric_limits::quiet_NaN()); + stan::math::fill(p_simplex_free__, std::numeric_limits::quiet_NaN()); current_statement__ = 16; assign(p_simplex_free__, stan::math::simplex_free(p_simplex), "assigning variable p_simplex_free__"); std::vector> p_1d_simplex; p_1d_simplex = std::vector>(N, Eigen::Matrix(N)); - stan::math::fill(p_1d_simplex, std::numeric_limits::quiet_NaN()); + stan::math::fill(p_1d_simplex, std::numeric_limits::quiet_NaN()); { std::vector p_1d_simplex_flat__; @@ -8579,22 +8978,25 @@ class mother_model final : public model_base_crtp { "assigning variable p_1d_simplex", index_uni(sym2__), index_uni(sym1__)); current_statement__ = 17; - pos__ = (pos__ + 1);}} + pos__ = (pos__ + 1); + } + } } std::vector> p_1d_simplex_free__; p_1d_simplex_free__ = std::vector>(N, Eigen::Matrix( - (N - 1))); - stan::math::fill(p_1d_simplex_free__, std::numeric_limits::quiet_NaN()); + (N - 1))); + stan::math::fill(p_1d_simplex_free__, std::numeric_limits::quiet_NaN()); current_statement__ = 17; for (int sym1__ = 1; sym1__ <= N; ++sym1__) { current_statement__ = 17; assign(p_1d_simplex_free__, stan::math::simplex_free(p_1d_simplex[(sym1__ - 1)]), - "assigning variable p_1d_simplex_free__", index_uni(sym1__));} + "assigning variable p_1d_simplex_free__", index_uni(sym1__)); + } std::vector>>> p_3d_simplex; p_3d_simplex = std::vector>>>(N, std::vector>>(M, std::vector>(K, Eigen::Matrix(N)))); - stan::math::fill(p_3d_simplex, std::numeric_limits::quiet_NaN()); + stan::math::fill(p_3d_simplex, std::numeric_limits::quiet_NaN()); { std::vector p_3d_simplex_flat__; @@ -8617,12 +9019,16 @@ class mother_model final : public model_base_crtp { index_uni(sym2__), index_uni(sym1__)); current_statement__ = 18; - pos__ = (pos__ + 1);}}}} + pos__ = (pos__ + 1); + } + } + } + } } std::vector>>> p_3d_simplex_free__; p_3d_simplex_free__ = std::vector>>>(N, std::vector>>(M, std::vector>(K, Eigen::Matrix( - (N - 1))))); - stan::math::fill(p_3d_simplex_free__, std::numeric_limits::quiet_NaN()); + (N - 1))))); + stan::math::fill(p_3d_simplex_free__, std::numeric_limits::quiet_NaN()); current_statement__ = 18; for (int sym1__ = 1; sym1__ <= N; ++sym1__) { @@ -8637,10 +9043,12 @@ class mother_model final : public model_base_crtp { "assigning variable p_3d_simplex_free__", index_uni(sym1__), index_uni(sym2__), index_uni(sym3__)); - }}} + } + } + } Eigen::Matrix p_cfcov_54; p_cfcov_54 = Eigen::Matrix(5, 4); - stan::math::fill(p_cfcov_54, std::numeric_limits::quiet_NaN()); + stan::math::fill(p_cfcov_54, std::numeric_limits::quiet_NaN()); { std::vector p_cfcov_54_flat__; @@ -8657,20 +9065,22 @@ class mother_model final : public model_base_crtp { "assigning variable p_cfcov_54", index_uni(sym2__), index_uni(sym1__)); current_statement__ = 19; - pos__ = (pos__ + 1);}} + pos__ = (pos__ + 1); + } + } } Eigen::Matrix p_cfcov_54_free__; p_cfcov_54_free__ = Eigen::Matrix(((((4 * (4 - 1)) / 2) + 4) + ((5 - 4) * 4))); - stan::math::fill(p_cfcov_54_free__, std::numeric_limits::quiet_NaN()); + stan::math::fill(p_cfcov_54_free__, std::numeric_limits::quiet_NaN()); current_statement__ = 19; assign(p_cfcov_54_free__, stan::math::cholesky_factor_free(p_cfcov_54), "assigning variable p_cfcov_54_free__"); Eigen::Matrix p_cfcov_33; p_cfcov_33 = Eigen::Matrix(3, 3); - stan::math::fill(p_cfcov_33, std::numeric_limits::quiet_NaN()); + stan::math::fill(p_cfcov_33, std::numeric_limits::quiet_NaN()); { std::vector p_cfcov_33_flat__; @@ -8687,20 +9097,22 @@ class mother_model final : public model_base_crtp { "assigning variable p_cfcov_33", index_uni(sym2__), index_uni(sym1__)); current_statement__ = 20; - pos__ = (pos__ + 1);}} + pos__ = (pos__ + 1); + } + } } Eigen::Matrix p_cfcov_33_free__; p_cfcov_33_free__ = Eigen::Matrix(((((3 * (3 - 1)) / 2) + 3) + ((3 - 3) * 3))); - stan::math::fill(p_cfcov_33_free__, std::numeric_limits::quiet_NaN()); + stan::math::fill(p_cfcov_33_free__, std::numeric_limits::quiet_NaN()); current_statement__ = 20; assign(p_cfcov_33_free__, stan::math::cholesky_factor_free(p_cfcov_33), "assigning variable p_cfcov_33_free__"); std::vector> p_cfcov_33_ar; p_cfcov_33_ar = std::vector>(K, Eigen::Matrix(3, 3)); - stan::math::fill(p_cfcov_33_ar, std::numeric_limits::quiet_NaN()); + stan::math::fill(p_cfcov_33_ar, std::numeric_limits::quiet_NaN()); { std::vector p_cfcov_33_ar_flat__; @@ -8720,22 +9132,26 @@ class mother_model final : public model_base_crtp { index_uni(sym2__), index_uni(sym1__)); current_statement__ = 21; - pos__ = (pos__ + 1);}}} + pos__ = (pos__ + 1); + } + } + } } std::vector> p_cfcov_33_ar_free__; p_cfcov_33_ar_free__ = std::vector>(K, Eigen::Matrix( - ((((3 * (3 - 1)) / 2) + 3) + ((3 - 3) * 3)))); - stan::math::fill(p_cfcov_33_ar_free__, std::numeric_limits::quiet_NaN()); + ((((3 * (3 - 1)) / 2) + 3) + ((3 - 3) * 3)))); + stan::math::fill(p_cfcov_33_ar_free__, std::numeric_limits::quiet_NaN()); current_statement__ = 21; for (int sym1__ = 1; sym1__ <= K; ++sym1__) { current_statement__ = 21; assign(p_cfcov_33_ar_free__, stan::math::cholesky_factor_free(p_cfcov_33_ar[(sym1__ - 1)]), - "assigning variable p_cfcov_33_ar_free__", index_uni(sym1__));} + "assigning variable p_cfcov_33_ar_free__", index_uni(sym1__)); + } Eigen::Matrix x_p; x_p = Eigen::Matrix(2); - stan::math::fill(x_p, std::numeric_limits::quiet_NaN()); + stan::math::fill(x_p, std::numeric_limits::quiet_NaN()); { std::vector x_p_flat__; @@ -8749,11 +9165,12 @@ class mother_model final : public model_base_crtp { assign(x_p, x_p_flat__[(pos__ - 1)], "assigning variable x_p", index_uni(sym1__)); current_statement__ = 22; - pos__ = (pos__ + 1);} + pos__ = (pos__ + 1); + } } Eigen::Matrix y_p; y_p = Eigen::Matrix(2); - stan::math::fill(y_p, std::numeric_limits::quiet_NaN()); + stan::math::fill(y_p, std::numeric_limits::quiet_NaN()); { std::vector y_p_flat__; @@ -8767,49 +9184,70 @@ class mother_model final : public model_base_crtp { assign(y_p, y_p_flat__[(pos__ - 1)], "assigning variable y_p", index_uni(sym1__)); current_statement__ = 23; - pos__ = (pos__ + 1);} + pos__ = (pos__ + 1); + } } vars__.emplace_back(p_real); vars__.emplace_back(p_upper_free__); vars__.emplace_back(p_lower_free__); for (int sym1__ = 1; sym1__ <= 5; ++sym1__) { - vars__.emplace_back(offset_multiplier_free__[(sym1__ - 1)]);} + vars__.emplace_back(offset_multiplier_free__[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= 5; ++sym1__) { - vars__.emplace_back(no_offset_multiplier_free__[(sym1__ - 1)]);} + vars__.emplace_back(no_offset_multiplier_free__[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= 5; ++sym1__) { - vars__.emplace_back(offset_no_multiplier_free__[(sym1__ - 1)]);} + vars__.emplace_back(offset_no_multiplier_free__[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { - vars__.emplace_back(p_real_1d_ar_free__[(sym1__ - 1)]);} + vars__.emplace_back(p_real_1d_ar_free__[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { for (int sym2__ = 1; sym2__ <= M; ++sym2__) { for (int sym3__ = 1; sym3__ <= K; ++sym3__) { vars__.emplace_back( p_real_3d_ar_free__[(sym1__ - 1)][(sym2__ - 1)][(sym3__ - 1)]); - }}} + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { - vars__.emplace_back(p_vec_free__[(sym1__ - 1)]);} + vars__.emplace_back(p_vec_free__[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { - vars__.emplace_back(p_1d_vec[(sym1__ - 1)][(sym2__ - 1)]);}} + vars__.emplace_back(p_1d_vec[(sym1__ - 1)][(sym2__ - 1)]); + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { for (int sym2__ = 1; sym2__ <= M; ++sym2__) { for (int sym3__ = 1; sym3__ <= K; ++sym3__) { for (int sym4__ = 1; sym4__ <= N; ++sym4__) { vars__.emplace_back( p_3d_vec[(sym1__ - 1)][(sym2__ - 1)][(sym3__ - 1)][(sym4__ - - 1)]);}}}} + 1)]); + } + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { - vars__.emplace_back(p_row_vec[(sym1__ - 1)]);} + vars__.emplace_back(p_row_vec[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { - vars__.emplace_back(p_1d_row_vec[(sym1__ - 1)][(sym2__ - 1)]);}} + vars__.emplace_back(p_1d_row_vec[(sym1__ - 1)][(sym2__ - 1)]); + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { for (int sym2__ = 1; sym2__ <= M; ++sym2__) { for (int sym3__ = 1; sym3__ <= K; ++sym3__) { for (int sym4__ = 1; sym4__ <= N; ++sym4__) { vars__.emplace_back( p_3d_row_vec[(sym1__ - 1)][(sym2__ - 1)][(sym3__ - 1)][ - (sym4__ - 1)]);}}}} + (sym4__ - 1)]); + } + } + } + } for (int sym1__ = 1; sym1__ <= 4; ++sym1__) { for (int sym2__ = 1; sym2__ <= 5; ++sym2__) { for (int sym3__ = 1; sym3__ <= 3; ++sym3__) { @@ -8817,35 +9255,52 @@ class mother_model final : public model_base_crtp { vars__.emplace_back( rvalue(p_ar_mat_free__, "p_ar_mat_free__", index_uni(sym1__), index_uni(sym2__), index_uni(sym4__), - index_uni(sym3__)));}}}} + index_uni(sym3__))); + } + } + } + } for (int sym1__ = 1; sym1__ <= (N - 1); ++sym1__) { - vars__.emplace_back(p_simplex_free__[(sym1__ - 1)]);} + vars__.emplace_back(p_simplex_free__[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { for (int sym2__ = 1; sym2__ <= (N - 1); ++sym2__) { vars__.emplace_back( - p_1d_simplex_free__[(sym1__ - 1)][(sym2__ - 1)]);}} + p_1d_simplex_free__[(sym1__ - 1)][(sym2__ - 1)]); + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { for (int sym2__ = 1; sym2__ <= M; ++sym2__) { for (int sym3__ = 1; sym3__ <= K; ++sym3__) { for (int sym4__ = 1; sym4__ <= (N - 1); ++sym4__) { vars__.emplace_back( p_3d_simplex_free__[(sym1__ - 1)][(sym2__ - 1)][(sym3__ - 1)][ - (sym4__ - 1)]);}}}} + (sym4__ - 1)]); + } + } + } + } for (int sym1__ = 1; sym1__ <= ((((4 * (4 - 1)) / 2) + 4) + ((5 - 4) * 4)); ++sym1__) { - vars__.emplace_back(p_cfcov_54_free__[(sym1__ - 1)]);} + vars__.emplace_back(p_cfcov_54_free__[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= ((((3 * (3 - 1)) / 2) + 3) + ((3 - 3) * 3)); ++sym1__) { - vars__.emplace_back(p_cfcov_33_free__[(sym1__ - 1)]);} + vars__.emplace_back(p_cfcov_33_free__[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= K; ++sym1__) { for (int sym2__ = 1; sym2__ <= ((((3 * (3 - 1)) / 2) + 3) + ((3 - 3) * 3)); ++sym2__) { vars__.emplace_back( - p_cfcov_33_ar_free__[(sym1__ - 1)][(sym2__ - 1)]);}} + p_cfcov_33_ar_free__[(sym1__ - 1)][(sym2__ - 1)]); + } + } for (int sym1__ = 1; sym1__ <= 2; ++sym1__) { - vars__.emplace_back(x_p[(sym1__ - 1)]);} + vars__.emplace_back(x_p[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= 2; ++sym1__) { - vars__.emplace_back(y_p[(sym1__ - 1)]);} + vars__.emplace_back(y_p[(sym1__ - 1)]); + } } catch (const std::exception& e) { stan::lang::rethrow_located(e, locations_array__[current_statement__]); // Next line prevents compiler griping about no return @@ -8855,169 +9310,117 @@ class mother_model final : public model_base_crtp { inline void get_param_names(std::vector& names__) const { - names__ = std::vector{"p_real", - "p_upper", - "p_lower", - "offset_multiplier", - "no_offset_multiplier", - "offset_no_multiplier", - "p_real_1d_ar", - "p_real_3d_ar", - "p_vec", - "p_1d_vec", - "p_3d_vec", - "p_row_vec", - "p_1d_row_vec", - "p_3d_row_vec", - "p_ar_mat", - "p_simplex", - "p_1d_simplex", - "p_3d_simplex", - "p_cfcov_54", - "p_cfcov_33", - "p_cfcov_33_ar", - "x_p", - "y_p", - "tp_real_1d_ar", - "tp_real_3d_ar", - "tp_vec", - "tp_1d_vec", - "tp_3d_vec", - "tp_row_vec", - "tp_1d_row_vec", - "tp_3d_row_vec", - "tp_ar_mat", - "tp_simplex", - "tp_1d_simplex", - "tp_3d_simplex", - "tp_cfcov_54", - "tp_cfcov_33", - "tp_cfcov_33_ar", - "theta_p", - "tp_real", - "gq_r1", - "gq_r2", - "gq_real_1d_ar", - "gq_real_3d_ar", - "gq_vec", - "gq_1d_vec", - "gq_3d_vec", - "gq_row_vec", - "gq_1d_row_vec", - "gq_3d_row_vec", - "gq_ar_mat", - "gq_simplex", - "gq_1d_simplex", - "gq_3d_simplex", - "gq_cfcov_54", - "gq_cfcov_33", - "gq_cfcov_33_ar", - "indices", - "indexing_mat", - "idx_res1", - "idx_res2", - "idx_res3", - "idx_res11", - "idx_res21", - "idx_res31", - "idx_res4", - "idx_res5"}; + names__ = std::vector{"p_real", "p_upper", "p_lower", + "offset_multiplier", "no_offset_multiplier", "offset_no_multiplier", + "p_real_1d_ar", "p_real_3d_ar", "p_vec", "p_1d_vec", "p_3d_vec", + "p_row_vec", "p_1d_row_vec", "p_3d_row_vec", "p_ar_mat", "p_simplex", + "p_1d_simplex", "p_3d_simplex", "p_cfcov_54", "p_cfcov_33", + "p_cfcov_33_ar", "x_p", "y_p", "tp_real_1d_ar", "tp_real_3d_ar", + "tp_vec", "tp_1d_vec", "tp_3d_vec", "tp_row_vec", "tp_1d_row_vec", + "tp_3d_row_vec", "tp_ar_mat", "tp_simplex", "tp_1d_simplex", + "tp_3d_simplex", "tp_cfcov_54", "tp_cfcov_33", "tp_cfcov_33_ar", + "theta_p", "tp_real", "gq_r1", "gq_r2", "gq_real_1d_ar", + "gq_real_3d_ar", "gq_vec", "gq_1d_vec", "gq_3d_vec", "gq_row_vec", + "gq_1d_row_vec", "gq_3d_row_vec", "gq_ar_mat", "gq_simplex", + "gq_1d_simplex", "gq_3d_simplex", "gq_cfcov_54", "gq_cfcov_33", + "gq_cfcov_33_ar", "indices", "indexing_mat", "idx_res1", "idx_res2", + "idx_res3", "idx_res11", "idx_res21", "idx_res31", "idx_res4", + "idx_res5"}; + } // get_param_names() inline void get_dims(std::vector>& dimss__) const { dimss__ = std::vector>{std::vector{}, - std::vector{}, - std::vector{}, - std::vector{static_cast(5)}, - std::vector{static_cast(5)}, - std::vector{static_cast(5)}, - std::vector{static_cast(N)}, - std::vector{static_cast(N), static_cast(M), - static_cast(K)}, - std::vector{static_cast(N)}, - std::vector{static_cast(N), static_cast(N)}, - std::vector{static_cast(N), static_cast(M), - static_cast(K), static_cast(N)}, - std::vector{static_cast(N)}, - std::vector{static_cast(N), static_cast(N)}, - std::vector{static_cast(N), static_cast(M), - static_cast(K), static_cast(N)}, - std::vector{static_cast(4), static_cast(5), - static_cast(2), static_cast(3)}, - std::vector{static_cast(N)}, - std::vector{static_cast(N), static_cast(N)}, - std::vector{static_cast(N), static_cast(M), - static_cast(K), static_cast(N)}, - std::vector{static_cast(5), static_cast(4)}, - std::vector{static_cast(3), static_cast(3)}, - std::vector{static_cast(K), static_cast(3), - static_cast(3)}, - std::vector{static_cast(2)}, - std::vector{static_cast(2)}, - std::vector{static_cast(N)}, - std::vector{static_cast(N), static_cast(M), - static_cast(K)}, - std::vector{static_cast(N)}, - std::vector{static_cast(N), static_cast(N)}, - std::vector{static_cast(N), static_cast(M), - static_cast(K), static_cast(N)}, - std::vector{static_cast(N)}, - std::vector{static_cast(N), static_cast(N)}, - std::vector{static_cast(N), static_cast(M), - static_cast(K), static_cast(N)}, - std::vector{static_cast(4), static_cast(5), - static_cast(2), static_cast(3)}, - std::vector{static_cast(N)}, - std::vector{static_cast(N), static_cast(N)}, - std::vector{static_cast(N), static_cast(M), - static_cast(K), static_cast(N)}, - std::vector{static_cast(5), static_cast(4)}, - std::vector{static_cast(3), static_cast(3)}, - std::vector{static_cast(K), static_cast(3), - static_cast(3)}, - std::vector{static_cast(2)}, - std::vector{}, - std::vector{}, - std::vector{}, - std::vector{static_cast(N)}, - std::vector{static_cast(N), static_cast(M), - static_cast(K)}, - std::vector{static_cast(N)}, - std::vector{static_cast(N), static_cast(N)}, - std::vector{static_cast(N), static_cast(M), - static_cast(K), static_cast(N)}, - std::vector{static_cast(N)}, - std::vector{static_cast(N), static_cast(N)}, - std::vector{static_cast(N), static_cast(M), - static_cast(K), static_cast(N)}, - std::vector{static_cast(4), static_cast(5), - static_cast(2), static_cast(3)}, - std::vector{static_cast(N)}, - std::vector{static_cast(N), static_cast(N)}, - std::vector{static_cast(N), static_cast(M), - static_cast(K), static_cast(N)}, - std::vector{static_cast(5), static_cast(4)}, - std::vector{static_cast(3), static_cast(3)}, - std::vector{static_cast(K), static_cast(3), - static_cast(3)}, - std::vector{static_cast(3)}, - std::vector{static_cast(5), static_cast(3), - static_cast(4)}, - std::vector{static_cast(3), static_cast(3), - static_cast(4)}, - std::vector{static_cast(5), static_cast(3), - static_cast(4)}, - std::vector{static_cast(3), static_cast(3), - static_cast(3)}, - std::vector{static_cast(3), static_cast(3), - static_cast(4)}, - std::vector{static_cast(5), static_cast(3), - static_cast(4)}, - std::vector{static_cast(3), static_cast(3), - static_cast(3)}, - std::vector{static_cast(3), static_cast(4)}, - std::vector{static_cast(2), static_cast(2)}}; + std::vector{}, std::vector{}, + std::vector{static_cast(5)}, + std::vector{static_cast(5)}, + std::vector{static_cast(5)}, + std::vector{static_cast(N)}, + std::vector{static_cast(N), static_cast(M), + static_cast(K)}, + std::vector{static_cast(N)}, + std::vector{static_cast(N), static_cast(N)}, + std::vector{static_cast(N), static_cast(M), + static_cast(K), static_cast(N)}, + std::vector{static_cast(N)}, + std::vector{static_cast(N), static_cast(N)}, + std::vector{static_cast(N), static_cast(M), + static_cast(K), static_cast(N)}, + std::vector{static_cast(4), static_cast(5), + static_cast(2), static_cast(3)}, + std::vector{static_cast(N)}, + std::vector{static_cast(N), static_cast(N)}, + std::vector{static_cast(N), static_cast(M), + static_cast(K), static_cast(N)}, + std::vector{static_cast(5), static_cast(4)}, + std::vector{static_cast(3), static_cast(3)}, + std::vector{static_cast(K), static_cast(3), + static_cast(3)}, + std::vector{static_cast(2)}, + std::vector{static_cast(2)}, + std::vector{static_cast(N)}, + std::vector{static_cast(N), static_cast(M), + static_cast(K)}, + std::vector{static_cast(N)}, + std::vector{static_cast(N), static_cast(N)}, + std::vector{static_cast(N), static_cast(M), + static_cast(K), static_cast(N)}, + std::vector{static_cast(N)}, + std::vector{static_cast(N), static_cast(N)}, + std::vector{static_cast(N), static_cast(M), + static_cast(K), static_cast(N)}, + std::vector{static_cast(4), static_cast(5), + static_cast(2), static_cast(3)}, + std::vector{static_cast(N)}, + std::vector{static_cast(N), static_cast(N)}, + std::vector{static_cast(N), static_cast(M), + static_cast(K), static_cast(N)}, + std::vector{static_cast(5), static_cast(4)}, + std::vector{static_cast(3), static_cast(3)}, + std::vector{static_cast(K), static_cast(3), + static_cast(3)}, + std::vector{static_cast(2)}, std::vector{ + }, std::vector{}, std::vector{}, + std::vector{static_cast(N)}, + std::vector{static_cast(N), static_cast(M), + static_cast(K)}, + std::vector{static_cast(N)}, + std::vector{static_cast(N), static_cast(N)}, + std::vector{static_cast(N), static_cast(M), + static_cast(K), static_cast(N)}, + std::vector{static_cast(N)}, + std::vector{static_cast(N), static_cast(N)}, + std::vector{static_cast(N), static_cast(M), + static_cast(K), static_cast(N)}, + std::vector{static_cast(4), static_cast(5), + static_cast(2), static_cast(3)}, + std::vector{static_cast(N)}, + std::vector{static_cast(N), static_cast(N)}, + std::vector{static_cast(N), static_cast(M), + static_cast(K), static_cast(N)}, + std::vector{static_cast(5), static_cast(4)}, + std::vector{static_cast(3), static_cast(3)}, + std::vector{static_cast(K), static_cast(3), + static_cast(3)}, + std::vector{static_cast(3)}, + std::vector{static_cast(5), static_cast(3), + static_cast(4)}, + std::vector{static_cast(3), static_cast(3), + static_cast(4)}, + std::vector{static_cast(5), static_cast(3), + static_cast(4)}, + std::vector{static_cast(3), static_cast(3), + static_cast(3)}, + std::vector{static_cast(3), static_cast(3), + static_cast(4)}, + std::vector{static_cast(5), static_cast(3), + static_cast(4)}, + std::vector{static_cast(3), static_cast(3), + static_cast(3)}, + std::vector{static_cast(3), static_cast(4)}, + std::vector{static_cast(2), static_cast(2)}}; + } // get_dims() inline void constrained_param_names( @@ -9032,19 +9435,23 @@ class mother_model final : public model_base_crtp { for (int sym1__ = 1; sym1__ <= 5; ++sym1__) { { param_names__.emplace_back(std::string() + "offset_multiplier" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= 5; ++sym1__) { { param_names__.emplace_back(std::string() + "no_offset_multiplier" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= 5; ++sym1__) { { param_names__.emplace_back(std::string() + "offset_no_multiplier" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { param_names__.emplace_back(std::string() + "p_real_1d_ar" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= K; ++sym1__) { { for (int sym2__ = 1; sym2__ <= M; ++sym2__) { @@ -9052,20 +9459,26 @@ class mother_model final : public model_base_crtp { for (int sym3__ = 1; sym3__ <= N; ++sym3__) { { param_names__.emplace_back(std::string() + "p_real_3d_ar" + '.' + std::to_string(sym3__) + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} - }} + } + } + } + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { param_names__.emplace_back(std::string() + "p_vec" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { { param_names__.emplace_back(std::string() + "p_1d_vec" + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} + } + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { for (int sym2__ = 1; sym2__ <= K; ++sym2__) { @@ -9075,21 +9488,28 @@ class mother_model final : public model_base_crtp { for (int sym4__ = 1; sym4__ <= N; ++sym4__) { { param_names__.emplace_back(std::string() + "p_3d_vec" + '.' + std::to_string(sym4__) + '.' + std::to_string(sym3__) + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} - }} - }} + } + } + } + } + } + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { param_names__.emplace_back(std::string() + "p_row_vec" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { { param_names__.emplace_back(std::string() + "p_1d_row_vec" + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} + } + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { for (int sym2__ = 1; sym2__ <= K; ++sym2__) { @@ -9099,10 +9519,14 @@ class mother_model final : public model_base_crtp { for (int sym4__ = 1; sym4__ <= N; ++sym4__) { { param_names__.emplace_back(std::string() + "p_3d_row_vec" + '.' + std::to_string(sym4__) + '.' + std::to_string(sym3__) + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} - }} - }} + } + } + } + } + } + } + } + } for (int sym1__ = 1; sym1__ <= 3; ++sym1__) { { for (int sym2__ = 1; sym2__ <= 2; ++sym2__) { @@ -9112,21 +9536,28 @@ class mother_model final : public model_base_crtp { for (int sym4__ = 1; sym4__ <= 4; ++sym4__) { { param_names__.emplace_back(std::string() + "p_ar_mat" + '.' + std::to_string(sym4__) + '.' + std::to_string(sym3__) + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} - }} - }} + } + } + } + } + } + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { param_names__.emplace_back(std::string() + "p_simplex" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { { param_names__.emplace_back(std::string() + "p_1d_simplex" + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} + } + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { for (int sym2__ = 1; sym2__ <= K; ++sym2__) { @@ -9136,24 +9567,32 @@ class mother_model final : public model_base_crtp { for (int sym4__ = 1; sym4__ <= N; ++sym4__) { { param_names__.emplace_back(std::string() + "p_3d_simplex" + '.' + std::to_string(sym4__) + '.' + std::to_string(sym3__) + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} - }} - }} + } + } + } + } + } + } + } + } for (int sym1__ = 1; sym1__ <= 4; ++sym1__) { { for (int sym2__ = 1; sym2__ <= 5; ++sym2__) { { param_names__.emplace_back(std::string() + "p_cfcov_54" + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} + } + } + } + } for (int sym1__ = 1; sym1__ <= 3; ++sym1__) { { for (int sym2__ = 1; sym2__ <= 3; ++sym2__) { { param_names__.emplace_back(std::string() + "p_cfcov_33" + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} + } + } + } + } for (int sym1__ = 1; sym1__ <= 3; ++sym1__) { { for (int sym2__ = 1; sym2__ <= 3; ++sym2__) { @@ -9161,22 +9600,28 @@ class mother_model final : public model_base_crtp { for (int sym3__ = 1; sym3__ <= K; ++sym3__) { { param_names__.emplace_back(std::string() + "p_cfcov_33_ar" + '.' + std::to_string(sym3__) + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} - }} + } + } + } + } + } + } for (int sym1__ = 1; sym1__ <= 2; ++sym1__) { { param_names__.emplace_back(std::string() + "x_p" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= 2; ++sym1__) { { param_names__.emplace_back(std::string() + "y_p" + '.' + std::to_string(sym1__)); - }} + } + } if (emit_transformed_parameters__) { for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { param_names__.emplace_back(std::string() + "tp_real_1d_ar" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= K; ++sym1__) { { for (int sym2__ = 1; sym2__ <= M; ++sym2__) { @@ -9184,20 +9629,26 @@ class mother_model final : public model_base_crtp { for (int sym3__ = 1; sym3__ <= N; ++sym3__) { { param_names__.emplace_back(std::string() + "tp_real_3d_ar" + '.' + std::to_string(sym3__) + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} - }} + } + } + } + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { param_names__.emplace_back(std::string() + "tp_vec" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { { param_names__.emplace_back(std::string() + "tp_1d_vec" + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} + } + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { for (int sym2__ = 1; sym2__ <= K; ++sym2__) { @@ -9207,21 +9658,28 @@ class mother_model final : public model_base_crtp { for (int sym4__ = 1; sym4__ <= N; ++sym4__) { { param_names__.emplace_back(std::string() + "tp_3d_vec" + '.' + std::to_string(sym4__) + '.' + std::to_string(sym3__) + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} - }} - }} + } + } + } + } + } + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { param_names__.emplace_back(std::string() + "tp_row_vec" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { { param_names__.emplace_back(std::string() + "tp_1d_row_vec" + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} + } + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { for (int sym2__ = 1; sym2__ <= K; ++sym2__) { @@ -9231,10 +9689,14 @@ class mother_model final : public model_base_crtp { for (int sym4__ = 1; sym4__ <= N; ++sym4__) { { param_names__.emplace_back(std::string() + "tp_3d_row_vec" + '.' + std::to_string(sym4__) + '.' + std::to_string(sym3__) + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} - }} - }} + } + } + } + } + } + } + } + } for (int sym1__ = 1; sym1__ <= 3; ++sym1__) { { for (int sym2__ = 1; sym2__ <= 2; ++sym2__) { @@ -9244,21 +9706,28 @@ class mother_model final : public model_base_crtp { for (int sym4__ = 1; sym4__ <= 4; ++sym4__) { { param_names__.emplace_back(std::string() + "tp_ar_mat" + '.' + std::to_string(sym4__) + '.' + std::to_string(sym3__) + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} - }} - }} + } + } + } + } + } + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { param_names__.emplace_back(std::string() + "tp_simplex" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { { param_names__.emplace_back(std::string() + "tp_1d_simplex" + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} + } + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { for (int sym2__ = 1; sym2__ <= K; ++sym2__) { @@ -9268,24 +9737,32 @@ class mother_model final : public model_base_crtp { for (int sym4__ = 1; sym4__ <= N; ++sym4__) { { param_names__.emplace_back(std::string() + "tp_3d_simplex" + '.' + std::to_string(sym4__) + '.' + std::to_string(sym3__) + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} - }} - }} + } + } + } + } + } + } + } + } for (int sym1__ = 1; sym1__ <= 4; ++sym1__) { { for (int sym2__ = 1; sym2__ <= 5; ++sym2__) { { param_names__.emplace_back(std::string() + "tp_cfcov_54" + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} + } + } + } + } for (int sym1__ = 1; sym1__ <= 3; ++sym1__) { { for (int sym2__ = 1; sym2__ <= 3; ++sym2__) { { param_names__.emplace_back(std::string() + "tp_cfcov_33" + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} + } + } + } + } for (int sym1__ = 1; sym1__ <= 3; ++sym1__) { { for (int sym2__ = 1; sym2__ <= 3; ++sym2__) { @@ -9293,13 +9770,17 @@ class mother_model final : public model_base_crtp { for (int sym3__ = 1; sym3__ <= K; ++sym3__) { { param_names__.emplace_back(std::string() + "tp_cfcov_33_ar" + '.' + std::to_string(sym3__) + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} - }} + } + } + } + } + } + } for (int sym1__ = 1; sym1__ <= 2; ++sym1__) { { param_names__.emplace_back(std::string() + "theta_p" + '.' + std::to_string(sym1__)); - }} + } + } param_names__.emplace_back(std::string() + "tp_real"); } @@ -9309,7 +9790,8 @@ class mother_model final : public model_base_crtp { for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { param_names__.emplace_back(std::string() + "gq_real_1d_ar" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= K; ++sym1__) { { for (int sym2__ = 1; sym2__ <= M; ++sym2__) { @@ -9317,20 +9799,26 @@ class mother_model final : public model_base_crtp { for (int sym3__ = 1; sym3__ <= N; ++sym3__) { { param_names__.emplace_back(std::string() + "gq_real_3d_ar" + '.' + std::to_string(sym3__) + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} - }} + } + } + } + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { param_names__.emplace_back(std::string() + "gq_vec" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { { param_names__.emplace_back(std::string() + "gq_1d_vec" + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} + } + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { for (int sym2__ = 1; sym2__ <= K; ++sym2__) { @@ -9340,21 +9828,28 @@ class mother_model final : public model_base_crtp { for (int sym4__ = 1; sym4__ <= N; ++sym4__) { { param_names__.emplace_back(std::string() + "gq_3d_vec" + '.' + std::to_string(sym4__) + '.' + std::to_string(sym3__) + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} - }} - }} + } + } + } + } + } + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { param_names__.emplace_back(std::string() + "gq_row_vec" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { { param_names__.emplace_back(std::string() + "gq_1d_row_vec" + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} + } + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { for (int sym2__ = 1; sym2__ <= K; ++sym2__) { @@ -9364,10 +9859,14 @@ class mother_model final : public model_base_crtp { for (int sym4__ = 1; sym4__ <= N; ++sym4__) { { param_names__.emplace_back(std::string() + "gq_3d_row_vec" + '.' + std::to_string(sym4__) + '.' + std::to_string(sym3__) + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} - }} - }} + } + } + } + } + } + } + } + } for (int sym1__ = 1; sym1__ <= 3; ++sym1__) { { for (int sym2__ = 1; sym2__ <= 2; ++sym2__) { @@ -9377,21 +9876,28 @@ class mother_model final : public model_base_crtp { for (int sym4__ = 1; sym4__ <= 4; ++sym4__) { { param_names__.emplace_back(std::string() + "gq_ar_mat" + '.' + std::to_string(sym4__) + '.' + std::to_string(sym3__) + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} - }} - }} + } + } + } + } + } + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { param_names__.emplace_back(std::string() + "gq_simplex" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { { param_names__.emplace_back(std::string() + "gq_1d_simplex" + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} + } + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { for (int sym2__ = 1; sym2__ <= K; ++sym2__) { @@ -9401,24 +9907,32 @@ class mother_model final : public model_base_crtp { for (int sym4__ = 1; sym4__ <= N; ++sym4__) { { param_names__.emplace_back(std::string() + "gq_3d_simplex" + '.' + std::to_string(sym4__) + '.' + std::to_string(sym3__) + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} - }} - }} + } + } + } + } + } + } + } + } for (int sym1__ = 1; sym1__ <= 4; ++sym1__) { { for (int sym2__ = 1; sym2__ <= 5; ++sym2__) { { param_names__.emplace_back(std::string() + "gq_cfcov_54" + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} + } + } + } + } for (int sym1__ = 1; sym1__ <= 3; ++sym1__) { { for (int sym2__ = 1; sym2__ <= 3; ++sym2__) { { param_names__.emplace_back(std::string() + "gq_cfcov_33" + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} + } + } + } + } for (int sym1__ = 1; sym1__ <= 3; ++sym1__) { { for (int sym2__ = 1; sym2__ <= 3; ++sym2__) { @@ -9426,13 +9940,17 @@ class mother_model final : public model_base_crtp { for (int sym3__ = 1; sym3__ <= K; ++sym3__) { { param_names__.emplace_back(std::string() + "gq_cfcov_33_ar" + '.' + std::to_string(sym3__) + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} - }} + } + } + } + } + } + } for (int sym1__ = 1; sym1__ <= 3; ++sym1__) { { param_names__.emplace_back(std::string() + "indices" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= 4; ++sym1__) { { for (int sym2__ = 1; sym2__ <= 3; ++sym2__) { @@ -9440,9 +9958,12 @@ class mother_model final : public model_base_crtp { for (int sym3__ = 1; sym3__ <= 5; ++sym3__) { { param_names__.emplace_back(std::string() + "indexing_mat" + '.' + std::to_string(sym3__) + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} - }} + } + } + } + } + } + } for (int sym1__ = 1; sym1__ <= 4; ++sym1__) { { for (int sym2__ = 1; sym2__ <= 3; ++sym2__) { @@ -9450,9 +9971,12 @@ class mother_model final : public model_base_crtp { for (int sym3__ = 1; sym3__ <= 3; ++sym3__) { { param_names__.emplace_back(std::string() + "idx_res1" + '.' + std::to_string(sym3__) + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} - }} + } + } + } + } + } + } for (int sym1__ = 1; sym1__ <= 4; ++sym1__) { { for (int sym2__ = 1; sym2__ <= 3; ++sym2__) { @@ -9460,9 +9984,12 @@ class mother_model final : public model_base_crtp { for (int sym3__ = 1; sym3__ <= 5; ++sym3__) { { param_names__.emplace_back(std::string() + "idx_res2" + '.' + std::to_string(sym3__) + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} - }} + } + } + } + } + } + } for (int sym1__ = 1; sym1__ <= 3; ++sym1__) { { for (int sym2__ = 1; sym2__ <= 3; ++sym2__) { @@ -9470,9 +9997,12 @@ class mother_model final : public model_base_crtp { for (int sym3__ = 1; sym3__ <= 3; ++sym3__) { { param_names__.emplace_back(std::string() + "idx_res3" + '.' + std::to_string(sym3__) + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} - }} + } + } + } + } + } + } for (int sym1__ = 1; sym1__ <= 4; ++sym1__) { { for (int sym2__ = 1; sym2__ <= 3; ++sym2__) { @@ -9480,9 +10010,12 @@ class mother_model final : public model_base_crtp { for (int sym3__ = 1; sym3__ <= 3; ++sym3__) { { param_names__.emplace_back(std::string() + "idx_res11" + '.' + std::to_string(sym3__) + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} - }} + } + } + } + } + } + } for (int sym1__ = 1; sym1__ <= 4; ++sym1__) { { for (int sym2__ = 1; sym2__ <= 3; ++sym2__) { @@ -9490,9 +10023,12 @@ class mother_model final : public model_base_crtp { for (int sym3__ = 1; sym3__ <= 5; ++sym3__) { { param_names__.emplace_back(std::string() + "idx_res21" + '.' + std::to_string(sym3__) + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} - }} + } + } + } + } + } + } for (int sym1__ = 1; sym1__ <= 3; ++sym1__) { { for (int sym2__ = 1; sym2__ <= 3; ++sym2__) { @@ -9500,23 +10036,30 @@ class mother_model final : public model_base_crtp { for (int sym3__ = 1; sym3__ <= 3; ++sym3__) { { param_names__.emplace_back(std::string() + "idx_res31" + '.' + std::to_string(sym3__) + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} - }} + } + } + } + } + } + } for (int sym1__ = 1; sym1__ <= 4; ++sym1__) { { for (int sym2__ = 1; sym2__ <= 3; ++sym2__) { { param_names__.emplace_back(std::string() + "idx_res4" + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} + } + } + } + } for (int sym1__ = 1; sym1__ <= 2; ++sym1__) { { for (int sym2__ = 1; sym2__ <= 2; ++sym2__) { { param_names__.emplace_back(std::string() + "idx_res5" + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} + } + } + } + } } } // constrained_param_names() @@ -9533,19 +10076,23 @@ class mother_model final : public model_base_crtp { for (int sym1__ = 1; sym1__ <= 5; ++sym1__) { { param_names__.emplace_back(std::string() + "offset_multiplier" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= 5; ++sym1__) { { param_names__.emplace_back(std::string() + "no_offset_multiplier" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= 5; ++sym1__) { { param_names__.emplace_back(std::string() + "offset_no_multiplier" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { param_names__.emplace_back(std::string() + "p_real_1d_ar" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= K; ++sym1__) { { for (int sym2__ = 1; sym2__ <= M; ++sym2__) { @@ -9553,20 +10100,26 @@ class mother_model final : public model_base_crtp { for (int sym3__ = 1; sym3__ <= N; ++sym3__) { { param_names__.emplace_back(std::string() + "p_real_3d_ar" + '.' + std::to_string(sym3__) + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} - }} + } + } + } + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { param_names__.emplace_back(std::string() + "p_vec" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { { param_names__.emplace_back(std::string() + "p_1d_vec" + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} + } + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { for (int sym2__ = 1; sym2__ <= K; ++sym2__) { @@ -9576,21 +10129,28 @@ class mother_model final : public model_base_crtp { for (int sym4__ = 1; sym4__ <= N; ++sym4__) { { param_names__.emplace_back(std::string() + "p_3d_vec" + '.' + std::to_string(sym4__) + '.' + std::to_string(sym3__) + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} - }} - }} + } + } + } + } + } + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { param_names__.emplace_back(std::string() + "p_row_vec" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { { param_names__.emplace_back(std::string() + "p_1d_row_vec" + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} + } + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { for (int sym2__ = 1; sym2__ <= K; ++sym2__) { @@ -9600,10 +10160,14 @@ class mother_model final : public model_base_crtp { for (int sym4__ = 1; sym4__ <= N; ++sym4__) { { param_names__.emplace_back(std::string() + "p_3d_row_vec" + '.' + std::to_string(sym4__) + '.' + std::to_string(sym3__) + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} - }} - }} + } + } + } + } + } + } + } + } for (int sym1__ = 1; sym1__ <= 3; ++sym1__) { { for (int sym2__ = 1; sym2__ <= 2; ++sym2__) { @@ -9613,21 +10177,28 @@ class mother_model final : public model_base_crtp { for (int sym4__ = 1; sym4__ <= 4; ++sym4__) { { param_names__.emplace_back(std::string() + "p_ar_mat" + '.' + std::to_string(sym4__) + '.' + std::to_string(sym3__) + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} - }} - }} + } + } + } + } + } + } + } + } for (int sym1__ = 1; sym1__ <= (N - 1); ++sym1__) { { param_names__.emplace_back(std::string() + "p_simplex" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= (N - 1); ++sym1__) { { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { { param_names__.emplace_back(std::string() + "p_1d_simplex" + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} + } + } + } + } for (int sym1__ = 1; sym1__ <= (N - 1); ++sym1__) { { for (int sym2__ = 1; sym2__ <= K; ++sym2__) { @@ -9637,41 +10208,52 @@ class mother_model final : public model_base_crtp { for (int sym4__ = 1; sym4__ <= N; ++sym4__) { { param_names__.emplace_back(std::string() + "p_3d_simplex" + '.' + std::to_string(sym4__) + '.' + std::to_string(sym3__) + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} - }} - }} + } + } + } + } + } + } + } + } for (int sym1__ = 1; sym1__ <= ((((4 * (4 - 1)) / 2) + 4) + ((5 - 4) * 4)); ++sym1__) { { param_names__.emplace_back(std::string() + "p_cfcov_54" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= ((((3 * (3 - 1)) / 2) + 3) + ((3 - 3) * 3)); ++sym1__) { { param_names__.emplace_back(std::string() + "p_cfcov_33" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= ((((3 * (3 - 1)) / 2) + 3) + ((3 - 3) * 3)); ++sym1__) { { for (int sym2__ = 1; sym2__ <= K; ++sym2__) { { param_names__.emplace_back(std::string() + "p_cfcov_33_ar" + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} + } + } + } + } for (int sym1__ = 1; sym1__ <= 2; ++sym1__) { { param_names__.emplace_back(std::string() + "x_p" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= 2; ++sym1__) { { param_names__.emplace_back(std::string() + "y_p" + '.' + std::to_string(sym1__)); - }} + } + } if (emit_transformed_parameters__) { for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { param_names__.emplace_back(std::string() + "tp_real_1d_ar" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= K; ++sym1__) { { for (int sym2__ = 1; sym2__ <= M; ++sym2__) { @@ -9679,20 +10261,26 @@ class mother_model final : public model_base_crtp { for (int sym3__ = 1; sym3__ <= N; ++sym3__) { { param_names__.emplace_back(std::string() + "tp_real_3d_ar" + '.' + std::to_string(sym3__) + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} - }} + } + } + } + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { param_names__.emplace_back(std::string() + "tp_vec" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { { param_names__.emplace_back(std::string() + "tp_1d_vec" + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} + } + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { for (int sym2__ = 1; sym2__ <= K; ++sym2__) { @@ -9702,21 +10290,28 @@ class mother_model final : public model_base_crtp { for (int sym4__ = 1; sym4__ <= N; ++sym4__) { { param_names__.emplace_back(std::string() + "tp_3d_vec" + '.' + std::to_string(sym4__) + '.' + std::to_string(sym3__) + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} - }} - }} + } + } + } + } + } + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { param_names__.emplace_back(std::string() + "tp_row_vec" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { { param_names__.emplace_back(std::string() + "tp_1d_row_vec" + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} + } + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { for (int sym2__ = 1; sym2__ <= K; ++sym2__) { @@ -9726,10 +10321,14 @@ class mother_model final : public model_base_crtp { for (int sym4__ = 1; sym4__ <= N; ++sym4__) { { param_names__.emplace_back(std::string() + "tp_3d_row_vec" + '.' + std::to_string(sym4__) + '.' + std::to_string(sym3__) + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} - }} - }} + } + } + } + } + } + } + } + } for (int sym1__ = 1; sym1__ <= 3; ++sym1__) { { for (int sym2__ = 1; sym2__ <= 2; ++sym2__) { @@ -9739,21 +10338,28 @@ class mother_model final : public model_base_crtp { for (int sym4__ = 1; sym4__ <= 4; ++sym4__) { { param_names__.emplace_back(std::string() + "tp_ar_mat" + '.' + std::to_string(sym4__) + '.' + std::to_string(sym3__) + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} - }} - }} + } + } + } + } + } + } + } + } for (int sym1__ = 1; sym1__ <= (N - 1); ++sym1__) { { param_names__.emplace_back(std::string() + "tp_simplex" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= (N - 1); ++sym1__) { { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { { param_names__.emplace_back(std::string() + "tp_1d_simplex" + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} + } + } + } + } for (int sym1__ = 1; sym1__ <= (N - 1); ++sym1__) { { for (int sym2__ = 1; sym2__ <= K; ++sym2__) { @@ -9763,32 +10369,41 @@ class mother_model final : public model_base_crtp { for (int sym4__ = 1; sym4__ <= N; ++sym4__) { { param_names__.emplace_back(std::string() + "tp_3d_simplex" + '.' + std::to_string(sym4__) + '.' + std::to_string(sym3__) + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} - }} - }} + } + } + } + } + } + } + } + } for (int sym1__ = 1; sym1__ <= ((((4 * (4 - 1)) / 2) + 4) + ((5 - 4) * 4)); ++sym1__) { { param_names__.emplace_back(std::string() + "tp_cfcov_54" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= ((((3 * (3 - 1)) / 2) + 3) + ((3 - 3) * 3)); ++sym1__) { { param_names__.emplace_back(std::string() + "tp_cfcov_33" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= ((((3 * (3 - 1)) / 2) + 3) + ((3 - 3) * 3)); ++sym1__) { { for (int sym2__ = 1; sym2__ <= K; ++sym2__) { { param_names__.emplace_back(std::string() + "tp_cfcov_33_ar" + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} + } + } + } + } for (int sym1__ = 1; sym1__ <= 2; ++sym1__) { { param_names__.emplace_back(std::string() + "theta_p" + '.' + std::to_string(sym1__)); - }} + } + } param_names__.emplace_back(std::string() + "tp_real"); } @@ -9798,7 +10413,8 @@ class mother_model final : public model_base_crtp { for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { param_names__.emplace_back(std::string() + "gq_real_1d_ar" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= K; ++sym1__) { { for (int sym2__ = 1; sym2__ <= M; ++sym2__) { @@ -9806,20 +10422,26 @@ class mother_model final : public model_base_crtp { for (int sym3__ = 1; sym3__ <= N; ++sym3__) { { param_names__.emplace_back(std::string() + "gq_real_3d_ar" + '.' + std::to_string(sym3__) + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} - }} + } + } + } + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { param_names__.emplace_back(std::string() + "gq_vec" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { { param_names__.emplace_back(std::string() + "gq_1d_vec" + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} + } + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { for (int sym2__ = 1; sym2__ <= K; ++sym2__) { @@ -9829,21 +10451,28 @@ class mother_model final : public model_base_crtp { for (int sym4__ = 1; sym4__ <= N; ++sym4__) { { param_names__.emplace_back(std::string() + "gq_3d_vec" + '.' + std::to_string(sym4__) + '.' + std::to_string(sym3__) + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} - }} - }} + } + } + } + } + } + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { param_names__.emplace_back(std::string() + "gq_row_vec" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { { param_names__.emplace_back(std::string() + "gq_1d_row_vec" + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} + } + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { for (int sym2__ = 1; sym2__ <= K; ++sym2__) { @@ -9853,10 +10482,14 @@ class mother_model final : public model_base_crtp { for (int sym4__ = 1; sym4__ <= N; ++sym4__) { { param_names__.emplace_back(std::string() + "gq_3d_row_vec" + '.' + std::to_string(sym4__) + '.' + std::to_string(sym3__) + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} - }} - }} + } + } + } + } + } + } + } + } for (int sym1__ = 1; sym1__ <= 3; ++sym1__) { { for (int sym2__ = 1; sym2__ <= 2; ++sym2__) { @@ -9866,21 +10499,28 @@ class mother_model final : public model_base_crtp { for (int sym4__ = 1; sym4__ <= 4; ++sym4__) { { param_names__.emplace_back(std::string() + "gq_ar_mat" + '.' + std::to_string(sym4__) + '.' + std::to_string(sym3__) + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} - }} - }} + } + } + } + } + } + } + } + } for (int sym1__ = 1; sym1__ <= (N - 1); ++sym1__) { { param_names__.emplace_back(std::string() + "gq_simplex" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= (N - 1); ++sym1__) { { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { { param_names__.emplace_back(std::string() + "gq_1d_simplex" + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} + } + } + } + } for (int sym1__ = 1; sym1__ <= (N - 1); ++sym1__) { { for (int sym2__ = 1; sym2__ <= K; ++sym2__) { @@ -9890,32 +10530,41 @@ class mother_model final : public model_base_crtp { for (int sym4__ = 1; sym4__ <= N; ++sym4__) { { param_names__.emplace_back(std::string() + "gq_3d_simplex" + '.' + std::to_string(sym4__) + '.' + std::to_string(sym3__) + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} - }} - }} + } + } + } + } + } + } + } + } for (int sym1__ = 1; sym1__ <= ((((4 * (4 - 1)) / 2) + 4) + ((5 - 4) * 4)); ++sym1__) { { param_names__.emplace_back(std::string() + "gq_cfcov_54" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= ((((3 * (3 - 1)) / 2) + 3) + ((3 - 3) * 3)); ++sym1__) { { param_names__.emplace_back(std::string() + "gq_cfcov_33" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= ((((3 * (3 - 1)) / 2) + 3) + ((3 - 3) * 3)); ++sym1__) { { for (int sym2__ = 1; sym2__ <= K; ++sym2__) { { param_names__.emplace_back(std::string() + "gq_cfcov_33_ar" + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} + } + } + } + } for (int sym1__ = 1; sym1__ <= 3; ++sym1__) { { param_names__.emplace_back(std::string() + "indices" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= 4; ++sym1__) { { for (int sym2__ = 1; sym2__ <= 3; ++sym2__) { @@ -9923,9 +10572,12 @@ class mother_model final : public model_base_crtp { for (int sym3__ = 1; sym3__ <= 5; ++sym3__) { { param_names__.emplace_back(std::string() + "indexing_mat" + '.' + std::to_string(sym3__) + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} - }} + } + } + } + } + } + } for (int sym1__ = 1; sym1__ <= 4; ++sym1__) { { for (int sym2__ = 1; sym2__ <= 3; ++sym2__) { @@ -9933,9 +10585,12 @@ class mother_model final : public model_base_crtp { for (int sym3__ = 1; sym3__ <= 3; ++sym3__) { { param_names__.emplace_back(std::string() + "idx_res1" + '.' + std::to_string(sym3__) + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} - }} + } + } + } + } + } + } for (int sym1__ = 1; sym1__ <= 4; ++sym1__) { { for (int sym2__ = 1; sym2__ <= 3; ++sym2__) { @@ -9943,9 +10598,12 @@ class mother_model final : public model_base_crtp { for (int sym3__ = 1; sym3__ <= 5; ++sym3__) { { param_names__.emplace_back(std::string() + "idx_res2" + '.' + std::to_string(sym3__) + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} - }} + } + } + } + } + } + } for (int sym1__ = 1; sym1__ <= 3; ++sym1__) { { for (int sym2__ = 1; sym2__ <= 3; ++sym2__) { @@ -9953,9 +10611,12 @@ class mother_model final : public model_base_crtp { for (int sym3__ = 1; sym3__ <= 3; ++sym3__) { { param_names__.emplace_back(std::string() + "idx_res3" + '.' + std::to_string(sym3__) + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} - }} + } + } + } + } + } + } for (int sym1__ = 1; sym1__ <= 4; ++sym1__) { { for (int sym2__ = 1; sym2__ <= 3; ++sym2__) { @@ -9963,9 +10624,12 @@ class mother_model final : public model_base_crtp { for (int sym3__ = 1; sym3__ <= 3; ++sym3__) { { param_names__.emplace_back(std::string() + "idx_res11" + '.' + std::to_string(sym3__) + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} - }} + } + } + } + } + } + } for (int sym1__ = 1; sym1__ <= 4; ++sym1__) { { for (int sym2__ = 1; sym2__ <= 3; ++sym2__) { @@ -9973,9 +10637,12 @@ class mother_model final : public model_base_crtp { for (int sym3__ = 1; sym3__ <= 5; ++sym3__) { { param_names__.emplace_back(std::string() + "idx_res21" + '.' + std::to_string(sym3__) + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} - }} + } + } + } + } + } + } for (int sym1__ = 1; sym1__ <= 3; ++sym1__) { { for (int sym2__ = 1; sym2__ <= 3; ++sym2__) { @@ -9983,35 +10650,44 @@ class mother_model final : public model_base_crtp { for (int sym3__ = 1; sym3__ <= 3; ++sym3__) { { param_names__.emplace_back(std::string() + "idx_res31" + '.' + std::to_string(sym3__) + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} - }} + } + } + } + } + } + } for (int sym1__ = 1; sym1__ <= 4; ++sym1__) { { for (int sym2__ = 1; sym2__ <= 3; ++sym2__) { { param_names__.emplace_back(std::string() + "idx_res4" + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} + } + } + } + } for (int sym1__ = 1; sym1__ <= 2; ++sym1__) { { for (int sym2__ = 1; sym2__ <= 2; ++sym2__) { { param_names__.emplace_back(std::string() + "idx_res5" + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} + } + } + } + } } } // unconstrained_param_names() - inline std::string get_constrained_sizedtypes() const final { + inline std::string get_constrained_sizedtypes() const { + + return std::string("[{\"name\":\"p_real\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"p_upper\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"p_lower\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"offset_multiplier\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(5) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"no_offset_multiplier\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(5) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"offset_no_multiplier\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(5) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"p_real_1d_ar\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"p_real_3d_ar\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(M) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(K) + ",\"element_type\":{\"name\":\"real\"}}}},\"block\":\"parameters\"},{\"name\":\"p_vec\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(N) + "},\"block\":\"parameters\"},{\"name\":\"p_1d_vec\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(N) + "}},\"block\":\"parameters\"},{\"name\":\"p_3d_vec\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(M) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(K) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(N) + "}}}},\"block\":\"parameters\"},{\"name\":\"p_row_vec\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(N) + "},\"block\":\"parameters\"},{\"name\":\"p_1d_row_vec\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(N) + "}},\"block\":\"parameters\"},{\"name\":\"p_3d_row_vec\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(M) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(K) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(N) + "}}}},\"block\":\"parameters\"},{\"name\":\"p_ar_mat\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(4) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(5) + ",\"element_type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(2) + ",\"cols\":" + std::to_string(3) + "}}},\"block\":\"parameters\"},{\"name\":\"p_simplex\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(N) + "},\"block\":\"parameters\"},{\"name\":\"p_1d_simplex\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(N) + "}},\"block\":\"parameters\"},{\"name\":\"p_3d_simplex\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(M) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(K) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(N) + "}}}},\"block\":\"parameters\"},{\"name\":\"p_cfcov_54\",\"type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(5) + ",\"cols\":" + std::to_string(4) + "},\"block\":\"parameters\"},{\"name\":\"p_cfcov_33\",\"type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(3) + ",\"cols\":" + std::to_string(3) + "},\"block\":\"parameters\"},{\"name\":\"p_cfcov_33_ar\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(K) + ",\"element_type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(3) + ",\"cols\":" + std::to_string(3) + "}},\"block\":\"parameters\"},{\"name\":\"x_p\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(2) + "},\"block\":\"parameters\"},{\"name\":\"y_p\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(2) + "},\"block\":\"parameters\"},{\"name\":\"tp_real_1d_ar\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_real_3d_ar\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(M) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(K) + ",\"element_type\":{\"name\":\"real\"}}}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_vec\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(N) + "},\"block\":\"transformed_parameters\"},{\"name\":\"tp_1d_vec\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(N) + "}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_3d_vec\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(M) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(K) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(N) + "}}}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_row_vec\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(N) + "},\"block\":\"transformed_parameters\"},{\"name\":\"tp_1d_row_vec\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(N) + "}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_3d_row_vec\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(M) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(K) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(N) + "}}}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_ar_mat\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(4) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(5) + ",\"element_type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(2) + ",\"cols\":" + std::to_string(3) + "}}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_simplex\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(N) + "},\"block\":\"transformed_parameters\"},{\"name\":\"tp_1d_simplex\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(N) + "}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_3d_simplex\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(M) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(K) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(N) + "}}}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_cfcov_54\",\"type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(5) + ",\"cols\":" + std::to_string(4) + "},\"block\":\"transformed_parameters\"},{\"name\":\"tp_cfcov_33\",\"type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(3) + ",\"cols\":" + std::to_string(3) + "},\"block\":\"transformed_parameters\"},{\"name\":\"tp_cfcov_33_ar\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(K) + ",\"element_type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(3) + ",\"cols\":" + std::to_string(3) + "}},\"block\":\"transformed_parameters\"},{\"name\":\"theta_p\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(2) + "},\"block\":\"transformed_parameters\"},{\"name\":\"tp_real\",\"type\":{\"name\":\"real\"},\"block\":\"transformed_parameters\"},{\"name\":\"gq_r1\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"gq_r2\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"gq_real_1d_ar\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"generated_quantities\"},{\"name\":\"gq_real_3d_ar\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(M) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(K) + ",\"element_type\":{\"name\":\"real\"}}}},\"block\":\"generated_quantities\"},{\"name\":\"gq_vec\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(N) + "},\"block\":\"generated_quantities\"},{\"name\":\"gq_1d_vec\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(N) + "}},\"block\":\"generated_quantities\"},{\"name\":\"gq_3d_vec\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(M) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(K) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(N) + "}}}},\"block\":\"generated_quantities\"},{\"name\":\"gq_row_vec\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(N) + "},\"block\":\"generated_quantities\"},{\"name\":\"gq_1d_row_vec\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(N) + "}},\"block\":\"generated_quantities\"},{\"name\":\"gq_3d_row_vec\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(M) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(K) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(N) + "}}}},\"block\":\"generated_quantities\"},{\"name\":\"gq_ar_mat\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(4) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(5) + ",\"element_type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(2) + ",\"cols\":" + std::to_string(3) + "}}},\"block\":\"generated_quantities\"},{\"name\":\"gq_simplex\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(N) + "},\"block\":\"generated_quantities\"},{\"name\":\"gq_1d_simplex\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(N) + "}},\"block\":\"generated_quantities\"},{\"name\":\"gq_3d_simplex\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(M) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(K) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(N) + "}}}},\"block\":\"generated_quantities\"},{\"name\":\"gq_cfcov_54\",\"type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(5) + ",\"cols\":" + std::to_string(4) + "},\"block\":\"generated_quantities\"},{\"name\":\"gq_cfcov_33\",\"type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(3) + ",\"cols\":" + std::to_string(3) + "},\"block\":\"generated_quantities\"},{\"name\":\"gq_cfcov_33_ar\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(K) + ",\"element_type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(3) + ",\"cols\":" + std::to_string(3) + "}},\"block\":\"generated_quantities\"},{\"name\":\"indices\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(3) + ",\"element_type\":{\"name\":\"int\"}},\"block\":\"generated_quantities\"},{\"name\":\"indexing_mat\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(5) + ",\"element_type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(3) + ",\"cols\":" + std::to_string(4) + "}},\"block\":\"generated_quantities\"},{\"name\":\"idx_res1\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(3) + ",\"element_type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(3) + ",\"cols\":" + std::to_string(4) + "}},\"block\":\"generated_quantities\"},{\"name\":\"idx_res2\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(5) + ",\"element_type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(3) + ",\"cols\":" + std::to_string(4) + "}},\"block\":\"generated_quantities\"},{\"name\":\"idx_res3\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(3) + ",\"element_type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(3) + ",\"cols\":" + std::to_string(3) + "}},\"block\":\"generated_quantities\"},{\"name\":\"idx_res11\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(3) + ",\"element_type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(3) + ",\"cols\":" + std::to_string(4) + "}},\"block\":\"generated_quantities\"},{\"name\":\"idx_res21\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(5) + ",\"element_type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(3) + ",\"cols\":" + std::to_string(4) + "}},\"block\":\"generated_quantities\"},{\"name\":\"idx_res31\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(3) + ",\"element_type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(3) + ",\"cols\":" + std::to_string(3) + "}},\"block\":\"generated_quantities\"},{\"name\":\"idx_res4\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(3) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(4) + "}},\"block\":\"generated_quantities\"},{\"name\":\"idx_res5\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(2) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(2) + "}},\"block\":\"generated_quantities\"}]"); - return std::string("[{\"name\":\"p_real\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"p_upper\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"p_lower\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"offset_multiplier\",\"type\":{\"name\":\"array\",\"length\":" << 5 << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"no_offset_multiplier\",\"type\":{\"name\":\"array\",\"length\":" << 5 << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"offset_no_multiplier\",\"type\":{\"name\":\"array\",\"length\":" << 5 << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"p_real_1d_ar\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"p_real_3d_ar\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << M << ",\"element_type\":{\"name\":\"array\",\"length\":" << K << ",\"element_type\":{\"name\":\"real\"}}}},\"block\":\"parameters\"},{\"name\":\"p_vec\",\"type\":{\"name\":\"vector\",\"length\":" << N << "},\"block\":\"parameters\"},{\"name\":\"p_1d_vec\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}},\"block\":\"parameters\"},{\"name\":\"p_3d_vec\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << M << ",\"element_type\":{\"name\":\"array\",\"length\":" << K << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}}}},\"block\":\"parameters\"},{\"name\":\"p_row_vec\",\"type\":{\"name\":\"vector\",\"length\":" << N << "},\"block\":\"parameters\"},{\"name\":\"p_1d_row_vec\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}},\"block\":\"parameters\"},{\"name\":\"p_3d_row_vec\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << M << ",\"element_type\":{\"name\":\"array\",\"length\":" << K << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}}}},\"block\":\"parameters\"},{\"name\":\"p_ar_mat\",\"type\":{\"name\":\"array\",\"length\":" << 4 << ",\"element_type\":{\"name\":\"array\",\"length\":" << 5 << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << 2 << ",\"cols\":" << 3 << "}}},\"block\":\"parameters\"},{\"name\":\"p_simplex\",\"type\":{\"name\":\"vector\",\"length\":" << N << "},\"block\":\"parameters\"},{\"name\":\"p_1d_simplex\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}},\"block\":\"parameters\"},{\"name\":\"p_3d_simplex\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << M << ",\"element_type\":{\"name\":\"array\",\"length\":" << K << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}}}},\"block\":\"parameters\"},{\"name\":\"p_cfcov_54\",\"type\":{\"name\":\"matrix\",\"rows\":" << 5 << ",\"cols\":" << 4 << "},\"block\":\"parameters\"},{\"name\":\"p_cfcov_33\",\"type\":{\"name\":\"matrix\",\"rows\":" << 3 << ",\"cols\":" << 3 << "},\"block\":\"parameters\"},{\"name\":\"p_cfcov_33_ar\",\"type\":{\"name\":\"array\",\"length\":" << K << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << 3 << ",\"cols\":" << 3 << "}},\"block\":\"parameters\"},{\"name\":\"x_p\",\"type\":{\"name\":\"vector\",\"length\":" << 2 << "},\"block\":\"parameters\"},{\"name\":\"y_p\",\"type\":{\"name\":\"vector\",\"length\":" << 2 << "},\"block\":\"parameters\"},{\"name\":\"tp_real_1d_ar\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_real_3d_ar\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << M << ",\"element_type\":{\"name\":\"array\",\"length\":" << K << ",\"element_type\":{\"name\":\"real\"}}}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_vec\",\"type\":{\"name\":\"vector\",\"length\":" << N << "},\"block\":\"transformed_parameters\"},{\"name\":\"tp_1d_vec\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_3d_vec\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << M << ",\"element_type\":{\"name\":\"array\",\"length\":" << K << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}}}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_row_vec\",\"type\":{\"name\":\"vector\",\"length\":" << N << "},\"block\":\"transformed_parameters\"},{\"name\":\"tp_1d_row_vec\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_3d_row_vec\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << M << ",\"element_type\":{\"name\":\"array\",\"length\":" << K << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}}}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_ar_mat\",\"type\":{\"name\":\"array\",\"length\":" << 4 << ",\"element_type\":{\"name\":\"array\",\"length\":" << 5 << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << 2 << ",\"cols\":" << 3 << "}}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_simplex\",\"type\":{\"name\":\"vector\",\"length\":" << N << "},\"block\":\"transformed_parameters\"},{\"name\":\"tp_1d_simplex\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_3d_simplex\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << M << ",\"element_type\":{\"name\":\"array\",\"length\":" << K << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}}}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_cfcov_54\",\"type\":{\"name\":\"matrix\",\"rows\":" << 5 << ",\"cols\":" << 4 << "},\"block\":\"transformed_parameters\"},{\"name\":\"tp_cfcov_33\",\"type\":{\"name\":\"matrix\",\"rows\":" << 3 << ",\"cols\":" << 3 << "},\"block\":\"transformed_parameters\"},{\"name\":\"tp_cfcov_33_ar\",\"type\":{\"name\":\"array\",\"length\":" << K << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << 3 << ",\"cols\":" << 3 << "}},\"block\":\"transformed_parameters\"},{\"name\":\"theta_p\",\"type\":{\"name\":\"vector\",\"length\":" << 2 << "},\"block\":\"transformed_parameters\"},{\"name\":\"tp_real\",\"type\":{\"name\":\"real\"},\"block\":\"transformed_parameters\"},{\"name\":\"gq_r1\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"gq_r2\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"gq_real_1d_ar\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"generated_quantities\"},{\"name\":\"gq_real_3d_ar\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << M << ",\"element_type\":{\"name\":\"array\",\"length\":" << K << ",\"element_type\":{\"name\":\"real\"}}}},\"block\":\"generated_quantities\"},{\"name\":\"gq_vec\",\"type\":{\"name\":\"vector\",\"length\":" << N << "},\"block\":\"generated_quantities\"},{\"name\":\"gq_1d_vec\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}},\"block\":\"generated_quantities\"},{\"name\":\"gq_3d_vec\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << M << ",\"element_type\":{\"name\":\"array\",\"length\":" << K << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}}}},\"block\":\"generated_quantities\"},{\"name\":\"gq_row_vec\",\"type\":{\"name\":\"vector\",\"length\":" << N << "},\"block\":\"generated_quantities\"},{\"name\":\"gq_1d_row_vec\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}},\"block\":\"generated_quantities\"},{\"name\":\"gq_3d_row_vec\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << M << ",\"element_type\":{\"name\":\"array\",\"length\":" << K << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}}}},\"block\":\"generated_quantities\"},{\"name\":\"gq_ar_mat\",\"type\":{\"name\":\"array\",\"length\":" << 4 << ",\"element_type\":{\"name\":\"array\",\"length\":" << 5 << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << 2 << ",\"cols\":" << 3 << "}}},\"block\":\"generated_quantities\"},{\"name\":\"gq_simplex\",\"type\":{\"name\":\"vector\",\"length\":" << N << "},\"block\":\"generated_quantities\"},{\"name\":\"gq_1d_simplex\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}},\"block\":\"generated_quantities\"},{\"name\":\"gq_3d_simplex\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << M << ",\"element_type\":{\"name\":\"array\",\"length\":" << K << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}}}},\"block\":\"generated_quantities\"},{\"name\":\"gq_cfcov_54\",\"type\":{\"name\":\"matrix\",\"rows\":" << 5 << ",\"cols\":" << 4 << "},\"block\":\"generated_quantities\"},{\"name\":\"gq_cfcov_33\",\"type\":{\"name\":\"matrix\",\"rows\":" << 3 << ",\"cols\":" << 3 << "},\"block\":\"generated_quantities\"},{\"name\":\"gq_cfcov_33_ar\",\"type\":{\"name\":\"array\",\"length\":" << K << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << 3 << ",\"cols\":" << 3 << "}},\"block\":\"generated_quantities\"},{\"name\":\"indices\",\"type\":{\"name\":\"array\",\"length\":" << 3 << ",\"element_type\":{\"name\":\"int\"}},\"block\":\"generated_quantities\"},{\"name\":\"indexing_mat\",\"type\":{\"name\":\"array\",\"length\":" << 5 << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << 3 << ",\"cols\":" << 4 << "}},\"block\":\"generated_quantities\"},{\"name\":\"idx_res1\",\"type\":{\"name\":\"array\",\"length\":" << 3 << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << 3 << ",\"cols\":" << 4 << "}},\"block\":\"generated_quantities\"},{\"name\":\"idx_res2\",\"type\":{\"name\":\"array\",\"length\":" << 5 << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << 3 << ",\"cols\":" << 4 << "}},\"block\":\"generated_quantities\"},{\"name\":\"idx_res3\",\"type\":{\"name\":\"array\",\"length\":" << 3 << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << 3 << ",\"cols\":" << 3 << "}},\"block\":\"generated_quantities\"},{\"name\":\"idx_res11\",\"type\":{\"name\":\"array\",\"length\":" << 3 << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << 3 << ",\"cols\":" << 4 << "}},\"block\":\"generated_quantities\"},{\"name\":\"idx_res21\",\"type\":{\"name\":\"array\",\"length\":" << 5 << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << 3 << ",\"cols\":" << 4 << "}},\"block\":\"generated_quantities\"},{\"name\":\"idx_res31\",\"type\":{\"name\":\"array\",\"length\":" << 3 << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << 3 << ",\"cols\":" << 3 << "}},\"block\":\"generated_quantities\"},{\"name\":\"idx_res4\",\"type\":{\"name\":\"array\",\"length\":" << 3 << ",\"element_type\":{\"name\":\"vector\",\"length\":" << 4 << "}},\"block\":\"generated_quantities\"},{\"name\":\"idx_res5\",\"type\":{\"name\":\"array\",\"length\":" << 2 << ",\"element_type\":{\"name\":\"vector\",\"length\":" << 2 << "}},\"block\":\"generated_quantities\"}]"); } // get_constrained_sizedtypes() - inline std::string get_unconstrained_sizedtypes() const final { + inline std::string get_unconstrained_sizedtypes() const { + + return std::string("[{\"name\":\"p_real\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"p_upper\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"p_lower\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"offset_multiplier\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(5) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"no_offset_multiplier\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(5) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"offset_no_multiplier\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(5) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"p_real_1d_ar\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"p_real_3d_ar\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(M) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(K) + ",\"element_type\":{\"name\":\"real\"}}}},\"block\":\"parameters\"},{\"name\":\"p_vec\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(N) + "},\"block\":\"parameters\"},{\"name\":\"p_1d_vec\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(N) + "}},\"block\":\"parameters\"},{\"name\":\"p_3d_vec\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(M) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(K) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(N) + "}}}},\"block\":\"parameters\"},{\"name\":\"p_row_vec\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(N) + "},\"block\":\"parameters\"},{\"name\":\"p_1d_row_vec\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(N) + "}},\"block\":\"parameters\"},{\"name\":\"p_3d_row_vec\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(M) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(K) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(N) + "}}}},\"block\":\"parameters\"},{\"name\":\"p_ar_mat\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(4) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(5) + ",\"element_type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(2) + ",\"cols\":" + std::to_string(3) + "}}},\"block\":\"parameters\"},{\"name\":\"p_simplex\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string((N - 1)) + "},\"block\":\"parameters\"},{\"name\":\"p_1d_simplex\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string((N - 1)) + "}},\"block\":\"parameters\"},{\"name\":\"p_3d_simplex\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(M) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(K) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string((N - 1)) + "}}}},\"block\":\"parameters\"},{\"name\":\"p_cfcov_54\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(((((4 * (4 - 1)) / 2) + 4) + ((5 - 4) * 4))) + "},\"block\":\"parameters\"},{\"name\":\"p_cfcov_33\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(((((3 * (3 - 1)) / 2) + 3) + ((3 - 3) * 3))) + "},\"block\":\"parameters\"},{\"name\":\"p_cfcov_33_ar\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(K) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(((((3 * (3 - 1)) / 2) + 3) + ((3 - 3) * 3))) + "}},\"block\":\"parameters\"},{\"name\":\"x_p\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(2) + "},\"block\":\"parameters\"},{\"name\":\"y_p\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(2) + "},\"block\":\"parameters\"},{\"name\":\"tp_real_1d_ar\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_real_3d_ar\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(M) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(K) + ",\"element_type\":{\"name\":\"real\"}}}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_vec\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(N) + "},\"block\":\"transformed_parameters\"},{\"name\":\"tp_1d_vec\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(N) + "}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_3d_vec\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(M) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(K) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(N) + "}}}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_row_vec\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(N) + "},\"block\":\"transformed_parameters\"},{\"name\":\"tp_1d_row_vec\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(N) + "}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_3d_row_vec\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(M) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(K) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(N) + "}}}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_ar_mat\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(4) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(5) + ",\"element_type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(2) + ",\"cols\":" + std::to_string(3) + "}}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_simplex\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string((N - 1)) + "},\"block\":\"transformed_parameters\"},{\"name\":\"tp_1d_simplex\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string((N - 1)) + "}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_3d_simplex\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(M) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(K) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string((N - 1)) + "}}}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_cfcov_54\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(((((4 * (4 - 1)) / 2) + 4) + ((5 - 4) * 4))) + "},\"block\":\"transformed_parameters\"},{\"name\":\"tp_cfcov_33\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(((((3 * (3 - 1)) / 2) + 3) + ((3 - 3) * 3))) + "},\"block\":\"transformed_parameters\"},{\"name\":\"tp_cfcov_33_ar\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(K) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(((((3 * (3 - 1)) / 2) + 3) + ((3 - 3) * 3))) + "}},\"block\":\"transformed_parameters\"},{\"name\":\"theta_p\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(2) + "},\"block\":\"transformed_parameters\"},{\"name\":\"tp_real\",\"type\":{\"name\":\"real\"},\"block\":\"transformed_parameters\"},{\"name\":\"gq_r1\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"gq_r2\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"gq_real_1d_ar\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"generated_quantities\"},{\"name\":\"gq_real_3d_ar\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(M) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(K) + ",\"element_type\":{\"name\":\"real\"}}}},\"block\":\"generated_quantities\"},{\"name\":\"gq_vec\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(N) + "},\"block\":\"generated_quantities\"},{\"name\":\"gq_1d_vec\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(N) + "}},\"block\":\"generated_quantities\"},{\"name\":\"gq_3d_vec\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(M) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(K) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(N) + "}}}},\"block\":\"generated_quantities\"},{\"name\":\"gq_row_vec\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(N) + "},\"block\":\"generated_quantities\"},{\"name\":\"gq_1d_row_vec\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(N) + "}},\"block\":\"generated_quantities\"},{\"name\":\"gq_3d_row_vec\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(M) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(K) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(N) + "}}}},\"block\":\"generated_quantities\"},{\"name\":\"gq_ar_mat\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(4) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(5) + ",\"element_type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(2) + ",\"cols\":" + std::to_string(3) + "}}},\"block\":\"generated_quantities\"},{\"name\":\"gq_simplex\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string((N - 1)) + "},\"block\":\"generated_quantities\"},{\"name\":\"gq_1d_simplex\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string((N - 1)) + "}},\"block\":\"generated_quantities\"},{\"name\":\"gq_3d_simplex\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(M) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(K) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string((N - 1)) + "}}}},\"block\":\"generated_quantities\"},{\"name\":\"gq_cfcov_54\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(((((4 * (4 - 1)) / 2) + 4) + ((5 - 4) * 4))) + "},\"block\":\"generated_quantities\"},{\"name\":\"gq_cfcov_33\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(((((3 * (3 - 1)) / 2) + 3) + ((3 - 3) * 3))) + "},\"block\":\"generated_quantities\"},{\"name\":\"gq_cfcov_33_ar\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(K) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(((((3 * (3 - 1)) / 2) + 3) + ((3 - 3) * 3))) + "}},\"block\":\"generated_quantities\"},{\"name\":\"indices\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(3) + ",\"element_type\":{\"name\":\"int\"}},\"block\":\"generated_quantities\"},{\"name\":\"indexing_mat\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(5) + ",\"element_type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(3) + ",\"cols\":" + std::to_string(4) + "}},\"block\":\"generated_quantities\"},{\"name\":\"idx_res1\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(3) + ",\"element_type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(3) + ",\"cols\":" + std::to_string(4) + "}},\"block\":\"generated_quantities\"},{\"name\":\"idx_res2\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(5) + ",\"element_type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(3) + ",\"cols\":" + std::to_string(4) + "}},\"block\":\"generated_quantities\"},{\"name\":\"idx_res3\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(3) + ",\"element_type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(3) + ",\"cols\":" + std::to_string(3) + "}},\"block\":\"generated_quantities\"},{\"name\":\"idx_res11\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(3) + ",\"element_type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(3) + ",\"cols\":" + std::to_string(4) + "}},\"block\":\"generated_quantities\"},{\"name\":\"idx_res21\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(5) + ",\"element_type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(3) + ",\"cols\":" + std::to_string(4) + "}},\"block\":\"generated_quantities\"},{\"name\":\"idx_res31\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(3) + ",\"element_type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(3) + ",\"cols\":" + std::to_string(3) + "}},\"block\":\"generated_quantities\"},{\"name\":\"idx_res4\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(3) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(4) + "}},\"block\":\"generated_quantities\"},{\"name\":\"idx_res5\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(2) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(2) + "}},\"block\":\"generated_quantities\"}]"); - return std::string("[{\"name\":\"p_real\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"p_upper\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"p_lower\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"offset_multiplier\",\"type\":{\"name\":\"array\",\"length\":" << 5 << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"no_offset_multiplier\",\"type\":{\"name\":\"array\",\"length\":" << 5 << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"offset_no_multiplier\",\"type\":{\"name\":\"array\",\"length\":" << 5 << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"p_real_1d_ar\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"p_real_3d_ar\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << M << ",\"element_type\":{\"name\":\"array\",\"length\":" << K << ",\"element_type\":{\"name\":\"real\"}}}},\"block\":\"parameters\"},{\"name\":\"p_vec\",\"type\":{\"name\":\"vector\",\"length\":" << N << "},\"block\":\"parameters\"},{\"name\":\"p_1d_vec\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}},\"block\":\"parameters\"},{\"name\":\"p_3d_vec\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << M << ",\"element_type\":{\"name\":\"array\",\"length\":" << K << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}}}},\"block\":\"parameters\"},{\"name\":\"p_row_vec\",\"type\":{\"name\":\"vector\",\"length\":" << N << "},\"block\":\"parameters\"},{\"name\":\"p_1d_row_vec\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}},\"block\":\"parameters\"},{\"name\":\"p_3d_row_vec\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << M << ",\"element_type\":{\"name\":\"array\",\"length\":" << K << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}}}},\"block\":\"parameters\"},{\"name\":\"p_ar_mat\",\"type\":{\"name\":\"array\",\"length\":" << 4 << ",\"element_type\":{\"name\":\"array\",\"length\":" << 5 << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << 2 << ",\"cols\":" << 3 << "}}},\"block\":\"parameters\"},{\"name\":\"p_simplex\",\"type\":{\"name\":\"vector\",\"length\":" << (N - 1) << "},\"block\":\"parameters\"},{\"name\":\"p_1d_simplex\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << (N - 1) << "}},\"block\":\"parameters\"},{\"name\":\"p_3d_simplex\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << M << ",\"element_type\":{\"name\":\"array\",\"length\":" << K << ",\"element_type\":{\"name\":\"vector\",\"length\":" << (N - 1) << "}}}},\"block\":\"parameters\"},{\"name\":\"p_cfcov_54\",\"type\":{\"name\":\"vector\",\"length\":" << ((((4 * (4 - 1)) / 2) + 4) + ((5 - 4) * 4)) << "},\"block\":\"parameters\"},{\"name\":\"p_cfcov_33\",\"type\":{\"name\":\"vector\",\"length\":" << ((((3 * (3 - 1)) / 2) + 3) + ((3 - 3) * 3)) << "},\"block\":\"parameters\"},{\"name\":\"p_cfcov_33_ar\",\"type\":{\"name\":\"array\",\"length\":" << K << ",\"element_type\":{\"name\":\"vector\",\"length\":" << ((((3 * (3 - 1)) / 2) + 3) + ((3 - 3) * 3)) << "}},\"block\":\"parameters\"},{\"name\":\"x_p\",\"type\":{\"name\":\"vector\",\"length\":" << 2 << "},\"block\":\"parameters\"},{\"name\":\"y_p\",\"type\":{\"name\":\"vector\",\"length\":" << 2 << "},\"block\":\"parameters\"},{\"name\":\"tp_real_1d_ar\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_real_3d_ar\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << M << ",\"element_type\":{\"name\":\"array\",\"length\":" << K << ",\"element_type\":{\"name\":\"real\"}}}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_vec\",\"type\":{\"name\":\"vector\",\"length\":" << N << "},\"block\":\"transformed_parameters\"},{\"name\":\"tp_1d_vec\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_3d_vec\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << M << ",\"element_type\":{\"name\":\"array\",\"length\":" << K << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}}}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_row_vec\",\"type\":{\"name\":\"vector\",\"length\":" << N << "},\"block\":\"transformed_parameters\"},{\"name\":\"tp_1d_row_vec\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_3d_row_vec\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << M << ",\"element_type\":{\"name\":\"array\",\"length\":" << K << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}}}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_ar_mat\",\"type\":{\"name\":\"array\",\"length\":" << 4 << ",\"element_type\":{\"name\":\"array\",\"length\":" << 5 << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << 2 << ",\"cols\":" << 3 << "}}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_simplex\",\"type\":{\"name\":\"vector\",\"length\":" << (N - 1) << "},\"block\":\"transformed_parameters\"},{\"name\":\"tp_1d_simplex\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << (N - 1) << "}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_3d_simplex\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << M << ",\"element_type\":{\"name\":\"array\",\"length\":" << K << ",\"element_type\":{\"name\":\"vector\",\"length\":" << (N - 1) << "}}}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_cfcov_54\",\"type\":{\"name\":\"vector\",\"length\":" << ((((4 * (4 - 1)) / 2) + 4) + ((5 - 4) * 4)) << "},\"block\":\"transformed_parameters\"},{\"name\":\"tp_cfcov_33\",\"type\":{\"name\":\"vector\",\"length\":" << ((((3 * (3 - 1)) / 2) + 3) + ((3 - 3) * 3)) << "},\"block\":\"transformed_parameters\"},{\"name\":\"tp_cfcov_33_ar\",\"type\":{\"name\":\"array\",\"length\":" << K << ",\"element_type\":{\"name\":\"vector\",\"length\":" << ((((3 * (3 - 1)) / 2) + 3) + ((3 - 3) * 3)) << "}},\"block\":\"transformed_parameters\"},{\"name\":\"theta_p\",\"type\":{\"name\":\"vector\",\"length\":" << 2 << "},\"block\":\"transformed_parameters\"},{\"name\":\"tp_real\",\"type\":{\"name\":\"real\"},\"block\":\"transformed_parameters\"},{\"name\":\"gq_r1\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"gq_r2\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"gq_real_1d_ar\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"generated_quantities\"},{\"name\":\"gq_real_3d_ar\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << M << ",\"element_type\":{\"name\":\"array\",\"length\":" << K << ",\"element_type\":{\"name\":\"real\"}}}},\"block\":\"generated_quantities\"},{\"name\":\"gq_vec\",\"type\":{\"name\":\"vector\",\"length\":" << N << "},\"block\":\"generated_quantities\"},{\"name\":\"gq_1d_vec\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}},\"block\":\"generated_quantities\"},{\"name\":\"gq_3d_vec\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << M << ",\"element_type\":{\"name\":\"array\",\"length\":" << K << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}}}},\"block\":\"generated_quantities\"},{\"name\":\"gq_row_vec\",\"type\":{\"name\":\"vector\",\"length\":" << N << "},\"block\":\"generated_quantities\"},{\"name\":\"gq_1d_row_vec\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}},\"block\":\"generated_quantities\"},{\"name\":\"gq_3d_row_vec\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << M << ",\"element_type\":{\"name\":\"array\",\"length\":" << K << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}}}},\"block\":\"generated_quantities\"},{\"name\":\"gq_ar_mat\",\"type\":{\"name\":\"array\",\"length\":" << 4 << ",\"element_type\":{\"name\":\"array\",\"length\":" << 5 << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << 2 << ",\"cols\":" << 3 << "}}},\"block\":\"generated_quantities\"},{\"name\":\"gq_simplex\",\"type\":{\"name\":\"vector\",\"length\":" << (N - 1) << "},\"block\":\"generated_quantities\"},{\"name\":\"gq_1d_simplex\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << (N - 1) << "}},\"block\":\"generated_quantities\"},{\"name\":\"gq_3d_simplex\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << M << ",\"element_type\":{\"name\":\"array\",\"length\":" << K << ",\"element_type\":{\"name\":\"vector\",\"length\":" << (N - 1) << "}}}},\"block\":\"generated_quantities\"},{\"name\":\"gq_cfcov_54\",\"type\":{\"name\":\"vector\",\"length\":" << ((((4 * (4 - 1)) / 2) + 4) + ((5 - 4) * 4)) << "},\"block\":\"generated_quantities\"},{\"name\":\"gq_cfcov_33\",\"type\":{\"name\":\"vector\",\"length\":" << ((((3 * (3 - 1)) / 2) + 3) + ((3 - 3) * 3)) << "},\"block\":\"generated_quantities\"},{\"name\":\"gq_cfcov_33_ar\",\"type\":{\"name\":\"array\",\"length\":" << K << ",\"element_type\":{\"name\":\"vector\",\"length\":" << ((((3 * (3 - 1)) / 2) + 3) + ((3 - 3) * 3)) << "}},\"block\":\"generated_quantities\"},{\"name\":\"indices\",\"type\":{\"name\":\"array\",\"length\":" << 3 << ",\"element_type\":{\"name\":\"int\"}},\"block\":\"generated_quantities\"},{\"name\":\"indexing_mat\",\"type\":{\"name\":\"array\",\"length\":" << 5 << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << 3 << ",\"cols\":" << 4 << "}},\"block\":\"generated_quantities\"},{\"name\":\"idx_res1\",\"type\":{\"name\":\"array\",\"length\":" << 3 << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << 3 << ",\"cols\":" << 4 << "}},\"block\":\"generated_quantities\"},{\"name\":\"idx_res2\",\"type\":{\"name\":\"array\",\"length\":" << 5 << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << 3 << ",\"cols\":" << 4 << "}},\"block\":\"generated_quantities\"},{\"name\":\"idx_res3\",\"type\":{\"name\":\"array\",\"length\":" << 3 << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << 3 << ",\"cols\":" << 3 << "}},\"block\":\"generated_quantities\"},{\"name\":\"idx_res11\",\"type\":{\"name\":\"array\",\"length\":" << 3 << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << 3 << ",\"cols\":" << 4 << "}},\"block\":\"generated_quantities\"},{\"name\":\"idx_res21\",\"type\":{\"name\":\"array\",\"length\":" << 5 << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << 3 << ",\"cols\":" << 4 << "}},\"block\":\"generated_quantities\"},{\"name\":\"idx_res31\",\"type\":{\"name\":\"array\",\"length\":" << 3 << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << 3 << ",\"cols\":" << 3 << "}},\"block\":\"generated_quantities\"},{\"name\":\"idx_res4\",\"type\":{\"name\":\"array\",\"length\":" << 3 << ",\"element_type\":{\"name\":\"vector\",\"length\":" << 4 << "}},\"block\":\"generated_quantities\"},{\"name\":\"idx_res5\",\"type\":{\"name\":\"array\",\"length\":" << 2 << ",\"element_type\":{\"name\":\"vector\",\"length\":" << 2 << "}},\"block\":\"generated_quantities\"}]"); } // get_unconstrained_sizedtypes() @@ -10023,14 +10699,13 @@ class mother_model final : public model_base_crtp { const bool emit_transformed_parameters = true, const bool emit_generated_quantities = true, std::ostream* pstream = nullptr) const { - std::vector vars_vec(vars.size()); + std::vector vars_vec; + vars_vec.reserve(vars.size()); std::vector params_i; write_array_impl(base_rng, params_r, params_i, vars_vec, emit_transformed_parameters, emit_generated_quantities, pstream); - vars.resize(vars_vec.size()); - for (int i = 0; i < vars.size(); ++i) { - vars.coeffRef(i) = vars_vec[i]; - } + vars = Eigen::Map>( + vars_vec.data(), vars_vec.size()); } template @@ -10040,7 +10715,8 @@ class mother_model final : public model_base_crtp { bool emit_transformed_parameters = true, bool emit_generated_quantities = true, std::ostream* pstream = nullptr) const { - write_array_impl(base_rng, params_r, params_i, vars, emit_transformed_parameters, emit_generated_quantities, pstream); + write_array_impl(base_rng, params_r, params_i, vars, + emit_transformed_parameters, emit_generated_quantities, pstream); } template @@ -10061,13 +10737,12 @@ class mother_model final : public model_base_crtp { inline void transform_inits(const stan::io::var_context& context, Eigen::Matrix& params_r, std::ostream* pstream = nullptr) const final { - std::vector params_r_vec(params_r.size()); + std::vector params_r_vec; + params_r_vec.reserve(params_r.size()); std::vector params_i; transform_inits_impl(context, params_i, params_r_vec, pstream); - params_r.resize(params_r_vec.size()); - for (int i = 0; i < params_r.size(); ++i) { - params_r.coeffRef(i) = params_r_vec[i]; - } + params_r = Eigen::Map>( + params_r_vec.data(), params_r_vec.size()); } inline void transform_inits(const stan::io::var_context& context, std::vector& params_i, @@ -10298,7 +10973,7 @@ sho(const T0__& t, const std::vector& y, (void) DUMMY_VAR__; // suppress unused var warning try { std::vector dydt; - dydt = std::vector(2, DUMMY_VAR__); + dydt = std::vector(2, DUMMY_VAR__); current_statement__ = 141; assign(dydt, rvalue(y, "y", index_uni(2)), @@ -10491,7 +11166,7 @@ algebra_system(const T0__& x_arg__, const T1__& y_arg__, try { Eigen::Matrix f_x; f_x = Eigen::Matrix(2); - stan::math::fill(f_x, DUMMY_VAR__); + stan::math::fill(f_x, DUMMY_VAR__); current_statement__ = 154; assign(f_x, @@ -10563,13 +11238,13 @@ class motherHOF_model final : public model_base_crtp { (void) DUMMY_VAR__; // suppress unused var warning try { int pos__; - pos__ = std::numeric_limits::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; current_statement__ = 123; context__.validate_dims("data initialization","T","int", - context__.to_vec()); - T = std::numeric_limits::min(); + std::vector{}); + T = std::numeric_limits::min(); current_statement__ = 123; T = context__.vals_i("T")[(1 - 1)]; @@ -10578,15 +11253,16 @@ class motherHOF_model final : public model_base_crtp { check_greater_or_equal(function__, "T", T, 1); current_statement__ = 124; context__.validate_dims("data initialization","y0_d","double", - context__.to_vec(2)); + std::vector{static_cast(2)}); y0_d = std::vector(2, std::numeric_limits::quiet_NaN()); + current_statement__ = 124; y0_d = context__.vals_r("y0_d"); current_statement__ = 125; context__.validate_dims("data initialization","t0","double", - context__.to_vec()); - t0 = std::numeric_limits::quiet_NaN(); + std::vector{}); + t0 = std::numeric_limits::quiet_NaN(); current_statement__ = 125; t0 = context__.vals_r("t0")[(1 - 1)]; @@ -10594,51 +11270,53 @@ class motherHOF_model final : public model_base_crtp { validate_non_negative_index("ts", "T", T); current_statement__ = 127; context__.validate_dims("data initialization","ts","double", - context__.to_vec(T)); - ts = std::vector(T, std::numeric_limits::quiet_NaN()); + std::vector{static_cast(T)}); + ts = std::vector(T, std::numeric_limits::quiet_NaN()); current_statement__ = 127; ts = context__.vals_r("ts"); current_statement__ = 128; context__.validate_dims("data initialization","theta_d","double", - context__.to_vec(1)); + std::vector{static_cast(1)}); theta_d = std::vector(1, std::numeric_limits::quiet_NaN()); + current_statement__ = 128; theta_d = context__.vals_r("theta_d"); current_statement__ = 129; context__.validate_dims("data initialization","x","double", - context__.to_vec(0)); - x = std::vector(0, std::numeric_limits::quiet_NaN()); + std::vector{static_cast(0)}); + x = std::vector(0, std::numeric_limits::quiet_NaN()); current_statement__ = 129; x = context__.vals_r("x"); current_statement__ = 130; context__.validate_dims("data initialization","x_int","int", - context__.to_vec(0)); - x_int = std::vector(0, std::numeric_limits::min()); + std::vector{static_cast(0)}); + x_int = std::vector(0, std::numeric_limits::min()); current_statement__ = 130; x_int = context__.vals_i("x_int"); current_statement__ = 131; context__.validate_dims("data initialization","x_d_r","double", - context__.to_vec(0)); + std::vector{static_cast(0)}); x_d_r = std::vector(0, std::numeric_limits::quiet_NaN()); + current_statement__ = 131; x_d_r = context__.vals_r("x_d_r"); current_statement__ = 132; context__.validate_dims("data initialization","x_d_i","int", - context__.to_vec(0)); - x_d_i = std::vector(0, std::numeric_limits::min()); + std::vector{static_cast(0)}); + x_d_i = std::vector(0, std::numeric_limits::min()); current_statement__ = 132; x_d_i = context__.vals_i("x_d_i"); current_statement__ = 133; context__.validate_dims("data initialization","shared_params_d", - "double",context__.to_vec(3)); + "double", std::vector{static_cast(3)}); shared_params_d = Eigen::Matrix(3); - stan::math::fill(shared_params_d, std::numeric_limits::quiet_NaN()); + stan::math::fill(shared_params_d, std::numeric_limits::quiet_NaN()); { std::vector shared_params_d_flat__; @@ -10652,13 +11330,15 @@ class motherHOF_model final : public model_base_crtp { assign(shared_params_d, shared_params_d_flat__[(pos__ - 1)], "assigning variable shared_params_d", index_uni(sym1__)); current_statement__ = 133; - pos__ = (pos__ + 1);} + pos__ = (pos__ + 1); + } } current_statement__ = 134; context__.validate_dims("data initialization","job_params_d","double", - context__.to_vec(3, 3)); + std::vector{static_cast(3), + static_cast(3)}); job_params_d = std::vector>(3, Eigen::Matrix(3)); - stan::math::fill(job_params_d, std::numeric_limits::quiet_NaN()); + stan::math::fill(job_params_d, std::numeric_limits::quiet_NaN()); { std::vector job_params_d_flat__; @@ -10675,12 +11355,16 @@ class motherHOF_model final : public model_base_crtp { "assigning variable job_params_d", index_uni(sym2__), index_uni(sym1__)); current_statement__ = 134; - pos__ = (pos__ + 1);}} + pos__ = (pos__ + 1); + } + } } current_statement__ = 135; context__.validate_dims("data initialization","data_r","double", - context__.to_vec(3, 3)); + std::vector{static_cast(3), + static_cast(3)}); data_r = std::vector>(3, std::vector(3, std::numeric_limits::quiet_NaN())); + { std::vector data_r_flat__; @@ -10697,12 +11381,16 @@ class motherHOF_model final : public model_base_crtp { "assigning variable data_r", index_uni(sym2__), index_uni(sym1__)); current_statement__ = 135; - pos__ = (pos__ + 1);}} + pos__ = (pos__ + 1); + } + } } current_statement__ = 136; context__.validate_dims("data initialization","data_i","int", - context__.to_vec(3, 3)); + std::vector{static_cast(3), + static_cast(3)}); data_i = std::vector>(3, std::vector(3, std::numeric_limits::min())); + { std::vector data_i_flat__; @@ -10719,7 +11407,9 @@ class motherHOF_model final : public model_base_crtp { "assigning variable data_i", index_uni(sym2__), index_uni(sym1__)); current_statement__ = 136; - pos__ = (pos__ + 1);}} + pos__ = (pos__ + 1); + } + } } current_statement__ = 137; validate_non_negative_index("theta_p", "1", 1); @@ -10732,21 +11422,8 @@ class motherHOF_model final : public model_base_crtp { // Next line prevents compiler griping about no return throw std::runtime_error("*** IF YOU SEE THIS, PLEASE REPORT A BUG ***"); } - num_params_r__ = 0U; + num_params_r__ = 2 + 1 + 1 + 2 + 3 + (3 * 3) + 1; - try { - num_params_r__ += 2; - num_params_r__ += 1; - num_params_r__ += 1; - num_params_r__ += 2; - num_params_r__ += 3; - num_params_r__ += 3 * 3; - num_params_r__ += 1; - } catch (const std::exception& e) { - stan::lang::rethrow_located(e, locations_array__[current_statement__]); - // Next line prevents compiler griping about no return - throw std::runtime_error("*** IF YOU SEE THIS, PLEASE REPORT A BUG ***"); - } } template { try { std::vector y0_p; - y0_p = std::vector(2, DUMMY_VAR__); + y0_p = std::vector(2, DUMMY_VAR__); current_statement__ = 1; y0_p = in__.template read>(2); std::vector theta_p; - theta_p = std::vector(1, DUMMY_VAR__); + theta_p = std::vector(1, DUMMY_VAR__); current_statement__ = 2; theta_p = in__.template read>(1); std::vector x_p; - x_p = std::vector(1, DUMMY_VAR__); + x_p = std::vector(1, DUMMY_VAR__); current_statement__ = 3; x_p = in__.template read>(1); Eigen::Matrix x_p_v; x_p_v = Eigen::Matrix(2); - stan::math::fill(x_p_v, DUMMY_VAR__); + stan::math::fill(x_p_v, DUMMY_VAR__); current_statement__ = 4; x_p_v = in__.template read>(2); Eigen::Matrix shared_params_p; shared_params_p = Eigen::Matrix(3); - stan::math::fill(shared_params_p, DUMMY_VAR__); + stan::math::fill(shared_params_p, DUMMY_VAR__); current_statement__ = 5; shared_params_p = in__.template read>( 3); std::vector> job_params_p; job_params_p = std::vector>(3, Eigen::Matrix(3)); - stan::math::fill(job_params_p, DUMMY_VAR__); + stan::math::fill(job_params_p, DUMMY_VAR__); current_statement__ = 6; job_params_p = in__.template read>>( 3, 3); local_scalar_t__ x_r; - x_r = DUMMY_VAR__; + x_r = DUMMY_VAR__; current_statement__ = 7; x_r = in__.template read(); local_scalar_t__ abc1_p; - abc1_p = DUMMY_VAR__; + abc1_p = DUMMY_VAR__; current_statement__ = 8; abc1_p = 3; local_scalar_t__ abc2_p; - abc2_p = DUMMY_VAR__; + abc2_p = DUMMY_VAR__; current_statement__ = 9; abc2_p = map_rectfake(abc1_p, pstream__); local_scalar_t__ abc3_p; - abc3_p = DUMMY_VAR__; + abc3_p = DUMMY_VAR__; current_statement__ = 10; abc3_p = map_rectfake(12, pstream__); Eigen::Matrix y_hat_tp1; y_hat_tp1 = Eigen::Matrix(3); - stan::math::fill(y_hat_tp1, DUMMY_VAR__); + stan::math::fill(y_hat_tp1, DUMMY_VAR__); current_statement__ = 11; assign(y_hat_tp1, @@ -10832,7 +11509,7 @@ class motherHOF_model final : public model_base_crtp { data_i, pstream__), "assigning variable y_hat_tp1"); Eigen::Matrix y_hat_tp2; y_hat_tp2 = Eigen::Matrix(3); - stan::math::fill(y_hat_tp2, DUMMY_VAR__); + stan::math::fill(y_hat_tp2, DUMMY_VAR__); current_statement__ = 12; assign(y_hat_tp2, @@ -10840,7 +11517,7 @@ class motherHOF_model final : public model_base_crtp { data_i, pstream__), "assigning variable y_hat_tp2"); Eigen::Matrix y_hat_tp3; y_hat_tp3 = Eigen::Matrix(3); - stan::math::fill(y_hat_tp3, DUMMY_VAR__); + stan::math::fill(y_hat_tp3, DUMMY_VAR__); current_statement__ = 13; assign(y_hat_tp3, @@ -10848,19 +11525,19 @@ class motherHOF_model final : public model_base_crtp { data_i, pstream__), "assigning variable y_hat_tp3"); Eigen::Matrix theta_p_as; theta_p_as = Eigen::Matrix(2); - stan::math::fill(theta_p_as, DUMMY_VAR__); + stan::math::fill(theta_p_as, DUMMY_VAR__); Eigen::Matrix x_v; x_v = Eigen::Matrix(2); - stan::math::fill(x_v, DUMMY_VAR__); + stan::math::fill(x_v, DUMMY_VAR__); Eigen::Matrix y_v; y_v = Eigen::Matrix(2); - stan::math::fill(y_v, DUMMY_VAR__); + stan::math::fill(y_v, DUMMY_VAR__); Eigen::Matrix y_p; y_p = Eigen::Matrix(2); - stan::math::fill(y_p, DUMMY_VAR__); + stan::math::fill(y_p, DUMMY_VAR__); current_statement__ = 18; assign(theta_p_as, @@ -10923,6 +11600,7 @@ class motherHOF_model final : public model_base_crtp { validate_non_negative_index("y_hat", "T", T); std::vector> y_hat; y_hat = std::vector>(T, std::vector(2, DUMMY_VAR__)); + current_statement__ = 82; assign(y_hat, @@ -10997,7 +11675,7 @@ class motherHOF_model final : public model_base_crtp { integrate_ode_rk45(sho_functor__(), y0_p, t0, ts, theta_p, x, x_int, pstream__), "assigning variable y_hat"); local_scalar_t__ y_1d; - y_1d = DUMMY_VAR__; + y_1d = DUMMY_VAR__; current_statement__ = 100; y_1d = integrate_1d(integrand_functor__(), 0, 1, x, x_d_r, x_d_i, @@ -11033,7 +11711,7 @@ class motherHOF_model final : public model_base_crtp { y_1d = integrate_1d(integrand_functor__(), x_r, x_r, x_d_r, x_d_r, x_d_i, pstream__); local_scalar_t__ z_1d; - z_1d = DUMMY_VAR__; + z_1d = DUMMY_VAR__; current_statement__ = 111; z_1d = integrate_1d(integrand_functor__(), 0, 1, x, x_d_r, x_d_i, @@ -11069,7 +11747,7 @@ class motherHOF_model final : public model_base_crtp { z_1d = integrate_1d(integrand_functor__(), x_r, x_r, x_d_r, x_d_r, x_d_i, pstream__, 1e-8); local_scalar_t__ abc_m; - abc_m = DUMMY_VAR__; + abc_m = DUMMY_VAR__; current_statement__ = 122; abc_m = map_rectfake(abc1_p, pstream__); @@ -11108,94 +11786,104 @@ class motherHOF_model final : public model_base_crtp { try { std::vector y0_p; y0_p = std::vector(2, std::numeric_limits::quiet_NaN()); + current_statement__ = 1; y0_p = in__.template read>(2); std::vector theta_p; theta_p = std::vector(1, std::numeric_limits::quiet_NaN()); + current_statement__ = 2; theta_p = in__.template read>(1); std::vector x_p; x_p = std::vector(1, std::numeric_limits::quiet_NaN()); + current_statement__ = 3; x_p = in__.template read>(1); Eigen::Matrix x_p_v; x_p_v = Eigen::Matrix(2); - stan::math::fill(x_p_v, std::numeric_limits::quiet_NaN()); + stan::math::fill(x_p_v, std::numeric_limits::quiet_NaN()); current_statement__ = 4; x_p_v = in__.template read>(2); Eigen::Matrix shared_params_p; shared_params_p = Eigen::Matrix(3); - stan::math::fill(shared_params_p, std::numeric_limits::quiet_NaN()); + stan::math::fill(shared_params_p, std::numeric_limits::quiet_NaN()); current_statement__ = 5; shared_params_p = in__.template read>( 3); std::vector> job_params_p; job_params_p = std::vector>(3, Eigen::Matrix(3)); - stan::math::fill(job_params_p, std::numeric_limits::quiet_NaN()); + stan::math::fill(job_params_p, std::numeric_limits::quiet_NaN()); current_statement__ = 6; job_params_p = in__.template read>>( 3, 3); double x_r; - x_r = std::numeric_limits::quiet_NaN(); + x_r = std::numeric_limits::quiet_NaN(); current_statement__ = 7; x_r = in__.template read(); double abc1_p; - abc1_p = std::numeric_limits::quiet_NaN(); + abc1_p = std::numeric_limits::quiet_NaN(); double abc2_p; - abc2_p = std::numeric_limits::quiet_NaN(); + abc2_p = std::numeric_limits::quiet_NaN(); double abc3_p; - abc3_p = std::numeric_limits::quiet_NaN(); + abc3_p = std::numeric_limits::quiet_NaN(); Eigen::Matrix y_hat_tp1; y_hat_tp1 = Eigen::Matrix(3); - stan::math::fill(y_hat_tp1, std::numeric_limits::quiet_NaN()); + stan::math::fill(y_hat_tp1, std::numeric_limits::quiet_NaN()); Eigen::Matrix y_hat_tp2; y_hat_tp2 = Eigen::Matrix(3); - stan::math::fill(y_hat_tp2, std::numeric_limits::quiet_NaN()); + stan::math::fill(y_hat_tp2, std::numeric_limits::quiet_NaN()); Eigen::Matrix y_hat_tp3; y_hat_tp3 = Eigen::Matrix(3); - stan::math::fill(y_hat_tp3, std::numeric_limits::quiet_NaN()); + stan::math::fill(y_hat_tp3, std::numeric_limits::quiet_NaN()); Eigen::Matrix theta_p_as; theta_p_as = Eigen::Matrix(2); - stan::math::fill(theta_p_as, std::numeric_limits::quiet_NaN()); + stan::math::fill(theta_p_as, std::numeric_limits::quiet_NaN()); Eigen::Matrix x_v; x_v = Eigen::Matrix(2); - stan::math::fill(x_v, std::numeric_limits::quiet_NaN()); + stan::math::fill(x_v, std::numeric_limits::quiet_NaN()); Eigen::Matrix y_v; y_v = Eigen::Matrix(2); - stan::math::fill(y_v, std::numeric_limits::quiet_NaN()); + stan::math::fill(y_v, std::numeric_limits::quiet_NaN()); Eigen::Matrix y_p; y_p = Eigen::Matrix(2); - stan::math::fill(y_p, std::numeric_limits::quiet_NaN()); + stan::math::fill(y_p, std::numeric_limits::quiet_NaN()); for (int sym1__ = 1; sym1__ <= 2; ++sym1__) { - vars__.emplace_back(y0_p[(sym1__ - 1)]);} + vars__.emplace_back(y0_p[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= 1; ++sym1__) { - vars__.emplace_back(theta_p[(sym1__ - 1)]);} + vars__.emplace_back(theta_p[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= 1; ++sym1__) { - vars__.emplace_back(x_p[(sym1__ - 1)]);} + vars__.emplace_back(x_p[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= 2; ++sym1__) { - vars__.emplace_back(x_p_v[(sym1__ - 1)]);} + vars__.emplace_back(x_p_v[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= 3; ++sym1__) { - vars__.emplace_back(shared_params_p[(sym1__ - 1)]);} + vars__.emplace_back(shared_params_p[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= 3; ++sym1__) { for (int sym2__ = 1; sym2__ <= 3; ++sym2__) { - vars__.emplace_back(job_params_p[(sym2__ - 1)][(sym1__ - 1)]);}} + vars__.emplace_back(job_params_p[(sym2__ - 1)][(sym1__ - 1)]); + } + } vars__.emplace_back(x_r); if (logical_negation((primitive_value(emit_transformed_parameters__) || primitive_value(emit_generated_quantities__)))) { @@ -11280,25 +11968,33 @@ class motherHOF_model final : public model_base_crtp { vars__.emplace_back(abc2_p); vars__.emplace_back(abc3_p); for (int sym1__ = 1; sym1__ <= 3; ++sym1__) { - vars__.emplace_back(y_hat_tp1[(sym1__ - 1)]);} + vars__.emplace_back(y_hat_tp1[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= 3; ++sym1__) { - vars__.emplace_back(y_hat_tp2[(sym1__ - 1)]);} + vars__.emplace_back(y_hat_tp2[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= 3; ++sym1__) { - vars__.emplace_back(y_hat_tp3[(sym1__ - 1)]);} + vars__.emplace_back(y_hat_tp3[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= 2; ++sym1__) { - vars__.emplace_back(theta_p_as[(sym1__ - 1)]);} + vars__.emplace_back(theta_p_as[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= 2; ++sym1__) { - vars__.emplace_back(x_v[(sym1__ - 1)]);} + vars__.emplace_back(x_v[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= 2; ++sym1__) { - vars__.emplace_back(y_v[(sym1__ - 1)]);} + vars__.emplace_back(y_v[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= 2; ++sym1__) { - vars__.emplace_back(y_p[(sym1__ - 1)]);} + vars__.emplace_back(y_p[(sym1__ - 1)]); + } } if (logical_negation(emit_generated_quantities__)) { return ; } std::vector> y_hat; y_hat = std::vector>(T, std::vector(2, std::numeric_limits::quiet_NaN())); + current_statement__ = 33; assign(y_hat, @@ -11381,7 +12077,7 @@ class motherHOF_model final : public model_base_crtp { integrate_ode_rk45(sho_functor__(), y0_p, t0, ts, theta_p, x, x_int, pstream__), "assigning variable y_hat"); double y_1d; - y_1d = std::numeric_limits::quiet_NaN(); + y_1d = std::numeric_limits::quiet_NaN(); current_statement__ = 53; y_1d = integrate_1d(integrand_functor__(), 0, 1, x, x_d_r, x_d_i, @@ -11396,7 +12092,7 @@ class motherHOF_model final : public model_base_crtp { y_1d = integrate_1d(integrand_functor__(), 0.0, 1.0, x, x_d_r, x_d_i, pstream__); double z_1d; - z_1d = std::numeric_limits::quiet_NaN(); + z_1d = std::numeric_limits::quiet_NaN(); current_statement__ = 57; z_1d = integrate_1d(integrand_functor__(), 0, 1, x, x_d_r, x_d_i, @@ -11411,18 +12107,18 @@ class motherHOF_model final : public model_base_crtp { z_1d = integrate_1d(integrand_functor__(), 0.0, 1.0, x, x_d_r, x_d_i, pstream__, 1e-8); double abc1_gq; - abc1_gq = std::numeric_limits::quiet_NaN(); + abc1_gq = std::numeric_limits::quiet_NaN(); current_statement__ = 61; abc1_gq = map_rectfake(12, pstream__); double abc2_gq; - abc2_gq = std::numeric_limits::quiet_NaN(); + abc2_gq = std::numeric_limits::quiet_NaN(); current_statement__ = 62; abc2_gq = map_rectfake(abc1_p, pstream__); Eigen::Matrix y_hat_gq; y_hat_gq = Eigen::Matrix(3); - stan::math::fill(y_hat_gq, std::numeric_limits::quiet_NaN()); + stan::math::fill(y_hat_gq, std::numeric_limits::quiet_NaN()); current_statement__ = 63; assign(y_hat_gq, @@ -11433,7 +12129,7 @@ class motherHOF_model final : public model_base_crtp { data_i, pstream__)), "assigning variable y_hat_gq"); Eigen::Matrix yy_hat_gq; yy_hat_gq = Eigen::Matrix(3); - stan::math::fill(yy_hat_gq, std::numeric_limits::quiet_NaN()); + stan::math::fill(yy_hat_gq, std::numeric_limits::quiet_NaN()); current_statement__ = 64; assign(yy_hat_gq, @@ -11441,7 +12137,7 @@ class motherHOF_model final : public model_base_crtp { data_i, pstream__), "assigning variable yy_hat_gq"); Eigen::Matrix theta_dbl; theta_dbl = Eigen::Matrix(2); - stan::math::fill(theta_dbl, std::numeric_limits::quiet_NaN()); + stan::math::fill(theta_dbl, std::numeric_limits::quiet_NaN()); current_statement__ = 66; assign(theta_dbl, @@ -11501,17 +12197,22 @@ class motherHOF_model final : public model_base_crtp { x_d_i, pstream__, 0.01, 0.01, 10), "assigning variable theta_dbl"); for (int sym1__ = 1; sym1__ <= 2; ++sym1__) { for (int sym2__ = 1; sym2__ <= T; ++sym2__) { - vars__.emplace_back(y_hat[(sym2__ - 1)][(sym1__ - 1)]);}} + vars__.emplace_back(y_hat[(sym2__ - 1)][(sym1__ - 1)]); + } + } vars__.emplace_back(y_1d); vars__.emplace_back(z_1d); vars__.emplace_back(abc1_gq); vars__.emplace_back(abc2_gq); for (int sym1__ = 1; sym1__ <= 3; ++sym1__) { - vars__.emplace_back(y_hat_gq[(sym1__ - 1)]);} + vars__.emplace_back(y_hat_gq[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= 3; ++sym1__) { - vars__.emplace_back(yy_hat_gq[(sym1__ - 1)]);} + vars__.emplace_back(yy_hat_gq[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= 2; ++sym1__) { - vars__.emplace_back(theta_dbl[(sym1__ - 1)]);} + vars__.emplace_back(theta_dbl[(sym1__ - 1)]); + } } catch (const std::exception& e) { stan::lang::rethrow_located(e, locations_array__[current_statement__]); // Next line prevents compiler griping about no return @@ -11532,27 +12233,30 @@ class motherHOF_model final : public model_base_crtp { try { int pos__; - pos__ = std::numeric_limits::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; std::vector y0_p; y0_p = std::vector(2, std::numeric_limits::quiet_NaN()); + current_statement__ = 1; y0_p = context__.vals_r("y0_p"); std::vector theta_p; theta_p = std::vector(1, std::numeric_limits::quiet_NaN()); + current_statement__ = 2; theta_p = context__.vals_r("theta_p"); std::vector x_p; x_p = std::vector(1, std::numeric_limits::quiet_NaN()); + current_statement__ = 3; x_p = context__.vals_r("x_p"); Eigen::Matrix x_p_v; x_p_v = Eigen::Matrix(2); - stan::math::fill(x_p_v, std::numeric_limits::quiet_NaN()); + stan::math::fill(x_p_v, std::numeric_limits::quiet_NaN()); { std::vector x_p_v_flat__; @@ -11566,11 +12270,12 @@ class motherHOF_model final : public model_base_crtp { assign(x_p_v, x_p_v_flat__[(pos__ - 1)], "assigning variable x_p_v", index_uni(sym1__)); current_statement__ = 4; - pos__ = (pos__ + 1);} + pos__ = (pos__ + 1); + } } Eigen::Matrix shared_params_p; shared_params_p = Eigen::Matrix(3); - stan::math::fill(shared_params_p, std::numeric_limits::quiet_NaN()); + stan::math::fill(shared_params_p, std::numeric_limits::quiet_NaN()); { std::vector shared_params_p_flat__; @@ -11584,11 +12289,12 @@ class motherHOF_model final : public model_base_crtp { assign(shared_params_p, shared_params_p_flat__[(pos__ - 1)], "assigning variable shared_params_p", index_uni(sym1__)); current_statement__ = 5; - pos__ = (pos__ + 1);} + pos__ = (pos__ + 1); + } } std::vector> job_params_p; job_params_p = std::vector>(3, Eigen::Matrix(3)); - stan::math::fill(job_params_p, std::numeric_limits::quiet_NaN()); + stan::math::fill(job_params_p, std::numeric_limits::quiet_NaN()); { std::vector job_params_p_flat__; @@ -11605,26 +12311,35 @@ class motherHOF_model final : public model_base_crtp { "assigning variable job_params_p", index_uni(sym2__), index_uni(sym1__)); current_statement__ = 6; - pos__ = (pos__ + 1);}} + pos__ = (pos__ + 1); + } + } } double x_r; - x_r = std::numeric_limits::quiet_NaN(); + x_r = std::numeric_limits::quiet_NaN(); current_statement__ = 7; x_r = context__.vals_r("x_r")[(1 - 1)]; for (int sym1__ = 1; sym1__ <= 2; ++sym1__) { - vars__.emplace_back(y0_p[(sym1__ - 1)]);} + vars__.emplace_back(y0_p[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= 1; ++sym1__) { - vars__.emplace_back(theta_p[(sym1__ - 1)]);} + vars__.emplace_back(theta_p[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= 1; ++sym1__) { - vars__.emplace_back(x_p[(sym1__ - 1)]);} + vars__.emplace_back(x_p[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= 2; ++sym1__) { - vars__.emplace_back(x_p_v[(sym1__ - 1)]);} + vars__.emplace_back(x_p_v[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= 3; ++sym1__) { - vars__.emplace_back(shared_params_p[(sym1__ - 1)]);} + vars__.emplace_back(shared_params_p[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= 3; ++sym1__) { for (int sym2__ = 1; sym2__ <= 3; ++sym2__) { - vars__.emplace_back(job_params_p[(sym1__ - 1)][(sym2__ - 1)]);}} + vars__.emplace_back(job_params_p[(sym1__ - 1)][(sym2__ - 1)]); + } + } vars__.emplace_back(x_r); } catch (const std::exception& e) { stan::lang::rethrow_located(e, locations_array__[current_statement__]); @@ -11635,31 +12350,12 @@ class motherHOF_model final : public model_base_crtp { inline void get_param_names(std::vector& names__) const { - names__ = std::vector{"y0_p", - "theta_p", - "x_p", - "x_p_v", - "shared_params_p", - "job_params_p", - "x_r", - "abc1_p", - "abc2_p", - "abc3_p", - "y_hat_tp1", - "y_hat_tp2", - "y_hat_tp3", - "theta_p_as", - "x_v", - "y_v", - "y_p", - "y_hat", - "y_1d", - "z_1d", - "abc1_gq", - "abc2_gq", - "y_hat_gq", - "yy_hat_gq", - "theta_dbl"}; + names__ = std::vector{"y0_p", "theta_p", "x_p", "x_p_v", + "shared_params_p", "job_params_p", "x_r", "abc1_p", "abc2_p", "abc3_p", + "y_hat_tp1", "y_hat_tp2", "y_hat_tp3", "theta_p_as", "x_v", "y_v", + "y_p", "y_hat", "y_1d", "z_1d", "abc1_gq", "abc2_gq", "y_hat_gq", + "yy_hat_gq", "theta_dbl"}; + } // get_param_names() inline void get_dims(std::vector>& dimss__) const { @@ -11667,30 +12363,25 @@ class motherHOF_model final : public model_base_crtp { dimss__ = std::vector>{std::vector{ static_cast(2) }, - std::vector{static_cast(1)}, - std::vector{static_cast(1)}, - std::vector{static_cast(2)}, - std::vector{static_cast(3)}, - std::vector{static_cast(3), static_cast(3)}, - std::vector{}, - std::vector{}, - std::vector{}, - std::vector{}, - std::vector{static_cast(3)}, - std::vector{static_cast(3)}, - std::vector{static_cast(3)}, - std::vector{static_cast(2)}, - std::vector{static_cast(2)}, - std::vector{static_cast(2)}, - std::vector{static_cast(2)}, - std::vector{static_cast(T), static_cast(2)}, - std::vector{}, - std::vector{}, - std::vector{}, - std::vector{}, - std::vector{static_cast(3)}, - std::vector{static_cast(3)}, - std::vector{static_cast(2)}}; + std::vector{static_cast(1)}, + std::vector{static_cast(1)}, + std::vector{static_cast(2)}, + std::vector{static_cast(3)}, + std::vector{static_cast(3), static_cast(3)}, + std::vector{}, std::vector{}, std::vector{ + }, std::vector{}, std::vector{static_cast(3)}, + std::vector{static_cast(3)}, + std::vector{static_cast(3)}, + std::vector{static_cast(2)}, + std::vector{static_cast(2)}, + std::vector{static_cast(2)}, + std::vector{static_cast(2)}, + std::vector{static_cast(T), static_cast(2)}, + std::vector{}, std::vector{}, std::vector{ + }, std::vector{}, std::vector{static_cast(3)}, + std::vector{static_cast(3)}, + std::vector{static_cast(2)}}; + } // get_dims() inline void constrained_param_names( @@ -11702,30 +12393,37 @@ class motherHOF_model final : public model_base_crtp { for (int sym1__ = 1; sym1__ <= 2; ++sym1__) { { param_names__.emplace_back(std::string() + "y0_p" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= 1; ++sym1__) { { param_names__.emplace_back(std::string() + "theta_p" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= 1; ++sym1__) { { param_names__.emplace_back(std::string() + "x_p" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= 2; ++sym1__) { { param_names__.emplace_back(std::string() + "x_p_v" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= 3; ++sym1__) { { param_names__.emplace_back(std::string() + "shared_params_p" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= 3; ++sym1__) { { for (int sym2__ = 1; sym2__ <= 3; ++sym2__) { { param_names__.emplace_back(std::string() + "job_params_p" + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} + } + } + } + } param_names__.emplace_back(std::string() + "x_r"); if (emit_transformed_parameters__) { param_names__.emplace_back(std::string() + "abc1_p"); @@ -11734,31 +12432,38 @@ class motherHOF_model final : public model_base_crtp { for (int sym1__ = 1; sym1__ <= 3; ++sym1__) { { param_names__.emplace_back(std::string() + "y_hat_tp1" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= 3; ++sym1__) { { param_names__.emplace_back(std::string() + "y_hat_tp2" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= 3; ++sym1__) { { param_names__.emplace_back(std::string() + "y_hat_tp3" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= 2; ++sym1__) { { param_names__.emplace_back(std::string() + "theta_p_as" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= 2; ++sym1__) { { param_names__.emplace_back(std::string() + "x_v" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= 2; ++sym1__) { { param_names__.emplace_back(std::string() + "y_v" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= 2; ++sym1__) { { param_names__.emplace_back(std::string() + "y_p" + '.' + std::to_string(sym1__)); - }} + } + } } if (emit_generated_quantities__) { @@ -11767,8 +12472,10 @@ class motherHOF_model final : public model_base_crtp { for (int sym2__ = 1; sym2__ <= T; ++sym2__) { { param_names__.emplace_back(std::string() + "y_hat" + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} + } + } + } + } param_names__.emplace_back(std::string() + "y_1d"); param_names__.emplace_back(std::string() + "z_1d"); param_names__.emplace_back(std::string() + "abc1_gq"); @@ -11776,15 +12483,18 @@ class motherHOF_model final : public model_base_crtp { for (int sym1__ = 1; sym1__ <= 3; ++sym1__) { { param_names__.emplace_back(std::string() + "y_hat_gq" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= 3; ++sym1__) { { param_names__.emplace_back(std::string() + "yy_hat_gq" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= 2; ++sym1__) { { param_names__.emplace_back(std::string() + "theta_dbl" + '.' + std::to_string(sym1__)); - }} + } + } } } // constrained_param_names() @@ -11798,30 +12508,37 @@ class motherHOF_model final : public model_base_crtp { for (int sym1__ = 1; sym1__ <= 2; ++sym1__) { { param_names__.emplace_back(std::string() + "y0_p" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= 1; ++sym1__) { { param_names__.emplace_back(std::string() + "theta_p" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= 1; ++sym1__) { { param_names__.emplace_back(std::string() + "x_p" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= 2; ++sym1__) { { param_names__.emplace_back(std::string() + "x_p_v" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= 3; ++sym1__) { { param_names__.emplace_back(std::string() + "shared_params_p" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= 3; ++sym1__) { { for (int sym2__ = 1; sym2__ <= 3; ++sym2__) { { param_names__.emplace_back(std::string() + "job_params_p" + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} + } + } + } + } param_names__.emplace_back(std::string() + "x_r"); if (emit_transformed_parameters__) { param_names__.emplace_back(std::string() + "abc1_p"); @@ -11830,31 +12547,38 @@ class motherHOF_model final : public model_base_crtp { for (int sym1__ = 1; sym1__ <= 3; ++sym1__) { { param_names__.emplace_back(std::string() + "y_hat_tp1" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= 3; ++sym1__) { { param_names__.emplace_back(std::string() + "y_hat_tp2" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= 3; ++sym1__) { { param_names__.emplace_back(std::string() + "y_hat_tp3" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= 2; ++sym1__) { { param_names__.emplace_back(std::string() + "theta_p_as" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= 2; ++sym1__) { { param_names__.emplace_back(std::string() + "x_v" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= 2; ++sym1__) { { param_names__.emplace_back(std::string() + "y_v" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= 2; ++sym1__) { { param_names__.emplace_back(std::string() + "y_p" + '.' + std::to_string(sym1__)); - }} + } + } } if (emit_generated_quantities__) { @@ -11863,8 +12587,10 @@ class motherHOF_model final : public model_base_crtp { for (int sym2__ = 1; sym2__ <= T; ++sym2__) { { param_names__.emplace_back(std::string() + "y_hat" + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} + } + } + } + } param_names__.emplace_back(std::string() + "y_1d"); param_names__.emplace_back(std::string() + "z_1d"); param_names__.emplace_back(std::string() + "abc1_gq"); @@ -11872,27 +12598,32 @@ class motherHOF_model final : public model_base_crtp { for (int sym1__ = 1; sym1__ <= 3; ++sym1__) { { param_names__.emplace_back(std::string() + "y_hat_gq" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= 3; ++sym1__) { { param_names__.emplace_back(std::string() + "yy_hat_gq" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= 2; ++sym1__) { { param_names__.emplace_back(std::string() + "theta_dbl" + '.' + std::to_string(sym1__)); - }} + } + } } } // unconstrained_param_names() - inline std::string get_constrained_sizedtypes() const final { + inline std::string get_constrained_sizedtypes() const { + + return std::string("[{\"name\":\"y0_p\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(2) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"theta_p\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(1) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"x_p\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(1) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"x_p_v\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(2) + "},\"block\":\"parameters\"},{\"name\":\"shared_params_p\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(3) + "},\"block\":\"parameters\"},{\"name\":\"job_params_p\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(3) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(3) + "}},\"block\":\"parameters\"},{\"name\":\"x_r\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"abc1_p\",\"type\":{\"name\":\"real\"},\"block\":\"transformed_parameters\"},{\"name\":\"abc2_p\",\"type\":{\"name\":\"real\"},\"block\":\"transformed_parameters\"},{\"name\":\"abc3_p\",\"type\":{\"name\":\"real\"},\"block\":\"transformed_parameters\"},{\"name\":\"y_hat_tp1\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(3) + "},\"block\":\"transformed_parameters\"},{\"name\":\"y_hat_tp2\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(3) + "},\"block\":\"transformed_parameters\"},{\"name\":\"y_hat_tp3\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(3) + "},\"block\":\"transformed_parameters\"},{\"name\":\"theta_p_as\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(2) + "},\"block\":\"transformed_parameters\"},{\"name\":\"x_v\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(2) + "},\"block\":\"transformed_parameters\"},{\"name\":\"y_v\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(2) + "},\"block\":\"transformed_parameters\"},{\"name\":\"y_p\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(2) + "},\"block\":\"transformed_parameters\"},{\"name\":\"y_hat\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(T) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(2) + ",\"element_type\":{\"name\":\"real\"}}},\"block\":\"generated_quantities\"},{\"name\":\"y_1d\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"z_1d\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"abc1_gq\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"abc2_gq\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"y_hat_gq\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(3) + "},\"block\":\"generated_quantities\"},{\"name\":\"yy_hat_gq\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(3) + "},\"block\":\"generated_quantities\"},{\"name\":\"theta_dbl\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(2) + "},\"block\":\"generated_quantities\"}]"); - return std::string("[{\"name\":\"y0_p\",\"type\":{\"name\":\"array\",\"length\":" << 2 << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"theta_p\",\"type\":{\"name\":\"array\",\"length\":" << 1 << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"x_p\",\"type\":{\"name\":\"array\",\"length\":" << 1 << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"x_p_v\",\"type\":{\"name\":\"vector\",\"length\":" << 2 << "},\"block\":\"parameters\"},{\"name\":\"shared_params_p\",\"type\":{\"name\":\"vector\",\"length\":" << 3 << "},\"block\":\"parameters\"},{\"name\":\"job_params_p\",\"type\":{\"name\":\"array\",\"length\":" << 3 << ",\"element_type\":{\"name\":\"vector\",\"length\":" << 3 << "}},\"block\":\"parameters\"},{\"name\":\"x_r\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"abc1_p\",\"type\":{\"name\":\"real\"},\"block\":\"transformed_parameters\"},{\"name\":\"abc2_p\",\"type\":{\"name\":\"real\"},\"block\":\"transformed_parameters\"},{\"name\":\"abc3_p\",\"type\":{\"name\":\"real\"},\"block\":\"transformed_parameters\"},{\"name\":\"y_hat_tp1\",\"type\":{\"name\":\"vector\",\"length\":" << 3 << "},\"block\":\"transformed_parameters\"},{\"name\":\"y_hat_tp2\",\"type\":{\"name\":\"vector\",\"length\":" << 3 << "},\"block\":\"transformed_parameters\"},{\"name\":\"y_hat_tp3\",\"type\":{\"name\":\"vector\",\"length\":" << 3 << "},\"block\":\"transformed_parameters\"},{\"name\":\"theta_p_as\",\"type\":{\"name\":\"vector\",\"length\":" << 2 << "},\"block\":\"transformed_parameters\"},{\"name\":\"x_v\",\"type\":{\"name\":\"vector\",\"length\":" << 2 << "},\"block\":\"transformed_parameters\"},{\"name\":\"y_v\",\"type\":{\"name\":\"vector\",\"length\":" << 2 << "},\"block\":\"transformed_parameters\"},{\"name\":\"y_p\",\"type\":{\"name\":\"vector\",\"length\":" << 2 << "},\"block\":\"transformed_parameters\"},{\"name\":\"y_hat\",\"type\":{\"name\":\"array\",\"length\":" << T << ",\"element_type\":{\"name\":\"array\",\"length\":" << 2 << ",\"element_type\":{\"name\":\"real\"}}},\"block\":\"generated_quantities\"},{\"name\":\"y_1d\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"z_1d\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"abc1_gq\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"abc2_gq\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"y_hat_gq\",\"type\":{\"name\":\"vector\",\"length\":" << 3 << "},\"block\":\"generated_quantities\"},{\"name\":\"yy_hat_gq\",\"type\":{\"name\":\"vector\",\"length\":" << 3 << "},\"block\":\"generated_quantities\"},{\"name\":\"theta_dbl\",\"type\":{\"name\":\"vector\",\"length\":" << 2 << "},\"block\":\"generated_quantities\"}]"); } // get_constrained_sizedtypes() - inline std::string get_unconstrained_sizedtypes() const final { + inline std::string get_unconstrained_sizedtypes() const { + + return std::string("[{\"name\":\"y0_p\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(2) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"theta_p\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(1) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"x_p\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(1) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"x_p_v\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(2) + "},\"block\":\"parameters\"},{\"name\":\"shared_params_p\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(3) + "},\"block\":\"parameters\"},{\"name\":\"job_params_p\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(3) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(3) + "}},\"block\":\"parameters\"},{\"name\":\"x_r\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"abc1_p\",\"type\":{\"name\":\"real\"},\"block\":\"transformed_parameters\"},{\"name\":\"abc2_p\",\"type\":{\"name\":\"real\"},\"block\":\"transformed_parameters\"},{\"name\":\"abc3_p\",\"type\":{\"name\":\"real\"},\"block\":\"transformed_parameters\"},{\"name\":\"y_hat_tp1\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(3) + "},\"block\":\"transformed_parameters\"},{\"name\":\"y_hat_tp2\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(3) + "},\"block\":\"transformed_parameters\"},{\"name\":\"y_hat_tp3\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(3) + "},\"block\":\"transformed_parameters\"},{\"name\":\"theta_p_as\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(2) + "},\"block\":\"transformed_parameters\"},{\"name\":\"x_v\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(2) + "},\"block\":\"transformed_parameters\"},{\"name\":\"y_v\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(2) + "},\"block\":\"transformed_parameters\"},{\"name\":\"y_p\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(2) + "},\"block\":\"transformed_parameters\"},{\"name\":\"y_hat\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(T) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(2) + ",\"element_type\":{\"name\":\"real\"}}},\"block\":\"generated_quantities\"},{\"name\":\"y_1d\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"z_1d\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"abc1_gq\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"abc2_gq\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"y_hat_gq\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(3) + "},\"block\":\"generated_quantities\"},{\"name\":\"yy_hat_gq\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(3) + "},\"block\":\"generated_quantities\"},{\"name\":\"theta_dbl\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(2) + "},\"block\":\"generated_quantities\"}]"); - return std::string("[{\"name\":\"y0_p\",\"type\":{\"name\":\"array\",\"length\":" << 2 << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"theta_p\",\"type\":{\"name\":\"array\",\"length\":" << 1 << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"x_p\",\"type\":{\"name\":\"array\",\"length\":" << 1 << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"x_p_v\",\"type\":{\"name\":\"vector\",\"length\":" << 2 << "},\"block\":\"parameters\"},{\"name\":\"shared_params_p\",\"type\":{\"name\":\"vector\",\"length\":" << 3 << "},\"block\":\"parameters\"},{\"name\":\"job_params_p\",\"type\":{\"name\":\"array\",\"length\":" << 3 << ",\"element_type\":{\"name\":\"vector\",\"length\":" << 3 << "}},\"block\":\"parameters\"},{\"name\":\"x_r\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"abc1_p\",\"type\":{\"name\":\"real\"},\"block\":\"transformed_parameters\"},{\"name\":\"abc2_p\",\"type\":{\"name\":\"real\"},\"block\":\"transformed_parameters\"},{\"name\":\"abc3_p\",\"type\":{\"name\":\"real\"},\"block\":\"transformed_parameters\"},{\"name\":\"y_hat_tp1\",\"type\":{\"name\":\"vector\",\"length\":" << 3 << "},\"block\":\"transformed_parameters\"},{\"name\":\"y_hat_tp2\",\"type\":{\"name\":\"vector\",\"length\":" << 3 << "},\"block\":\"transformed_parameters\"},{\"name\":\"y_hat_tp3\",\"type\":{\"name\":\"vector\",\"length\":" << 3 << "},\"block\":\"transformed_parameters\"},{\"name\":\"theta_p_as\",\"type\":{\"name\":\"vector\",\"length\":" << 2 << "},\"block\":\"transformed_parameters\"},{\"name\":\"x_v\",\"type\":{\"name\":\"vector\",\"length\":" << 2 << "},\"block\":\"transformed_parameters\"},{\"name\":\"y_v\",\"type\":{\"name\":\"vector\",\"length\":" << 2 << "},\"block\":\"transformed_parameters\"},{\"name\":\"y_p\",\"type\":{\"name\":\"vector\",\"length\":" << 2 << "},\"block\":\"transformed_parameters\"},{\"name\":\"y_hat\",\"type\":{\"name\":\"array\",\"length\":" << T << ",\"element_type\":{\"name\":\"array\",\"length\":" << 2 << ",\"element_type\":{\"name\":\"real\"}}},\"block\":\"generated_quantities\"},{\"name\":\"y_1d\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"z_1d\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"abc1_gq\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"abc2_gq\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"y_hat_gq\",\"type\":{\"name\":\"vector\",\"length\":" << 3 << "},\"block\":\"generated_quantities\"},{\"name\":\"yy_hat_gq\",\"type\":{\"name\":\"vector\",\"length\":" << 3 << "},\"block\":\"generated_quantities\"},{\"name\":\"theta_dbl\",\"type\":{\"name\":\"vector\",\"length\":" << 2 << "},\"block\":\"generated_quantities\"}]"); } // get_unconstrained_sizedtypes() @@ -11904,14 +12635,13 @@ class motherHOF_model final : public model_base_crtp { const bool emit_transformed_parameters = true, const bool emit_generated_quantities = true, std::ostream* pstream = nullptr) const { - std::vector vars_vec(vars.size()); + std::vector vars_vec; + vars_vec.reserve(vars.size()); std::vector params_i; write_array_impl(base_rng, params_r, params_i, vars_vec, emit_transformed_parameters, emit_generated_quantities, pstream); - vars.resize(vars_vec.size()); - for (int i = 0; i < vars.size(); ++i) { - vars.coeffRef(i) = vars_vec[i]; - } + vars = Eigen::Map>( + vars_vec.data(), vars_vec.size()); } template @@ -11921,7 +12651,8 @@ class motherHOF_model final : public model_base_crtp { bool emit_transformed_parameters = true, bool emit_generated_quantities = true, std::ostream* pstream = nullptr) const { - write_array_impl(base_rng, params_r, params_i, vars, emit_transformed_parameters, emit_generated_quantities, pstream); + write_array_impl(base_rng, params_r, params_i, vars, + emit_transformed_parameters, emit_generated_quantities, pstream); } template @@ -11942,13 +12673,12 @@ class motherHOF_model final : public model_base_crtp { inline void transform_inits(const stan::io::var_context& context, Eigen::Matrix& params_r, std::ostream* pstream = nullptr) const final { - std::vector params_r_vec(params_r.size()); + std::vector params_r_vec; + params_r_vec.reserve(params_r.size()); std::vector params_i; transform_inits_impl(context, params_i, params_r_vec, pstream); - params_r.resize(params_r_vec.size()); - for (int i = 0; i < params_r.size(); ++i) { - params_r.coeffRef(i) = params_r_vec[i]; - } + params_r = Eigen::Map>( + params_r_vec.data(), params_r_vec.size()); } inline void transform_inits(const stan::io::var_context& context, std::vector& params_i, @@ -12839,27 +13569,27 @@ class new_integrate_interface_model final : public model_base_crtp::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; current_statement__ = 601; context__.validate_dims("data initialization","N","int", - context__.to_vec()); - N = std::numeric_limits::min(); + std::vector{}); + N = std::numeric_limits::min(); current_statement__ = 601; N = context__.vals_i("N")[(1 - 1)]; current_statement__ = 602; context__.validate_dims("data initialization","id","int", - context__.to_vec()); - id = std::numeric_limits::min(); + std::vector{}); + id = std::numeric_limits::min(); current_statement__ = 602; id = context__.vals_i("id")[(1 - 1)]; current_statement__ = 603; context__.validate_dims("data initialization","rd","double", - context__.to_vec()); - rd = std::numeric_limits::quiet_NaN(); + std::vector{}); + rd = std::numeric_limits::quiet_NaN(); current_statement__ = 603; rd = context__.vals_r("rd")[(1 - 1)]; @@ -12867,8 +13597,9 @@ class new_integrate_interface_model final : public model_base_crtp{static_cast(N)}); rad = std::vector(N, std::numeric_limits::quiet_NaN()); + current_statement__ = 605; rad = context__.vals_r("rad"); @@ -12876,9 +13607,9 @@ class new_integrate_interface_model final : public model_base_crtp{static_cast(N)}); vd = Eigen::Matrix(N); - stan::math::fill(vd, std::numeric_limits::quiet_NaN()); + stan::math::fill(vd, std::numeric_limits::quiet_NaN()); { std::vector vd_flat__; @@ -12892,15 +13623,14 @@ class new_integrate_interface_model final : public model_base_crtp>(N, Eigen::Matrix(N)); - stan::math::fill(zd, std::numeric_limits::quiet_NaN()); current_statement__ = 610; assign(zd, @@ -12961,17 +13691,8 @@ class new_integrate_interface_model final : public model_base_crtp(); std::vector ra; - ra = std::vector(N, DUMMY_VAR__); + ra = std::vector(N, DUMMY_VAR__); current_statement__ = 2; ra = in__.template read>(N); Eigen::Matrix v; v = Eigen::Matrix(N); - stan::math::fill(v, DUMMY_VAR__); + stan::math::fill(v, DUMMY_VAR__); current_statement__ = 3; v = in__.template read>(N); std::vector> z; z = std::vector>(N, Eigen::Matrix(N)); - stan::math::fill(z, DUMMY_VAR__); + stan::math::fill(z, DUMMY_VAR__); current_statement__ = 4; assign(z, @@ -13712,7 +14433,7 @@ class new_integrate_interface_model final : public model_base_crtp> zm; zm = std::vector>(N, Eigen::Matrix(N)); - stan::math::fill(zm, DUMMY_VAR__); + stan::math::fill(zm, DUMMY_VAR__); current_statement__ = 402; assign(zm, @@ -14452,30 +15173,32 @@ class new_integrate_interface_model final : public model_base_crtp::quiet_NaN(); + r = std::numeric_limits::quiet_NaN(); current_statement__ = 1; r = in__.template read(); std::vector ra; - ra = std::vector(N, std::numeric_limits::quiet_NaN()); + ra = std::vector(N, std::numeric_limits::quiet_NaN()); current_statement__ = 2; ra = in__.template read>(N); Eigen::Matrix v; v = Eigen::Matrix(N); - stan::math::fill(v, std::numeric_limits::quiet_NaN()); + stan::math::fill(v, std::numeric_limits::quiet_NaN()); current_statement__ = 3; v = in__.template read>(N); std::vector> z; z = std::vector>(N, Eigen::Matrix(N)); - stan::math::fill(z, std::numeric_limits::quiet_NaN()); + stan::math::fill(z, std::numeric_limits::quiet_NaN()); vars__.emplace_back(r); for (int sym1__ = 1; sym1__ <= N; ++sym1__) { - vars__.emplace_back(ra[(sym1__ - 1)]);} + vars__.emplace_back(ra[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { - vars__.emplace_back(v[(sym1__ - 1)]);} + vars__.emplace_back(v[(sym1__ - 1)]); + } if (logical_negation((primitive_value(emit_transformed_parameters__) || primitive_value(emit_generated_quantities__)))) { return ; @@ -15176,14 +15899,16 @@ class new_integrate_interface_model final : public model_base_crtp> zg; zg = std::vector>(N, Eigen::Matrix(N)); - stan::math::fill(zg, std::numeric_limits::quiet_NaN()); + stan::math::fill(zg, std::numeric_limits::quiet_NaN()); current_statement__ = 202; assign(zg, @@ -15880,7 +16605,9 @@ class new_integrate_interface_model final : public model_base_crtp::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; double r; - r = std::numeric_limits::quiet_NaN(); + r = std::numeric_limits::quiet_NaN(); current_statement__ = 1; r = context__.vals_r("r")[(1 - 1)]; std::vector ra; - ra = std::vector(N, std::numeric_limits::quiet_NaN()); + ra = std::vector(N, std::numeric_limits::quiet_NaN()); current_statement__ = 2; ra = context__.vals_r("ra"); Eigen::Matrix v; v = Eigen::Matrix(N); - stan::math::fill(v, std::numeric_limits::quiet_NaN()); + stan::math::fill(v, std::numeric_limits::quiet_NaN()); { std::vector v_flat__; @@ -15930,13 +16657,16 @@ class new_integrate_interface_model final : public model_base_crtp& names__) const { - names__ = std::vector{"r", - "ra", - "v", - "z", - "zg"}; + names__ = std::vector{"r", "ra", "v", "z", "zg"}; + } // get_param_names() inline void get_dims(std::vector>& dimss__) const { dimss__ = std::vector>{std::vector{}, - std::vector{static_cast(N)}, - std::vector{static_cast(N)}, - std::vector{static_cast(N), static_cast(N)}, - std::vector{static_cast(N), static_cast(N)}}; + std::vector{static_cast(N)}, + std::vector{static_cast(N)}, + std::vector{static_cast(N), static_cast(N)}, + std::vector{static_cast(N), static_cast(N)}}; + } // get_dims() inline void constrained_param_names( @@ -15972,19 +16700,23 @@ class new_integrate_interface_model final : public model_base_crtp vars_vec(vars.size()); + std::vector vars_vec; + vars_vec.reserve(vars.size()); std::vector params_i; write_array_impl(base_rng, params_r, params_i, vars_vec, emit_transformed_parameters, emit_generated_quantities, pstream); - vars.resize(vars_vec.size()); - for (int i = 0; i < vars.size(); ++i) { - vars.coeffRef(i) = vars_vec[i]; - } + vars = Eigen::Map>( + vars_vec.data(), vars_vec.size()); } template @@ -16072,7 +16813,8 @@ class new_integrate_interface_model final : public model_base_crtp @@ -16093,13 +16835,12 @@ class new_integrate_interface_model final : public model_base_crtp& params_r, std::ostream* pstream = nullptr) const final { - std::vector params_r_vec(params_r.size()); + std::vector params_r_vec; + params_r_vec.reserve(params_r.size()); std::vector params_i; transform_inits_impl(context, params_i, params_r_vec, pstream); - params_r.resize(params_r_vec.size()); - for (int i = 0; i < params_r.size(); ++i) { - params_r.coeffRef(i) = params_r_vec[i]; - } + params_r = Eigen::Map>( + params_r_vec.data(), params_r_vec.size()); } inline void transform_inits(const stan::io::var_context& context, std::vector& params_i, @@ -16204,42 +16945,42 @@ dz_dt(const T0__& t, const std::vector& z, (void) DUMMY_VAR__; // suppress unused var warning try { local_scalar_t__ u; - u = DUMMY_VAR__; + u = DUMMY_VAR__; current_statement__ = 25; u = rvalue(z, "z", index_uni(1)); local_scalar_t__ v; - v = DUMMY_VAR__; + v = DUMMY_VAR__; current_statement__ = 26; v = rvalue(z, "z", index_uni(2)); local_scalar_t__ alpha; - alpha = DUMMY_VAR__; + alpha = DUMMY_VAR__; current_statement__ = 27; alpha = rvalue(theta, "theta", index_uni(1)); local_scalar_t__ beta; - beta = DUMMY_VAR__; + beta = DUMMY_VAR__; current_statement__ = 28; beta = rvalue(theta, "theta", index_uni(2)); local_scalar_t__ gamma; - gamma = DUMMY_VAR__; + gamma = DUMMY_VAR__; current_statement__ = 29; gamma = rvalue(theta, "theta", index_uni(3)); local_scalar_t__ delta; - delta = DUMMY_VAR__; + delta = DUMMY_VAR__; current_statement__ = 30; delta = rvalue(theta, "theta", index_uni(4)); local_scalar_t__ du_dt; - du_dt = DUMMY_VAR__; + du_dt = DUMMY_VAR__; current_statement__ = 31; du_dt = ((alpha - (beta * v)) * u); local_scalar_t__ dv_dt; - dv_dt = DUMMY_VAR__; + dv_dt = DUMMY_VAR__; current_statement__ = 32; dv_dt = ((-gamma + (delta * u)) * v); @@ -16297,13 +17038,13 @@ class old_integrate_interface_model final : public model_base_crtp::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; current_statement__ = 18; context__.validate_dims("data initialization","N","int", - context__.to_vec()); - N = std::numeric_limits::min(); + std::vector{}); + N = std::numeric_limits::min(); current_statement__ = 18; N = context__.vals_i("N")[(1 - 1)]; @@ -16314,15 +17055,16 @@ class old_integrate_interface_model final : public model_base_crtp(N, std::numeric_limits::quiet_NaN()); + std::vector{static_cast(N)}); + ts = std::vector(N, std::numeric_limits::quiet_NaN()); current_statement__ = 20; ts = context__.vals_r("ts"); current_statement__ = 21; context__.validate_dims("data initialization","y_init","double", - context__.to_vec(2)); + std::vector{static_cast(2)}); y_init = std::vector(2, std::numeric_limits::quiet_NaN()); + current_statement__ = 21; y_init = context__.vals_r("y_init"); @@ -16330,8 +17072,10 @@ class old_integrate_interface_model final : public model_base_crtp{static_cast(N), + static_cast(2)}); y = std::vector>(N, std::vector(2, std::numeric_limits::quiet_NaN())); + { std::vector y_flat__; @@ -16347,7 +17091,9 @@ class old_integrate_interface_model final : public model_base_crtp( 0, lp__); local_scalar_t__ beta; - beta = DUMMY_VAR__; + beta = DUMMY_VAR__; current_statement__ = 2; beta = in__.template read_constrain_lb(0, lp__); local_scalar_t__ gamma; - gamma = DUMMY_VAR__; + gamma = DUMMY_VAR__; current_statement__ = 3; gamma = in__.template read_constrain_lb( 0, lp__); local_scalar_t__ delta; - delta = DUMMY_VAR__; + delta = DUMMY_VAR__; current_statement__ = 4; delta = in__.template read_constrain_lb( 0, lp__); std::vector z_init; - z_init = std::vector(2, DUMMY_VAR__); + z_init = std::vector(2, DUMMY_VAR__); current_statement__ = 5; z_init = in__.template read_constrain_lb, jacobian__>( 0, lp__, 2); std::vector sigma; - sigma = std::vector(2, DUMMY_VAR__); + sigma = std::vector(2, DUMMY_VAR__); current_statement__ = 6; sigma = in__.template read_constrain_lb, jacobian__>( 0, lp__, 2); std::vector> z; z = std::vector>(N, std::vector(2, DUMMY_VAR__)); + current_statement__ = 7; assign(z, @@ -16469,7 +17206,8 @@ class old_integrate_interface_model final : public model_base_crtp( rvalue(y, "y", index_omni(), index_uni(k)), stan::math::log(rvalue(z, "z", index_omni(), index_uni(k))), - rvalue(sigma, "sigma", index_uni(k))));} + rvalue(sigma, "sigma", index_uni(k)))); + } } } catch (const std::exception& e) { stan::lang::rethrow_located(e, locations_array__[current_statement__]); @@ -16504,52 +17242,57 @@ class old_integrate_interface_model final : public model_base_crtp::quiet_NaN(); + alpha = std::numeric_limits::quiet_NaN(); current_statement__ = 1; alpha = in__.template read_constrain_lb( 0, lp__); double beta; - beta = std::numeric_limits::quiet_NaN(); + beta = std::numeric_limits::quiet_NaN(); current_statement__ = 2; beta = in__.template read_constrain_lb(0, lp__); double gamma; - gamma = std::numeric_limits::quiet_NaN(); + gamma = std::numeric_limits::quiet_NaN(); current_statement__ = 3; gamma = in__.template read_constrain_lb( 0, lp__); double delta; - delta = std::numeric_limits::quiet_NaN(); + delta = std::numeric_limits::quiet_NaN(); current_statement__ = 4; delta = in__.template read_constrain_lb( 0, lp__); std::vector z_init; z_init = std::vector(2, std::numeric_limits::quiet_NaN()); + current_statement__ = 5; z_init = in__.template read_constrain_lb, jacobian__>( 0, lp__, 2); std::vector sigma; sigma = std::vector(2, std::numeric_limits::quiet_NaN()); + current_statement__ = 6; sigma = in__.template read_constrain_lb, jacobian__>( 0, lp__, 2); std::vector> z; z = std::vector>(N, std::vector(2, std::numeric_limits::quiet_NaN())); + vars__.emplace_back(alpha); vars__.emplace_back(beta); vars__.emplace_back(gamma); vars__.emplace_back(delta); for (int sym1__ = 1; sym1__ <= 2; ++sym1__) { - vars__.emplace_back(z_init[(sym1__ - 1)]);} + vars__.emplace_back(z_init[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= 2; ++sym1__) { - vars__.emplace_back(sigma[(sym1__ - 1)]);} + vars__.emplace_back(sigma[(sym1__ - 1)]); + } if (logical_negation((primitive_value(emit_transformed_parameters__) || primitive_value(emit_generated_quantities__)))) { return ; @@ -16563,7 +17306,9 @@ class old_integrate_interface_model final : public model_base_crtp::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; double alpha; - alpha = std::numeric_limits::quiet_NaN(); + alpha = std::numeric_limits::quiet_NaN(); current_statement__ = 1; alpha = context__.vals_r("alpha")[(1 - 1)]; double alpha_free__; - alpha_free__ = std::numeric_limits::quiet_NaN(); + alpha_free__ = std::numeric_limits::quiet_NaN(); current_statement__ = 1; alpha_free__ = stan::math::lb_free(alpha, 0); double beta; - beta = std::numeric_limits::quiet_NaN(); + beta = std::numeric_limits::quiet_NaN(); current_statement__ = 2; beta = context__.vals_r("beta")[(1 - 1)]; double beta_free__; - beta_free__ = std::numeric_limits::quiet_NaN(); + beta_free__ = std::numeric_limits::quiet_NaN(); current_statement__ = 2; beta_free__ = stan::math::lb_free(beta, 0); double gamma; - gamma = std::numeric_limits::quiet_NaN(); + gamma = std::numeric_limits::quiet_NaN(); current_statement__ = 3; gamma = context__.vals_r("gamma")[(1 - 1)]; double gamma_free__; - gamma_free__ = std::numeric_limits::quiet_NaN(); + gamma_free__ = std::numeric_limits::quiet_NaN(); current_statement__ = 3; gamma_free__ = stan::math::lb_free(gamma, 0); double delta; - delta = std::numeric_limits::quiet_NaN(); + delta = std::numeric_limits::quiet_NaN(); current_statement__ = 4; delta = context__.vals_r("delta")[(1 - 1)]; double delta_free__; - delta_free__ = std::numeric_limits::quiet_NaN(); + delta_free__ = std::numeric_limits::quiet_NaN(); current_statement__ = 4; delta_free__ = stan::math::lb_free(delta, 0); std::vector z_init; z_init = std::vector(2, std::numeric_limits::quiet_NaN()); + current_statement__ = 5; z_init = context__.vals_r("z_init"); std::vector z_init_free__; z_init_free__ = std::vector(2, std::numeric_limits::quiet_NaN()); + current_statement__ = 5; for (int sym1__ = 1; sym1__ <= 2; ++sym1__) { current_statement__ = 5; assign(z_init_free__, stan::math::lb_free(z_init[(sym1__ - 1)], 0), - "assigning variable z_init_free__", index_uni(sym1__));} + "assigning variable z_init_free__", index_uni(sym1__)); + } std::vector sigma; sigma = std::vector(2, std::numeric_limits::quiet_NaN()); + current_statement__ = 6; sigma = context__.vals_r("sigma"); std::vector sigma_free__; sigma_free__ = std::vector(2, std::numeric_limits::quiet_NaN()); + current_statement__ = 6; for (int sym1__ = 1; sym1__ <= 2; ++sym1__) { current_statement__ = 6; assign(sigma_free__, stan::math::lb_free(sigma[(sym1__ - 1)], 0), - "assigning variable sigma_free__", index_uni(sym1__));} + "assigning variable sigma_free__", index_uni(sym1__)); + } vars__.emplace_back(alpha_free__); vars__.emplace_back(beta_free__); vars__.emplace_back(gamma_free__); vars__.emplace_back(delta_free__); for (int sym1__ = 1; sym1__ <= 2; ++sym1__) { - vars__.emplace_back(z_init_free__[(sym1__ - 1)]);} + vars__.emplace_back(z_init_free__[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= 2; ++sym1__) { - vars__.emplace_back(sigma_free__[(sym1__ - 1)]);} + vars__.emplace_back(sigma_free__[(sym1__ - 1)]); + } } catch (const std::exception& e) { stan::lang::rethrow_located(e, locations_array__[current_statement__]); // Next line prevents compiler griping about no return @@ -16674,24 +17427,19 @@ class old_integrate_interface_model final : public model_base_crtp& names__) const { - names__ = std::vector{"alpha", - "beta", - "gamma", - "delta", - "z_init", - "sigma", - "z"}; + names__ = std::vector{"alpha", "beta", "gamma", "delta", + "z_init", "sigma", "z"}; + } // get_param_names() inline void get_dims(std::vector>& dimss__) const { dimss__ = std::vector>{std::vector{}, - std::vector{}, - std::vector{}, - std::vector{}, - std::vector{static_cast(2)}, - std::vector{static_cast(2)}, - std::vector{static_cast(N), static_cast(2)}}; + std::vector{}, std::vector{}, std::vector{ + }, std::vector{static_cast(2)}, + std::vector{static_cast(2)}, + std::vector{static_cast(N), static_cast(2)}}; + } // get_dims() inline void constrained_param_names( @@ -16707,19 +17455,23 @@ class old_integrate_interface_model final : public model_base_crtp vars_vec(vars.size()); + std::vector vars_vec; + vars_vec.reserve(vars.size()); std::vector params_i; write_array_impl(base_rng, params_r, params_i, vars_vec, emit_transformed_parameters, emit_generated_quantities, pstream); - vars.resize(vars_vec.size()); - for (int i = 0; i < vars.size(); ++i) { - vars.coeffRef(i) = vars_vec[i]; - } + vars = Eigen::Map>( + vars_vec.data(), vars_vec.size()); } template @@ -16798,7 +17555,8 @@ class old_integrate_interface_model final : public model_base_crtp @@ -16819,13 +17577,12 @@ class old_integrate_interface_model final : public model_base_crtp& params_r, std::ostream* pstream = nullptr) const final { - std::vector params_r_vec(params_r.size()); + std::vector params_r_vec; + params_r_vec.reserve(params_r.size()); std::vector params_i; transform_inits_impl(context, params_i, params_r_vec, pstream); - params_r.resize(params_r_vec.size()); - for (int i = 0; i < params_r.size(); ++i) { - params_r.coeffRef(i) = params_r_vec[i]; - } + params_r = Eigen::Map>( + params_r_vec.data(), params_r_vec.size()); } inline void transform_inits(const stan::io::var_context& context, std::vector& params_i, @@ -17149,13 +17906,13 @@ class optimize_glm_model final : public model_base_crtp { (void) DUMMY_VAR__; // suppress unused var warning try { int pos__; - pos__ = std::numeric_limits::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; current_statement__ = 176; context__.validate_dims("data initialization","k","int", - context__.to_vec()); - k = std::numeric_limits::min(); + std::vector{}); + k = std::numeric_limits::min(); current_statement__ = 176; k = context__.vals_i("k")[(1 - 1)]; @@ -17164,8 +17921,8 @@ class optimize_glm_model final : public model_base_crtp { check_greater_or_equal(function__, "k", k, 1); current_statement__ = 177; context__.validate_dims("data initialization","n","int", - context__.to_vec()); - n = std::numeric_limits::min(); + std::vector{}); + n = std::numeric_limits::min(); current_statement__ = 177; n = context__.vals_i("n")[(1 - 1)]; @@ -17178,9 +17935,10 @@ class optimize_glm_model final : public model_base_crtp { validate_non_negative_index("X_d", "k", k); current_statement__ = 180; context__.validate_dims("data initialization","X_d","double", - context__.to_vec(n, k)); + std::vector{static_cast(n), + static_cast(k)}); X_d = Eigen::Matrix(n, k); - stan::math::fill(X_d, std::numeric_limits::quiet_NaN()); + stan::math::fill(X_d, std::numeric_limits::quiet_NaN()); { std::vector X_d_flat__; @@ -17196,7 +17954,9 @@ class optimize_glm_model final : public model_base_crtp { assign(X_d, X_d_flat__[(pos__ - 1)], "assigning variable X_d", index_uni(sym2__), index_uni(sym1__)); current_statement__ = 180; - pos__ = (pos__ + 1);}} + pos__ = (pos__ + 1); + } + } } current_statement__ = 181; validate_non_negative_index("X_d_a", "n", n); @@ -17204,9 +17964,10 @@ class optimize_glm_model final : public model_base_crtp { validate_non_negative_index("X_d_a", "k", k); current_statement__ = 183; context__.validate_dims("data initialization","X_d_a","double", - context__.to_vec(2, n, k)); + std::vector{static_cast(2), + static_cast(n), static_cast(k)}); X_d_a = std::vector>(2, Eigen::Matrix(n, k)); - stan::math::fill(X_d_a, std::numeric_limits::quiet_NaN()); + stan::math::fill(X_d_a, std::numeric_limits::quiet_NaN()); { std::vector X_d_a_flat__; @@ -17226,15 +17987,18 @@ class optimize_glm_model final : public model_base_crtp { index_uni(sym2__), index_uni(sym1__)); current_statement__ = 183; - pos__ = (pos__ + 1);}}} + pos__ = (pos__ + 1); + } + } + } } current_statement__ = 184; validate_non_negative_index("y_v_d", "n", n); current_statement__ = 185; context__.validate_dims("data initialization","y_v_d","double", - context__.to_vec(n)); + std::vector{static_cast(n)}); y_v_d = Eigen::Matrix(n); - stan::math::fill(y_v_d, std::numeric_limits::quiet_NaN()); + stan::math::fill(y_v_d, std::numeric_limits::quiet_NaN()); { std::vector y_v_d_flat__; @@ -17248,15 +18012,16 @@ class optimize_glm_model final : public model_base_crtp { assign(y_v_d, y_v_d_flat__[(pos__ - 1)], "assigning variable y_v_d", index_uni(sym1__)); current_statement__ = 185; - pos__ = (pos__ + 1);} + pos__ = (pos__ + 1); + } } current_statement__ = 186; validate_non_negative_index("X_rv_d", "n", n); current_statement__ = 187; context__.validate_dims("data initialization","X_rv_d","double", - context__.to_vec(n)); + std::vector{static_cast(n)}); X_rv_d = Eigen::Matrix(n); - stan::math::fill(X_rv_d, std::numeric_limits::quiet_NaN()); + stan::math::fill(X_rv_d, std::numeric_limits::quiet_NaN()); { std::vector X_rv_d_flat__; @@ -17270,14 +18035,15 @@ class optimize_glm_model final : public model_base_crtp { assign(X_rv_d, X_rv_d_flat__[(pos__ - 1)], "assigning variable X_rv_d", index_uni(sym1__)); current_statement__ = 187; - pos__ = (pos__ + 1);} + pos__ = (pos__ + 1); + } } current_statement__ = 188; validate_non_negative_index("y_vi_d", "n", n); current_statement__ = 189; context__.validate_dims("data initialization","y_vi_d","int", - context__.to_vec(n)); - y_vi_d = std::vector(n, std::numeric_limits::min()); + std::vector{static_cast(n)}); + y_vi_d = std::vector(n, std::numeric_limits::min()); current_statement__ = 189; y_vi_d = context__.vals_i("y_vi_d"); @@ -17285,66 +18051,54 @@ class optimize_glm_model final : public model_base_crtp { validate_non_negative_index("y2_vi_d", "n", n); current_statement__ = 191; context__.validate_dims("data initialization","y2_vi_d","int", - context__.to_vec(n)); - y2_vi_d = std::vector(n, std::numeric_limits::min()); + std::vector{static_cast(n)}); + y2_vi_d = std::vector(n, std::numeric_limits::min()); current_statement__ = 191; y2_vi_d = context__.vals_i("y2_vi_d"); current_statement__ = 192; context__.validate_dims("data initialization","y_s_d","int", - context__.to_vec()); - y_s_d = std::numeric_limits::min(); + std::vector{}); + y_s_d = std::numeric_limits::min(); current_statement__ = 192; y_s_d = context__.vals_i("y_s_d")[(1 - 1)]; current_statement__ = 193; context__.validate_dims("data initialization","y_r_d","double", - context__.to_vec()); - y_r_d = std::numeric_limits::quiet_NaN(); + std::vector{}); + y_r_d = std::numeric_limits::quiet_NaN(); current_statement__ = 193; y_r_d = context__.vals_r("y_r_d")[(1 - 1)]; current_statement__ = 194; - k_td = std::numeric_limits::min(); current_statement__ = 195; - n_td = std::numeric_limits::min(); current_statement__ = 196; validate_non_negative_index("X_d_td", "n", n); current_statement__ = 197; validate_non_negative_index("X_d_td", "k", k); current_statement__ = 198; - X_d_td = Eigen::Matrix(n, k); - stan::math::fill(X_d_td, std::numeric_limits::quiet_NaN()); current_statement__ = 199; validate_non_negative_index("y_v_d_td", "n", n); current_statement__ = 200; - y_v_d_td = Eigen::Matrix(n); - stan::math::fill(y_v_d_td, std::numeric_limits::quiet_NaN()); current_statement__ = 201; validate_non_negative_index("X_rv_d_td", "n", n); current_statement__ = 202; - X_rv_d_td = Eigen::Matrix(n); - stan::math::fill(X_rv_d_td, std::numeric_limits::quiet_NaN()); current_statement__ = 203; validate_non_negative_index("y_vi_d_td", "n", n); current_statement__ = 204; - y_vi_d_td = std::vector(n, std::numeric_limits::min()); current_statement__ = 205; validate_non_negative_index("y2_vi_d_td", "n", n); current_statement__ = 206; - y2_vi_d_td = std::vector(n, std::numeric_limits::min()); current_statement__ = 207; - y_s_d_td = std::numeric_limits::min(); current_statement__ = 208; - y_r_d_td = std::numeric_limits::quiet_NaN(); current_statement__ = 194; current_statement__ = 194; @@ -17373,23 +18127,8 @@ class optimize_glm_model final : public model_base_crtp { // Next line prevents compiler griping about no return throw std::runtime_error("*** IF YOU SEE THIS, PLEASE REPORT A BUG ***"); } - num_params_r__ = 0U; + num_params_r__ = k + k + k + 1 + 1 + 1 + (n * k) + (n * k) + n; - try { - num_params_r__ += k; - num_params_r__ += k; - num_params_r__ += k; - num_params_r__ += 1; - num_params_r__ += 1; - num_params_r__ += 1; - num_params_r__ += n * k; - num_params_r__ += n * k; - num_params_r__ += n; - } catch (const std::exception& e) { - stan::lang::rethrow_located(e, locations_array__[current_statement__]); - // Next line prevents compiler griping about no return - throw std::runtime_error("*** IF YOU SEE THIS, PLEASE REPORT A BUG ***"); - } } template { try { Eigen::Matrix alpha_v; alpha_v = Eigen::Matrix(k); - stan::math::fill(alpha_v, DUMMY_VAR__); + stan::math::fill(alpha_v, DUMMY_VAR__); current_statement__ = 1; alpha_v = in__.template read>(k); Eigen::Matrix beta; beta = Eigen::Matrix(k); - stan::math::fill(beta, DUMMY_VAR__); + stan::math::fill(beta, DUMMY_VAR__); current_statement__ = 2; beta = in__.template read>(k); Eigen::Matrix cuts; cuts = Eigen::Matrix(k); - stan::math::fill(cuts, DUMMY_VAR__); + stan::math::fill(cuts, DUMMY_VAR__); current_statement__ = 3; cuts = in__.template read>(k); local_scalar_t__ sigma; - sigma = DUMMY_VAR__; + sigma = DUMMY_VAR__; current_statement__ = 4; sigma = in__.template read_constrain_lb( 0, lp__); local_scalar_t__ alpha; - alpha = DUMMY_VAR__; + alpha = DUMMY_VAR__; current_statement__ = 5; alpha = in__.template read(); local_scalar_t__ phi; - phi = DUMMY_VAR__; + phi = DUMMY_VAR__; current_statement__ = 6; phi = in__.template read(); Eigen::Matrix X_p; X_p = Eigen::Matrix(n, k); - stan::math::fill(X_p, DUMMY_VAR__); + stan::math::fill(X_p, DUMMY_VAR__); current_statement__ = 7; X_p = in__.template read>(n, k); Eigen::Matrix beta_m; beta_m = Eigen::Matrix(n, k); - stan::math::fill(beta_m, DUMMY_VAR__); + stan::math::fill(beta_m, DUMMY_VAR__); current_statement__ = 8; beta_m = in__.template read>(n, k); Eigen::Matrix X_rv_p; X_rv_p = Eigen::Matrix(n); - stan::math::fill(X_rv_p, DUMMY_VAR__); + stan::math::fill(X_rv_p, DUMMY_VAR__); current_statement__ = 9; X_rv_p = in__.template read>(n); @@ -18035,77 +18774,84 @@ class optimize_glm_model final : public model_base_crtp { try { Eigen::Matrix alpha_v; alpha_v = Eigen::Matrix(k); - stan::math::fill(alpha_v, std::numeric_limits::quiet_NaN()); + stan::math::fill(alpha_v, std::numeric_limits::quiet_NaN()); current_statement__ = 1; alpha_v = in__.template read>(k); Eigen::Matrix beta; beta = Eigen::Matrix(k); - stan::math::fill(beta, std::numeric_limits::quiet_NaN()); + stan::math::fill(beta, std::numeric_limits::quiet_NaN()); current_statement__ = 2; beta = in__.template read>(k); Eigen::Matrix cuts; cuts = Eigen::Matrix(k); - stan::math::fill(cuts, std::numeric_limits::quiet_NaN()); + stan::math::fill(cuts, std::numeric_limits::quiet_NaN()); current_statement__ = 3; cuts = in__.template read>(k); double sigma; - sigma = std::numeric_limits::quiet_NaN(); + sigma = std::numeric_limits::quiet_NaN(); current_statement__ = 4; sigma = in__.template read_constrain_lb( 0, lp__); double alpha; - alpha = std::numeric_limits::quiet_NaN(); + alpha = std::numeric_limits::quiet_NaN(); current_statement__ = 5; alpha = in__.template read(); double phi; - phi = std::numeric_limits::quiet_NaN(); + phi = std::numeric_limits::quiet_NaN(); current_statement__ = 6; phi = in__.template read(); Eigen::Matrix X_p; X_p = Eigen::Matrix(n, k); - stan::math::fill(X_p, std::numeric_limits::quiet_NaN()); + stan::math::fill(X_p, std::numeric_limits::quiet_NaN()); current_statement__ = 7; X_p = in__.template read>(n, k); Eigen::Matrix beta_m; beta_m = Eigen::Matrix(n, k); - stan::math::fill(beta_m, std::numeric_limits::quiet_NaN()); + stan::math::fill(beta_m, std::numeric_limits::quiet_NaN()); current_statement__ = 8; beta_m = in__.template read>(n, k); Eigen::Matrix X_rv_p; X_rv_p = Eigen::Matrix(n); - stan::math::fill(X_rv_p, std::numeric_limits::quiet_NaN()); + stan::math::fill(X_rv_p, std::numeric_limits::quiet_NaN()); current_statement__ = 9; X_rv_p = in__.template read>(n); for (int sym1__ = 1; sym1__ <= k; ++sym1__) { - vars__.emplace_back(alpha_v[(sym1__ - 1)]);} + vars__.emplace_back(alpha_v[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { - vars__.emplace_back(beta[(sym1__ - 1)]);} + vars__.emplace_back(beta[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { - vars__.emplace_back(cuts[(sym1__ - 1)]);} + vars__.emplace_back(cuts[(sym1__ - 1)]); + } vars__.emplace_back(sigma); vars__.emplace_back(alpha); vars__.emplace_back(phi); for (int sym1__ = 1; sym1__ <= k; ++sym1__) { for (int sym2__ = 1; sym2__ <= n; ++sym2__) { vars__.emplace_back( - rvalue(X_p, "X_p", index_uni(sym2__), index_uni(sym1__)));}} + rvalue(X_p, "X_p", index_uni(sym2__), index_uni(sym1__))); + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { for (int sym2__ = 1; sym2__ <= n; ++sym2__) { vars__.emplace_back( - rvalue(beta_m, "beta_m", index_uni(sym2__), index_uni(sym1__)));} + rvalue(beta_m, "beta_m", index_uni(sym2__), index_uni(sym1__))); + } } for (int sym1__ = 1; sym1__ <= n; ++sym1__) { - vars__.emplace_back(X_rv_p[(sym1__ - 1)]);} + vars__.emplace_back(X_rv_p[(sym1__ - 1)]); + } if (logical_negation((primitive_value(emit_transformed_parameters__) || primitive_value(emit_generated_quantities__)))) { return ; @@ -18133,12 +18879,12 @@ class optimize_glm_model final : public model_base_crtp { try { int pos__; - pos__ = std::numeric_limits::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; Eigen::Matrix alpha_v; alpha_v = Eigen::Matrix(k); - stan::math::fill(alpha_v, std::numeric_limits::quiet_NaN()); + stan::math::fill(alpha_v, std::numeric_limits::quiet_NaN()); { std::vector alpha_v_flat__; @@ -18152,11 +18898,12 @@ class optimize_glm_model final : public model_base_crtp { assign(alpha_v, alpha_v_flat__[(pos__ - 1)], "assigning variable alpha_v", index_uni(sym1__)); current_statement__ = 1; - pos__ = (pos__ + 1);} + pos__ = (pos__ + 1); + } } Eigen::Matrix beta; beta = Eigen::Matrix(k); - stan::math::fill(beta, std::numeric_limits::quiet_NaN()); + stan::math::fill(beta, std::numeric_limits::quiet_NaN()); { std::vector beta_flat__; @@ -18170,11 +18917,12 @@ class optimize_glm_model final : public model_base_crtp { assign(beta, beta_flat__[(pos__ - 1)], "assigning variable beta", index_uni(sym1__)); current_statement__ = 2; - pos__ = (pos__ + 1);} + pos__ = (pos__ + 1); + } } Eigen::Matrix cuts; cuts = Eigen::Matrix(k); - stan::math::fill(cuts, std::numeric_limits::quiet_NaN()); + stan::math::fill(cuts, std::numeric_limits::quiet_NaN()); { std::vector cuts_flat__; @@ -18188,31 +18936,32 @@ class optimize_glm_model final : public model_base_crtp { assign(cuts, cuts_flat__[(pos__ - 1)], "assigning variable cuts", index_uni(sym1__)); current_statement__ = 3; - pos__ = (pos__ + 1);} + pos__ = (pos__ + 1); + } } double sigma; - sigma = std::numeric_limits::quiet_NaN(); + sigma = std::numeric_limits::quiet_NaN(); current_statement__ = 4; sigma = context__.vals_r("sigma")[(1 - 1)]; double sigma_free__; - sigma_free__ = std::numeric_limits::quiet_NaN(); + sigma_free__ = std::numeric_limits::quiet_NaN(); current_statement__ = 4; sigma_free__ = stan::math::lb_free(sigma, 0); double alpha; - alpha = std::numeric_limits::quiet_NaN(); + alpha = std::numeric_limits::quiet_NaN(); current_statement__ = 5; alpha = context__.vals_r("alpha")[(1 - 1)]; double phi; - phi = std::numeric_limits::quiet_NaN(); + phi = std::numeric_limits::quiet_NaN(); current_statement__ = 6; phi = context__.vals_r("phi")[(1 - 1)]; Eigen::Matrix X_p; X_p = Eigen::Matrix(n, k); - stan::math::fill(X_p, std::numeric_limits::quiet_NaN()); + stan::math::fill(X_p, std::numeric_limits::quiet_NaN()); { std::vector X_p_flat__; @@ -18228,11 +18977,13 @@ class optimize_glm_model final : public model_base_crtp { assign(X_p, X_p_flat__[(pos__ - 1)], "assigning variable X_p", index_uni(sym2__), index_uni(sym1__)); current_statement__ = 7; - pos__ = (pos__ + 1);}} + pos__ = (pos__ + 1); + } + } } Eigen::Matrix beta_m; beta_m = Eigen::Matrix(n, k); - stan::math::fill(beta_m, std::numeric_limits::quiet_NaN()); + stan::math::fill(beta_m, std::numeric_limits::quiet_NaN()); { std::vector beta_m_flat__; @@ -18249,11 +19000,13 @@ class optimize_glm_model final : public model_base_crtp { "assigning variable beta_m", index_uni(sym2__), index_uni(sym1__)); current_statement__ = 8; - pos__ = (pos__ + 1);}} + pos__ = (pos__ + 1); + } + } } Eigen::Matrix X_rv_p; X_rv_p = Eigen::Matrix(n); - stan::math::fill(X_rv_p, std::numeric_limits::quiet_NaN()); + stan::math::fill(X_rv_p, std::numeric_limits::quiet_NaN()); { std::vector X_rv_p_flat__; @@ -18267,28 +19020,36 @@ class optimize_glm_model final : public model_base_crtp { assign(X_rv_p, X_rv_p_flat__[(pos__ - 1)], "assigning variable X_rv_p", index_uni(sym1__)); current_statement__ = 9; - pos__ = (pos__ + 1);} + pos__ = (pos__ + 1); + } } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { - vars__.emplace_back(alpha_v[(sym1__ - 1)]);} + vars__.emplace_back(alpha_v[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { - vars__.emplace_back(beta[(sym1__ - 1)]);} + vars__.emplace_back(beta[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { - vars__.emplace_back(cuts[(sym1__ - 1)]);} + vars__.emplace_back(cuts[(sym1__ - 1)]); + } vars__.emplace_back(sigma_free__); vars__.emplace_back(alpha); vars__.emplace_back(phi); for (int sym1__ = 1; sym1__ <= k; ++sym1__) { for (int sym2__ = 1; sym2__ <= n; ++sym2__) { vars__.emplace_back( - rvalue(X_p, "X_p", index_uni(sym2__), index_uni(sym1__)));}} + rvalue(X_p, "X_p", index_uni(sym2__), index_uni(sym1__))); + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { for (int sym2__ = 1; sym2__ <= n; ++sym2__) { vars__.emplace_back( - rvalue(beta_m, "beta_m", index_uni(sym2__), index_uni(sym1__)));} + rvalue(beta_m, "beta_m", index_uni(sym2__), index_uni(sym1__))); + } } for (int sym1__ = 1; sym1__ <= n; ++sym1__) { - vars__.emplace_back(X_rv_p[(sym1__ - 1)]);} + vars__.emplace_back(X_rv_p[(sym1__ - 1)]); + } } catch (const std::exception& e) { stan::lang::rethrow_located(e, locations_array__[current_statement__]); // Next line prevents compiler griping about no return @@ -18298,15 +19059,9 @@ class optimize_glm_model final : public model_base_crtp { inline void get_param_names(std::vector& names__) const { - names__ = std::vector{"alpha_v", - "beta", - "cuts", - "sigma", - "alpha", - "phi", - "X_p", - "beta_m", - "X_rv_p"}; + names__ = std::vector{"alpha_v", "beta", "cuts", "sigma", + "alpha", "phi", "X_p", "beta_m", "X_rv_p"}; + } // get_param_names() inline void get_dims(std::vector>& dimss__) const { @@ -18314,14 +19069,13 @@ class optimize_glm_model final : public model_base_crtp { dimss__ = std::vector>{std::vector{ static_cast(k) }, - std::vector{static_cast(k)}, - std::vector{static_cast(k)}, - std::vector{}, - std::vector{}, - std::vector{}, - std::vector{static_cast(n), static_cast(k)}, - std::vector{static_cast(n), static_cast(k)}, - std::vector{static_cast(n)}}; + std::vector{static_cast(k)}, + std::vector{static_cast(k)}, std::vector{ + }, std::vector{}, std::vector{}, + std::vector{static_cast(n), static_cast(k)}, + std::vector{static_cast(n), static_cast(k)}, + std::vector{static_cast(n)}}; + } // get_dims() inline void constrained_param_names( @@ -18333,15 +19087,18 @@ class optimize_glm_model final : public model_base_crtp { for (int sym1__ = 1; sym1__ <= k; ++sym1__) { { param_names__.emplace_back(std::string() + "alpha_v" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { { param_names__.emplace_back(std::string() + "beta" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { { param_names__.emplace_back(std::string() + "cuts" + '.' + std::to_string(sym1__)); - }} + } + } param_names__.emplace_back(std::string() + "sigma"); param_names__.emplace_back(std::string() + "alpha"); param_names__.emplace_back(std::string() + "phi"); @@ -18350,19 +19107,24 @@ class optimize_glm_model final : public model_base_crtp { for (int sym2__ = 1; sym2__ <= n; ++sym2__) { { param_names__.emplace_back(std::string() + "X_p" + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} + } + } + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { { for (int sym2__ = 1; sym2__ <= n; ++sym2__) { { param_names__.emplace_back(std::string() + "beta_m" + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} + } + } + } + } for (int sym1__ = 1; sym1__ <= n; ++sym1__) { { param_names__.emplace_back(std::string() + "X_rv_p" + '.' + std::to_string(sym1__)); - }} + } + } if (emit_transformed_parameters__) { } @@ -18382,15 +19144,18 @@ class optimize_glm_model final : public model_base_crtp { for (int sym1__ = 1; sym1__ <= k; ++sym1__) { { param_names__.emplace_back(std::string() + "alpha_v" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { { param_names__.emplace_back(std::string() + "beta" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { { param_names__.emplace_back(std::string() + "cuts" + '.' + std::to_string(sym1__)); - }} + } + } param_names__.emplace_back(std::string() + "sigma"); param_names__.emplace_back(std::string() + "alpha"); param_names__.emplace_back(std::string() + "phi"); @@ -18399,19 +19164,24 @@ class optimize_glm_model final : public model_base_crtp { for (int sym2__ = 1; sym2__ <= n; ++sym2__) { { param_names__.emplace_back(std::string() + "X_p" + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} + } + } + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { { for (int sym2__ = 1; sym2__ <= n; ++sym2__) { { param_names__.emplace_back(std::string() + "beta_m" + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} + } + } + } + } for (int sym1__ = 1; sym1__ <= n; ++sym1__) { { param_names__.emplace_back(std::string() + "X_rv_p" + '.' + std::to_string(sym1__)); - }} + } + } if (emit_transformed_parameters__) { } @@ -18422,14 +19192,16 @@ class optimize_glm_model final : public model_base_crtp { } // unconstrained_param_names() - inline std::string get_constrained_sizedtypes() const final { + inline std::string get_constrained_sizedtypes() const { + + return std::string("[{\"name\":\"alpha_v\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(k) + "},\"block\":\"parameters\"},{\"name\":\"beta\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(k) + "},\"block\":\"parameters\"},{\"name\":\"cuts\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(k) + "},\"block\":\"parameters\"},{\"name\":\"sigma\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"alpha\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"phi\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"X_p\",\"type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(n) + ",\"cols\":" + std::to_string(k) + "},\"block\":\"parameters\"},{\"name\":\"beta_m\",\"type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(n) + ",\"cols\":" + std::to_string(k) + "},\"block\":\"parameters\"},{\"name\":\"X_rv_p\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(n) + "},\"block\":\"parameters\"}]"); - return std::string("[{\"name\":\"alpha_v\",\"type\":{\"name\":\"vector\",\"length\":" << k << "},\"block\":\"parameters\"},{\"name\":\"beta\",\"type\":{\"name\":\"vector\",\"length\":" << k << "},\"block\":\"parameters\"},{\"name\":\"cuts\",\"type\":{\"name\":\"vector\",\"length\":" << k << "},\"block\":\"parameters\"},{\"name\":\"sigma\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"alpha\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"phi\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"X_p\",\"type\":{\"name\":\"matrix\",\"rows\":" << n << ",\"cols\":" << k << "},\"block\":\"parameters\"},{\"name\":\"beta_m\",\"type\":{\"name\":\"matrix\",\"rows\":" << n << ",\"cols\":" << k << "},\"block\":\"parameters\"},{\"name\":\"X_rv_p\",\"type\":{\"name\":\"vector\",\"length\":" << n << "},\"block\":\"parameters\"}]"); } // get_constrained_sizedtypes() - inline std::string get_unconstrained_sizedtypes() const final { + inline std::string get_unconstrained_sizedtypes() const { + + return std::string("[{\"name\":\"alpha_v\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(k) + "},\"block\":\"parameters\"},{\"name\":\"beta\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(k) + "},\"block\":\"parameters\"},{\"name\":\"cuts\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(k) + "},\"block\":\"parameters\"},{\"name\":\"sigma\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"alpha\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"phi\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"X_p\",\"type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(n) + ",\"cols\":" + std::to_string(k) + "},\"block\":\"parameters\"},{\"name\":\"beta_m\",\"type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(n) + ",\"cols\":" + std::to_string(k) + "},\"block\":\"parameters\"},{\"name\":\"X_rv_p\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(n) + "},\"block\":\"parameters\"}]"); - return std::string("[{\"name\":\"alpha_v\",\"type\":{\"name\":\"vector\",\"length\":" << k << "},\"block\":\"parameters\"},{\"name\":\"beta\",\"type\":{\"name\":\"vector\",\"length\":" << k << "},\"block\":\"parameters\"},{\"name\":\"cuts\",\"type\":{\"name\":\"vector\",\"length\":" << k << "},\"block\":\"parameters\"},{\"name\":\"sigma\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"alpha\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"phi\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"X_p\",\"type\":{\"name\":\"matrix\",\"rows\":" << n << ",\"cols\":" << k << "},\"block\":\"parameters\"},{\"name\":\"beta_m\",\"type\":{\"name\":\"matrix\",\"rows\":" << n << ",\"cols\":" << k << "},\"block\":\"parameters\"},{\"name\":\"X_rv_p\",\"type\":{\"name\":\"vector\",\"length\":" << n << "},\"block\":\"parameters\"}]"); } // get_unconstrained_sizedtypes() @@ -18441,14 +19213,13 @@ class optimize_glm_model final : public model_base_crtp { const bool emit_transformed_parameters = true, const bool emit_generated_quantities = true, std::ostream* pstream = nullptr) const { - std::vector vars_vec(vars.size()); + std::vector vars_vec; + vars_vec.reserve(vars.size()); std::vector params_i; write_array_impl(base_rng, params_r, params_i, vars_vec, emit_transformed_parameters, emit_generated_quantities, pstream); - vars.resize(vars_vec.size()); - for (int i = 0; i < vars.size(); ++i) { - vars.coeffRef(i) = vars_vec[i]; - } + vars = Eigen::Map>( + vars_vec.data(), vars_vec.size()); } template @@ -18458,7 +19229,8 @@ class optimize_glm_model final : public model_base_crtp { bool emit_transformed_parameters = true, bool emit_generated_quantities = true, std::ostream* pstream = nullptr) const { - write_array_impl(base_rng, params_r, params_i, vars, emit_transformed_parameters, emit_generated_quantities, pstream); + write_array_impl(base_rng, params_r, params_i, vars, + emit_transformed_parameters, emit_generated_quantities, pstream); } template @@ -18479,13 +19251,12 @@ class optimize_glm_model final : public model_base_crtp { inline void transform_inits(const stan::io::var_context& context, Eigen::Matrix& params_r, std::ostream* pstream = nullptr) const final { - std::vector params_r_vec(params_r.size()); + std::vector params_r_vec; + params_r_vec.reserve(params_r.size()); std::vector params_i; transform_inits_impl(context, params_i, params_r_vec, pstream); - params_r.resize(params_r_vec.size()); - for (int i = 0; i < params_r.size(); ++i) { - params_r.coeffRef(i) = params_r_vec[i]; - } + params_r = Eigen::Map>( + params_r_vec.data(), params_r_vec.size()); } inline void transform_inits(const stan::io::var_context& context, std::vector& params_i, @@ -18578,20 +19349,20 @@ class param_constraint_model final : public model_base_crtp::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; current_statement__ = 3; context__.validate_dims("data initialization","nt","int", - context__.to_vec()); - nt = std::numeric_limits::min(); + std::vector{}); + nt = std::numeric_limits::min(); current_statement__ = 3; nt = context__.vals_i("nt")[(1 - 1)]; current_statement__ = 4; context__.validate_dims("data initialization","NS","int", - context__.to_vec()); - NS = std::numeric_limits::min(); + std::vector{}); + NS = std::numeric_limits::min(); current_statement__ = 4; NS = context__.vals_i("NS")[(1 - 1)]; @@ -18604,16 +19375,8 @@ class param_constraint_model final : public model_base_crtp> L_Omega; L_Omega = std::vector>(nt, Eigen::Matrix(2, 2)); - stan::math::fill(L_Omega, DUMMY_VAR__); + stan::math::fill(L_Omega, DUMMY_VAR__); current_statement__ = 1; L_Omega = in__.template read_constrain_cholesky_factor_corr>, jacobian__>( lp__, nt, 2); Eigen::Matrix z1; z1 = Eigen::Matrix(NS); - stan::math::fill(z1, DUMMY_VAR__); + stan::math::fill(z1, DUMMY_VAR__); current_statement__ = 2; z1 = in__.template read_constrain_lb, jacobian__>( @@ -18683,14 +19446,14 @@ class param_constraint_model final : public model_base_crtp> L_Omega; L_Omega = std::vector>(nt, Eigen::Matrix(2, 2)); - stan::math::fill(L_Omega, std::numeric_limits::quiet_NaN()); + stan::math::fill(L_Omega, std::numeric_limits::quiet_NaN()); current_statement__ = 1; L_Omega = in__.template read_constrain_cholesky_factor_corr>, jacobian__>( lp__, nt, 2); Eigen::Matrix z1; z1 = Eigen::Matrix(NS); - stan::math::fill(z1, std::numeric_limits::quiet_NaN()); + stan::math::fill(z1, std::numeric_limits::quiet_NaN()); current_statement__ = 2; z1 = in__.template read_constrain_lb, jacobian__>( @@ -18701,9 +19464,13 @@ class param_constraint_model final : public model_base_crtp::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; std::vector> L_Omega; L_Omega = std::vector>(nt, Eigen::Matrix(2, 2)); - stan::math::fill(L_Omega, std::numeric_limits::quiet_NaN()); + stan::math::fill(L_Omega, std::numeric_limits::quiet_NaN()); { std::vector L_Omega_flat__; @@ -18756,22 +19523,26 @@ class param_constraint_model final : public model_base_crtp> L_Omega_free__; L_Omega_free__ = std::vector>(nt, Eigen::Matrix( - ((2 * (2 - 1)) / 2))); - stan::math::fill(L_Omega_free__, std::numeric_limits::quiet_NaN()); + ((2 * (2 - 1)) / 2))); + stan::math::fill(L_Omega_free__, std::numeric_limits::quiet_NaN()); current_statement__ = 1; for (int sym1__ = 1; sym1__ <= nt; ++sym1__) { current_statement__ = 1; assign(L_Omega_free__, stan::math::cholesky_corr_free(L_Omega[(sym1__ - 1)]), - "assigning variable L_Omega_free__", index_uni(sym1__));} + "assigning variable L_Omega_free__", index_uni(sym1__)); + } Eigen::Matrix z1; z1 = Eigen::Matrix(NS); - stan::math::fill(z1, std::numeric_limits::quiet_NaN()); + stan::math::fill(z1, std::numeric_limits::quiet_NaN()); { std::vector z1_flat__; @@ -18785,11 +19556,12 @@ class param_constraint_model final : public model_base_crtp z1_free__; z1_free__ = Eigen::Matrix(NS); - stan::math::fill(z1_free__, std::numeric_limits::quiet_NaN()); + stan::math::fill(z1_free__, std::numeric_limits::quiet_NaN()); current_statement__ = 2; for (int sym1__ = 1; sym1__ <= NS; ++sym1__) { @@ -18798,12 +19570,16 @@ class param_constraint_model final : public model_base_crtp& names__) const { - names__ = std::vector{"L_Omega", - "z1"}; + names__ = std::vector{"L_Omega", "z1"}; + } // get_param_names() inline void get_dims(std::vector>& dimss__) const { @@ -18826,7 +19602,8 @@ class param_constraint_model final : public model_base_crtp(2) }, - std::vector{static_cast(NS)}}; + std::vector{static_cast(NS)}}; + } // get_dims() inline void constrained_param_names( @@ -18842,13 +19619,17 @@ class param_constraint_model final : public model_base_crtp vars_vec(vars.size()); + std::vector vars_vec; + vars_vec.reserve(vars.size()); std::vector params_i; write_array_impl(base_rng, params_r, params_i, vars_vec, emit_transformed_parameters, emit_generated_quantities, pstream); - vars.resize(vars_vec.size()); - for (int i = 0; i < vars.size(); ++i) { - vars.coeffRef(i) = vars_vec[i]; - } + vars = Eigen::Map>( + vars_vec.data(), vars_vec.size()); } template @@ -18922,7 +19707,8 @@ class param_constraint_model final : public model_base_crtp @@ -18943,13 +19729,12 @@ class param_constraint_model final : public model_base_crtp& params_r, std::ostream* pstream = nullptr) const final { - std::vector params_r_vec(params_r.size()); + std::vector params_r_vec; + params_r_vec.reserve(params_r.size()); std::vector params_i; transform_inits_impl(context, params_i, params_r_vec, pstream); - params_r.resize(params_r_vec.size()); - for (int i = 0; i < params_r.size(); ++i) { - params_r.coeffRef(i) = params_r_vec[i]; - } + params_r = Eigen::Map>( + params_r_vec.data(), params_r_vec.size()); } inline void transform_inits(const stan::io::var_context& context, std::vector& params_i, @@ -19205,11 +19990,10 @@ class reduce_sum_m1_model final : public model_base_crtp { (void) DUMMY_VAR__; // suppress unused var warning try { int pos__; - pos__ = std::numeric_limits::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; current_statement__ = 8; - N = std::numeric_limits::min(); current_statement__ = 8; N = 100; @@ -19224,17 +20008,8 @@ class reduce_sum_m1_model final : public model_base_crtp { // Next line prevents compiler griping about no return throw std::runtime_error("*** IF YOU SEE THIS, PLEASE REPORT A BUG ***"); } - num_params_r__ = 0U; + num_params_r__ = N + N + N; - try { - num_params_r__ += N; - num_params_r__ += N; - num_params_r__ += N; - } catch (const std::exception& e) { - stan::lang::rethrow_located(e, locations_array__[current_statement__]); - // Next line prevents compiler griping about no return - throw std::runtime_error("*** IF YOU SEE THIS, PLEASE REPORT A BUG ***"); - } } template { try { std::vector y1; - y1 = std::vector(N, DUMMY_VAR__); + y1 = std::vector(N, DUMMY_VAR__); current_statement__ = 1; y1 = in__.template read>(N); std::vector y2; - y2 = std::vector(N, DUMMY_VAR__); + y2 = std::vector(N, DUMMY_VAR__); current_statement__ = 2; y2 = in__.template read>(N); std::vector y3; - y3 = std::vector(N, DUMMY_VAR__); + y3 = std::vector(N, DUMMY_VAR__); current_statement__ = 3; y3 = in__.template read>(N); @@ -19315,26 +20090,29 @@ class reduce_sum_m1_model final : public model_base_crtp { try { std::vector y1; - y1 = std::vector(N, std::numeric_limits::quiet_NaN()); + y1 = std::vector(N, std::numeric_limits::quiet_NaN()); current_statement__ = 1; y1 = in__.template read>(N); std::vector y2; - y2 = std::vector(N, std::numeric_limits::quiet_NaN()); + y2 = std::vector(N, std::numeric_limits::quiet_NaN()); current_statement__ = 2; y2 = in__.template read>(N); std::vector y3; - y3 = std::vector(N, std::numeric_limits::quiet_NaN()); + y3 = std::vector(N, std::numeric_limits::quiet_NaN()); current_statement__ = 3; y3 = in__.template read>(N); for (int sym1__ = 1; sym1__ <= N; ++sym1__) { - vars__.emplace_back(y1[(sym1__ - 1)]);} + vars__.emplace_back(y1[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { - vars__.emplace_back(y2[(sym1__ - 1)]);} + vars__.emplace_back(y2[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { - vars__.emplace_back(y3[(sym1__ - 1)]);} + vars__.emplace_back(y3[(sym1__ - 1)]); + } if (logical_negation((primitive_value(emit_transformed_parameters__) || primitive_value(emit_generated_quantities__)))) { return ; @@ -19362,30 +20140,33 @@ class reduce_sum_m1_model final : public model_base_crtp { try { int pos__; - pos__ = std::numeric_limits::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; std::vector y1; - y1 = std::vector(N, std::numeric_limits::quiet_NaN()); + y1 = std::vector(N, std::numeric_limits::quiet_NaN()); current_statement__ = 1; y1 = context__.vals_r("y1"); std::vector y2; - y2 = std::vector(N, std::numeric_limits::quiet_NaN()); + y2 = std::vector(N, std::numeric_limits::quiet_NaN()); current_statement__ = 2; y2 = context__.vals_r("y2"); std::vector y3; - y3 = std::vector(N, std::numeric_limits::quiet_NaN()); + y3 = std::vector(N, std::numeric_limits::quiet_NaN()); current_statement__ = 3; y3 = context__.vals_r("y3"); for (int sym1__ = 1; sym1__ <= N; ++sym1__) { - vars__.emplace_back(y1[(sym1__ - 1)]);} + vars__.emplace_back(y1[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { - vars__.emplace_back(y2[(sym1__ - 1)]);} + vars__.emplace_back(y2[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { - vars__.emplace_back(y3[(sym1__ - 1)]);} + vars__.emplace_back(y3[(sym1__ - 1)]); + } } catch (const std::exception& e) { stan::lang::rethrow_located(e, locations_array__[current_statement__]); // Next line prevents compiler griping about no return @@ -19395,9 +20176,8 @@ class reduce_sum_m1_model final : public model_base_crtp { inline void get_param_names(std::vector& names__) const { - names__ = std::vector{"y1", - "y2", - "y3"}; + names__ = std::vector{"y1", "y2", "y3"}; + } // get_param_names() inline void get_dims(std::vector>& dimss__) const { @@ -19405,8 +20185,9 @@ class reduce_sum_m1_model final : public model_base_crtp { dimss__ = std::vector>{std::vector{ static_cast(N) }, - std::vector{static_cast(N)}, - std::vector{static_cast(N)}}; + std::vector{static_cast(N)}, + std::vector{static_cast(N)}}; + } // get_dims() inline void constrained_param_names( @@ -19418,15 +20199,18 @@ class reduce_sum_m1_model final : public model_base_crtp { for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { param_names__.emplace_back(std::string() + "y1" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { param_names__.emplace_back(std::string() + "y2" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { param_names__.emplace_back(std::string() + "y3" + '.' + std::to_string(sym1__)); - }} + } + } if (emit_transformed_parameters__) { } @@ -19446,15 +20230,18 @@ class reduce_sum_m1_model final : public model_base_crtp { for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { param_names__.emplace_back(std::string() + "y1" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { param_names__.emplace_back(std::string() + "y2" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { param_names__.emplace_back(std::string() + "y3" + '.' + std::to_string(sym1__)); - }} + } + } if (emit_transformed_parameters__) { } @@ -19465,14 +20252,16 @@ class reduce_sum_m1_model final : public model_base_crtp { } // unconstrained_param_names() - inline std::string get_constrained_sizedtypes() const final { + inline std::string get_constrained_sizedtypes() const { + + return std::string("[{\"name\":\"y1\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"y2\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"y3\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"}]"); - return std::string("[{\"name\":\"y1\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"y2\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"y3\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"}]"); } // get_constrained_sizedtypes() - inline std::string get_unconstrained_sizedtypes() const final { + inline std::string get_unconstrained_sizedtypes() const { + + return std::string("[{\"name\":\"y1\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"y2\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"y3\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"}]"); - return std::string("[{\"name\":\"y1\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"y2\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"y3\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"}]"); } // get_unconstrained_sizedtypes() @@ -19484,14 +20273,13 @@ class reduce_sum_m1_model final : public model_base_crtp { const bool emit_transformed_parameters = true, const bool emit_generated_quantities = true, std::ostream* pstream = nullptr) const { - std::vector vars_vec(vars.size()); + std::vector vars_vec; + vars_vec.reserve(vars.size()); std::vector params_i; write_array_impl(base_rng, params_r, params_i, vars_vec, emit_transformed_parameters, emit_generated_quantities, pstream); - vars.resize(vars_vec.size()); - for (int i = 0; i < vars.size(); ++i) { - vars.coeffRef(i) = vars_vec[i]; - } + vars = Eigen::Map>( + vars_vec.data(), vars_vec.size()); } template @@ -19501,7 +20289,8 @@ class reduce_sum_m1_model final : public model_base_crtp { bool emit_transformed_parameters = true, bool emit_generated_quantities = true, std::ostream* pstream = nullptr) const { - write_array_impl(base_rng, params_r, params_i, vars, emit_transformed_parameters, emit_generated_quantities, pstream); + write_array_impl(base_rng, params_r, params_i, vars, + emit_transformed_parameters, emit_generated_quantities, pstream); } template @@ -19522,13 +20311,12 @@ class reduce_sum_m1_model final : public model_base_crtp { inline void transform_inits(const stan::io::var_context& context, Eigen::Matrix& params_r, std::ostream* pstream = nullptr) const final { - std::vector params_r_vec(params_r.size()); + std::vector params_r_vec; + params_r_vec.reserve(params_r.size()); std::vector params_i; transform_inits_impl(context, params_i, params_r_vec, pstream); - params_r.resize(params_r_vec.size()); - for (int i = 0; i < params_r.size(); ++i) { - params_r.coeffRef(i) = params_r_vec[i]; - } + params_r = Eigen::Map>( + params_r_vec.data(), params_r_vec.size()); } inline void transform_inits(const stan::io::var_context& context, std::vector& params_i, @@ -19832,7 +20620,7 @@ g2(const std::vector>& y_slice, const int& start, (void) DUMMY_VAR__; // suppress unused var warning try { local_scalar_t__ sum_lpdf; - sum_lpdf = DUMMY_VAR__; + sum_lpdf = DUMMY_VAR__; current_statement__ = 78; sum_lpdf = 0.0; @@ -19841,7 +20629,8 @@ g2(const std::vector>& y_slice, const int& start, current_statement__ = 79; sum_lpdf = (sum_lpdf + normal_lpdf( - rvalue(y_slice, "y_slice", index_uni(n)), 0, 1));} + rvalue(y_slice, "y_slice", index_uni(n)), 0, 1)); + } current_statement__ = 82; return sum_lpdf; } catch (const std::exception& e) { @@ -19885,7 +20674,7 @@ g3(const std::vector>& y_slice, const int& start, (void) DUMMY_VAR__; // suppress unused var warning try { local_scalar_t__ sum_lpdf; - sum_lpdf = DUMMY_VAR__; + sum_lpdf = DUMMY_VAR__; current_statement__ = 84; sum_lpdf = 0.0; @@ -19894,7 +20683,8 @@ g3(const std::vector>& y_slice, const int& start, current_statement__ = 85; sum_lpdf = (sum_lpdf + normal_lpdf( - rvalue(y_slice, "y_slice", index_uni(n)), 0, 1));} + rvalue(y_slice, "y_slice", index_uni(n)), 0, 1)); + } current_statement__ = 88; return sum_lpdf; } catch (const std::exception& e) { @@ -19938,7 +20728,7 @@ g4(const std::vector>& y_slice, const int& start, (void) DUMMY_VAR__; // suppress unused var warning try { local_scalar_t__ sum_lpdf; - sum_lpdf = DUMMY_VAR__; + sum_lpdf = DUMMY_VAR__; current_statement__ = 90; sum_lpdf = 0.0; @@ -19948,7 +20738,8 @@ g4(const std::vector>& y_slice, const int& start, sum_lpdf = (sum_lpdf + normal_lpdf( to_vector(rvalue(y_slice, "y_slice", index_uni(n))), 0, - 1));} + 1)); + } current_statement__ = 94; return sum_lpdf; } catch (const std::exception& e) { @@ -19992,7 +20783,7 @@ g5(const std::vector>& y_slice, const int& start, (void) DUMMY_VAR__; // suppress unused var warning try { local_scalar_t__ sum_lpdf; - sum_lpdf = DUMMY_VAR__; + sum_lpdf = DUMMY_VAR__; current_statement__ = 96; sum_lpdf = 0.0; @@ -20005,7 +20796,9 @@ g5(const std::vector>& y_slice, const int& start, sum_lpdf = (sum_lpdf + normal_lpdf( rvalue(y_slice, "y_slice", index_uni(n), index_uni(m)), - 0, 1));}} + 0, 1)); + } + } current_statement__ = 102; return sum_lpdf; } catch (const std::exception& e) { @@ -20049,7 +20842,7 @@ g6(const std::vector>>& y_slice, (void) DUMMY_VAR__; // suppress unused var warning try { local_scalar_t__ sum_lpdf; - sum_lpdf = DUMMY_VAR__; + sum_lpdf = DUMMY_VAR__; current_statement__ = 104; sum_lpdf = 0.0; @@ -20063,7 +20856,9 @@ g6(const std::vector>>& y_slice, normal_lpdf( to_vector( rvalue(y_slice, "y_slice", - index_uni(n), index_uni(m))), 0, 1));}} + index_uni(n), index_uni(m))), 0, 1)); + } + } current_statement__ = 110; return sum_lpdf; } catch (const std::exception& e) { @@ -20107,7 +20902,7 @@ g7(const std::vector>>& y_slice, (void) DUMMY_VAR__; // suppress unused var warning try { local_scalar_t__ sum_lpdf; - sum_lpdf = DUMMY_VAR__; + sum_lpdf = DUMMY_VAR__; current_statement__ = 112; sum_lpdf = 0.0; @@ -20121,7 +20916,9 @@ g7(const std::vector>>& y_slice, normal_lpdf( to_vector( rvalue(y_slice, "y_slice", - index_uni(n), index_uni(m))), 0, 1));}} + index_uni(n), index_uni(m))), 0, 1)); + } + } current_statement__ = 118; return sum_lpdf; } catch (const std::exception& e) { @@ -20165,7 +20962,7 @@ g8(const std::vector>>& y_slice, (void) DUMMY_VAR__; // suppress unused var warning try { local_scalar_t__ sum_lpdf; - sum_lpdf = DUMMY_VAR__; + sum_lpdf = DUMMY_VAR__; current_statement__ = 120; sum_lpdf = 0.0; @@ -20179,7 +20976,9 @@ g8(const std::vector>>& y_slice, normal_lpdf( to_vector( rvalue(y_slice, "y_slice", - index_uni(n), index_uni(m))), 0, 1));}} + index_uni(n), index_uni(m))), 0, 1)); + } + } current_statement__ = 126; return sum_lpdf; } catch (const std::exception& e) { @@ -20270,7 +21069,7 @@ h2(const std::vector& y, const int& start, const int& end, (void) DUMMY_VAR__; // suppress unused var warning try { local_scalar_t__ sum_lpdf; - sum_lpdf = DUMMY_VAR__; + sum_lpdf = DUMMY_VAR__; current_statement__ = 130; sum_lpdf = 0.0; @@ -20278,7 +21077,8 @@ h2(const std::vector& y, const int& start, const int& end, for (int n = start; n <= end; ++n) { current_statement__ = 131; sum_lpdf = (sum_lpdf + - normal_lpdf(rvalue(a, "a", index_uni(n)), 0, 1));} + normal_lpdf(rvalue(a, "a", index_uni(n)), 0, 1)); + } current_statement__ = 134; return sum_lpdf; } catch (const std::exception& e) { @@ -20327,7 +21127,7 @@ h3(const std::vector& y, const int& start, const int& end, (void) DUMMY_VAR__; // suppress unused var warning try { local_scalar_t__ sum_lpdf; - sum_lpdf = DUMMY_VAR__; + sum_lpdf = DUMMY_VAR__; current_statement__ = 136; sum_lpdf = 0.0; @@ -20335,7 +21135,8 @@ h3(const std::vector& y, const int& start, const int& end, for (int n = start; n <= end; ++n) { current_statement__ = 137; sum_lpdf = (sum_lpdf + - normal_lpdf(rvalue(a, "a", index_uni(n)), 0, 1));} + normal_lpdf(rvalue(a, "a", index_uni(n)), 0, 1)); + } current_statement__ = 140; return sum_lpdf; } catch (const std::exception& e) { @@ -20384,7 +21185,7 @@ h4(const std::vector& y, const int& start, const int& end, (void) DUMMY_VAR__; // suppress unused var warning try { local_scalar_t__ sum_lpdf; - sum_lpdf = DUMMY_VAR__; + sum_lpdf = DUMMY_VAR__; current_statement__ = 142; sum_lpdf = 0.0; @@ -20393,7 +21194,8 @@ h4(const std::vector& y, const int& start, const int& end, current_statement__ = 143; sum_lpdf = (sum_lpdf + normal_lpdf( - to_vector(rvalue(a, "a", index_uni(n))), 0, 1));} + to_vector(rvalue(a, "a", index_uni(n))), 0, 1)); + } current_statement__ = 146; return sum_lpdf; } catch (const std::exception& e) { @@ -20442,7 +21244,7 @@ h5(const std::vector& y, const int& start, const int& end, (void) DUMMY_VAR__; // suppress unused var warning try { local_scalar_t__ sum_lpdf; - sum_lpdf = DUMMY_VAR__; + sum_lpdf = DUMMY_VAR__; current_statement__ = 148; sum_lpdf = 0.0; @@ -20453,7 +21255,9 @@ h5(const std::vector& y, const int& start, const int& end, current_statement__ = 149; sum_lpdf = (sum_lpdf + normal_lpdf( - rvalue(a, "a", index_uni(n), index_uni(m)), 0, 1));}} + rvalue(a, "a", index_uni(n), index_uni(m)), 0, 1)); + } + } current_statement__ = 154; return sum_lpdf; } catch (const std::exception& e) { @@ -20501,7 +21305,7 @@ h6(const std::vector& y, const int& start, const int& end, (void) DUMMY_VAR__; // suppress unused var warning try { local_scalar_t__ sum_lpdf; - sum_lpdf = DUMMY_VAR__; + sum_lpdf = DUMMY_VAR__; current_statement__ = 156; sum_lpdf = 0.0; @@ -20513,7 +21317,9 @@ h6(const std::vector& y, const int& start, const int& end, sum_lpdf = (sum_lpdf + normal_lpdf( to_vector(rvalue(a, "a", index_uni(n), index_uni(m))), - 0, 1));}} + 0, 1)); + } + } current_statement__ = 162; return sum_lpdf; } catch (const std::exception& e) { @@ -20563,7 +21369,7 @@ h7(const std::vector& y, const int& start, const int& end, (void) DUMMY_VAR__; // suppress unused var warning try { local_scalar_t__ sum_lpdf; - sum_lpdf = DUMMY_VAR__; + sum_lpdf = DUMMY_VAR__; current_statement__ = 164; sum_lpdf = 0.0; @@ -20575,7 +21381,9 @@ h7(const std::vector& y, const int& start, const int& end, sum_lpdf = (sum_lpdf + normal_lpdf( to_vector(rvalue(a, "a", index_uni(n), index_uni(m))), - 0, 1));}} + 0, 1)); + } + } current_statement__ = 170; return sum_lpdf; } catch (const std::exception& e) { @@ -20625,7 +21433,7 @@ h8(const std::vector& y, const int& start, const int& end, (void) DUMMY_VAR__; // suppress unused var warning try { local_scalar_t__ sum_lpdf; - sum_lpdf = DUMMY_VAR__; + sum_lpdf = DUMMY_VAR__; current_statement__ = 172; sum_lpdf = 0.0; @@ -20637,7 +21445,9 @@ h8(const std::vector& y, const int& start, const int& end, sum_lpdf = (sum_lpdf + normal_lpdf( to_vector(rvalue(a, "a", index_uni(n), index_uni(m))), - 0, 1));}} + 0, 1)); + } + } current_statement__ = 178; return sum_lpdf; } catch (const std::exception& e) { @@ -20703,18 +21513,16 @@ class reduce_sum_m2_model final : public model_base_crtp { (void) DUMMY_VAR__; // suppress unused var warning try { int pos__; - pos__ = std::numeric_limits::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; current_statement__ = 33; - N = std::numeric_limits::min(); current_statement__ = 33; N = 2; current_statement__ = 34; validate_non_negative_index("x", "N", N); current_statement__ = 35; - x = std::vector(N, std::numeric_limits::quiet_NaN()); current_statement__ = 36; validate_non_negative_index("a8", "N", N); @@ -20801,30 +21609,10 @@ class reduce_sum_m2_model final : public model_base_crtp { // Next line prevents compiler griping about no return throw std::runtime_error("*** IF YOU SEE THIS, PLEASE REPORT A BUG ***"); } - num_params_r__ = 0U; + num_params_r__ = (N * N * N * N) + (N * N * N) + (N * N * N) + (N * N) + + (N * N * N) + (N * N) + (N * N) + N + (N * N * N * N) + (N * N * N) + + (N * N * N) + (N * N) + (N * N * N) + (N * N) + (N * N) + N; - try { - num_params_r__ += N * N * N * N; - num_params_r__ += N * N * N; - num_params_r__ += N * N * N; - num_params_r__ += N * N; - num_params_r__ += N * N * N; - num_params_r__ += N * N; - num_params_r__ += N * N; - num_params_r__ += N; - num_params_r__ += N * N * N * N; - num_params_r__ += N * N * N; - num_params_r__ += N * N * N; - num_params_r__ += N * N; - num_params_r__ += N * N * N; - num_params_r__ += N * N; - num_params_r__ += N * N; - num_params_r__ += N; - } catch (const std::exception& e) { - stan::lang::rethrow_located(e, locations_array__[current_statement__]); - // Next line prevents compiler griping about no return - throw std::runtime_error("*** IF YOU SEE THIS, PLEASE REPORT A BUG ***"); - } } template { try { std::vector>> a8; a8 = std::vector>>(N, std::vector>(N, Eigen::Matrix(N, N))); - stan::math::fill(a8, DUMMY_VAR__); + stan::math::fill(a8, DUMMY_VAR__); current_statement__ = 1; a8 = in__.template read>>>( N, N, N, N); std::vector>> a7; a7 = std::vector>>(N, std::vector>(N, Eigen::Matrix(N))); - stan::math::fill(a7, DUMMY_VAR__); + stan::math::fill(a7, DUMMY_VAR__); current_statement__ = 2; a7 = in__.template read>>>( N, N, N); std::vector>> a6; a6 = std::vector>>(N, std::vector>(N, Eigen::Matrix(N))); - stan::math::fill(a6, DUMMY_VAR__); + stan::math::fill(a6, DUMMY_VAR__); current_statement__ = 3; a6 = in__.template read>>>( N, N, N); std::vector> a5; a5 = std::vector>(N, std::vector(N, DUMMY_VAR__)); + current_statement__ = 4; a5 = in__.template read>>(N, N); std::vector> a4; a4 = std::vector>(N, Eigen::Matrix(N, N)); - stan::math::fill(a4, DUMMY_VAR__); + stan::math::fill(a4, DUMMY_VAR__); current_statement__ = 5; a4 = in__.template read>>( N, N, N); std::vector> a3; a3 = std::vector>(N, Eigen::Matrix(N)); - stan::math::fill(a3, DUMMY_VAR__); + stan::math::fill(a3, DUMMY_VAR__); current_statement__ = 6; a3 = in__.template read>>( N, N); std::vector> a2; a2 = std::vector>(N, Eigen::Matrix(N)); - stan::math::fill(a2, DUMMY_VAR__); + stan::math::fill(a2, DUMMY_VAR__); current_statement__ = 7; a2 = in__.template read>>( N, N); std::vector a1; - a1 = std::vector(N, DUMMY_VAR__); + a1 = std::vector(N, DUMMY_VAR__); current_statement__ = 8; a1 = in__.template read>(N); std::vector>> y8; y8 = std::vector>>(N, std::vector>(N, Eigen::Matrix(N, N))); - stan::math::fill(y8, DUMMY_VAR__); + stan::math::fill(y8, DUMMY_VAR__); current_statement__ = 9; y8 = in__.template read>>>( N, N, N, N); std::vector>> y7; y7 = std::vector>>(N, std::vector>(N, Eigen::Matrix(N))); - stan::math::fill(y7, DUMMY_VAR__); + stan::math::fill(y7, DUMMY_VAR__); current_statement__ = 10; y7 = in__.template read>>>( N, N, N); std::vector>> y6; y6 = std::vector>>(N, std::vector>(N, Eigen::Matrix(N))); - stan::math::fill(y6, DUMMY_VAR__); + stan::math::fill(y6, DUMMY_VAR__); current_statement__ = 11; y6 = in__.template read>>>( N, N, N); std::vector> y5; y5 = std::vector>(N, std::vector(N, DUMMY_VAR__)); + current_statement__ = 12; y5 = in__.template read>>(N, N); std::vector> y4; y4 = std::vector>(N, Eigen::Matrix(N, N)); - stan::math::fill(y4, DUMMY_VAR__); + stan::math::fill(y4, DUMMY_VAR__); current_statement__ = 13; y4 = in__.template read>>( N, N, N); std::vector> y3; y3 = std::vector>(N, Eigen::Matrix(N)); - stan::math::fill(y3, DUMMY_VAR__); + stan::math::fill(y3, DUMMY_VAR__); current_statement__ = 14; y3 = in__.template read>>( N, N); std::vector> y2; y2 = std::vector>(N, Eigen::Matrix(N)); - stan::math::fill(y2, DUMMY_VAR__); + stan::math::fill(y2, DUMMY_VAR__); current_statement__ = 15; y2 = in__.template read>>( N, N); std::vector y1; - y1 = std::vector(N, DUMMY_VAR__); + y1 = std::vector(N, DUMMY_VAR__); current_statement__ = 16; y1 = in__.template read>(N); @@ -21019,107 +21809,109 @@ class reduce_sum_m2_model final : public model_base_crtp { try { std::vector>> a8; a8 = std::vector>>(N, std::vector>(N, Eigen::Matrix(N, N))); - stan::math::fill(a8, std::numeric_limits::quiet_NaN()); + stan::math::fill(a8, std::numeric_limits::quiet_NaN()); current_statement__ = 1; a8 = in__.template read>>>( N, N, N, N); std::vector>> a7; a7 = std::vector>>(N, std::vector>(N, Eigen::Matrix(N))); - stan::math::fill(a7, std::numeric_limits::quiet_NaN()); + stan::math::fill(a7, std::numeric_limits::quiet_NaN()); current_statement__ = 2; a7 = in__.template read>>>( N, N, N); std::vector>> a6; a6 = std::vector>>(N, std::vector>(N, Eigen::Matrix(N))); - stan::math::fill(a6, std::numeric_limits::quiet_NaN()); + stan::math::fill(a6, std::numeric_limits::quiet_NaN()); current_statement__ = 3; a6 = in__.template read>>>( N, N, N); std::vector> a5; a5 = std::vector>(N, std::vector(N, std::numeric_limits::quiet_NaN())); + current_statement__ = 4; a5 = in__.template read>>(N, N); std::vector> a4; a4 = std::vector>(N, Eigen::Matrix(N, N)); - stan::math::fill(a4, std::numeric_limits::quiet_NaN()); + stan::math::fill(a4, std::numeric_limits::quiet_NaN()); current_statement__ = 5; a4 = in__.template read>>( N, N, N); std::vector> a3; a3 = std::vector>(N, Eigen::Matrix(N)); - stan::math::fill(a3, std::numeric_limits::quiet_NaN()); + stan::math::fill(a3, std::numeric_limits::quiet_NaN()); current_statement__ = 6; a3 = in__.template read>>( N, N); std::vector> a2; a2 = std::vector>(N, Eigen::Matrix(N)); - stan::math::fill(a2, std::numeric_limits::quiet_NaN()); + stan::math::fill(a2, std::numeric_limits::quiet_NaN()); current_statement__ = 7; a2 = in__.template read>>( N, N); std::vector a1; - a1 = std::vector(N, std::numeric_limits::quiet_NaN()); + a1 = std::vector(N, std::numeric_limits::quiet_NaN()); current_statement__ = 8; a1 = in__.template read>(N); std::vector>> y8; y8 = std::vector>>(N, std::vector>(N, Eigen::Matrix(N, N))); - stan::math::fill(y8, std::numeric_limits::quiet_NaN()); + stan::math::fill(y8, std::numeric_limits::quiet_NaN()); current_statement__ = 9; y8 = in__.template read>>>( N, N, N, N); std::vector>> y7; y7 = std::vector>>(N, std::vector>(N, Eigen::Matrix(N))); - stan::math::fill(y7, std::numeric_limits::quiet_NaN()); + stan::math::fill(y7, std::numeric_limits::quiet_NaN()); current_statement__ = 10; y7 = in__.template read>>>( N, N, N); std::vector>> y6; y6 = std::vector>>(N, std::vector>(N, Eigen::Matrix(N))); - stan::math::fill(y6, std::numeric_limits::quiet_NaN()); + stan::math::fill(y6, std::numeric_limits::quiet_NaN()); current_statement__ = 11; y6 = in__.template read>>>( N, N, N); std::vector> y5; y5 = std::vector>(N, std::vector(N, std::numeric_limits::quiet_NaN())); + current_statement__ = 12; y5 = in__.template read>>(N, N); std::vector> y4; y4 = std::vector>(N, Eigen::Matrix(N, N)); - stan::math::fill(y4, std::numeric_limits::quiet_NaN()); + stan::math::fill(y4, std::numeric_limits::quiet_NaN()); current_statement__ = 13; y4 = in__.template read>>( N, N, N); std::vector> y3; y3 = std::vector>(N, Eigen::Matrix(N)); - stan::math::fill(y3, std::numeric_limits::quiet_NaN()); + stan::math::fill(y3, std::numeric_limits::quiet_NaN()); current_statement__ = 14; y3 = in__.template read>>( N, N); std::vector> y2; y2 = std::vector>(N, Eigen::Matrix(N)); - stan::math::fill(y2, std::numeric_limits::quiet_NaN()); + stan::math::fill(y2, std::numeric_limits::quiet_NaN()); current_statement__ = 15; y2 = in__.template read>>( N, N); std::vector y1; - y1 = std::vector(N, std::numeric_limits::quiet_NaN()); + y1 = std::vector(N, std::numeric_limits::quiet_NaN()); current_statement__ = 16; y1 = in__.template read>(N); @@ -21130,34 +21922,54 @@ class reduce_sum_m2_model final : public model_base_crtp { vars__.emplace_back( rvalue(a8, "a8", index_uni(sym4__), index_uni(sym3__), index_uni(sym2__), - index_uni(sym1__)));}}}} + index_uni(sym1__))); + } + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { for (int sym3__ = 1; sym3__ <= N; ++sym3__) { vars__.emplace_back( - a7[(sym3__ - 1)][(sym2__ - 1)][(sym1__ - 1)]);}}} + a7[(sym3__ - 1)][(sym2__ - 1)][(sym1__ - 1)]); + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { for (int sym3__ = 1; sym3__ <= N; ++sym3__) { vars__.emplace_back( - a6[(sym3__ - 1)][(sym2__ - 1)][(sym1__ - 1)]);}}} + a6[(sym3__ - 1)][(sym2__ - 1)][(sym1__ - 1)]); + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { - vars__.emplace_back(a5[(sym2__ - 1)][(sym1__ - 1)]);}} + vars__.emplace_back(a5[(sym2__ - 1)][(sym1__ - 1)]); + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { for (int sym3__ = 1; sym3__ <= N; ++sym3__) { vars__.emplace_back( rvalue(a4, "a4", - index_uni(sym3__), index_uni(sym2__), index_uni(sym1__)));}}} + index_uni(sym3__), index_uni(sym2__), index_uni(sym1__))); + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { - vars__.emplace_back(a3[(sym2__ - 1)][(sym1__ - 1)]);}} + vars__.emplace_back(a3[(sym2__ - 1)][(sym1__ - 1)]); + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { - vars__.emplace_back(a2[(sym2__ - 1)][(sym1__ - 1)]);}} + vars__.emplace_back(a2[(sym2__ - 1)][(sym1__ - 1)]); + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { - vars__.emplace_back(a1[(sym1__ - 1)]);} + vars__.emplace_back(a1[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { for (int sym3__ = 1; sym3__ <= N; ++sym3__) { @@ -21165,34 +21977,54 @@ class reduce_sum_m2_model final : public model_base_crtp { vars__.emplace_back( rvalue(y8, "y8", index_uni(sym4__), index_uni(sym3__), index_uni(sym2__), - index_uni(sym1__)));}}}} + index_uni(sym1__))); + } + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { for (int sym3__ = 1; sym3__ <= N; ++sym3__) { vars__.emplace_back( - y7[(sym3__ - 1)][(sym2__ - 1)][(sym1__ - 1)]);}}} + y7[(sym3__ - 1)][(sym2__ - 1)][(sym1__ - 1)]); + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { for (int sym3__ = 1; sym3__ <= N; ++sym3__) { vars__.emplace_back( - y6[(sym3__ - 1)][(sym2__ - 1)][(sym1__ - 1)]);}}} + y6[(sym3__ - 1)][(sym2__ - 1)][(sym1__ - 1)]); + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { - vars__.emplace_back(y5[(sym2__ - 1)][(sym1__ - 1)]);}} + vars__.emplace_back(y5[(sym2__ - 1)][(sym1__ - 1)]); + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { for (int sym3__ = 1; sym3__ <= N; ++sym3__) { vars__.emplace_back( rvalue(y4, "y4", - index_uni(sym3__), index_uni(sym2__), index_uni(sym1__)));}}} + index_uni(sym3__), index_uni(sym2__), index_uni(sym1__))); + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { - vars__.emplace_back(y3[(sym2__ - 1)][(sym1__ - 1)]);}} + vars__.emplace_back(y3[(sym2__ - 1)][(sym1__ - 1)]); + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { - vars__.emplace_back(y2[(sym2__ - 1)][(sym1__ - 1)]);}} + vars__.emplace_back(y2[(sym2__ - 1)][(sym1__ - 1)]); + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { - vars__.emplace_back(y1[(sym1__ - 1)]);} + vars__.emplace_back(y1[(sym1__ - 1)]); + } if (logical_negation((primitive_value(emit_transformed_parameters__) || primitive_value(emit_generated_quantities__)))) { return ; @@ -21220,12 +22052,12 @@ class reduce_sum_m2_model final : public model_base_crtp { try { int pos__; - pos__ = std::numeric_limits::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; std::vector>> a8; a8 = std::vector>>(N, std::vector>(N, Eigen::Matrix(N, N))); - stan::math::fill(a8, std::numeric_limits::quiet_NaN()); + stan::math::fill(a8, std::numeric_limits::quiet_NaN()); { std::vector a8_flat__; @@ -21248,11 +22080,15 @@ class reduce_sum_m2_model final : public model_base_crtp { index_uni(sym2__), index_uni(sym1__)); current_statement__ = 1; - pos__ = (pos__ + 1);}}}} + pos__ = (pos__ + 1); + } + } + } + } } std::vector>> a7; a7 = std::vector>>(N, std::vector>(N, Eigen::Matrix(N))); - stan::math::fill(a7, std::numeric_limits::quiet_NaN()); + stan::math::fill(a7, std::numeric_limits::quiet_NaN()); { std::vector a7_flat__; @@ -21272,11 +22108,14 @@ class reduce_sum_m2_model final : public model_base_crtp { index_uni(sym2__), index_uni(sym1__)); current_statement__ = 2; - pos__ = (pos__ + 1);}}} + pos__ = (pos__ + 1); + } + } + } } std::vector>> a6; a6 = std::vector>>(N, std::vector>(N, Eigen::Matrix(N))); - stan::math::fill(a6, std::numeric_limits::quiet_NaN()); + stan::math::fill(a6, std::numeric_limits::quiet_NaN()); { std::vector a6_flat__; @@ -21296,10 +22135,14 @@ class reduce_sum_m2_model final : public model_base_crtp { index_uni(sym2__), index_uni(sym1__)); current_statement__ = 3; - pos__ = (pos__ + 1);}}} + pos__ = (pos__ + 1); + } + } + } } std::vector> a5; a5 = std::vector>(N, std::vector(N, std::numeric_limits::quiet_NaN())); + { std::vector a5_flat__; @@ -21315,11 +22158,13 @@ class reduce_sum_m2_model final : public model_base_crtp { assign(a5, a5_flat__[(pos__ - 1)], "assigning variable a5", index_uni(sym2__), index_uni(sym1__)); current_statement__ = 4; - pos__ = (pos__ + 1);}} + pos__ = (pos__ + 1); + } + } } std::vector> a4; a4 = std::vector>(N, Eigen::Matrix(N, N)); - stan::math::fill(a4, std::numeric_limits::quiet_NaN()); + stan::math::fill(a4, std::numeric_limits::quiet_NaN()); { std::vector a4_flat__; @@ -21339,11 +22184,14 @@ class reduce_sum_m2_model final : public model_base_crtp { index_uni(sym2__), index_uni(sym1__)); current_statement__ = 5; - pos__ = (pos__ + 1);}}} + pos__ = (pos__ + 1); + } + } + } } std::vector> a3; a3 = std::vector>(N, Eigen::Matrix(N)); - stan::math::fill(a3, std::numeric_limits::quiet_NaN()); + stan::math::fill(a3, std::numeric_limits::quiet_NaN()); { std::vector a3_flat__; @@ -21359,11 +22207,13 @@ class reduce_sum_m2_model final : public model_base_crtp { assign(a3, a3_flat__[(pos__ - 1)], "assigning variable a3", index_uni(sym2__), index_uni(sym1__)); current_statement__ = 6; - pos__ = (pos__ + 1);}} + pos__ = (pos__ + 1); + } + } } std::vector> a2; a2 = std::vector>(N, Eigen::Matrix(N)); - stan::math::fill(a2, std::numeric_limits::quiet_NaN()); + stan::math::fill(a2, std::numeric_limits::quiet_NaN()); { std::vector a2_flat__; @@ -21379,16 +22229,18 @@ class reduce_sum_m2_model final : public model_base_crtp { assign(a2, a2_flat__[(pos__ - 1)], "assigning variable a2", index_uni(sym2__), index_uni(sym1__)); current_statement__ = 7; - pos__ = (pos__ + 1);}} + pos__ = (pos__ + 1); + } + } } std::vector a1; - a1 = std::vector(N, std::numeric_limits::quiet_NaN()); + a1 = std::vector(N, std::numeric_limits::quiet_NaN()); current_statement__ = 8; a1 = context__.vals_r("a1"); std::vector>> y8; y8 = std::vector>>(N, std::vector>(N, Eigen::Matrix(N, N))); - stan::math::fill(y8, std::numeric_limits::quiet_NaN()); + stan::math::fill(y8, std::numeric_limits::quiet_NaN()); { std::vector y8_flat__; @@ -21411,11 +22263,15 @@ class reduce_sum_m2_model final : public model_base_crtp { index_uni(sym2__), index_uni(sym1__)); current_statement__ = 9; - pos__ = (pos__ + 1);}}}} + pos__ = (pos__ + 1); + } + } + } + } } std::vector>> y7; y7 = std::vector>>(N, std::vector>(N, Eigen::Matrix(N))); - stan::math::fill(y7, std::numeric_limits::quiet_NaN()); + stan::math::fill(y7, std::numeric_limits::quiet_NaN()); { std::vector y7_flat__; @@ -21435,11 +22291,14 @@ class reduce_sum_m2_model final : public model_base_crtp { index_uni(sym2__), index_uni(sym1__)); current_statement__ = 10; - pos__ = (pos__ + 1);}}} + pos__ = (pos__ + 1); + } + } + } } std::vector>> y6; y6 = std::vector>>(N, std::vector>(N, Eigen::Matrix(N))); - stan::math::fill(y6, std::numeric_limits::quiet_NaN()); + stan::math::fill(y6, std::numeric_limits::quiet_NaN()); { std::vector y6_flat__; @@ -21459,10 +22318,14 @@ class reduce_sum_m2_model final : public model_base_crtp { index_uni(sym2__), index_uni(sym1__)); current_statement__ = 11; - pos__ = (pos__ + 1);}}} + pos__ = (pos__ + 1); + } + } + } } std::vector> y5; y5 = std::vector>(N, std::vector(N, std::numeric_limits::quiet_NaN())); + { std::vector y5_flat__; @@ -21478,11 +22341,13 @@ class reduce_sum_m2_model final : public model_base_crtp { assign(y5, y5_flat__[(pos__ - 1)], "assigning variable y5", index_uni(sym2__), index_uni(sym1__)); current_statement__ = 12; - pos__ = (pos__ + 1);}} + pos__ = (pos__ + 1); + } + } } std::vector> y4; y4 = std::vector>(N, Eigen::Matrix(N, N)); - stan::math::fill(y4, std::numeric_limits::quiet_NaN()); + stan::math::fill(y4, std::numeric_limits::quiet_NaN()); { std::vector y4_flat__; @@ -21502,11 +22367,14 @@ class reduce_sum_m2_model final : public model_base_crtp { index_uni(sym2__), index_uni(sym1__)); current_statement__ = 13; - pos__ = (pos__ + 1);}}} + pos__ = (pos__ + 1); + } + } + } } std::vector> y3; y3 = std::vector>(N, Eigen::Matrix(N)); - stan::math::fill(y3, std::numeric_limits::quiet_NaN()); + stan::math::fill(y3, std::numeric_limits::quiet_NaN()); { std::vector y3_flat__; @@ -21522,11 +22390,13 @@ class reduce_sum_m2_model final : public model_base_crtp { assign(y3, y3_flat__[(pos__ - 1)], "assigning variable y3", index_uni(sym2__), index_uni(sym1__)); current_statement__ = 14; - pos__ = (pos__ + 1);}} + pos__ = (pos__ + 1); + } + } } std::vector> y2; y2 = std::vector>(N, Eigen::Matrix(N)); - stan::math::fill(y2, std::numeric_limits::quiet_NaN()); + stan::math::fill(y2, std::numeric_limits::quiet_NaN()); { std::vector y2_flat__; @@ -21542,10 +22412,12 @@ class reduce_sum_m2_model final : public model_base_crtp { assign(y2, y2_flat__[(pos__ - 1)], "assigning variable y2", index_uni(sym2__), index_uni(sym1__)); current_statement__ = 15; - pos__ = (pos__ + 1);}} + pos__ = (pos__ + 1); + } + } } std::vector y1; - y1 = std::vector(N, std::numeric_limits::quiet_NaN()); + y1 = std::vector(N, std::numeric_limits::quiet_NaN()); current_statement__ = 16; y1 = context__.vals_r("y1"); @@ -21556,34 +22428,54 @@ class reduce_sum_m2_model final : public model_base_crtp { vars__.emplace_back( rvalue(a8, "a8", index_uni(sym1__), index_uni(sym2__), index_uni(sym4__), - index_uni(sym3__)));}}}} + index_uni(sym3__))); + } + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { for (int sym3__ = 1; sym3__ <= N; ++sym3__) { vars__.emplace_back( - a7[(sym1__ - 1)][(sym2__ - 1)][(sym3__ - 1)]);}}} + a7[(sym1__ - 1)][(sym2__ - 1)][(sym3__ - 1)]); + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { for (int sym3__ = 1; sym3__ <= N; ++sym3__) { vars__.emplace_back( - a6[(sym1__ - 1)][(sym2__ - 1)][(sym3__ - 1)]);}}} + a6[(sym1__ - 1)][(sym2__ - 1)][(sym3__ - 1)]); + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { - vars__.emplace_back(a5[(sym1__ - 1)][(sym2__ - 1)]);}} + vars__.emplace_back(a5[(sym1__ - 1)][(sym2__ - 1)]); + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { for (int sym3__ = 1; sym3__ <= N; ++sym3__) { vars__.emplace_back( rvalue(a4, "a4", - index_uni(sym1__), index_uni(sym3__), index_uni(sym2__)));}}} + index_uni(sym1__), index_uni(sym3__), index_uni(sym2__))); + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { - vars__.emplace_back(a3[(sym1__ - 1)][(sym2__ - 1)]);}} + vars__.emplace_back(a3[(sym1__ - 1)][(sym2__ - 1)]); + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { - vars__.emplace_back(a2[(sym1__ - 1)][(sym2__ - 1)]);}} + vars__.emplace_back(a2[(sym1__ - 1)][(sym2__ - 1)]); + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { - vars__.emplace_back(a1[(sym1__ - 1)]);} + vars__.emplace_back(a1[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { for (int sym3__ = 1; sym3__ <= N; ++sym3__) { @@ -21591,34 +22483,54 @@ class reduce_sum_m2_model final : public model_base_crtp { vars__.emplace_back( rvalue(y8, "y8", index_uni(sym1__), index_uni(sym2__), index_uni(sym4__), - index_uni(sym3__)));}}}} + index_uni(sym3__))); + } + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { for (int sym3__ = 1; sym3__ <= N; ++sym3__) { vars__.emplace_back( - y7[(sym1__ - 1)][(sym2__ - 1)][(sym3__ - 1)]);}}} + y7[(sym1__ - 1)][(sym2__ - 1)][(sym3__ - 1)]); + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { for (int sym3__ = 1; sym3__ <= N; ++sym3__) { vars__.emplace_back( - y6[(sym1__ - 1)][(sym2__ - 1)][(sym3__ - 1)]);}}} + y6[(sym1__ - 1)][(sym2__ - 1)][(sym3__ - 1)]); + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { - vars__.emplace_back(y5[(sym1__ - 1)][(sym2__ - 1)]);}} + vars__.emplace_back(y5[(sym1__ - 1)][(sym2__ - 1)]); + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { for (int sym3__ = 1; sym3__ <= N; ++sym3__) { vars__.emplace_back( rvalue(y4, "y4", - index_uni(sym1__), index_uni(sym3__), index_uni(sym2__)));}}} + index_uni(sym1__), index_uni(sym3__), index_uni(sym2__))); + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { - vars__.emplace_back(y3[(sym1__ - 1)][(sym2__ - 1)]);}} + vars__.emplace_back(y3[(sym1__ - 1)][(sym2__ - 1)]); + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { - vars__.emplace_back(y2[(sym1__ - 1)][(sym2__ - 1)]);}} + vars__.emplace_back(y2[(sym1__ - 1)][(sym2__ - 1)]); + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { - vars__.emplace_back(y1[(sym1__ - 1)]);} + vars__.emplace_back(y1[(sym1__ - 1)]); + } } catch (const std::exception& e) { stan::lang::rethrow_located(e, locations_array__[current_statement__]); // Next line prevents compiler griping about no return @@ -21628,22 +22540,9 @@ class reduce_sum_m2_model final : public model_base_crtp { inline void get_param_names(std::vector& names__) const { - names__ = std::vector{"a8", - "a7", - "a6", - "a5", - "a4", - "a3", - "a2", - "a1", - "y8", - "y7", - "y6", - "y5", - "y4", - "y3", - "y2", - "y1"}; + names__ = std::vector{"a8", "a7", "a6", "a5", "a4", "a3", + "a2", "a1", "y8", "y7", "y6", "y5", "y4", "y3", "y2", "y1"}; + } // get_param_names() inline void get_dims(std::vector>& dimss__) const { @@ -21657,28 +22556,29 @@ class reduce_sum_m2_model final : public model_base_crtp { , static_cast(N) }, - std::vector{static_cast(N), static_cast(N), - static_cast(N)}, - std::vector{static_cast(N), static_cast(N), - static_cast(N)}, - std::vector{static_cast(N), static_cast(N)}, - std::vector{static_cast(N), static_cast(N), - static_cast(N)}, - std::vector{static_cast(N), static_cast(N)}, - std::vector{static_cast(N), static_cast(N)}, - std::vector{static_cast(N)}, - std::vector{static_cast(N), static_cast(N), - static_cast(N), static_cast(N)}, - std::vector{static_cast(N), static_cast(N), - static_cast(N)}, - std::vector{static_cast(N), static_cast(N), - static_cast(N)}, - std::vector{static_cast(N), static_cast(N)}, - std::vector{static_cast(N), static_cast(N), - static_cast(N)}, - std::vector{static_cast(N), static_cast(N)}, - std::vector{static_cast(N), static_cast(N)}, - std::vector{static_cast(N)}}; + std::vector{static_cast(N), static_cast(N), + static_cast(N)}, + std::vector{static_cast(N), static_cast(N), + static_cast(N)}, + std::vector{static_cast(N), static_cast(N)}, + std::vector{static_cast(N), static_cast(N), + static_cast(N)}, + std::vector{static_cast(N), static_cast(N)}, + std::vector{static_cast(N), static_cast(N)}, + std::vector{static_cast(N)}, + std::vector{static_cast(N), static_cast(N), + static_cast(N), static_cast(N)}, + std::vector{static_cast(N), static_cast(N), + static_cast(N)}, + std::vector{static_cast(N), static_cast(N), + static_cast(N)}, + std::vector{static_cast(N), static_cast(N)}, + std::vector{static_cast(N), static_cast(N), + static_cast(N)}, + std::vector{static_cast(N), static_cast(N)}, + std::vector{static_cast(N), static_cast(N)}, + std::vector{static_cast(N)}}; + } // get_dims() inline void constrained_param_names( @@ -21696,10 +22596,14 @@ class reduce_sum_m2_model final : public model_base_crtp { for (int sym4__ = 1; sym4__ <= N; ++sym4__) { { param_names__.emplace_back(std::string() + "a8" + '.' + std::to_string(sym4__) + '.' + std::to_string(sym3__) + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} - }} - }} + } + } + } + } + } + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { @@ -21707,9 +22611,12 @@ class reduce_sum_m2_model final : public model_base_crtp { for (int sym3__ = 1; sym3__ <= N; ++sym3__) { { param_names__.emplace_back(std::string() + "a7" + '.' + std::to_string(sym3__) + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} - }} + } + } + } + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { @@ -21717,16 +22624,21 @@ class reduce_sum_m2_model final : public model_base_crtp { for (int sym3__ = 1; sym3__ <= N; ++sym3__) { { param_names__.emplace_back(std::string() + "a6" + '.' + std::to_string(sym3__) + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} - }} + } + } + } + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { { param_names__.emplace_back(std::string() + "a5" + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} + } + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { @@ -21734,27 +22646,35 @@ class reduce_sum_m2_model final : public model_base_crtp { for (int sym3__ = 1; sym3__ <= N; ++sym3__) { { param_names__.emplace_back(std::string() + "a4" + '.' + std::to_string(sym3__) + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} - }} + } + } + } + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { { param_names__.emplace_back(std::string() + "a3" + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} + } + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { { param_names__.emplace_back(std::string() + "a2" + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} + } + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { param_names__.emplace_back(std::string() + "a1" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { @@ -21764,10 +22684,14 @@ class reduce_sum_m2_model final : public model_base_crtp { for (int sym4__ = 1; sym4__ <= N; ++sym4__) { { param_names__.emplace_back(std::string() + "y8" + '.' + std::to_string(sym4__) + '.' + std::to_string(sym3__) + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} - }} - }} + } + } + } + } + } + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { @@ -21775,9 +22699,12 @@ class reduce_sum_m2_model final : public model_base_crtp { for (int sym3__ = 1; sym3__ <= N; ++sym3__) { { param_names__.emplace_back(std::string() + "y7" + '.' + std::to_string(sym3__) + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} - }} + } + } + } + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { @@ -21785,16 +22712,21 @@ class reduce_sum_m2_model final : public model_base_crtp { for (int sym3__ = 1; sym3__ <= N; ++sym3__) { { param_names__.emplace_back(std::string() + "y6" + '.' + std::to_string(sym3__) + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} - }} + } + } + } + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { { param_names__.emplace_back(std::string() + "y5" + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} + } + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { @@ -21802,27 +22734,35 @@ class reduce_sum_m2_model final : public model_base_crtp { for (int sym3__ = 1; sym3__ <= N; ++sym3__) { { param_names__.emplace_back(std::string() + "y4" + '.' + std::to_string(sym3__) + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} - }} + } + } + } + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { { param_names__.emplace_back(std::string() + "y3" + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} + } + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { { param_names__.emplace_back(std::string() + "y2" + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} + } + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { param_names__.emplace_back(std::string() + "y1" + '.' + std::to_string(sym1__)); - }} + } + } if (emit_transformed_parameters__) { } @@ -21848,10 +22788,14 @@ class reduce_sum_m2_model final : public model_base_crtp { for (int sym4__ = 1; sym4__ <= N; ++sym4__) { { param_names__.emplace_back(std::string() + "a8" + '.' + std::to_string(sym4__) + '.' + std::to_string(sym3__) + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} - }} - }} + } + } + } + } + } + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { @@ -21859,9 +22803,12 @@ class reduce_sum_m2_model final : public model_base_crtp { for (int sym3__ = 1; sym3__ <= N; ++sym3__) { { param_names__.emplace_back(std::string() + "a7" + '.' + std::to_string(sym3__) + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} - }} + } + } + } + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { @@ -21869,16 +22816,21 @@ class reduce_sum_m2_model final : public model_base_crtp { for (int sym3__ = 1; sym3__ <= N; ++sym3__) { { param_names__.emplace_back(std::string() + "a6" + '.' + std::to_string(sym3__) + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} - }} + } + } + } + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { { param_names__.emplace_back(std::string() + "a5" + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} + } + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { @@ -21886,27 +22838,35 @@ class reduce_sum_m2_model final : public model_base_crtp { for (int sym3__ = 1; sym3__ <= N; ++sym3__) { { param_names__.emplace_back(std::string() + "a4" + '.' + std::to_string(sym3__) + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} - }} + } + } + } + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { { param_names__.emplace_back(std::string() + "a3" + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} + } + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { { param_names__.emplace_back(std::string() + "a2" + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} + } + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { param_names__.emplace_back(std::string() + "a1" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { @@ -21916,10 +22876,14 @@ class reduce_sum_m2_model final : public model_base_crtp { for (int sym4__ = 1; sym4__ <= N; ++sym4__) { { param_names__.emplace_back(std::string() + "y8" + '.' + std::to_string(sym4__) + '.' + std::to_string(sym3__) + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} - }} - }} + } + } + } + } + } + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { @@ -21927,9 +22891,12 @@ class reduce_sum_m2_model final : public model_base_crtp { for (int sym3__ = 1; sym3__ <= N; ++sym3__) { { param_names__.emplace_back(std::string() + "y7" + '.' + std::to_string(sym3__) + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} - }} + } + } + } + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { @@ -21937,16 +22904,21 @@ class reduce_sum_m2_model final : public model_base_crtp { for (int sym3__ = 1; sym3__ <= N; ++sym3__) { { param_names__.emplace_back(std::string() + "y6" + '.' + std::to_string(sym3__) + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} - }} + } + } + } + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { { param_names__.emplace_back(std::string() + "y5" + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} + } + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { @@ -21954,27 +22926,35 @@ class reduce_sum_m2_model final : public model_base_crtp { for (int sym3__ = 1; sym3__ <= N; ++sym3__) { { param_names__.emplace_back(std::string() + "y4" + '.' + std::to_string(sym3__) + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} - }} + } + } + } + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { { param_names__.emplace_back(std::string() + "y3" + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} + } + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { { param_names__.emplace_back(std::string() + "y2" + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} + } + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { param_names__.emplace_back(std::string() + "y1" + '.' + std::to_string(sym1__)); - }} + } + } if (emit_transformed_parameters__) { } @@ -21985,14 +22965,16 @@ class reduce_sum_m2_model final : public model_base_crtp { } // unconstrained_param_names() - inline std::string get_constrained_sizedtypes() const final { + inline std::string get_constrained_sizedtypes() const { + + return std::string("[{\"name\":\"a8\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(N) + ",\"cols\":" + std::to_string(N) + "}}},\"block\":\"parameters\"},{\"name\":\"a7\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(N) + "}}},\"block\":\"parameters\"},{\"name\":\"a6\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(N) + "}}},\"block\":\"parameters\"},{\"name\":\"a5\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"real\"}}},\"block\":\"parameters\"},{\"name\":\"a4\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(N) + ",\"cols\":" + std::to_string(N) + "}},\"block\":\"parameters\"},{\"name\":\"a3\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(N) + "}},\"block\":\"parameters\"},{\"name\":\"a2\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(N) + "}},\"block\":\"parameters\"},{\"name\":\"a1\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"y8\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(N) + ",\"cols\":" + std::to_string(N) + "}}},\"block\":\"parameters\"},{\"name\":\"y7\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(N) + "}}},\"block\":\"parameters\"},{\"name\":\"y6\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(N) + "}}},\"block\":\"parameters\"},{\"name\":\"y5\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"real\"}}},\"block\":\"parameters\"},{\"name\":\"y4\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(N) + ",\"cols\":" + std::to_string(N) + "}},\"block\":\"parameters\"},{\"name\":\"y3\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(N) + "}},\"block\":\"parameters\"},{\"name\":\"y2\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(N) + "}},\"block\":\"parameters\"},{\"name\":\"y1\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"}]"); - return std::string("[{\"name\":\"a8\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << N << ",\"cols\":" << N << "}}},\"block\":\"parameters\"},{\"name\":\"a7\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}}},\"block\":\"parameters\"},{\"name\":\"a6\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}}},\"block\":\"parameters\"},{\"name\":\"a5\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"real\"}}},\"block\":\"parameters\"},{\"name\":\"a4\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << N << ",\"cols\":" << N << "}},\"block\":\"parameters\"},{\"name\":\"a3\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}},\"block\":\"parameters\"},{\"name\":\"a2\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}},\"block\":\"parameters\"},{\"name\":\"a1\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"y8\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << N << ",\"cols\":" << N << "}}},\"block\":\"parameters\"},{\"name\":\"y7\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}}},\"block\":\"parameters\"},{\"name\":\"y6\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}}},\"block\":\"parameters\"},{\"name\":\"y5\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"real\"}}},\"block\":\"parameters\"},{\"name\":\"y4\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << N << ",\"cols\":" << N << "}},\"block\":\"parameters\"},{\"name\":\"y3\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}},\"block\":\"parameters\"},{\"name\":\"y2\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}},\"block\":\"parameters\"},{\"name\":\"y1\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"}]"); } // get_constrained_sizedtypes() - inline std::string get_unconstrained_sizedtypes() const final { + inline std::string get_unconstrained_sizedtypes() const { + + return std::string("[{\"name\":\"a8\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(N) + ",\"cols\":" + std::to_string(N) + "}}},\"block\":\"parameters\"},{\"name\":\"a7\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(N) + "}}},\"block\":\"parameters\"},{\"name\":\"a6\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(N) + "}}},\"block\":\"parameters\"},{\"name\":\"a5\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"real\"}}},\"block\":\"parameters\"},{\"name\":\"a4\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(N) + ",\"cols\":" + std::to_string(N) + "}},\"block\":\"parameters\"},{\"name\":\"a3\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(N) + "}},\"block\":\"parameters\"},{\"name\":\"a2\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(N) + "}},\"block\":\"parameters\"},{\"name\":\"a1\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"y8\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(N) + ",\"cols\":" + std::to_string(N) + "}}},\"block\":\"parameters\"},{\"name\":\"y7\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(N) + "}}},\"block\":\"parameters\"},{\"name\":\"y6\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(N) + "}}},\"block\":\"parameters\"},{\"name\":\"y5\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"real\"}}},\"block\":\"parameters\"},{\"name\":\"y4\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(N) + ",\"cols\":" + std::to_string(N) + "}},\"block\":\"parameters\"},{\"name\":\"y3\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(N) + "}},\"block\":\"parameters\"},{\"name\":\"y2\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(N) + "}},\"block\":\"parameters\"},{\"name\":\"y1\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"}]"); - return std::string("[{\"name\":\"a8\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << N << ",\"cols\":" << N << "}}},\"block\":\"parameters\"},{\"name\":\"a7\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}}},\"block\":\"parameters\"},{\"name\":\"a6\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}}},\"block\":\"parameters\"},{\"name\":\"a5\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"real\"}}},\"block\":\"parameters\"},{\"name\":\"a4\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << N << ",\"cols\":" << N << "}},\"block\":\"parameters\"},{\"name\":\"a3\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}},\"block\":\"parameters\"},{\"name\":\"a2\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}},\"block\":\"parameters\"},{\"name\":\"a1\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"y8\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << N << ",\"cols\":" << N << "}}},\"block\":\"parameters\"},{\"name\":\"y7\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}}},\"block\":\"parameters\"},{\"name\":\"y6\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}}},\"block\":\"parameters\"},{\"name\":\"y5\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"real\"}}},\"block\":\"parameters\"},{\"name\":\"y4\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << N << ",\"cols\":" << N << "}},\"block\":\"parameters\"},{\"name\":\"y3\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}},\"block\":\"parameters\"},{\"name\":\"y2\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}},\"block\":\"parameters\"},{\"name\":\"y1\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"}]"); } // get_unconstrained_sizedtypes() @@ -22004,14 +22986,13 @@ class reduce_sum_m2_model final : public model_base_crtp { const bool emit_transformed_parameters = true, const bool emit_generated_quantities = true, std::ostream* pstream = nullptr) const { - std::vector vars_vec(vars.size()); + std::vector vars_vec; + vars_vec.reserve(vars.size()); std::vector params_i; write_array_impl(base_rng, params_r, params_i, vars_vec, emit_transformed_parameters, emit_generated_quantities, pstream); - vars.resize(vars_vec.size()); - for (int i = 0; i < vars.size(); ++i) { - vars.coeffRef(i) = vars_vec[i]; - } + vars = Eigen::Map>( + vars_vec.data(), vars_vec.size()); } template @@ -22021,7 +23002,8 @@ class reduce_sum_m2_model final : public model_base_crtp { bool emit_transformed_parameters = true, bool emit_generated_quantities = true, std::ostream* pstream = nullptr) const { - write_array_impl(base_rng, params_r, params_i, vars, emit_transformed_parameters, emit_generated_quantities, pstream); + write_array_impl(base_rng, params_r, params_i, vars, + emit_transformed_parameters, emit_generated_quantities, pstream); } template @@ -22042,13 +23024,12 @@ class reduce_sum_m2_model final : public model_base_crtp { inline void transform_inits(const stan::io::var_context& context, Eigen::Matrix& params_r, std::ostream* pstream = nullptr) const final { - std::vector params_r_vec(params_r.size()); + std::vector params_r_vec; + params_r_vec.reserve(params_r.size()); std::vector params_i; transform_inits_impl(context, params_i, params_r_vec, pstream); - params_r.resize(params_r_vec.size()); - for (int i = 0; i < params_r.size(); ++i) { - params_r.coeffRef(i) = params_r_vec[i]; - } + params_r = Eigen::Map>( + params_r_vec.data(), params_r_vec.size()); } inline void transform_inits(const stan::io::var_context& context, std::vector& params_i, @@ -23702,12 +24683,12 @@ r(std::ostream* pstream__) { (void) DUMMY_VAR__; // suppress unused var warning try { int N; - N = std::numeric_limits::min(); + N = std::numeric_limits::min(); current_statement__ = 224; validate_non_negative_index("y1d", "N", N); std::vector y1d; - y1d = std::vector(N, DUMMY_VAR__); + y1d = std::vector(N, DUMMY_VAR__); current_statement__ = 226; validate_non_negative_index("y2d", "N", N); @@ -23715,7 +24696,7 @@ r(std::ostream* pstream__) { validate_non_negative_index("y2d", "N", N); std::vector> y2d; y2d = std::vector>(N, Eigen::Matrix(N)); - stan::math::fill(y2d, DUMMY_VAR__); + stan::math::fill(y2d, DUMMY_VAR__); current_statement__ = 229; validate_non_negative_index("y3d", "N", N); @@ -23723,7 +24704,7 @@ r(std::ostream* pstream__) { validate_non_negative_index("y3d", "N", N); std::vector> y3d; y3d = std::vector>(N, Eigen::Matrix(N)); - stan::math::fill(y3d, DUMMY_VAR__); + stan::math::fill(y3d, DUMMY_VAR__); current_statement__ = 232; validate_non_negative_index("y4d", "N", N); @@ -23733,7 +24714,7 @@ r(std::ostream* pstream__) { validate_non_negative_index("y4d", "N", N); std::vector> y4d; y4d = std::vector>(N, Eigen::Matrix(N, N)); - stan::math::fill(y4d, DUMMY_VAR__); + stan::math::fill(y4d, DUMMY_VAR__); current_statement__ = 236; validate_non_negative_index("y5d", "N", N); @@ -23741,6 +24722,7 @@ r(std::ostream* pstream__) { validate_non_negative_index("y5d", "N", N); std::vector> y5d; y5d = std::vector>(N, std::vector(N, DUMMY_VAR__)); + current_statement__ = 239; validate_non_negative_index("y6d", "N", N); @@ -23750,7 +24732,7 @@ r(std::ostream* pstream__) { validate_non_negative_index("y6d", "N", N); std::vector>> y6d; y6d = std::vector>>(N, std::vector>(N, Eigen::Matrix(N))); - stan::math::fill(y6d, DUMMY_VAR__); + stan::math::fill(y6d, DUMMY_VAR__); current_statement__ = 243; validate_non_negative_index("y7d", "N", N); @@ -23760,7 +24742,7 @@ r(std::ostream* pstream__) { validate_non_negative_index("y7d", "N", N); std::vector>> y7d; y7d = std::vector>>(N, std::vector>(N, Eigen::Matrix(N))); - stan::math::fill(y7d, DUMMY_VAR__); + stan::math::fill(y7d, DUMMY_VAR__); current_statement__ = 247; validate_non_negative_index("y8d", "N", N); @@ -23772,22 +24754,22 @@ r(std::ostream* pstream__) { validate_non_negative_index("y8d", "N", N); std::vector>> y8d; y8d = std::vector>>(N, std::vector>(N, Eigen::Matrix(N, N))); - stan::math::fill(y8d, DUMMY_VAR__); + stan::math::fill(y8d, DUMMY_VAR__); local_scalar_t__ y9d; - y9d = DUMMY_VAR__; + y9d = DUMMY_VAR__; current_statement__ = 253; validate_non_negative_index("y10d", "N", N); Eigen::Matrix y10d; y10d = Eigen::Matrix(N); - stan::math::fill(y10d, DUMMY_VAR__); + stan::math::fill(y10d, DUMMY_VAR__); current_statement__ = 255; validate_non_negative_index("y11d", "N", N); Eigen::Matrix y11d; y11d = Eigen::Matrix(N); - stan::math::fill(y11d, DUMMY_VAR__); + stan::math::fill(y11d, DUMMY_VAR__); current_statement__ = 257; validate_non_negative_index("y12d", "N", N); @@ -23795,15 +24777,15 @@ r(std::ostream* pstream__) { validate_non_negative_index("y12d", "N", N); Eigen::Matrix y12d; y12d = Eigen::Matrix(N, N); - stan::math::fill(y12d, DUMMY_VAR__); + stan::math::fill(y12d, DUMMY_VAR__); int y13d; - y13d = std::numeric_limits::min(); + y13d = std::numeric_limits::min(); current_statement__ = 261; validate_non_negative_index("y14d", "N", N); std::vector y14d; - y14d = std::vector(N, std::numeric_limits::min()); + y14d = std::vector(N, std::numeric_limits::min()); current_statement__ = 263; validate_non_negative_index("y15d", "N", N); @@ -23811,6 +24793,7 @@ r(std::ostream* pstream__) { validate_non_negative_index("y15d", "N", N); std::vector> y15d; y15d = std::vector>(N, std::vector(N, std::numeric_limits::min())); + current_statement__ = 266; validate_non_negative_index("y16d", "N", N); @@ -23820,6 +24803,7 @@ r(std::ostream* pstream__) { validate_non_negative_index("y16d", "N", N); std::vector>> y16d; y16d = std::vector>>(N, std::vector>(N, std::vector(N, std::numeric_limits::min()))); + current_statement__ = 270; validate_non_negative_index("y17d", "N", N); @@ -23829,11 +24813,12 @@ r(std::ostream* pstream__) { validate_non_negative_index("y17d", "N", N); std::vector>> y17d; y17d = std::vector>>(N, std::vector>(N, std::vector(N, DUMMY_VAR__))); + current_statement__ = 274; validate_non_negative_index("y1", "N", N); std::vector y1; - y1 = std::vector(N, DUMMY_VAR__); + y1 = std::vector(N, DUMMY_VAR__); current_statement__ = 276; validate_non_negative_index("y2", "N", N); @@ -23841,7 +24826,7 @@ r(std::ostream* pstream__) { validate_non_negative_index("y2", "N", N); std::vector> y2; y2 = std::vector>(N, Eigen::Matrix(N)); - stan::math::fill(y2, DUMMY_VAR__); + stan::math::fill(y2, DUMMY_VAR__); current_statement__ = 279; validate_non_negative_index("y3", "N", N); @@ -23849,7 +24834,7 @@ r(std::ostream* pstream__) { validate_non_negative_index("y3", "N", N); std::vector> y3; y3 = std::vector>(N, Eigen::Matrix(N)); - stan::math::fill(y3, DUMMY_VAR__); + stan::math::fill(y3, DUMMY_VAR__); current_statement__ = 282; validate_non_negative_index("y4", "N", N); @@ -23859,7 +24844,7 @@ r(std::ostream* pstream__) { validate_non_negative_index("y4", "N", N); std::vector> y4; y4 = std::vector>(N, Eigen::Matrix(N, N)); - stan::math::fill(y4, DUMMY_VAR__); + stan::math::fill(y4, DUMMY_VAR__); current_statement__ = 286; validate_non_negative_index("y5", "N", N); @@ -23867,6 +24852,7 @@ r(std::ostream* pstream__) { validate_non_negative_index("y5", "N", N); std::vector> y5; y5 = std::vector>(N, std::vector(N, DUMMY_VAR__)); + current_statement__ = 289; validate_non_negative_index("y6", "N", N); @@ -23876,7 +24862,7 @@ r(std::ostream* pstream__) { validate_non_negative_index("y6", "N", N); std::vector>> y6; y6 = std::vector>>(N, std::vector>(N, Eigen::Matrix(N))); - stan::math::fill(y6, DUMMY_VAR__); + stan::math::fill(y6, DUMMY_VAR__); current_statement__ = 293; validate_non_negative_index("y7", "N", N); @@ -23886,7 +24872,7 @@ r(std::ostream* pstream__) { validate_non_negative_index("y7", "N", N); std::vector>> y7; y7 = std::vector>>(N, std::vector>(N, Eigen::Matrix(N))); - stan::math::fill(y7, DUMMY_VAR__); + stan::math::fill(y7, DUMMY_VAR__); current_statement__ = 297; validate_non_negative_index("y8", "N", N); @@ -23898,22 +24884,22 @@ r(std::ostream* pstream__) { validate_non_negative_index("y8", "N", N); std::vector>> y8; y8 = std::vector>>(N, std::vector>(N, Eigen::Matrix(N, N))); - stan::math::fill(y8, DUMMY_VAR__); + stan::math::fill(y8, DUMMY_VAR__); local_scalar_t__ y9; - y9 = DUMMY_VAR__; + y9 = DUMMY_VAR__; current_statement__ = 303; validate_non_negative_index("y10", "N", N); Eigen::Matrix y10; y10 = Eigen::Matrix(N); - stan::math::fill(y10, DUMMY_VAR__); + stan::math::fill(y10, DUMMY_VAR__); current_statement__ = 305; validate_non_negative_index("y11", "N", N); Eigen::Matrix y11; y11 = Eigen::Matrix(N); - stan::math::fill(y11, DUMMY_VAR__); + stan::math::fill(y11, DUMMY_VAR__); current_statement__ = 307; validate_non_negative_index("y12", "N", N); @@ -23921,7 +24907,7 @@ r(std::ostream* pstream__) { validate_non_negative_index("y12", "N", N); Eigen::Matrix y12; y12 = Eigen::Matrix(N, N); - stan::math::fill(y12, DUMMY_VAR__); + stan::math::fill(y12, DUMMY_VAR__); current_statement__ = 310; validate_non_negative_index("y17", "N", N); @@ -23931,135 +24917,136 @@ r(std::ostream* pstream__) { validate_non_negative_index("y17", "N", N); std::vector>> y17; y17 = std::vector>>(N, std::vector>(N, std::vector(N, DUMMY_VAR__))); + local_scalar_t__ t1; - t1 = DUMMY_VAR__; + t1 = DUMMY_VAR__; current_statement__ = 314; t1 = reduce_sum(y1, 1, pstream__); local_scalar_t__ t1a; - t1a = DUMMY_VAR__; + t1a = DUMMY_VAR__; current_statement__ = 315; t1a = (reduce_sum(y1, 1, pstream__) + reduce_sum(y1, 1, pstream__)); local_scalar_t__ t2; - t2 = DUMMY_VAR__; + t2 = DUMMY_VAR__; current_statement__ = 316; t2 = reduce_sum(y2, 1, pstream__); local_scalar_t__ t3; - t3 = DUMMY_VAR__; + t3 = DUMMY_VAR__; current_statement__ = 317; t3 = reduce_sum(y3, 1, pstream__); local_scalar_t__ t4; - t4 = DUMMY_VAR__; + t4 = DUMMY_VAR__; current_statement__ = 318; t4 = reduce_sum(y4, 1, pstream__); local_scalar_t__ t5; - t5 = DUMMY_VAR__; + t5 = DUMMY_VAR__; current_statement__ = 319; t5 = reduce_sum(y5, 1, pstream__); local_scalar_t__ t6; - t6 = DUMMY_VAR__; + t6 = DUMMY_VAR__; current_statement__ = 320; t6 = reduce_sum(y6, 1, pstream__); local_scalar_t__ t7; - t7 = DUMMY_VAR__; + t7 = DUMMY_VAR__; current_statement__ = 321; t7 = reduce_sum(y7, 1, pstream__); local_scalar_t__ t8; - t8 = DUMMY_VAR__; + t8 = DUMMY_VAR__; current_statement__ = 322; t8 = reduce_sum(y8, 1, pstream__); local_scalar_t__ t9; - t9 = DUMMY_VAR__; + t9 = DUMMY_VAR__; current_statement__ = 323; t9 = reduce_sum(y14d, 1, pstream__); local_scalar_t__ t10; - t10 = DUMMY_VAR__; + t10 = DUMMY_VAR__; current_statement__ = 324; t10 = reduce_sum(y15d, 1, pstream__); local_scalar_t__ t11; - t11 = DUMMY_VAR__; + t11 = DUMMY_VAR__; current_statement__ = 325; t11 = reduce_sum(y16d, 1, pstream__); local_scalar_t__ t12; - t12 = DUMMY_VAR__; + t12 = DUMMY_VAR__; current_statement__ = 326; t12 = reduce_sum(y17, 1, pstream__); local_scalar_t__ tg1; - tg1 = DUMMY_VAR__; + tg1 = DUMMY_VAR__; current_statement__ = 327; tg1 = reduce_sum(y1, 1, pstream__, y9); local_scalar_t__ tg2; - tg2 = DUMMY_VAR__; + tg2 = DUMMY_VAR__; current_statement__ = 328; tg2 = reduce_sum(y1, 1, pstream__, y10); local_scalar_t__ tg3; - tg3 = DUMMY_VAR__; + tg3 = DUMMY_VAR__; current_statement__ = 329; tg3 = reduce_sum(y1, 1, pstream__, y11); local_scalar_t__ tg4; - tg4 = DUMMY_VAR__; + tg4 = DUMMY_VAR__; current_statement__ = 330; tg4 = reduce_sum(y1, 1, pstream__, y12); local_scalar_t__ tg5; - tg5 = DUMMY_VAR__; + tg5 = DUMMY_VAR__; current_statement__ = 331; tg5 = reduce_sum(y1, 1, pstream__, y1); local_scalar_t__ tg6; - tg6 = DUMMY_VAR__; + tg6 = DUMMY_VAR__; current_statement__ = 332; tg6 = reduce_sum(y1, 1, pstream__, y2); local_scalar_t__ tg7; - tg7 = DUMMY_VAR__; + tg7 = DUMMY_VAR__; current_statement__ = 333; tg7 = reduce_sum(y1, 1, pstream__, y3); local_scalar_t__ tg8; - tg8 = DUMMY_VAR__; + tg8 = DUMMY_VAR__; current_statement__ = 334; tg8 = reduce_sum(y1, 1, pstream__, y4); local_scalar_t__ tg9; - tg9 = DUMMY_VAR__; + tg9 = DUMMY_VAR__; current_statement__ = 335; tg9 = reduce_sum(y1, 1, pstream__, y5); local_scalar_t__ tg10; - tg10 = DUMMY_VAR__; + tg10 = DUMMY_VAR__; current_statement__ = 336; tg10 = reduce_sum(y1, 1, pstream__, y6); local_scalar_t__ tg11; - tg11 = DUMMY_VAR__; + tg11 = DUMMY_VAR__; current_statement__ = 337; tg11 = reduce_sum(y1, 1, pstream__, y7); local_scalar_t__ tg12; - tg12 = DUMMY_VAR__; + tg12 = DUMMY_VAR__; current_statement__ = 338; tg12 = reduce_sum(y1, 1, pstream__, y8); local_scalar_t__ ts; - ts = DUMMY_VAR__; + ts = DUMMY_VAR__; current_statement__ = 339; ts = reduce_sum(y1d, 1, pstream__, y13d, y9, y10, y11, @@ -24154,13 +25141,13 @@ class reduce_sum_m3_model final : public model_base_crtp { (void) DUMMY_VAR__; // suppress unused var warning try { int pos__; - pos__ = std::numeric_limits::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; current_statement__ = 67; context__.validate_dims("data initialization","N","int", - context__.to_vec()); - N = std::numeric_limits::min(); + std::vector{}); + N = std::numeric_limits::min(); current_statement__ = 67; N = context__.vals_i("N")[(1 - 1)]; @@ -24168,8 +25155,9 @@ class reduce_sum_m3_model final : public model_base_crtp { validate_non_negative_index("y1d", "N", N); current_statement__ = 69; context__.validate_dims("data initialization","y1d","double", - context__.to_vec(N)); + std::vector{static_cast(N)}); y1d = std::vector(N, std::numeric_limits::quiet_NaN()); + current_statement__ = 69; y1d = context__.vals_r("y1d"); @@ -24179,9 +25167,10 @@ class reduce_sum_m3_model final : public model_base_crtp { validate_non_negative_index("y2d", "N", N); current_statement__ = 72; context__.validate_dims("data initialization","y2d","double", - context__.to_vec(N, N)); + std::vector{static_cast(N), + static_cast(N)}); y2d = std::vector>(N, Eigen::Matrix(N)); - stan::math::fill(y2d, std::numeric_limits::quiet_NaN()); + stan::math::fill(y2d, std::numeric_limits::quiet_NaN()); { std::vector y2d_flat__; @@ -24197,7 +25186,9 @@ class reduce_sum_m3_model final : public model_base_crtp { assign(y2d, y2d_flat__[(pos__ - 1)], "assigning variable y2d", index_uni(sym2__), index_uni(sym1__)); current_statement__ = 72; - pos__ = (pos__ + 1);}} + pos__ = (pos__ + 1); + } + } } current_statement__ = 73; validate_non_negative_index("y3d", "N", N); @@ -24205,9 +25196,10 @@ class reduce_sum_m3_model final : public model_base_crtp { validate_non_negative_index("y3d", "N", N); current_statement__ = 75; context__.validate_dims("data initialization","y3d","double", - context__.to_vec(N, N)); + std::vector{static_cast(N), + static_cast(N)}); y3d = std::vector>(N, Eigen::Matrix(N)); - stan::math::fill(y3d, std::numeric_limits::quiet_NaN()); + stan::math::fill(y3d, std::numeric_limits::quiet_NaN()); { std::vector y3d_flat__; @@ -24223,7 +25215,9 @@ class reduce_sum_m3_model final : public model_base_crtp { assign(y3d, y3d_flat__[(pos__ - 1)], "assigning variable y3d", index_uni(sym2__), index_uni(sym1__)); current_statement__ = 75; - pos__ = (pos__ + 1);}} + pos__ = (pos__ + 1); + } + } } current_statement__ = 76; validate_non_negative_index("y4d", "N", N); @@ -24233,9 +25227,10 @@ class reduce_sum_m3_model final : public model_base_crtp { validate_non_negative_index("y4d", "N", N); current_statement__ = 79; context__.validate_dims("data initialization","y4d","double", - context__.to_vec(N, N, N)); + std::vector{static_cast(N), + static_cast(N), static_cast(N)}); y4d = std::vector>(N, Eigen::Matrix(N, N)); - stan::math::fill(y4d, std::numeric_limits::quiet_NaN()); + stan::math::fill(y4d, std::numeric_limits::quiet_NaN()); { std::vector y4d_flat__; @@ -24255,7 +25250,10 @@ class reduce_sum_m3_model final : public model_base_crtp { index_uni(sym2__), index_uni(sym1__)); current_statement__ = 79; - pos__ = (pos__ + 1);}}} + pos__ = (pos__ + 1); + } + } + } } current_statement__ = 80; validate_non_negative_index("y5d", "N", N); @@ -24263,8 +25261,10 @@ class reduce_sum_m3_model final : public model_base_crtp { validate_non_negative_index("y5d", "N", N); current_statement__ = 82; context__.validate_dims("data initialization","y5d","double", - context__.to_vec(N, N)); + std::vector{static_cast(N), + static_cast(N)}); y5d = std::vector>(N, std::vector(N, std::numeric_limits::quiet_NaN())); + { std::vector y5d_flat__; @@ -24280,7 +25280,9 @@ class reduce_sum_m3_model final : public model_base_crtp { assign(y5d, y5d_flat__[(pos__ - 1)], "assigning variable y5d", index_uni(sym2__), index_uni(sym1__)); current_statement__ = 82; - pos__ = (pos__ + 1);}} + pos__ = (pos__ + 1); + } + } } current_statement__ = 83; validate_non_negative_index("y6d", "N", N); @@ -24290,9 +25292,10 @@ class reduce_sum_m3_model final : public model_base_crtp { validate_non_negative_index("y6d", "N", N); current_statement__ = 86; context__.validate_dims("data initialization","y6d","double", - context__.to_vec(N, N, N)); + std::vector{static_cast(N), + static_cast(N), static_cast(N)}); y6d = std::vector>>(N, std::vector>(N, Eigen::Matrix(N))); - stan::math::fill(y6d, std::numeric_limits::quiet_NaN()); + stan::math::fill(y6d, std::numeric_limits::quiet_NaN()); { std::vector y6d_flat__; @@ -24312,7 +25315,10 @@ class reduce_sum_m3_model final : public model_base_crtp { index_uni(sym2__), index_uni(sym1__)); current_statement__ = 86; - pos__ = (pos__ + 1);}}} + pos__ = (pos__ + 1); + } + } + } } current_statement__ = 87; validate_non_negative_index("y7d", "N", N); @@ -24322,9 +25328,10 @@ class reduce_sum_m3_model final : public model_base_crtp { validate_non_negative_index("y7d", "N", N); current_statement__ = 90; context__.validate_dims("data initialization","y7d","double", - context__.to_vec(N, N, N)); + std::vector{static_cast(N), + static_cast(N), static_cast(N)}); y7d = std::vector>>(N, std::vector>(N, Eigen::Matrix(N))); - stan::math::fill(y7d, std::numeric_limits::quiet_NaN()); + stan::math::fill(y7d, std::numeric_limits::quiet_NaN()); { std::vector y7d_flat__; @@ -24344,7 +25351,10 @@ class reduce_sum_m3_model final : public model_base_crtp { index_uni(sym2__), index_uni(sym1__)); current_statement__ = 90; - pos__ = (pos__ + 1);}}} + pos__ = (pos__ + 1); + } + } + } } current_statement__ = 91; validate_non_negative_index("y8d", "N", N); @@ -24356,9 +25366,11 @@ class reduce_sum_m3_model final : public model_base_crtp { validate_non_negative_index("y8d", "N", N); current_statement__ = 95; context__.validate_dims("data initialization","y8d","double", - context__.to_vec(N, N, N, N)); + std::vector{static_cast(N), + static_cast(N), static_cast(N), + static_cast(N)}); y8d = std::vector>>(N, std::vector>(N, Eigen::Matrix(N, N))); - stan::math::fill(y8d, std::numeric_limits::quiet_NaN()); + stan::math::fill(y8d, std::numeric_limits::quiet_NaN()); { std::vector y8d_flat__; @@ -24381,12 +25393,16 @@ class reduce_sum_m3_model final : public model_base_crtp { index_uni(sym2__), index_uni(sym1__)); current_statement__ = 95; - pos__ = (pos__ + 1);}}}} + pos__ = (pos__ + 1); + } + } + } + } } current_statement__ = 96; context__.validate_dims("data initialization","y9d","double", - context__.to_vec()); - y9d = std::numeric_limits::quiet_NaN(); + std::vector{}); + y9d = std::numeric_limits::quiet_NaN(); current_statement__ = 96; y9d = context__.vals_r("y9d")[(1 - 1)]; @@ -24394,9 +25410,9 @@ class reduce_sum_m3_model final : public model_base_crtp { validate_non_negative_index("y10d", "N", N); current_statement__ = 98; context__.validate_dims("data initialization","y10d","double", - context__.to_vec(N)); + std::vector{static_cast(N)}); y10d = Eigen::Matrix(N); - stan::math::fill(y10d, std::numeric_limits::quiet_NaN()); + stan::math::fill(y10d, std::numeric_limits::quiet_NaN()); { std::vector y10d_flat__; @@ -24410,15 +25426,16 @@ class reduce_sum_m3_model final : public model_base_crtp { assign(y10d, y10d_flat__[(pos__ - 1)], "assigning variable y10d", index_uni(sym1__)); current_statement__ = 98; - pos__ = (pos__ + 1);} + pos__ = (pos__ + 1); + } } current_statement__ = 99; validate_non_negative_index("y11d", "N", N); current_statement__ = 100; context__.validate_dims("data initialization","y11d","double", - context__.to_vec(N)); + std::vector{static_cast(N)}); y11d = Eigen::Matrix(N); - stan::math::fill(y11d, std::numeric_limits::quiet_NaN()); + stan::math::fill(y11d, std::numeric_limits::quiet_NaN()); { std::vector y11d_flat__; @@ -24432,7 +25449,8 @@ class reduce_sum_m3_model final : public model_base_crtp { assign(y11d, y11d_flat__[(pos__ - 1)], "assigning variable y11d", index_uni(sym1__)); current_statement__ = 100; - pos__ = (pos__ + 1);} + pos__ = (pos__ + 1); + } } current_statement__ = 101; validate_non_negative_index("y12d", "N", N); @@ -24440,9 +25458,10 @@ class reduce_sum_m3_model final : public model_base_crtp { validate_non_negative_index("y12d", "N", N); current_statement__ = 103; context__.validate_dims("data initialization","y12d","double", - context__.to_vec(N, N)); + std::vector{static_cast(N), + static_cast(N)}); y12d = Eigen::Matrix(N, N); - stan::math::fill(y12d, std::numeric_limits::quiet_NaN()); + stan::math::fill(y12d, std::numeric_limits::quiet_NaN()); { std::vector y12d_flat__; @@ -24458,12 +25477,14 @@ class reduce_sum_m3_model final : public model_base_crtp { assign(y12d, y12d_flat__[(pos__ - 1)], "assigning variable y12d", index_uni(sym2__), index_uni(sym1__)); current_statement__ = 103; - pos__ = (pos__ + 1);}} + pos__ = (pos__ + 1); + } + } } current_statement__ = 104; context__.validate_dims("data initialization","y13d","int", - context__.to_vec()); - y13d = std::numeric_limits::min(); + std::vector{}); + y13d = std::numeric_limits::min(); current_statement__ = 104; y13d = context__.vals_i("y13d")[(1 - 1)]; @@ -24471,8 +25492,8 @@ class reduce_sum_m3_model final : public model_base_crtp { validate_non_negative_index("y14d", "N", N); current_statement__ = 106; context__.validate_dims("data initialization","y14d","int", - context__.to_vec(N)); - y14d = std::vector(N, std::numeric_limits::min()); + std::vector{static_cast(N)}); + y14d = std::vector(N, std::numeric_limits::min()); current_statement__ = 106; y14d = context__.vals_i("y14d"); @@ -24482,8 +25503,10 @@ class reduce_sum_m3_model final : public model_base_crtp { validate_non_negative_index("y15d", "N", N); current_statement__ = 109; context__.validate_dims("data initialization","y15d","int", - context__.to_vec(N, N)); + std::vector{static_cast(N), + static_cast(N)}); y15d = std::vector>(N, std::vector(N, std::numeric_limits::min())); + { std::vector y15d_flat__; @@ -24499,7 +25522,9 @@ class reduce_sum_m3_model final : public model_base_crtp { assign(y15d, y15d_flat__[(pos__ - 1)], "assigning variable y15d", index_uni(sym2__), index_uni(sym1__)); current_statement__ = 109; - pos__ = (pos__ + 1);}} + pos__ = (pos__ + 1); + } + } } current_statement__ = 110; validate_non_negative_index("y16d", "N", N); @@ -24509,8 +25534,10 @@ class reduce_sum_m3_model final : public model_base_crtp { validate_non_negative_index("y16d", "N", N); current_statement__ = 113; context__.validate_dims("data initialization","y16d","int", - context__.to_vec(N, N, N)); + std::vector{static_cast(N), + static_cast(N), static_cast(N)}); y16d = std::vector>>(N, std::vector>(N, std::vector(N, std::numeric_limits::min()))); + { std::vector y16d_flat__; @@ -24530,7 +25557,10 @@ class reduce_sum_m3_model final : public model_base_crtp { index_uni(sym2__), index_uni(sym1__)); current_statement__ = 113; - pos__ = (pos__ + 1);}}} + pos__ = (pos__ + 1); + } + } + } } current_statement__ = 114; validate_non_negative_index("y17d", "N", N); @@ -24540,8 +25570,10 @@ class reduce_sum_m3_model final : public model_base_crtp { validate_non_negative_index("y17d", "N", N); current_statement__ = 117; context__.validate_dims("data initialization","y17d","double", - context__.to_vec(N, N, N)); + std::vector{static_cast(N), + static_cast(N), static_cast(N)}); y17d = std::vector>>(N, std::vector>(N, std::vector(N, std::numeric_limits::quiet_NaN()))); + { std::vector y17d_flat__; @@ -24561,136 +25593,113 @@ class reduce_sum_m3_model final : public model_base_crtp { index_uni(sym2__), index_uni(sym1__)); current_statement__ = 117; - pos__ = (pos__ + 1);}}} + pos__ = (pos__ + 1); + } + } + } } current_statement__ = 118; - td1 = std::numeric_limits::quiet_NaN(); current_statement__ = 118; td1 = reduce_sum(y1d, 1, pstream__); current_statement__ = 119; - td1a = std::numeric_limits::quiet_NaN(); current_statement__ = 119; td1a = (reduce_sum(y1d, 1, pstream__) + reduce_sum(y1d, 1, pstream__)); current_statement__ = 120; - td2 = std::numeric_limits::quiet_NaN(); current_statement__ = 120; td2 = reduce_sum(y2d, 1, pstream__); current_statement__ = 121; - td3 = std::numeric_limits::quiet_NaN(); current_statement__ = 121; td3 = reduce_sum(y3d, 1, pstream__); current_statement__ = 122; - td4 = std::numeric_limits::quiet_NaN(); current_statement__ = 122; td4 = reduce_sum(y4d, 1, pstream__); current_statement__ = 123; - td5 = std::numeric_limits::quiet_NaN(); current_statement__ = 123; td5 = reduce_sum(y5d, 1, pstream__); current_statement__ = 124; - td6 = std::numeric_limits::quiet_NaN(); current_statement__ = 124; td6 = reduce_sum(y6d, 1, pstream__); current_statement__ = 125; - td7 = std::numeric_limits::quiet_NaN(); current_statement__ = 125; td7 = reduce_sum(y7d, 1, pstream__); current_statement__ = 126; - td8 = std::numeric_limits::quiet_NaN(); current_statement__ = 126; td8 = reduce_sum(y8d, 1, pstream__); current_statement__ = 127; - td9 = std::numeric_limits::quiet_NaN(); current_statement__ = 127; td9 = reduce_sum(y14d, 1, pstream__); current_statement__ = 128; - td10 = std::numeric_limits::quiet_NaN(); current_statement__ = 128; td10 = reduce_sum(y15d, 1, pstream__); current_statement__ = 129; - td11 = std::numeric_limits::quiet_NaN(); current_statement__ = 129; td11 = reduce_sum(y16d, 1, pstream__); current_statement__ = 130; - td12 = std::numeric_limits::quiet_NaN(); current_statement__ = 130; td12 = reduce_sum(y17d, 1, pstream__); current_statement__ = 131; - tgd1 = std::numeric_limits::quiet_NaN(); current_statement__ = 131; tgd1 = reduce_sum(y1d, 1, pstream__, y9d); current_statement__ = 132; - tgd2 = std::numeric_limits::quiet_NaN(); current_statement__ = 132; tgd2 = reduce_sum(y1d, 1, pstream__, y10d); current_statement__ = 133; - tgd3 = std::numeric_limits::quiet_NaN(); current_statement__ = 133; tgd3 = reduce_sum(y1d, 1, pstream__, y11d); current_statement__ = 134; - tgd4 = std::numeric_limits::quiet_NaN(); current_statement__ = 134; tgd4 = reduce_sum(y1d, 1, pstream__, y12d); current_statement__ = 135; - tgd5 = std::numeric_limits::quiet_NaN(); current_statement__ = 135; tgd5 = reduce_sum(y1d, 1, pstream__, y1d); current_statement__ = 136; - tgd6 = std::numeric_limits::quiet_NaN(); current_statement__ = 136; tgd6 = reduce_sum(y1d, 1, pstream__, y2d); current_statement__ = 137; - tgd7 = std::numeric_limits::quiet_NaN(); current_statement__ = 137; tgd7 = reduce_sum(y1d, 1, pstream__, y3d); current_statement__ = 138; - tgd8 = std::numeric_limits::quiet_NaN(); current_statement__ = 138; tgd8 = reduce_sum(y1d, 1, pstream__, y4d); current_statement__ = 139; - tgd9 = std::numeric_limits::quiet_NaN(); current_statement__ = 139; tgd9 = reduce_sum(y1d, 1, pstream__, y5d); current_statement__ = 140; - tgd10 = std::numeric_limits::quiet_NaN(); current_statement__ = 140; tgd10 = reduce_sum(y1d, 1, pstream__, y6d); current_statement__ = 141; - tgd11 = std::numeric_limits::quiet_NaN(); current_statement__ = 141; tgd11 = reduce_sum(y1d, 1, pstream__, y7d); current_statement__ = 142; - tgd12 = std::numeric_limits::quiet_NaN(); current_statement__ = 142; tgd12 = reduce_sum(y1d, 1, pstream__, y8d); current_statement__ = 143; - tsd = std::numeric_limits::quiet_NaN(); current_statement__ = 143; tsd = reduce_sum(y1d, 1, pstream__, y13d, y9d, y10d, @@ -24755,27 +25764,10 @@ class reduce_sum_m3_model final : public model_base_crtp { // Next line prevents compiler griping about no return throw std::runtime_error("*** IF YOU SEE THIS, PLEASE REPORT A BUG ***"); } - num_params_r__ = 0U; + num_params_r__ = N + (N * N) + (N * N) + (N * N * N) + (N * N) + + (N * N * N) + (N * N * N) + (N * N * N * N) + 1 + N + N + (N * N) + + (N * N * N); - try { - num_params_r__ += N; - num_params_r__ += N * N; - num_params_r__ += N * N; - num_params_r__ += N * N * N; - num_params_r__ += N * N; - num_params_r__ += N * N * N; - num_params_r__ += N * N * N; - num_params_r__ += N * N * N * N; - num_params_r__ += 1; - num_params_r__ += N; - num_params_r__ += N; - num_params_r__ += N * N; - num_params_r__ += N * N * N; - } catch (const std::exception& e) { - stan::lang::rethrow_located(e, locations_array__[current_statement__]); - // Next line prevents compiler griping about no return - throw std::runtime_error("*** IF YOU SEE THIS, PLEASE REPORT A BUG ***"); - } } template { try { std::vector y1; - y1 = std::vector(N, DUMMY_VAR__); + y1 = std::vector(N, DUMMY_VAR__); current_statement__ = 1; y1 = in__.template read>(N); std::vector> y2; y2 = std::vector>(N, Eigen::Matrix(N)); - stan::math::fill(y2, DUMMY_VAR__); + stan::math::fill(y2, DUMMY_VAR__); current_statement__ = 2; y2 = in__.template read>>( N, N); std::vector> y3; y3 = std::vector>(N, Eigen::Matrix(N)); - stan::math::fill(y3, DUMMY_VAR__); + stan::math::fill(y3, DUMMY_VAR__); current_statement__ = 3; y3 = in__.template read>>( N, N); std::vector> y4; y4 = std::vector>(N, Eigen::Matrix(N, N)); - stan::math::fill(y4, DUMMY_VAR__); + stan::math::fill(y4, DUMMY_VAR__); current_statement__ = 4; y4 = in__.template read>>( N, N, N); std::vector> y5; y5 = std::vector>(N, std::vector(N, DUMMY_VAR__)); + current_statement__ = 5; y5 = in__.template read>>(N, N); std::vector>> y6; y6 = std::vector>>(N, std::vector>(N, Eigen::Matrix(N))); - stan::math::fill(y6, DUMMY_VAR__); + stan::math::fill(y6, DUMMY_VAR__); current_statement__ = 6; y6 = in__.template read>>>( N, N, N); std::vector>> y7; y7 = std::vector>>(N, std::vector>(N, Eigen::Matrix(N))); - stan::math::fill(y7, DUMMY_VAR__); + stan::math::fill(y7, DUMMY_VAR__); current_statement__ = 7; y7 = in__.template read>>>( N, N, N); std::vector>> y8; y8 = std::vector>>(N, std::vector>(N, Eigen::Matrix(N, N))); - stan::math::fill(y8, DUMMY_VAR__); + stan::math::fill(y8, DUMMY_VAR__); current_statement__ = 8; y8 = in__.template read>>>( N, N, N, N); local_scalar_t__ y9; - y9 = DUMMY_VAR__; + y9 = DUMMY_VAR__; current_statement__ = 9; y9 = in__.template read(); Eigen::Matrix y10; y10 = Eigen::Matrix(N); - stan::math::fill(y10, DUMMY_VAR__); + stan::math::fill(y10, DUMMY_VAR__); current_statement__ = 10; y10 = in__.template read>(N); Eigen::Matrix y11; y11 = Eigen::Matrix(N); - stan::math::fill(y11, DUMMY_VAR__); + stan::math::fill(y11, DUMMY_VAR__); current_statement__ = 11; y11 = in__.template read>(N); Eigen::Matrix y12; y12 = Eigen::Matrix(N, N); - stan::math::fill(y12, DUMMY_VAR__); + stan::math::fill(y12, DUMMY_VAR__); current_statement__ = 12; y12 = in__.template read>(N, N); std::vector>> y17; y17 = std::vector>>(N, std::vector>(N, std::vector(N, DUMMY_VAR__))); + current_statement__ = 13; y17 = in__.template read>>>( N, N, N); { local_scalar_t__ t1; - t1 = DUMMY_VAR__; + t1 = DUMMY_VAR__; current_statement__ = 40; t1 = reduce_sum(y1, 1, pstream__); local_scalar_t__ t1a; - t1a = DUMMY_VAR__; + t1a = DUMMY_VAR__; current_statement__ = 41; t1a = (reduce_sum(y1, 1, pstream__) + reduce_sum(y1, 1, pstream__)); local_scalar_t__ t2; - t2 = DUMMY_VAR__; + t2 = DUMMY_VAR__; current_statement__ = 42; t2 = reduce_sum(y2, 1, pstream__); local_scalar_t__ t3; - t3 = DUMMY_VAR__; + t3 = DUMMY_VAR__; current_statement__ = 43; t3 = reduce_sum(y3, 1, pstream__); local_scalar_t__ t4; - t4 = DUMMY_VAR__; + t4 = DUMMY_VAR__; current_statement__ = 44; t4 = reduce_sum(y4, 1, pstream__); local_scalar_t__ t5; - t5 = DUMMY_VAR__; + t5 = DUMMY_VAR__; current_statement__ = 45; t5 = reduce_sum(y5, 1, pstream__); local_scalar_t__ t6; - t6 = DUMMY_VAR__; + t6 = DUMMY_VAR__; current_statement__ = 46; t6 = reduce_sum(y6, 1, pstream__); local_scalar_t__ t7; - t7 = DUMMY_VAR__; + t7 = DUMMY_VAR__; current_statement__ = 47; t7 = reduce_sum(y7, 1, pstream__); local_scalar_t__ t8; - t8 = DUMMY_VAR__; + t8 = DUMMY_VAR__; current_statement__ = 48; t8 = reduce_sum(y8, 1, pstream__); local_scalar_t__ t9; - t9 = DUMMY_VAR__; + t9 = DUMMY_VAR__; current_statement__ = 49; t9 = reduce_sum(y14d, 1, pstream__); local_scalar_t__ t10; - t10 = DUMMY_VAR__; + t10 = DUMMY_VAR__; current_statement__ = 50; t10 = reduce_sum(y15d, 1, pstream__); local_scalar_t__ t11; - t11 = DUMMY_VAR__; + t11 = DUMMY_VAR__; current_statement__ = 51; t11 = reduce_sum(y16d, 1, pstream__); local_scalar_t__ t12; - t12 = DUMMY_VAR__; + t12 = DUMMY_VAR__; current_statement__ = 52; t12 = reduce_sum(y17, 1, pstream__); local_scalar_t__ tg1; - tg1 = DUMMY_VAR__; + tg1 = DUMMY_VAR__; current_statement__ = 53; tg1 = reduce_sum(y1, 1, pstream__, y9); local_scalar_t__ tg2; - tg2 = DUMMY_VAR__; + tg2 = DUMMY_VAR__; current_statement__ = 54; tg2 = reduce_sum(y1, 1, pstream__, y10); local_scalar_t__ tg3; - tg3 = DUMMY_VAR__; + tg3 = DUMMY_VAR__; current_statement__ = 55; tg3 = reduce_sum(y1, 1, pstream__, y11); local_scalar_t__ tg4; - tg4 = DUMMY_VAR__; + tg4 = DUMMY_VAR__; current_statement__ = 56; tg4 = reduce_sum(y1, 1, pstream__, y12); local_scalar_t__ tg5; - tg5 = DUMMY_VAR__; + tg5 = DUMMY_VAR__; current_statement__ = 57; tg5 = reduce_sum(y1, 1, pstream__, y1); local_scalar_t__ tg6; - tg6 = DUMMY_VAR__; + tg6 = DUMMY_VAR__; current_statement__ = 58; tg6 = reduce_sum(y1, 1, pstream__, y2); local_scalar_t__ tg7; - tg7 = DUMMY_VAR__; + tg7 = DUMMY_VAR__; current_statement__ = 59; tg7 = reduce_sum(y1, 1, pstream__, y3); local_scalar_t__ tg8; - tg8 = DUMMY_VAR__; + tg8 = DUMMY_VAR__; current_statement__ = 60; tg8 = reduce_sum(y1, 1, pstream__, y4); local_scalar_t__ tg9; - tg9 = DUMMY_VAR__; + tg9 = DUMMY_VAR__; current_statement__ = 61; tg9 = reduce_sum(y1, 1, pstream__, y5); local_scalar_t__ tg10; - tg10 = DUMMY_VAR__; + tg10 = DUMMY_VAR__; current_statement__ = 62; tg10 = reduce_sum(y1, 1, pstream__, y6); local_scalar_t__ tg11; - tg11 = DUMMY_VAR__; + tg11 = DUMMY_VAR__; current_statement__ = 63; tg11 = reduce_sum(y1, 1, pstream__, y7); local_scalar_t__ tg12; - tg12 = DUMMY_VAR__; + tg12 = DUMMY_VAR__; current_statement__ = 64; tg12 = reduce_sum(y1, 1, pstream__, y8); local_scalar_t__ ts; - ts = DUMMY_VAR__; + ts = DUMMY_VAR__; current_statement__ = 65; ts = reduce_sum(y1d, 1, pstream__, y13d, y9, y10, y11, y12, y14d, y1, y2, y3, y4, y15d, y5, y6, y7, y8, y16d, y17); local_scalar_t__ tt; - tt = DUMMY_VAR__; + tt = DUMMY_VAR__; current_statement__ = 66; tt = r(pstream__); @@ -25050,114 +26044,132 @@ class reduce_sum_m3_model final : public model_base_crtp { try { std::vector y1; - y1 = std::vector(N, std::numeric_limits::quiet_NaN()); + y1 = std::vector(N, std::numeric_limits::quiet_NaN()); current_statement__ = 1; y1 = in__.template read>(N); std::vector> y2; y2 = std::vector>(N, Eigen::Matrix(N)); - stan::math::fill(y2, std::numeric_limits::quiet_NaN()); + stan::math::fill(y2, std::numeric_limits::quiet_NaN()); current_statement__ = 2; y2 = in__.template read>>( N, N); std::vector> y3; y3 = std::vector>(N, Eigen::Matrix(N)); - stan::math::fill(y3, std::numeric_limits::quiet_NaN()); + stan::math::fill(y3, std::numeric_limits::quiet_NaN()); current_statement__ = 3; y3 = in__.template read>>( N, N); std::vector> y4; y4 = std::vector>(N, Eigen::Matrix(N, N)); - stan::math::fill(y4, std::numeric_limits::quiet_NaN()); + stan::math::fill(y4, std::numeric_limits::quiet_NaN()); current_statement__ = 4; y4 = in__.template read>>( N, N, N); std::vector> y5; y5 = std::vector>(N, std::vector(N, std::numeric_limits::quiet_NaN())); + current_statement__ = 5; y5 = in__.template read>>(N, N); std::vector>> y6; y6 = std::vector>>(N, std::vector>(N, Eigen::Matrix(N))); - stan::math::fill(y6, std::numeric_limits::quiet_NaN()); + stan::math::fill(y6, std::numeric_limits::quiet_NaN()); current_statement__ = 6; y6 = in__.template read>>>( N, N, N); std::vector>> y7; y7 = std::vector>>(N, std::vector>(N, Eigen::Matrix(N))); - stan::math::fill(y7, std::numeric_limits::quiet_NaN()); + stan::math::fill(y7, std::numeric_limits::quiet_NaN()); current_statement__ = 7; y7 = in__.template read>>>( N, N, N); std::vector>> y8; y8 = std::vector>>(N, std::vector>(N, Eigen::Matrix(N, N))); - stan::math::fill(y8, std::numeric_limits::quiet_NaN()); + stan::math::fill(y8, std::numeric_limits::quiet_NaN()); current_statement__ = 8; y8 = in__.template read>>>( N, N, N, N); double y9; - y9 = std::numeric_limits::quiet_NaN(); + y9 = std::numeric_limits::quiet_NaN(); current_statement__ = 9; y9 = in__.template read(); Eigen::Matrix y10; y10 = Eigen::Matrix(N); - stan::math::fill(y10, std::numeric_limits::quiet_NaN()); + stan::math::fill(y10, std::numeric_limits::quiet_NaN()); current_statement__ = 10; y10 = in__.template read>(N); Eigen::Matrix y11; y11 = Eigen::Matrix(N); - stan::math::fill(y11, std::numeric_limits::quiet_NaN()); + stan::math::fill(y11, std::numeric_limits::quiet_NaN()); current_statement__ = 11; y11 = in__.template read>(N); Eigen::Matrix y12; y12 = Eigen::Matrix(N, N); - stan::math::fill(y12, std::numeric_limits::quiet_NaN()); + stan::math::fill(y12, std::numeric_limits::quiet_NaN()); current_statement__ = 12; y12 = in__.template read>(N, N); std::vector>> y17; y17 = std::vector>>(N, std::vector>(N, std::vector(N, std::numeric_limits::quiet_NaN()))); + current_statement__ = 13; y17 = in__.template read>>>( N, N, N); for (int sym1__ = 1; sym1__ <= N; ++sym1__) { - vars__.emplace_back(y1[(sym1__ - 1)]);} + vars__.emplace_back(y1[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { - vars__.emplace_back(y2[(sym2__ - 1)][(sym1__ - 1)]);}} + vars__.emplace_back(y2[(sym2__ - 1)][(sym1__ - 1)]); + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { - vars__.emplace_back(y3[(sym2__ - 1)][(sym1__ - 1)]);}} + vars__.emplace_back(y3[(sym2__ - 1)][(sym1__ - 1)]); + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { for (int sym3__ = 1; sym3__ <= N; ++sym3__) { vars__.emplace_back( rvalue(y4, "y4", - index_uni(sym3__), index_uni(sym2__), index_uni(sym1__)));}}} + index_uni(sym3__), index_uni(sym2__), index_uni(sym1__))); + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { - vars__.emplace_back(y5[(sym2__ - 1)][(sym1__ - 1)]);}} + vars__.emplace_back(y5[(sym2__ - 1)][(sym1__ - 1)]); + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { for (int sym3__ = 1; sym3__ <= N; ++sym3__) { vars__.emplace_back( - y6[(sym3__ - 1)][(sym2__ - 1)][(sym1__ - 1)]);}}} + y6[(sym3__ - 1)][(sym2__ - 1)][(sym1__ - 1)]); + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { for (int sym3__ = 1; sym3__ <= N; ++sym3__) { vars__.emplace_back( - y7[(sym3__ - 1)][(sym2__ - 1)][(sym1__ - 1)]);}}} + y7[(sym3__ - 1)][(sym2__ - 1)][(sym1__ - 1)]); + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { for (int sym3__ = 1; sym3__ <= N; ++sym3__) { @@ -25165,21 +26177,32 @@ class reduce_sum_m3_model final : public model_base_crtp { vars__.emplace_back( rvalue(y8, "y8", index_uni(sym4__), index_uni(sym3__), index_uni(sym2__), - index_uni(sym1__)));}}}} + index_uni(sym1__))); + } + } + } + } vars__.emplace_back(y9); for (int sym1__ = 1; sym1__ <= N; ++sym1__) { - vars__.emplace_back(y10[(sym1__ - 1)]);} + vars__.emplace_back(y10[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { - vars__.emplace_back(y11[(sym1__ - 1)]);} + vars__.emplace_back(y11[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { vars__.emplace_back( - rvalue(y12, "y12", index_uni(sym2__), index_uni(sym1__)));}} + rvalue(y12, "y12", index_uni(sym2__), index_uni(sym1__))); + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { for (int sym3__ = 1; sym3__ <= N; ++sym3__) { vars__.emplace_back( - y17[(sym3__ - 1)][(sym2__ - 1)][(sym1__ - 1)]);}}} + y17[(sym3__ - 1)][(sym2__ - 1)][(sym1__ - 1)]); + } + } + } if (logical_negation((primitive_value(emit_transformed_parameters__) || primitive_value(emit_generated_quantities__)))) { return ; @@ -25188,133 +26211,133 @@ class reduce_sum_m3_model final : public model_base_crtp { return ; } double t1; - t1 = std::numeric_limits::quiet_NaN(); + t1 = std::numeric_limits::quiet_NaN(); current_statement__ = 14; t1 = reduce_sum(y1, 1, pstream__); double t1a; - t1a = std::numeric_limits::quiet_NaN(); + t1a = std::numeric_limits::quiet_NaN(); current_statement__ = 15; t1a = (reduce_sum(y1, 1, pstream__) + reduce_sum(y1, 1, pstream__)); double t2; - t2 = std::numeric_limits::quiet_NaN(); + t2 = std::numeric_limits::quiet_NaN(); current_statement__ = 16; t2 = reduce_sum(y2, 1, pstream__); double t3; - t3 = std::numeric_limits::quiet_NaN(); + t3 = std::numeric_limits::quiet_NaN(); current_statement__ = 17; t3 = reduce_sum(y3, 1, pstream__); double t4; - t4 = std::numeric_limits::quiet_NaN(); + t4 = std::numeric_limits::quiet_NaN(); current_statement__ = 18; t4 = reduce_sum(y4, 1, pstream__); double t5; - t5 = std::numeric_limits::quiet_NaN(); + t5 = std::numeric_limits::quiet_NaN(); current_statement__ = 19; t5 = reduce_sum(y5, 1, pstream__); double t6; - t6 = std::numeric_limits::quiet_NaN(); + t6 = std::numeric_limits::quiet_NaN(); current_statement__ = 20; t6 = reduce_sum(y6, 1, pstream__); double t7; - t7 = std::numeric_limits::quiet_NaN(); + t7 = std::numeric_limits::quiet_NaN(); current_statement__ = 21; t7 = reduce_sum(y7, 1, pstream__); double t8; - t8 = std::numeric_limits::quiet_NaN(); + t8 = std::numeric_limits::quiet_NaN(); current_statement__ = 22; t8 = reduce_sum(y8, 1, pstream__); double t9; - t9 = std::numeric_limits::quiet_NaN(); + t9 = std::numeric_limits::quiet_NaN(); current_statement__ = 23; t9 = reduce_sum(y14d, 1, pstream__); double t10; - t10 = std::numeric_limits::quiet_NaN(); + t10 = std::numeric_limits::quiet_NaN(); current_statement__ = 24; t10 = reduce_sum(y15d, 1, pstream__); double t11; - t11 = std::numeric_limits::quiet_NaN(); + t11 = std::numeric_limits::quiet_NaN(); current_statement__ = 25; t11 = reduce_sum(y16d, 1, pstream__); double t12; - t12 = std::numeric_limits::quiet_NaN(); + t12 = std::numeric_limits::quiet_NaN(); current_statement__ = 26; t12 = reduce_sum(y17, 1, pstream__); double tg1; - tg1 = std::numeric_limits::quiet_NaN(); + tg1 = std::numeric_limits::quiet_NaN(); current_statement__ = 27; tg1 = reduce_sum(y1, 1, pstream__, y9); double tg2; - tg2 = std::numeric_limits::quiet_NaN(); + tg2 = std::numeric_limits::quiet_NaN(); current_statement__ = 28; tg2 = reduce_sum(y1, 1, pstream__, y10); double tg3; - tg3 = std::numeric_limits::quiet_NaN(); + tg3 = std::numeric_limits::quiet_NaN(); current_statement__ = 29; tg3 = reduce_sum(y1, 1, pstream__, y11); double tg4; - tg4 = std::numeric_limits::quiet_NaN(); + tg4 = std::numeric_limits::quiet_NaN(); current_statement__ = 30; tg4 = reduce_sum(y1, 1, pstream__, y12); double tg5; - tg5 = std::numeric_limits::quiet_NaN(); + tg5 = std::numeric_limits::quiet_NaN(); current_statement__ = 31; tg5 = reduce_sum(y1, 1, pstream__, y1); double tg6; - tg6 = std::numeric_limits::quiet_NaN(); + tg6 = std::numeric_limits::quiet_NaN(); current_statement__ = 32; tg6 = reduce_sum(y1, 1, pstream__, y2); double tg7; - tg7 = std::numeric_limits::quiet_NaN(); + tg7 = std::numeric_limits::quiet_NaN(); current_statement__ = 33; tg7 = reduce_sum(y1, 1, pstream__, y3); double tg8; - tg8 = std::numeric_limits::quiet_NaN(); + tg8 = std::numeric_limits::quiet_NaN(); current_statement__ = 34; tg8 = reduce_sum(y1, 1, pstream__, y4); double tg9; - tg9 = std::numeric_limits::quiet_NaN(); + tg9 = std::numeric_limits::quiet_NaN(); current_statement__ = 35; tg9 = reduce_sum(y1, 1, pstream__, y5); double tg10; - tg10 = std::numeric_limits::quiet_NaN(); + tg10 = std::numeric_limits::quiet_NaN(); current_statement__ = 36; tg10 = reduce_sum(y1, 1, pstream__, y6); double tg11; - tg11 = std::numeric_limits::quiet_NaN(); + tg11 = std::numeric_limits::quiet_NaN(); current_statement__ = 37; tg11 = reduce_sum(y1, 1, pstream__, y7); double tg12; - tg12 = std::numeric_limits::quiet_NaN(); + tg12 = std::numeric_limits::quiet_NaN(); current_statement__ = 38; tg12 = reduce_sum(y1, 1, pstream__, y8); double tgs; - tgs = std::numeric_limits::quiet_NaN(); + tgs = std::numeric_limits::quiet_NaN(); current_statement__ = 39; tgs = reduce_sum(y1d, 1, pstream__, y13d, y9d, y10d, @@ -25366,17 +26389,17 @@ class reduce_sum_m3_model final : public model_base_crtp { try { int pos__; - pos__ = std::numeric_limits::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; std::vector y1; - y1 = std::vector(N, std::numeric_limits::quiet_NaN()); + y1 = std::vector(N, std::numeric_limits::quiet_NaN()); current_statement__ = 1; y1 = context__.vals_r("y1"); std::vector> y2; y2 = std::vector>(N, Eigen::Matrix(N)); - stan::math::fill(y2, std::numeric_limits::quiet_NaN()); + stan::math::fill(y2, std::numeric_limits::quiet_NaN()); { std::vector y2_flat__; @@ -25392,11 +26415,13 @@ class reduce_sum_m3_model final : public model_base_crtp { assign(y2, y2_flat__[(pos__ - 1)], "assigning variable y2", index_uni(sym2__), index_uni(sym1__)); current_statement__ = 2; - pos__ = (pos__ + 1);}} + pos__ = (pos__ + 1); + } + } } std::vector> y3; y3 = std::vector>(N, Eigen::Matrix(N)); - stan::math::fill(y3, std::numeric_limits::quiet_NaN()); + stan::math::fill(y3, std::numeric_limits::quiet_NaN()); { std::vector y3_flat__; @@ -25412,11 +26437,13 @@ class reduce_sum_m3_model final : public model_base_crtp { assign(y3, y3_flat__[(pos__ - 1)], "assigning variable y3", index_uni(sym2__), index_uni(sym1__)); current_statement__ = 3; - pos__ = (pos__ + 1);}} + pos__ = (pos__ + 1); + } + } } std::vector> y4; y4 = std::vector>(N, Eigen::Matrix(N, N)); - stan::math::fill(y4, std::numeric_limits::quiet_NaN()); + stan::math::fill(y4, std::numeric_limits::quiet_NaN()); { std::vector y4_flat__; @@ -25436,10 +26463,14 @@ class reduce_sum_m3_model final : public model_base_crtp { index_uni(sym2__), index_uni(sym1__)); current_statement__ = 4; - pos__ = (pos__ + 1);}}} + pos__ = (pos__ + 1); + } + } + } } std::vector> y5; y5 = std::vector>(N, std::vector(N, std::numeric_limits::quiet_NaN())); + { std::vector y5_flat__; @@ -25455,11 +26486,13 @@ class reduce_sum_m3_model final : public model_base_crtp { assign(y5, y5_flat__[(pos__ - 1)], "assigning variable y5", index_uni(sym2__), index_uni(sym1__)); current_statement__ = 5; - pos__ = (pos__ + 1);}} + pos__ = (pos__ + 1); + } + } } std::vector>> y6; y6 = std::vector>>(N, std::vector>(N, Eigen::Matrix(N))); - stan::math::fill(y6, std::numeric_limits::quiet_NaN()); + stan::math::fill(y6, std::numeric_limits::quiet_NaN()); { std::vector y6_flat__; @@ -25479,11 +26512,14 @@ class reduce_sum_m3_model final : public model_base_crtp { index_uni(sym2__), index_uni(sym1__)); current_statement__ = 6; - pos__ = (pos__ + 1);}}} + pos__ = (pos__ + 1); + } + } + } } std::vector>> y7; y7 = std::vector>>(N, std::vector>(N, Eigen::Matrix(N))); - stan::math::fill(y7, std::numeric_limits::quiet_NaN()); + stan::math::fill(y7, std::numeric_limits::quiet_NaN()); { std::vector y7_flat__; @@ -25503,11 +26539,14 @@ class reduce_sum_m3_model final : public model_base_crtp { index_uni(sym2__), index_uni(sym1__)); current_statement__ = 7; - pos__ = (pos__ + 1);}}} + pos__ = (pos__ + 1); + } + } + } } std::vector>> y8; y8 = std::vector>>(N, std::vector>(N, Eigen::Matrix(N, N))); - stan::math::fill(y8, std::numeric_limits::quiet_NaN()); + stan::math::fill(y8, std::numeric_limits::quiet_NaN()); { std::vector y8_flat__; @@ -25530,16 +26569,20 @@ class reduce_sum_m3_model final : public model_base_crtp { index_uni(sym2__), index_uni(sym1__)); current_statement__ = 8; - pos__ = (pos__ + 1);}}}} + pos__ = (pos__ + 1); + } + } + } + } } double y9; - y9 = std::numeric_limits::quiet_NaN(); + y9 = std::numeric_limits::quiet_NaN(); current_statement__ = 9; y9 = context__.vals_r("y9")[(1 - 1)]; Eigen::Matrix y10; y10 = Eigen::Matrix(N); - stan::math::fill(y10, std::numeric_limits::quiet_NaN()); + stan::math::fill(y10, std::numeric_limits::quiet_NaN()); { std::vector y10_flat__; @@ -25553,11 +26596,12 @@ class reduce_sum_m3_model final : public model_base_crtp { assign(y10, y10_flat__[(pos__ - 1)], "assigning variable y10", index_uni(sym1__)); current_statement__ = 10; - pos__ = (pos__ + 1);} + pos__ = (pos__ + 1); + } } Eigen::Matrix y11; y11 = Eigen::Matrix(N); - stan::math::fill(y11, std::numeric_limits::quiet_NaN()); + stan::math::fill(y11, std::numeric_limits::quiet_NaN()); { std::vector y11_flat__; @@ -25571,11 +26615,12 @@ class reduce_sum_m3_model final : public model_base_crtp { assign(y11, y11_flat__[(pos__ - 1)], "assigning variable y11", index_uni(sym1__)); current_statement__ = 11; - pos__ = (pos__ + 1);} + pos__ = (pos__ + 1); + } } Eigen::Matrix y12; y12 = Eigen::Matrix(N, N); - stan::math::fill(y12, std::numeric_limits::quiet_NaN()); + stan::math::fill(y12, std::numeric_limits::quiet_NaN()); { std::vector y12_flat__; @@ -25591,10 +26636,13 @@ class reduce_sum_m3_model final : public model_base_crtp { assign(y12, y12_flat__[(pos__ - 1)], "assigning variable y12", index_uni(sym2__), index_uni(sym1__)); current_statement__ = 12; - pos__ = (pos__ + 1);}} + pos__ = (pos__ + 1); + } + } } std::vector>> y17; y17 = std::vector>>(N, std::vector>(N, std::vector(N, std::numeric_limits::quiet_NaN()))); + { std::vector y17_flat__; @@ -25614,35 +26662,54 @@ class reduce_sum_m3_model final : public model_base_crtp { index_uni(sym2__), index_uni(sym1__)); current_statement__ = 13; - pos__ = (pos__ + 1);}}} + pos__ = (pos__ + 1); + } + } + } } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { - vars__.emplace_back(y1[(sym1__ - 1)]);} + vars__.emplace_back(y1[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { - vars__.emplace_back(y2[(sym1__ - 1)][(sym2__ - 1)]);}} + vars__.emplace_back(y2[(sym1__ - 1)][(sym2__ - 1)]); + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { - vars__.emplace_back(y3[(sym1__ - 1)][(sym2__ - 1)]);}} + vars__.emplace_back(y3[(sym1__ - 1)][(sym2__ - 1)]); + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { for (int sym3__ = 1; sym3__ <= N; ++sym3__) { vars__.emplace_back( rvalue(y4, "y4", - index_uni(sym1__), index_uni(sym3__), index_uni(sym2__)));}}} + index_uni(sym1__), index_uni(sym3__), index_uni(sym2__))); + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { - vars__.emplace_back(y5[(sym1__ - 1)][(sym2__ - 1)]);}} + vars__.emplace_back(y5[(sym1__ - 1)][(sym2__ - 1)]); + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { for (int sym3__ = 1; sym3__ <= N; ++sym3__) { vars__.emplace_back( - y6[(sym1__ - 1)][(sym2__ - 1)][(sym3__ - 1)]);}}} + y6[(sym1__ - 1)][(sym2__ - 1)][(sym3__ - 1)]); + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { for (int sym3__ = 1; sym3__ <= N; ++sym3__) { vars__.emplace_back( - y7[(sym1__ - 1)][(sym2__ - 1)][(sym3__ - 1)]);}}} + y7[(sym1__ - 1)][(sym2__ - 1)][(sym3__ - 1)]); + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { for (int sym3__ = 1; sym3__ <= N; ++sym3__) { @@ -25650,21 +26717,32 @@ class reduce_sum_m3_model final : public model_base_crtp { vars__.emplace_back( rvalue(y8, "y8", index_uni(sym1__), index_uni(sym2__), index_uni(sym4__), - index_uni(sym3__)));}}}} + index_uni(sym3__))); + } + } + } + } vars__.emplace_back(y9); for (int sym1__ = 1; sym1__ <= N; ++sym1__) { - vars__.emplace_back(y10[(sym1__ - 1)]);} + vars__.emplace_back(y10[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { - vars__.emplace_back(y11[(sym1__ - 1)]);} + vars__.emplace_back(y11[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { vars__.emplace_back( - rvalue(y12, "y12", index_uni(sym2__), index_uni(sym1__)));}} + rvalue(y12, "y12", index_uni(sym2__), index_uni(sym1__))); + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { for (int sym3__ = 1; sym3__ <= N; ++sym3__) { vars__.emplace_back( - y17[(sym1__ - 1)][(sym2__ - 1)][(sym3__ - 1)]);}}} + y17[(sym1__ - 1)][(sym2__ - 1)][(sym3__ - 1)]); + } + } + } } catch (const std::exception& e) { stan::lang::rethrow_located(e, locations_array__[current_statement__]); // Next line prevents compiler griping about no return @@ -25674,45 +26752,12 @@ class reduce_sum_m3_model final : public model_base_crtp { inline void get_param_names(std::vector& names__) const { - names__ = std::vector{"y1", - "y2", - "y3", - "y4", - "y5", - "y6", - "y7", - "y8", - "y9", - "y10", - "y11", - "y12", - "y17", - "t1", - "t1a", - "t2", - "t3", - "t4", - "t5", - "t6", - "t7", - "t8", - "t9", - "t10", - "t11", - "t12", - "tg1", - "tg2", - "tg3", - "tg4", - "tg5", - "tg6", - "tg7", - "tg8", - "tg9", - "tg10", - "tg11", - "tg12", - "tgs"}; + names__ = std::vector{"y1", "y2", "y3", "y4", "y5", "y6", + "y7", "y8", "y9", "y10", "y11", "y12", "y17", "t1", "t1a", "t2", "t3", + "t4", "t5", "t6", "t7", "t8", "t9", "t10", "t11", "t12", "tg1", "tg2", + "tg3", "tg4", "tg5", "tg6", "tg7", "tg8", "tg9", "tg10", "tg11", + "tg12", "tgs"}; + } // get_param_names() inline void get_dims(std::vector>& dimss__) const { @@ -25720,49 +26765,32 @@ class reduce_sum_m3_model final : public model_base_crtp { dimss__ = std::vector>{std::vector{ static_cast(N) }, - std::vector{static_cast(N), static_cast(N)}, - std::vector{static_cast(N), static_cast(N)}, - std::vector{static_cast(N), static_cast(N), - static_cast(N)}, - std::vector{static_cast(N), static_cast(N)}, - std::vector{static_cast(N), static_cast(N), - static_cast(N)}, - std::vector{static_cast(N), static_cast(N), - static_cast(N)}, - std::vector{static_cast(N), static_cast(N), - static_cast(N), static_cast(N)}, - std::vector{}, - std::vector{static_cast(N)}, - std::vector{static_cast(N)}, - std::vector{static_cast(N), static_cast(N)}, - std::vector{static_cast(N), static_cast(N), - static_cast(N)}, - std::vector{}, - std::vector{}, - std::vector{}, - std::vector{}, - std::vector{}, - std::vector{}, - std::vector{}, - std::vector{}, - std::vector{}, - std::vector{}, - std::vector{}, - std::vector{}, - std::vector{}, - std::vector{}, - std::vector{}, - std::vector{}, - std::vector{}, - std::vector{}, - std::vector{}, - std::vector{}, - std::vector{}, - std::vector{}, - std::vector{}, - std::vector{}, - std::vector{}, - std::vector{}}; + std::vector{static_cast(N), static_cast(N)}, + std::vector{static_cast(N), static_cast(N)}, + std::vector{static_cast(N), static_cast(N), + static_cast(N)}, + std::vector{static_cast(N), static_cast(N)}, + std::vector{static_cast(N), static_cast(N), + static_cast(N)}, + std::vector{static_cast(N), static_cast(N), + static_cast(N)}, + std::vector{static_cast(N), static_cast(N), + static_cast(N), static_cast(N)}, + std::vector{}, std::vector{static_cast(N)}, + std::vector{static_cast(N)}, + std::vector{static_cast(N), static_cast(N)}, + std::vector{static_cast(N), static_cast(N), + static_cast(N)}, std::vector{ + }, std::vector{}, std::vector{}, std::vector{ + }, std::vector{}, std::vector{}, std::vector{ + }, std::vector{}, std::vector{}, std::vector{ + }, std::vector{}, std::vector{}, std::vector{ + }, std::vector{}, std::vector{}, std::vector{ + }, std::vector{}, std::vector{}, std::vector{ + }, std::vector{}, std::vector{}, std::vector{ + }, std::vector{}, std::vector{}, std::vector{ + }, std::vector{}}; + } // get_dims() inline void constrained_param_names( @@ -25774,21 +26802,26 @@ class reduce_sum_m3_model final : public model_base_crtp { for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { param_names__.emplace_back(std::string() + "y1" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { { param_names__.emplace_back(std::string() + "y2" + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} + } + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { { param_names__.emplace_back(std::string() + "y3" + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} + } + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { @@ -25796,16 +26829,21 @@ class reduce_sum_m3_model final : public model_base_crtp { for (int sym3__ = 1; sym3__ <= N; ++sym3__) { { param_names__.emplace_back(std::string() + "y4" + '.' + std::to_string(sym3__) + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} - }} + } + } + } + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { { param_names__.emplace_back(std::string() + "y5" + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} + } + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { @@ -25813,9 +26851,12 @@ class reduce_sum_m3_model final : public model_base_crtp { for (int sym3__ = 1; sym3__ <= N; ++sym3__) { { param_names__.emplace_back(std::string() + "y6" + '.' + std::to_string(sym3__) + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} - }} + } + } + } + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { @@ -25823,9 +26864,12 @@ class reduce_sum_m3_model final : public model_base_crtp { for (int sym3__ = 1; sym3__ <= N; ++sym3__) { { param_names__.emplace_back(std::string() + "y7" + '.' + std::to_string(sym3__) + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} - }} + } + } + } + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { @@ -25835,26 +26879,34 @@ class reduce_sum_m3_model final : public model_base_crtp { for (int sym4__ = 1; sym4__ <= N; ++sym4__) { { param_names__.emplace_back(std::string() + "y8" + '.' + std::to_string(sym4__) + '.' + std::to_string(sym3__) + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} - }} - }} + } + } + } + } + } + } + } + } param_names__.emplace_back(std::string() + "y9"); for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { param_names__.emplace_back(std::string() + "y10" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { param_names__.emplace_back(std::string() + "y11" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { { param_names__.emplace_back(std::string() + "y12" + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} + } + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { @@ -25862,9 +26914,12 @@ class reduce_sum_m3_model final : public model_base_crtp { for (int sym3__ = 1; sym3__ <= N; ++sym3__) { { param_names__.emplace_back(std::string() + "y17" + '.' + std::to_string(sym3__) + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} - }} + } + } + } + } + } + } if (emit_transformed_parameters__) { } @@ -25909,21 +26964,26 @@ class reduce_sum_m3_model final : public model_base_crtp { for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { param_names__.emplace_back(std::string() + "y1" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { { param_names__.emplace_back(std::string() + "y2" + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} + } + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { { param_names__.emplace_back(std::string() + "y3" + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} + } + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { @@ -25931,16 +26991,21 @@ class reduce_sum_m3_model final : public model_base_crtp { for (int sym3__ = 1; sym3__ <= N; ++sym3__) { { param_names__.emplace_back(std::string() + "y4" + '.' + std::to_string(sym3__) + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} - }} + } + } + } + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { { param_names__.emplace_back(std::string() + "y5" + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} + } + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { @@ -25948,9 +27013,12 @@ class reduce_sum_m3_model final : public model_base_crtp { for (int sym3__ = 1; sym3__ <= N; ++sym3__) { { param_names__.emplace_back(std::string() + "y6" + '.' + std::to_string(sym3__) + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} - }} + } + } + } + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { @@ -25958,9 +27026,12 @@ class reduce_sum_m3_model final : public model_base_crtp { for (int sym3__ = 1; sym3__ <= N; ++sym3__) { { param_names__.emplace_back(std::string() + "y7" + '.' + std::to_string(sym3__) + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} - }} + } + } + } + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { @@ -25970,26 +27041,34 @@ class reduce_sum_m3_model final : public model_base_crtp { for (int sym4__ = 1; sym4__ <= N; ++sym4__) { { param_names__.emplace_back(std::string() + "y8" + '.' + std::to_string(sym4__) + '.' + std::to_string(sym3__) + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} - }} - }} + } + } + } + } + } + } + } + } param_names__.emplace_back(std::string() + "y9"); for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { param_names__.emplace_back(std::string() + "y10" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { param_names__.emplace_back(std::string() + "y11" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { { param_names__.emplace_back(std::string() + "y12" + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} + } + } + } + } for (int sym1__ = 1; sym1__ <= N; ++sym1__) { { for (int sym2__ = 1; sym2__ <= N; ++sym2__) { @@ -25997,9 +27076,12 @@ class reduce_sum_m3_model final : public model_base_crtp { for (int sym3__ = 1; sym3__ <= N; ++sym3__) { { param_names__.emplace_back(std::string() + "y17" + '.' + std::to_string(sym3__) + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} - }} + } + } + } + } + } + } if (emit_transformed_parameters__) { } @@ -26035,14 +27117,16 @@ class reduce_sum_m3_model final : public model_base_crtp { } // unconstrained_param_names() - inline std::string get_constrained_sizedtypes() const final { + inline std::string get_constrained_sizedtypes() const { + + return std::string("[{\"name\":\"y1\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"y2\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(N) + "}},\"block\":\"parameters\"},{\"name\":\"y3\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(N) + "}},\"block\":\"parameters\"},{\"name\":\"y4\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(N) + ",\"cols\":" + std::to_string(N) + "}},\"block\":\"parameters\"},{\"name\":\"y5\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"real\"}}},\"block\":\"parameters\"},{\"name\":\"y6\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(N) + "}}},\"block\":\"parameters\"},{\"name\":\"y7\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(N) + "}}},\"block\":\"parameters\"},{\"name\":\"y8\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(N) + ",\"cols\":" + std::to_string(N) + "}}},\"block\":\"parameters\"},{\"name\":\"y9\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"y10\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(N) + "},\"block\":\"parameters\"},{\"name\":\"y11\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(N) + "},\"block\":\"parameters\"},{\"name\":\"y12\",\"type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(N) + ",\"cols\":" + std::to_string(N) + "},\"block\":\"parameters\"},{\"name\":\"y17\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"real\"}}}},\"block\":\"parameters\"},{\"name\":\"t1\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"t1a\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"t2\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"t3\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"t4\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"t5\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"t6\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"t7\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"t8\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"t9\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"t10\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"t11\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"t12\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tg1\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tg2\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tg3\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tg4\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tg5\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tg6\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tg7\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tg8\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tg9\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tg10\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tg11\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tg12\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tgs\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"}]"); - return std::string("[{\"name\":\"y1\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"y2\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}},\"block\":\"parameters\"},{\"name\":\"y3\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}},\"block\":\"parameters\"},{\"name\":\"y4\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << N << ",\"cols\":" << N << "}},\"block\":\"parameters\"},{\"name\":\"y5\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"real\"}}},\"block\":\"parameters\"},{\"name\":\"y6\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}}},\"block\":\"parameters\"},{\"name\":\"y7\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}}},\"block\":\"parameters\"},{\"name\":\"y8\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << N << ",\"cols\":" << N << "}}},\"block\":\"parameters\"},{\"name\":\"y9\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"y10\",\"type\":{\"name\":\"vector\",\"length\":" << N << "},\"block\":\"parameters\"},{\"name\":\"y11\",\"type\":{\"name\":\"vector\",\"length\":" << N << "},\"block\":\"parameters\"},{\"name\":\"y12\",\"type\":{\"name\":\"matrix\",\"rows\":" << N << ",\"cols\":" << N << "},\"block\":\"parameters\"},{\"name\":\"y17\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"real\"}}}},\"block\":\"parameters\"},{\"name\":\"t1\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"t1a\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"t2\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"t3\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"t4\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"t5\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"t6\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"t7\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"t8\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"t9\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"t10\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"t11\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"t12\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tg1\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tg2\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tg3\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tg4\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tg5\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tg6\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tg7\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tg8\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tg9\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tg10\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tg11\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tg12\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tgs\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"}]"); } // get_constrained_sizedtypes() - inline std::string get_unconstrained_sizedtypes() const final { + inline std::string get_unconstrained_sizedtypes() const { + + return std::string("[{\"name\":\"y1\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"y2\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(N) + "}},\"block\":\"parameters\"},{\"name\":\"y3\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(N) + "}},\"block\":\"parameters\"},{\"name\":\"y4\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(N) + ",\"cols\":" + std::to_string(N) + "}},\"block\":\"parameters\"},{\"name\":\"y5\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"real\"}}},\"block\":\"parameters\"},{\"name\":\"y6\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(N) + "}}},\"block\":\"parameters\"},{\"name\":\"y7\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(N) + "}}},\"block\":\"parameters\"},{\"name\":\"y8\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(N) + ",\"cols\":" + std::to_string(N) + "}}},\"block\":\"parameters\"},{\"name\":\"y9\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"y10\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(N) + "},\"block\":\"parameters\"},{\"name\":\"y11\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(N) + "},\"block\":\"parameters\"},{\"name\":\"y12\",\"type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(N) + ",\"cols\":" + std::to_string(N) + "},\"block\":\"parameters\"},{\"name\":\"y17\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(N) + ",\"element_type\":{\"name\":\"real\"}}}},\"block\":\"parameters\"},{\"name\":\"t1\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"t1a\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"t2\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"t3\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"t4\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"t5\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"t6\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"t7\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"t8\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"t9\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"t10\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"t11\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"t12\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tg1\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tg2\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tg3\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tg4\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tg5\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tg6\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tg7\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tg8\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tg9\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tg10\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tg11\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tg12\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tgs\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"}]"); - return std::string("[{\"name\":\"y1\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"y2\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}},\"block\":\"parameters\"},{\"name\":\"y3\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}},\"block\":\"parameters\"},{\"name\":\"y4\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << N << ",\"cols\":" << N << "}},\"block\":\"parameters\"},{\"name\":\"y5\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"real\"}}},\"block\":\"parameters\"},{\"name\":\"y6\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}}},\"block\":\"parameters\"},{\"name\":\"y7\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"vector\",\"length\":" << N << "}}},\"block\":\"parameters\"},{\"name\":\"y8\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << N << ",\"cols\":" << N << "}}},\"block\":\"parameters\"},{\"name\":\"y9\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"y10\",\"type\":{\"name\":\"vector\",\"length\":" << N << "},\"block\":\"parameters\"},{\"name\":\"y11\",\"type\":{\"name\":\"vector\",\"length\":" << N << "},\"block\":\"parameters\"},{\"name\":\"y12\",\"type\":{\"name\":\"matrix\",\"rows\":" << N << ",\"cols\":" << N << "},\"block\":\"parameters\"},{\"name\":\"y17\",\"type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"array\",\"length\":" << N << ",\"element_type\":{\"name\":\"real\"}}}},\"block\":\"parameters\"},{\"name\":\"t1\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"t1a\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"t2\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"t3\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"t4\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"t5\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"t6\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"t7\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"t8\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"t9\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"t10\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"t11\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"t12\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tg1\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tg2\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tg3\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tg4\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tg5\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tg6\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tg7\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tg8\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tg9\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tg10\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tg11\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tg12\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"tgs\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"}]"); } // get_unconstrained_sizedtypes() @@ -26054,14 +27138,13 @@ class reduce_sum_m3_model final : public model_base_crtp { const bool emit_transformed_parameters = true, const bool emit_generated_quantities = true, std::ostream* pstream = nullptr) const { - std::vector vars_vec(vars.size()); + std::vector vars_vec; + vars_vec.reserve(vars.size()); std::vector params_i; write_array_impl(base_rng, params_r, params_i, vars_vec, emit_transformed_parameters, emit_generated_quantities, pstream); - vars.resize(vars_vec.size()); - for (int i = 0; i < vars.size(); ++i) { - vars.coeffRef(i) = vars_vec[i]; - } + vars = Eigen::Map>( + vars_vec.data(), vars_vec.size()); } template @@ -26071,7 +27154,8 @@ class reduce_sum_m3_model final : public model_base_crtp { bool emit_transformed_parameters = true, bool emit_generated_quantities = true, std::ostream* pstream = nullptr) const { - write_array_impl(base_rng, params_r, params_i, vars, emit_transformed_parameters, emit_generated_quantities, pstream); + write_array_impl(base_rng, params_r, params_i, vars, + emit_transformed_parameters, emit_generated_quantities, pstream); } template @@ -26092,13 +27176,12 @@ class reduce_sum_m3_model final : public model_base_crtp { inline void transform_inits(const stan::io::var_context& context, Eigen::Matrix& params_r, std::ostream* pstream = nullptr) const final { - std::vector params_r_vec(params_r.size()); + std::vector params_r_vec; + params_r_vec.reserve(params_r.size()); std::vector params_i; transform_inits_impl(context, params_i, params_r_vec, pstream); - params_r.resize(params_r_vec.size()); - for (int i = 0; i < params_r.size(); ++i) { - params_r.coeffRef(i) = params_r_vec[i]; - } + params_r = Eigen::Map>( + params_r_vec.data(), params_r_vec.size()); } inline void transform_inits(const stan::io::var_context& context, std::vector& params_i, @@ -26363,7 +27446,7 @@ class single_argument_lpmf_model final : public model_base_crtp::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; } catch (const std::exception& e) { @@ -26373,13 +27456,6 @@ class single_argument_lpmf_model final : public model_base_crtp::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; } catch (const std::exception& e) { @@ -26473,11 +27549,13 @@ class single_argument_lpmf_model final : public model_base_crtp& names__) const { names__ = std::vector{}; + } // get_param_names() inline void get_dims(std::vector>& dimss__) const { dimss__ = std::vector>{}; + } // get_dims() inline void constrained_param_names( @@ -26514,14 +27592,16 @@ class single_argument_lpmf_model final : public model_base_crtp vars_vec(vars.size()); + std::vector vars_vec; + vars_vec.reserve(vars.size()); std::vector params_i; write_array_impl(base_rng, params_r, params_i, vars_vec, emit_transformed_parameters, emit_generated_quantities, pstream); - vars.resize(vars_vec.size()); - for (int i = 0; i < vars.size(); ++i) { - vars.coeffRef(i) = vars_vec[i]; - } + vars = Eigen::Map>( + vars_vec.data(), vars_vec.size()); } template @@ -26550,7 +27629,8 @@ class single_argument_lpmf_model final : public model_base_crtp @@ -26571,13 +27651,12 @@ class single_argument_lpmf_model final : public model_base_crtp& params_r, std::ostream* pstream = nullptr) const final { - std::vector params_r_vec(params_r.size()); + std::vector params_r_vec; + params_r_vec.reserve(params_r.size()); std::vector params_i; transform_inits_impl(context, params_i, params_r_vec, pstream); - params_r.resize(params_r_vec.size()); - for (int i = 0; i < params_r.size(); ++i) { - params_r.coeffRef(i) = params_r_vec[i]; - } + params_r = Eigen::Map>( + params_r_vec.data(), params_r_vec.size()); } inline void transform_inits(const stan::io::var_context& context, std::vector& params_i, @@ -26671,13 +27750,13 @@ class tilde_block_model final : public model_base_crtp { (void) DUMMY_VAR__; // suppress unused var warning try { int pos__; - pos__ = std::numeric_limits::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; current_statement__ = 7; context__.validate_dims("data initialization","t","int", - context__.to_vec()); - t = std::numeric_limits::min(); + std::vector{}); + t = std::numeric_limits::min(); current_statement__ = 7; t = context__.vals_i("t")[(1 - 1)]; @@ -26686,15 +27765,8 @@ class tilde_block_model final : public model_base_crtp { // Next line prevents compiler griping about no return throw std::runtime_error("*** IF YOU SEE THIS, PLEASE REPORT A BUG ***"); } - num_params_r__ = 0U; + num_params_r__ = 1; - try { - num_params_r__ += 1; - } catch (const std::exception& e) { - stan::lang::rethrow_located(e, locations_array__[current_statement__]); - // Next line prevents compiler griping about no return - throw std::runtime_error("*** IF YOU SEE THIS, PLEASE REPORT A BUG ***"); - } } template { try { local_scalar_t__ x; - x = DUMMY_VAR__; + x = DUMMY_VAR__; current_statement__ = 1; x = in__.template read_constrain_lb(0, @@ -26780,7 +27852,7 @@ class tilde_block_model final : public model_base_crtp { try { double x; - x = std::numeric_limits::quiet_NaN(); + x = std::numeric_limits::quiet_NaN(); current_statement__ = 1; x = in__.template read_constrain_lb(0, @@ -26813,16 +27885,16 @@ class tilde_block_model final : public model_base_crtp { try { int pos__; - pos__ = std::numeric_limits::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; double x; - x = std::numeric_limits::quiet_NaN(); + x = std::numeric_limits::quiet_NaN(); current_statement__ = 1; x = context__.vals_r("x")[(1 - 1)]; double x_free__; - x_free__ = std::numeric_limits::quiet_NaN(); + x_free__ = std::numeric_limits::quiet_NaN(); current_statement__ = 1; x_free__ = stan::math::lb_free(x, 0); @@ -26837,11 +27909,13 @@ class tilde_block_model final : public model_base_crtp { inline void get_param_names(std::vector& names__) const { names__ = std::vector{"x"}; + } // get_param_names() inline void get_dims(std::vector>& dimss__) const { dimss__ = std::vector>{std::vector{}}; + } // get_dims() inline void constrained_param_names( @@ -26878,14 +27952,16 @@ class tilde_block_model final : public model_base_crtp { } // unconstrained_param_names() - inline std::string get_constrained_sizedtypes() const final { + inline std::string get_constrained_sizedtypes() const { return std::string("[{\"name\":\"x\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"}]"); + } // get_constrained_sizedtypes() - inline std::string get_unconstrained_sizedtypes() const final { + inline std::string get_unconstrained_sizedtypes() const { return std::string("[{\"name\":\"x\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"}]"); + } // get_unconstrained_sizedtypes() @@ -26897,14 +27973,13 @@ class tilde_block_model final : public model_base_crtp { const bool emit_transformed_parameters = true, const bool emit_generated_quantities = true, std::ostream* pstream = nullptr) const { - std::vector vars_vec(vars.size()); + std::vector vars_vec; + vars_vec.reserve(vars.size()); std::vector params_i; write_array_impl(base_rng, params_r, params_i, vars_vec, emit_transformed_parameters, emit_generated_quantities, pstream); - vars.resize(vars_vec.size()); - for (int i = 0; i < vars.size(); ++i) { - vars.coeffRef(i) = vars_vec[i]; - } + vars = Eigen::Map>( + vars_vec.data(), vars_vec.size()); } template @@ -26914,7 +27989,8 @@ class tilde_block_model final : public model_base_crtp { bool emit_transformed_parameters = true, bool emit_generated_quantities = true, std::ostream* pstream = nullptr) const { - write_array_impl(base_rng, params_r, params_i, vars, emit_transformed_parameters, emit_generated_quantities, pstream); + write_array_impl(base_rng, params_r, params_i, vars, + emit_transformed_parameters, emit_generated_quantities, pstream); } template @@ -26935,13 +28011,12 @@ class tilde_block_model final : public model_base_crtp { inline void transform_inits(const stan::io::var_context& context, Eigen::Matrix& params_r, std::ostream* pstream = nullptr) const final { - std::vector params_r_vec(params_r.size()); + std::vector params_r_vec; + params_r_vec.reserve(params_r.size()); std::vector params_i; transform_inits_impl(context, params_i, params_r_vec, pstream); - params_r.resize(params_r_vec.size()); - for (int i = 0; i < params_r.size(); ++i) { - params_r.coeffRef(i) = params_r_vec[i]; - } + params_r = Eigen::Map>( + params_r_vec.data(), params_r_vec.size()); } inline void transform_inits(const stan::io::var_context& context, std::vector& params_i, @@ -27148,13 +28223,13 @@ class transform_model final : public model_base_crtp { (void) DUMMY_VAR__; // suppress unused var warning try { int pos__; - pos__ = std::numeric_limits::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; current_statement__ = 37; context__.validate_dims("data initialization","n","int", - context__.to_vec()); - n = std::numeric_limits::min(); + std::vector{}); + n = std::numeric_limits::min(); current_statement__ = 37; n = context__.vals_i("n")[(1 - 1)]; @@ -27163,8 +28238,8 @@ class transform_model final : public model_base_crtp { check_greater_or_equal(function__, "n", n, 1); current_statement__ = 38; context__.validate_dims("data initialization","m","int", - context__.to_vec()); - m = std::numeric_limits::min(); + std::vector{}); + m = std::numeric_limits::min(); current_statement__ = 38; m = context__.vals_i("m")[(1 - 1)]; @@ -27173,8 +28248,8 @@ class transform_model final : public model_base_crtp { check_greater_or_equal(function__, "m", m, 1); current_statement__ = 39; context__.validate_dims("data initialization","k","int", - context__.to_vec()); - k = std::numeric_limits::min(); + std::vector{}); + k = std::numeric_limits::min(); current_statement__ = 39; k = context__.vals_i("k")[(1 - 1)]; @@ -27189,8 +28264,10 @@ class transform_model final : public model_base_crtp { validate_non_negative_index("ds", "k", k); current_statement__ = 43; context__.validate_dims("data initialization","ds","double", - context__.to_vec(n, m, k)); + std::vector{static_cast(n), + static_cast(m), static_cast(k)}); ds = std::vector>>(n, std::vector>(m, std::vector(k, std::numeric_limits::quiet_NaN()))); + { std::vector ds_flat__; @@ -27210,7 +28287,10 @@ class transform_model final : public model_base_crtp { index_uni(sym2__), index_uni(sym1__)); current_statement__ = 43; - pos__ = (pos__ + 1);}}} + pos__ = (pos__ + 1); + } + } + } } current_statement__ = 44; validate_non_negative_index("dv", "n", n); @@ -27220,9 +28300,10 @@ class transform_model final : public model_base_crtp { validate_non_negative_index("dv", "k", k); current_statement__ = 47; context__.validate_dims("data initialization","dv","double", - context__.to_vec(n, m, k)); + std::vector{static_cast(n), + static_cast(m), static_cast(k)}); dv = std::vector>>(n, std::vector>(m, Eigen::Matrix(k))); - stan::math::fill(dv, std::numeric_limits::quiet_NaN()); + stan::math::fill(dv, std::numeric_limits::quiet_NaN()); { std::vector dv_flat__; @@ -27242,7 +28323,10 @@ class transform_model final : public model_base_crtp { index_uni(sym2__), index_uni(sym1__)); current_statement__ = 47; - pos__ = (pos__ + 1);}}} + pos__ = (pos__ + 1); + } + } + } } current_statement__ = 48; validate_non_negative_index("dr", "n", n); @@ -27252,9 +28336,10 @@ class transform_model final : public model_base_crtp { validate_non_negative_index("dr", "k", k); current_statement__ = 51; context__.validate_dims("data initialization","dr","double", - context__.to_vec(n, m, k)); + std::vector{static_cast(n), + static_cast(m), static_cast(k)}); dr = std::vector>>(n, std::vector>(m, Eigen::Matrix(k))); - stan::math::fill(dr, std::numeric_limits::quiet_NaN()); + stan::math::fill(dr, std::numeric_limits::quiet_NaN()); { std::vector dr_flat__; @@ -27274,7 +28359,10 @@ class transform_model final : public model_base_crtp { index_uni(sym2__), index_uni(sym1__)); current_statement__ = 51; - pos__ = (pos__ + 1);}}} + pos__ = (pos__ + 1); + } + } + } } current_statement__ = 52; validate_non_negative_index("dm", "n", n); @@ -27284,9 +28372,10 @@ class transform_model final : public model_base_crtp { validate_non_negative_index("dm", "k", k); current_statement__ = 55; context__.validate_dims("data initialization","dm","double", - context__.to_vec(n, m, k)); + std::vector{static_cast(n), + static_cast(m), static_cast(k)}); dm = std::vector>(n, Eigen::Matrix(m, k)); - stan::math::fill(dm, std::numeric_limits::quiet_NaN()); + stan::math::fill(dm, std::numeric_limits::quiet_NaN()); { std::vector dm_flat__; @@ -27306,7 +28395,10 @@ class transform_model final : public model_base_crtp { index_uni(sym2__), index_uni(sym1__)); current_statement__ = 55; - pos__ = (pos__ + 1);}}} + pos__ = (pos__ + 1); + } + } + } } current_statement__ = 56; validate_non_negative_index("p_1", "k", k); @@ -27433,32 +28525,10 @@ class transform_model final : public model_base_crtp { // Next line prevents compiler griping about no return throw std::runtime_error("*** IF YOU SEE THIS, PLEASE REPORT A BUG ***"); } - num_params_r__ = 0U; + num_params_r__ = k + k + k + k + k + k + k + k + (m * k) + (n * m * k) + + k + (m * k) + (n * m * k) + k + (m * k) + (n * m * k) + (m * k) + + (n * m * k); - try { - num_params_r__ += k; - num_params_r__ += k; - num_params_r__ += k; - num_params_r__ += k; - num_params_r__ += k; - num_params_r__ += k; - num_params_r__ += k; - num_params_r__ += k; - num_params_r__ += m * k; - num_params_r__ += n * m * k; - num_params_r__ += k; - num_params_r__ += m * k; - num_params_r__ += n * m * k; - num_params_r__ += k; - num_params_r__ += m * k; - num_params_r__ += n * m * k; - num_params_r__ += m * k; - num_params_r__ += n * m * k; - } catch (const std::exception& e) { - stan::lang::rethrow_located(e, locations_array__[current_statement__]); - // Next line prevents compiler griping about no return - throw std::runtime_error("*** IF YOU SEE THIS, PLEASE REPORT A BUG ***"); - } } template { try { std::vector p_1; - p_1 = std::vector(k, DUMMY_VAR__); + p_1 = std::vector(k, DUMMY_VAR__); current_statement__ = 1; p_1 = in__.template read_constrain_lb, jacobian__>( @@ -27489,7 +28559,7 @@ class transform_model final : public model_base_crtp { check_matching_dims("constraint", "p_1", p_1, "lower", rvalue(ds, "ds", index_uni(1), index_uni(1))); std::vector p_2; - p_2 = std::vector(k, DUMMY_VAR__); + p_2 = std::vector(k, DUMMY_VAR__); current_statement__ = 2; p_2 = in__.template read_constrain_ub, jacobian__>( @@ -27498,7 +28568,7 @@ class transform_model final : public model_base_crtp { check_matching_dims("constraint", "p_2", p_2, "upper", rvalue(ds, "ds", index_uni(1), index_uni(1))); std::vector p_3; - p_3 = std::vector(k, DUMMY_VAR__); + p_3 = std::vector(k, DUMMY_VAR__); current_statement__ = 3; p_3 = in__.template read_constrain_lub, jacobian__>( @@ -27511,7 +28581,7 @@ class transform_model final : public model_base_crtp { check_matching_dims("constraint", "p_3", p_3, "upper", rvalue(ds, "ds", index_uni(1), index_uni(2))); std::vector p_4; - p_4 = std::vector(k, DUMMY_VAR__); + p_4 = std::vector(k, DUMMY_VAR__); current_statement__ = 4; p_4 = in__.template read_constrain_lub, jacobian__>( @@ -27520,7 +28590,7 @@ class transform_model final : public model_base_crtp { check_matching_dims("constraint", "p_4", p_4, "upper", rvalue(ds, "ds", index_uni(1), index_uni(2))); std::vector p_5; - p_5 = std::vector(k, DUMMY_VAR__); + p_5 = std::vector(k, DUMMY_VAR__); current_statement__ = 5; p_5 = in__.template read_constrain_lub, jacobian__>( @@ -27529,7 +28599,7 @@ class transform_model final : public model_base_crtp { check_matching_dims("constraint", "p_5", p_5, "lower", rvalue(ds, "ds", index_uni(1), index_uni(1))); std::vector p_6; - p_6 = std::vector(k, DUMMY_VAR__); + p_6 = std::vector(k, DUMMY_VAR__); current_statement__ = 6; p_6 = in__.template read_constrain_offset_multiplier, jacobian__>( @@ -27538,7 +28608,7 @@ class transform_model final : public model_base_crtp { check_matching_dims("constraint", "p_6", p_6, "offset", rvalue(ds, "ds", index_uni(1), index_uni(1))); std::vector p_7; - p_7 = std::vector(k, DUMMY_VAR__); + p_7 = std::vector(k, DUMMY_VAR__); current_statement__ = 7; p_7 = in__.template read_constrain_offset_multiplier, jacobian__>( @@ -27547,7 +28617,7 @@ class transform_model final : public model_base_crtp { check_matching_dims("constraint", "p_7", p_7, "multiplier", rvalue(ds, "ds", index_uni(1), index_uni(1))); std::vector p_8; - p_8 = std::vector(k, DUMMY_VAR__); + p_8 = std::vector(k, DUMMY_VAR__); current_statement__ = 8; p_8 = in__.template read_constrain_offset_multiplier, jacobian__>( @@ -27561,6 +28631,7 @@ class transform_model final : public model_base_crtp { rvalue(ds, "ds", index_uni(1), index_uni(2))); std::vector> p_9; p_9 = std::vector>(m, std::vector(k, DUMMY_VAR__)); + current_statement__ = 9; p_9 = in__.template read_constrain_lub>, jacobian__>( @@ -27570,6 +28641,7 @@ class transform_model final : public model_base_crtp { rvalue(ds, "ds", index_uni(1))); std::vector>> p_10; p_10 = std::vector>>(n, std::vector>(m, std::vector(k, DUMMY_VAR__))); + current_statement__ = 10; p_10 = in__.template read_constrain_lub>>, jacobian__>( @@ -27578,7 +28650,7 @@ class transform_model final : public model_base_crtp { check_matching_dims("constraint", "p_10", p_10, "upper", ds); Eigen::Matrix pv_1; pv_1 = Eigen::Matrix(k); - stan::math::fill(pv_1, DUMMY_VAR__); + stan::math::fill(pv_1, DUMMY_VAR__); current_statement__ = 11; pv_1 = in__.template read_constrain_lub, jacobian__>( @@ -27592,7 +28664,7 @@ class transform_model final : public model_base_crtp { rvalue(dv, "dv", index_uni(1), index_uni(2))); std::vector> pv_2; pv_2 = std::vector>(m, Eigen::Matrix(k)); - stan::math::fill(pv_2, DUMMY_VAR__); + stan::math::fill(pv_2, DUMMY_VAR__); current_statement__ = 12; pv_2 = in__.template read_constrain_lb>, jacobian__>( @@ -27602,7 +28674,7 @@ class transform_model final : public model_base_crtp { rvalue(dv, "dv", index_uni(1))); std::vector>> pv_3; pv_3 = std::vector>>(n, std::vector>(m, Eigen::Matrix(k))); - stan::math::fill(pv_3, DUMMY_VAR__); + stan::math::fill(pv_3, DUMMY_VAR__); current_statement__ = 13; pv_3 = in__.template read_constrain_ub>>, jacobian__>( @@ -27611,7 +28683,7 @@ class transform_model final : public model_base_crtp { check_matching_dims("constraint", "pv_3", pv_3, "upper", dv); Eigen::Matrix pr_1; pr_1 = Eigen::Matrix(k); - stan::math::fill(pr_1, DUMMY_VAR__); + stan::math::fill(pr_1, DUMMY_VAR__); current_statement__ = 14; pr_1 = in__.template read_constrain_lub, jacobian__>( @@ -27625,7 +28697,7 @@ class transform_model final : public model_base_crtp { rvalue(dr, "dr", index_uni(1), index_uni(2))); std::vector> pr_2; pr_2 = std::vector>(m, Eigen::Matrix(k)); - stan::math::fill(pr_2, DUMMY_VAR__); + stan::math::fill(pr_2, DUMMY_VAR__); current_statement__ = 15; pr_2 = in__.template read_constrain_lb>, jacobian__>( @@ -27635,7 +28707,7 @@ class transform_model final : public model_base_crtp { rvalue(dr, "dr", index_uni(1))); std::vector>> pr_3; pr_3 = std::vector>>(n, std::vector>(m, Eigen::Matrix(k))); - stan::math::fill(pr_3, DUMMY_VAR__); + stan::math::fill(pr_3, DUMMY_VAR__); current_statement__ = 16; pr_3 = in__.template read_constrain_ub>>, jacobian__>( @@ -27644,7 +28716,7 @@ class transform_model final : public model_base_crtp { check_matching_dims("constraint", "pr_3", pr_3, "upper", dr); Eigen::Matrix pm_1; pm_1 = Eigen::Matrix(m, k); - stan::math::fill(pm_1, DUMMY_VAR__); + stan::math::fill(pm_1, DUMMY_VAR__); current_statement__ = 17; pm_1 = in__.template read_constrain_lb, jacobian__>( @@ -27654,7 +28726,7 @@ class transform_model final : public model_base_crtp { rvalue(dm, "dm", index_uni(1))); std::vector> pm_2; pm_2 = std::vector>(n, Eigen::Matrix(m, k)); - stan::math::fill(pm_2, DUMMY_VAR__); + stan::math::fill(pm_2, DUMMY_VAR__); current_statement__ = 18; pm_2 = in__.template read_constrain_ub>, jacobian__>( @@ -27662,7 +28734,7 @@ class transform_model final : public model_base_crtp { current_statement__ = 18; check_matching_dims("constraint", "pm_2", pm_2, "upper", dm); std::vector tp_1; - tp_1 = std::vector(k, DUMMY_VAR__); + tp_1 = std::vector(k, DUMMY_VAR__); current_statement__ = 19; assign(tp_1, p_1, "assigning variable tp_1"); @@ -27670,7 +28742,7 @@ class transform_model final : public model_base_crtp { check_matching_dims("constraint", "tp_1", tp_1, "lower", rvalue(ds, "ds", index_uni(1), index_uni(1))); std::vector tp_2; - tp_2 = std::vector(k, DUMMY_VAR__); + tp_2 = std::vector(k, DUMMY_VAR__); current_statement__ = 20; assign(tp_2, p_2, "assigning variable tp_2"); @@ -27678,7 +28750,7 @@ class transform_model final : public model_base_crtp { check_matching_dims("constraint", "tp_2", tp_2, "upper", rvalue(ds, "ds", index_uni(1), index_uni(1))); std::vector tp_3; - tp_3 = std::vector(k, DUMMY_VAR__); + tp_3 = std::vector(k, DUMMY_VAR__); current_statement__ = 21; assign(tp_3, p_3, "assigning variable tp_3"); @@ -27689,7 +28761,7 @@ class transform_model final : public model_base_crtp { check_matching_dims("constraint", "tp_3", tp_3, "upper", rvalue(ds, "ds", index_uni(1), index_uni(2))); std::vector tp_4; - tp_4 = std::vector(k, DUMMY_VAR__); + tp_4 = std::vector(k, DUMMY_VAR__); current_statement__ = 22; assign(tp_4, p_4, "assigning variable tp_4"); @@ -27697,7 +28769,7 @@ class transform_model final : public model_base_crtp { check_matching_dims("constraint", "tp_4", tp_4, "upper", rvalue(ds, "ds", index_uni(1), index_uni(2))); std::vector tp_5; - tp_5 = std::vector(k, DUMMY_VAR__); + tp_5 = std::vector(k, DUMMY_VAR__); current_statement__ = 23; assign(tp_5, p_5, "assigning variable tp_5"); @@ -27705,7 +28777,7 @@ class transform_model final : public model_base_crtp { check_matching_dims("constraint", "tp_5", tp_5, "lower", rvalue(ds, "ds", index_uni(1), index_uni(1))); std::vector tp_6; - tp_6 = std::vector(k, DUMMY_VAR__); + tp_6 = std::vector(k, DUMMY_VAR__); current_statement__ = 24; assign(tp_6, p_6, "assigning variable tp_6"); @@ -27713,7 +28785,7 @@ class transform_model final : public model_base_crtp { check_matching_dims("constraint", "tp_6", tp_6, "offset", rvalue(ds, "ds", index_uni(1), index_uni(1))); std::vector tp_7; - tp_7 = std::vector(k, DUMMY_VAR__); + tp_7 = std::vector(k, DUMMY_VAR__); current_statement__ = 25; assign(tp_7, p_7, "assigning variable tp_7"); @@ -27721,7 +28793,7 @@ class transform_model final : public model_base_crtp { check_matching_dims("constraint", "tp_7", tp_7, "multiplier", rvalue(ds, "ds", index_uni(1), index_uni(1))); std::vector tp_8; - tp_8 = std::vector(k, DUMMY_VAR__); + tp_8 = std::vector(k, DUMMY_VAR__); current_statement__ = 26; assign(tp_8, p_8, "assigning variable tp_8"); @@ -27733,6 +28805,7 @@ class transform_model final : public model_base_crtp { rvalue(ds, "ds", index_uni(1), index_uni(2))); std::vector> tp_9; tp_9 = std::vector>(m, std::vector(k, DUMMY_VAR__)); + current_statement__ = 27; assign(tp_9, p_9, "assigning variable tp_9"); @@ -27741,6 +28814,7 @@ class transform_model final : public model_base_crtp { rvalue(ds, "ds", index_uni(1))); std::vector>> tp_10; tp_10 = std::vector>>(n, std::vector>(m, std::vector(k, DUMMY_VAR__))); + current_statement__ = 28; assign(tp_10, p_10, "assigning variable tp_10"); @@ -27748,7 +28822,7 @@ class transform_model final : public model_base_crtp { check_matching_dims("constraint", "tp_10", tp_10, "upper", ds); Eigen::Matrix tpv_1; tpv_1 = Eigen::Matrix(k); - stan::math::fill(tpv_1, DUMMY_VAR__); + stan::math::fill(tpv_1, DUMMY_VAR__); current_statement__ = 29; assign(tpv_1, pv_1, "assigning variable tpv_1"); @@ -27760,7 +28834,7 @@ class transform_model final : public model_base_crtp { rvalue(dv, "dv", index_uni(1), index_uni(2))); std::vector> tpv_2; tpv_2 = std::vector>(m, Eigen::Matrix(k)); - stan::math::fill(tpv_2, DUMMY_VAR__); + stan::math::fill(tpv_2, DUMMY_VAR__); current_statement__ = 30; assign(tpv_2, pv_2, "assigning variable tpv_2"); @@ -27769,7 +28843,7 @@ class transform_model final : public model_base_crtp { rvalue(dv, "dv", index_uni(1))); std::vector>> tpv_3; tpv_3 = std::vector>>(n, std::vector>(m, Eigen::Matrix(k))); - stan::math::fill(tpv_3, DUMMY_VAR__); + stan::math::fill(tpv_3, DUMMY_VAR__); current_statement__ = 31; assign(tpv_3, pv_3, "assigning variable tpv_3"); @@ -27777,7 +28851,7 @@ class transform_model final : public model_base_crtp { check_matching_dims("constraint", "tpv_3", tpv_3, "upper", dv); Eigen::Matrix tpr_1; tpr_1 = Eigen::Matrix(k); - stan::math::fill(tpr_1, DUMMY_VAR__); + stan::math::fill(tpr_1, DUMMY_VAR__); current_statement__ = 32; assign(tpr_1, pr_1, "assigning variable tpr_1"); @@ -27789,7 +28863,7 @@ class transform_model final : public model_base_crtp { rvalue(dr, "dr", index_uni(1), index_uni(2))); std::vector> tpr_2; tpr_2 = std::vector>(m, Eigen::Matrix(k)); - stan::math::fill(tpr_2, DUMMY_VAR__); + stan::math::fill(tpr_2, DUMMY_VAR__); current_statement__ = 33; assign(tpr_2, pr_2, "assigning variable tpr_2"); @@ -27798,7 +28872,7 @@ class transform_model final : public model_base_crtp { rvalue(dr, "dr", index_uni(1))); std::vector>> tpr_3; tpr_3 = std::vector>>(n, std::vector>(m, Eigen::Matrix(k))); - stan::math::fill(tpr_3, DUMMY_VAR__); + stan::math::fill(tpr_3, DUMMY_VAR__); current_statement__ = 34; assign(tpr_3, pr_3, "assigning variable tpr_3"); @@ -27806,7 +28880,7 @@ class transform_model final : public model_base_crtp { check_matching_dims("constraint", "tpr_3", tpr_3, "upper", dr); Eigen::Matrix tpm_1; tpm_1 = Eigen::Matrix(m, k); - stan::math::fill(tpm_1, DUMMY_VAR__); + stan::math::fill(tpm_1, DUMMY_VAR__); current_statement__ = 35; assign(tpm_1, pm_1, "assigning variable tpm_1"); @@ -27815,7 +28889,7 @@ class transform_model final : public model_base_crtp { rvalue(dm, "dm", index_uni(1))); std::vector> tpm_2; tpm_2 = std::vector>(n, Eigen::Matrix(m, k)); - stan::math::fill(tpm_2, DUMMY_VAR__); + stan::math::fill(tpm_2, DUMMY_VAR__); current_statement__ = 36; assign(tpm_2, pm_2, "assigning variable tpm_2"); @@ -27828,14 +28902,16 @@ class transform_model final : public model_base_crtp { check_greater_or_equal(function__, "tp_1[sym1__]", tp_1[(sym1__ - 1)], rvalue(ds, "ds", index_uni(1), index_uni(1))[ - (sym1__ - 1)]);} + (sym1__ - 1)]); + } current_statement__ = 20; for (int sym1__ = 1; sym1__ <= k; ++sym1__) { current_statement__ = 20; current_statement__ = 20; check_less_or_equal(function__, "tp_2[sym1__]", tp_2[(sym1__ - 1)], rvalue(ds, "ds", index_uni(1), index_uni(1))[ - (sym1__ - 1)]);} + (sym1__ - 1)]); + } current_statement__ = 21; for (int sym1__ = 1; sym1__ <= k; ++sym1__) { current_statement__ = 21; @@ -27843,27 +28919,31 @@ class transform_model final : public model_base_crtp { check_greater_or_equal(function__, "tp_3[sym1__]", tp_3[(sym1__ - 1)], rvalue(ds, "ds", index_uni(1), index_uni(1))[ - (sym1__ - 1)]);} + (sym1__ - 1)]); + } current_statement__ = 21; for (int sym1__ = 1; sym1__ <= k; ++sym1__) { current_statement__ = 21; current_statement__ = 21; check_less_or_equal(function__, "tp_3[sym1__]", tp_3[(sym1__ - 1)], rvalue(ds, "ds", index_uni(1), index_uni(2))[ - (sym1__ - 1)]);} + (sym1__ - 1)]); + } current_statement__ = 22; for (int sym1__ = 1; sym1__ <= k; ++sym1__) { current_statement__ = 22; current_statement__ = 22; check_greater_or_equal(function__, "tp_4[sym1__]", - tp_4[(sym1__ - 1)], 0);} + tp_4[(sym1__ - 1)], 0); + } current_statement__ = 22; for (int sym1__ = 1; sym1__ <= k; ++sym1__) { current_statement__ = 22; current_statement__ = 22; check_less_or_equal(function__, "tp_4[sym1__]", tp_4[(sym1__ - 1)], rvalue(ds, "ds", index_uni(1), index_uni(2))[ - (sym1__ - 1)]);} + (sym1__ - 1)]); + } current_statement__ = 23; for (int sym1__ = 1; sym1__ <= k; ++sym1__) { current_statement__ = 23; @@ -27871,7 +28951,8 @@ class transform_model final : public model_base_crtp { check_greater_or_equal(function__, "tp_5[sym1__]", tp_5[(sym1__ - 1)], rvalue(ds, "ds", index_uni(1), index_uni(1))[ - (sym1__ - 1)]);} + (sym1__ - 1)]); + } current_statement__ = 23; for (int sym1__ = 1; sym1__ <= k; ++sym1__) { current_statement__ = 23; @@ -27887,7 +28968,9 @@ class transform_model final : public model_base_crtp { check_greater_or_equal(function__, "tp_9[sym1__, sym2__]", tp_9[(sym1__ - 1)][(sym2__ - 1)], rvalue(ds, "ds", index_uni(1))[(sym1__ - 1)][ - (sym2__ - 1)]);}} + (sym2__ - 1)]); + } + } current_statement__ = 27; for (int sym1__ = 1; sym1__ <= m; ++sym1__) { current_statement__ = 27; @@ -27895,7 +28978,9 @@ class transform_model final : public model_base_crtp { current_statement__ = 27; current_statement__ = 27; check_less_or_equal(function__, "tp_9[sym1__, sym2__]", - tp_9[(sym1__ - 1)][(sym2__ - 1)], 1);}} + tp_9[(sym1__ - 1)][(sym2__ - 1)], 1); + } + } current_statement__ = 28; for (int sym1__ = 1; sym1__ <= n; ++sym1__) { current_statement__ = 28; @@ -27907,7 +28992,10 @@ class transform_model final : public model_base_crtp { check_greater_or_equal(function__, "tp_10[sym1__, sym2__, sym3__]", tp_10[(sym1__ - 1)][(sym2__ - 1)][ - (sym3__ - 1)], 0);}}} + (sym3__ - 1)], 0); + } + } + } current_statement__ = 28; for (int sym1__ = 1; sym1__ <= n; ++sym1__) { current_statement__ = 28; @@ -27920,7 +29008,9 @@ class transform_model final : public model_base_crtp { tp_10[(sym1__ - 1)][(sym2__ - 1)][(sym3__ - 1)], ds[(sym1__ - 1)][(sym2__ - 1)][(sym3__ - 1)]); - }}} + } + } + } current_statement__ = 29; for (int sym1__ = 1; sym1__ <= k; ++sym1__) { current_statement__ = 29; @@ -27928,14 +29018,16 @@ class transform_model final : public model_base_crtp { check_greater_or_equal(function__, "tpv_1[sym1__]", tpv_1[(sym1__ - 1)], rvalue(dv, "dv", index_uni(1), index_uni(1))[ - (sym1__ - 1)]);} + (sym1__ - 1)]); + } current_statement__ = 29; for (int sym1__ = 1; sym1__ <= k; ++sym1__) { current_statement__ = 29; current_statement__ = 29; check_less_or_equal(function__, "tpv_1[sym1__]", tpv_1[(sym1__ - 1)], rvalue(dv, "dv", index_uni(1), index_uni(2))[ - (sym1__ - 1)]);} + (sym1__ - 1)]); + } current_statement__ = 30; for (int sym1__ = 1; sym1__ <= m; ++sym1__) { current_statement__ = 30; @@ -27945,7 +29037,9 @@ class transform_model final : public model_base_crtp { check_greater_or_equal(function__, "tpv_2[sym1__, sym2__]", tpv_2[(sym1__ - 1)][(sym2__ - 1)], rvalue(dv, "dv", index_uni(1))[(sym1__ - 1)][ - (sym2__ - 1)]);}} + (sym2__ - 1)]); + } + } current_statement__ = 31; for (int sym1__ = 1; sym1__ <= n; ++sym1__) { current_statement__ = 31; @@ -27958,7 +29052,9 @@ class transform_model final : public model_base_crtp { tpv_3[(sym1__ - 1)][(sym2__ - 1)][(sym3__ - 1)], dv[(sym1__ - 1)][(sym2__ - 1)][(sym3__ - 1)]); - }}} + } + } + } current_statement__ = 32; for (int sym1__ = 1; sym1__ <= k; ++sym1__) { current_statement__ = 32; @@ -27966,14 +29062,16 @@ class transform_model final : public model_base_crtp { check_greater_or_equal(function__, "tpr_1[sym1__]", tpr_1[(sym1__ - 1)], rvalue(dr, "dr", index_uni(1), index_uni(1))[ - (sym1__ - 1)]);} + (sym1__ - 1)]); + } current_statement__ = 32; for (int sym1__ = 1; sym1__ <= k; ++sym1__) { current_statement__ = 32; current_statement__ = 32; check_less_or_equal(function__, "tpr_1[sym1__]", tpr_1[(sym1__ - 1)], rvalue(dr, "dr", index_uni(1), index_uni(2))[ - (sym1__ - 1)]);} + (sym1__ - 1)]); + } current_statement__ = 33; for (int sym1__ = 1; sym1__ <= m; ++sym1__) { current_statement__ = 33; @@ -27983,7 +29081,9 @@ class transform_model final : public model_base_crtp { check_greater_or_equal(function__, "tpr_2[sym1__, sym2__]", tpr_2[(sym1__ - 1)][(sym2__ - 1)], rvalue(dr, "dr", index_uni(1))[(sym1__ - 1)][ - (sym2__ - 1)]);}} + (sym2__ - 1)]); + } + } current_statement__ = 34; for (int sym1__ = 1; sym1__ <= n; ++sym1__) { current_statement__ = 34; @@ -27996,7 +29096,9 @@ class transform_model final : public model_base_crtp { tpr_3[(sym1__ - 1)][(sym2__ - 1)][(sym3__ - 1)], dr[(sym1__ - 1)][(sym2__ - 1)][(sym3__ - 1)]); - }}} + } + } + } current_statement__ = 35; for (int sym1__ = 1; sym1__ <= m; ++sym1__) { current_statement__ = 35; @@ -28008,7 +29110,9 @@ class transform_model final : public model_base_crtp { index_uni(sym1__), index_uni(sym2__)), rvalue(rvalue(dm, "dm", index_uni(1)), "dm[1]", - index_uni(sym1__), index_uni(sym2__)));}} + index_uni(sym1__), index_uni(sym2__))); + } + } current_statement__ = 36; for (int sym1__ = 1; sym1__ <= n; ++sym1__) { current_statement__ = 36; @@ -28023,7 +29127,10 @@ class transform_model final : public model_base_crtp { index_uni(sym3__)), rvalue(dm, "dm", index_uni(sym1__), index_uni(sym2__), - index_uni(sym3__)));}}} + index_uni(sym3__))); + } + } + } } catch (const std::exception& e) { stan::lang::rethrow_located(e, locations_array__[current_statement__]); // Next line prevents compiler griping about no return @@ -28058,6 +29165,7 @@ class transform_model final : public model_base_crtp { try { std::vector p_1; p_1 = std::vector(k, std::numeric_limits::quiet_NaN()); + current_statement__ = 1; p_1 = in__.template read_constrain_lb, jacobian__>( @@ -28067,6 +29175,7 @@ class transform_model final : public model_base_crtp { rvalue(ds, "ds", index_uni(1), index_uni(1))); std::vector p_2; p_2 = std::vector(k, std::numeric_limits::quiet_NaN()); + current_statement__ = 2; p_2 = in__.template read_constrain_ub, jacobian__>( @@ -28076,6 +29185,7 @@ class transform_model final : public model_base_crtp { rvalue(ds, "ds", index_uni(1), index_uni(1))); std::vector p_3; p_3 = std::vector(k, std::numeric_limits::quiet_NaN()); + current_statement__ = 3; p_3 = in__.template read_constrain_lub, jacobian__>( @@ -28089,6 +29199,7 @@ class transform_model final : public model_base_crtp { rvalue(ds, "ds", index_uni(1), index_uni(2))); std::vector p_4; p_4 = std::vector(k, std::numeric_limits::quiet_NaN()); + current_statement__ = 4; p_4 = in__.template read_constrain_lub, jacobian__>( @@ -28098,6 +29209,7 @@ class transform_model final : public model_base_crtp { rvalue(ds, "ds", index_uni(1), index_uni(2))); std::vector p_5; p_5 = std::vector(k, std::numeric_limits::quiet_NaN()); + current_statement__ = 5; p_5 = in__.template read_constrain_lub, jacobian__>( @@ -28107,6 +29219,7 @@ class transform_model final : public model_base_crtp { rvalue(ds, "ds", index_uni(1), index_uni(1))); std::vector p_6; p_6 = std::vector(k, std::numeric_limits::quiet_NaN()); + current_statement__ = 6; p_6 = in__.template read_constrain_offset_multiplier, jacobian__>( @@ -28116,6 +29229,7 @@ class transform_model final : public model_base_crtp { rvalue(ds, "ds", index_uni(1), index_uni(1))); std::vector p_7; p_7 = std::vector(k, std::numeric_limits::quiet_NaN()); + current_statement__ = 7; p_7 = in__.template read_constrain_offset_multiplier, jacobian__>( @@ -28125,6 +29239,7 @@ class transform_model final : public model_base_crtp { rvalue(ds, "ds", index_uni(1), index_uni(1))); std::vector p_8; p_8 = std::vector(k, std::numeric_limits::quiet_NaN()); + current_statement__ = 8; p_8 = in__.template read_constrain_offset_multiplier, jacobian__>( @@ -28138,6 +29253,7 @@ class transform_model final : public model_base_crtp { rvalue(ds, "ds", index_uni(1), index_uni(2))); std::vector> p_9; p_9 = std::vector>(m, std::vector(k, std::numeric_limits::quiet_NaN())); + current_statement__ = 9; p_9 = in__.template read_constrain_lub>, jacobian__>( @@ -28147,6 +29263,7 @@ class transform_model final : public model_base_crtp { rvalue(ds, "ds", index_uni(1))); std::vector>> p_10; p_10 = std::vector>>(n, std::vector>(m, std::vector(k, std::numeric_limits::quiet_NaN()))); + current_statement__ = 10; p_10 = in__.template read_constrain_lub>>, jacobian__>( @@ -28155,7 +29272,7 @@ class transform_model final : public model_base_crtp { check_matching_dims("constraint", "p_10", p_10, "upper", ds); Eigen::Matrix pv_1; pv_1 = Eigen::Matrix(k); - stan::math::fill(pv_1, std::numeric_limits::quiet_NaN()); + stan::math::fill(pv_1, std::numeric_limits::quiet_NaN()); current_statement__ = 11; pv_1 = in__.template read_constrain_lub, jacobian__>( @@ -28169,7 +29286,7 @@ class transform_model final : public model_base_crtp { rvalue(dv, "dv", index_uni(1), index_uni(2))); std::vector> pv_2; pv_2 = std::vector>(m, Eigen::Matrix(k)); - stan::math::fill(pv_2, std::numeric_limits::quiet_NaN()); + stan::math::fill(pv_2, std::numeric_limits::quiet_NaN()); current_statement__ = 12; pv_2 = in__.template read_constrain_lb>, jacobian__>( @@ -28179,7 +29296,7 @@ class transform_model final : public model_base_crtp { rvalue(dv, "dv", index_uni(1))); std::vector>> pv_3; pv_3 = std::vector>>(n, std::vector>(m, Eigen::Matrix(k))); - stan::math::fill(pv_3, std::numeric_limits::quiet_NaN()); + stan::math::fill(pv_3, std::numeric_limits::quiet_NaN()); current_statement__ = 13; pv_3 = in__.template read_constrain_ub>>, jacobian__>( @@ -28188,7 +29305,7 @@ class transform_model final : public model_base_crtp { check_matching_dims("constraint", "pv_3", pv_3, "upper", dv); Eigen::Matrix pr_1; pr_1 = Eigen::Matrix(k); - stan::math::fill(pr_1, std::numeric_limits::quiet_NaN()); + stan::math::fill(pr_1, std::numeric_limits::quiet_NaN()); current_statement__ = 14; pr_1 = in__.template read_constrain_lub, jacobian__>( @@ -28202,7 +29319,7 @@ class transform_model final : public model_base_crtp { rvalue(dr, "dr", index_uni(1), index_uni(2))); std::vector> pr_2; pr_2 = std::vector>(m, Eigen::Matrix(k)); - stan::math::fill(pr_2, std::numeric_limits::quiet_NaN()); + stan::math::fill(pr_2, std::numeric_limits::quiet_NaN()); current_statement__ = 15; pr_2 = in__.template read_constrain_lb>, jacobian__>( @@ -28212,7 +29329,7 @@ class transform_model final : public model_base_crtp { rvalue(dr, "dr", index_uni(1))); std::vector>> pr_3; pr_3 = std::vector>>(n, std::vector>(m, Eigen::Matrix(k))); - stan::math::fill(pr_3, std::numeric_limits::quiet_NaN()); + stan::math::fill(pr_3, std::numeric_limits::quiet_NaN()); current_statement__ = 16; pr_3 = in__.template read_constrain_ub>>, jacobian__>( @@ -28221,7 +29338,7 @@ class transform_model final : public model_base_crtp { check_matching_dims("constraint", "pr_3", pr_3, "upper", dr); Eigen::Matrix pm_1; pm_1 = Eigen::Matrix(m, k); - stan::math::fill(pm_1, std::numeric_limits::quiet_NaN()); + stan::math::fill(pm_1, std::numeric_limits::quiet_NaN()); current_statement__ = 17; pm_1 = in__.template read_constrain_lb, jacobian__>( @@ -28231,7 +29348,7 @@ class transform_model final : public model_base_crtp { rvalue(dm, "dm", index_uni(1))); std::vector> pm_2; pm_2 = std::vector>(n, Eigen::Matrix(m, k)); - stan::math::fill(pm_2, std::numeric_limits::quiet_NaN()); + stan::math::fill(pm_2, std::numeric_limits::quiet_NaN()); current_statement__ = 18; pm_2 = in__.template read_constrain_ub>, jacobian__>( @@ -28240,120 +29357,160 @@ class transform_model final : public model_base_crtp { check_matching_dims("constraint", "pm_2", pm_2, "upper", dm); std::vector tp_1; tp_1 = std::vector(k, std::numeric_limits::quiet_NaN()); + std::vector tp_2; tp_2 = std::vector(k, std::numeric_limits::quiet_NaN()); + std::vector tp_3; tp_3 = std::vector(k, std::numeric_limits::quiet_NaN()); + std::vector tp_4; tp_4 = std::vector(k, std::numeric_limits::quiet_NaN()); + std::vector tp_5; tp_5 = std::vector(k, std::numeric_limits::quiet_NaN()); + std::vector tp_6; tp_6 = std::vector(k, std::numeric_limits::quiet_NaN()); + std::vector tp_7; tp_7 = std::vector(k, std::numeric_limits::quiet_NaN()); + std::vector tp_8; tp_8 = std::vector(k, std::numeric_limits::quiet_NaN()); + std::vector> tp_9; tp_9 = std::vector>(m, std::vector(k, std::numeric_limits::quiet_NaN())); + std::vector>> tp_10; tp_10 = std::vector>>(n, std::vector>(m, std::vector(k, std::numeric_limits::quiet_NaN()))); + Eigen::Matrix tpv_1; tpv_1 = Eigen::Matrix(k); - stan::math::fill(tpv_1, std::numeric_limits::quiet_NaN()); + stan::math::fill(tpv_1, std::numeric_limits::quiet_NaN()); std::vector> tpv_2; tpv_2 = std::vector>(m, Eigen::Matrix(k)); - stan::math::fill(tpv_2, std::numeric_limits::quiet_NaN()); + stan::math::fill(tpv_2, std::numeric_limits::quiet_NaN()); std::vector>> tpv_3; tpv_3 = std::vector>>(n, std::vector>(m, Eigen::Matrix(k))); - stan::math::fill(tpv_3, std::numeric_limits::quiet_NaN()); + stan::math::fill(tpv_3, std::numeric_limits::quiet_NaN()); Eigen::Matrix tpr_1; tpr_1 = Eigen::Matrix(k); - stan::math::fill(tpr_1, std::numeric_limits::quiet_NaN()); + stan::math::fill(tpr_1, std::numeric_limits::quiet_NaN()); std::vector> tpr_2; tpr_2 = std::vector>(m, Eigen::Matrix(k)); - stan::math::fill(tpr_2, std::numeric_limits::quiet_NaN()); + stan::math::fill(tpr_2, std::numeric_limits::quiet_NaN()); std::vector>> tpr_3; tpr_3 = std::vector>>(n, std::vector>(m, Eigen::Matrix(k))); - stan::math::fill(tpr_3, std::numeric_limits::quiet_NaN()); + stan::math::fill(tpr_3, std::numeric_limits::quiet_NaN()); Eigen::Matrix tpm_1; tpm_1 = Eigen::Matrix(m, k); - stan::math::fill(tpm_1, std::numeric_limits::quiet_NaN()); + stan::math::fill(tpm_1, std::numeric_limits::quiet_NaN()); std::vector> tpm_2; tpm_2 = std::vector>(n, Eigen::Matrix(m, k)); - stan::math::fill(tpm_2, std::numeric_limits::quiet_NaN()); + stan::math::fill(tpm_2, std::numeric_limits::quiet_NaN()); for (int sym1__ = 1; sym1__ <= k; ++sym1__) { - vars__.emplace_back(p_1[(sym1__ - 1)]);} + vars__.emplace_back(p_1[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { - vars__.emplace_back(p_2[(sym1__ - 1)]);} + vars__.emplace_back(p_2[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { - vars__.emplace_back(p_3[(sym1__ - 1)]);} + vars__.emplace_back(p_3[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { - vars__.emplace_back(p_4[(sym1__ - 1)]);} + vars__.emplace_back(p_4[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { - vars__.emplace_back(p_5[(sym1__ - 1)]);} + vars__.emplace_back(p_5[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { - vars__.emplace_back(p_6[(sym1__ - 1)]);} + vars__.emplace_back(p_6[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { - vars__.emplace_back(p_7[(sym1__ - 1)]);} + vars__.emplace_back(p_7[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { - vars__.emplace_back(p_8[(sym1__ - 1)]);} + vars__.emplace_back(p_8[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { for (int sym2__ = 1; sym2__ <= m; ++sym2__) { - vars__.emplace_back(p_9[(sym2__ - 1)][(sym1__ - 1)]);}} + vars__.emplace_back(p_9[(sym2__ - 1)][(sym1__ - 1)]); + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { for (int sym2__ = 1; sym2__ <= m; ++sym2__) { for (int sym3__ = 1; sym3__ <= n; ++sym3__) { vars__.emplace_back( - p_10[(sym3__ - 1)][(sym2__ - 1)][(sym1__ - 1)]);}}} + p_10[(sym3__ - 1)][(sym2__ - 1)][(sym1__ - 1)]); + } + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { - vars__.emplace_back(pv_1[(sym1__ - 1)]);} + vars__.emplace_back(pv_1[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { for (int sym2__ = 1; sym2__ <= m; ++sym2__) { - vars__.emplace_back(pv_2[(sym2__ - 1)][(sym1__ - 1)]);}} + vars__.emplace_back(pv_2[(sym2__ - 1)][(sym1__ - 1)]); + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { for (int sym2__ = 1; sym2__ <= m; ++sym2__) { for (int sym3__ = 1; sym3__ <= n; ++sym3__) { vars__.emplace_back( - pv_3[(sym3__ - 1)][(sym2__ - 1)][(sym1__ - 1)]);}}} + pv_3[(sym3__ - 1)][(sym2__ - 1)][(sym1__ - 1)]); + } + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { - vars__.emplace_back(pr_1[(sym1__ - 1)]);} + vars__.emplace_back(pr_1[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { for (int sym2__ = 1; sym2__ <= m; ++sym2__) { - vars__.emplace_back(pr_2[(sym2__ - 1)][(sym1__ - 1)]);}} + vars__.emplace_back(pr_2[(sym2__ - 1)][(sym1__ - 1)]); + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { for (int sym2__ = 1; sym2__ <= m; ++sym2__) { for (int sym3__ = 1; sym3__ <= n; ++sym3__) { vars__.emplace_back( - pr_3[(sym3__ - 1)][(sym2__ - 1)][(sym1__ - 1)]);}}} + pr_3[(sym3__ - 1)][(sym2__ - 1)][(sym1__ - 1)]); + } + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { for (int sym2__ = 1; sym2__ <= m; ++sym2__) { vars__.emplace_back( - rvalue(pm_1, "pm_1", index_uni(sym2__), index_uni(sym1__)));}} + rvalue(pm_1, "pm_1", index_uni(sym2__), index_uni(sym1__))); + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { for (int sym2__ = 1; sym2__ <= m; ++sym2__) { for (int sym3__ = 1; sym3__ <= n; ++sym3__) { vars__.emplace_back( rvalue(pm_2, "pm_2", - index_uni(sym3__), index_uni(sym2__), index_uni(sym1__)));}}} + index_uni(sym3__), index_uni(sym2__), index_uni(sym1__))); + } + } + } if (logical_negation((primitive_value(emit_transformed_parameters__) || primitive_value(emit_generated_quantities__)))) { return ; @@ -28463,14 +29620,16 @@ class transform_model final : public model_base_crtp { check_greater_or_equal(function__, "tp_1[sym1__]", tp_1[(sym1__ - 1)], rvalue(ds, "ds", index_uni(1), index_uni(1))[ - (sym1__ - 1)]);} + (sym1__ - 1)]); + } current_statement__ = 20; for (int sym1__ = 1; sym1__ <= k; ++sym1__) { current_statement__ = 20; current_statement__ = 20; check_less_or_equal(function__, "tp_2[sym1__]", tp_2[(sym1__ - 1)], rvalue(ds, "ds", index_uni(1), index_uni(1))[ - (sym1__ - 1)]);} + (sym1__ - 1)]); + } current_statement__ = 21; for (int sym1__ = 1; sym1__ <= k; ++sym1__) { current_statement__ = 21; @@ -28478,27 +29637,31 @@ class transform_model final : public model_base_crtp { check_greater_or_equal(function__, "tp_3[sym1__]", tp_3[(sym1__ - 1)], rvalue(ds, "ds", index_uni(1), index_uni(1))[ - (sym1__ - 1)]);} + (sym1__ - 1)]); + } current_statement__ = 21; for (int sym1__ = 1; sym1__ <= k; ++sym1__) { current_statement__ = 21; current_statement__ = 21; check_less_or_equal(function__, "tp_3[sym1__]", tp_3[(sym1__ - 1)], rvalue(ds, "ds", index_uni(1), index_uni(2))[ - (sym1__ - 1)]);} + (sym1__ - 1)]); + } current_statement__ = 22; for (int sym1__ = 1; sym1__ <= k; ++sym1__) { current_statement__ = 22; current_statement__ = 22; check_greater_or_equal(function__, "tp_4[sym1__]", - tp_4[(sym1__ - 1)], 0);} + tp_4[(sym1__ - 1)], 0); + } current_statement__ = 22; for (int sym1__ = 1; sym1__ <= k; ++sym1__) { current_statement__ = 22; current_statement__ = 22; check_less_or_equal(function__, "tp_4[sym1__]", tp_4[(sym1__ - 1)], rvalue(ds, "ds", index_uni(1), index_uni(2))[ - (sym1__ - 1)]);} + (sym1__ - 1)]); + } current_statement__ = 23; for (int sym1__ = 1; sym1__ <= k; ++sym1__) { current_statement__ = 23; @@ -28506,7 +29669,8 @@ class transform_model final : public model_base_crtp { check_greater_or_equal(function__, "tp_5[sym1__]", tp_5[(sym1__ - 1)], rvalue(ds, "ds", index_uni(1), index_uni(1))[ - (sym1__ - 1)]);} + (sym1__ - 1)]); + } current_statement__ = 23; for (int sym1__ = 1; sym1__ <= k; ++sym1__) { current_statement__ = 23; @@ -28522,7 +29686,9 @@ class transform_model final : public model_base_crtp { check_greater_or_equal(function__, "tp_9[sym1__, sym2__]", tp_9[(sym1__ - 1)][(sym2__ - 1)], rvalue(ds, "ds", index_uni(1))[(sym1__ - 1)][ - (sym2__ - 1)]);}} + (sym2__ - 1)]); + } + } current_statement__ = 27; for (int sym1__ = 1; sym1__ <= m; ++sym1__) { current_statement__ = 27; @@ -28530,7 +29696,9 @@ class transform_model final : public model_base_crtp { current_statement__ = 27; current_statement__ = 27; check_less_or_equal(function__, "tp_9[sym1__, sym2__]", - tp_9[(sym1__ - 1)][(sym2__ - 1)], 1);}} + tp_9[(sym1__ - 1)][(sym2__ - 1)], 1); + } + } current_statement__ = 28; for (int sym1__ = 1; sym1__ <= n; ++sym1__) { current_statement__ = 28; @@ -28542,7 +29710,10 @@ class transform_model final : public model_base_crtp { check_greater_or_equal(function__, "tp_10[sym1__, sym2__, sym3__]", tp_10[(sym1__ - 1)][(sym2__ - 1)][ - (sym3__ - 1)], 0);}}} + (sym3__ - 1)], 0); + } + } + } current_statement__ = 28; for (int sym1__ = 1; sym1__ <= n; ++sym1__) { current_statement__ = 28; @@ -28555,7 +29726,9 @@ class transform_model final : public model_base_crtp { tp_10[(sym1__ - 1)][(sym2__ - 1)][(sym3__ - 1)], ds[(sym1__ - 1)][(sym2__ - 1)][(sym3__ - 1)]); - }}} + } + } + } current_statement__ = 29; for (int sym1__ = 1; sym1__ <= k; ++sym1__) { current_statement__ = 29; @@ -28563,14 +29736,16 @@ class transform_model final : public model_base_crtp { check_greater_or_equal(function__, "tpv_1[sym1__]", tpv_1[(sym1__ - 1)], rvalue(dv, "dv", index_uni(1), index_uni(1))[ - (sym1__ - 1)]);} + (sym1__ - 1)]); + } current_statement__ = 29; for (int sym1__ = 1; sym1__ <= k; ++sym1__) { current_statement__ = 29; current_statement__ = 29; check_less_or_equal(function__, "tpv_1[sym1__]", tpv_1[(sym1__ - 1)], rvalue(dv, "dv", index_uni(1), index_uni(2))[ - (sym1__ - 1)]);} + (sym1__ - 1)]); + } current_statement__ = 30; for (int sym1__ = 1; sym1__ <= m; ++sym1__) { current_statement__ = 30; @@ -28580,7 +29755,9 @@ class transform_model final : public model_base_crtp { check_greater_or_equal(function__, "tpv_2[sym1__, sym2__]", tpv_2[(sym1__ - 1)][(sym2__ - 1)], rvalue(dv, "dv", index_uni(1))[(sym1__ - 1)][ - (sym2__ - 1)]);}} + (sym2__ - 1)]); + } + } current_statement__ = 31; for (int sym1__ = 1; sym1__ <= n; ++sym1__) { current_statement__ = 31; @@ -28593,7 +29770,9 @@ class transform_model final : public model_base_crtp { tpv_3[(sym1__ - 1)][(sym2__ - 1)][(sym3__ - 1)], dv[(sym1__ - 1)][(sym2__ - 1)][(sym3__ - 1)]); - }}} + } + } + } current_statement__ = 32; for (int sym1__ = 1; sym1__ <= k; ++sym1__) { current_statement__ = 32; @@ -28601,14 +29780,16 @@ class transform_model final : public model_base_crtp { check_greater_or_equal(function__, "tpr_1[sym1__]", tpr_1[(sym1__ - 1)], rvalue(dr, "dr", index_uni(1), index_uni(1))[ - (sym1__ - 1)]);} + (sym1__ - 1)]); + } current_statement__ = 32; for (int sym1__ = 1; sym1__ <= k; ++sym1__) { current_statement__ = 32; current_statement__ = 32; check_less_or_equal(function__, "tpr_1[sym1__]", tpr_1[(sym1__ - 1)], rvalue(dr, "dr", index_uni(1), index_uni(2))[ - (sym1__ - 1)]);} + (sym1__ - 1)]); + } current_statement__ = 33; for (int sym1__ = 1; sym1__ <= m; ++sym1__) { current_statement__ = 33; @@ -28618,7 +29799,9 @@ class transform_model final : public model_base_crtp { check_greater_or_equal(function__, "tpr_2[sym1__, sym2__]", tpr_2[(sym1__ - 1)][(sym2__ - 1)], rvalue(dr, "dr", index_uni(1))[(sym1__ - 1)][ - (sym2__ - 1)]);}} + (sym2__ - 1)]); + } + } current_statement__ = 34; for (int sym1__ = 1; sym1__ <= n; ++sym1__) { current_statement__ = 34; @@ -28631,7 +29814,9 @@ class transform_model final : public model_base_crtp { tpr_3[(sym1__ - 1)][(sym2__ - 1)][(sym3__ - 1)], dr[(sym1__ - 1)][(sym2__ - 1)][(sym3__ - 1)]); - }}} + } + } + } current_statement__ = 35; for (int sym1__ = 1; sym1__ <= m; ++sym1__) { current_statement__ = 35; @@ -28643,7 +29828,9 @@ class transform_model final : public model_base_crtp { index_uni(sym1__), index_uni(sym2__)), rvalue(rvalue(dm, "dm", index_uni(1)), "dm[1]", - index_uni(sym1__), index_uni(sym2__)));}} + index_uni(sym1__), index_uni(sym2__))); + } + } current_statement__ = 36; for (int sym1__ = 1; sym1__ <= n; ++sym1__) { current_statement__ = 36; @@ -28658,64 +29845,95 @@ class transform_model final : public model_base_crtp { index_uni(sym3__)), rvalue(dm, "dm", index_uni(sym1__), index_uni(sym2__), - index_uni(sym3__)));}}} + index_uni(sym3__))); + } + } + } if (emit_transformed_parameters__) { for (int sym1__ = 1; sym1__ <= k; ++sym1__) { - vars__.emplace_back(tp_1[(sym1__ - 1)]);} + vars__.emplace_back(tp_1[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { - vars__.emplace_back(tp_2[(sym1__ - 1)]);} + vars__.emplace_back(tp_2[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { - vars__.emplace_back(tp_3[(sym1__ - 1)]);} + vars__.emplace_back(tp_3[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { - vars__.emplace_back(tp_4[(sym1__ - 1)]);} + vars__.emplace_back(tp_4[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { - vars__.emplace_back(tp_5[(sym1__ - 1)]);} + vars__.emplace_back(tp_5[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { - vars__.emplace_back(tp_6[(sym1__ - 1)]);} + vars__.emplace_back(tp_6[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { - vars__.emplace_back(tp_7[(sym1__ - 1)]);} + vars__.emplace_back(tp_7[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { - vars__.emplace_back(tp_8[(sym1__ - 1)]);} + vars__.emplace_back(tp_8[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { for (int sym2__ = 1; sym2__ <= m; ++sym2__) { - vars__.emplace_back(tp_9[(sym2__ - 1)][(sym1__ - 1)]);}} + vars__.emplace_back(tp_9[(sym2__ - 1)][(sym1__ - 1)]); + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { for (int sym2__ = 1; sym2__ <= m; ++sym2__) { for (int sym3__ = 1; sym3__ <= n; ++sym3__) { vars__.emplace_back( - tp_10[(sym3__ - 1)][(sym2__ - 1)][(sym1__ - 1)]);}}} + tp_10[(sym3__ - 1)][(sym2__ - 1)][(sym1__ - 1)]); + } + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { - vars__.emplace_back(tpv_1[(sym1__ - 1)]);} + vars__.emplace_back(tpv_1[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { for (int sym2__ = 1; sym2__ <= m; ++sym2__) { - vars__.emplace_back(tpv_2[(sym2__ - 1)][(sym1__ - 1)]);}} + vars__.emplace_back(tpv_2[(sym2__ - 1)][(sym1__ - 1)]); + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { for (int sym2__ = 1; sym2__ <= m; ++sym2__) { for (int sym3__ = 1; sym3__ <= n; ++sym3__) { vars__.emplace_back( - tpv_3[(sym3__ - 1)][(sym2__ - 1)][(sym1__ - 1)]);}}} + tpv_3[(sym3__ - 1)][(sym2__ - 1)][(sym1__ - 1)]); + } + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { - vars__.emplace_back(tpr_1[(sym1__ - 1)]);} + vars__.emplace_back(tpr_1[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { for (int sym2__ = 1; sym2__ <= m; ++sym2__) { - vars__.emplace_back(tpr_2[(sym2__ - 1)][(sym1__ - 1)]);}} + vars__.emplace_back(tpr_2[(sym2__ - 1)][(sym1__ - 1)]); + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { for (int sym2__ = 1; sym2__ <= m; ++sym2__) { for (int sym3__ = 1; sym3__ <= n; ++sym3__) { vars__.emplace_back( - tpr_3[(sym3__ - 1)][(sym2__ - 1)][(sym1__ - 1)]);}}} + tpr_3[(sym3__ - 1)][(sym2__ - 1)][(sym1__ - 1)]); + } + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { for (int sym2__ = 1; sym2__ <= m; ++sym2__) { vars__.emplace_back( - rvalue(tpm_1, "tpm_1", index_uni(sym2__), index_uni(sym1__)));} + rvalue(tpm_1, "tpm_1", index_uni(sym2__), index_uni(sym1__))); + } } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { for (int sym2__ = 1; sym2__ <= m; ++sym2__) { for (int sym3__ = 1; sym3__ <= n; ++sym3__) { vars__.emplace_back( rvalue(tpm_2, "tpm_2", - index_uni(sym3__), index_uni(sym2__), index_uni(sym1__)));} - }} + index_uni(sym3__), index_uni(sym2__), index_uni(sym1__))); + } + } + } } if (logical_negation(emit_generated_quantities__)) { return ; @@ -28740,11 +29958,12 @@ class transform_model final : public model_base_crtp { try { int pos__; - pos__ = std::numeric_limits::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; std::vector p_1; p_1 = std::vector(k, std::numeric_limits::quiet_NaN()); + current_statement__ = 1; p_1 = context__.vals_r("p_1"); @@ -28753,6 +29972,7 @@ class transform_model final : public model_base_crtp { rvalue(ds, "ds", index_uni(1), index_uni(1))); std::vector p_1_free__; p_1_free__ = std::vector(k, std::numeric_limits::quiet_NaN()); + current_statement__ = 1; for (int sym1__ = 1; sym1__ <= k; ++sym1__) { @@ -28760,9 +29980,11 @@ class transform_model final : public model_base_crtp { assign(p_1_free__, stan::math::lb_free(p_1[(sym1__ - 1)], rvalue(ds, "ds", index_uni(1), index_uni(1))[(sym1__ - 1)]), - "assigning variable p_1_free__", index_uni(sym1__));} + "assigning variable p_1_free__", index_uni(sym1__)); + } std::vector p_2; p_2 = std::vector(k, std::numeric_limits::quiet_NaN()); + current_statement__ = 2; p_2 = context__.vals_r("p_2"); @@ -28771,6 +29993,7 @@ class transform_model final : public model_base_crtp { rvalue(ds, "ds", index_uni(1), index_uni(1))); std::vector p_2_free__; p_2_free__ = std::vector(k, std::numeric_limits::quiet_NaN()); + current_statement__ = 2; for (int sym1__ = 1; sym1__ <= k; ++sym1__) { @@ -28778,9 +30001,11 @@ class transform_model final : public model_base_crtp { assign(p_2_free__, stan::math::ub_free(p_2[(sym1__ - 1)], rvalue(ds, "ds", index_uni(1), index_uni(1))[(sym1__ - 1)]), - "assigning variable p_2_free__", index_uni(sym1__));} + "assigning variable p_2_free__", index_uni(sym1__)); + } std::vector p_3; p_3 = std::vector(k, std::numeric_limits::quiet_NaN()); + current_statement__ = 3; p_3 = context__.vals_r("p_3"); @@ -28792,6 +30017,7 @@ class transform_model final : public model_base_crtp { rvalue(ds, "ds", index_uni(1), index_uni(2))); std::vector p_3_free__; p_3_free__ = std::vector(k, std::numeric_limits::quiet_NaN()); + current_statement__ = 3; for (int sym1__ = 1; sym1__ <= k; ++sym1__) { @@ -28800,9 +30026,11 @@ class transform_model final : public model_base_crtp { stan::math::lub_free(p_3[(sym1__ - 1)], rvalue(ds, "ds", index_uni(1), index_uni(1))[(sym1__ - 1)], rvalue(ds, "ds", index_uni(1), index_uni(2))[(sym1__ - 1)]), - "assigning variable p_3_free__", index_uni(sym1__));} + "assigning variable p_3_free__", index_uni(sym1__)); + } std::vector p_4; p_4 = std::vector(k, std::numeric_limits::quiet_NaN()); + current_statement__ = 4; p_4 = context__.vals_r("p_4"); @@ -28811,6 +30039,7 @@ class transform_model final : public model_base_crtp { rvalue(ds, "ds", index_uni(1), index_uni(2))); std::vector p_4_free__; p_4_free__ = std::vector(k, std::numeric_limits::quiet_NaN()); + current_statement__ = 4; for (int sym1__ = 1; sym1__ <= k; ++sym1__) { @@ -28818,9 +30047,11 @@ class transform_model final : public model_base_crtp { assign(p_4_free__, stan::math::lub_free(p_4[(sym1__ - 1)], 0, rvalue(ds, "ds", index_uni(1), index_uni(2))[(sym1__ - 1)]), - "assigning variable p_4_free__", index_uni(sym1__));} + "assigning variable p_4_free__", index_uni(sym1__)); + } std::vector p_5; p_5 = std::vector(k, std::numeric_limits::quiet_NaN()); + current_statement__ = 5; p_5 = context__.vals_r("p_5"); @@ -28829,6 +30060,7 @@ class transform_model final : public model_base_crtp { rvalue(ds, "ds", index_uni(1), index_uni(1))); std::vector p_5_free__; p_5_free__ = std::vector(k, std::numeric_limits::quiet_NaN()); + current_statement__ = 5; for (int sym1__ = 1; sym1__ <= k; ++sym1__) { @@ -28836,9 +30068,11 @@ class transform_model final : public model_base_crtp { assign(p_5_free__, stan::math::lub_free(p_5[(sym1__ - 1)], rvalue(ds, "ds", index_uni(1), index_uni(1))[(sym1__ - 1)], 1), - "assigning variable p_5_free__", index_uni(sym1__));} + "assigning variable p_5_free__", index_uni(sym1__)); + } std::vector p_6; p_6 = std::vector(k, std::numeric_limits::quiet_NaN()); + current_statement__ = 6; p_6 = context__.vals_r("p_6"); @@ -28847,6 +30081,7 @@ class transform_model final : public model_base_crtp { rvalue(ds, "ds", index_uni(1), index_uni(1))); std::vector p_6_free__; p_6_free__ = std::vector(k, std::numeric_limits::quiet_NaN()); + current_statement__ = 6; for (int sym1__ = 1; sym1__ <= k; ++sym1__) { @@ -28854,9 +30089,11 @@ class transform_model final : public model_base_crtp { assign(p_6_free__, stan::math::offset_multiplier_free(p_6[(sym1__ - 1)], rvalue(ds, "ds", index_uni(1), index_uni(1))[(sym1__ - 1)], 1), - "assigning variable p_6_free__", index_uni(sym1__));} + "assigning variable p_6_free__", index_uni(sym1__)); + } std::vector p_7; p_7 = std::vector(k, std::numeric_limits::quiet_NaN()); + current_statement__ = 7; p_7 = context__.vals_r("p_7"); @@ -28865,6 +30102,7 @@ class transform_model final : public model_base_crtp { rvalue(ds, "ds", index_uni(1), index_uni(1))); std::vector p_7_free__; p_7_free__ = std::vector(k, std::numeric_limits::quiet_NaN()); + current_statement__ = 7; for (int sym1__ = 1; sym1__ <= k; ++sym1__) { @@ -28872,9 +30110,11 @@ class transform_model final : public model_base_crtp { assign(p_7_free__, stan::math::offset_multiplier_free(p_7[(sym1__ - 1)], 0, rvalue(ds, "ds", index_uni(1), index_uni(1))[(sym1__ - 1)]), - "assigning variable p_7_free__", index_uni(sym1__));} + "assigning variable p_7_free__", index_uni(sym1__)); + } std::vector p_8; p_8 = std::vector(k, std::numeric_limits::quiet_NaN()); + current_statement__ = 8; p_8 = context__.vals_r("p_8"); @@ -28886,6 +30126,7 @@ class transform_model final : public model_base_crtp { rvalue(ds, "ds", index_uni(1), index_uni(2))); std::vector p_8_free__; p_8_free__ = std::vector(k, std::numeric_limits::quiet_NaN()); + current_statement__ = 8; for (int sym1__ = 1; sym1__ <= k; ++sym1__) { @@ -28894,9 +30135,11 @@ class transform_model final : public model_base_crtp { stan::math::offset_multiplier_free(p_8[(sym1__ - 1)], rvalue(ds, "ds", index_uni(1), index_uni(1))[(sym1__ - 1)], rvalue(ds, "ds", index_uni(1), index_uni(2))[(sym1__ - 1)]), - "assigning variable p_8_free__", index_uni(sym1__));} + "assigning variable p_8_free__", index_uni(sym1__)); + } std::vector> p_9; p_9 = std::vector>(m, std::vector(k, std::numeric_limits::quiet_NaN())); + { std::vector p_9_flat__; @@ -28912,13 +30155,16 @@ class transform_model final : public model_base_crtp { assign(p_9, p_9_flat__[(pos__ - 1)], "assigning variable p_9", index_uni(sym2__), index_uni(sym1__)); current_statement__ = 9; - pos__ = (pos__ + 1);}} + pos__ = (pos__ + 1); + } + } } current_statement__ = 9; check_matching_dims("constraint", "p_9", p_9, "lower", rvalue(ds, "ds", index_uni(1))); std::vector> p_9_free__; p_9_free__ = std::vector>(m, std::vector(k, std::numeric_limits::quiet_NaN())); + current_statement__ = 9; for (int sym1__ = 1; sym1__ <= m; ++sym1__) { @@ -28929,9 +30175,12 @@ class transform_model final : public model_base_crtp { stan::math::lub_free(p_9[(sym1__ - 1)][(sym2__ - 1)], rvalue(ds, "ds", index_uni(1))[(sym1__ - 1)][(sym2__ - 1)], 1), "assigning variable p_9_free__", index_uni(sym1__), - index_uni(sym2__));}} + index_uni(sym2__)); + } + } std::vector>> p_10; p_10 = std::vector>>(n, std::vector>(m, std::vector(k, std::numeric_limits::quiet_NaN()))); + { std::vector p_10_flat__; @@ -28951,12 +30200,16 @@ class transform_model final : public model_base_crtp { index_uni(sym2__), index_uni(sym1__)); current_statement__ = 10; - pos__ = (pos__ + 1);}}} + pos__ = (pos__ + 1); + } + } + } } current_statement__ = 10; check_matching_dims("constraint", "p_10", p_10, "upper", ds); std::vector>> p_10_free__; p_10_free__ = std::vector>>(n, std::vector>(m, std::vector(k, std::numeric_limits::quiet_NaN()))); + current_statement__ = 10; for (int sym1__ = 1; sym1__ <= n; ++sym1__) { @@ -28971,10 +30224,13 @@ class transform_model final : public model_base_crtp { ds[(sym1__ - 1)][(sym2__ - 1)][(sym3__ - 1)]), "assigning variable p_10_free__", index_uni(sym1__), index_uni(sym2__), - index_uni(sym3__));}}} + index_uni(sym3__)); + } + } + } Eigen::Matrix pv_1; pv_1 = Eigen::Matrix(k); - stan::math::fill(pv_1, std::numeric_limits::quiet_NaN()); + stan::math::fill(pv_1, std::numeric_limits::quiet_NaN()); { std::vector pv_1_flat__; @@ -28988,7 +30244,8 @@ class transform_model final : public model_base_crtp { assign(pv_1, pv_1_flat__[(pos__ - 1)], "assigning variable pv_1", index_uni(sym1__)); current_statement__ = 11; - pos__ = (pos__ + 1);} + pos__ = (pos__ + 1); + } } current_statement__ = 11; check_matching_dims("constraint", "pv_1", pv_1, "lower", @@ -28998,7 +30255,7 @@ class transform_model final : public model_base_crtp { rvalue(dv, "dv", index_uni(1), index_uni(2))); Eigen::Matrix pv_1_free__; pv_1_free__ = Eigen::Matrix(k); - stan::math::fill(pv_1_free__, std::numeric_limits::quiet_NaN()); + stan::math::fill(pv_1_free__, std::numeric_limits::quiet_NaN()); current_statement__ = 11; for (int sym1__ = 1; sym1__ <= k; ++sym1__) { @@ -29007,10 +30264,11 @@ class transform_model final : public model_base_crtp { stan::math::lub_free(pv_1[(sym1__ - 1)], rvalue(dv, "dv", index_uni(1), index_uni(1))[(sym1__ - 1)], rvalue(dv, "dv", index_uni(1), index_uni(2))[(sym1__ - 1)]), - "assigning variable pv_1_free__", index_uni(sym1__));} + "assigning variable pv_1_free__", index_uni(sym1__)); + } std::vector> pv_2; pv_2 = std::vector>(m, Eigen::Matrix(k)); - stan::math::fill(pv_2, std::numeric_limits::quiet_NaN()); + stan::math::fill(pv_2, std::numeric_limits::quiet_NaN()); { std::vector pv_2_flat__; @@ -29026,14 +30284,16 @@ class transform_model final : public model_base_crtp { assign(pv_2, pv_2_flat__[(pos__ - 1)], "assigning variable pv_2", index_uni(sym2__), index_uni(sym1__)); current_statement__ = 12; - pos__ = (pos__ + 1);}} + pos__ = (pos__ + 1); + } + } } current_statement__ = 12; check_matching_dims("constraint", "pv_2", pv_2, "lower", rvalue(dv, "dv", index_uni(1))); std::vector> pv_2_free__; pv_2_free__ = std::vector>(m, Eigen::Matrix(k)); - stan::math::fill(pv_2_free__, std::numeric_limits::quiet_NaN()); + stan::math::fill(pv_2_free__, std::numeric_limits::quiet_NaN()); current_statement__ = 12; for (int sym1__ = 1; sym1__ <= m; ++sym1__) { @@ -29044,10 +30304,12 @@ class transform_model final : public model_base_crtp { stan::math::lb_free(pv_2[(sym1__ - 1)][(sym2__ - 1)], rvalue(dv, "dv", index_uni(1))[(sym1__ - 1)][(sym2__ - 1)]), "assigning variable pv_2_free__", index_uni(sym1__), - index_uni(sym2__));}} + index_uni(sym2__)); + } + } std::vector>> pv_3; pv_3 = std::vector>>(n, std::vector>(m, Eigen::Matrix(k))); - stan::math::fill(pv_3, std::numeric_limits::quiet_NaN()); + stan::math::fill(pv_3, std::numeric_limits::quiet_NaN()); { std::vector pv_3_flat__; @@ -29067,13 +30329,16 @@ class transform_model final : public model_base_crtp { index_uni(sym2__), index_uni(sym1__)); current_statement__ = 13; - pos__ = (pos__ + 1);}}} + pos__ = (pos__ + 1); + } + } + } } current_statement__ = 13; check_matching_dims("constraint", "pv_3", pv_3, "upper", dv); std::vector>> pv_3_free__; pv_3_free__ = std::vector>>(n, std::vector>(m, Eigen::Matrix(k))); - stan::math::fill(pv_3_free__, std::numeric_limits::quiet_NaN()); + stan::math::fill(pv_3_free__, std::numeric_limits::quiet_NaN()); current_statement__ = 13; for (int sym1__ = 1; sym1__ <= n; ++sym1__) { @@ -29088,10 +30353,13 @@ class transform_model final : public model_base_crtp { dv[(sym1__ - 1)][(sym2__ - 1)][(sym3__ - 1)]), "assigning variable pv_3_free__", index_uni(sym1__), index_uni(sym2__), - index_uni(sym3__));}}} + index_uni(sym3__)); + } + } + } Eigen::Matrix pr_1; pr_1 = Eigen::Matrix(k); - stan::math::fill(pr_1, std::numeric_limits::quiet_NaN()); + stan::math::fill(pr_1, std::numeric_limits::quiet_NaN()); { std::vector pr_1_flat__; @@ -29105,7 +30373,8 @@ class transform_model final : public model_base_crtp { assign(pr_1, pr_1_flat__[(pos__ - 1)], "assigning variable pr_1", index_uni(sym1__)); current_statement__ = 14; - pos__ = (pos__ + 1);} + pos__ = (pos__ + 1); + } } current_statement__ = 14; check_matching_dims("constraint", "pr_1", pr_1, "lower", @@ -29115,7 +30384,7 @@ class transform_model final : public model_base_crtp { rvalue(dr, "dr", index_uni(1), index_uni(2))); Eigen::Matrix pr_1_free__; pr_1_free__ = Eigen::Matrix(k); - stan::math::fill(pr_1_free__, std::numeric_limits::quiet_NaN()); + stan::math::fill(pr_1_free__, std::numeric_limits::quiet_NaN()); current_statement__ = 14; for (int sym1__ = 1; sym1__ <= k; ++sym1__) { @@ -29124,10 +30393,11 @@ class transform_model final : public model_base_crtp { stan::math::lub_free(pr_1[(sym1__ - 1)], rvalue(dr, "dr", index_uni(1), index_uni(1))[(sym1__ - 1)], rvalue(dr, "dr", index_uni(1), index_uni(2))[(sym1__ - 1)]), - "assigning variable pr_1_free__", index_uni(sym1__));} + "assigning variable pr_1_free__", index_uni(sym1__)); + } std::vector> pr_2; pr_2 = std::vector>(m, Eigen::Matrix(k)); - stan::math::fill(pr_2, std::numeric_limits::quiet_NaN()); + stan::math::fill(pr_2, std::numeric_limits::quiet_NaN()); { std::vector pr_2_flat__; @@ -29143,14 +30413,16 @@ class transform_model final : public model_base_crtp { assign(pr_2, pr_2_flat__[(pos__ - 1)], "assigning variable pr_2", index_uni(sym2__), index_uni(sym1__)); current_statement__ = 15; - pos__ = (pos__ + 1);}} + pos__ = (pos__ + 1); + } + } } current_statement__ = 15; check_matching_dims("constraint", "pr_2", pr_2, "lower", rvalue(dr, "dr", index_uni(1))); std::vector> pr_2_free__; pr_2_free__ = std::vector>(m, Eigen::Matrix(k)); - stan::math::fill(pr_2_free__, std::numeric_limits::quiet_NaN()); + stan::math::fill(pr_2_free__, std::numeric_limits::quiet_NaN()); current_statement__ = 15; for (int sym1__ = 1; sym1__ <= m; ++sym1__) { @@ -29161,10 +30433,12 @@ class transform_model final : public model_base_crtp { stan::math::lb_free(pr_2[(sym1__ - 1)][(sym2__ - 1)], rvalue(dr, "dr", index_uni(1))[(sym1__ - 1)][(sym2__ - 1)]), "assigning variable pr_2_free__", index_uni(sym1__), - index_uni(sym2__));}} + index_uni(sym2__)); + } + } std::vector>> pr_3; pr_3 = std::vector>>(n, std::vector>(m, Eigen::Matrix(k))); - stan::math::fill(pr_3, std::numeric_limits::quiet_NaN()); + stan::math::fill(pr_3, std::numeric_limits::quiet_NaN()); { std::vector pr_3_flat__; @@ -29184,13 +30458,16 @@ class transform_model final : public model_base_crtp { index_uni(sym2__), index_uni(sym1__)); current_statement__ = 16; - pos__ = (pos__ + 1);}}} + pos__ = (pos__ + 1); + } + } + } } current_statement__ = 16; check_matching_dims("constraint", "pr_3", pr_3, "upper", dr); std::vector>> pr_3_free__; pr_3_free__ = std::vector>>(n, std::vector>(m, Eigen::Matrix(k))); - stan::math::fill(pr_3_free__, std::numeric_limits::quiet_NaN()); + stan::math::fill(pr_3_free__, std::numeric_limits::quiet_NaN()); current_statement__ = 16; for (int sym1__ = 1; sym1__ <= n; ++sym1__) { @@ -29205,10 +30482,13 @@ class transform_model final : public model_base_crtp { dr[(sym1__ - 1)][(sym2__ - 1)][(sym3__ - 1)]), "assigning variable pr_3_free__", index_uni(sym1__), index_uni(sym2__), - index_uni(sym3__));}}} + index_uni(sym3__)); + } + } + } Eigen::Matrix pm_1; pm_1 = Eigen::Matrix(m, k); - stan::math::fill(pm_1, std::numeric_limits::quiet_NaN()); + stan::math::fill(pm_1, std::numeric_limits::quiet_NaN()); { std::vector pm_1_flat__; @@ -29224,14 +30504,16 @@ class transform_model final : public model_base_crtp { assign(pm_1, pm_1_flat__[(pos__ - 1)], "assigning variable pm_1", index_uni(sym2__), index_uni(sym1__)); current_statement__ = 17; - pos__ = (pos__ + 1);}} + pos__ = (pos__ + 1); + } + } } current_statement__ = 17; check_matching_dims("constraint", "pm_1", pm_1, "lower", rvalue(dm, "dm", index_uni(1))); Eigen::Matrix pm_1_free__; pm_1_free__ = Eigen::Matrix(m, k); - stan::math::fill(pm_1_free__, std::numeric_limits::quiet_NaN()); + stan::math::fill(pm_1_free__, std::numeric_limits::quiet_NaN()); current_statement__ = 17; for (int sym1__ = 1; sym1__ <= m; ++sym1__) { @@ -29244,10 +30526,12 @@ class transform_model final : public model_base_crtp { rvalue(rvalue(dm, "dm", index_uni(1)), "dm[1]", index_uni(sym1__), index_uni(sym2__))), "assigning variable pm_1_free__", index_uni(sym1__), - index_uni(sym2__));}} + index_uni(sym2__)); + } + } std::vector> pm_2; pm_2 = std::vector>(n, Eigen::Matrix(m, k)); - stan::math::fill(pm_2, std::numeric_limits::quiet_NaN()); + stan::math::fill(pm_2, std::numeric_limits::quiet_NaN()); { std::vector pm_2_flat__; @@ -29267,13 +30551,16 @@ class transform_model final : public model_base_crtp { index_uni(sym2__), index_uni(sym1__)); current_statement__ = 18; - pos__ = (pos__ + 1);}}} + pos__ = (pos__ + 1); + } + } + } } current_statement__ = 18; check_matching_dims("constraint", "pm_2", pm_2, "upper", dm); std::vector> pm_2_free__; pm_2_free__ = std::vector>(n, Eigen::Matrix(m, k)); - stan::math::fill(pm_2_free__, std::numeric_limits::quiet_NaN()); + stan::math::fill(pm_2_free__, std::numeric_limits::quiet_NaN()); current_statement__ = 18; for (int sym1__ = 1; sym1__ <= n; ++sym1__) { @@ -29290,62 +30577,95 @@ class transform_model final : public model_base_crtp { index_uni(sym1__), index_uni(sym2__), index_uni(sym3__))), "assigning variable pm_2_free__", index_uni(sym1__), index_uni(sym2__), - index_uni(sym3__));}}} + index_uni(sym3__)); + } + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { - vars__.emplace_back(p_1_free__[(sym1__ - 1)]);} + vars__.emplace_back(p_1_free__[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { - vars__.emplace_back(p_2_free__[(sym1__ - 1)]);} + vars__.emplace_back(p_2_free__[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { - vars__.emplace_back(p_3_free__[(sym1__ - 1)]);} + vars__.emplace_back(p_3_free__[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { - vars__.emplace_back(p_4_free__[(sym1__ - 1)]);} + vars__.emplace_back(p_4_free__[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { - vars__.emplace_back(p_5_free__[(sym1__ - 1)]);} + vars__.emplace_back(p_5_free__[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { - vars__.emplace_back(p_6_free__[(sym1__ - 1)]);} + vars__.emplace_back(p_6_free__[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { - vars__.emplace_back(p_7_free__[(sym1__ - 1)]);} + vars__.emplace_back(p_7_free__[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { - vars__.emplace_back(p_8_free__[(sym1__ - 1)]);} + vars__.emplace_back(p_8_free__[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= m; ++sym1__) { for (int sym2__ = 1; sym2__ <= k; ++sym2__) { - vars__.emplace_back(p_9_free__[(sym1__ - 1)][(sym2__ - 1)]);}} + vars__.emplace_back(p_9_free__[(sym1__ - 1)][(sym2__ - 1)]); + } + } for (int sym1__ = 1; sym1__ <= n; ++sym1__) { for (int sym2__ = 1; sym2__ <= m; ++sym2__) { for (int sym3__ = 1; sym3__ <= k; ++sym3__) { vars__.emplace_back( - p_10_free__[(sym1__ - 1)][(sym2__ - 1)][(sym3__ - 1)]);}}} + p_10_free__[(sym1__ - 1)][(sym2__ - 1)][(sym3__ - 1)]); + } + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { - vars__.emplace_back(pv_1_free__[(sym1__ - 1)]);} + vars__.emplace_back(pv_1_free__[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= m; ++sym1__) { for (int sym2__ = 1; sym2__ <= k; ++sym2__) { - vars__.emplace_back(pv_2_free__[(sym1__ - 1)][(sym2__ - 1)]);}} + vars__.emplace_back(pv_2_free__[(sym1__ - 1)][(sym2__ - 1)]); + } + } for (int sym1__ = 1; sym1__ <= n; ++sym1__) { for (int sym2__ = 1; sym2__ <= m; ++sym2__) { for (int sym3__ = 1; sym3__ <= k; ++sym3__) { vars__.emplace_back( - pv_3_free__[(sym1__ - 1)][(sym2__ - 1)][(sym3__ - 1)]);}}} + pv_3_free__[(sym1__ - 1)][(sym2__ - 1)][(sym3__ - 1)]); + } + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { - vars__.emplace_back(pr_1_free__[(sym1__ - 1)]);} + vars__.emplace_back(pr_1_free__[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= m; ++sym1__) { for (int sym2__ = 1; sym2__ <= k; ++sym2__) { - vars__.emplace_back(pr_2_free__[(sym1__ - 1)][(sym2__ - 1)]);}} + vars__.emplace_back(pr_2_free__[(sym1__ - 1)][(sym2__ - 1)]); + } + } for (int sym1__ = 1; sym1__ <= n; ++sym1__) { for (int sym2__ = 1; sym2__ <= m; ++sym2__) { for (int sym3__ = 1; sym3__ <= k; ++sym3__) { vars__.emplace_back( - pr_3_free__[(sym1__ - 1)][(sym2__ - 1)][(sym3__ - 1)]);}}} + pr_3_free__[(sym1__ - 1)][(sym2__ - 1)][(sym3__ - 1)]); + } + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { for (int sym2__ = 1; sym2__ <= m; ++sym2__) { vars__.emplace_back( rvalue(pm_1_free__, "pm_1_free__", - index_uni(sym2__), index_uni(sym1__)));}} + index_uni(sym2__), index_uni(sym1__))); + } + } for (int sym1__ = 1; sym1__ <= n; ++sym1__) { for (int sym2__ = 1; sym2__ <= k; ++sym2__) { for (int sym3__ = 1; sym3__ <= m; ++sym3__) { vars__.emplace_back( rvalue(pm_2_free__, "pm_2_free__", - index_uni(sym1__), index_uni(sym3__), index_uni(sym2__)));}}} + index_uni(sym1__), index_uni(sym3__), index_uni(sym2__))); + } + } + } } catch (const std::exception& e) { stan::lang::rethrow_located(e, locations_array__[current_statement__]); // Next line prevents compiler griping about no return @@ -29355,42 +30675,12 @@ class transform_model final : public model_base_crtp { inline void get_param_names(std::vector& names__) const { - names__ = std::vector{"p_1", - "p_2", - "p_3", - "p_4", - "p_5", - "p_6", - "p_7", - "p_8", - "p_9", - "p_10", - "pv_1", - "pv_2", - "pv_3", - "pr_1", - "pr_2", - "pr_3", - "pm_1", - "pm_2", - "tp_1", - "tp_2", - "tp_3", - "tp_4", - "tp_5", - "tp_6", - "tp_7", - "tp_8", - "tp_9", - "tp_10", - "tpv_1", - "tpv_2", - "tpv_3", - "tpr_1", - "tpr_2", - "tpr_3", - "tpm_1", - "tpm_2"}; + names__ = std::vector{"p_1", "p_2", "p_3", "p_4", "p_5", + "p_6", "p_7", "p_8", "p_9", "p_10", "pv_1", "pv_2", "pv_3", "pr_1", + "pr_2", "pr_3", "pm_1", "pm_2", "tp_1", "tp_2", "tp_3", "tp_4", "tp_5", + "tp_6", "tp_7", "tp_8", "tp_9", "tp_10", "tpv_1", "tpv_2", "tpv_3", + "tpr_1", "tpr_2", "tpr_3", "tpm_1", "tpm_2"}; + } // get_param_names() inline void get_dims(std::vector>& dimss__) const { @@ -29398,49 +30688,50 @@ class transform_model final : public model_base_crtp { dimss__ = std::vector>{std::vector{ static_cast(k) }, - std::vector{static_cast(k)}, - std::vector{static_cast(k)}, - std::vector{static_cast(k)}, - std::vector{static_cast(k)}, - std::vector{static_cast(k)}, - std::vector{static_cast(k)}, - std::vector{static_cast(k)}, - std::vector{static_cast(m), static_cast(k)}, - std::vector{static_cast(n), static_cast(m), - static_cast(k)}, - std::vector{static_cast(k)}, - std::vector{static_cast(m), static_cast(k)}, - std::vector{static_cast(n), static_cast(m), - static_cast(k)}, - std::vector{static_cast(k)}, - std::vector{static_cast(m), static_cast(k)}, - std::vector{static_cast(n), static_cast(m), - static_cast(k)}, - std::vector{static_cast(m), static_cast(k)}, - std::vector{static_cast(n), static_cast(m), - static_cast(k)}, - std::vector{static_cast(k)}, - std::vector{static_cast(k)}, - std::vector{static_cast(k)}, - std::vector{static_cast(k)}, - std::vector{static_cast(k)}, - std::vector{static_cast(k)}, - std::vector{static_cast(k)}, - std::vector{static_cast(k)}, - std::vector{static_cast(m), static_cast(k)}, - std::vector{static_cast(n), static_cast(m), - static_cast(k)}, - std::vector{static_cast(k)}, - std::vector{static_cast(m), static_cast(k)}, - std::vector{static_cast(n), static_cast(m), - static_cast(k)}, - std::vector{static_cast(k)}, - std::vector{static_cast(m), static_cast(k)}, - std::vector{static_cast(n), static_cast(m), - static_cast(k)}, - std::vector{static_cast(m), static_cast(k)}, - std::vector{static_cast(n), static_cast(m), - static_cast(k)}}; + std::vector{static_cast(k)}, + std::vector{static_cast(k)}, + std::vector{static_cast(k)}, + std::vector{static_cast(k)}, + std::vector{static_cast(k)}, + std::vector{static_cast(k)}, + std::vector{static_cast(k)}, + std::vector{static_cast(m), static_cast(k)}, + std::vector{static_cast(n), static_cast(m), + static_cast(k)}, + std::vector{static_cast(k)}, + std::vector{static_cast(m), static_cast(k)}, + std::vector{static_cast(n), static_cast(m), + static_cast(k)}, + std::vector{static_cast(k)}, + std::vector{static_cast(m), static_cast(k)}, + std::vector{static_cast(n), static_cast(m), + static_cast(k)}, + std::vector{static_cast(m), static_cast(k)}, + std::vector{static_cast(n), static_cast(m), + static_cast(k)}, + std::vector{static_cast(k)}, + std::vector{static_cast(k)}, + std::vector{static_cast(k)}, + std::vector{static_cast(k)}, + std::vector{static_cast(k)}, + std::vector{static_cast(k)}, + std::vector{static_cast(k)}, + std::vector{static_cast(k)}, + std::vector{static_cast(m), static_cast(k)}, + std::vector{static_cast(n), static_cast(m), + static_cast(k)}, + std::vector{static_cast(k)}, + std::vector{static_cast(m), static_cast(k)}, + std::vector{static_cast(n), static_cast(m), + static_cast(k)}, + std::vector{static_cast(k)}, + std::vector{static_cast(m), static_cast(k)}, + std::vector{static_cast(n), static_cast(m), + static_cast(k)}, + std::vector{static_cast(m), static_cast(k)}, + std::vector{static_cast(n), static_cast(m), + static_cast(k)}}; + } // get_dims() inline void constrained_param_names( @@ -29452,42 +30743,52 @@ class transform_model final : public model_base_crtp { for (int sym1__ = 1; sym1__ <= k; ++sym1__) { { param_names__.emplace_back(std::string() + "p_1" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { { param_names__.emplace_back(std::string() + "p_2" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { { param_names__.emplace_back(std::string() + "p_3" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { { param_names__.emplace_back(std::string() + "p_4" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { { param_names__.emplace_back(std::string() + "p_5" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { { param_names__.emplace_back(std::string() + "p_6" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { { param_names__.emplace_back(std::string() + "p_7" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { { param_names__.emplace_back(std::string() + "p_8" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { { for (int sym2__ = 1; sym2__ <= m; ++sym2__) { { param_names__.emplace_back(std::string() + "p_9" + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} + } + } + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { { for (int sym2__ = 1; sym2__ <= m; ++sym2__) { @@ -29495,20 +30796,26 @@ class transform_model final : public model_base_crtp { for (int sym3__ = 1; sym3__ <= n; ++sym3__) { { param_names__.emplace_back(std::string() + "p_10" + '.' + std::to_string(sym3__) + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} - }} + } + } + } + } + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { { param_names__.emplace_back(std::string() + "pv_1" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { { for (int sym2__ = 1; sym2__ <= m; ++sym2__) { { param_names__.emplace_back(std::string() + "pv_2" + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} + } + } + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { { for (int sym2__ = 1; sym2__ <= m; ++sym2__) { @@ -29516,20 +30823,26 @@ class transform_model final : public model_base_crtp { for (int sym3__ = 1; sym3__ <= n; ++sym3__) { { param_names__.emplace_back(std::string() + "pv_3" + '.' + std::to_string(sym3__) + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} - }} + } + } + } + } + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { { param_names__.emplace_back(std::string() + "pr_1" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { { for (int sym2__ = 1; sym2__ <= m; ++sym2__) { { param_names__.emplace_back(std::string() + "pr_2" + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} + } + } + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { { for (int sym2__ = 1; sym2__ <= m; ++sym2__) { @@ -29537,16 +30850,21 @@ class transform_model final : public model_base_crtp { for (int sym3__ = 1; sym3__ <= n; ++sym3__) { { param_names__.emplace_back(std::string() + "pr_3" + '.' + std::to_string(sym3__) + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} - }} + } + } + } + } + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { { for (int sym2__ = 1; sym2__ <= m; ++sym2__) { { param_names__.emplace_back(std::string() + "pm_1" + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} + } + } + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { { for (int sym2__ = 1; sym2__ <= m; ++sym2__) { @@ -29554,49 +30872,62 @@ class transform_model final : public model_base_crtp { for (int sym3__ = 1; sym3__ <= n; ++sym3__) { { param_names__.emplace_back(std::string() + "pm_2" + '.' + std::to_string(sym3__) + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} - }} + } + } + } + } + } + } if (emit_transformed_parameters__) { for (int sym1__ = 1; sym1__ <= k; ++sym1__) { { param_names__.emplace_back(std::string() + "tp_1" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { { param_names__.emplace_back(std::string() + "tp_2" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { { param_names__.emplace_back(std::string() + "tp_3" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { { param_names__.emplace_back(std::string() + "tp_4" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { { param_names__.emplace_back(std::string() + "tp_5" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { { param_names__.emplace_back(std::string() + "tp_6" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { { param_names__.emplace_back(std::string() + "tp_7" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { { param_names__.emplace_back(std::string() + "tp_8" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { { for (int sym2__ = 1; sym2__ <= m; ++sym2__) { { param_names__.emplace_back(std::string() + "tp_9" + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} + } + } + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { { for (int sym2__ = 1; sym2__ <= m; ++sym2__) { @@ -29604,20 +30935,26 @@ class transform_model final : public model_base_crtp { for (int sym3__ = 1; sym3__ <= n; ++sym3__) { { param_names__.emplace_back(std::string() + "tp_10" + '.' + std::to_string(sym3__) + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} - }} + } + } + } + } + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { { param_names__.emplace_back(std::string() + "tpv_1" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { { for (int sym2__ = 1; sym2__ <= m; ++sym2__) { { param_names__.emplace_back(std::string() + "tpv_2" + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} + } + } + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { { for (int sym2__ = 1; sym2__ <= m; ++sym2__) { @@ -29625,20 +30962,26 @@ class transform_model final : public model_base_crtp { for (int sym3__ = 1; sym3__ <= n; ++sym3__) { { param_names__.emplace_back(std::string() + "tpv_3" + '.' + std::to_string(sym3__) + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} - }} + } + } + } + } + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { { param_names__.emplace_back(std::string() + "tpr_1" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { { for (int sym2__ = 1; sym2__ <= m; ++sym2__) { { param_names__.emplace_back(std::string() + "tpr_2" + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} + } + } + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { { for (int sym2__ = 1; sym2__ <= m; ++sym2__) { @@ -29646,16 +30989,21 @@ class transform_model final : public model_base_crtp { for (int sym3__ = 1; sym3__ <= n; ++sym3__) { { param_names__.emplace_back(std::string() + "tpr_3" + '.' + std::to_string(sym3__) + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} - }} + } + } + } + } + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { { for (int sym2__ = 1; sym2__ <= m; ++sym2__) { { param_names__.emplace_back(std::string() + "tpm_1" + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} + } + } + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { { for (int sym2__ = 1; sym2__ <= m; ++sym2__) { @@ -29663,9 +31011,12 @@ class transform_model final : public model_base_crtp { for (int sym3__ = 1; sym3__ <= n; ++sym3__) { { param_names__.emplace_back(std::string() + "tpm_2" + '.' + std::to_string(sym3__) + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} - }} + } + } + } + } + } + } } if (emit_generated_quantities__) { @@ -29683,42 +31034,52 @@ class transform_model final : public model_base_crtp { for (int sym1__ = 1; sym1__ <= k; ++sym1__) { { param_names__.emplace_back(std::string() + "p_1" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { { param_names__.emplace_back(std::string() + "p_2" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { { param_names__.emplace_back(std::string() + "p_3" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { { param_names__.emplace_back(std::string() + "p_4" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { { param_names__.emplace_back(std::string() + "p_5" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { { param_names__.emplace_back(std::string() + "p_6" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { { param_names__.emplace_back(std::string() + "p_7" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { { param_names__.emplace_back(std::string() + "p_8" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { { for (int sym2__ = 1; sym2__ <= m; ++sym2__) { { param_names__.emplace_back(std::string() + "p_9" + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} + } + } + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { { for (int sym2__ = 1; sym2__ <= m; ++sym2__) { @@ -29726,20 +31087,26 @@ class transform_model final : public model_base_crtp { for (int sym3__ = 1; sym3__ <= n; ++sym3__) { { param_names__.emplace_back(std::string() + "p_10" + '.' + std::to_string(sym3__) + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} - }} + } + } + } + } + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { { param_names__.emplace_back(std::string() + "pv_1" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { { for (int sym2__ = 1; sym2__ <= m; ++sym2__) { { param_names__.emplace_back(std::string() + "pv_2" + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} + } + } + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { { for (int sym2__ = 1; sym2__ <= m; ++sym2__) { @@ -29747,20 +31114,26 @@ class transform_model final : public model_base_crtp { for (int sym3__ = 1; sym3__ <= n; ++sym3__) { { param_names__.emplace_back(std::string() + "pv_3" + '.' + std::to_string(sym3__) + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} - }} + } + } + } + } + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { { param_names__.emplace_back(std::string() + "pr_1" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { { for (int sym2__ = 1; sym2__ <= m; ++sym2__) { { param_names__.emplace_back(std::string() + "pr_2" + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} + } + } + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { { for (int sym2__ = 1; sym2__ <= m; ++sym2__) { @@ -29768,16 +31141,21 @@ class transform_model final : public model_base_crtp { for (int sym3__ = 1; sym3__ <= n; ++sym3__) { { param_names__.emplace_back(std::string() + "pr_3" + '.' + std::to_string(sym3__) + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} - }} + } + } + } + } + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { { for (int sym2__ = 1; sym2__ <= m; ++sym2__) { { param_names__.emplace_back(std::string() + "pm_1" + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} + } + } + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { { for (int sym2__ = 1; sym2__ <= m; ++sym2__) { @@ -29785,49 +31163,62 @@ class transform_model final : public model_base_crtp { for (int sym3__ = 1; sym3__ <= n; ++sym3__) { { param_names__.emplace_back(std::string() + "pm_2" + '.' + std::to_string(sym3__) + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} - }} + } + } + } + } + } + } if (emit_transformed_parameters__) { for (int sym1__ = 1; sym1__ <= k; ++sym1__) { { param_names__.emplace_back(std::string() + "tp_1" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { { param_names__.emplace_back(std::string() + "tp_2" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { { param_names__.emplace_back(std::string() + "tp_3" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { { param_names__.emplace_back(std::string() + "tp_4" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { { param_names__.emplace_back(std::string() + "tp_5" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { { param_names__.emplace_back(std::string() + "tp_6" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { { param_names__.emplace_back(std::string() + "tp_7" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { { param_names__.emplace_back(std::string() + "tp_8" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { { for (int sym2__ = 1; sym2__ <= m; ++sym2__) { { param_names__.emplace_back(std::string() + "tp_9" + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} + } + } + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { { for (int sym2__ = 1; sym2__ <= m; ++sym2__) { @@ -29835,20 +31226,26 @@ class transform_model final : public model_base_crtp { for (int sym3__ = 1; sym3__ <= n; ++sym3__) { { param_names__.emplace_back(std::string() + "tp_10" + '.' + std::to_string(sym3__) + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} - }} + } + } + } + } + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { { param_names__.emplace_back(std::string() + "tpv_1" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { { for (int sym2__ = 1; sym2__ <= m; ++sym2__) { { param_names__.emplace_back(std::string() + "tpv_2" + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} + } + } + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { { for (int sym2__ = 1; sym2__ <= m; ++sym2__) { @@ -29856,20 +31253,26 @@ class transform_model final : public model_base_crtp { for (int sym3__ = 1; sym3__ <= n; ++sym3__) { { param_names__.emplace_back(std::string() + "tpv_3" + '.' + std::to_string(sym3__) + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} - }} + } + } + } + } + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { { param_names__.emplace_back(std::string() + "tpr_1" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { { for (int sym2__ = 1; sym2__ <= m; ++sym2__) { { param_names__.emplace_back(std::string() + "tpr_2" + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} + } + } + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { { for (int sym2__ = 1; sym2__ <= m; ++sym2__) { @@ -29877,16 +31280,21 @@ class transform_model final : public model_base_crtp { for (int sym3__ = 1; sym3__ <= n; ++sym3__) { { param_names__.emplace_back(std::string() + "tpr_3" + '.' + std::to_string(sym3__) + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} - }} + } + } + } + } + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { { for (int sym2__ = 1; sym2__ <= m; ++sym2__) { { param_names__.emplace_back(std::string() + "tpm_1" + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} + } + } + } + } for (int sym1__ = 1; sym1__ <= k; ++sym1__) { { for (int sym2__ = 1; sym2__ <= m; ++sym2__) { @@ -29894,9 +31302,12 @@ class transform_model final : public model_base_crtp { for (int sym3__ = 1; sym3__ <= n; ++sym3__) { { param_names__.emplace_back(std::string() + "tpm_2" + '.' + std::to_string(sym3__) + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} - }} + } + } + } + } + } + } } if (emit_generated_quantities__) { @@ -29905,14 +31316,16 @@ class transform_model final : public model_base_crtp { } // unconstrained_param_names() - inline std::string get_constrained_sizedtypes() const final { + inline std::string get_constrained_sizedtypes() const { + + return std::string("[{\"name\":\"p_1\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(k) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"p_2\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(k) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"p_3\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(k) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"p_4\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(k) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"p_5\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(k) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"p_6\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(k) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"p_7\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(k) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"p_8\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(k) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"p_9\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(m) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(k) + ",\"element_type\":{\"name\":\"real\"}}},\"block\":\"parameters\"},{\"name\":\"p_10\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(n) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(m) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(k) + ",\"element_type\":{\"name\":\"real\"}}}},\"block\":\"parameters\"},{\"name\":\"pv_1\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(k) + "},\"block\":\"parameters\"},{\"name\":\"pv_2\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(m) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(k) + "}},\"block\":\"parameters\"},{\"name\":\"pv_3\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(n) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(m) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(k) + "}}},\"block\":\"parameters\"},{\"name\":\"pr_1\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(k) + "},\"block\":\"parameters\"},{\"name\":\"pr_2\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(m) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(k) + "}},\"block\":\"parameters\"},{\"name\":\"pr_3\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(n) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(m) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(k) + "}}},\"block\":\"parameters\"},{\"name\":\"pm_1\",\"type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(m) + ",\"cols\":" + std::to_string(k) + "},\"block\":\"parameters\"},{\"name\":\"pm_2\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(n) + ",\"element_type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(m) + ",\"cols\":" + std::to_string(k) + "}},\"block\":\"parameters\"},{\"name\":\"tp_1\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(k) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_2\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(k) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_3\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(k) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_4\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(k) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_5\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(k) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_6\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(k) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_7\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(k) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_8\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(k) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_9\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(m) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(k) + ",\"element_type\":{\"name\":\"real\"}}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_10\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(n) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(m) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(k) + ",\"element_type\":{\"name\":\"real\"}}}},\"block\":\"transformed_parameters\"},{\"name\":\"tpv_1\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(k) + "},\"block\":\"transformed_parameters\"},{\"name\":\"tpv_2\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(m) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(k) + "}},\"block\":\"transformed_parameters\"},{\"name\":\"tpv_3\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(n) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(m) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(k) + "}}},\"block\":\"transformed_parameters\"},{\"name\":\"tpr_1\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(k) + "},\"block\":\"transformed_parameters\"},{\"name\":\"tpr_2\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(m) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(k) + "}},\"block\":\"transformed_parameters\"},{\"name\":\"tpr_3\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(n) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(m) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(k) + "}}},\"block\":\"transformed_parameters\"},{\"name\":\"tpm_1\",\"type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(m) + ",\"cols\":" + std::to_string(k) + "},\"block\":\"transformed_parameters\"},{\"name\":\"tpm_2\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(n) + ",\"element_type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(m) + ",\"cols\":" + std::to_string(k) + "}},\"block\":\"transformed_parameters\"}]"); - return std::string("[{\"name\":\"p_1\",\"type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"p_2\",\"type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"p_3\",\"type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"p_4\",\"type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"p_5\",\"type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"p_6\",\"type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"p_7\",\"type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"p_8\",\"type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"p_9\",\"type\":{\"name\":\"array\",\"length\":" << m << ",\"element_type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}}},\"block\":\"parameters\"},{\"name\":\"p_10\",\"type\":{\"name\":\"array\",\"length\":" << n << ",\"element_type\":{\"name\":\"array\",\"length\":" << m << ",\"element_type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}}}},\"block\":\"parameters\"},{\"name\":\"pv_1\",\"type\":{\"name\":\"vector\",\"length\":" << k << "},\"block\":\"parameters\"},{\"name\":\"pv_2\",\"type\":{\"name\":\"array\",\"length\":" << m << ",\"element_type\":{\"name\":\"vector\",\"length\":" << k << "}},\"block\":\"parameters\"},{\"name\":\"pv_3\",\"type\":{\"name\":\"array\",\"length\":" << n << ",\"element_type\":{\"name\":\"array\",\"length\":" << m << ",\"element_type\":{\"name\":\"vector\",\"length\":" << k << "}}},\"block\":\"parameters\"},{\"name\":\"pr_1\",\"type\":{\"name\":\"vector\",\"length\":" << k << "},\"block\":\"parameters\"},{\"name\":\"pr_2\",\"type\":{\"name\":\"array\",\"length\":" << m << ",\"element_type\":{\"name\":\"vector\",\"length\":" << k << "}},\"block\":\"parameters\"},{\"name\":\"pr_3\",\"type\":{\"name\":\"array\",\"length\":" << n << ",\"element_type\":{\"name\":\"array\",\"length\":" << m << ",\"element_type\":{\"name\":\"vector\",\"length\":" << k << "}}},\"block\":\"parameters\"},{\"name\":\"pm_1\",\"type\":{\"name\":\"matrix\",\"rows\":" << m << ",\"cols\":" << k << "},\"block\":\"parameters\"},{\"name\":\"pm_2\",\"type\":{\"name\":\"array\",\"length\":" << n << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << m << ",\"cols\":" << k << "}},\"block\":\"parameters\"},{\"name\":\"tp_1\",\"type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_2\",\"type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_3\",\"type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_4\",\"type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_5\",\"type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_6\",\"type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_7\",\"type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_8\",\"type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_9\",\"type\":{\"name\":\"array\",\"length\":" << m << ",\"element_type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_10\",\"type\":{\"name\":\"array\",\"length\":" << n << ",\"element_type\":{\"name\":\"array\",\"length\":" << m << ",\"element_type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}}}},\"block\":\"transformed_parameters\"},{\"name\":\"tpv_1\",\"type\":{\"name\":\"vector\",\"length\":" << k << "},\"block\":\"transformed_parameters\"},{\"name\":\"tpv_2\",\"type\":{\"name\":\"array\",\"length\":" << m << ",\"element_type\":{\"name\":\"vector\",\"length\":" << k << "}},\"block\":\"transformed_parameters\"},{\"name\":\"tpv_3\",\"type\":{\"name\":\"array\",\"length\":" << n << ",\"element_type\":{\"name\":\"array\",\"length\":" << m << ",\"element_type\":{\"name\":\"vector\",\"length\":" << k << "}}},\"block\":\"transformed_parameters\"},{\"name\":\"tpr_1\",\"type\":{\"name\":\"vector\",\"length\":" << k << "},\"block\":\"transformed_parameters\"},{\"name\":\"tpr_2\",\"type\":{\"name\":\"array\",\"length\":" << m << ",\"element_type\":{\"name\":\"vector\",\"length\":" << k << "}},\"block\":\"transformed_parameters\"},{\"name\":\"tpr_3\",\"type\":{\"name\":\"array\",\"length\":" << n << ",\"element_type\":{\"name\":\"array\",\"length\":" << m << ",\"element_type\":{\"name\":\"vector\",\"length\":" << k << "}}},\"block\":\"transformed_parameters\"},{\"name\":\"tpm_1\",\"type\":{\"name\":\"matrix\",\"rows\":" << m << ",\"cols\":" << k << "},\"block\":\"transformed_parameters\"},{\"name\":\"tpm_2\",\"type\":{\"name\":\"array\",\"length\":" << n << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << m << ",\"cols\":" << k << "}},\"block\":\"transformed_parameters\"}]"); } // get_constrained_sizedtypes() - inline std::string get_unconstrained_sizedtypes() const final { + inline std::string get_unconstrained_sizedtypes() const { + + return std::string("[{\"name\":\"p_1\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(k) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"p_2\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(k) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"p_3\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(k) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"p_4\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(k) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"p_5\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(k) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"p_6\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(k) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"p_7\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(k) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"p_8\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(k) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"p_9\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(m) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(k) + ",\"element_type\":{\"name\":\"real\"}}},\"block\":\"parameters\"},{\"name\":\"p_10\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(n) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(m) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(k) + ",\"element_type\":{\"name\":\"real\"}}}},\"block\":\"parameters\"},{\"name\":\"pv_1\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(k) + "},\"block\":\"parameters\"},{\"name\":\"pv_2\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(m) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(k) + "}},\"block\":\"parameters\"},{\"name\":\"pv_3\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(n) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(m) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(k) + "}}},\"block\":\"parameters\"},{\"name\":\"pr_1\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(k) + "},\"block\":\"parameters\"},{\"name\":\"pr_2\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(m) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(k) + "}},\"block\":\"parameters\"},{\"name\":\"pr_3\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(n) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(m) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(k) + "}}},\"block\":\"parameters\"},{\"name\":\"pm_1\",\"type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(m) + ",\"cols\":" + std::to_string(k) + "},\"block\":\"parameters\"},{\"name\":\"pm_2\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(n) + ",\"element_type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(m) + ",\"cols\":" + std::to_string(k) + "}},\"block\":\"parameters\"},{\"name\":\"tp_1\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(k) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_2\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(k) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_3\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(k) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_4\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(k) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_5\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(k) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_6\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(k) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_7\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(k) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_8\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(k) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_9\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(m) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(k) + ",\"element_type\":{\"name\":\"real\"}}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_10\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(n) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(m) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(k) + ",\"element_type\":{\"name\":\"real\"}}}},\"block\":\"transformed_parameters\"},{\"name\":\"tpv_1\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(k) + "},\"block\":\"transformed_parameters\"},{\"name\":\"tpv_2\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(m) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(k) + "}},\"block\":\"transformed_parameters\"},{\"name\":\"tpv_3\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(n) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(m) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(k) + "}}},\"block\":\"transformed_parameters\"},{\"name\":\"tpr_1\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(k) + "},\"block\":\"transformed_parameters\"},{\"name\":\"tpr_2\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(m) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(k) + "}},\"block\":\"transformed_parameters\"},{\"name\":\"tpr_3\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(n) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(m) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(k) + "}}},\"block\":\"transformed_parameters\"},{\"name\":\"tpm_1\",\"type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(m) + ",\"cols\":" + std::to_string(k) + "},\"block\":\"transformed_parameters\"},{\"name\":\"tpm_2\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(n) + ",\"element_type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(m) + ",\"cols\":" + std::to_string(k) + "}},\"block\":\"transformed_parameters\"}]"); - return std::string("[{\"name\":\"p_1\",\"type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"p_2\",\"type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"p_3\",\"type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"p_4\",\"type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"p_5\",\"type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"p_6\",\"type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"p_7\",\"type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"p_8\",\"type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"p_9\",\"type\":{\"name\":\"array\",\"length\":" << m << ",\"element_type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}}},\"block\":\"parameters\"},{\"name\":\"p_10\",\"type\":{\"name\":\"array\",\"length\":" << n << ",\"element_type\":{\"name\":\"array\",\"length\":" << m << ",\"element_type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}}}},\"block\":\"parameters\"},{\"name\":\"pv_1\",\"type\":{\"name\":\"vector\",\"length\":" << k << "},\"block\":\"parameters\"},{\"name\":\"pv_2\",\"type\":{\"name\":\"array\",\"length\":" << m << ",\"element_type\":{\"name\":\"vector\",\"length\":" << k << "}},\"block\":\"parameters\"},{\"name\":\"pv_3\",\"type\":{\"name\":\"array\",\"length\":" << n << ",\"element_type\":{\"name\":\"array\",\"length\":" << m << ",\"element_type\":{\"name\":\"vector\",\"length\":" << k << "}}},\"block\":\"parameters\"},{\"name\":\"pr_1\",\"type\":{\"name\":\"vector\",\"length\":" << k << "},\"block\":\"parameters\"},{\"name\":\"pr_2\",\"type\":{\"name\":\"array\",\"length\":" << m << ",\"element_type\":{\"name\":\"vector\",\"length\":" << k << "}},\"block\":\"parameters\"},{\"name\":\"pr_3\",\"type\":{\"name\":\"array\",\"length\":" << n << ",\"element_type\":{\"name\":\"array\",\"length\":" << m << ",\"element_type\":{\"name\":\"vector\",\"length\":" << k << "}}},\"block\":\"parameters\"},{\"name\":\"pm_1\",\"type\":{\"name\":\"matrix\",\"rows\":" << m << ",\"cols\":" << k << "},\"block\":\"parameters\"},{\"name\":\"pm_2\",\"type\":{\"name\":\"array\",\"length\":" << n << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << m << ",\"cols\":" << k << "}},\"block\":\"parameters\"},{\"name\":\"tp_1\",\"type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_2\",\"type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_3\",\"type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_4\",\"type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_5\",\"type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_6\",\"type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_7\",\"type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_8\",\"type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_9\",\"type\":{\"name\":\"array\",\"length\":" << m << ",\"element_type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}}},\"block\":\"transformed_parameters\"},{\"name\":\"tp_10\",\"type\":{\"name\":\"array\",\"length\":" << n << ",\"element_type\":{\"name\":\"array\",\"length\":" << m << ",\"element_type\":{\"name\":\"array\",\"length\":" << k << ",\"element_type\":{\"name\":\"real\"}}}},\"block\":\"transformed_parameters\"},{\"name\":\"tpv_1\",\"type\":{\"name\":\"vector\",\"length\":" << k << "},\"block\":\"transformed_parameters\"},{\"name\":\"tpv_2\",\"type\":{\"name\":\"array\",\"length\":" << m << ",\"element_type\":{\"name\":\"vector\",\"length\":" << k << "}},\"block\":\"transformed_parameters\"},{\"name\":\"tpv_3\",\"type\":{\"name\":\"array\",\"length\":" << n << ",\"element_type\":{\"name\":\"array\",\"length\":" << m << ",\"element_type\":{\"name\":\"vector\",\"length\":" << k << "}}},\"block\":\"transformed_parameters\"},{\"name\":\"tpr_1\",\"type\":{\"name\":\"vector\",\"length\":" << k << "},\"block\":\"transformed_parameters\"},{\"name\":\"tpr_2\",\"type\":{\"name\":\"array\",\"length\":" << m << ",\"element_type\":{\"name\":\"vector\",\"length\":" << k << "}},\"block\":\"transformed_parameters\"},{\"name\":\"tpr_3\",\"type\":{\"name\":\"array\",\"length\":" << n << ",\"element_type\":{\"name\":\"array\",\"length\":" << m << ",\"element_type\":{\"name\":\"vector\",\"length\":" << k << "}}},\"block\":\"transformed_parameters\"},{\"name\":\"tpm_1\",\"type\":{\"name\":\"matrix\",\"rows\":" << m << ",\"cols\":" << k << "},\"block\":\"transformed_parameters\"},{\"name\":\"tpm_2\",\"type\":{\"name\":\"array\",\"length\":" << n << ",\"element_type\":{\"name\":\"matrix\",\"rows\":" << m << ",\"cols\":" << k << "}},\"block\":\"transformed_parameters\"}]"); } // get_unconstrained_sizedtypes() @@ -29924,14 +31337,13 @@ class transform_model final : public model_base_crtp { const bool emit_transformed_parameters = true, const bool emit_generated_quantities = true, std::ostream* pstream = nullptr) const { - std::vector vars_vec(vars.size()); + std::vector vars_vec; + vars_vec.reserve(vars.size()); std::vector params_i; write_array_impl(base_rng, params_r, params_i, vars_vec, emit_transformed_parameters, emit_generated_quantities, pstream); - vars.resize(vars_vec.size()); - for (int i = 0; i < vars.size(); ++i) { - vars.coeffRef(i) = vars_vec[i]; - } + vars = Eigen::Map>( + vars_vec.data(), vars_vec.size()); } template @@ -29941,7 +31353,8 @@ class transform_model final : public model_base_crtp { bool emit_transformed_parameters = true, bool emit_generated_quantities = true, std::ostream* pstream = nullptr) const { - write_array_impl(base_rng, params_r, params_i, vars, emit_transformed_parameters, emit_generated_quantities, pstream); + write_array_impl(base_rng, params_r, params_i, vars, + emit_transformed_parameters, emit_generated_quantities, pstream); } template @@ -29962,13 +31375,12 @@ class transform_model final : public model_base_crtp { inline void transform_inits(const stan::io::var_context& context, Eigen::Matrix& params_r, std::ostream* pstream = nullptr) const final { - std::vector params_r_vec(params_r.size()); + std::vector params_r_vec; + params_r_vec.reserve(params_r.size()); std::vector params_i; transform_inits_impl(context, params_i, params_r_vec, pstream); - params_r.resize(params_r_vec.size()); - for (int i = 0; i < params_r.size(); ++i) { - params_r.coeffRef(i) = params_r_vec[i]; - } + params_r = Eigen::Map>( + params_r_vec.data(), params_r_vec.size()); } inline void transform_inits(const stan::io::var_context& context, std::vector& params_i, @@ -30075,20 +31487,20 @@ class truncate_model final : public model_base_crtp { (void) DUMMY_VAR__; // suppress unused var warning try { int pos__; - pos__ = std::numeric_limits::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; current_statement__ = 19; context__.validate_dims("data initialization","n","int", - context__.to_vec()); - n = std::numeric_limits::min(); + std::vector{}); + n = std::numeric_limits::min(); current_statement__ = 19; n = context__.vals_i("n")[(1 - 1)]; current_statement__ = 20; context__.validate_dims("data initialization","x","double", - context__.to_vec()); - x = std::numeric_limits::quiet_NaN(); + std::vector{}); + x = std::numeric_limits::quiet_NaN(); current_statement__ = 20; x = context__.vals_r("x")[(1 - 1)]; @@ -30097,16 +31509,8 @@ class truncate_model final : public model_base_crtp { // Next line prevents compiler griping about no return throw std::runtime_error("*** IF YOU SEE THIS, PLEASE REPORT A BUG ***"); } - num_params_r__ = 0U; + num_params_r__ = 1 + 1; - try { - num_params_r__ += 1; - num_params_r__ += 1; - } catch (const std::exception& e) { - stan::lang::rethrow_located(e, locations_array__[current_statement__]); - // Next line prevents compiler griping about no return - throw std::runtime_error("*** IF YOU SEE THIS, PLEASE REPORT A BUG ***"); - } } template { try { local_scalar_t__ m; - m = DUMMY_VAR__; + m = DUMMY_VAR__; current_statement__ = 1; m = in__.template read(); local_scalar_t__ y; - y = DUMMY_VAR__; + y = DUMMY_VAR__; current_statement__ = 2; y = in__.template read_constrain_lb(0, @@ -30253,12 +31657,12 @@ class truncate_model final : public model_base_crtp { try { double m; - m = std::numeric_limits::quiet_NaN(); + m = std::numeric_limits::quiet_NaN(); current_statement__ = 1; m = in__.template read(); double y; - y = std::numeric_limits::quiet_NaN(); + y = std::numeric_limits::quiet_NaN(); current_statement__ = 2; y = in__.template read_constrain_lb(0, @@ -30292,21 +31696,21 @@ class truncate_model final : public model_base_crtp { try { int pos__; - pos__ = std::numeric_limits::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; double m; - m = std::numeric_limits::quiet_NaN(); + m = std::numeric_limits::quiet_NaN(); current_statement__ = 1; m = context__.vals_r("m")[(1 - 1)]; double y; - y = std::numeric_limits::quiet_NaN(); + y = std::numeric_limits::quiet_NaN(); current_statement__ = 2; y = context__.vals_r("y")[(1 - 1)]; double y_free__; - y_free__ = std::numeric_limits::quiet_NaN(); + y_free__ = std::numeric_limits::quiet_NaN(); current_statement__ = 2; y_free__ = stan::math::lb_free(y, 0); @@ -30321,14 +31725,15 @@ class truncate_model final : public model_base_crtp { inline void get_param_names(std::vector& names__) const { - names__ = std::vector{"m", - "y"}; + names__ = std::vector{"m", "y"}; + } // get_param_names() inline void get_dims(std::vector>& dimss__) const { dimss__ = std::vector>{std::vector{}, - std::vector{}}; + std::vector{}}; + } // get_dims() inline void constrained_param_names( @@ -30367,14 +31772,16 @@ class truncate_model final : public model_base_crtp { } // unconstrained_param_names() - inline std::string get_constrained_sizedtypes() const final { + inline std::string get_constrained_sizedtypes() const { return std::string("[{\"name\":\"m\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"y\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"}]"); + } // get_constrained_sizedtypes() - inline std::string get_unconstrained_sizedtypes() const final { + inline std::string get_unconstrained_sizedtypes() const { return std::string("[{\"name\":\"m\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"y\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"}]"); + } // get_unconstrained_sizedtypes() @@ -30386,14 +31793,13 @@ class truncate_model final : public model_base_crtp { const bool emit_transformed_parameters = true, const bool emit_generated_quantities = true, std::ostream* pstream = nullptr) const { - std::vector vars_vec(vars.size()); + std::vector vars_vec; + vars_vec.reserve(vars.size()); std::vector params_i; write_array_impl(base_rng, params_r, params_i, vars_vec, emit_transformed_parameters, emit_generated_quantities, pstream); - vars.resize(vars_vec.size()); - for (int i = 0; i < vars.size(); ++i) { - vars.coeffRef(i) = vars_vec[i]; - } + vars = Eigen::Map>( + vars_vec.data(), vars_vec.size()); } template @@ -30403,7 +31809,8 @@ class truncate_model final : public model_base_crtp { bool emit_transformed_parameters = true, bool emit_generated_quantities = true, std::ostream* pstream = nullptr) const { - write_array_impl(base_rng, params_r, params_i, vars, emit_transformed_parameters, emit_generated_quantities, pstream); + write_array_impl(base_rng, params_r, params_i, vars, + emit_transformed_parameters, emit_generated_quantities, pstream); } template @@ -30424,13 +31831,12 @@ class truncate_model final : public model_base_crtp { inline void transform_inits(const stan::io::var_context& context, Eigen::Matrix& params_r, std::ostream* pstream = nullptr) const final { - std::vector params_r_vec(params_r.size()); + std::vector params_r_vec; + params_r_vec.reserve(params_r.size()); std::vector params_i; transform_inits_impl(context, params_i, params_r_vec, pstream); - params_r.resize(params_r_vec.size()); - for (int i = 0; i < params_r.size(); ++i) { - params_r.coeffRef(i) = params_r_vec[i]; - } + params_r = Eigen::Map>( + params_r_vec.data(), params_r_vec.size()); } inline void transform_inits(const stan::io::var_context& context, std::vector& params_i, @@ -30548,7 +31954,7 @@ class udf_tilde_stmt_conflict_model final : public model_base_crtp::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; } catch (const std::exception& e) { @@ -30556,15 +31962,8 @@ class udf_tilde_stmt_conflict_model final : public model_base_crtp(); @@ -30627,7 +32026,7 @@ class udf_tilde_stmt_conflict_model final : public model_base_crtp::quiet_NaN(); + x = std::numeric_limits::quiet_NaN(); current_statement__ = 1; x = in__.template read(); @@ -30659,11 +32058,11 @@ class udf_tilde_stmt_conflict_model final : public model_base_crtp::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; double x; - x = std::numeric_limits::quiet_NaN(); + x = std::numeric_limits::quiet_NaN(); current_statement__ = 1; x = context__.vals_r("x")[(1 - 1)]; @@ -30678,11 +32077,13 @@ class udf_tilde_stmt_conflict_model final : public model_base_crtp& names__) const { names__ = std::vector{"x"}; + } // get_param_names() inline void get_dims(std::vector>& dimss__) const { dimss__ = std::vector>{std::vector{}}; + } // get_dims() inline void constrained_param_names( @@ -30719,14 +32120,16 @@ class udf_tilde_stmt_conflict_model final : public model_base_crtp vars_vec(vars.size()); + std::vector vars_vec; + vars_vec.reserve(vars.size()); std::vector params_i; write_array_impl(base_rng, params_r, params_i, vars_vec, emit_transformed_parameters, emit_generated_quantities, pstream); - vars.resize(vars_vec.size()); - for (int i = 0; i < vars.size(); ++i) { - vars.coeffRef(i) = vars_vec[i]; - } + vars = Eigen::Map>( + vars_vec.data(), vars_vec.size()); } template @@ -30755,7 +32157,8 @@ class udf_tilde_stmt_conflict_model final : public model_base_crtp @@ -30776,13 +32179,12 @@ class udf_tilde_stmt_conflict_model final : public model_base_crtp& params_r, std::ostream* pstream = nullptr) const final { - std::vector params_r_vec(params_r.size()); + std::vector params_r_vec; + params_r_vec.reserve(params_r.size()); std::vector params_i; transform_inits_impl(context, params_i, params_r_vec, pstream); - params_r.resize(params_r_vec.size()); - for (int i = 0; i < params_r.size(); ++i) { - params_r.coeffRef(i) = params_r_vec[i]; - } + params_r = Eigen::Map>( + params_r_vec.data(), params_r_vec.size()); } inline void transform_inits(const stan::io::var_context& context, std::vector& params_i, @@ -30903,7 +32305,7 @@ class user_constrain_model final : public model_base_crtp (void) DUMMY_VAR__; // suppress unused var warning try { int pos__; - pos__ = std::numeric_limits::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; } catch (const std::exception& e) { @@ -30911,15 +32313,8 @@ class user_constrain_model final : public model_base_crtp // Next line prevents compiler griping about no return throw std::runtime_error("*** IF YOU SEE THIS, PLEASE REPORT A BUG ***"); } - num_params_r__ = 0U; + num_params_r__ = 1; - try { - num_params_r__ += 1; - } catch (const std::exception& e) { - stan::lang::rethrow_located(e, locations_array__[current_statement__]); - // Next line prevents compiler griping about no return - throw std::runtime_error("*** IF YOU SEE THIS, PLEASE REPORT A BUG ***"); - } } template try { local_scalar_t__ x; - x = DUMMY_VAR__; + x = DUMMY_VAR__; current_statement__ = 1; x = in__.template read_constrain_lb(0, @@ -30983,7 +32378,7 @@ class user_constrain_model final : public model_base_crtp try { double x; - x = std::numeric_limits::quiet_NaN(); + x = std::numeric_limits::quiet_NaN(); current_statement__ = 1; x = in__.template read_constrain_lb(0, @@ -31016,16 +32411,16 @@ class user_constrain_model final : public model_base_crtp try { int pos__; - pos__ = std::numeric_limits::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; double x; - x = std::numeric_limits::quiet_NaN(); + x = std::numeric_limits::quiet_NaN(); current_statement__ = 1; x = context__.vals_r("x")[(1 - 1)]; double x_free__; - x_free__ = std::numeric_limits::quiet_NaN(); + x_free__ = std::numeric_limits::quiet_NaN(); current_statement__ = 1; x_free__ = stan::math::lb_free(x, 0); @@ -31040,11 +32435,13 @@ class user_constrain_model final : public model_base_crtp inline void get_param_names(std::vector& names__) const { names__ = std::vector{"x"}; + } // get_param_names() inline void get_dims(std::vector>& dimss__) const { dimss__ = std::vector>{std::vector{}}; + } // get_dims() inline void constrained_param_names( @@ -31081,14 +32478,16 @@ class user_constrain_model final : public model_base_crtp } // unconstrained_param_names() - inline std::string get_constrained_sizedtypes() const final { + inline std::string get_constrained_sizedtypes() const { return std::string("[{\"name\":\"x\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"}]"); + } // get_constrained_sizedtypes() - inline std::string get_unconstrained_sizedtypes() const final { + inline std::string get_unconstrained_sizedtypes() const { return std::string("[{\"name\":\"x\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"}]"); + } // get_unconstrained_sizedtypes() @@ -31100,14 +32499,13 @@ class user_constrain_model final : public model_base_crtp const bool emit_transformed_parameters = true, const bool emit_generated_quantities = true, std::ostream* pstream = nullptr) const { - std::vector vars_vec(vars.size()); + std::vector vars_vec; + vars_vec.reserve(vars.size()); std::vector params_i; write_array_impl(base_rng, params_r, params_i, vars_vec, emit_transformed_parameters, emit_generated_quantities, pstream); - vars.resize(vars_vec.size()); - for (int i = 0; i < vars.size(); ++i) { - vars.coeffRef(i) = vars_vec[i]; - } + vars = Eigen::Map>( + vars_vec.data(), vars_vec.size()); } template @@ -31117,7 +32515,8 @@ class user_constrain_model final : public model_base_crtp bool emit_transformed_parameters = true, bool emit_generated_quantities = true, std::ostream* pstream = nullptr) const { - write_array_impl(base_rng, params_r, params_i, vars, emit_transformed_parameters, emit_generated_quantities, pstream); + write_array_impl(base_rng, params_r, params_i, vars, + emit_transformed_parameters, emit_generated_quantities, pstream); } template @@ -31138,13 +32537,12 @@ class user_constrain_model final : public model_base_crtp inline void transform_inits(const stan::io::var_context& context, Eigen::Matrix& params_r, std::ostream* pstream = nullptr) const final { - std::vector params_r_vec(params_r.size()); + std::vector params_r_vec; + params_r_vec.reserve(params_r.size()); std::vector params_i; transform_inits_impl(context, params_i, params_r_vec, pstream); - params_r.resize(params_r_vec.size()); - for (int i = 0; i < params_r.size(); ++i) { - params_r.coeffRef(i) = params_r_vec[i]; - } + params_r = Eigen::Map>( + params_r_vec.data(), params_r_vec.size()); } inline void transform_inits(const stan::io::var_context& context, std::vector& params_i, diff --git a/test/integration/good/code-gen/expressions/cpp.expected b/test/integration/good/code-gen/expressions/cpp.expected index bfd0cee2db..5f547ade2e 100644 --- a/test/integration/good/code-gen/expressions/cpp.expected +++ b/test/integration/good/code-gen/expressions/cpp.expected @@ -180,13 +180,13 @@ class simple_function_model final : public model_base_crtp::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; current_statement__ = 1; context__.validate_dims("data initialization","N","int", - context__.to_vec()); - N = std::numeric_limits::min(); + std::vector{}); + N = std::numeric_limits::min(); current_statement__ = 1; N = context__.vals_i("N")[(1 - 1)]; @@ -196,9 +196,10 @@ class simple_function_model final : public model_base_crtp{static_cast(N), + static_cast(N)}); m = Eigen::Matrix(N, N); - stan::math::fill(m, std::numeric_limits::quiet_NaN()); + stan::math::fill(m, std::numeric_limits::quiet_NaN()); { std::vector m_flat__; @@ -214,7 +215,9 @@ class simple_function_model final : public model_base_crtp::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; } catch (const std::exception& e) { @@ -323,11 +319,13 @@ class simple_function_model final : public model_base_crtp& names__) const { names__ = std::vector{}; + } // get_param_names() inline void get_dims(std::vector>& dimss__) const { dimss__ = std::vector>{}; + } // get_dims() inline void constrained_param_names( @@ -364,14 +362,16 @@ class simple_function_model final : public model_base_crtp vars_vec(vars.size()); + std::vector vars_vec; + vars_vec.reserve(vars.size()); std::vector params_i; write_array_impl(base_rng, params_r, params_i, vars_vec, emit_transformed_parameters, emit_generated_quantities, pstream); - vars.resize(vars_vec.size()); - for (int i = 0; i < vars.size(); ++i) { - vars.coeffRef(i) = vars_vec[i]; - } + vars = Eigen::Map>( + vars_vec.data(), vars_vec.size()); } template @@ -400,7 +399,8 @@ class simple_function_model final : public model_base_crtp @@ -421,13 +421,12 @@ class simple_function_model final : public model_base_crtp& params_r, std::ostream* pstream = nullptr) const final { - std::vector params_r_vec(params_r.size()); + std::vector params_r_vec; + params_r_vec.reserve(params_r.size()); std::vector params_i; transform_inits_impl(context, params_i, params_r_vec, pstream); - params_r.resize(params_r_vec.size()); - for (int i = 0; i < params_r.size(); ++i) { - params_r.coeffRef(i) = params_r_vec[i]; - } + params_r = Eigen::Map>( + params_r_vec.data(), params_r_vec.size()); } inline void transform_inits(const stan::io::var_context& context, std::vector& params_i, diff --git a/test/integration/good/code-gen/opencl/cpp.expected b/test/integration/good/code-gen/opencl/cpp.expected index 1cab04ec66..8887e97c96 100644 --- a/test/integration/good/code-gen/opencl/cpp.expected +++ b/test/integration/good/code-gen/opencl/cpp.expected @@ -831,13 +831,13 @@ class distributions_model final : public model_base_crtp { (void) DUMMY_VAR__; // suppress unused var warning try { int pos__; - pos__ = std::numeric_limits::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; current_statement__ = 756; context__.validate_dims("data initialization","d_int","int", - context__.to_vec()); - d_int = std::numeric_limits::min(); + std::vector{}); + d_int = std::numeric_limits::min(); current_statement__ = 756; d_int = context__.vals_i("d_int")[(1 - 1)]; @@ -845,15 +845,16 @@ class distributions_model final : public model_base_crtp { validate_non_negative_index("d_int_array", "d_int", d_int); current_statement__ = 758; context__.validate_dims("data initialization","d_int_array","int", - context__.to_vec(d_int)); + std::vector{static_cast(d_int)}); d_int_array = std::vector(d_int, std::numeric_limits::min()); + current_statement__ = 758; d_int_array = context__.vals_i("d_int_array"); current_statement__ = 759; context__.validate_dims("data initialization","d_real","double", - context__.to_vec()); - d_real = std::numeric_limits::quiet_NaN(); + std::vector{}); + d_real = std::numeric_limits::quiet_NaN(); current_statement__ = 759; d_real = context__.vals_r("d_real")[(1 - 1)]; @@ -861,8 +862,9 @@ class distributions_model final : public model_base_crtp { validate_non_negative_index("d_real_array", "d_int", d_int); current_statement__ = 761; context__.validate_dims("data initialization","d_real_array","double", - context__.to_vec(d_int)); + std::vector{static_cast(d_int)}); d_real_array = std::vector(d_int, std::numeric_limits::quiet_NaN()); + current_statement__ = 761; d_real_array = context__.vals_r("d_real_array"); @@ -870,9 +872,9 @@ class distributions_model final : public model_base_crtp { validate_non_negative_index("d_vector", "d_int", d_int); current_statement__ = 763; context__.validate_dims("data initialization","d_vector","double", - context__.to_vec(d_int)); + std::vector{static_cast(d_int)}); d_vector = Eigen::Matrix(d_int); - stan::math::fill(d_vector, std::numeric_limits::quiet_NaN()); + stan::math::fill(d_vector, std::numeric_limits::quiet_NaN()); { std::vector d_vector_flat__; @@ -886,15 +888,16 @@ class distributions_model final : public model_base_crtp { assign(d_vector, d_vector_flat__[(pos__ - 1)], "assigning variable d_vector", index_uni(sym1__)); current_statement__ = 763; - pos__ = (pos__ + 1);} + pos__ = (pos__ + 1); + } } current_statement__ = 764; validate_non_negative_index("d_row_vector", "d_int", d_int); current_statement__ = 765; context__.validate_dims("data initialization","d_row_vector","double", - context__.to_vec(d_int)); + std::vector{static_cast(d_int)}); d_row_vector = Eigen::Matrix(d_int); - stan::math::fill(d_row_vector, std::numeric_limits::quiet_NaN()); + stan::math::fill(d_row_vector, std::numeric_limits::quiet_NaN()); { std::vector d_row_vector_flat__; @@ -908,7 +911,8 @@ class distributions_model final : public model_base_crtp { assign(d_row_vector, d_row_vector_flat__[(pos__ - 1)], "assigning variable d_row_vector", index_uni(sym1__)); current_statement__ = 765; - pos__ = (pos__ + 1);} + pos__ = (pos__ + 1); + } } current_statement__ = 766; validate_non_negative_index("p_real_array", "d_int", d_int); @@ -933,20 +937,8 @@ class distributions_model final : public model_base_crtp { // Next line prevents compiler griping about no return throw std::runtime_error("*** IF YOU SEE THIS, PLEASE REPORT A BUG ***"); } - num_params_r__ = 0U; + num_params_r__ = 1 + d_int + (d_int * d_int) + d_int + d_int + 1; - try { - num_params_r__ += 1; - num_params_r__ += d_int; - num_params_r__ += d_int * d_int; - num_params_r__ += d_int; - num_params_r__ += d_int; - num_params_r__ += 1; - } catch (const std::exception& e) { - stan::lang::rethrow_located(e, locations_array__[current_statement__]); - // Next line prevents compiler griping about no return - throw std::runtime_error("*** IF YOU SEE THIS, PLEASE REPORT A BUG ***"); - } } template { try { local_scalar_t__ p_real; - p_real = DUMMY_VAR__; + p_real = DUMMY_VAR__; current_statement__ = 1; p_real = in__.template read(); std::vector p_real_array; - p_real_array = std::vector(d_int, DUMMY_VAR__); + p_real_array = std::vector(d_int, DUMMY_VAR__); current_statement__ = 2; p_real_array = in__.template read>(d_int); Eigen::Matrix p_matrix; p_matrix = Eigen::Matrix(d_int, d_int); - stan::math::fill(p_matrix, DUMMY_VAR__); + stan::math::fill(p_matrix, DUMMY_VAR__); current_statement__ = 3; p_matrix = in__.template read>( d_int, d_int); Eigen::Matrix p_vector; p_vector = Eigen::Matrix(d_int); - stan::math::fill(p_vector, DUMMY_VAR__); + stan::math::fill(p_vector, DUMMY_VAR__); current_statement__ = 4; p_vector = in__.template read>( d_int); Eigen::Matrix p_row_vector; p_row_vector = Eigen::Matrix(d_int); - stan::math::fill(p_row_vector, DUMMY_VAR__); + stan::math::fill(p_row_vector, DUMMY_VAR__); current_statement__ = 5; p_row_vector = in__.template read>( d_int); local_scalar_t__ y_p; - y_p = DUMMY_VAR__; + y_p = DUMMY_VAR__; current_statement__ = 6; y_p = in__.template read(); local_scalar_t__ transformed_param_real; - transformed_param_real = DUMMY_VAR__; + transformed_param_real = DUMMY_VAR__; current_statement__ = 8; transformed_param_real = bernoulli_logit_lpmf(d_int, d_int); @@ -3512,56 +3504,62 @@ class distributions_model final : public model_base_crtp { try { double p_real; - p_real = std::numeric_limits::quiet_NaN(); + p_real = std::numeric_limits::quiet_NaN(); current_statement__ = 1; p_real = in__.template read(); std::vector p_real_array; p_real_array = std::vector(d_int, std::numeric_limits::quiet_NaN()); + current_statement__ = 2; p_real_array = in__.template read>(d_int); Eigen::Matrix p_matrix; p_matrix = Eigen::Matrix(d_int, d_int); - stan::math::fill(p_matrix, std::numeric_limits::quiet_NaN()); + stan::math::fill(p_matrix, std::numeric_limits::quiet_NaN()); current_statement__ = 3; p_matrix = in__.template read>( d_int, d_int); Eigen::Matrix p_vector; p_vector = Eigen::Matrix(d_int); - stan::math::fill(p_vector, std::numeric_limits::quiet_NaN()); + stan::math::fill(p_vector, std::numeric_limits::quiet_NaN()); current_statement__ = 4; p_vector = in__.template read>( d_int); Eigen::Matrix p_row_vector; p_row_vector = Eigen::Matrix(d_int); - stan::math::fill(p_row_vector, std::numeric_limits::quiet_NaN()); + stan::math::fill(p_row_vector, std::numeric_limits::quiet_NaN()); current_statement__ = 5; p_row_vector = in__.template read>( d_int); double y_p; - y_p = std::numeric_limits::quiet_NaN(); + y_p = std::numeric_limits::quiet_NaN(); current_statement__ = 6; y_p = in__.template read(); double transformed_param_real; - transformed_param_real = std::numeric_limits::quiet_NaN(); + transformed_param_real = std::numeric_limits::quiet_NaN(); vars__.emplace_back(p_real); for (int sym1__ = 1; sym1__ <= d_int; ++sym1__) { - vars__.emplace_back(p_real_array[(sym1__ - 1)]);} + vars__.emplace_back(p_real_array[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= d_int; ++sym1__) { for (int sym2__ = 1; sym2__ <= d_int; ++sym2__) { vars__.emplace_back( rvalue(p_matrix, "p_matrix", - index_uni(sym2__), index_uni(sym1__)));}} + index_uni(sym2__), index_uni(sym1__))); + } + } for (int sym1__ = 1; sym1__ <= d_int; ++sym1__) { - vars__.emplace_back(p_vector[(sym1__ - 1)]);} + vars__.emplace_back(p_vector[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= d_int; ++sym1__) { - vars__.emplace_back(p_row_vector[(sym1__ - 1)]);} + vars__.emplace_back(p_row_vector[(sym1__ - 1)]); + } vars__.emplace_back(y_p); if (logical_negation((primitive_value(emit_transformed_parameters__) || primitive_value(emit_generated_quantities__)))) { @@ -6062,22 +6060,23 @@ class distributions_model final : public model_base_crtp { try { int pos__; - pos__ = std::numeric_limits::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; double p_real; - p_real = std::numeric_limits::quiet_NaN(); + p_real = std::numeric_limits::quiet_NaN(); current_statement__ = 1; p_real = context__.vals_r("p_real")[(1 - 1)]; std::vector p_real_array; p_real_array = std::vector(d_int, std::numeric_limits::quiet_NaN()); + current_statement__ = 2; p_real_array = context__.vals_r("p_real_array"); Eigen::Matrix p_matrix; p_matrix = Eigen::Matrix(d_int, d_int); - stan::math::fill(p_matrix, std::numeric_limits::quiet_NaN()); + stan::math::fill(p_matrix, std::numeric_limits::quiet_NaN()); { std::vector p_matrix_flat__; @@ -6094,11 +6093,13 @@ class distributions_model final : public model_base_crtp { "assigning variable p_matrix", index_uni(sym2__), index_uni(sym1__)); current_statement__ = 3; - pos__ = (pos__ + 1);}} + pos__ = (pos__ + 1); + } + } } Eigen::Matrix p_vector; p_vector = Eigen::Matrix(d_int); - stan::math::fill(p_vector, std::numeric_limits::quiet_NaN()); + stan::math::fill(p_vector, std::numeric_limits::quiet_NaN()); { std::vector p_vector_flat__; @@ -6112,11 +6113,12 @@ class distributions_model final : public model_base_crtp { assign(p_vector, p_vector_flat__[(pos__ - 1)], "assigning variable p_vector", index_uni(sym1__)); current_statement__ = 4; - pos__ = (pos__ + 1);} + pos__ = (pos__ + 1); + } } Eigen::Matrix p_row_vector; p_row_vector = Eigen::Matrix(d_int); - stan::math::fill(p_row_vector, std::numeric_limits::quiet_NaN()); + stan::math::fill(p_row_vector, std::numeric_limits::quiet_NaN()); { std::vector p_row_vector_flat__; @@ -6130,25 +6132,31 @@ class distributions_model final : public model_base_crtp { assign(p_row_vector, p_row_vector_flat__[(pos__ - 1)], "assigning variable p_row_vector", index_uni(sym1__)); current_statement__ = 5; - pos__ = (pos__ + 1);} + pos__ = (pos__ + 1); + } } double y_p; - y_p = std::numeric_limits::quiet_NaN(); + y_p = std::numeric_limits::quiet_NaN(); current_statement__ = 6; y_p = context__.vals_r("y_p")[(1 - 1)]; vars__.emplace_back(p_real); for (int sym1__ = 1; sym1__ <= d_int; ++sym1__) { - vars__.emplace_back(p_real_array[(sym1__ - 1)]);} + vars__.emplace_back(p_real_array[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= d_int; ++sym1__) { for (int sym2__ = 1; sym2__ <= d_int; ++sym2__) { vars__.emplace_back( rvalue(p_matrix, "p_matrix", - index_uni(sym2__), index_uni(sym1__)));}} + index_uni(sym2__), index_uni(sym1__))); + } + } for (int sym1__ = 1; sym1__ <= d_int; ++sym1__) { - vars__.emplace_back(p_vector[(sym1__ - 1)]);} + vars__.emplace_back(p_vector[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= d_int; ++sym1__) { - vars__.emplace_back(p_row_vector[(sym1__ - 1)]);} + vars__.emplace_back(p_row_vector[(sym1__ - 1)]); + } vars__.emplace_back(y_p); } catch (const std::exception& e) { stan::lang::rethrow_located(e, locations_array__[current_statement__]); @@ -6159,25 +6167,21 @@ class distributions_model final : public model_base_crtp { inline void get_param_names(std::vector& names__) const { - names__ = std::vector{"p_real", - "p_real_array", - "p_matrix", - "p_vector", - "p_row_vector", - "y_p", - "transformed_param_real"}; + names__ = std::vector{"p_real", "p_real_array", "p_matrix", + "p_vector", "p_row_vector", "y_p", "transformed_param_real"}; + } // get_param_names() inline void get_dims(std::vector>& dimss__) const { dimss__ = std::vector>{std::vector{}, - std::vector{static_cast(d_int)}, - std::vector{static_cast(d_int), - static_cast(d_int)}, - std::vector{static_cast(d_int)}, - std::vector{static_cast(d_int)}, - std::vector{}, - std::vector{}}; + std::vector{static_cast(d_int)}, + std::vector{static_cast(d_int), + static_cast(d_int)}, + std::vector{static_cast(d_int)}, + std::vector{static_cast(d_int)}, std::vector{ + }, std::vector{}}; + } // get_dims() inline void constrained_param_names( @@ -6190,22 +6194,27 @@ class distributions_model final : public model_base_crtp { for (int sym1__ = 1; sym1__ <= d_int; ++sym1__) { { param_names__.emplace_back(std::string() + "p_real_array" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= d_int; ++sym1__) { { for (int sym2__ = 1; sym2__ <= d_int; ++sym2__) { { param_names__.emplace_back(std::string() + "p_matrix" + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} + } + } + } + } for (int sym1__ = 1; sym1__ <= d_int; ++sym1__) { { param_names__.emplace_back(std::string() + "p_vector" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= d_int; ++sym1__) { { param_names__.emplace_back(std::string() + "p_row_vector" + '.' + std::to_string(sym1__)); - }} + } + } param_names__.emplace_back(std::string() + "y_p"); if (emit_transformed_parameters__) { param_names__.emplace_back(std::string() + "transformed_param_real"); @@ -6227,22 +6236,27 @@ class distributions_model final : public model_base_crtp { for (int sym1__ = 1; sym1__ <= d_int; ++sym1__) { { param_names__.emplace_back(std::string() + "p_real_array" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= d_int; ++sym1__) { { for (int sym2__ = 1; sym2__ <= d_int; ++sym2__) { { param_names__.emplace_back(std::string() + "p_matrix" + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} + } + } + } + } for (int sym1__ = 1; sym1__ <= d_int; ++sym1__) { { param_names__.emplace_back(std::string() + "p_vector" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= d_int; ++sym1__) { { param_names__.emplace_back(std::string() + "p_row_vector" + '.' + std::to_string(sym1__)); - }} + } + } param_names__.emplace_back(std::string() + "y_p"); if (emit_transformed_parameters__) { param_names__.emplace_back(std::string() + "transformed_param_real"); @@ -6254,14 +6268,16 @@ class distributions_model final : public model_base_crtp { } // unconstrained_param_names() - inline std::string get_constrained_sizedtypes() const final { + inline std::string get_constrained_sizedtypes() const { + + return std::string("[{\"name\":\"p_real\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"p_real_array\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(d_int) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"p_matrix\",\"type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(d_int) + ",\"cols\":" + std::to_string(d_int) + "},\"block\":\"parameters\"},{\"name\":\"p_vector\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(d_int) + "},\"block\":\"parameters\"},{\"name\":\"p_row_vector\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(d_int) + "},\"block\":\"parameters\"},{\"name\":\"y_p\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"transformed_param_real\",\"type\":{\"name\":\"real\"},\"block\":\"transformed_parameters\"}]"); - return std::string("[{\"name\":\"p_real\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"p_real_array\",\"type\":{\"name\":\"array\",\"length\":" << d_int << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"p_matrix\",\"type\":{\"name\":\"matrix\",\"rows\":" << d_int << ",\"cols\":" << d_int << "},\"block\":\"parameters\"},{\"name\":\"p_vector\",\"type\":{\"name\":\"vector\",\"length\":" << d_int << "},\"block\":\"parameters\"},{\"name\":\"p_row_vector\",\"type\":{\"name\":\"vector\",\"length\":" << d_int << "},\"block\":\"parameters\"},{\"name\":\"y_p\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"transformed_param_real\",\"type\":{\"name\":\"real\"},\"block\":\"transformed_parameters\"}]"); } // get_constrained_sizedtypes() - inline std::string get_unconstrained_sizedtypes() const final { + inline std::string get_unconstrained_sizedtypes() const { + + return std::string("[{\"name\":\"p_real\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"p_real_array\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(d_int) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"p_matrix\",\"type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(d_int) + ",\"cols\":" + std::to_string(d_int) + "},\"block\":\"parameters\"},{\"name\":\"p_vector\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(d_int) + "},\"block\":\"parameters\"},{\"name\":\"p_row_vector\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(d_int) + "},\"block\":\"parameters\"},{\"name\":\"y_p\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"transformed_param_real\",\"type\":{\"name\":\"real\"},\"block\":\"transformed_parameters\"}]"); - return std::string("[{\"name\":\"p_real\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"p_real_array\",\"type\":{\"name\":\"array\",\"length\":" << d_int << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"p_matrix\",\"type\":{\"name\":\"matrix\",\"rows\":" << d_int << ",\"cols\":" << d_int << "},\"block\":\"parameters\"},{\"name\":\"p_vector\",\"type\":{\"name\":\"vector\",\"length\":" << d_int << "},\"block\":\"parameters\"},{\"name\":\"p_row_vector\",\"type\":{\"name\":\"vector\",\"length\":" << d_int << "},\"block\":\"parameters\"},{\"name\":\"y_p\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"transformed_param_real\",\"type\":{\"name\":\"real\"},\"block\":\"transformed_parameters\"}]"); } // get_unconstrained_sizedtypes() @@ -6273,14 +6289,13 @@ class distributions_model final : public model_base_crtp { const bool emit_transformed_parameters = true, const bool emit_generated_quantities = true, std::ostream* pstream = nullptr) const { - std::vector vars_vec(vars.size()); + std::vector vars_vec; + vars_vec.reserve(vars.size()); std::vector params_i; write_array_impl(base_rng, params_r, params_i, vars_vec, emit_transformed_parameters, emit_generated_quantities, pstream); - vars.resize(vars_vec.size()); - for (int i = 0; i < vars.size(); ++i) { - vars.coeffRef(i) = vars_vec[i]; - } + vars = Eigen::Map>( + vars_vec.data(), vars_vec.size()); } template @@ -6290,7 +6305,8 @@ class distributions_model final : public model_base_crtp { bool emit_transformed_parameters = true, bool emit_generated_quantities = true, std::ostream* pstream = nullptr) const { - write_array_impl(base_rng, params_r, params_i, vars, emit_transformed_parameters, emit_generated_quantities, pstream); + write_array_impl(base_rng, params_r, params_i, vars, + emit_transformed_parameters, emit_generated_quantities, pstream); } template @@ -6311,13 +6327,12 @@ class distributions_model final : public model_base_crtp { inline void transform_inits(const stan::io::var_context& context, Eigen::Matrix& params_r, std::ostream* pstream = nullptr) const final { - std::vector params_r_vec(params_r.size()); + std::vector params_r_vec; + params_r_vec.reserve(params_r.size()); std::vector params_i; transform_inits_impl(context, params_i, params_r_vec, pstream); - params_r.resize(params_r_vec.size()); - for (int i = 0; i < params_r.size(); ++i) { - params_r.coeffRef(i) = params_r_vec[i]; - } + params_r = Eigen::Map>( + params_r_vec.data(), params_r_vec.size()); } inline void transform_inits(const stan::io::var_context& context, std::vector& params_i, @@ -6448,13 +6463,13 @@ class restricted_model final : public model_base_crtp { (void) DUMMY_VAR__; // suppress unused var warning try { int pos__; - pos__ = std::numeric_limits::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; current_statement__ = 25; context__.validate_dims("data initialization","d_int","int", - context__.to_vec()); - d_int = std::numeric_limits::min(); + std::vector{}); + d_int = std::numeric_limits::min(); current_statement__ = 25; d_int = context__.vals_i("d_int")[(1 - 1)]; @@ -6462,15 +6477,16 @@ class restricted_model final : public model_base_crtp { validate_non_negative_index("d_int_array", "d_int", d_int); current_statement__ = 27; context__.validate_dims("data initialization","d_int_array","int", - context__.to_vec(d_int)); + std::vector{static_cast(d_int)}); d_int_array = std::vector(d_int, std::numeric_limits::min()); + current_statement__ = 27; d_int_array = context__.vals_i("d_int_array"); current_statement__ = 28; context__.validate_dims("data initialization","d_real","double", - context__.to_vec()); - d_real = std::numeric_limits::quiet_NaN(); + std::vector{}); + d_real = std::numeric_limits::quiet_NaN(); current_statement__ = 28; d_real = context__.vals_r("d_real")[(1 - 1)]; @@ -6478,8 +6494,9 @@ class restricted_model final : public model_base_crtp { validate_non_negative_index("d_real_array", "d_int", d_int); current_statement__ = 30; context__.validate_dims("data initialization","d_real_array","double", - context__.to_vec(d_int)); + std::vector{static_cast(d_int)}); d_real_array = std::vector(d_int, std::numeric_limits::quiet_NaN()); + current_statement__ = 30; d_real_array = context__.vals_r("d_real_array"); @@ -6487,9 +6504,9 @@ class restricted_model final : public model_base_crtp { validate_non_negative_index("d_vector", "d_int", d_int); current_statement__ = 32; context__.validate_dims("data initialization","d_vector","double", - context__.to_vec(d_int)); + std::vector{static_cast(d_int)}); d_vector = Eigen::Matrix(d_int); - stan::math::fill(d_vector, std::numeric_limits::quiet_NaN()); + stan::math::fill(d_vector, std::numeric_limits::quiet_NaN()); { std::vector d_vector_flat__; @@ -6503,15 +6520,16 @@ class restricted_model final : public model_base_crtp { assign(d_vector, d_vector_flat__[(pos__ - 1)], "assigning variable d_vector", index_uni(sym1__)); current_statement__ = 32; - pos__ = (pos__ + 1);} + pos__ = (pos__ + 1); + } } current_statement__ = 33; validate_non_negative_index("d_row_vector", "d_int", d_int); current_statement__ = 34; context__.validate_dims("data initialization","d_row_vector","double", - context__.to_vec(d_int)); + std::vector{static_cast(d_int)}); d_row_vector = Eigen::Matrix(d_int); - stan::math::fill(d_row_vector, std::numeric_limits::quiet_NaN()); + stan::math::fill(d_row_vector, std::numeric_limits::quiet_NaN()); { std::vector d_row_vector_flat__; @@ -6525,7 +6543,8 @@ class restricted_model final : public model_base_crtp { assign(d_row_vector, d_row_vector_flat__[(pos__ - 1)], "assigning variable d_row_vector", index_uni(sym1__)); current_statement__ = 34; - pos__ = (pos__ + 1);} + pos__ = (pos__ + 1); + } } current_statement__ = 35; validate_non_negative_index("p_real_array", "d_int", d_int); @@ -6544,20 +6563,8 @@ class restricted_model final : public model_base_crtp { // Next line prevents compiler griping about no return throw std::runtime_error("*** IF YOU SEE THIS, PLEASE REPORT A BUG ***"); } - num_params_r__ = 0U; + num_params_r__ = 1 + d_int + (d_int * d_int) + d_int + d_int + 1; - try { - num_params_r__ += 1; - num_params_r__ += d_int; - num_params_r__ += d_int * d_int; - num_params_r__ += d_int; - num_params_r__ += d_int; - num_params_r__ += 1; - } catch (const std::exception& e) { - stan::lang::rethrow_located(e, locations_array__[current_statement__]); - // Next line prevents compiler griping about no return - throw std::runtime_error("*** IF YOU SEE THIS, PLEASE REPORT A BUG ***"); - } } template { try { local_scalar_t__ p_real; - p_real = DUMMY_VAR__; + p_real = DUMMY_VAR__; current_statement__ = 1; p_real = in__.template read(); std::vector p_real_array; - p_real_array = std::vector(d_int, DUMMY_VAR__); + p_real_array = std::vector(d_int, DUMMY_VAR__); current_statement__ = 2; p_real_array = in__.template read>(d_int); Eigen::Matrix p_matrix; p_matrix = Eigen::Matrix(d_int, d_int); - stan::math::fill(p_matrix, DUMMY_VAR__); + stan::math::fill(p_matrix, DUMMY_VAR__); current_statement__ = 3; p_matrix = in__.template read>( d_int, d_int); Eigen::Matrix p_vector; p_vector = Eigen::Matrix(d_int); - stan::math::fill(p_vector, DUMMY_VAR__); + stan::math::fill(p_vector, DUMMY_VAR__); current_statement__ = 4; p_vector = in__.template read>( d_int); Eigen::Matrix p_row_vector; p_row_vector = Eigen::Matrix(d_int); - stan::math::fill(p_row_vector, DUMMY_VAR__); + stan::math::fill(p_row_vector, DUMMY_VAR__); current_statement__ = 5; p_row_vector = in__.template read>( d_int); local_scalar_t__ y_p; - y_p = DUMMY_VAR__; + y_p = DUMMY_VAR__; current_statement__ = 6; y_p = in__.template read(); local_scalar_t__ transformed_param_real; - transformed_param_real = DUMMY_VAR__; + transformed_param_real = DUMMY_VAR__; current_statement__ = 8; transformed_param_real = bernoulli_lpmf(d_int_array, d_real); @@ -6692,56 +6699,62 @@ class restricted_model final : public model_base_crtp { try { double p_real; - p_real = std::numeric_limits::quiet_NaN(); + p_real = std::numeric_limits::quiet_NaN(); current_statement__ = 1; p_real = in__.template read(); std::vector p_real_array; p_real_array = std::vector(d_int, std::numeric_limits::quiet_NaN()); + current_statement__ = 2; p_real_array = in__.template read>(d_int); Eigen::Matrix p_matrix; p_matrix = Eigen::Matrix(d_int, d_int); - stan::math::fill(p_matrix, std::numeric_limits::quiet_NaN()); + stan::math::fill(p_matrix, std::numeric_limits::quiet_NaN()); current_statement__ = 3; p_matrix = in__.template read>( d_int, d_int); Eigen::Matrix p_vector; p_vector = Eigen::Matrix(d_int); - stan::math::fill(p_vector, std::numeric_limits::quiet_NaN()); + stan::math::fill(p_vector, std::numeric_limits::quiet_NaN()); current_statement__ = 4; p_vector = in__.template read>( d_int); Eigen::Matrix p_row_vector; p_row_vector = Eigen::Matrix(d_int); - stan::math::fill(p_row_vector, std::numeric_limits::quiet_NaN()); + stan::math::fill(p_row_vector, std::numeric_limits::quiet_NaN()); current_statement__ = 5; p_row_vector = in__.template read>( d_int); double y_p; - y_p = std::numeric_limits::quiet_NaN(); + y_p = std::numeric_limits::quiet_NaN(); current_statement__ = 6; y_p = in__.template read(); double transformed_param_real; - transformed_param_real = std::numeric_limits::quiet_NaN(); + transformed_param_real = std::numeric_limits::quiet_NaN(); vars__.emplace_back(p_real); for (int sym1__ = 1; sym1__ <= d_int; ++sym1__) { - vars__.emplace_back(p_real_array[(sym1__ - 1)]);} + vars__.emplace_back(p_real_array[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= d_int; ++sym1__) { for (int sym2__ = 1; sym2__ <= d_int; ++sym2__) { vars__.emplace_back( rvalue(p_matrix, "p_matrix", - index_uni(sym2__), index_uni(sym1__)));}} + index_uni(sym2__), index_uni(sym1__))); + } + } for (int sym1__ = 1; sym1__ <= d_int; ++sym1__) { - vars__.emplace_back(p_vector[(sym1__ - 1)]);} + vars__.emplace_back(p_vector[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= d_int; ++sym1__) { - vars__.emplace_back(p_row_vector[(sym1__ - 1)]);} + vars__.emplace_back(p_row_vector[(sym1__ - 1)]); + } vars__.emplace_back(y_p); if (logical_negation((primitive_value(emit_transformed_parameters__) || primitive_value(emit_generated_quantities__)))) { @@ -6811,22 +6824,23 @@ class restricted_model final : public model_base_crtp { try { int pos__; - pos__ = std::numeric_limits::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; double p_real; - p_real = std::numeric_limits::quiet_NaN(); + p_real = std::numeric_limits::quiet_NaN(); current_statement__ = 1; p_real = context__.vals_r("p_real")[(1 - 1)]; std::vector p_real_array; p_real_array = std::vector(d_int, std::numeric_limits::quiet_NaN()); + current_statement__ = 2; p_real_array = context__.vals_r("p_real_array"); Eigen::Matrix p_matrix; p_matrix = Eigen::Matrix(d_int, d_int); - stan::math::fill(p_matrix, std::numeric_limits::quiet_NaN()); + stan::math::fill(p_matrix, std::numeric_limits::quiet_NaN()); { std::vector p_matrix_flat__; @@ -6843,11 +6857,13 @@ class restricted_model final : public model_base_crtp { "assigning variable p_matrix", index_uni(sym2__), index_uni(sym1__)); current_statement__ = 3; - pos__ = (pos__ + 1);}} + pos__ = (pos__ + 1); + } + } } Eigen::Matrix p_vector; p_vector = Eigen::Matrix(d_int); - stan::math::fill(p_vector, std::numeric_limits::quiet_NaN()); + stan::math::fill(p_vector, std::numeric_limits::quiet_NaN()); { std::vector p_vector_flat__; @@ -6861,11 +6877,12 @@ class restricted_model final : public model_base_crtp { assign(p_vector, p_vector_flat__[(pos__ - 1)], "assigning variable p_vector", index_uni(sym1__)); current_statement__ = 4; - pos__ = (pos__ + 1);} + pos__ = (pos__ + 1); + } } Eigen::Matrix p_row_vector; p_row_vector = Eigen::Matrix(d_int); - stan::math::fill(p_row_vector, std::numeric_limits::quiet_NaN()); + stan::math::fill(p_row_vector, std::numeric_limits::quiet_NaN()); { std::vector p_row_vector_flat__; @@ -6879,25 +6896,31 @@ class restricted_model final : public model_base_crtp { assign(p_row_vector, p_row_vector_flat__[(pos__ - 1)], "assigning variable p_row_vector", index_uni(sym1__)); current_statement__ = 5; - pos__ = (pos__ + 1);} + pos__ = (pos__ + 1); + } } double y_p; - y_p = std::numeric_limits::quiet_NaN(); + y_p = std::numeric_limits::quiet_NaN(); current_statement__ = 6; y_p = context__.vals_r("y_p")[(1 - 1)]; vars__.emplace_back(p_real); for (int sym1__ = 1; sym1__ <= d_int; ++sym1__) { - vars__.emplace_back(p_real_array[(sym1__ - 1)]);} + vars__.emplace_back(p_real_array[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= d_int; ++sym1__) { for (int sym2__ = 1; sym2__ <= d_int; ++sym2__) { vars__.emplace_back( rvalue(p_matrix, "p_matrix", - index_uni(sym2__), index_uni(sym1__)));}} + index_uni(sym2__), index_uni(sym1__))); + } + } for (int sym1__ = 1; sym1__ <= d_int; ++sym1__) { - vars__.emplace_back(p_vector[(sym1__ - 1)]);} + vars__.emplace_back(p_vector[(sym1__ - 1)]); + } for (int sym1__ = 1; sym1__ <= d_int; ++sym1__) { - vars__.emplace_back(p_row_vector[(sym1__ - 1)]);} + vars__.emplace_back(p_row_vector[(sym1__ - 1)]); + } vars__.emplace_back(y_p); } catch (const std::exception& e) { stan::lang::rethrow_located(e, locations_array__[current_statement__]); @@ -6908,25 +6931,21 @@ class restricted_model final : public model_base_crtp { inline void get_param_names(std::vector& names__) const { - names__ = std::vector{"p_real", - "p_real_array", - "p_matrix", - "p_vector", - "p_row_vector", - "y_p", - "transformed_param_real"}; + names__ = std::vector{"p_real", "p_real_array", "p_matrix", + "p_vector", "p_row_vector", "y_p", "transformed_param_real"}; + } // get_param_names() inline void get_dims(std::vector>& dimss__) const { dimss__ = std::vector>{std::vector{}, - std::vector{static_cast(d_int)}, - std::vector{static_cast(d_int), - static_cast(d_int)}, - std::vector{static_cast(d_int)}, - std::vector{static_cast(d_int)}, - std::vector{}, - std::vector{}}; + std::vector{static_cast(d_int)}, + std::vector{static_cast(d_int), + static_cast(d_int)}, + std::vector{static_cast(d_int)}, + std::vector{static_cast(d_int)}, std::vector{ + }, std::vector{}}; + } // get_dims() inline void constrained_param_names( @@ -6939,22 +6958,27 @@ class restricted_model final : public model_base_crtp { for (int sym1__ = 1; sym1__ <= d_int; ++sym1__) { { param_names__.emplace_back(std::string() + "p_real_array" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= d_int; ++sym1__) { { for (int sym2__ = 1; sym2__ <= d_int; ++sym2__) { { param_names__.emplace_back(std::string() + "p_matrix" + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} + } + } + } + } for (int sym1__ = 1; sym1__ <= d_int; ++sym1__) { { param_names__.emplace_back(std::string() + "p_vector" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= d_int; ++sym1__) { { param_names__.emplace_back(std::string() + "p_row_vector" + '.' + std::to_string(sym1__)); - }} + } + } param_names__.emplace_back(std::string() + "y_p"); if (emit_transformed_parameters__) { param_names__.emplace_back(std::string() + "transformed_param_real"); @@ -6976,22 +7000,27 @@ class restricted_model final : public model_base_crtp { for (int sym1__ = 1; sym1__ <= d_int; ++sym1__) { { param_names__.emplace_back(std::string() + "p_real_array" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= d_int; ++sym1__) { { for (int sym2__ = 1; sym2__ <= d_int; ++sym2__) { { param_names__.emplace_back(std::string() + "p_matrix" + '.' + std::to_string(sym2__) + '.' + std::to_string(sym1__)); - }} - }} + } + } + } + } for (int sym1__ = 1; sym1__ <= d_int; ++sym1__) { { param_names__.emplace_back(std::string() + "p_vector" + '.' + std::to_string(sym1__)); - }} + } + } for (int sym1__ = 1; sym1__ <= d_int; ++sym1__) { { param_names__.emplace_back(std::string() + "p_row_vector" + '.' + std::to_string(sym1__)); - }} + } + } param_names__.emplace_back(std::string() + "y_p"); if (emit_transformed_parameters__) { param_names__.emplace_back(std::string() + "transformed_param_real"); @@ -7003,14 +7032,16 @@ class restricted_model final : public model_base_crtp { } // unconstrained_param_names() - inline std::string get_constrained_sizedtypes() const final { + inline std::string get_constrained_sizedtypes() const { + + return std::string("[{\"name\":\"p_real\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"p_real_array\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(d_int) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"p_matrix\",\"type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(d_int) + ",\"cols\":" + std::to_string(d_int) + "},\"block\":\"parameters\"},{\"name\":\"p_vector\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(d_int) + "},\"block\":\"parameters\"},{\"name\":\"p_row_vector\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(d_int) + "},\"block\":\"parameters\"},{\"name\":\"y_p\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"transformed_param_real\",\"type\":{\"name\":\"real\"},\"block\":\"transformed_parameters\"}]"); - return std::string("[{\"name\":\"p_real\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"p_real_array\",\"type\":{\"name\":\"array\",\"length\":" << d_int << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"p_matrix\",\"type\":{\"name\":\"matrix\",\"rows\":" << d_int << ",\"cols\":" << d_int << "},\"block\":\"parameters\"},{\"name\":\"p_vector\",\"type\":{\"name\":\"vector\",\"length\":" << d_int << "},\"block\":\"parameters\"},{\"name\":\"p_row_vector\",\"type\":{\"name\":\"vector\",\"length\":" << d_int << "},\"block\":\"parameters\"},{\"name\":\"y_p\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"transformed_param_real\",\"type\":{\"name\":\"real\"},\"block\":\"transformed_parameters\"}]"); } // get_constrained_sizedtypes() - inline std::string get_unconstrained_sizedtypes() const final { + inline std::string get_unconstrained_sizedtypes() const { + + return std::string("[{\"name\":\"p_real\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"p_real_array\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(d_int) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"p_matrix\",\"type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(d_int) + ",\"cols\":" + std::to_string(d_int) + "},\"block\":\"parameters\"},{\"name\":\"p_vector\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(d_int) + "},\"block\":\"parameters\"},{\"name\":\"p_row_vector\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(d_int) + "},\"block\":\"parameters\"},{\"name\":\"y_p\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"transformed_param_real\",\"type\":{\"name\":\"real\"},\"block\":\"transformed_parameters\"}]"); - return std::string("[{\"name\":\"p_real\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"p_real_array\",\"type\":{\"name\":\"array\",\"length\":" << d_int << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"p_matrix\",\"type\":{\"name\":\"matrix\",\"rows\":" << d_int << ",\"cols\":" << d_int << "},\"block\":\"parameters\"},{\"name\":\"p_vector\",\"type\":{\"name\":\"vector\",\"length\":" << d_int << "},\"block\":\"parameters\"},{\"name\":\"p_row_vector\",\"type\":{\"name\":\"vector\",\"length\":" << d_int << "},\"block\":\"parameters\"},{\"name\":\"y_p\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"transformed_param_real\",\"type\":{\"name\":\"real\"},\"block\":\"transformed_parameters\"}]"); } // get_unconstrained_sizedtypes() @@ -7022,14 +7053,13 @@ class restricted_model final : public model_base_crtp { const bool emit_transformed_parameters = true, const bool emit_generated_quantities = true, std::ostream* pstream = nullptr) const { - std::vector vars_vec(vars.size()); + std::vector vars_vec; + vars_vec.reserve(vars.size()); std::vector params_i; write_array_impl(base_rng, params_r, params_i, vars_vec, emit_transformed_parameters, emit_generated_quantities, pstream); - vars.resize(vars_vec.size()); - for (int i = 0; i < vars.size(); ++i) { - vars.coeffRef(i) = vars_vec[i]; - } + vars = Eigen::Map>( + vars_vec.data(), vars_vec.size()); } template @@ -7039,7 +7069,8 @@ class restricted_model final : public model_base_crtp { bool emit_transformed_parameters = true, bool emit_generated_quantities = true, std::ostream* pstream = nullptr) const { - write_array_impl(base_rng, params_r, params_i, vars, emit_transformed_parameters, emit_generated_quantities, pstream); + write_array_impl(base_rng, params_r, params_i, vars, + emit_transformed_parameters, emit_generated_quantities, pstream); } template @@ -7060,13 +7091,12 @@ class restricted_model final : public model_base_crtp { inline void transform_inits(const stan::io::var_context& context, Eigen::Matrix& params_r, std::ostream* pstream = nullptr) const final { - std::vector params_r_vec(params_r.size()); + std::vector params_r_vec; + params_r_vec.reserve(params_r.size()); std::vector params_i; transform_inits_impl(context, params_i, params_r_vec, pstream); - params_r.resize(params_r_vec.size()); - for (int i = 0; i < params_r.size(); ++i) { - params_r.coeffRef(i) = params_r_vec[i]; - } + params_r = Eigen::Map>( + params_r_vec.data(), params_r_vec.size()); } inline void transform_inits(const stan::io::var_context& context, std::vector& params_i, diff --git a/test/integration/good/code-gen/profiling/cpp.expected b/test/integration/good/code-gen/profiling/cpp.expected index 0b702b58f3..e1c86b8c4d 100644 --- a/test/integration/good/code-gen/profiling/cpp.expected +++ b/test/integration/good/code-gen/profiling/cpp.expected @@ -83,13 +83,13 @@ class simple_function_model final : public model_base_crtp::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; current_statement__ = 21; context__.validate_dims("data initialization","N","int", - context__.to_vec()); - N = std::numeric_limits::min(); + std::vector{}); + N = std::numeric_limits::min(); current_statement__ = 21; N = context__.vals_i("N")[(1 - 1)]; @@ -100,8 +100,8 @@ class simple_function_model final : public model_base_crtp(N, std::numeric_limits::quiet_NaN()); + std::vector{static_cast(N)}); + x = std::vector(N, std::numeric_limits::quiet_NaN()); current_statement__ = 23; x = context__.vals_r("x"); @@ -109,9 +109,9 @@ class simple_function_model final : public model_base_crtp{static_cast(N)}); y = Eigen::Matrix(N); - stan::math::fill(y, std::numeric_limits::quiet_NaN()); + stan::math::fill(y, std::numeric_limits::quiet_NaN()); { std::vector y_flat__; @@ -125,10 +125,10 @@ class simple_function_model final : public model_base_crtp::quiet_NaN(); current_statement__ = 28; { @@ -142,17 +142,8 @@ class simple_function_model final : public model_base_crtp(0, lp__); local_scalar_t__ alpha; - alpha = DUMMY_VAR__; + alpha = DUMMY_VAR__; current_statement__ = 2; alpha = in__.template read_constrain_lb( 0, lp__); local_scalar_t__ sigma; - sigma = DUMMY_VAR__; + sigma = DUMMY_VAR__; current_statement__ = 3; sigma = in__.template read_constrain_lb( @@ -198,7 +189,7 @@ class simple_function_model final : public model_base_crtp cov; cov = Eigen::Matrix(N, N); - stan::math::fill(cov, DUMMY_VAR__); + stan::math::fill(cov, DUMMY_VAR__); current_statement__ = 7; validate_non_negative_index("L_cov", "N", N); @@ -206,7 +197,7 @@ class simple_function_model final : public model_base_crtp L_cov; L_cov = Eigen::Matrix(N, N); - stan::math::fill(L_cov, DUMMY_VAR__); + stan::math::fill(L_cov, DUMMY_VAR__); current_statement__ = 11; { @@ -283,19 +274,19 @@ class simple_function_model final : public model_base_crtp::quiet_NaN(); + rho = std::numeric_limits::quiet_NaN(); current_statement__ = 1; rho = in__.template read_constrain_lb(0, lp__); double alpha; - alpha = std::numeric_limits::quiet_NaN(); + alpha = std::numeric_limits::quiet_NaN(); current_statement__ = 2; alpha = in__.template read_constrain_lb( 0, lp__); double sigma; - sigma = std::numeric_limits::quiet_NaN(); + sigma = std::numeric_limits::quiet_NaN(); current_statement__ = 3; sigma = in__.template read_constrain_lb( @@ -330,36 +321,36 @@ class simple_function_model final : public model_base_crtp::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; double rho; - rho = std::numeric_limits::quiet_NaN(); + rho = std::numeric_limits::quiet_NaN(); current_statement__ = 1; rho = context__.vals_r("rho")[(1 - 1)]; double rho_free__; - rho_free__ = std::numeric_limits::quiet_NaN(); + rho_free__ = std::numeric_limits::quiet_NaN(); current_statement__ = 1; rho_free__ = stan::math::lb_free(rho, 0); double alpha; - alpha = std::numeric_limits::quiet_NaN(); + alpha = std::numeric_limits::quiet_NaN(); current_statement__ = 2; alpha = context__.vals_r("alpha")[(1 - 1)]; double alpha_free__; - alpha_free__ = std::numeric_limits::quiet_NaN(); + alpha_free__ = std::numeric_limits::quiet_NaN(); current_statement__ = 2; alpha_free__ = stan::math::lb_free(alpha, 0); double sigma; - sigma = std::numeric_limits::quiet_NaN(); + sigma = std::numeric_limits::quiet_NaN(); current_statement__ = 3; sigma = context__.vals_r("sigma")[(1 - 1)]; double sigma_free__; - sigma_free__ = std::numeric_limits::quiet_NaN(); + sigma_free__ = std::numeric_limits::quiet_NaN(); current_statement__ = 3; sigma_free__ = stan::math::lb_free(sigma, 0); @@ -375,16 +366,15 @@ class simple_function_model final : public model_base_crtp& names__) const { - names__ = std::vector{"rho", - "alpha", - "sigma"}; + names__ = std::vector{"rho", "alpha", "sigma"}; + } // get_param_names() inline void get_dims(std::vector>& dimss__) const { dimss__ = std::vector>{std::vector{}, - std::vector{}, - std::vector{}}; + std::vector{}, std::vector{}}; + } // get_dims() inline void constrained_param_names( @@ -425,14 +415,16 @@ class simple_function_model final : public model_base_crtp vars_vec(vars.size()); + std::vector vars_vec; + vars_vec.reserve(vars.size()); std::vector params_i; write_array_impl(base_rng, params_r, params_i, vars_vec, emit_transformed_parameters, emit_generated_quantities, pstream); - vars.resize(vars_vec.size()); - for (int i = 0; i < vars.size(); ++i) { - vars.coeffRef(i) = vars_vec[i]; - } + vars = Eigen::Map>( + vars_vec.data(), vars_vec.size()); } template @@ -461,7 +452,8 @@ class simple_function_model final : public model_base_crtp @@ -482,13 +474,12 @@ class simple_function_model final : public model_base_crtp& params_r, std::ostream* pstream = nullptr) const final { - std::vector params_r_vec(params_r.size()); + std::vector params_r_vec; + params_r_vec.reserve(params_r.size()); std::vector params_i; transform_inits_impl(context, params_i, params_r_vec, pstream); - params_r.resize(params_r_vec.size()); - for (int i = 0; i < params_r.size(); ++i) { - params_r.coeffRef(i) = params_r_vec[i]; - } + params_r = Eigen::Map>( + params_r_vec.data(), params_r_vec.size()); } inline void transform_inits(const stan::io::var_context& context, std::vector& params_i, diff --git a/test/integration/good/code-gen/standalone_functions/cpp.expected b/test/integration/good/code-gen/standalone_functions/cpp.expected index 8bca38ac4f..00400ae3e5 100644 --- a/test/integration/good/code-gen/standalone_functions/cpp.expected +++ b/test/integration/good/code-gen/standalone_functions/cpp.expected @@ -142,7 +142,7 @@ my_vector_mul_by_5(const T0__& x_arg__, std::ostream* pstream__) { validate_non_negative_index("result", "num_elements(x)", num_elements(x)); Eigen::Matrix result; result = Eigen::Matrix(num_elements(x)); - stan::math::fill(result, DUMMY_VAR__); + stan::math::fill(result, DUMMY_VAR__); current_statement__ = 8; assign(result, multiply(x, 5.0), "assigning variable result"); @@ -462,10 +462,10 @@ integrand_ode(const T0__& r, const std::vector& f, (void) DUMMY_VAR__; // suppress unused var warning try { std::vector df_dx; - df_dx = std::vector(1, DUMMY_VAR__); + df_dx = std::vector(1, DUMMY_VAR__); local_scalar_t__ x; - x = DUMMY_VAR__; + x = DUMMY_VAR__; current_statement__ = 4; x = logit(r); @@ -504,7 +504,7 @@ ode_integrate(std::ostream* pstream__) { (void) DUMMY_VAR__; // suppress unused var warning try { std::vector x_i; - x_i = std::vector(0, std::numeric_limits::min()); + x_i = std::vector(0, std::numeric_limits::min()); current_statement__ = 9; return rvalue( diff --git a/test/integration/good/compiler-optimizations/cpp.expected b/test/integration/good/compiler-optimizations/cpp.expected index 55dbc76281..7045953e0a 100644 --- a/test/integration/good/compiler-optimizations/cpp.expected +++ b/test/integration/good/compiler-optimizations/cpp.expected @@ -75,7 +75,7 @@ simple_SIR(const T0__& t, const std::vector& y, double lcm_sym1__; { std::vector dydt; - dydt = std::vector(4, DUMMY_VAR__); + dydt = std::vector(4, DUMMY_VAR__); current_statement__ = 30; assign(dydt, @@ -163,13 +163,13 @@ class ad_level_failing_model final : public model_base_crtp::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; current_statement__ = 16; context__.validate_dims("data initialization","N_t","int", - context__.to_vec()); - N_t = std::numeric_limits::min(); + std::vector{}); + N_t = std::numeric_limits::min(); current_statement__ = 16; N_t = context__.vals_i("N_t")[(1 - 1)]; @@ -180,15 +180,16 @@ class ad_level_failing_model final : public model_base_crtp{static_cast(N_t)}); t = std::vector(N_t, std::numeric_limits::quiet_NaN()); + current_statement__ = 18; t = context__.vals_r("t"); current_statement__ = 19; context__.validate_dims("data initialization","y0","double", - context__.to_vec(4)); - y0 = std::vector(4, std::numeric_limits::quiet_NaN()); + std::vector{static_cast(4)}); + y0 = std::vector(4, std::numeric_limits::quiet_NaN()); current_statement__ = 19; y0 = context__.vals_r("y0"); @@ -196,8 +197,8 @@ class ad_level_failing_model final : public model_base_crtp(N_t, std::numeric_limits::min()); + std::vector{static_cast(N_t)}); + stoi_hat = std::vector(N_t, std::numeric_limits::min()); current_statement__ = 21; stoi_hat = context__.vals_i("stoi_hat"); @@ -205,26 +206,23 @@ class ad_level_failing_model final : public model_base_crtp{static_cast(N_t)}); B_hat = std::vector(N_t, std::numeric_limits::quiet_NaN()); + current_statement__ = 23; B_hat = context__.vals_r("B_hat"); current_statement__ = 24; - t0 = std::numeric_limits::quiet_NaN(); current_statement__ = 24; t0 = 0; current_statement__ = 25; - kappa = std::numeric_limits::quiet_NaN(); current_statement__ = 25; kappa = 1000000; current_statement__ = 26; - x_r = std::vector(0, std::numeric_limits::quiet_NaN()); current_statement__ = 27; - x_i = std::vector(0, std::numeric_limits::min()); current_statement__ = 25; current_statement__ = 25; @@ -236,18 +234,8 @@ class ad_level_failing_model final : public model_base_crtp(0, lp__); local_scalar_t__ gamma; - gamma = DUMMY_VAR__; + gamma = DUMMY_VAR__; current_statement__ = 2; gamma = in__.template read_constrain_lb( 0, lp__); local_scalar_t__ xi; - xi = DUMMY_VAR__; + xi = DUMMY_VAR__; current_statement__ = 3; xi = in__.template read_constrain_lb(0, lp__); local_scalar_t__ delta; - delta = DUMMY_VAR__; + delta = DUMMY_VAR__; current_statement__ = 4; delta = in__.template read_constrain_lb( 0, lp__); std::vector> y; y = std::vector>(N_t, std::vector(4, DUMMY_VAR__)); + { std::vector theta; theta = std::vector(5, std::numeric_limits::quiet_NaN()); + assign(lcm_sym28__, std::vector{beta, stan::math::promote_scalar(1000000), gamma, xi, @@ -383,7 +373,8 @@ class ad_level_failing_model final : public model_base_crtp::quiet_NaN(); + beta = std::numeric_limits::quiet_NaN(); current_statement__ = 1; beta = in__.template read_constrain_lb(0, lp__); double gamma; - gamma = std::numeric_limits::quiet_NaN(); + gamma = std::numeric_limits::quiet_NaN(); current_statement__ = 2; gamma = in__.template read_constrain_lb( 0, lp__); double xi; - xi = std::numeric_limits::quiet_NaN(); + xi = std::numeric_limits::quiet_NaN(); current_statement__ = 3; xi = in__.template read_constrain_lb(0, lp__); double delta; - delta = std::numeric_limits::quiet_NaN(); + delta = std::numeric_limits::quiet_NaN(); current_statement__ = 4; delta = in__.template read_constrain_lb( 0, lp__); std::vector> y; y = std::vector>(N_t, std::vector(4, std::numeric_limits::quiet_NaN())); + vars__.emplace_back(beta); vars__.emplace_back(gamma); @@ -508,6 +501,7 @@ class ad_level_failing_model final : public model_base_crtp theta; theta = std::vector(5, std::numeric_limits::quiet_NaN()); + assign(lcm_sym9__, std::vector{beta, stan::math::promote_scalar(1000000), gamma, xi, delta}, @@ -575,7 +569,8 @@ class ad_level_failing_model final : public model_base_crtp::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; double beta; - beta = std::numeric_limits::quiet_NaN(); + beta = std::numeric_limits::quiet_NaN(); current_statement__ = 1; beta = context__.vals_r("beta")[(1 - 1)]; double beta_free__; - beta_free__ = std::numeric_limits::quiet_NaN(); + beta_free__ = std::numeric_limits::quiet_NaN(); current_statement__ = 1; beta_free__ = stan::math::lb_free(beta, 0); double gamma; - gamma = std::numeric_limits::quiet_NaN(); + gamma = std::numeric_limits::quiet_NaN(); current_statement__ = 2; gamma = context__.vals_r("gamma")[(1 - 1)]; double gamma_free__; - gamma_free__ = std::numeric_limits::quiet_NaN(); + gamma_free__ = std::numeric_limits::quiet_NaN(); current_statement__ = 2; gamma_free__ = stan::math::lb_free(gamma, 0); double xi; - xi = std::numeric_limits::quiet_NaN(); + xi = std::numeric_limits::quiet_NaN(); current_statement__ = 3; xi = context__.vals_r("xi")[(1 - 1)]; double xi_free__; - xi_free__ = std::numeric_limits::quiet_NaN(); + xi_free__ = std::numeric_limits::quiet_NaN(); current_statement__ = 3; xi_free__ = stan::math::lb_free(xi, 0); double delta; - delta = std::numeric_limits::quiet_NaN(); + delta = std::numeric_limits::quiet_NaN(); current_statement__ = 4; delta = context__.vals_r("delta")[(1 - 1)]; double delta_free__; - delta_free__ = std::numeric_limits::quiet_NaN(); + delta_free__ = std::numeric_limits::quiet_NaN(); current_statement__ = 4; delta_free__ = stan::math::lb_free(delta, 0); @@ -698,20 +697,17 @@ class ad_level_failing_model final : public model_base_crtp& names__) const { - names__ = std::vector{"beta", - "gamma", - "xi", - "delta", - "y"}; + names__ = std::vector{"beta", "gamma", "xi", "delta", "y"}; + } // get_param_names() inline void get_dims(std::vector>& dimss__) const { dimss__ = std::vector>{std::vector{}, - std::vector{}, - std::vector{}, - std::vector{}, - std::vector{static_cast(N_t), static_cast(4)}}; + std::vector{}, std::vector{}, std::vector{ + }, + std::vector{static_cast(N_t), static_cast(4)}}; + } // get_dims() inline void constrained_param_names( @@ -730,8 +726,10 @@ class ad_level_failing_model final : public model_base_crtp vars_vec(vars.size()); + std::vector vars_vec; + vars_vec.reserve(vars.size()); std::vector params_i; write_array_impl(base_rng, params_r, params_i, vars_vec, emit_transformed_parameters, emit_generated_quantities, pstream); - vars.resize(vars_vec.size()); - for (int i = 0; i < vars.size(); ++i) { - vars.coeffRef(i) = vars_vec[i]; - } + vars = Eigen::Map>( + vars_vec.data(), vars_vec.size()); } template @@ -802,7 +803,8 @@ class ad_level_failing_model final : public model_base_crtp @@ -823,13 +825,12 @@ class ad_level_failing_model final : public model_base_crtp& params_r, std::ostream* pstream = nullptr) const final { - std::vector params_r_vec(params_r.size()); + std::vector params_r_vec; + params_r_vec.reserve(params_r.size()); std::vector params_i; transform_inits_impl(context, params_i, params_r_vec, pstream); - params_r.resize(params_r_vec.size()); - for (int i = 0; i < params_r.size(); ++i) { - params_r.coeffRef(i) = params_r_vec[i]; - } + params_r = Eigen::Map>( + params_r_vec.data(), params_r_vec.size()); } inline void transform_inits(const stan::io::var_context& context, std::vector& params_i, @@ -981,7 +982,8 @@ first_capture(const std::vector& y_i, std::ostream* pstream__) { if (rvalue(y_i, "y_i", index_uni(k))) { current_statement__ = 44; return k; - } } + } + } } current_statement__ = 63; return 0; @@ -1021,7 +1023,7 @@ last_capture(const std::vector& y_i, std::ostream* pstream__) { lcm_sym33__ = (size(y_i) - 1); if (logical_gte(lcm_sym33__, 0)) { int k; - k = std::numeric_limits::min(); + k = std::numeric_limits::min(); lcm_sym32__ = (size(y_i) - 0); current_statement__ = 51; @@ -1031,14 +1033,15 @@ last_capture(const std::vector& y_i, std::ostream* pstream__) { } for (int k_rev = 1; k_rev <= lcm_sym33__; ++k_rev) { int k; - k = std::numeric_limits::min(); + k = std::numeric_limits::min(); lcm_sym31__ = (size(y_i) - k_rev); current_statement__ = 51; if (y_i[(lcm_sym31__ - 1)]) { current_statement__ = 50; return lcm_sym31__; - } } + } + } } current_statement__ = 64; return 0; @@ -1091,7 +1094,7 @@ prob_uncaptured(const int& nind, const int& n_occasions, const T2__& p_arg__, validate_non_negative_index("chi", "n_occasions", n_occasions); Eigen::Matrix chi; chi = Eigen::Matrix(nind, n_occasions); - stan::math::fill(chi, DUMMY_VAR__); + stan::math::fill(chi, DUMMY_VAR__); current_statement__ = 66; if (logical_gte(nind, 1)) { @@ -1102,10 +1105,10 @@ prob_uncaptured(const int& nind, const int& n_occasions, const T2__& p_arg__, lcm_sym37__ = logical_gte(lcm_sym39__, 1); if (lcm_sym37__) { int t_curr; - t_curr = std::numeric_limits::min(); + t_curr = std::numeric_limits::min(); int t_next; - t_next = std::numeric_limits::min(); + t_next = std::numeric_limits::min(); lcm_sym41__ = (lcm_sym39__ + 1); current_statement__ = 20; @@ -1119,11 +1122,11 @@ prob_uncaptured(const int& nind, const int& n_occasions, const T2__& p_arg__, "assigning variable chi", index_uni(1), index_uni(lcm_sym39__)); for (int t = 2; t <= lcm_sym39__; ++t) { int t_curr; - t_curr = std::numeric_limits::min(); + t_curr = std::numeric_limits::min(); lcm_sym38__ = (n_occasions - t); int t_next; - t_next = std::numeric_limits::min(); + t_next = std::numeric_limits::min(); lcm_sym40__ = (lcm_sym38__ + 1); current_statement__ = 20; @@ -1146,10 +1149,10 @@ prob_uncaptured(const int& nind, const int& n_occasions, const T2__& p_arg__, current_statement__ = 65; if (lcm_sym37__) { int t_curr; - t_curr = std::numeric_limits::min(); + t_curr = std::numeric_limits::min(); int t_next; - t_next = std::numeric_limits::min(); + t_next = std::numeric_limits::min(); lcm_sym41__ = (lcm_sym39__ + 1); current_statement__ = 20; @@ -1165,11 +1168,11 @@ prob_uncaptured(const int& nind, const int& n_occasions, const T2__& p_arg__, "assigning variable chi", index_uni(i), index_uni(lcm_sym39__)); for (int t = 2; t <= lcm_sym39__; ++t) { int t_curr; - t_curr = std::numeric_limits::min(); + t_curr = std::numeric_limits::min(); lcm_sym38__ = (n_occasions - t); int t_next; - t_next = std::numeric_limits::min(); + t_next = std::numeric_limits::min(); lcm_sym40__ = (lcm_sym38__ + 1); current_statement__ = 20; @@ -1183,8 +1186,10 @@ prob_uncaptured(const int& nind, const int& n_occasions, const T2__& p_arg__, (1 - rvalue(phi, "phi", index_uni(i), index_uni(lcm_sym38__)))), "assigning variable chi", index_uni(i), - index_uni(lcm_sym38__));} - } } + index_uni(lcm_sym38__)); + } + } + } } current_statement__ = 67; return chi; @@ -1306,13 +1311,13 @@ class copy_fail_model final : public model_base_crtp { int pos__; - pos__ = std::numeric_limits::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; current_statement__ = 31; context__.validate_dims("data initialization","nind","int", - context__.to_vec()); - nind = std::numeric_limits::min(); + std::vector{}); + nind = std::numeric_limits::min(); current_statement__ = 31; nind = context__.vals_i("nind")[(1 - 1)]; @@ -1321,8 +1326,8 @@ class copy_fail_model final : public model_base_crtp { check_greater_or_equal(function__, "nind", nind, 0); current_statement__ = 32; context__.validate_dims("data initialization","n_occasions","int", - context__.to_vec()); - n_occasions = std::numeric_limits::min(); + std::vector{}); + n_occasions = std::numeric_limits::min(); current_statement__ = 32; n_occasions = context__.vals_i("n_occasions")[(1 - 1)]; @@ -1335,8 +1340,10 @@ class copy_fail_model final : public model_base_crtp { validate_non_negative_index("y", "n_occasions", n_occasions); current_statement__ = 35; context__.validate_dims("data initialization","y","int", - context__.to_vec(nind, n_occasions)); + std::vector{static_cast(nind), + static_cast(n_occasions)}); y = std::vector>(nind, std::vector(n_occasions, std::numeric_limits::min())); + { std::vector y_flat__; @@ -1359,7 +1366,8 @@ class copy_fail_model final : public model_base_crtp { assign(y, y_flat__[(pos__ - 1)], "assigning variable y", index_uni(sym2__), index_uni(1)); current_statement__ = 35; - pos__ = (pos__ + 1);} + pos__ = (pos__ + 1); + } } for (int sym1__ = 2; sym1__ <= n_occasions; ++sym1__) { current_statement__ = 35; @@ -1375,8 +1383,10 @@ class copy_fail_model final : public model_base_crtp { "assigning variable y", index_uni(sym2__), index_uni(sym1__)); current_statement__ = 35; - pos__ = (pos__ + 1);} - } } + pos__ = (pos__ + 1); + } + } + } } } else { lcm_sym157__ = logical_gte(nind, 1); @@ -1396,7 +1406,8 @@ class copy_fail_model final : public model_base_crtp { current_statement__ = 35; check_greater_or_equal(function__, "y[sym1__, sym2__]", rvalue(y, "y", - index_uni(1), index_uni(sym2__)), 0);} + index_uni(1), index_uni(sym2__)), 0); + } } for (int sym1__ = 2; sym1__ <= nind; ++sym1__) { current_statement__ = 35; @@ -1410,8 +1421,10 @@ class copy_fail_model final : public model_base_crtp { current_statement__ = 35; current_statement__ = 35; check_greater_or_equal(function__, "y[sym1__, sym2__]", - y[(sym1__ - 1)][(sym2__ - 1)], 0);} - } } + y[(sym1__ - 1)][(sym2__ - 1)], 0); + } + } + } } current_statement__ = 35; if (lcm_sym157__) { @@ -1426,7 +1439,8 @@ class copy_fail_model final : public model_base_crtp { current_statement__ = 35; check_less_or_equal(function__, "y[sym1__, sym2__]", rvalue(y, "y", - index_uni(1), index_uni(sym2__)), 1);} + index_uni(1), index_uni(sym2__)), 1); + } } for (int sym1__ = 2; sym1__ <= nind; ++sym1__) { current_statement__ = 35; @@ -1440,13 +1454,15 @@ class copy_fail_model final : public model_base_crtp { current_statement__ = 35; current_statement__ = 35; check_less_or_equal(function__, "y[sym1__, sym2__]", - y[(sym1__ - 1)][(sym2__ - 1)], 1);} - } } + y[(sym1__ - 1)][(sym2__ - 1)], 1); + } + } + } } current_statement__ = 36; context__.validate_dims("data initialization","max_age","int", - context__.to_vec()); - max_age = std::numeric_limits::min(); + std::vector{}); + max_age = std::numeric_limits::min(); current_statement__ = 36; max_age = context__.vals_i("max_age")[(1 - 1)]; @@ -1459,8 +1475,10 @@ class copy_fail_model final : public model_base_crtp { validate_non_negative_index("x", "n_occasions - 1", lcm_sym159__); current_statement__ = 38; context__.validate_dims("data initialization","x","int", - context__.to_vec(nind, lcm_sym159__)); + std::vector{static_cast(nind), + static_cast(lcm_sym159__)}); x = std::vector>(nind, std::vector(lcm_sym159__, std::numeric_limits::min())); + { std::vector x_flat__; @@ -1482,7 +1500,8 @@ class copy_fail_model final : public model_base_crtp { assign(x, x_flat__[(pos__ - 1)], "assigning variable x", index_uni(sym2__), index_uni(1)); current_statement__ = 38; - pos__ = (pos__ + 1);} + pos__ = (pos__ + 1); + } } for (int sym1__ = 2; sym1__ <= lcm_sym159__; ++sym1__) { current_statement__ = 38; @@ -1498,8 +1517,10 @@ class copy_fail_model final : public model_base_crtp { "assigning variable x", index_uni(sym2__), index_uni(sym1__)); current_statement__ = 38; - pos__ = (pos__ + 1);} - } } + pos__ = (pos__ + 1); + } + } + } } } current_statement__ = 38; @@ -1516,7 +1537,8 @@ class copy_fail_model final : public model_base_crtp { current_statement__ = 38; check_greater_or_equal(function__, "x[sym1__, sym2__]", rvalue(x, "x", - index_uni(1), index_uni(sym2__)), 0);} + index_uni(1), index_uni(sym2__)), 0); + } } for (int sym1__ = 2; sym1__ <= nind; ++sym1__) { current_statement__ = 38; @@ -1530,8 +1552,10 @@ class copy_fail_model final : public model_base_crtp { current_statement__ = 38; current_statement__ = 38; check_greater_or_equal(function__, "x[sym1__, sym2__]", - x[(sym1__ - 1)][(sym2__ - 1)], 0);} - } } + x[(sym1__ - 1)][(sym2__ - 1)], 0); + } + } + } } current_statement__ = 38; if (lcm_sym157__) { @@ -1562,29 +1586,28 @@ class copy_fail_model final : public model_base_crtp { current_statement__ = 38; current_statement__ = 38; check_less_or_equal(function__, "x[sym1__, sym2__]", - x[(sym1__ - 1)][(sym2__ - 1)], max_age);} - } } + x[(sym1__ - 1)][(sym2__ - 1)], max_age); + } + } + } } current_statement__ = 39; - n_occ_minus_1 = std::numeric_limits::min(); current_statement__ = 39; n_occ_minus_1 = lcm_sym159__; current_statement__ = 40; validate_non_negative_index("first", "nind", nind); current_statement__ = 41; - first = std::vector(nind, std::numeric_limits::min()); current_statement__ = 42; validate_non_negative_index("last", "nind", nind); current_statement__ = 43; - last = std::vector(nind, std::numeric_limits::min()); current_statement__ = 48; if (lcm_sym157__) { int inline_sym17__; int inline_sym19__; - inline_sym19__ = std::numeric_limits::min(); + inline_sym19__ = std::numeric_limits::min(); inline_sym19__ = 0; for (int inline_sym20__ = 1; inline_sym20__ <= 1; ++inline_sym20__) { @@ -1596,19 +1619,21 @@ class copy_fail_model final : public model_base_crtp { inline_sym19__ = 1; inline_sym17__ = inline_sym18__; break; - } } + } + } if (inline_sym19__) { break; } inline_sym19__ = 1; inline_sym17__ = 0; - break;} + break; + } assign(first, inline_sym17__, "assigning variable first", index_uni(1)); for (int i = 2; i <= nind; ++i) { int inline_sym17__; int inline_sym19__; - inline_sym19__ = std::numeric_limits::min(); + inline_sym19__ = std::numeric_limits::min(); inline_sym19__ = 0; for (int inline_sym20__ = 1; inline_sym20__ <= 1; ++inline_sym20__) { @@ -1620,21 +1645,24 @@ class copy_fail_model final : public model_base_crtp { inline_sym19__ = 1; inline_sym17__ = inline_sym18__; break; - } } + } + } if (inline_sym19__) { break; } inline_sym19__ = 1; inline_sym17__ = 0; - break;} + break; + } assign(first, inline_sym17__, - "assigning variable first", index_uni(i));} + "assigning variable first", index_uni(i)); + } } current_statement__ = 55; if (lcm_sym157__) { int inline_sym21__; int inline_sym24__; - inline_sym24__ = std::numeric_limits::min(); + inline_sym24__ = std::numeric_limits::min(); inline_sym24__ = 0; for (int inline_sym25__ = 1; inline_sym25__ <= 1; ++inline_sym25__) { @@ -1643,7 +1671,7 @@ class copy_fail_model final : public model_base_crtp { for (int inline_sym23__ = 0; inline_sym23__ <= lcm_sym163__; ++inline_sym23__) { int inline_sym22__; - inline_sym22__ = std::numeric_limits::min(); + inline_sym22__ = std::numeric_limits::min(); lcm_sym162__ = (lcm_sym166__ - inline_sym23__); inline_sym22__ = lcm_sym162__; @@ -1652,18 +1680,20 @@ class copy_fail_model final : public model_base_crtp { inline_sym24__ = 1; inline_sym21__ = lcm_sym162__; break; - } } + } + } if (inline_sym24__) { break; } inline_sym24__ = 1; inline_sym21__ = 0; - break;} + break; + } assign(last, inline_sym21__, "assigning variable last", index_uni(1)); for (int i = 2; i <= nind; ++i) { int inline_sym21__; int inline_sym24__; - inline_sym24__ = std::numeric_limits::min(); + inline_sym24__ = std::numeric_limits::min(); inline_sym24__ = 0; for (int inline_sym25__ = 1; inline_sym25__ <= 1; ++inline_sym25__) { @@ -1672,7 +1702,7 @@ class copy_fail_model final : public model_base_crtp { for (int inline_sym23__ = 0; inline_sym23__ <= lcm_sym161__; ++inline_sym23__) { int inline_sym22__; - inline_sym22__ = std::numeric_limits::min(); + inline_sym22__ = std::numeric_limits::min(); lcm_sym160__ = (lcm_sym165__ - inline_sym23__); inline_sym22__ = lcm_sym160__; @@ -1681,15 +1711,18 @@ class copy_fail_model final : public model_base_crtp { inline_sym24__ = 1; inline_sym21__ = lcm_sym160__; break; - } } + } + } if (inline_sym24__) { break; } inline_sym24__ = 1; inline_sym21__ = 0; - break;} + break; + } assign(last, inline_sym21__, - "assigning variable last", index_uni(i));} + "assigning variable last", index_uni(i)); + } } current_statement__ = 41; if (lcm_sym157__) { @@ -1701,7 +1734,8 @@ class copy_fail_model final : public model_base_crtp { current_statement__ = 41; current_statement__ = 41; check_greater_or_equal(function__, "first[sym1__]", - first[(sym1__ - 1)], 0);} + first[(sym1__ - 1)], 0); + } } current_statement__ = 41; if (lcm_sym157__) { @@ -1713,7 +1747,8 @@ class copy_fail_model final : public model_base_crtp { current_statement__ = 41; current_statement__ = 41; check_less_or_equal(function__, "first[sym1__]", - first[(sym1__ - 1)], n_occasions);} + first[(sym1__ - 1)], n_occasions); + } } current_statement__ = 43; if (lcm_sym157__) { @@ -1725,7 +1760,8 @@ class copy_fail_model final : public model_base_crtp { current_statement__ = 43; current_statement__ = 43; check_greater_or_equal(function__, "last[sym1__]", - last[(sym1__ - 1)], 0);} + last[(sym1__ - 1)], 0); + } } current_statement__ = 43; if (lcm_sym157__) { @@ -1737,7 +1773,8 @@ class copy_fail_model final : public model_base_crtp { current_statement__ = 43; current_statement__ = 43; check_less_or_equal(function__, "last[sym1__]", last[(sym1__ - 1)], - n_occasions);} + n_occasions); + } } current_statement__ = 56; validate_non_negative_index("beta", "max_age", max_age); @@ -1758,16 +1795,8 @@ class copy_fail_model final : public model_base_crtp { // Next line prevents compiler griping about no return throw std::runtime_error("*** IF YOU SEE THIS, PLEASE REPORT A BUG ***"); } - num_params_r__ = 0U; + num_params_r__ = 1 + max_age; - try { - num_params_r__ += 1; - num_params_r__ += max_age; - } catch (const std::exception& e) { - stan::lang::rethrow_located(e, locations_array__[current_statement__]); - // Next line prevents compiler griping about no return - throw std::runtime_error("*** IF YOU SEE THIS, PLEASE REPORT A BUG ***"); - } } template { int lcm_sym104__; int lcm_sym103__; local_scalar_t__ mean_p; - mean_p = DUMMY_VAR__; + mean_p = DUMMY_VAR__; current_statement__ = 1; mean_p = in__.template read_constrain_lub( 0, 1, lp__); Eigen::Matrix beta; beta = Eigen::Matrix(max_age); - stan::math::fill(beta, DUMMY_VAR__); + stan::math::fill(beta, DUMMY_VAR__); current_statement__ = 2; beta = in__.template read_constrain_lub, jacobian__>( 0, 1, lp__, max_age); Eigen::Matrix phi; phi = Eigen::Matrix(nind, (n_occasions - 1)); - stan::math::fill(phi, DUMMY_VAR__); + stan::math::fill(phi, DUMMY_VAR__); Eigen::Matrix p; p = Eigen::Matrix(nind, (n_occasions - 1)); - stan::math::fill(p, DUMMY_VAR__); + stan::math::fill(p, DUMMY_VAR__); Eigen::Matrix chi; chi = Eigen::Matrix(nind, n_occasions); - stan::math::fill(chi, DUMMY_VAR__); + stan::math::fill(chi, DUMMY_VAR__); lcm_sym104__ = logical_gte(nind, 1); if (lcm_sym104__) { @@ -1901,7 +1930,8 @@ class copy_fail_model final : public model_base_crtp { "assigning variable phi", index_uni(1), index_uni(t)); current_statement__ = 10; assign(p, mean_p, - "assigning variable p", index_uni(1), index_uni(t));} + "assigning variable p", index_uni(1), index_uni(t)); + } } for (int i = 2; i <= nind; ++i) { lcm_sym140__ = rvalue(first, "first", index_uni(i)); @@ -1939,12 +1969,14 @@ class copy_fail_model final : public model_base_crtp { "assigning variable phi", index_uni(i), index_uni(t)); current_statement__ = 10; assign(p, mean_p, - "assigning variable p", index_uni(i), index_uni(t));} - } } + "assigning variable p", index_uni(i), index_uni(t)); + } + } + } } Eigen::Matrix inline_sym9__; int inline_sym15__; - inline_sym15__ = std::numeric_limits::min(); + inline_sym15__ = std::numeric_limits::min(); inline_sym15__ = 0; for (int inline_sym16__ = 1; inline_sym16__ <= 1; ++inline_sym16__) { @@ -1954,7 +1986,7 @@ class copy_fail_model final : public model_base_crtp { validate_non_negative_index("chi", "n_occasions", n_occasions); Eigen::Matrix inline_sym10__; inline_sym10__ = Eigen::Matrix(nind, n_occasions); - stan::math::fill(inline_sym10__, DUMMY_VAR__); + stan::math::fill(inline_sym10__, DUMMY_VAR__); for (int inline_sym14__ = 1; inline_sym14__ <= nind; ++inline_sym14__) { current_statement__ = 17; @@ -1964,10 +1996,10 @@ class copy_fail_model final : public model_base_crtp { lcm_sym115__ = (n_occasions - 1); if (logical_gte(lcm_sym115__, 1)) { int inline_sym11__; - inline_sym11__ = std::numeric_limits::min(); + inline_sym11__ = std::numeric_limits::min(); int inline_sym12__; - inline_sym12__ = std::numeric_limits::min(); + inline_sym12__ = std::numeric_limits::min(); lcm_sym119__ = (lcm_sym115__ + 1); current_statement__ = 20; @@ -1989,11 +2021,11 @@ class copy_fail_model final : public model_base_crtp { for (int inline_sym13__ = 2; inline_sym13__ <= lcm_sym115__; ++inline_sym13__) { int inline_sym11__; - inline_sym11__ = std::numeric_limits::min(); + inline_sym11__ = std::numeric_limits::min(); lcm_sym114__ = (n_occasions - inline_sym13__); int inline_sym12__; - inline_sym12__ = std::numeric_limits::min(); + inline_sym12__ = std::numeric_limits::min(); lcm_sym118__ = (lcm_sym114__ + 1); current_statement__ = 20; @@ -2016,14 +2048,16 @@ class copy_fail_model final : public model_base_crtp { } if (inline_sym15__) { break; - } } + } + } if (inline_sym15__) { break; } inline_sym15__ = 1; assign(inline_sym9__, inline_sym10__, "assigning variable inline_sym9__"); - break;} + break; + } assign(chi, inline_sym9__, "assigning variable chi"); current_statement__ = 3; if (lcm_sym104__) { @@ -2040,7 +2074,8 @@ class copy_fail_model final : public model_base_crtp { current_statement__ = 3; check_greater_or_equal(function__, "phi[sym1__, sym2__]", rvalue(phi, "phi", - index_uni(1), index_uni(sym2__)), 0);} + index_uni(1), index_uni(sym2__)), 0); + } } for (int sym1__ = 2; sym1__ <= nind; ++sym1__) { current_statement__ = 3; @@ -2056,8 +2091,10 @@ class copy_fail_model final : public model_base_crtp { check_greater_or_equal(function__, "phi[sym1__, sym2__]", rvalue(phi, "phi", index_uni(sym1__), index_uni(sym2__)), - 0);} - } } + 0); + } + } + } } current_statement__ = 3; if (lcm_sym104__) { @@ -2074,7 +2111,8 @@ class copy_fail_model final : public model_base_crtp { current_statement__ = 3; check_less_or_equal(function__, "phi[sym1__, sym2__]", rvalue(phi, "phi", - index_uni(1), index_uni(sym2__)), 1);} + index_uni(1), index_uni(sym2__)), 1); + } } for (int sym1__ = 2; sym1__ <= nind; ++sym1__) { current_statement__ = 3; @@ -2091,7 +2129,8 @@ class copy_fail_model final : public model_base_crtp { rvalue(phi, "phi", index_uni(sym1__), index_uni(sym2__)), 1); } - } } + } + } } current_statement__ = 4; if (lcm_sym104__) { @@ -2108,7 +2147,8 @@ class copy_fail_model final : public model_base_crtp { current_statement__ = 4; check_greater_or_equal(function__, "p[sym1__, sym2__]", rvalue(p, "p", - index_uni(1), index_uni(sym2__)), 0);} + index_uni(1), index_uni(sym2__)), 0); + } } for (int sym1__ = 2; sym1__ <= nind; ++sym1__) { current_statement__ = 4; @@ -2124,8 +2164,10 @@ class copy_fail_model final : public model_base_crtp { check_greater_or_equal(function__, "p[sym1__, sym2__]", rvalue(p, "p", index_uni(sym1__), index_uni(sym2__)), - 0);} - } } + 0); + } + } + } } current_statement__ = 4; if (lcm_sym104__) { @@ -2141,7 +2183,8 @@ class copy_fail_model final : public model_base_crtp { current_statement__ = 4; check_less_or_equal(function__, "p[sym1__, sym2__]", rvalue(p, "p", - index_uni(1), index_uni(sym2__)), 1);} + index_uni(1), index_uni(sym2__)), 1); + } } for (int sym1__ = 2; sym1__ <= nind; ++sym1__) { current_statement__ = 4; @@ -2158,7 +2201,8 @@ class copy_fail_model final : public model_base_crtp { rvalue(p, "p", index_uni(sym1__), index_uni(sym2__)), 1); } - } } + } + } } current_statement__ = 5; if (lcm_sym104__) { @@ -2174,7 +2218,8 @@ class copy_fail_model final : public model_base_crtp { current_statement__ = 5; check_greater_or_equal(function__, "chi[sym1__, sym2__]", rvalue(inline_sym9__, "inline_sym9__", - index_uni(1), index_uni(sym2__)), 0);} + index_uni(1), index_uni(sym2__)), 0); + } } for (int sym1__ = 2; sym1__ <= nind; ++sym1__) { current_statement__ = 5; @@ -2190,8 +2235,10 @@ class copy_fail_model final : public model_base_crtp { check_greater_or_equal(function__, "chi[sym1__, sym2__]", rvalue(inline_sym9__, "inline_sym9__", index_uni(sym1__), index_uni(sym2__)), - 0);} - } } + 0); + } + } + } } current_statement__ = 5; if (lcm_sym104__) { @@ -2207,7 +2254,8 @@ class copy_fail_model final : public model_base_crtp { current_statement__ = 5; check_less_or_equal(function__, "chi[sym1__, sym2__]", rvalue(inline_sym9__, "inline_sym9__", - index_uni(1), index_uni(sym2__)), 1);} + index_uni(1), index_uni(sym2__)), 1); + } } for (int sym1__ = 2; sym1__ <= nind; ++sym1__) { current_statement__ = 5; @@ -2224,7 +2272,8 @@ class copy_fail_model final : public model_base_crtp { rvalue(inline_sym9__, "inline_sym9__", index_uni(sym1__), index_uni(sym2__)), 1); } - } } + } + } } { current_statement__ = 30; @@ -2253,7 +2302,8 @@ class copy_fail_model final : public model_base_crtp { lp_accum__.add( bernoulli_lpmf( rvalue(y, "y", index_uni(1), index_uni(t)), - rvalue(p, "p", index_uni(1), index_uni((t - 1)))));} + rvalue(p, "p", index_uni(1), index_uni((t - 1))))); + } } current_statement__ = 27; lp_accum__.add( @@ -2287,14 +2337,16 @@ class copy_fail_model final : public model_base_crtp { lp_accum__.add( bernoulli_lpmf( rvalue(y, "y", index_uni(i), index_uni(t)), - rvalue(p, "p", index_uni(i), index_uni((t - 1)))));} + rvalue(p, "p", index_uni(i), index_uni((t - 1))))); + } } current_statement__ = 27; lp_accum__.add( bernoulli_lpmf(1, rvalue(inline_sym9__, "inline_sym9__", index_uni(i), index_uni(lcm_sym146__)))); - } } + } + } } } } catch (const std::exception& e) { @@ -2379,35 +2431,36 @@ class copy_fail_model final : public model_base_crtp { int lcm_sym55__; int lcm_sym54__; double mean_p; - mean_p = std::numeric_limits::quiet_NaN(); + mean_p = std::numeric_limits::quiet_NaN(); current_statement__ = 1; mean_p = in__.template read_constrain_lub( 0, 1, lp__); Eigen::Matrix beta; beta = Eigen::Matrix(max_age); - stan::math::fill(beta, std::numeric_limits::quiet_NaN()); + stan::math::fill(beta, std::numeric_limits::quiet_NaN()); current_statement__ = 2; beta = in__.template read_constrain_lub, jacobian__>( 0, 1, lp__, max_age); Eigen::Matrix phi; phi = Eigen::Matrix(nind, (n_occasions - 1)); - stan::math::fill(phi, DUMMY_VAR__); + stan::math::fill(phi, DUMMY_VAR__); Eigen::Matrix p; p = Eigen::Matrix(nind, (n_occasions - 1)); - stan::math::fill(p, std::numeric_limits::quiet_NaN()); + stan::math::fill(p, std::numeric_limits::quiet_NaN()); Eigen::Matrix chi; chi = Eigen::Matrix(nind, n_occasions); - stan::math::fill(chi, DUMMY_VAR__); + stan::math::fill(chi, DUMMY_VAR__); vars__.emplace_back(mean_p); if (logical_gte(max_age, 1)) { vars__.emplace_back(rvalue(beta, "beta", index_uni(1))); for (int sym1__ = 2; sym1__ <= max_age; ++sym1__) { - vars__.emplace_back(beta[(sym1__ - 1)]);} + vars__.emplace_back(beta[(sym1__ - 1)]); + } } if (logical_negation((primitive_value(emit_transformed_parameters__) || primitive_value(emit_generated_quantities__)))) { @@ -2448,7 +2501,8 @@ class copy_fail_model final : public model_base_crtp { "assigning variable phi", index_uni(1), index_uni(t)); current_statement__ = 10; assign(p, mean_p, - "assigning variable p", index_uni(1), index_uni(t));} + "assigning variable p", index_uni(1), index_uni(t)); + } } for (int i = 2; i <= nind; ++i) { lcm_sym80__ = rvalue(first, "first", index_uni(i)); @@ -2486,12 +2540,14 @@ class copy_fail_model final : public model_base_crtp { "assigning variable phi", index_uni(i), index_uni(t)); current_statement__ = 10; assign(p, mean_p, - "assigning variable p", index_uni(i), index_uni(t));} - } } + "assigning variable p", index_uni(i), index_uni(t)); + } + } + } } Eigen::Matrix inline_sym1__; int inline_sym7__; - inline_sym7__ = std::numeric_limits::min(); + inline_sym7__ = std::numeric_limits::min(); inline_sym7__ = 0; for (int inline_sym8__ = 1; inline_sym8__ <= 1; ++inline_sym8__) { @@ -2501,7 +2557,7 @@ class copy_fail_model final : public model_base_crtp { validate_non_negative_index("chi", "n_occasions", n_occasions); Eigen::Matrix inline_sym2__; inline_sym2__ = Eigen::Matrix(nind, n_occasions); - stan::math::fill(inline_sym2__, DUMMY_VAR__); + stan::math::fill(inline_sym2__, DUMMY_VAR__); for (int inline_sym6__ = 1; inline_sym6__ <= nind; ++inline_sym6__) { current_statement__ = 17; @@ -2511,10 +2567,10 @@ class copy_fail_model final : public model_base_crtp { lcm_sym63__ = (n_occasions - 1); if (logical_gte(lcm_sym63__, 1)) { int inline_sym3__; - inline_sym3__ = std::numeric_limits::min(); + inline_sym3__ = std::numeric_limits::min(); int inline_sym4__; - inline_sym4__ = std::numeric_limits::min(); + inline_sym4__ = std::numeric_limits::min(); lcm_sym69__ = (lcm_sym63__ + 1); current_statement__ = 20; @@ -2535,11 +2591,11 @@ class copy_fail_model final : public model_base_crtp { for (int inline_sym5__ = 2; inline_sym5__ <= lcm_sym63__; ++inline_sym5__) { int inline_sym3__; - inline_sym3__ = std::numeric_limits::min(); + inline_sym3__ = std::numeric_limits::min(); lcm_sym62__ = (n_occasions - inline_sym5__); int inline_sym4__; - inline_sym4__ = std::numeric_limits::min(); + inline_sym4__ = std::numeric_limits::min(); lcm_sym68__ = (lcm_sym62__ + 1); current_statement__ = 20; @@ -2562,14 +2618,16 @@ class copy_fail_model final : public model_base_crtp { } if (inline_sym7__) { break; - } } + } + } if (inline_sym7__) { break; } inline_sym7__ = 1; assign(inline_sym1__, inline_sym2__, "assigning variable inline_sym1__"); - break;} + break; + } assign(chi, inline_sym1__, "assigning variable chi"); current_statement__ = 3; if (lcm_sym56__) { @@ -2586,7 +2644,8 @@ class copy_fail_model final : public model_base_crtp { current_statement__ = 3; check_greater_or_equal(function__, "phi[sym1__, sym2__]", rvalue(phi, "phi", - index_uni(1), index_uni(sym2__)), 0);} + index_uni(1), index_uni(sym2__)), 0); + } } for (int sym1__ = 2; sym1__ <= nind; ++sym1__) { current_statement__ = 3; @@ -2602,8 +2661,10 @@ class copy_fail_model final : public model_base_crtp { check_greater_or_equal(function__, "phi[sym1__, sym2__]", rvalue(phi, "phi", index_uni(sym1__), index_uni(sym2__)), - 0);} - } } + 0); + } + } + } } current_statement__ = 3; if (lcm_sym56__) { @@ -2620,7 +2681,8 @@ class copy_fail_model final : public model_base_crtp { current_statement__ = 3; check_less_or_equal(function__, "phi[sym1__, sym2__]", rvalue(phi, "phi", - index_uni(1), index_uni(sym2__)), 1);} + index_uni(1), index_uni(sym2__)), 1); + } } for (int sym1__ = 2; sym1__ <= nind; ++sym1__) { current_statement__ = 3; @@ -2637,7 +2699,8 @@ class copy_fail_model final : public model_base_crtp { rvalue(phi, "phi", index_uni(sym1__), index_uni(sym2__)), 1); } - } } + } + } } current_statement__ = 4; if (lcm_sym56__) { @@ -2654,7 +2717,8 @@ class copy_fail_model final : public model_base_crtp { current_statement__ = 4; check_greater_or_equal(function__, "p[sym1__, sym2__]", rvalue(p, "p", - index_uni(1), index_uni(sym2__)), 0);} + index_uni(1), index_uni(sym2__)), 0); + } } for (int sym1__ = 2; sym1__ <= nind; ++sym1__) { current_statement__ = 4; @@ -2670,8 +2734,10 @@ class copy_fail_model final : public model_base_crtp { check_greater_or_equal(function__, "p[sym1__, sym2__]", rvalue(p, "p", index_uni(sym1__), index_uni(sym2__)), - 0);} - } } + 0); + } + } + } } current_statement__ = 4; if (lcm_sym56__) { @@ -2687,7 +2753,8 @@ class copy_fail_model final : public model_base_crtp { current_statement__ = 4; check_less_or_equal(function__, "p[sym1__, sym2__]", rvalue(p, "p", - index_uni(1), index_uni(sym2__)), 1);} + index_uni(1), index_uni(sym2__)), 1); + } } for (int sym1__ = 2; sym1__ <= nind; ++sym1__) { current_statement__ = 4; @@ -2704,7 +2771,8 @@ class copy_fail_model final : public model_base_crtp { rvalue(p, "p", index_uni(sym1__), index_uni(sym2__)), 1); } - } } + } + } } current_statement__ = 5; if (lcm_sym56__) { @@ -2720,7 +2788,8 @@ class copy_fail_model final : public model_base_crtp { current_statement__ = 5; check_greater_or_equal(function__, "chi[sym1__, sym2__]", rvalue(inline_sym1__, "inline_sym1__", - index_uni(1), index_uni(sym2__)), 0);} + index_uni(1), index_uni(sym2__)), 0); + } } for (int sym1__ = 2; sym1__ <= nind; ++sym1__) { current_statement__ = 5; @@ -2736,8 +2805,10 @@ class copy_fail_model final : public model_base_crtp { check_greater_or_equal(function__, "chi[sym1__, sym2__]", rvalue(inline_sym1__, "inline_sym1__", index_uni(sym1__), index_uni(sym2__)), - 0);} - } } + 0); + } + } + } } current_statement__ = 5; if (lcm_sym56__) { @@ -2753,7 +2824,8 @@ class copy_fail_model final : public model_base_crtp { current_statement__ = 5; check_less_or_equal(function__, "chi[sym1__, sym2__]", rvalue(inline_sym1__, "inline_sym1__", - index_uni(1), index_uni(sym2__)), 1);} + index_uni(1), index_uni(sym2__)), 1); + } } for (int sym1__ = 2; sym1__ <= nind; ++sym1__) { current_statement__ = 5; @@ -2770,7 +2842,8 @@ class copy_fail_model final : public model_base_crtp { rvalue(inline_sym1__, "inline_sym1__", index_uni(sym1__), index_uni(sym2__)), 1); } - } } + } + } } if (emit_transformed_parameters__) { lcm_sym63__ = (n_occasions - 1); @@ -2781,7 +2854,8 @@ class copy_fail_model final : public model_base_crtp { rvalue(phi, "phi", index_uni(1), index_uni(1))); for (int sym2__ = 2; sym2__ <= nind; ++sym2__) { vars__.emplace_back( - rvalue(phi, "phi", index_uni(sym2__), index_uni(1)));} + rvalue(phi, "phi", index_uni(sym2__), index_uni(1))); + } } for (int sym1__ = 2; sym1__ <= lcm_sym63__; ++sym1__) { if (lcm_sym56__) { @@ -2789,15 +2863,18 @@ class copy_fail_model final : public model_base_crtp { rvalue(phi, "phi", index_uni(1), index_uni(sym1__))); for (int sym2__ = 2; sym2__ <= nind; ++sym2__) { vars__.emplace_back( - rvalue(phi, "phi", index_uni(sym2__), index_uni(sym1__)));} - } } + rvalue(phi, "phi", index_uni(sym2__), index_uni(sym1__))); + } + } + } } if (lcm_sym57__) { if (lcm_sym56__) { vars__.emplace_back(rvalue(p, "p", index_uni(1), index_uni(1))); for (int sym2__ = 2; sym2__ <= nind; ++sym2__) { vars__.emplace_back( - rvalue(p, "p", index_uni(sym2__), index_uni(1)));} + rvalue(p, "p", index_uni(sym2__), index_uni(1))); + } } for (int sym1__ = 2; sym1__ <= lcm_sym63__; ++sym1__) { if (lcm_sym56__) { @@ -2805,8 +2882,10 @@ class copy_fail_model final : public model_base_crtp { rvalue(p, "p", index_uni(1), index_uni(sym1__))); for (int sym2__ = 2; sym2__ <= nind; ++sym2__) { vars__.emplace_back( - rvalue(p, "p", index_uni(sym2__), index_uni(sym1__)));} - } } + rvalue(p, "p", index_uni(sym2__), index_uni(sym1__))); + } + } + } } if (logical_gte(n_occasions, 1)) { if (lcm_sym56__) { @@ -2816,7 +2895,8 @@ class copy_fail_model final : public model_base_crtp { for (int sym2__ = 2; sym2__ <= nind; ++sym2__) { vars__.emplace_back( rvalue(inline_sym1__, "inline_sym1__", - index_uni(sym2__), index_uni(1)));} + index_uni(sym2__), index_uni(1))); + } } for (int sym1__ = 2; sym1__ <= n_occasions; ++sym1__) { if (lcm_sym56__) { @@ -2826,8 +2906,10 @@ class copy_fail_model final : public model_base_crtp { for (int sym2__ = 2; sym2__ <= nind; ++sym2__) { vars__.emplace_back( rvalue(inline_sym1__, "inline_sym1__", - index_uni(sym2__), index_uni(sym1__)));} - } } + index_uni(sym2__), index_uni(sym1__))); + } + } + } } } if (logical_negation(emit_generated_quantities__)) { @@ -2861,22 +2943,22 @@ class copy_fail_model final : public model_base_crtp { int lcm_sym47__; int lcm_sym46__; int pos__; - pos__ = std::numeric_limits::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; double mean_p; - mean_p = std::numeric_limits::quiet_NaN(); + mean_p = std::numeric_limits::quiet_NaN(); current_statement__ = 1; mean_p = context__.vals_r("mean_p")[(1 - 1)]; double mean_p_free__; - mean_p_free__ = std::numeric_limits::quiet_NaN(); + mean_p_free__ = std::numeric_limits::quiet_NaN(); current_statement__ = 1; mean_p_free__ = stan::math::lub_free(mean_p, 0, 1); Eigen::Matrix beta; beta = Eigen::Matrix(max_age); - stan::math::fill(beta, std::numeric_limits::quiet_NaN()); + stan::math::fill(beta, std::numeric_limits::quiet_NaN()); { std::vector beta_flat__; @@ -2896,12 +2978,13 @@ class copy_fail_model final : public model_base_crtp { assign(beta, beta_flat__[(pos__ - 1)], "assigning variable beta", index_uni(sym1__)); current_statement__ = 2; - pos__ = (pos__ + 1);} + pos__ = (pos__ + 1); + } } } Eigen::Matrix beta_free__; beta_free__ = Eigen::Matrix(max_age); - stan::math::fill(beta_free__, std::numeric_limits::quiet_NaN()); + stan::math::fill(beta_free__, std::numeric_limits::quiet_NaN()); current_statement__ = 2; if (lcm_sym46__) { @@ -2912,14 +2995,16 @@ class copy_fail_model final : public model_base_crtp { for (int sym1__ = 2; sym1__ <= max_age; ++sym1__) { current_statement__ = 2; assign(beta_free__, stan::math::lub_free(beta[(sym1__ - 1)], 0, 1), - "assigning variable beta_free__", index_uni(sym1__));} + "assigning variable beta_free__", index_uni(sym1__)); + } } vars__.emplace_back(mean_p_free__); if (lcm_sym46__) { vars__.emplace_back( rvalue(beta_free__, "beta_free__", index_uni(1))); for (int sym1__ = 2; sym1__ <= max_age; ++sym1__) { - vars__.emplace_back(beta_free__[(sym1__ - 1)]);} + vars__.emplace_back(beta_free__[(sym1__ - 1)]); + } } } catch (const std::exception& e) { stan::lang::rethrow_located(e, locations_array__[current_statement__]); @@ -2930,23 +3015,21 @@ class copy_fail_model final : public model_base_crtp { inline void get_param_names(std::vector& names__) const { - names__ = std::vector{"mean_p", - "beta", - "phi", - "p", - "chi"}; + names__ = std::vector{"mean_p", "beta", "phi", "p", "chi"}; + } // get_param_names() inline void get_dims(std::vector>& dimss__) const { dimss__ = std::vector>{std::vector{}, - std::vector{static_cast(max_age)}, - std::vector{static_cast(nind), - static_cast(n_occ_minus_1)}, - std::vector{static_cast(nind), - static_cast(n_occ_minus_1)}, - std::vector{static_cast(nind), - static_cast(n_occasions)}}; + std::vector{static_cast(max_age)}, + std::vector{static_cast(nind), + static_cast(n_occ_minus_1)}, + std::vector{static_cast(nind), + static_cast(n_occ_minus_1)}, + std::vector{static_cast(nind), + static_cast(n_occasions)}}; + } // get_dims() inline void constrained_param_names( @@ -2959,29 +3042,36 @@ class copy_fail_model final : public model_base_crtp { for (int sym187__ = 1; sym187__ <= max_age; ++sym187__) { { param_names__.emplace_back(std::string() + "beta" + '.' + std::to_string(sym187__)); - }} + } + } if (emit_transformed_parameters__) { for (int sym187__ = 1; sym187__ <= n_occ_minus_1; ++sym187__) { { for (int sym188__ = 1; sym188__ <= nind; ++sym188__) { { param_names__.emplace_back(std::string() + "phi" + '.' + std::to_string(sym188__) + '.' + std::to_string(sym187__)); - }} - }} + } + } + } + } for (int sym187__ = 1; sym187__ <= n_occ_minus_1; ++sym187__) { { for (int sym188__ = 1; sym188__ <= nind; ++sym188__) { { param_names__.emplace_back(std::string() + "p" + '.' + std::to_string(sym188__) + '.' + std::to_string(sym187__)); - }} - }} + } + } + } + } for (int sym187__ = 1; sym187__ <= n_occasions; ++sym187__) { { for (int sym188__ = 1; sym188__ <= nind; ++sym188__) { { param_names__.emplace_back(std::string() + "chi" + '.' + std::to_string(sym188__) + '.' + std::to_string(sym187__)); - }} - }} + } + } + } + } } if (emit_generated_quantities__) { @@ -3000,29 +3090,36 @@ class copy_fail_model final : public model_base_crtp { for (int sym187__ = 1; sym187__ <= max_age; ++sym187__) { { param_names__.emplace_back(std::string() + "beta" + '.' + std::to_string(sym187__)); - }} + } + } if (emit_transformed_parameters__) { for (int sym187__ = 1; sym187__ <= n_occ_minus_1; ++sym187__) { { for (int sym188__ = 1; sym188__ <= nind; ++sym188__) { { param_names__.emplace_back(std::string() + "phi" + '.' + std::to_string(sym188__) + '.' + std::to_string(sym187__)); - }} - }} + } + } + } + } for (int sym187__ = 1; sym187__ <= n_occ_minus_1; ++sym187__) { { for (int sym188__ = 1; sym188__ <= nind; ++sym188__) { { param_names__.emplace_back(std::string() + "p" + '.' + std::to_string(sym188__) + '.' + std::to_string(sym187__)); - }} - }} + } + } + } + } for (int sym187__ = 1; sym187__ <= n_occasions; ++sym187__) { { for (int sym188__ = 1; sym188__ <= nind; ++sym188__) { { param_names__.emplace_back(std::string() + "chi" + '.' + std::to_string(sym188__) + '.' + std::to_string(sym187__)); - }} - }} + } + } + } + } } if (emit_generated_quantities__) { @@ -3031,14 +3128,16 @@ class copy_fail_model final : public model_base_crtp { } // unconstrained_param_names() - inline std::string get_constrained_sizedtypes() const final { + inline std::string get_constrained_sizedtypes() const { + + return std::string("[{\"name\":\"mean_p\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"beta\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(max_age) + "},\"block\":\"parameters\"},{\"name\":\"phi\",\"type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(nind) + ",\"cols\":" + std::to_string(n_occ_minus_1) + "},\"block\":\"transformed_parameters\"},{\"name\":\"p\",\"type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(nind) + ",\"cols\":" + std::to_string(n_occ_minus_1) + "},\"block\":\"transformed_parameters\"},{\"name\":\"chi\",\"type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(nind) + ",\"cols\":" + std::to_string(n_occasions) + "},\"block\":\"transformed_parameters\"}]"); - return std::string("[{\"name\":\"mean_p\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"beta\",\"type\":{\"name\":\"vector\",\"length\":" << max_age << "},\"block\":\"parameters\"},{\"name\":\"phi\",\"type\":{\"name\":\"matrix\",\"rows\":" << nind << ",\"cols\":" << n_occ_minus_1 << "},\"block\":\"transformed_parameters\"},{\"name\":\"p\",\"type\":{\"name\":\"matrix\",\"rows\":" << nind << ",\"cols\":" << n_occ_minus_1 << "},\"block\":\"transformed_parameters\"},{\"name\":\"chi\",\"type\":{\"name\":\"matrix\",\"rows\":" << nind << ",\"cols\":" << n_occasions << "},\"block\":\"transformed_parameters\"}]"); } // get_constrained_sizedtypes() - inline std::string get_unconstrained_sizedtypes() const final { + inline std::string get_unconstrained_sizedtypes() const { + + return std::string("[{\"name\":\"mean_p\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"beta\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(max_age) + "},\"block\":\"parameters\"},{\"name\":\"phi\",\"type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(nind) + ",\"cols\":" + std::to_string(n_occ_minus_1) + "},\"block\":\"transformed_parameters\"},{\"name\":\"p\",\"type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(nind) + ",\"cols\":" + std::to_string(n_occ_minus_1) + "},\"block\":\"transformed_parameters\"},{\"name\":\"chi\",\"type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(nind) + ",\"cols\":" + std::to_string(n_occasions) + "},\"block\":\"transformed_parameters\"}]"); - return std::string("[{\"name\":\"mean_p\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"beta\",\"type\":{\"name\":\"vector\",\"length\":" << max_age << "},\"block\":\"parameters\"},{\"name\":\"phi\",\"type\":{\"name\":\"matrix\",\"rows\":" << nind << ",\"cols\":" << n_occ_minus_1 << "},\"block\":\"transformed_parameters\"},{\"name\":\"p\",\"type\":{\"name\":\"matrix\",\"rows\":" << nind << ",\"cols\":" << n_occ_minus_1 << "},\"block\":\"transformed_parameters\"},{\"name\":\"chi\",\"type\":{\"name\":\"matrix\",\"rows\":" << nind << ",\"cols\":" << n_occasions << "},\"block\":\"transformed_parameters\"}]"); } // get_unconstrained_sizedtypes() @@ -3050,14 +3149,13 @@ class copy_fail_model final : public model_base_crtp { const bool emit_transformed_parameters = true, const bool emit_generated_quantities = true, std::ostream* pstream = nullptr) const { - std::vector vars_vec(vars.size()); + std::vector vars_vec; + vars_vec.reserve(vars.size()); std::vector params_i; write_array_impl(base_rng, params_r, params_i, vars_vec, emit_transformed_parameters, emit_generated_quantities, pstream); - vars.resize(vars_vec.size()); - for (int i = 0; i < vars.size(); ++i) { - vars.coeffRef(i) = vars_vec[i]; - } + vars = Eigen::Map>( + vars_vec.data(), vars_vec.size()); } template @@ -3067,7 +3165,8 @@ class copy_fail_model final : public model_base_crtp { bool emit_transformed_parameters = true, bool emit_generated_quantities = true, std::ostream* pstream = nullptr) const { - write_array_impl(base_rng, params_r, params_i, vars, emit_transformed_parameters, emit_generated_quantities, pstream); + write_array_impl(base_rng, params_r, params_i, vars, + emit_transformed_parameters, emit_generated_quantities, pstream); } template @@ -3088,13 +3187,12 @@ class copy_fail_model final : public model_base_crtp { inline void transform_inits(const stan::io::var_context& context, Eigen::Matrix& params_r, std::ostream* pstream = nullptr) const final { - std::vector params_r_vec(params_r.size()); + std::vector params_r_vec; + params_r_vec.reserve(params_r.size()); std::vector params_i; transform_inits_impl(context, params_i, params_r_vec, pstream); - params_r.resize(params_r_vec.size()); - for (int i = 0; i < params_r.size(); ++i) { - params_r.coeffRef(i) = params_r_vec[i]; - } + params_r = Eigen::Map>( + params_r_vec.data(), params_r_vec.size()); } inline void transform_inits(const stan::io::var_context& context, std::vector& params_i, @@ -3295,13 +3393,13 @@ class dce_fail_model final : public model_base_crtp { int pos__; - pos__ = std::numeric_limits::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; current_statement__ = 39; context__.validate_dims("data initialization","N","int", - context__.to_vec()); - N = std::numeric_limits::min(); + std::vector{}); + N = std::numeric_limits::min(); current_statement__ = 39; N = context__.vals_i("N")[(1 - 1)]; @@ -3310,8 +3408,8 @@ class dce_fail_model final : public model_base_crtp { check_greater_or_equal(function__, "N", N, 0); current_statement__ = 40; context__.validate_dims("data initialization","n_age","int", - context__.to_vec()); - n_age = std::numeric_limits::min(); + std::vector{}); + n_age = std::numeric_limits::min(); current_statement__ = 40; n_age = context__.vals_i("n_age")[(1 - 1)]; @@ -3320,8 +3418,8 @@ class dce_fail_model final : public model_base_crtp { check_greater_or_equal(function__, "n_age", n_age, 0); current_statement__ = 41; context__.validate_dims("data initialization","n_edu","int", - context__.to_vec()); - n_edu = std::numeric_limits::min(); + std::vector{}); + n_edu = std::numeric_limits::min(); current_statement__ = 41; n_edu = context__.vals_i("n_edu")[(1 - 1)]; @@ -3330,8 +3428,8 @@ class dce_fail_model final : public model_base_crtp { check_greater_or_equal(function__, "n_edu", n_edu, 0); current_statement__ = 42; context__.validate_dims("data initialization","n_region","int", - context__.to_vec()); - n_region = std::numeric_limits::min(); + std::vector{}); + n_region = std::numeric_limits::min(); current_statement__ = 42; n_region = context__.vals_i("n_region")[(1 - 1)]; @@ -3340,8 +3438,8 @@ class dce_fail_model final : public model_base_crtp { check_greater_or_equal(function__, "n_region", n_region, 0); current_statement__ = 43; context__.validate_dims("data initialization","n_state","int", - context__.to_vec()); - n_state = std::numeric_limits::min(); + std::vector{}); + n_state = std::numeric_limits::min(); current_statement__ = 43; n_state = context__.vals_i("n_state")[(1 - 1)]; @@ -3352,8 +3450,8 @@ class dce_fail_model final : public model_base_crtp { validate_non_negative_index("female", "N", N); current_statement__ = 45; context__.validate_dims("data initialization","female","int", - context__.to_vec(N)); - female = std::vector(N, std::numeric_limits::min()); + std::vector{static_cast(N)}); + female = std::vector(N, std::numeric_limits::min()); current_statement__ = 45; female = context__.vals_i("female"); @@ -3367,7 +3465,8 @@ class dce_fail_model final : public model_base_crtp { current_statement__ = 45; current_statement__ = 45; check_greater_or_equal(function__, "female[sym1__]", - female[(sym1__ - 1)], 0);} + female[(sym1__ - 1)], 0); + } } current_statement__ = 45; if (lcm_sym68__) { @@ -3379,14 +3478,15 @@ class dce_fail_model final : public model_base_crtp { current_statement__ = 45; current_statement__ = 45; check_less_or_equal(function__, "female[sym1__]", - female[(sym1__ - 1)], 1);} + female[(sym1__ - 1)], 1); + } } current_statement__ = 46; validate_non_negative_index("black", "N", N); current_statement__ = 47; context__.validate_dims("data initialization","black","int", - context__.to_vec(N)); - black = std::vector(N, std::numeric_limits::min()); + std::vector{static_cast(N)}); + black = std::vector(N, std::numeric_limits::min()); current_statement__ = 47; black = context__.vals_i("black"); @@ -3400,7 +3500,8 @@ class dce_fail_model final : public model_base_crtp { current_statement__ = 47; current_statement__ = 47; check_greater_or_equal(function__, "black[sym1__]", - black[(sym1__ - 1)], 0);} + black[(sym1__ - 1)], 0); + } } current_statement__ = 47; if (lcm_sym68__) { @@ -3412,14 +3513,15 @@ class dce_fail_model final : public model_base_crtp { current_statement__ = 47; current_statement__ = 47; check_less_or_equal(function__, "black[sym1__]", - black[(sym1__ - 1)], 1);} + black[(sym1__ - 1)], 1); + } } current_statement__ = 48; validate_non_negative_index("age", "N", N); current_statement__ = 49; context__.validate_dims("data initialization","age","int", - context__.to_vec(N)); - age = std::vector(N, std::numeric_limits::min()); + std::vector{static_cast(N)}); + age = std::vector(N, std::numeric_limits::min()); current_statement__ = 49; age = context__.vals_i("age"); @@ -3433,7 +3535,8 @@ class dce_fail_model final : public model_base_crtp { current_statement__ = 49; current_statement__ = 49; check_greater_or_equal(function__, "age[sym1__]", - age[(sym1__ - 1)], 0);} + age[(sym1__ - 1)], 0); + } } current_statement__ = 49; if (lcm_sym68__) { @@ -3445,14 +3548,15 @@ class dce_fail_model final : public model_base_crtp { current_statement__ = 49; current_statement__ = 49; check_less_or_equal(function__, "age[sym1__]", age[(sym1__ - 1)], - n_age);} + n_age); + } } current_statement__ = 50; validate_non_negative_index("edu", "N", N); current_statement__ = 51; context__.validate_dims("data initialization","edu","int", - context__.to_vec(N)); - edu = std::vector(N, std::numeric_limits::min()); + std::vector{static_cast(N)}); + edu = std::vector(N, std::numeric_limits::min()); current_statement__ = 51; edu = context__.vals_i("edu"); @@ -3466,7 +3570,8 @@ class dce_fail_model final : public model_base_crtp { current_statement__ = 51; current_statement__ = 51; check_greater_or_equal(function__, "edu[sym1__]", - edu[(sym1__ - 1)], 0);} + edu[(sym1__ - 1)], 0); + } } current_statement__ = 51; if (lcm_sym68__) { @@ -3478,14 +3583,15 @@ class dce_fail_model final : public model_base_crtp { current_statement__ = 51; current_statement__ = 51; check_less_or_equal(function__, "edu[sym1__]", edu[(sym1__ - 1)], - n_edu);} + n_edu); + } } current_statement__ = 52; validate_non_negative_index("region", "n_state", n_state); current_statement__ = 53; context__.validate_dims("data initialization","region","int", - context__.to_vec(n_state)); - region = std::vector(n_state, std::numeric_limits::min()); + std::vector{static_cast(n_state)}); + region = std::vector(n_state, std::numeric_limits::min()); current_statement__ = 53; region = context__.vals_i("region"); @@ -3499,7 +3605,8 @@ class dce_fail_model final : public model_base_crtp { current_statement__ = 53; current_statement__ = 53; check_greater_or_equal(function__, "region[sym1__]", - region[(sym1__ - 1)], 0);} + region[(sym1__ - 1)], 0); + } } current_statement__ = 53; if (lcm_sym69__) { @@ -3511,14 +3618,15 @@ class dce_fail_model final : public model_base_crtp { current_statement__ = 53; current_statement__ = 53; check_less_or_equal(function__, "region[sym1__]", - region[(sym1__ - 1)], n_state);} + region[(sym1__ - 1)], n_state); + } } current_statement__ = 54; validate_non_negative_index("state", "N", N); current_statement__ = 55; context__.validate_dims("data initialization","state","int", - context__.to_vec(N)); - state = std::vector(N, std::numeric_limits::min()); + std::vector{static_cast(N)}); + state = std::vector(N, std::numeric_limits::min()); current_statement__ = 55; state = context__.vals_i("state"); @@ -3532,7 +3640,8 @@ class dce_fail_model final : public model_base_crtp { current_statement__ = 55; current_statement__ = 55; check_greater_or_equal(function__, "state[sym1__]", - state[(sym1__ - 1)], 0);} + state[(sym1__ - 1)], 0); + } } current_statement__ = 55; if (lcm_sym68__) { @@ -3544,14 +3653,15 @@ class dce_fail_model final : public model_base_crtp { current_statement__ = 55; current_statement__ = 55; check_less_or_equal(function__, "state[sym1__]", - state[(sym1__ - 1)], n_state);} + state[(sym1__ - 1)], n_state); + } } current_statement__ = 56; validate_non_negative_index("y", "N", N); current_statement__ = 57; context__.validate_dims("data initialization","y","int", - context__.to_vec(N)); - y = std::vector(N, std::numeric_limits::min()); + std::vector{static_cast(N)}); + y = std::vector(N, std::numeric_limits::min()); current_statement__ = 57; y = context__.vals_i("y"); @@ -3576,15 +3686,16 @@ class dce_fail_model final : public model_base_crtp { for (int sym1__ = 2; sym1__ <= N; ++sym1__) { current_statement__ = 57; current_statement__ = 57; - check_less_or_equal(function__, "y[sym1__]", y[(sym1__ - 1)], 1);} + check_less_or_equal(function__, "y[sym1__]", y[(sym1__ - 1)], 1); + } } current_statement__ = 58; validate_non_negative_index("v_prev", "n_state", n_state); current_statement__ = 59; context__.validate_dims("data initialization","v_prev","double", - context__.to_vec(n_state)); + std::vector{static_cast(n_state)}); v_prev = Eigen::Matrix(n_state); - stan::math::fill(v_prev, std::numeric_limits::quiet_NaN()); + stan::math::fill(v_prev, std::numeric_limits::quiet_NaN()); { std::vector v_prev_flat__; @@ -3605,7 +3716,8 @@ class dce_fail_model final : public model_base_crtp { assign(v_prev, v_prev_flat__[(pos__ - 1)], "assigning variable v_prev", index_uni(sym1__)); current_statement__ = 59; - pos__ = (pos__ + 1);} + pos__ = (pos__ + 1); + } } } current_statement__ = 60; @@ -3625,30 +3737,9 @@ class dce_fail_model final : public model_base_crtp { // Next line prevents compiler griping about no return throw std::runtime_error("*** IF YOU SEE THIS, PLEASE REPORT A BUG ***"); } - num_params_r__ = 0U; + num_params_r__ = 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + n_age + + n_edu + n_region + (n_age * n_edu) + n_state; - try { - num_params_r__ += 1; - num_params_r__ += 1; - num_params_r__ += 1; - num_params_r__ += 1; - num_params_r__ += 1; - num_params_r__ += 1; - num_params_r__ += 1; - num_params_r__ += 1; - num_params_r__ += 1; - num_params_r__ += 1; - num_params_r__ += 1; - num_params_r__ += n_age; - num_params_r__ += n_edu; - num_params_r__ += n_region; - num_params_r__ += n_age * n_edu; - num_params_r__ += n_state; - } catch (const std::exception& e) { - stan::lang::rethrow_located(e, locations_array__[current_statement__]); - // Next line prevents compiler griping about no return - throw std::runtime_error("*** IF YOU SEE THIS, PLEASE REPORT A BUG ***"); - } } template { int lcm_sym47__; int lcm_sym46__; local_scalar_t__ sigma; - sigma = DUMMY_VAR__; + sigma = DUMMY_VAR__; current_statement__ = 1; sigma = in__.template read_constrain_lb( 0, lp__); local_scalar_t__ sigma_age; - sigma_age = DUMMY_VAR__; + sigma_age = DUMMY_VAR__; current_statement__ = 2; sigma_age = in__.template read_constrain_lb( 0, lp__); local_scalar_t__ sigma_edu; - sigma_edu = DUMMY_VAR__; + sigma_edu = DUMMY_VAR__; current_statement__ = 3; sigma_edu = in__.template read_constrain_lb( 0, lp__); local_scalar_t__ sigma_state; - sigma_state = DUMMY_VAR__; + sigma_state = DUMMY_VAR__; current_statement__ = 4; sigma_state = in__.template read_constrain_lb( 0, lp__); local_scalar_t__ sigma_region; - sigma_region = DUMMY_VAR__; + sigma_region = DUMMY_VAR__; current_statement__ = 5; sigma_region = in__.template read_constrain_lb( 0, lp__); local_scalar_t__ sigma_age_edu; - sigma_age_edu = DUMMY_VAR__; + sigma_age_edu = DUMMY_VAR__; current_statement__ = 6; sigma_age_edu = in__.template read_constrain_lb( 0, lp__); local_scalar_t__ b_0; - b_0 = DUMMY_VAR__; + b_0 = DUMMY_VAR__; current_statement__ = 7; b_0 = in__.template read(); local_scalar_t__ b_female; - b_female = DUMMY_VAR__; + b_female = DUMMY_VAR__; current_statement__ = 8; b_female = in__.template read(); local_scalar_t__ b_black; - b_black = DUMMY_VAR__; + b_black = DUMMY_VAR__; current_statement__ = 9; b_black = in__.template read(); local_scalar_t__ b_female_black; - b_female_black = DUMMY_VAR__; + b_female_black = DUMMY_VAR__; current_statement__ = 10; b_female_black = in__.template read(); local_scalar_t__ b_v_prev; - b_v_prev = DUMMY_VAR__; + b_v_prev = DUMMY_VAR__; current_statement__ = 11; b_v_prev = in__.template read(); Eigen::Matrix b_age; b_age = Eigen::Matrix(n_age); - stan::math::fill(b_age, DUMMY_VAR__); + stan::math::fill(b_age, DUMMY_VAR__); current_statement__ = 12; b_age = in__.template read>( n_age); Eigen::Matrix b_edu; b_edu = Eigen::Matrix(n_edu); - stan::math::fill(b_edu, DUMMY_VAR__); + stan::math::fill(b_edu, DUMMY_VAR__); current_statement__ = 13; b_edu = in__.template read>( n_edu); Eigen::Matrix b_region; b_region = Eigen::Matrix(n_region); - stan::math::fill(b_region, DUMMY_VAR__); + stan::math::fill(b_region, DUMMY_VAR__); current_statement__ = 14; b_region = in__.template read>( n_region); Eigen::Matrix b_age_edu; b_age_edu = Eigen::Matrix(n_age, n_edu); - stan::math::fill(b_age_edu, DUMMY_VAR__); + stan::math::fill(b_age_edu, DUMMY_VAR__); current_statement__ = 15; b_age_edu = in__.template read>( n_age, n_edu); Eigen::Matrix b_hat; b_hat = Eigen::Matrix(n_state); - stan::math::fill(b_hat, DUMMY_VAR__); + stan::math::fill(b_hat, DUMMY_VAR__); current_statement__ = 16; b_hat = in__.template read>( @@ -3792,13 +3883,13 @@ class dce_fail_model final : public model_base_crtp { validate_non_negative_index("p", "N", N); Eigen::Matrix p; p = Eigen::Matrix(N); - stan::math::fill(p, DUMMY_VAR__); + stan::math::fill(p, DUMMY_VAR__); current_statement__ = 19; validate_non_negative_index("b_state_hat", "n_state", n_state); Eigen::Matrix b_state_hat; b_state_hat = Eigen::Matrix(n_state); - stan::math::fill(b_state_hat, DUMMY_VAR__); + stan::math::fill(b_state_hat, DUMMY_VAR__); current_statement__ = 21; lp_accum__.add(normal_lpdf(b_0, 0, 100)); @@ -3828,7 +3919,8 @@ class dce_fail_model final : public model_base_crtp { lp_accum__.add( normal_lpdf( rvalue(b_age_edu, "b_age_edu", index_uni(1), index_uni(i)), - 0, sigma_age_edu));} + 0, sigma_age_edu)); + } } for (int j = 2; j <= n_age; ++j) { current_statement__ = 29; @@ -3843,8 +3935,10 @@ class dce_fail_model final : public model_base_crtp { lp_accum__.add( normal_lpdf( rvalue(b_age_edu, "b_age_edu", - index_uni(j), index_uni(i)), 0, sigma_age_edu));} - } } + index_uni(j), index_uni(i)), 0, sigma_age_edu)); + } + } + } } current_statement__ = 32; lp_accum__.add(normal_lpdf(b_v_prev, 0, 100)); @@ -3863,7 +3957,8 @@ class dce_fail_model final : public model_base_crtp { rvalue(v_prev, "v_prev", index_uni(j)), rvalue(b_region, "b_region", index_uni(rvalue(region, "region", index_uni(j))))), - "assigning variable b_state_hat", index_uni(j));} + "assigning variable b_state_hat", index_uni(j)); + } } current_statement__ = 35; lp_accum__.add(normal_lpdf(b_hat, b_state_hat, sigma_state)); @@ -3916,7 +4011,8 @@ class dce_fail_model final : public model_base_crtp { index_uni(rvalue(edu, "edu", index_uni(i))))) + rvalue(b_hat, "b_hat", index_uni(rvalue(state, "state", index_uni(i)))))))), - "assigning variable p", index_uni(i));} + "assigning variable p", index_uni(i)); + } } current_statement__ = 38; lp_accum__.add(bernoulli_lpmf(y, p)); @@ -3972,97 +4068,97 @@ class dce_fail_model final : public model_base_crtp { int lcm_sym29__; int lcm_sym28__; double sigma; - sigma = std::numeric_limits::quiet_NaN(); + sigma = std::numeric_limits::quiet_NaN(); current_statement__ = 1; sigma = in__.template read_constrain_lb( 0, lp__); double sigma_age; - sigma_age = std::numeric_limits::quiet_NaN(); + sigma_age = std::numeric_limits::quiet_NaN(); current_statement__ = 2; sigma_age = in__.template read_constrain_lb( 0, lp__); double sigma_edu; - sigma_edu = std::numeric_limits::quiet_NaN(); + sigma_edu = std::numeric_limits::quiet_NaN(); current_statement__ = 3; sigma_edu = in__.template read_constrain_lb( 0, lp__); double sigma_state; - sigma_state = std::numeric_limits::quiet_NaN(); + sigma_state = std::numeric_limits::quiet_NaN(); current_statement__ = 4; sigma_state = in__.template read_constrain_lb( 0, lp__); double sigma_region; - sigma_region = std::numeric_limits::quiet_NaN(); + sigma_region = std::numeric_limits::quiet_NaN(); current_statement__ = 5; sigma_region = in__.template read_constrain_lb( 0, lp__); double sigma_age_edu; - sigma_age_edu = std::numeric_limits::quiet_NaN(); + sigma_age_edu = std::numeric_limits::quiet_NaN(); current_statement__ = 6; sigma_age_edu = in__.template read_constrain_lb( 0, lp__); double b_0; - b_0 = std::numeric_limits::quiet_NaN(); + b_0 = std::numeric_limits::quiet_NaN(); current_statement__ = 7; b_0 = in__.template read(); double b_female; - b_female = std::numeric_limits::quiet_NaN(); + b_female = std::numeric_limits::quiet_NaN(); current_statement__ = 8; b_female = in__.template read(); double b_black; - b_black = std::numeric_limits::quiet_NaN(); + b_black = std::numeric_limits::quiet_NaN(); current_statement__ = 9; b_black = in__.template read(); double b_female_black; - b_female_black = std::numeric_limits::quiet_NaN(); + b_female_black = std::numeric_limits::quiet_NaN(); current_statement__ = 10; b_female_black = in__.template read(); double b_v_prev; - b_v_prev = std::numeric_limits::quiet_NaN(); + b_v_prev = std::numeric_limits::quiet_NaN(); current_statement__ = 11; b_v_prev = in__.template read(); Eigen::Matrix b_age; b_age = Eigen::Matrix(n_age); - stan::math::fill(b_age, std::numeric_limits::quiet_NaN()); + stan::math::fill(b_age, std::numeric_limits::quiet_NaN()); current_statement__ = 12; b_age = in__.template read>( n_age); Eigen::Matrix b_edu; b_edu = Eigen::Matrix(n_edu); - stan::math::fill(b_edu, std::numeric_limits::quiet_NaN()); + stan::math::fill(b_edu, std::numeric_limits::quiet_NaN()); current_statement__ = 13; b_edu = in__.template read>( n_edu); Eigen::Matrix b_region; b_region = Eigen::Matrix(n_region); - stan::math::fill(b_region, std::numeric_limits::quiet_NaN()); + stan::math::fill(b_region, std::numeric_limits::quiet_NaN()); current_statement__ = 14; b_region = in__.template read>( n_region); Eigen::Matrix b_age_edu; b_age_edu = Eigen::Matrix(n_age, n_edu); - stan::math::fill(b_age_edu, std::numeric_limits::quiet_NaN()); + stan::math::fill(b_age_edu, std::numeric_limits::quiet_NaN()); current_statement__ = 15; b_age_edu = in__.template read>( n_age, n_edu); Eigen::Matrix b_hat; b_hat = Eigen::Matrix(n_state); - stan::math::fill(b_hat, std::numeric_limits::quiet_NaN()); + stan::math::fill(b_hat, std::numeric_limits::quiet_NaN()); current_statement__ = 16; b_hat = in__.template read>( @@ -4082,18 +4178,21 @@ class dce_fail_model final : public model_base_crtp { if (lcm_sym28__) { vars__.emplace_back(rvalue(b_age, "b_age", index_uni(1))); for (int sym1__ = 2; sym1__ <= n_age; ++sym1__) { - vars__.emplace_back(b_age[(sym1__ - 1)]);} + vars__.emplace_back(b_age[(sym1__ - 1)]); + } } lcm_sym29__ = logical_gte(n_edu, 1); if (lcm_sym29__) { vars__.emplace_back(rvalue(b_edu, "b_edu", index_uni(1))); for (int sym1__ = 2; sym1__ <= n_edu; ++sym1__) { - vars__.emplace_back(b_edu[(sym1__ - 1)]);} + vars__.emplace_back(b_edu[(sym1__ - 1)]); + } } if (logical_gte(n_region, 1)) { vars__.emplace_back(rvalue(b_region, "b_region", index_uni(1))); for (int sym1__ = 2; sym1__ <= n_region; ++sym1__) { - vars__.emplace_back(b_region[(sym1__ - 1)]);} + vars__.emplace_back(b_region[(sym1__ - 1)]); + } } if (lcm_sym29__) { if (lcm_sym28__) { @@ -4111,13 +4210,16 @@ class dce_fail_model final : public model_base_crtp { for (int sym2__ = 2; sym2__ <= n_age; ++sym2__) { vars__.emplace_back( rvalue(b_age_edu, "b_age_edu", - index_uni(sym2__), index_uni(sym1__)));} - } } + index_uni(sym2__), index_uni(sym1__))); + } + } + } } if (logical_gte(n_state, 1)) { vars__.emplace_back(rvalue(b_hat, "b_hat", index_uni(1))); for (int sym1__ = 2; sym1__ <= n_state; ++sym1__) { - vars__.emplace_back(b_hat[(sym1__ - 1)]);} + vars__.emplace_back(b_hat[(sym1__ - 1)]); + } } if (logical_negation((primitive_value(emit_transformed_parameters__) || primitive_value(emit_generated_quantities__)))) { @@ -4173,97 +4275,97 @@ class dce_fail_model final : public model_base_crtp { int lcm_sym2__; int lcm_sym1__; int pos__; - pos__ = std::numeric_limits::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; double sigma; - sigma = std::numeric_limits::quiet_NaN(); + sigma = std::numeric_limits::quiet_NaN(); current_statement__ = 1; sigma = context__.vals_r("sigma")[(1 - 1)]; double sigma_free__; - sigma_free__ = std::numeric_limits::quiet_NaN(); + sigma_free__ = std::numeric_limits::quiet_NaN(); current_statement__ = 1; sigma_free__ = stan::math::lb_free(sigma, 0); double sigma_age; - sigma_age = std::numeric_limits::quiet_NaN(); + sigma_age = std::numeric_limits::quiet_NaN(); current_statement__ = 2; sigma_age = context__.vals_r("sigma_age")[(1 - 1)]; double sigma_age_free__; - sigma_age_free__ = std::numeric_limits::quiet_NaN(); + sigma_age_free__ = std::numeric_limits::quiet_NaN(); current_statement__ = 2; sigma_age_free__ = stan::math::lb_free(sigma_age, 0); double sigma_edu; - sigma_edu = std::numeric_limits::quiet_NaN(); + sigma_edu = std::numeric_limits::quiet_NaN(); current_statement__ = 3; sigma_edu = context__.vals_r("sigma_edu")[(1 - 1)]; double sigma_edu_free__; - sigma_edu_free__ = std::numeric_limits::quiet_NaN(); + sigma_edu_free__ = std::numeric_limits::quiet_NaN(); current_statement__ = 3; sigma_edu_free__ = stan::math::lb_free(sigma_edu, 0); double sigma_state; - sigma_state = std::numeric_limits::quiet_NaN(); + sigma_state = std::numeric_limits::quiet_NaN(); current_statement__ = 4; sigma_state = context__.vals_r("sigma_state")[(1 - 1)]; double sigma_state_free__; - sigma_state_free__ = std::numeric_limits::quiet_NaN(); + sigma_state_free__ = std::numeric_limits::quiet_NaN(); current_statement__ = 4; sigma_state_free__ = stan::math::lb_free(sigma_state, 0); double sigma_region; - sigma_region = std::numeric_limits::quiet_NaN(); + sigma_region = std::numeric_limits::quiet_NaN(); current_statement__ = 5; sigma_region = context__.vals_r("sigma_region")[(1 - 1)]; double sigma_region_free__; - sigma_region_free__ = std::numeric_limits::quiet_NaN(); + sigma_region_free__ = std::numeric_limits::quiet_NaN(); current_statement__ = 5; sigma_region_free__ = stan::math::lb_free(sigma_region, 0); double sigma_age_edu; - sigma_age_edu = std::numeric_limits::quiet_NaN(); + sigma_age_edu = std::numeric_limits::quiet_NaN(); current_statement__ = 6; sigma_age_edu = context__.vals_r("sigma_age_edu")[(1 - 1)]; double sigma_age_edu_free__; - sigma_age_edu_free__ = std::numeric_limits::quiet_NaN(); + sigma_age_edu_free__ = std::numeric_limits::quiet_NaN(); current_statement__ = 6; sigma_age_edu_free__ = stan::math::lb_free(sigma_age_edu, 0); double b_0; - b_0 = std::numeric_limits::quiet_NaN(); + b_0 = std::numeric_limits::quiet_NaN(); current_statement__ = 7; b_0 = context__.vals_r("b_0")[(1 - 1)]; double b_female; - b_female = std::numeric_limits::quiet_NaN(); + b_female = std::numeric_limits::quiet_NaN(); current_statement__ = 8; b_female = context__.vals_r("b_female")[(1 - 1)]; double b_black; - b_black = std::numeric_limits::quiet_NaN(); + b_black = std::numeric_limits::quiet_NaN(); current_statement__ = 9; b_black = context__.vals_r("b_black")[(1 - 1)]; double b_female_black; - b_female_black = std::numeric_limits::quiet_NaN(); + b_female_black = std::numeric_limits::quiet_NaN(); current_statement__ = 10; b_female_black = context__.vals_r("b_female_black")[(1 - 1)]; double b_v_prev; - b_v_prev = std::numeric_limits::quiet_NaN(); + b_v_prev = std::numeric_limits::quiet_NaN(); current_statement__ = 11; b_v_prev = context__.vals_r("b_v_prev")[(1 - 1)]; Eigen::Matrix b_age; b_age = Eigen::Matrix(n_age); - stan::math::fill(b_age, std::numeric_limits::quiet_NaN()); + stan::math::fill(b_age, std::numeric_limits::quiet_NaN()); { std::vector b_age_flat__; @@ -4283,12 +4385,13 @@ class dce_fail_model final : public model_base_crtp { assign(b_age, b_age_flat__[(pos__ - 1)], "assigning variable b_age", index_uni(sym1__)); current_statement__ = 12; - pos__ = (pos__ + 1);} + pos__ = (pos__ + 1); + } } } Eigen::Matrix b_edu; b_edu = Eigen::Matrix(n_edu); - stan::math::fill(b_edu, std::numeric_limits::quiet_NaN()); + stan::math::fill(b_edu, std::numeric_limits::quiet_NaN()); { std::vector b_edu_flat__; @@ -4308,12 +4411,13 @@ class dce_fail_model final : public model_base_crtp { assign(b_edu, b_edu_flat__[(pos__ - 1)], "assigning variable b_edu", index_uni(sym1__)); current_statement__ = 13; - pos__ = (pos__ + 1);} + pos__ = (pos__ + 1); + } } } Eigen::Matrix b_region; b_region = Eigen::Matrix(n_region); - stan::math::fill(b_region, std::numeric_limits::quiet_NaN()); + stan::math::fill(b_region, std::numeric_limits::quiet_NaN()); { std::vector b_region_flat__; @@ -4334,12 +4438,13 @@ class dce_fail_model final : public model_base_crtp { assign(b_region, b_region_flat__[(pos__ - 1)], "assigning variable b_region", index_uni(sym1__)); current_statement__ = 14; - pos__ = (pos__ + 1);} + pos__ = (pos__ + 1); + } } } Eigen::Matrix b_age_edu; b_age_edu = Eigen::Matrix(n_age, n_edu); - stan::math::fill(b_age_edu, std::numeric_limits::quiet_NaN()); + stan::math::fill(b_age_edu, std::numeric_limits::quiet_NaN()); { std::vector b_age_edu_flat__; @@ -4363,7 +4468,8 @@ class dce_fail_model final : public model_base_crtp { "assigning variable b_age_edu", index_uni(sym2__), index_uni(1)); current_statement__ = 15; - pos__ = (pos__ + 1);} + pos__ = (pos__ + 1); + } } for (int sym1__ = 2; sym1__ <= n_edu; ++sym1__) { current_statement__ = 15; @@ -4380,13 +4486,15 @@ class dce_fail_model final : public model_base_crtp { "assigning variable b_age_edu", index_uni(sym2__), index_uni(sym1__)); current_statement__ = 15; - pos__ = (pos__ + 1);} - } } + pos__ = (pos__ + 1); + } + } + } } } Eigen::Matrix b_hat; b_hat = Eigen::Matrix(n_state); - stan::math::fill(b_hat, std::numeric_limits::quiet_NaN()); + stan::math::fill(b_hat, std::numeric_limits::quiet_NaN()); { std::vector b_hat_flat__; @@ -4406,7 +4514,8 @@ class dce_fail_model final : public model_base_crtp { assign(b_hat, b_hat_flat__[(pos__ - 1)], "assigning variable b_hat", index_uni(sym1__)); current_statement__ = 16; - pos__ = (pos__ + 1);} + pos__ = (pos__ + 1); + } } } vars__.emplace_back(sigma_free__); @@ -4423,17 +4532,20 @@ class dce_fail_model final : public model_base_crtp { if (lcm_sym1__) { vars__.emplace_back(rvalue(b_age, "b_age", index_uni(1))); for (int sym1__ = 2; sym1__ <= n_age; ++sym1__) { - vars__.emplace_back(b_age[(sym1__ - 1)]);} + vars__.emplace_back(b_age[(sym1__ - 1)]); + } } if (lcm_sym2__) { vars__.emplace_back(rvalue(b_edu, "b_edu", index_uni(1))); for (int sym1__ = 2; sym1__ <= n_edu; ++sym1__) { - vars__.emplace_back(b_edu[(sym1__ - 1)]);} + vars__.emplace_back(b_edu[(sym1__ - 1)]); + } } if (lcm_sym3__) { vars__.emplace_back(rvalue(b_region, "b_region", index_uni(1))); for (int sym1__ = 2; sym1__ <= n_region; ++sym1__) { - vars__.emplace_back(b_region[(sym1__ - 1)]);} + vars__.emplace_back(b_region[(sym1__ - 1)]); + } } if (lcm_sym2__) { if (lcm_sym1__) { @@ -4451,13 +4563,16 @@ class dce_fail_model final : public model_base_crtp { for (int sym2__ = 2; sym2__ <= n_age; ++sym2__) { vars__.emplace_back( rvalue(b_age_edu, "b_age_edu", - index_uni(sym2__), index_uni(sym1__)));} - } } + index_uni(sym2__), index_uni(sym1__))); + } + } + } } if (lcm_sym4__) { vars__.emplace_back(rvalue(b_hat, "b_hat", index_uni(1))); for (int sym1__ = 2; sym1__ <= n_state; ++sym1__) { - vars__.emplace_back(b_hat[(sym1__ - 1)]);} + vars__.emplace_back(b_hat[(sym1__ - 1)]); + } } } catch (const std::exception& e) { stan::lang::rethrow_located(e, locations_array__[current_statement__]); @@ -4468,43 +4583,27 @@ class dce_fail_model final : public model_base_crtp { inline void get_param_names(std::vector& names__) const { - names__ = std::vector{"sigma", - "sigma_age", - "sigma_edu", - "sigma_state", - "sigma_region", - "sigma_age_edu", - "b_0", - "b_female", - "b_black", - "b_female_black", - "b_v_prev", - "b_age", - "b_edu", - "b_region", - "b_age_edu", - "b_hat"}; + names__ = std::vector{"sigma", "sigma_age", "sigma_edu", + "sigma_state", "sigma_region", "sigma_age_edu", "b_0", "b_female", + "b_black", "b_female_black", "b_v_prev", "b_age", "b_edu", "b_region", + "b_age_edu", "b_hat"}; + } // get_param_names() inline void get_dims(std::vector>& dimss__) const { dimss__ = std::vector>{std::vector{}, - std::vector{}, - std::vector{}, - std::vector{}, - std::vector{}, - std::vector{}, - std::vector{}, - std::vector{}, - std::vector{}, - std::vector{}, - std::vector{}, - std::vector{static_cast(n_age)}, - std::vector{static_cast(n_edu)}, - std::vector{static_cast(n_region)}, - std::vector{static_cast(n_age), - static_cast(n_edu)}, - std::vector{static_cast(n_state)}}; + std::vector{}, std::vector{}, std::vector{ + }, std::vector{}, std::vector{}, std::vector{ + }, std::vector{}, std::vector{}, std::vector{ + }, std::vector{}, + std::vector{static_cast(n_age)}, + std::vector{static_cast(n_edu)}, + std::vector{static_cast(n_region)}, + std::vector{static_cast(n_age), + static_cast(n_edu)}, + std::vector{static_cast(n_state)}}; + } // get_dims() inline void constrained_param_names( @@ -4527,26 +4626,32 @@ class dce_fail_model final : public model_base_crtp { for (int sym87__ = 1; sym87__ <= n_age; ++sym87__) { { param_names__.emplace_back(std::string() + "b_age" + '.' + std::to_string(sym87__)); - }} + } + } for (int sym87__ = 1; sym87__ <= n_edu; ++sym87__) { { param_names__.emplace_back(std::string() + "b_edu" + '.' + std::to_string(sym87__)); - }} + } + } for (int sym87__ = 1; sym87__ <= n_region; ++sym87__) { { param_names__.emplace_back(std::string() + "b_region" + '.' + std::to_string(sym87__)); - }} + } + } for (int sym87__ = 1; sym87__ <= n_edu; ++sym87__) { { for (int sym88__ = 1; sym88__ <= n_age; ++sym88__) { { param_names__.emplace_back(std::string() + "b_age_edu" + '.' + std::to_string(sym88__) + '.' + std::to_string(sym87__)); - }} - }} + } + } + } + } for (int sym87__ = 1; sym87__ <= n_state; ++sym87__) { { param_names__.emplace_back(std::string() + "b_hat" + '.' + std::to_string(sym87__)); - }} + } + } if (emit_transformed_parameters__) { } @@ -4577,26 +4682,32 @@ class dce_fail_model final : public model_base_crtp { for (int sym87__ = 1; sym87__ <= n_age; ++sym87__) { { param_names__.emplace_back(std::string() + "b_age" + '.' + std::to_string(sym87__)); - }} + } + } for (int sym87__ = 1; sym87__ <= n_edu; ++sym87__) { { param_names__.emplace_back(std::string() + "b_edu" + '.' + std::to_string(sym87__)); - }} + } + } for (int sym87__ = 1; sym87__ <= n_region; ++sym87__) { { param_names__.emplace_back(std::string() + "b_region" + '.' + std::to_string(sym87__)); - }} + } + } for (int sym87__ = 1; sym87__ <= n_edu; ++sym87__) { { for (int sym88__ = 1; sym88__ <= n_age; ++sym88__) { { param_names__.emplace_back(std::string() + "b_age_edu" + '.' + std::to_string(sym88__) + '.' + std::to_string(sym87__)); - }} - }} + } + } + } + } for (int sym87__ = 1; sym87__ <= n_state; ++sym87__) { { param_names__.emplace_back(std::string() + "b_hat" + '.' + std::to_string(sym87__)); - }} + } + } if (emit_transformed_parameters__) { } @@ -4607,14 +4718,16 @@ class dce_fail_model final : public model_base_crtp { } // unconstrained_param_names() - inline std::string get_constrained_sizedtypes() const final { + inline std::string get_constrained_sizedtypes() const { + + return std::string("[{\"name\":\"sigma\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"sigma_age\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"sigma_edu\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"sigma_state\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"sigma_region\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"sigma_age_edu\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"b_0\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"b_female\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"b_black\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"b_female_black\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"b_v_prev\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"b_age\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(n_age) + "},\"block\":\"parameters\"},{\"name\":\"b_edu\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(n_edu) + "},\"block\":\"parameters\"},{\"name\":\"b_region\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(n_region) + "},\"block\":\"parameters\"},{\"name\":\"b_age_edu\",\"type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(n_age) + ",\"cols\":" + std::to_string(n_edu) + "},\"block\":\"parameters\"},{\"name\":\"b_hat\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(n_state) + "},\"block\":\"parameters\"}]"); - return std::string("[{\"name\":\"sigma\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"sigma_age\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"sigma_edu\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"sigma_state\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"sigma_region\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"sigma_age_edu\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"b_0\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"b_female\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"b_black\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"b_female_black\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"b_v_prev\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"b_age\",\"type\":{\"name\":\"vector\",\"length\":" << n_age << "},\"block\":\"parameters\"},{\"name\":\"b_edu\",\"type\":{\"name\":\"vector\",\"length\":" << n_edu << "},\"block\":\"parameters\"},{\"name\":\"b_region\",\"type\":{\"name\":\"vector\",\"length\":" << n_region << "},\"block\":\"parameters\"},{\"name\":\"b_age_edu\",\"type\":{\"name\":\"matrix\",\"rows\":" << n_age << ",\"cols\":" << n_edu << "},\"block\":\"parameters\"},{\"name\":\"b_hat\",\"type\":{\"name\":\"vector\",\"length\":" << n_state << "},\"block\":\"parameters\"}]"); } // get_constrained_sizedtypes() - inline std::string get_unconstrained_sizedtypes() const final { + inline std::string get_unconstrained_sizedtypes() const { + + return std::string("[{\"name\":\"sigma\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"sigma_age\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"sigma_edu\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"sigma_state\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"sigma_region\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"sigma_age_edu\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"b_0\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"b_female\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"b_black\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"b_female_black\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"b_v_prev\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"b_age\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(n_age) + "},\"block\":\"parameters\"},{\"name\":\"b_edu\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(n_edu) + "},\"block\":\"parameters\"},{\"name\":\"b_region\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(n_region) + "},\"block\":\"parameters\"},{\"name\":\"b_age_edu\",\"type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(n_age) + ",\"cols\":" + std::to_string(n_edu) + "},\"block\":\"parameters\"},{\"name\":\"b_hat\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(n_state) + "},\"block\":\"parameters\"}]"); - return std::string("[{\"name\":\"sigma\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"sigma_age\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"sigma_edu\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"sigma_state\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"sigma_region\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"sigma_age_edu\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"b_0\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"b_female\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"b_black\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"b_female_black\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"b_v_prev\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"b_age\",\"type\":{\"name\":\"vector\",\"length\":" << n_age << "},\"block\":\"parameters\"},{\"name\":\"b_edu\",\"type\":{\"name\":\"vector\",\"length\":" << n_edu << "},\"block\":\"parameters\"},{\"name\":\"b_region\",\"type\":{\"name\":\"vector\",\"length\":" << n_region << "},\"block\":\"parameters\"},{\"name\":\"b_age_edu\",\"type\":{\"name\":\"matrix\",\"rows\":" << n_age << ",\"cols\":" << n_edu << "},\"block\":\"parameters\"},{\"name\":\"b_hat\",\"type\":{\"name\":\"vector\",\"length\":" << n_state << "},\"block\":\"parameters\"}]"); } // get_unconstrained_sizedtypes() @@ -4626,14 +4739,13 @@ class dce_fail_model final : public model_base_crtp { const bool emit_transformed_parameters = true, const bool emit_generated_quantities = true, std::ostream* pstream = nullptr) const { - std::vector vars_vec(vars.size()); + std::vector vars_vec; + vars_vec.reserve(vars.size()); std::vector params_i; write_array_impl(base_rng, params_r, params_i, vars_vec, emit_transformed_parameters, emit_generated_quantities, pstream); - vars.resize(vars_vec.size()); - for (int i = 0; i < vars.size(); ++i) { - vars.coeffRef(i) = vars_vec[i]; - } + vars = Eigen::Map>( + vars_vec.data(), vars_vec.size()); } template @@ -4643,7 +4755,8 @@ class dce_fail_model final : public model_base_crtp { bool emit_transformed_parameters = true, bool emit_generated_quantities = true, std::ostream* pstream = nullptr) const { - write_array_impl(base_rng, params_r, params_i, vars, emit_transformed_parameters, emit_generated_quantities, pstream); + write_array_impl(base_rng, params_r, params_i, vars, + emit_transformed_parameters, emit_generated_quantities, pstream); } template @@ -4664,13 +4777,12 @@ class dce_fail_model final : public model_base_crtp { inline void transform_inits(const stan::io::var_context& context, Eigen::Matrix& params_r, std::ostream* pstream = nullptr) const final { - std::vector params_r_vec(params_r.size()); + std::vector params_r_vec; + params_r_vec.reserve(params_r.size()); std::vector params_i; transform_inits_impl(context, params_i, params_r_vec, pstream); - params_r.resize(params_r_vec.size()); - for (int i = 0; i < params_r.size(); ++i) { - params_r.coeffRef(i) = params_r_vec[i]; - } + params_r = Eigen::Map>( + params_r_vec.data(), params_r_vec.size()); } inline void transform_inits(const stan::io::var_context& context, std::vector& params_i, @@ -4770,27 +4882,23 @@ class expr_prop_experiment_model final : public model_base_crtp::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; current_statement__ = 1; context__.validate_dims("data initialization","j","int", - context__.to_vec()); - j = std::numeric_limits::min(); + std::vector{}); + j = std::numeric_limits::min(); current_statement__ = 1; j = context__.vals_i("j")[(1 - 1)]; current_statement__ = 2; - z = std::numeric_limits::quiet_NaN(); current_statement__ = 3; - x = std::numeric_limits::quiet_NaN(); current_statement__ = 4; - y = std::numeric_limits::quiet_NaN(); current_statement__ = 5; - i = std::numeric_limits::quiet_NaN(); current_statement__ = 5; i = normal_rng(5, 1, base_rng__); @@ -4809,13 +4917,6 @@ class expr_prop_experiment_model final : public model_base_crtp::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; } catch (const std::exception& e) { @@ -4911,11 +5012,13 @@ class expr_prop_experiment_model final : public model_base_crtp& names__) const { names__ = std::vector{}; + } // get_param_names() inline void get_dims(std::vector>& dimss__) const { dimss__ = std::vector>{}; + } // get_dims() inline void constrained_param_names( @@ -4952,14 +5055,16 @@ class expr_prop_experiment_model final : public model_base_crtp vars_vec(vars.size()); + std::vector vars_vec; + vars_vec.reserve(vars.size()); std::vector params_i; write_array_impl(base_rng, params_r, params_i, vars_vec, emit_transformed_parameters, emit_generated_quantities, pstream); - vars.resize(vars_vec.size()); - for (int i = 0; i < vars.size(); ++i) { - vars.coeffRef(i) = vars_vec[i]; - } + vars = Eigen::Map>( + vars_vec.data(), vars_vec.size()); } template @@ -4988,7 +5092,8 @@ class expr_prop_experiment_model final : public model_base_crtp @@ -5009,13 +5114,12 @@ class expr_prop_experiment_model final : public model_base_crtp& params_r, std::ostream* pstream = nullptr) const final { - std::vector params_r_vec(params_r.size()); + std::vector params_r_vec; + params_r_vec.reserve(params_r.size()); std::vector params_i; transform_inits_impl(context, params_i, params_r_vec, pstream); - params_r.resize(params_r_vec.size()); - for (int i = 0; i < params_r.size(); ++i) { - params_r.coeffRef(i) = params_r_vec[i]; - } + params_r = Eigen::Map>( + params_r_vec.data(), params_r_vec.size()); } inline void transform_inits(const stan::io::var_context& context, std::vector& params_i, @@ -5113,27 +5217,25 @@ class expr_prop_experiment2_model final : public model_base_crtp::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; current_statement__ = 1; context__.validate_dims("data initialization","j","int", - context__.to_vec()); - j = std::numeric_limits::min(); + std::vector{}); + j = std::numeric_limits::min(); current_statement__ = 1; j = context__.vals_i("j")[(1 - 1)]; current_statement__ = 2; - z = std::numeric_limits::quiet_NaN(); current_statement__ = 2; z = 1; current_statement__ = 3; - y = std::numeric_limits::quiet_NaN(); { double x; - x = std::numeric_limits::quiet_NaN(); + x = std::numeric_limits::quiet_NaN(); current_statement__ = 4; x = normal_rng(123, 1, base_rng__); @@ -5151,13 +5253,6 @@ class expr_prop_experiment2_model final : public model_base_crtp::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; } catch (const std::exception& e) { @@ -5253,11 +5348,13 @@ class expr_prop_experiment2_model final : public model_base_crtp& names__) const { names__ = std::vector{}; + } // get_param_names() inline void get_dims(std::vector>& dimss__) const { dimss__ = std::vector>{}; + } // get_dims() inline void constrained_param_names( @@ -5294,14 +5391,16 @@ class expr_prop_experiment2_model final : public model_base_crtp vars_vec(vars.size()); + std::vector vars_vec; + vars_vec.reserve(vars.size()); std::vector params_i; write_array_impl(base_rng, params_r, params_i, vars_vec, emit_transformed_parameters, emit_generated_quantities, pstream); - vars.resize(vars_vec.size()); - for (int i = 0; i < vars.size(); ++i) { - vars.coeffRef(i) = vars_vec[i]; - } + vars = Eigen::Map>( + vars_vec.data(), vars_vec.size()); } template @@ -5330,7 +5428,8 @@ class expr_prop_experiment2_model final : public model_base_crtp @@ -5351,13 +5450,12 @@ class expr_prop_experiment2_model final : public model_base_crtp& params_r, std::ostream* pstream = nullptr) const final { - std::vector params_r_vec(params_r.size()); + std::vector params_r_vec; + params_r_vec.reserve(params_r.size()); std::vector params_i; transform_inits_impl(context, params_i, params_r_vec, pstream); - params_r.resize(params_r_vec.size()); - for (int i = 0; i < params_r.size(); ++i) { - params_r.coeffRef(i) = params_r_vec[i]; - } + params_r = Eigen::Map>( + params_r_vec.data(), params_r_vec.size()); } inline void transform_inits(const stan::io::var_context& context, std::vector& params_i, @@ -5464,13 +5562,13 @@ class expr_prop_fail_model final : public model_base_crtp int pos__; - pos__ = std::numeric_limits::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; current_statement__ = 9; context__.validate_dims("data initialization","N","int", - context__.to_vec()); - N = std::numeric_limits::min(); + std::vector{}); + N = std::numeric_limits::min(); current_statement__ = 9; N = context__.vals_i("N")[(1 - 1)]; @@ -5481,9 +5579,9 @@ class expr_prop_fail_model final : public model_base_crtp validate_non_negative_index("y", "N", N); current_statement__ = 11; context__.validate_dims("data initialization","y","double", - context__.to_vec(N)); + std::vector{static_cast(N)}); y = Eigen::Matrix(N); - stan::math::fill(y, std::numeric_limits::quiet_NaN()); + stan::math::fill(y, std::numeric_limits::quiet_NaN()); { std::vector y_flat__; @@ -5503,7 +5601,8 @@ class expr_prop_fail_model final : public model_base_crtp assign(y, y_flat__[(pos__ - 1)], "assigning variable y", index_uni(sym1__)); current_statement__ = 11; - pos__ = (pos__ + 1);} + pos__ = (pos__ + 1); + } } } } catch (const std::exception& e) { @@ -5511,17 +5610,8 @@ class expr_prop_fail_model final : public model_base_crtp // Next line prevents compiler griping about no return throw std::runtime_error("*** IF YOU SEE THIS, PLEASE REPORT A BUG ***"); } - num_params_r__ = 0U; + num_params_r__ = 2 + 2 + 1; - try { - num_params_r__ += 2; - num_params_r__ += 2; - num_params_r__ += 1; - } catch (const std::exception& e) { - stan::lang::rethrow_located(e, locations_array__[current_statement__]); - // Next line prevents compiler griping about no return - throw std::runtime_error("*** IF YOU SEE THIS, PLEASE REPORT A BUG ***"); - } } template int lcm_sym16__; Eigen::Matrix mu; mu = Eigen::Matrix(2); - stan::math::fill(mu, DUMMY_VAR__); + stan::math::fill(mu, DUMMY_VAR__); current_statement__ = 1; mu = in__.template read_constrain_ordered, jacobian__>( lp__, 2); std::vector sigma; - sigma = std::vector(2, DUMMY_VAR__); + sigma = std::vector(2, DUMMY_VAR__); current_statement__ = 2; sigma = in__.template read_constrain_lb, jacobian__>( 0, lp__, 2); local_scalar_t__ theta; - theta = DUMMY_VAR__; + theta = DUMMY_VAR__; current_statement__ = 3; theta = in__.template read_constrain_lub( @@ -5594,7 +5684,8 @@ class expr_prop_fail_model final : public model_base_crtp rvalue(sigma, "sigma", index_uni(1))), normal_lpdf(rvalue(y, "y", index_uni(n)), rvalue(mu, "mu", index_uni(2)), - rvalue(sigma, "sigma", index_uni(2)))));} + rvalue(sigma, "sigma", index_uni(2))))); + } } } } catch (const std::exception& e) { @@ -5637,19 +5728,20 @@ class expr_prop_fail_model final : public model_base_crtp int lcm_sym10__; Eigen::Matrix mu; mu = Eigen::Matrix(2); - stan::math::fill(mu, std::numeric_limits::quiet_NaN()); + stan::math::fill(mu, std::numeric_limits::quiet_NaN()); current_statement__ = 1; mu = in__.template read_constrain_ordered, jacobian__>( lp__, 2); std::vector sigma; sigma = std::vector(2, std::numeric_limits::quiet_NaN()); + current_statement__ = 2; sigma = in__.template read_constrain_lb, jacobian__>( 0, lp__, 2); double theta; - theta = std::numeric_limits::quiet_NaN(); + theta = std::numeric_limits::quiet_NaN(); current_statement__ = 3; theta = in__.template read_constrain_lub( @@ -5703,12 +5795,12 @@ class expr_prop_fail_model final : public model_base_crtp double lcm_sym4__; int lcm_sym1__; int pos__; - pos__ = std::numeric_limits::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; Eigen::Matrix mu; mu = Eigen::Matrix(2); - stan::math::fill(mu, std::numeric_limits::quiet_NaN()); + stan::math::fill(mu, std::numeric_limits::quiet_NaN()); { std::vector mu_flat__; @@ -5733,18 +5825,20 @@ class expr_prop_fail_model final : public model_base_crtp } Eigen::Matrix mu_free__; mu_free__ = Eigen::Matrix(2); - stan::math::fill(mu_free__, std::numeric_limits::quiet_NaN()); + stan::math::fill(mu_free__, std::numeric_limits::quiet_NaN()); current_statement__ = 1; assign(mu_free__, stan::math::ordered_free(mu), "assigning variable mu_free__"); std::vector sigma; sigma = std::vector(2, std::numeric_limits::quiet_NaN()); + current_statement__ = 2; sigma = context__.vals_r("sigma"); std::vector sigma_free__; sigma_free__ = std::vector(2, std::numeric_limits::quiet_NaN()); + { current_statement__ = 2; @@ -5759,12 +5853,12 @@ class expr_prop_fail_model final : public model_base_crtp } } double theta; - theta = std::numeric_limits::quiet_NaN(); + theta = std::numeric_limits::quiet_NaN(); current_statement__ = 3; theta = context__.vals_r("theta")[(1 - 1)]; double theta_free__; - theta_free__ = std::numeric_limits::quiet_NaN(); + theta_free__ = std::numeric_limits::quiet_NaN(); current_statement__ = 3; theta_free__ = stan::math::lub_free(theta, 0, 1); @@ -5792,9 +5886,8 @@ class expr_prop_fail_model final : public model_base_crtp inline void get_param_names(std::vector& names__) const { - names__ = std::vector{"mu", - "sigma", - "theta"}; + names__ = std::vector{"mu", "sigma", "theta"}; + } // get_param_names() inline void get_dims(std::vector>& dimss__) const { @@ -5802,8 +5895,9 @@ class expr_prop_fail_model final : public model_base_crtp dimss__ = std::vector>{std::vector{ static_cast(2) }, - std::vector{static_cast(2)}, - std::vector{}}; + std::vector{static_cast(2)}, std::vector{ + }}; + } // get_dims() inline void constrained_param_names( @@ -5815,11 +5909,13 @@ class expr_prop_fail_model final : public model_base_crtp for (int sym26__ = 1; sym26__ <= 2; ++sym26__) { { param_names__.emplace_back(std::string() + "mu" + '.' + std::to_string(sym26__)); - }} + } + } for (int sym26__ = 1; sym26__ <= 2; ++sym26__) { { param_names__.emplace_back(std::string() + "sigma" + '.' + std::to_string(sym26__)); - }} + } + } param_names__.emplace_back(std::string() + "theta"); if (emit_transformed_parameters__) { @@ -5840,11 +5936,13 @@ class expr_prop_fail_model final : public model_base_crtp for (int sym26__ = 1; sym26__ <= 2; ++sym26__) { { param_names__.emplace_back(std::string() + "mu" + '.' + std::to_string(sym26__)); - }} + } + } for (int sym26__ = 1; sym26__ <= 2; ++sym26__) { { param_names__.emplace_back(std::string() + "sigma" + '.' + std::to_string(sym26__)); - }} + } + } param_names__.emplace_back(std::string() + "theta"); if (emit_transformed_parameters__) { @@ -5856,14 +5954,16 @@ class expr_prop_fail_model final : public model_base_crtp } // unconstrained_param_names() - inline std::string get_constrained_sizedtypes() const final { + inline std::string get_constrained_sizedtypes() const { + + return std::string("[{\"name\":\"mu\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(2) + "},\"block\":\"parameters\"},{\"name\":\"sigma\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(2) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"theta\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"}]"); - return std::string("[{\"name\":\"mu\",\"type\":{\"name\":\"vector\",\"length\":" << 2 << "},\"block\":\"parameters\"},{\"name\":\"sigma\",\"type\":{\"name\":\"array\",\"length\":" << 2 << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"theta\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"}]"); } // get_constrained_sizedtypes() - inline std::string get_unconstrained_sizedtypes() const final { + inline std::string get_unconstrained_sizedtypes() const { + + return std::string("[{\"name\":\"mu\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(2) + "},\"block\":\"parameters\"},{\"name\":\"sigma\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(2) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"theta\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"}]"); - return std::string("[{\"name\":\"mu\",\"type\":{\"name\":\"vector\",\"length\":" << 2 << "},\"block\":\"parameters\"},{\"name\":\"sigma\",\"type\":{\"name\":\"array\",\"length\":" << 2 << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"theta\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"}]"); } // get_unconstrained_sizedtypes() @@ -5875,14 +5975,13 @@ class expr_prop_fail_model final : public model_base_crtp const bool emit_transformed_parameters = true, const bool emit_generated_quantities = true, std::ostream* pstream = nullptr) const { - std::vector vars_vec(vars.size()); + std::vector vars_vec; + vars_vec.reserve(vars.size()); std::vector params_i; write_array_impl(base_rng, params_r, params_i, vars_vec, emit_transformed_parameters, emit_generated_quantities, pstream); - vars.resize(vars_vec.size()); - for (int i = 0; i < vars.size(); ++i) { - vars.coeffRef(i) = vars_vec[i]; - } + vars = Eigen::Map>( + vars_vec.data(), vars_vec.size()); } template @@ -5892,7 +5991,8 @@ class expr_prop_fail_model final : public model_base_crtp bool emit_transformed_parameters = true, bool emit_generated_quantities = true, std::ostream* pstream = nullptr) const { - write_array_impl(base_rng, params_r, params_i, vars, emit_transformed_parameters, emit_generated_quantities, pstream); + write_array_impl(base_rng, params_r, params_i, vars, + emit_transformed_parameters, emit_generated_quantities, pstream); } template @@ -5913,13 +6013,12 @@ class expr_prop_fail_model final : public model_base_crtp inline void transform_inits(const stan::io::var_context& context, Eigen::Matrix& params_r, std::ostream* pstream = nullptr) const final { - std::vector params_r_vec(params_r.size()); + std::vector params_r_vec; + params_r_vec.reserve(params_r.size()); std::vector params_i; transform_inits_impl(context, params_i, params_r_vec, pstream); - params_r.resize(params_r_vec.size()); - for (int i = 0; i < params_r.size(); ++i) { - params_r.coeffRef(i) = params_r_vec[i]; - } + params_r = Eigen::Map>( + params_r_vec.data(), params_r_vec.size()); } inline void transform_inits(const stan::io::var_context& context, std::vector& params_i, @@ -6024,13 +6123,13 @@ class expr_prop_fail2_model final : public model_base_crtp::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; current_statement__ = 6; context__.validate_dims("data initialization","J","int", - context__.to_vec()); - J = std::numeric_limits::min(); + std::vector{}); + J = std::numeric_limits::min(); current_statement__ = 6; J = context__.vals_i("J")[(1 - 1)]; @@ -6041,8 +6140,8 @@ class expr_prop_fail2_model final : public model_base_crtp(J, std::numeric_limits::quiet_NaN()); + std::vector{static_cast(J)}); + y = std::vector(J, std::numeric_limits::quiet_NaN()); current_statement__ = 8; y = context__.vals_r("y"); @@ -6050,8 +6149,9 @@ class expr_prop_fail2_model final : public model_base_crtp{static_cast(J)}); sigma = std::vector(J, std::numeric_limits::quiet_NaN()); + current_statement__ = 10; sigma = context__.vals_r("sigma"); @@ -6065,7 +6165,8 @@ class expr_prop_fail2_model final : public model_base_crtp(); std::vector theta; - theta = std::vector(J, DUMMY_VAR__); + theta = std::vector(J, DUMMY_VAR__); current_statement__ = 2; theta = in__.template read>(J); local_scalar_t__ tau; - tau = DUMMY_VAR__; + tau = DUMMY_VAR__; current_statement__ = 3; tau = in__.template read_constrain_lb(0, @@ -6167,17 +6259,18 @@ class expr_prop_fail2_model final : public model_base_crtp::quiet_NaN(); + mu = std::numeric_limits::quiet_NaN(); current_statement__ = 1; mu = in__.template read(); std::vector theta; theta = std::vector(J, std::numeric_limits::quiet_NaN()); + current_statement__ = 2; theta = in__.template read>(J); double tau; - tau = std::numeric_limits::quiet_NaN(); + tau = std::numeric_limits::quiet_NaN(); current_statement__ = 3; tau = in__.template read_constrain_lb(0, @@ -6186,7 +6279,8 @@ class expr_prop_fail2_model final : public model_base_crtp::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; double mu; - mu = std::numeric_limits::quiet_NaN(); + mu = std::numeric_limits::quiet_NaN(); current_statement__ = 1; mu = context__.vals_r("mu")[(1 - 1)]; std::vector theta; theta = std::vector(J, std::numeric_limits::quiet_NaN()); + current_statement__ = 2; theta = context__.vals_r("theta"); double tau; - tau = std::numeric_limits::quiet_NaN(); + tau = std::numeric_limits::quiet_NaN(); current_statement__ = 3; tau = context__.vals_r("tau")[(1 - 1)]; double tau_free__; - tau_free__ = std::numeric_limits::quiet_NaN(); + tau_free__ = std::numeric_limits::quiet_NaN(); current_statement__ = 3; tau_free__ = stan::math::lb_free(tau, 0); @@ -6246,7 +6341,8 @@ class expr_prop_fail2_model final : public model_base_crtp& names__) const { - names__ = std::vector{"mu", - "theta", - "tau"}; + names__ = std::vector{"mu", "theta", "tau"}; + } // get_param_names() inline void get_dims(std::vector>& dimss__) const { dimss__ = std::vector>{std::vector{}, - std::vector{static_cast(J)}, - std::vector{}}; + std::vector{static_cast(J)}, std::vector{ + }}; + } // get_dims() inline void constrained_param_names( @@ -6280,7 +6376,8 @@ class expr_prop_fail2_model final : public model_base_crtp vars_vec(vars.size()); + std::vector vars_vec; + vars_vec.reserve(vars.size()); std::vector params_i; write_array_impl(base_rng, params_r, params_i, vars_vec, emit_transformed_parameters, emit_generated_quantities, pstream); - vars.resize(vars_vec.size()); - for (int i = 0; i < vars.size(); ++i) { - vars.coeffRef(i) = vars_vec[i]; - } + vars = Eigen::Map>( + vars_vec.data(), vars_vec.size()); } template @@ -6350,7 +6449,8 @@ class expr_prop_fail2_model final : public model_base_crtp @@ -6371,13 +6471,12 @@ class expr_prop_fail2_model final : public model_base_crtp& params_r, std::ostream* pstream = nullptr) const final { - std::vector params_r_vec(params_r.size()); + std::vector params_r_vec; + params_r_vec.reserve(params_r.size()); std::vector params_i; transform_inits_impl(context, params_i, params_r_vec, pstream); - params_r.resize(params_r_vec.size()); - for (int i = 0; i < params_r.size(); ++i) { - params_r.coeffRef(i) = params_r_vec[i]; - } + params_r = Eigen::Map>( + params_r_vec.data(), params_r_vec.size()); } inline void transform_inits(const stan::io::var_context& context, std::vector& params_i, @@ -6576,13 +6675,13 @@ class expr_prop_fail3_model final : public model_base_crtp::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; current_statement__ = 22; context__.validate_dims("data initialization","N","int", - context__.to_vec()); - N = std::numeric_limits::min(); + std::vector{}); + N = std::numeric_limits::min(); current_statement__ = 22; N = context__.vals_i("N")[(1 - 1)]; @@ -6591,8 +6690,8 @@ class expr_prop_fail3_model final : public model_base_crtp::min(); + std::vector{}); + n_age = std::numeric_limits::min(); current_statement__ = 23; n_age = context__.vals_i("n_age")[(1 - 1)]; @@ -6601,8 +6700,8 @@ class expr_prop_fail3_model final : public model_base_crtp::min(); + std::vector{}); + n_age_edu = std::numeric_limits::min(); current_statement__ = 24; n_age_edu = context__.vals_i("n_age_edu")[(1 - 1)]; @@ -6611,8 +6710,8 @@ class expr_prop_fail3_model final : public model_base_crtp::min(); + std::vector{}); + n_edu = std::numeric_limits::min(); current_statement__ = 25; n_edu = context__.vals_i("n_edu")[(1 - 1)]; @@ -6621,8 +6720,8 @@ class expr_prop_fail3_model final : public model_base_crtp::min(); + std::vector{}); + n_region_full = std::numeric_limits::min(); current_statement__ = 26; n_region_full = context__.vals_i("n_region_full")[(1 - 1)]; @@ -6631,8 +6730,8 @@ class expr_prop_fail3_model final : public model_base_crtp::min(); + std::vector{}); + n_state = std::numeric_limits::min(); current_statement__ = 27; n_state = context__.vals_i("n_state")[(1 - 1)]; @@ -6643,8 +6742,8 @@ class expr_prop_fail3_model final : public model_base_crtp(N, std::numeric_limits::min()); + std::vector{static_cast(N)}); + age = std::vector(N, std::numeric_limits::min()); current_statement__ = 29; age = context__.vals_i("age"); @@ -6658,7 +6757,8 @@ class expr_prop_fail3_model final : public model_base_crtp(N, std::numeric_limits::min()); + std::vector{static_cast(N)}); + age_edu = std::vector(N, std::numeric_limits::min()); current_statement__ = 31; age_edu = context__.vals_i("age_edu"); @@ -6691,7 +6792,8 @@ class expr_prop_fail3_model final : public model_base_crtp{static_cast(N)}); black = Eigen::Matrix(N); - stan::math::fill(black, std::numeric_limits::quiet_NaN()); + stan::math::fill(black, std::numeric_limits::quiet_NaN()); { std::vector black_flat__; @@ -6732,7 +6835,8 @@ class expr_prop_fail3_model final : public model_base_crtp(N, std::numeric_limits::min()); + std::vector{static_cast(N)}); + edu = std::vector(N, std::numeric_limits::min()); current_statement__ = 35; edu = context__.vals_i("edu"); @@ -6778,7 +6884,8 @@ class expr_prop_fail3_model final : public model_base_crtp{static_cast(N)}); female = Eigen::Matrix(N); - stan::math::fill(female, std::numeric_limits::quiet_NaN()); + stan::math::fill(female, std::numeric_limits::quiet_NaN()); { std::vector female_flat__; @@ -6819,7 +6927,8 @@ class expr_prop_fail3_model final : public model_base_crtp(N, std::numeric_limits::min()); + std::vector{static_cast(N)}); + region_full = std::vector(N, std::numeric_limits::min()); current_statement__ = 39; region_full = context__.vals_i("region_full"); @@ -6866,7 +6977,8 @@ class expr_prop_fail3_model final : public model_base_crtp(N, std::numeric_limits::min()); + std::vector{static_cast(N)}); + state = std::vector(N, std::numeric_limits::min()); current_statement__ = 41; state = context__.vals_i("state"); @@ -6900,7 +7013,8 @@ class expr_prop_fail3_model final : public model_base_crtp{static_cast(N)}); v_prev_full = Eigen::Matrix(N); - stan::math::fill(v_prev_full, std::numeric_limits::quiet_NaN()); + stan::math::fill(v_prev_full, std::numeric_limits::quiet_NaN()); { std::vector v_prev_full_flat__; @@ -6941,15 +7056,16 @@ class expr_prop_fail3_model final : public model_base_crtp(N, std::numeric_limits::min()); + std::vector{static_cast(N)}); + y = std::vector(N, std::numeric_limits::min()); current_statement__ = 45; y = context__.vals_i("y"); @@ -6974,7 +7090,8 @@ class expr_prop_fail3_model final : public model_base_crtp a; a = Eigen::Matrix(n_age); - stan::math::fill(a, DUMMY_VAR__); + stan::math::fill(a, DUMMY_VAR__); current_statement__ = 1; a = in__.template read>(n_age); Eigen::Matrix b; b = Eigen::Matrix(n_edu); - stan::math::fill(b, DUMMY_VAR__); + stan::math::fill(b, DUMMY_VAR__); current_statement__ = 2; b = in__.template read>(n_edu); Eigen::Matrix c; c = Eigen::Matrix(n_age_edu); - stan::math::fill(c, DUMMY_VAR__); + stan::math::fill(c, DUMMY_VAR__); current_statement__ = 3; c = in__.template read>( n_age_edu); Eigen::Matrix d; d = Eigen::Matrix(n_state); - stan::math::fill(d, DUMMY_VAR__); + stan::math::fill(d, DUMMY_VAR__); current_statement__ = 4; d = in__.template read>(n_state); Eigen::Matrix e; e = Eigen::Matrix(n_region_full); - stan::math::fill(e, DUMMY_VAR__); + stan::math::fill(e, DUMMY_VAR__); current_statement__ = 5; e = in__.template read>( n_region_full); Eigen::Matrix beta; beta = Eigen::Matrix(5); - stan::math::fill(beta, DUMMY_VAR__); + stan::math::fill(beta, DUMMY_VAR__); current_statement__ = 6; beta = in__.template read>(5); local_scalar_t__ sigma_a; - sigma_a = DUMMY_VAR__; + sigma_a = DUMMY_VAR__; current_statement__ = 7; sigma_a = in__.template read_constrain_lub( 0, 100, lp__); local_scalar_t__ sigma_b; - sigma_b = DUMMY_VAR__; + sigma_b = DUMMY_VAR__; current_statement__ = 8; sigma_b = in__.template read_constrain_lub( 0, 100, lp__); local_scalar_t__ sigma_c; - sigma_c = DUMMY_VAR__; + sigma_c = DUMMY_VAR__; current_statement__ = 9; sigma_c = in__.template read_constrain_lub( 0, 100, lp__); local_scalar_t__ sigma_d; - sigma_d = DUMMY_VAR__; + sigma_d = DUMMY_VAR__; current_statement__ = 10; sigma_d = in__.template read_constrain_lub( 0, 100, lp__); local_scalar_t__ sigma_e; - sigma_e = DUMMY_VAR__; + sigma_e = DUMMY_VAR__; current_statement__ = 11; sigma_e = in__.template read_constrain_lub( 0, 100, lp__); Eigen::Matrix y_hat; y_hat = Eigen::Matrix(N); - stan::math::fill(y_hat, DUMMY_VAR__); + stan::math::fill(y_hat, DUMMY_VAR__); current_statement__ = 14; if (logical_gte(N, 1)) { @@ -7163,7 +7264,8 @@ class expr_prop_fail3_model final : public model_base_crtp a; a = Eigen::Matrix(n_age); - stan::math::fill(a, std::numeric_limits::quiet_NaN()); + stan::math::fill(a, std::numeric_limits::quiet_NaN()); current_statement__ = 1; a = in__.template read>(n_age); Eigen::Matrix b; b = Eigen::Matrix(n_edu); - stan::math::fill(b, std::numeric_limits::quiet_NaN()); + stan::math::fill(b, std::numeric_limits::quiet_NaN()); current_statement__ = 2; b = in__.template read>(n_edu); Eigen::Matrix c; c = Eigen::Matrix(n_age_edu); - stan::math::fill(c, std::numeric_limits::quiet_NaN()); + stan::math::fill(c, std::numeric_limits::quiet_NaN()); current_statement__ = 3; c = in__.template read>( n_age_edu); Eigen::Matrix d; d = Eigen::Matrix(n_state); - stan::math::fill(d, std::numeric_limits::quiet_NaN()); + stan::math::fill(d, std::numeric_limits::quiet_NaN()); current_statement__ = 4; d = in__.template read>(n_state); Eigen::Matrix e; e = Eigen::Matrix(n_region_full); - stan::math::fill(e, std::numeric_limits::quiet_NaN()); + stan::math::fill(e, std::numeric_limits::quiet_NaN()); current_statement__ = 5; e = in__.template read>( n_region_full); Eigen::Matrix beta; beta = Eigen::Matrix(5); - stan::math::fill(beta, std::numeric_limits::quiet_NaN()); + stan::math::fill(beta, std::numeric_limits::quiet_NaN()); current_statement__ = 6; beta = in__.template read>(5); double sigma_a; - sigma_a = std::numeric_limits::quiet_NaN(); + sigma_a = std::numeric_limits::quiet_NaN(); current_statement__ = 7; sigma_a = in__.template read_constrain_lub( 0, 100, lp__); double sigma_b; - sigma_b = std::numeric_limits::quiet_NaN(); + sigma_b = std::numeric_limits::quiet_NaN(); current_statement__ = 8; sigma_b = in__.template read_constrain_lub( 0, 100, lp__); double sigma_c; - sigma_c = std::numeric_limits::quiet_NaN(); + sigma_c = std::numeric_limits::quiet_NaN(); current_statement__ = 9; sigma_c = in__.template read_constrain_lub( 0, 100, lp__); double sigma_d; - sigma_d = std::numeric_limits::quiet_NaN(); + sigma_d = std::numeric_limits::quiet_NaN(); current_statement__ = 10; sigma_d = in__.template read_constrain_lub( 0, 100, lp__); double sigma_e; - sigma_e = std::numeric_limits::quiet_NaN(); + sigma_e = std::numeric_limits::quiet_NaN(); current_statement__ = 11; sigma_e = in__.template read_constrain_lub( 0, 100, lp__); Eigen::Matrix y_hat; y_hat = Eigen::Matrix(N); - stan::math::fill(y_hat, DUMMY_VAR__); + stan::math::fill(y_hat, DUMMY_VAR__); if (logical_gte(n_age, 1)) { vars__.emplace_back(rvalue(a, "a", index_uni(1))); for (int sym1__ = 2; sym1__ <= n_age; ++sym1__) { - vars__.emplace_back(a[(sym1__ - 1)]);} + vars__.emplace_back(a[(sym1__ - 1)]); + } } if (logical_gte(n_edu, 1)) { vars__.emplace_back(rvalue(b, "b", index_uni(1))); for (int sym1__ = 2; sym1__ <= n_edu; ++sym1__) { - vars__.emplace_back(b[(sym1__ - 1)]);} + vars__.emplace_back(b[(sym1__ - 1)]); + } } if (logical_gte(n_age_edu, 1)) { vars__.emplace_back(rvalue(c, "c", index_uni(1))); for (int sym1__ = 2; sym1__ <= n_age_edu; ++sym1__) { - vars__.emplace_back(c[(sym1__ - 1)]);} + vars__.emplace_back(c[(sym1__ - 1)]); + } } if (logical_gte(n_state, 1)) { vars__.emplace_back(rvalue(d, "d", index_uni(1))); for (int sym1__ = 2; sym1__ <= n_state; ++sym1__) { - vars__.emplace_back(d[(sym1__ - 1)]);} + vars__.emplace_back(d[(sym1__ - 1)]); + } } if (logical_gte(n_region_full, 1)) { vars__.emplace_back(rvalue(e, "e", index_uni(1))); for (int sym1__ = 2; sym1__ <= n_region_full; ++sym1__) { - vars__.emplace_back(e[(sym1__ - 1)]);} + vars__.emplace_back(e[(sym1__ - 1)]); + } } { vars__.emplace_back(rvalue(beta, "beta", index_uni(1))); @@ -7407,13 +7514,15 @@ class expr_prop_fail3_model final : public model_base_crtp::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; Eigen::Matrix a; a = Eigen::Matrix(n_age); - stan::math::fill(a, std::numeric_limits::quiet_NaN()); + stan::math::fill(a, std::numeric_limits::quiet_NaN()); { std::vector a_flat__; @@ -7494,12 +7603,13 @@ class expr_prop_fail3_model final : public model_base_crtp b; b = Eigen::Matrix(n_edu); - stan::math::fill(b, std::numeric_limits::quiet_NaN()); + stan::math::fill(b, std::numeric_limits::quiet_NaN()); { std::vector b_flat__; @@ -7519,12 +7629,13 @@ class expr_prop_fail3_model final : public model_base_crtp c; c = Eigen::Matrix(n_age_edu); - stan::math::fill(c, std::numeric_limits::quiet_NaN()); + stan::math::fill(c, std::numeric_limits::quiet_NaN()); { std::vector c_flat__; @@ -7544,12 +7655,13 @@ class expr_prop_fail3_model final : public model_base_crtp d; d = Eigen::Matrix(n_state); - stan::math::fill(d, std::numeric_limits::quiet_NaN()); + stan::math::fill(d, std::numeric_limits::quiet_NaN()); { std::vector d_flat__; @@ -7569,12 +7681,13 @@ class expr_prop_fail3_model final : public model_base_crtp e; e = Eigen::Matrix(n_region_full); - stan::math::fill(e, std::numeric_limits::quiet_NaN()); + stan::math::fill(e, std::numeric_limits::quiet_NaN()); { std::vector e_flat__; @@ -7594,12 +7707,13 @@ class expr_prop_fail3_model final : public model_base_crtp beta; beta = Eigen::Matrix(5); - stan::math::fill(beta, std::numeric_limits::quiet_NaN()); + stan::math::fill(beta, std::numeric_limits::quiet_NaN()); { std::vector beta_flat__; @@ -7644,79 +7758,84 @@ class expr_prop_fail3_model final : public model_base_crtp::quiet_NaN(); + sigma_a = std::numeric_limits::quiet_NaN(); current_statement__ = 7; sigma_a = context__.vals_r("sigma_a")[(1 - 1)]; double sigma_a_free__; - sigma_a_free__ = std::numeric_limits::quiet_NaN(); + sigma_a_free__ = std::numeric_limits::quiet_NaN(); current_statement__ = 7; sigma_a_free__ = stan::math::lub_free(sigma_a, 0, 100); double sigma_b; - sigma_b = std::numeric_limits::quiet_NaN(); + sigma_b = std::numeric_limits::quiet_NaN(); current_statement__ = 8; sigma_b = context__.vals_r("sigma_b")[(1 - 1)]; double sigma_b_free__; - sigma_b_free__ = std::numeric_limits::quiet_NaN(); + sigma_b_free__ = std::numeric_limits::quiet_NaN(); current_statement__ = 8; sigma_b_free__ = stan::math::lub_free(sigma_b, 0, 100); double sigma_c; - sigma_c = std::numeric_limits::quiet_NaN(); + sigma_c = std::numeric_limits::quiet_NaN(); current_statement__ = 9; sigma_c = context__.vals_r("sigma_c")[(1 - 1)]; double sigma_c_free__; - sigma_c_free__ = std::numeric_limits::quiet_NaN(); + sigma_c_free__ = std::numeric_limits::quiet_NaN(); current_statement__ = 9; sigma_c_free__ = stan::math::lub_free(sigma_c, 0, 100); double sigma_d; - sigma_d = std::numeric_limits::quiet_NaN(); + sigma_d = std::numeric_limits::quiet_NaN(); current_statement__ = 10; sigma_d = context__.vals_r("sigma_d")[(1 - 1)]; double sigma_d_free__; - sigma_d_free__ = std::numeric_limits::quiet_NaN(); + sigma_d_free__ = std::numeric_limits::quiet_NaN(); current_statement__ = 10; sigma_d_free__ = stan::math::lub_free(sigma_d, 0, 100); double sigma_e; - sigma_e = std::numeric_limits::quiet_NaN(); + sigma_e = std::numeric_limits::quiet_NaN(); current_statement__ = 11; sigma_e = context__.vals_r("sigma_e")[(1 - 1)]; double sigma_e_free__; - sigma_e_free__ = std::numeric_limits::quiet_NaN(); + sigma_e_free__ = std::numeric_limits::quiet_NaN(); current_statement__ = 11; sigma_e_free__ = stan::math::lub_free(sigma_e, 0, 100); if (lcm_sym1__) { vars__.emplace_back(rvalue(a, "a", index_uni(1))); for (int sym1__ = 2; sym1__ <= n_age; ++sym1__) { - vars__.emplace_back(a[(sym1__ - 1)]);} + vars__.emplace_back(a[(sym1__ - 1)]); + } } if (lcm_sym3__) { vars__.emplace_back(rvalue(b, "b", index_uni(1))); for (int sym1__ = 2; sym1__ <= n_edu; ++sym1__) { - vars__.emplace_back(b[(sym1__ - 1)]);} + vars__.emplace_back(b[(sym1__ - 1)]); + } } if (lcm_sym2__) { vars__.emplace_back(rvalue(c, "c", index_uni(1))); for (int sym1__ = 2; sym1__ <= n_age_edu; ++sym1__) { - vars__.emplace_back(c[(sym1__ - 1)]);} + vars__.emplace_back(c[(sym1__ - 1)]); + } } if (lcm_sym5__) { vars__.emplace_back(rvalue(d, "d", index_uni(1))); for (int sym1__ = 2; sym1__ <= n_state; ++sym1__) { - vars__.emplace_back(d[(sym1__ - 1)]);} + vars__.emplace_back(d[(sym1__ - 1)]); + } } if (lcm_sym4__) { vars__.emplace_back(rvalue(e, "e", index_uni(1))); for (int sym1__ = 2; sym1__ <= n_region_full; ++sym1__) { - vars__.emplace_back(e[(sym1__ - 1)]);} + vars__.emplace_back(e[(sym1__ - 1)]); + } } { vars__.emplace_back(rvalue(beta, "beta", index_uni(1))); @@ -7747,18 +7866,9 @@ class expr_prop_fail3_model final : public model_base_crtp& names__) const { - names__ = std::vector{"a", - "b", - "c", - "d", - "e", - "beta", - "sigma_a", - "sigma_b", - "sigma_c", - "sigma_d", - "sigma_e", - "y_hat"}; + names__ = std::vector{"a", "b", "c", "d", "e", "beta", + "sigma_a", "sigma_b", "sigma_c", "sigma_d", "sigma_e", "y_hat"}; + } // get_param_names() inline void get_dims(std::vector>& dimss__) const { @@ -7766,17 +7876,14 @@ class expr_prop_fail3_model final : public model_base_crtp>{std::vector{ static_cast(n_age) }, - std::vector{static_cast(n_edu)}, - std::vector{static_cast(n_age_edu)}, - std::vector{static_cast(n_state)}, - std::vector{static_cast(n_region_full)}, - std::vector{static_cast(5)}, - std::vector{}, - std::vector{}, - std::vector{}, - std::vector{}, - std::vector{}, - std::vector{static_cast(N)}}; + std::vector{static_cast(n_edu)}, + std::vector{static_cast(n_age_edu)}, + std::vector{static_cast(n_state)}, + std::vector{static_cast(n_region_full)}, + std::vector{static_cast(5)}, std::vector{ + }, std::vector{}, std::vector{}, std::vector{ + }, std::vector{}, std::vector{static_cast(N)}}; + } // get_dims() inline void constrained_param_names( @@ -7788,27 +7895,33 @@ class expr_prop_fail3_model final : public model_base_crtp vars_vec(vars.size()); + std::vector vars_vec; + vars_vec.reserve(vars.size()); std::vector params_i; write_array_impl(base_rng, params_r, params_i, vars_vec, emit_transformed_parameters, emit_generated_quantities, pstream); - vars.resize(vars_vec.size()); - for (int i = 0; i < vars.size(); ++i) { - vars.coeffRef(i) = vars_vec[i]; - } + vars = Eigen::Map>( + vars_vec.data(), vars_vec.size()); } template @@ -7911,7 +8033,8 @@ class expr_prop_fail3_model final : public model_base_crtp @@ -7932,13 +8055,12 @@ class expr_prop_fail3_model final : public model_base_crtp& params_r, std::ostream* pstream = nullptr) const final { - std::vector params_r_vec(params_r.size()); + std::vector params_r_vec; + params_r_vec.reserve(params_r.size()); std::vector params_i; transform_inits_impl(context, params_i, params_r_vec, pstream); - params_r.resize(params_r_vec.size()); - for (int i = 0; i < params_r.size(); ++i) { - params_r.coeffRef(i) = params_r_vec[i]; - } + params_r = Eigen::Map>( + params_r_vec.data(), params_r_vec.size()); } inline void transform_inits(const stan::io::var_context& context, std::vector& params_i, @@ -8099,13 +8221,13 @@ class expr_prop_fail4_model final : public model_base_crtp::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; current_statement__ = 28; context__.validate_dims("data initialization","N","int", - context__.to_vec()); - N = std::numeric_limits::min(); + std::vector{}); + N = std::numeric_limits::min(); current_statement__ = 28; N = context__.vals_i("N")[(1 - 1)]; @@ -8114,8 +8236,8 @@ class expr_prop_fail4_model final : public model_base_crtp::min(); + std::vector{}); + N_edges = std::numeric_limits::min(); current_statement__ = 29; N_edges = context__.vals_i("N_edges")[(1 - 1)]; @@ -8126,8 +8248,8 @@ class expr_prop_fail4_model final : public model_base_crtp(N_edges, std::numeric_limits::min()); + std::vector{static_cast(N_edges)}); + node1 = std::vector(N_edges, std::numeric_limits::min()); current_statement__ = 31; node1 = context__.vals_i("node1"); @@ -8141,7 +8263,8 @@ class expr_prop_fail4_model final : public model_base_crtp(N_edges, std::numeric_limits::min()); + std::vector{static_cast(N_edges)}); + node2 = std::vector(N_edges, std::numeric_limits::min()); current_statement__ = 33; node2 = context__.vals_i("node2"); @@ -8174,7 +8298,8 @@ class expr_prop_fail4_model final : public model_base_crtp{static_cast(N)}); E = Eigen::Matrix(N); - stan::math::fill(E, std::numeric_limits::quiet_NaN()); + stan::math::fill(E, std::numeric_limits::quiet_NaN()); { std::vector E_flat__; @@ -8214,7 +8340,8 @@ class expr_prop_fail4_model final : public model_base_crtp(N); - stan::math::fill(log_E, std::numeric_limits::quiet_NaN()); current_statement__ = 37; assign(log_E, stan::math::log(E), "assigning variable log_E"); current_statement__ = 38; - phi_std_raw_1dim__ = std::numeric_limits::min(); lcm_sym42__ = (N - 1); phi_std_raw_1dim__ = lcm_sym42__; @@ -8259,16 +8383,8 @@ class expr_prop_fail4_model final : public model_base_crtp( 0, lp__); Eigen::Matrix phi_std_raw; phi_std_raw = Eigen::Matrix((N - 1)); - stan::math::fill(phi_std_raw, DUMMY_VAR__); + stan::math::fill(phi_std_raw, DUMMY_VAR__); lcm_sym39__ = (N - 1); phi_std_raw = in__.template read>( lcm_sym39__); local_scalar_t__ sigma_phi; - sigma_phi = DUMMY_VAR__; + sigma_phi = DUMMY_VAR__; lcm_sym38__ = inv_sqrt(tau_phi); sigma_phi = lcm_sym38__; Eigen::Matrix phi; phi = Eigen::Matrix(N); - stan::math::fill(phi, DUMMY_VAR__); + stan::math::fill(phi, DUMMY_VAR__); current_statement__ = 5; assign(phi, phi_std_raw, @@ -8395,31 +8511,32 @@ class expr_prop_fail4_model final : public model_base_crtp::quiet_NaN(); + tau_phi = std::numeric_limits::quiet_NaN(); current_statement__ = 1; tau_phi = in__.template read_constrain_lb( 0, lp__); Eigen::Matrix phi_std_raw; phi_std_raw = Eigen::Matrix((N - 1)); - stan::math::fill(phi_std_raw, std::numeric_limits::quiet_NaN()); + stan::math::fill(phi_std_raw, std::numeric_limits::quiet_NaN()); lcm_sym20__ = (N - 1); phi_std_raw = in__.template read>( lcm_sym20__); double sigma_phi; - sigma_phi = std::numeric_limits::quiet_NaN(); + sigma_phi = std::numeric_limits::quiet_NaN(); Eigen::Matrix phi; phi = Eigen::Matrix(N); - stan::math::fill(phi, std::numeric_limits::quiet_NaN()); + stan::math::fill(phi, std::numeric_limits::quiet_NaN()); vars__.emplace_back(tau_phi); if (logical_gte(lcm_sym20__, 1)) { vars__.emplace_back( rvalue(phi_std_raw, "phi_std_raw", index_uni(1))); for (int sym1__ = 2; sym1__ <= lcm_sym20__; ++sym1__) { - vars__.emplace_back(phi_std_raw[(sym1__ - 1)]);} + vars__.emplace_back(phi_std_raw[(sym1__ - 1)]); + } } if (logical_negation((primitive_value(emit_transformed_parameters__) || primitive_value(emit_generated_quantities__)))) { @@ -8445,7 +8562,8 @@ class expr_prop_fail4_model final : public model_base_crtp::quiet_NaN(); + beta0 = std::numeric_limits::quiet_NaN(); double beta1; - beta1 = std::numeric_limits::quiet_NaN(); + beta1 = std::numeric_limits::quiet_NaN(); double tau_theta; - tau_theta = std::numeric_limits::quiet_NaN(); + tau_theta = std::numeric_limits::quiet_NaN(); double sigma_theta; - sigma_theta = std::numeric_limits::quiet_NaN(); + sigma_theta = std::numeric_limits::quiet_NaN(); Eigen::Matrix theta; theta = Eigen::Matrix(N); - stan::math::fill(theta, std::numeric_limits::quiet_NaN()); + stan::math::fill(theta, std::numeric_limits::quiet_NaN()); Eigen::Matrix theta_std; theta_std = Eigen::Matrix(N); - stan::math::fill(theta_std, std::numeric_limits::quiet_NaN()); + stan::math::fill(theta_std, std::numeric_limits::quiet_NaN()); Eigen::Matrix x; x = Eigen::Matrix(N); - stan::math::fill(x, std::numeric_limits::quiet_NaN()); + stan::math::fill(x, std::numeric_limits::quiet_NaN()); std::vector y; - y = std::vector(N, std::numeric_limits::min()); + y = std::vector(N, std::numeric_limits::min()); current_statement__ = 16; beta0 = normal_rng(0, 1, base_rng__); @@ -8493,7 +8611,8 @@ class expr_prop_fail4_model final : public model_base_crtp::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; double tau_phi; - tau_phi = std::numeric_limits::quiet_NaN(); + tau_phi = std::numeric_limits::quiet_NaN(); current_statement__ = 1; tau_phi = context__.vals_r("tau_phi")[(1 - 1)]; double tau_phi_free__; - tau_phi_free__ = std::numeric_limits::quiet_NaN(); + tau_phi_free__ = std::numeric_limits::quiet_NaN(); current_statement__ = 1; tau_phi_free__ = stan::math::lb_free(tau_phi, 0); Eigen::Matrix phi_std_raw; phi_std_raw = Eigen::Matrix((N - 1)); - stan::math::fill(phi_std_raw, std::numeric_limits::quiet_NaN()); + stan::math::fill(phi_std_raw, std::numeric_limits::quiet_NaN()); { std::vector phi_std_raw_flat__; @@ -8623,7 +8747,8 @@ class expr_prop_fail4_model final : public model_base_crtp& names__) const { - names__ = std::vector{"tau_phi", - "phi_std_raw", - "sigma_phi", - "phi", - "beta0", - "beta1", - "tau_theta", - "sigma_theta", - "theta", - "theta_std", - "x", - "y"}; + names__ = std::vector{"tau_phi", "phi_std_raw", "sigma_phi", + "phi", "beta0", "beta1", "tau_theta", "sigma_theta", "theta", + "theta_std", "x", "y"}; + } // get_param_names() inline void get_dims(std::vector>& dimss__) const { dimss__ = std::vector>{std::vector{}, - std::vector{static_cast(phi_std_raw_1dim__)}, - std::vector{}, - std::vector{static_cast(N)}, - std::vector{}, - std::vector{}, - std::vector{}, - std::vector{}, - std::vector{static_cast(N)}, - std::vector{static_cast(N)}, - std::vector{static_cast(N)}, - std::vector{static_cast(N)}}; + std::vector{static_cast(phi_std_raw_1dim__)}, + std::vector{}, std::vector{static_cast(N)}, + std::vector{}, std::vector{}, std::vector{ + }, std::vector{}, std::vector{static_cast(N)}, + std::vector{static_cast(N)}, + std::vector{static_cast(N)}, + std::vector{static_cast(N)}}; + } // get_dims() inline void constrained_param_names( @@ -8682,13 +8797,15 @@ class expr_prop_fail4_model final : public model_base_crtp vars_vec(vars.size()); + std::vector vars_vec; + vars_vec.reserve(vars.size()); std::vector params_i; write_array_impl(base_rng, params_r, params_i, vars_vec, emit_transformed_parameters, emit_generated_quantities, pstream); - vars.resize(vars_vec.size()); - for (int i = 0; i < vars.size(); ++i) { - vars.coeffRef(i) = vars_vec[i]; - } + vars = Eigen::Map>( + vars_vec.data(), vars_vec.size()); } template @@ -8796,7 +8924,8 @@ class expr_prop_fail4_model final : public model_base_crtp @@ -8817,13 +8946,12 @@ class expr_prop_fail4_model final : public model_base_crtp& params_r, std::ostream* pstream = nullptr) const final { - std::vector params_r_vec(params_r.size()); + std::vector params_r_vec; + params_r_vec.reserve(params_r.size()); std::vector params_i; transform_inits_impl(context, params_i, params_r_vec, pstream); - params_r.resize(params_r_vec.size()); - for (int i = 0; i < params_r.size(); ++i) { - params_r.coeffRef(i) = params_r_vec[i]; - } + params_r = Eigen::Map>( + params_r_vec.data(), params_r_vec.size()); } inline void transform_inits(const stan::io::var_context& context, std::vector& params_i, @@ -8975,7 +9103,8 @@ first_capture(const std::vector& y_i, std::ostream* pstream__) { if (rvalue(y_i, "y_i", index_uni(k))) { current_statement__ = 47; return k; - } } + } + } } current_statement__ = 66; return 0; @@ -9015,7 +9144,7 @@ last_capture(const std::vector& y_i, std::ostream* pstream__) { lcm_sym33__ = (size(y_i) - 1); if (logical_gte(lcm_sym33__, 0)) { int k; - k = std::numeric_limits::min(); + k = std::numeric_limits::min(); lcm_sym32__ = (size(y_i) - 0); current_statement__ = 54; @@ -9025,14 +9154,15 @@ last_capture(const std::vector& y_i, std::ostream* pstream__) { } for (int k_rev = 1; k_rev <= lcm_sym33__; ++k_rev) { int k; - k = std::numeric_limits::min(); + k = std::numeric_limits::min(); lcm_sym31__ = (size(y_i) - k_rev); current_statement__ = 54; if (y_i[(lcm_sym31__ - 1)]) { current_statement__ = 53; return lcm_sym31__; - } } + } + } } current_statement__ = 67; return 0; @@ -9085,7 +9215,7 @@ prob_uncaptured(const int& nind, const int& n_occasions, const T2__& p_arg__, validate_non_negative_index("chi", "n_occasions", n_occasions); Eigen::Matrix chi; chi = Eigen::Matrix(nind, n_occasions); - stan::math::fill(chi, DUMMY_VAR__); + stan::math::fill(chi, DUMMY_VAR__); current_statement__ = 69; if (logical_gte(nind, 1)) { @@ -9096,10 +9226,10 @@ prob_uncaptured(const int& nind, const int& n_occasions, const T2__& p_arg__, lcm_sym37__ = logical_gte(lcm_sym39__, 1); if (lcm_sym37__) { int t_curr; - t_curr = std::numeric_limits::min(); + t_curr = std::numeric_limits::min(); int t_next; - t_next = std::numeric_limits::min(); + t_next = std::numeric_limits::min(); lcm_sym41__ = (lcm_sym39__ + 1); current_statement__ = 24; @@ -9113,11 +9243,11 @@ prob_uncaptured(const int& nind, const int& n_occasions, const T2__& p_arg__, "assigning variable chi", index_uni(1), index_uni(lcm_sym39__)); for (int t = 2; t <= lcm_sym39__; ++t) { int t_curr; - t_curr = std::numeric_limits::min(); + t_curr = std::numeric_limits::min(); lcm_sym38__ = (n_occasions - t); int t_next; - t_next = std::numeric_limits::min(); + t_next = std::numeric_limits::min(); lcm_sym40__ = (lcm_sym38__ + 1); current_statement__ = 24; @@ -9140,10 +9270,10 @@ prob_uncaptured(const int& nind, const int& n_occasions, const T2__& p_arg__, current_statement__ = 68; if (lcm_sym37__) { int t_curr; - t_curr = std::numeric_limits::min(); + t_curr = std::numeric_limits::min(); int t_next; - t_next = std::numeric_limits::min(); + t_next = std::numeric_limits::min(); lcm_sym41__ = (lcm_sym39__ + 1); current_statement__ = 24; @@ -9159,11 +9289,11 @@ prob_uncaptured(const int& nind, const int& n_occasions, const T2__& p_arg__, "assigning variable chi", index_uni(i), index_uni(lcm_sym39__)); for (int t = 2; t <= lcm_sym39__; ++t) { int t_curr; - t_curr = std::numeric_limits::min(); + t_curr = std::numeric_limits::min(); lcm_sym38__ = (n_occasions - t); int t_next; - t_next = std::numeric_limits::min(); + t_next = std::numeric_limits::min(); lcm_sym40__ = (lcm_sym38__ + 1); current_statement__ = 24; @@ -9177,8 +9307,10 @@ prob_uncaptured(const int& nind, const int& n_occasions, const T2__& p_arg__, (1 - rvalue(phi, "phi", index_uni(i), index_uni(lcm_sym38__)))), "assigning variable chi", index_uni(i), - index_uni(lcm_sym38__));} - } } + index_uni(lcm_sym38__)); + } + } + } } current_statement__ = 70; return chi; @@ -9284,13 +9416,13 @@ class expr_prop_fail5_model final : public model_base_crtp::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; current_statement__ = 37; context__.validate_dims("data initialization","nind","int", - context__.to_vec()); - nind = std::numeric_limits::min(); + std::vector{}); + nind = std::numeric_limits::min(); current_statement__ = 37; nind = context__.vals_i("nind")[(1 - 1)]; @@ -9299,8 +9431,8 @@ class expr_prop_fail5_model final : public model_base_crtp::min(); + std::vector{}); + n_occasions = std::numeric_limits::min(); current_statement__ = 38; n_occasions = context__.vals_i("n_occasions")[(1 - 1)]; @@ -9313,8 +9445,10 @@ class expr_prop_fail5_model final : public model_base_crtp{static_cast(nind), + static_cast(n_occasions)}); y = std::vector>(nind, std::vector(n_occasions, std::numeric_limits::min())); + { std::vector y_flat__; @@ -9337,7 +9471,8 @@ class expr_prop_fail5_model final : public model_base_crtp::min(); lcm_sym155__ = (n_occasions - 1); n_occ_minus_1 = lcm_sym155__; current_statement__ = 43; validate_non_negative_index("first", "nind", nind); current_statement__ = 44; - first = std::vector(nind, std::numeric_limits::min()); current_statement__ = 45; validate_non_negative_index("last", "nind", nind); current_statement__ = 46; - last = std::vector(nind, std::numeric_limits::min()); current_statement__ = 51; if (lcm_sym154__) { int inline_sym17__; int inline_sym19__; - inline_sym19__ = std::numeric_limits::min(); + inline_sym19__ = std::numeric_limits::min(); inline_sym19__ = 0; for (int inline_sym20__ = 1; inline_sym20__ <= 1; ++inline_sym20__) { @@ -9452,19 +9592,21 @@ class expr_prop_fail5_model final : public model_base_crtp::min(); + inline_sym19__ = std::numeric_limits::min(); inline_sym19__ = 0; for (int inline_sym20__ = 1; inline_sym20__ <= 1; ++inline_sym20__) { @@ -9476,21 +9618,24 @@ class expr_prop_fail5_model final : public model_base_crtp::min(); + inline_sym24__ = std::numeric_limits::min(); inline_sym24__ = 0; for (int inline_sym25__ = 1; inline_sym25__ <= 1; ++inline_sym25__) { @@ -9499,7 +9644,7 @@ class expr_prop_fail5_model final : public model_base_crtp::min(); + inline_sym22__ = std::numeric_limits::min(); lcm_sym158__ = (lcm_sym162__ - inline_sym23__); inline_sym22__ = lcm_sym158__; @@ -9508,18 +9653,20 @@ class expr_prop_fail5_model final : public model_base_crtp::min(); + inline_sym24__ = std::numeric_limits::min(); inline_sym24__ = 0; for (int inline_sym25__ = 1; inline_sym25__ <= 1; ++inline_sym25__) { @@ -9528,7 +9675,7 @@ class expr_prop_fail5_model final : public model_base_crtp::min(); + inline_sym22__ = std::numeric_limits::min(); lcm_sym156__ = (lcm_sym161__ - inline_sym23__); inline_sym22__ = lcm_sym156__; @@ -9537,15 +9684,18 @@ class expr_prop_fail5_model final : public model_base_crtp( 0, 1, lp__); local_scalar_t__ mean_p; - mean_p = DUMMY_VAR__; + mean_p = DUMMY_VAR__; current_statement__ = 2; mean_p = in__.template read_constrain_lub( 0, 1, lp__); Eigen::Matrix epsilon; epsilon = Eigen::Matrix(nind); - stan::math::fill(epsilon, DUMMY_VAR__); + stan::math::fill(epsilon, DUMMY_VAR__); current_statement__ = 3; epsilon = in__.template read>( nind); local_scalar_t__ sigma; - sigma = DUMMY_VAR__; + sigma = DUMMY_VAR__; current_statement__ = 4; sigma = in__.template read_constrain_lub( 0, 5, lp__); Eigen::Matrix phi; phi = Eigen::Matrix(nind, (n_occasions - 1)); - stan::math::fill(phi, DUMMY_VAR__); + stan::math::fill(phi, DUMMY_VAR__); Eigen::Matrix p; p = Eigen::Matrix(nind, (n_occasions - 1)); - stan::math::fill(p, DUMMY_VAR__); + stan::math::fill(p, DUMMY_VAR__); Eigen::Matrix chi; chi = Eigen::Matrix(nind, n_occasions); - stan::math::fill(chi, DUMMY_VAR__); + stan::math::fill(chi, DUMMY_VAR__); local_scalar_t__ mu; - mu = DUMMY_VAR__; + mu = DUMMY_VAR__; lcm_sym135__ = logit(mean_phi); mu = lcm_sym135__; @@ -9774,7 +9918,8 @@ class expr_prop_fail5_model final : public model_base_crtp inline_sym9__; int inline_sym15__; - inline_sym15__ = std::numeric_limits::min(); + inline_sym15__ = std::numeric_limits::min(); inline_sym15__ = 0; for (int inline_sym16__ = 1; inline_sym16__ <= 1; ++inline_sym16__) { @@ -9824,7 +9971,7 @@ class expr_prop_fail5_model final : public model_base_crtp inline_sym10__; inline_sym10__ = Eigen::Matrix(nind, n_occasions); - stan::math::fill(inline_sym10__, DUMMY_VAR__); + stan::math::fill(inline_sym10__, DUMMY_VAR__); for (int inline_sym14__ = 1; inline_sym14__ <= nind; ++inline_sym14__) { current_statement__ = 21; @@ -9834,10 +9981,10 @@ class expr_prop_fail5_model final : public model_base_crtp::min(); + inline_sym11__ = std::numeric_limits::min(); int inline_sym12__; - inline_sym12__ = std::numeric_limits::min(); + inline_sym12__ = std::numeric_limits::min(); lcm_sym116__ = (lcm_sym112__ + 1); current_statement__ = 24; @@ -9859,10 +10006,10 @@ class expr_prop_fail5_model final : public model_base_crtp::min(); + inline_sym11__ = std::numeric_limits::min(); int inline_sym12__; - inline_sym12__ = std::numeric_limits::min(); + inline_sym12__ = std::numeric_limits::min(); lcm_sym111__ = (n_occasions - inline_sym13__); lcm_sym115__ = (lcm_sym111__ + 1); @@ -9886,14 +10033,16 @@ class expr_prop_fail5_model final : public model_base_crtp( rvalue(y, "y", index_uni(1), index_uni(t)), - rvalue(p, "p", index_uni(1), index_uni((t - 1)))));} + rvalue(p, "p", index_uni(1), index_uni((t - 1))))); + } } current_statement__ = 33; lp_accum__.add( @@ -10159,14 +10324,16 @@ class expr_prop_fail5_model final : public model_base_crtp( rvalue(y, "y", index_uni(i), index_uni(t)), - rvalue(p, "p", index_uni(i), index_uni((t - 1)))));} + rvalue(p, "p", index_uni(i), index_uni((t - 1))))); + } } current_statement__ = 33; lp_accum__.add( bernoulli_lpmf(1, rvalue(inline_sym9__, "inline_sym9__", index_uni(i), index_uni(lcm_sym143__)))); - } } + } + } } } } catch (const std::exception& e) { @@ -10250,44 +10417,44 @@ class expr_prop_fail5_model final : public model_base_crtp::quiet_NaN(); + mean_phi = std::numeric_limits::quiet_NaN(); current_statement__ = 1; mean_phi = in__.template read_constrain_lub( 0, 1, lp__); double mean_p; - mean_p = std::numeric_limits::quiet_NaN(); + mean_p = std::numeric_limits::quiet_NaN(); current_statement__ = 2; mean_p = in__.template read_constrain_lub( 0, 1, lp__); Eigen::Matrix epsilon; epsilon = Eigen::Matrix(nind); - stan::math::fill(epsilon, std::numeric_limits::quiet_NaN()); + stan::math::fill(epsilon, std::numeric_limits::quiet_NaN()); current_statement__ = 3; epsilon = in__.template read>( nind); double sigma; - sigma = std::numeric_limits::quiet_NaN(); + sigma = std::numeric_limits::quiet_NaN(); current_statement__ = 4; sigma = in__.template read_constrain_lub( 0, 5, lp__); Eigen::Matrix phi; phi = Eigen::Matrix(nind, (n_occasions - 1)); - stan::math::fill(phi, DUMMY_VAR__); + stan::math::fill(phi, DUMMY_VAR__); Eigen::Matrix p; p = Eigen::Matrix(nind, (n_occasions - 1)); - stan::math::fill(p, std::numeric_limits::quiet_NaN()); + stan::math::fill(p, std::numeric_limits::quiet_NaN()); Eigen::Matrix chi; chi = Eigen::Matrix(nind, n_occasions); - stan::math::fill(chi, DUMMY_VAR__); + stan::math::fill(chi, DUMMY_VAR__); double mu; - mu = std::numeric_limits::quiet_NaN(); + mu = std::numeric_limits::quiet_NaN(); vars__.emplace_back(mean_phi); vars__.emplace_back(mean_p); @@ -10295,7 +10462,8 @@ class expr_prop_fail5_model final : public model_base_crtp inline_sym1__; int inline_sym7__; - inline_sym7__ = std::numeric_limits::min(); + inline_sym7__ = std::numeric_limits::min(); inline_sym7__ = 0; for (int inline_sym8__ = 1; inline_sym8__ <= 1; ++inline_sym8__) { @@ -10387,7 +10558,7 @@ class expr_prop_fail5_model final : public model_base_crtp inline_sym2__; inline_sym2__ = Eigen::Matrix(nind, n_occasions); - stan::math::fill(inline_sym2__, DUMMY_VAR__); + stan::math::fill(inline_sym2__, DUMMY_VAR__); for (int inline_sym6__ = 1; inline_sym6__ <= nind; ++inline_sym6__) { current_statement__ = 21; @@ -10397,10 +10568,10 @@ class expr_prop_fail5_model final : public model_base_crtp::min(); + inline_sym3__ = std::numeric_limits::min(); int inline_sym4__; - inline_sym4__ = std::numeric_limits::min(); + inline_sym4__ = std::numeric_limits::min(); lcm_sym66__ = (lcm_sym60__ + 1); current_statement__ = 24; @@ -10421,10 +10592,10 @@ class expr_prop_fail5_model final : public model_base_crtp::min(); + inline_sym3__ = std::numeric_limits::min(); int inline_sym4__; - inline_sym4__ = std::numeric_limits::min(); + inline_sym4__ = std::numeric_limits::min(); lcm_sym59__ = (n_occasions - inline_sym5__); lcm_sym65__ = (lcm_sym59__ + 1); @@ -10448,14 +10619,16 @@ class expr_prop_fail5_model final : public model_base_crtp::quiet_NaN(); + sigma2 = std::numeric_limits::quiet_NaN(); lcm_sym74__ = square(sigma); sigma2 = lcm_sym74__; @@ -10755,32 +10952,32 @@ class expr_prop_fail5_model final : public model_base_crtp::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; double mean_phi; - mean_phi = std::numeric_limits::quiet_NaN(); + mean_phi = std::numeric_limits::quiet_NaN(); current_statement__ = 1; mean_phi = context__.vals_r("mean_phi")[(1 - 1)]; double mean_phi_free__; - mean_phi_free__ = std::numeric_limits::quiet_NaN(); + mean_phi_free__ = std::numeric_limits::quiet_NaN(); current_statement__ = 1; mean_phi_free__ = stan::math::lub_free(mean_phi, 0, 1); double mean_p; - mean_p = std::numeric_limits::quiet_NaN(); + mean_p = std::numeric_limits::quiet_NaN(); current_statement__ = 2; mean_p = context__.vals_r("mean_p")[(1 - 1)]; double mean_p_free__; - mean_p_free__ = std::numeric_limits::quiet_NaN(); + mean_p_free__ = std::numeric_limits::quiet_NaN(); current_statement__ = 2; mean_p_free__ = stan::math::lub_free(mean_p, 0, 1); Eigen::Matrix epsilon; epsilon = Eigen::Matrix(nind); - stan::math::fill(epsilon, std::numeric_limits::quiet_NaN()); + stan::math::fill(epsilon, std::numeric_limits::quiet_NaN()); { std::vector epsilon_flat__; @@ -10801,16 +10998,17 @@ class expr_prop_fail5_model final : public model_base_crtp::quiet_NaN(); + sigma = std::numeric_limits::quiet_NaN(); current_statement__ = 4; sigma = context__.vals_r("sigma")[(1 - 1)]; double sigma_free__; - sigma_free__ = std::numeric_limits::quiet_NaN(); + sigma_free__ = std::numeric_limits::quiet_NaN(); current_statement__ = 4; sigma_free__ = stan::math::lub_free(sigma, 0, 5); @@ -10819,7 +11017,8 @@ class expr_prop_fail5_model final : public model_base_crtp& names__) const { - names__ = std::vector{"mean_phi", - "mean_p", - "epsilon", - "sigma", - "phi", - "p", - "chi", - "mu", - "sigma2"}; + names__ = std::vector{"mean_phi", "mean_p", "epsilon", + "sigma", "phi", "p", "chi", "mu", "sigma2"}; + } // get_param_names() inline void get_dims(std::vector>& dimss__) const { dimss__ = std::vector>{std::vector{}, - std::vector{}, - std::vector{static_cast(nind)}, - std::vector{}, - std::vector{static_cast(nind), - static_cast(n_occ_minus_1)}, - std::vector{static_cast(nind), - static_cast(n_occ_minus_1)}, - std::vector{static_cast(nind), - static_cast(n_occasions)}, - std::vector{}, - std::vector{}}; + std::vector{}, std::vector{static_cast(nind)}, + std::vector{}, + std::vector{static_cast(nind), + static_cast(n_occ_minus_1)}, + std::vector{static_cast(nind), + static_cast(n_occ_minus_1)}, + std::vector{static_cast(nind), + static_cast(n_occasions)}, + std::vector{}, std::vector{}}; + } // get_dims() inline void constrained_param_names( @@ -10869,7 +11061,8 @@ class expr_prop_fail5_model final : public model_base_crtp vars_vec(vars.size()); + std::vector vars_vec; + vars_vec.reserve(vars.size()); std::vector params_i; write_array_impl(base_rng, params_r, params_i, vars_vec, emit_transformed_parameters, emit_generated_quantities, pstream); - vars.resize(vars_vec.size()); - for (int i = 0; i < vars.size(); ++i) { - vars.coeffRef(i) = vars_vec[i]; - } + vars = Eigen::Map>( + vars_vec.data(), vars_vec.size()); } template @@ -10982,7 +11189,8 @@ class expr_prop_fail5_model final : public model_base_crtp @@ -11003,13 +11211,12 @@ class expr_prop_fail5_model final : public model_base_crtp& params_r, std::ostream* pstream = nullptr) const final { - std::vector params_r_vec(params_r.size()); + std::vector params_r_vec; + params_r_vec.reserve(params_r.size()); std::vector params_i; transform_inits_impl(context, params_i, params_r_vec, pstream); - params_r.resize(params_r_vec.size()); - for (int i = 0; i < params_r.size(); ++i) { - params_r.coeffRef(i) = params_r_vec[i]; - } + params_r = Eigen::Map>( + params_r_vec.data(), params_r_vec.size()); } inline void transform_inits(const stan::io::var_context& context, std::vector& params_i, @@ -11237,7 +11444,8 @@ first_capture(const std::vector& y_i, std::ostream* pstream__) { if (rvalue(y_i, "y_i", index_uni(k))) { current_statement__ = 59; return k; - } } + } + } } current_statement__ = 138; return 0; @@ -11277,7 +11485,7 @@ last_capture(const std::vector& y_i, std::ostream* pstream__) { lcm_sym50__ = (size(y_i) - 1); if (logical_gte(lcm_sym50__, 0)) { int k; - k = std::numeric_limits::min(); + k = std::numeric_limits::min(); lcm_sym49__ = (size(y_i) - 0); current_statement__ = 119; @@ -11287,14 +11495,15 @@ last_capture(const std::vector& y_i, std::ostream* pstream__) { } for (int k_rev = 1; k_rev <= lcm_sym50__; ++k_rev) { int k; - k = std::numeric_limits::min(); + k = std::numeric_limits::min(); lcm_sym48__ = (size(y_i) - k_rev); current_statement__ = 119; if (y_i[(lcm_sym48__ - 1)]) { current_statement__ = 118; return lcm_sym48__; - } } + } + } } current_statement__ = 139; return 0; @@ -11344,11 +11553,11 @@ prob_uncaptured(const T0__& p_arg__, const T1__& phi_arg__, int lcm_sym53__; { int n_ind; - n_ind = std::numeric_limits::min(); + n_ind = std::numeric_limits::min(); lcm_sym64__ = rows(p); int n_occasions; - n_occasions = std::numeric_limits::min(); + n_occasions = std::numeric_limits::min(); lcm_sym59__ = cols(p); n_occasions = lcm_sym59__; @@ -11358,7 +11567,7 @@ prob_uncaptured(const T0__& p_arg__, const T1__& phi_arg__, validate_non_negative_index("chi", "n_occasions", lcm_sym59__); Eigen::Matrix chi; chi = Eigen::Matrix(lcm_sym64__, lcm_sym59__); - stan::math::fill(chi, DUMMY_VAR__); + stan::math::fill(chi, DUMMY_VAR__); current_statement__ = 141; if (logical_gte(lcm_sym64__, 1)) { @@ -11369,10 +11578,10 @@ prob_uncaptured(const T0__& p_arg__, const T1__& phi_arg__, lcm_sym53__ = logical_gte(lcm_sym56__, 1); if (lcm_sym53__) { int t_curr; - t_curr = std::numeric_limits::min(); + t_curr = std::numeric_limits::min(); int t_next; - t_next = std::numeric_limits::min(); + t_next = std::numeric_limits::min(); lcm_sym58__ = (lcm_sym56__ + 1); current_statement__ = 30; @@ -11385,11 +11594,11 @@ prob_uncaptured(const T0__& p_arg__, const T1__& phi_arg__, "assigning variable chi", index_uni(1), index_uni(lcm_sym56__)); for (int t = 2; t <= lcm_sym56__; ++t) { int t_curr; - t_curr = std::numeric_limits::min(); + t_curr = std::numeric_limits::min(); lcm_sym55__ = (lcm_sym59__ - t); int t_next; - t_next = std::numeric_limits::min(); + t_next = std::numeric_limits::min(); lcm_sym57__ = (lcm_sym55__ + 1); current_statement__ = 30; @@ -11410,10 +11619,10 @@ prob_uncaptured(const T0__& p_arg__, const T1__& phi_arg__, current_statement__ = 140; if (lcm_sym53__) { int t_curr; - t_curr = std::numeric_limits::min(); + t_curr = std::numeric_limits::min(); int t_next; - t_next = std::numeric_limits::min(); + t_next = std::numeric_limits::min(); lcm_sym58__ = (lcm_sym56__ + 1); current_statement__ = 30; @@ -11427,11 +11636,11 @@ prob_uncaptured(const T0__& p_arg__, const T1__& phi_arg__, "assigning variable chi", index_uni(i), index_uni(lcm_sym56__)); for (int t = 2; t <= lcm_sym56__; ++t) { int t_curr; - t_curr = std::numeric_limits::min(); + t_curr = std::numeric_limits::min(); lcm_sym55__ = (lcm_sym59__ - t); int t_next; - t_next = std::numeric_limits::min(); + t_next = std::numeric_limits::min(); lcm_sym57__ = (lcm_sym55__ + 1); current_statement__ = 30; @@ -11444,8 +11653,10 @@ prob_uncaptured(const T0__& p_arg__, const T1__& phi_arg__, (1 - rvalue(phi, "phi", index_uni(i), index_uni(lcm_sym55__)))), "assigning variable chi", index_uni(i), - index_uni(lcm_sym55__));} - } } + index_uni(lcm_sym55__)); + } + } + } } current_statement__ = 142; return chi; @@ -11542,11 +11753,11 @@ js_super_lp(const std::vector>& y, int lcm_sym65__; { int n_ind; - n_ind = std::numeric_limits::min(); + n_ind = std::numeric_limits::min(); lcm_sym114__ = rvalue(dims(y), "dims(y)", index_uni(1)); int n_occasions; - n_occasions = std::numeric_limits::min(); + n_occasions = std::numeric_limits::min(); lcm_sym115__ = rvalue(dims(y), "dims(y)", index_uni(2)); n_occasions = lcm_sym115__; @@ -11554,7 +11765,7 @@ js_super_lp(const std::vector>& y, validate_non_negative_index("qnu", "n_occasions", lcm_sym115__); Eigen::Matrix qnu; qnu = Eigen::Matrix(lcm_sym115__); - stan::math::fill(qnu, std::numeric_limits::quiet_NaN()); + stan::math::fill(qnu, std::numeric_limits::quiet_NaN()); assign(lcm_sym73__, subtract(1.0, nu), "assigning variable lcm_sym73__"); current_statement__ = 145; @@ -11563,7 +11774,7 @@ js_super_lp(const std::vector>& y, validate_non_negative_index("qp", "n_occasions", lcm_sym115__); Eigen::Matrix qp; qp = Eigen::Matrix(lcm_sym115__); - stan::math::fill(qp, std::numeric_limits::quiet_NaN()); + stan::math::fill(qp, std::numeric_limits::quiet_NaN()); assign(lcm_sym75__, subtract(1.0, transpose(rvalue(p, "p", index_uni(1)))), @@ -11584,7 +11795,7 @@ js_super_lp(const std::vector>& y, validate_non_negative_index("lp", "first[i]", lcm_sym111__); Eigen::Matrix lp; lp = Eigen::Matrix(lcm_sym111__); - stan::math::fill(lp, DUMMY_VAR__); + stan::math::fill(lp, DUMMY_VAR__); lcm_sym77__ = (lcm_sym111__ - 1); assign(lp, @@ -11640,7 +11851,8 @@ js_super_lp(const std::vector>& y, index_uni(1), index_min_max(t, lcm_sym77__))))) + bernoulli_lpmf(1, rvalue(p, "p", index_uni(1), index_uni(lcm_sym111__)))), - "assigning variable lp", index_uni(t));} + "assigning variable lp", index_uni(t)); + } } current_statement__ = 93; assign(lp, @@ -11676,7 +11888,8 @@ js_super_lp(const std::vector>& y, lp_accum__.add( bernoulli_lpmf( rvalue(y, "y", index_uni(1), index_uni(t)), - rvalue(p, "p", index_uni(1), index_uni(t))));} + rvalue(p, "p", index_uni(1), index_uni(t)))); + } } current_statement__ = 101; lp_accum__.add( @@ -11687,7 +11900,7 @@ js_super_lp(const std::vector>& y, validate_non_negative_index("lp", "n_occasions + 1", lcm_sym94__); Eigen::Matrix lp; lp = Eigen::Matrix(lcm_sym94__); - stan::math::fill(lp, DUMMY_VAR__); + stan::math::fill(lp, DUMMY_VAR__); current_statement__ = 103; assign(lp, @@ -11727,7 +11940,8 @@ js_super_lp(const std::vector>& y, rvalue(p, "p", index_uni(1), index_uni(t)))) + bernoulli_lpmf(1, rvalue(chi, "chi", index_uni(1), index_uni(t)))), - "assigning variable lp", index_uni(t));} + "assigning variable lp", index_uni(t)); + } } current_statement__ = 86; assign(lp, bernoulli_lpmf(0, psi), @@ -11740,7 +11954,7 @@ js_super_lp(const std::vector>& y, validate_non_negative_index("qp", "n_occasions", lcm_sym115__); Eigen::Matrix qp; qp = Eigen::Matrix(lcm_sym115__); - stan::math::fill(qp, std::numeric_limits::quiet_NaN()); + stan::math::fill(qp, std::numeric_limits::quiet_NaN()); assign(lcm_sym74__, subtract(1.0, transpose(rvalue(p, "p", index_uni(i)))), @@ -11761,7 +11975,7 @@ js_super_lp(const std::vector>& y, validate_non_negative_index("lp", "first[i]", lcm_sym110__); Eigen::Matrix lp; lp = Eigen::Matrix(lcm_sym110__); - stan::math::fill(lp, DUMMY_VAR__); + stan::math::fill(lp, DUMMY_VAR__); lcm_sym76__ = (lcm_sym110__ - 1); assign(lp, @@ -11818,7 +12032,8 @@ js_super_lp(const std::vector>& y, + bernoulli_lpmf(1, rvalue(p, "p", index_uni(i), index_uni(lcm_sym110__)))), - "assigning variable lp", index_uni(t));} + "assigning variable lp", index_uni(t)); + } } current_statement__ = 93; assign(lp, @@ -11854,7 +12069,8 @@ js_super_lp(const std::vector>& y, lp_accum__.add( bernoulli_lpmf( rvalue(y, "y", index_uni(i), index_uni(t)), - rvalue(p, "p", index_uni(i), index_uni(t))));} + rvalue(p, "p", index_uni(i), index_uni(t)))); + } } current_statement__ = 101; lp_accum__.add( @@ -11865,7 +12081,7 @@ js_super_lp(const std::vector>& y, validate_non_negative_index("lp", "n_occasions + 1", lcm_sym94__); Eigen::Matrix lp; lp = Eigen::Matrix(lcm_sym94__); - stan::math::fill(lp, DUMMY_VAR__); + stan::math::fill(lp, DUMMY_VAR__); current_statement__ = 103; assign(lp, @@ -11906,14 +12122,16 @@ js_super_lp(const std::vector>& y, rvalue(p, "p", index_uni(i), index_uni(t)))) + bernoulli_lpmf(1, rvalue(chi, "chi", index_uni(i), index_uni(t)))), - "assigning variable lp", index_uni(t));} + "assigning variable lp", index_uni(t)); + } } current_statement__ = 86; assign(lp, bernoulli_lpmf(0, psi), "assigning variable lp", index_uni(lcm_sym94__)); current_statement__ = 87; lp_accum__.add(log_sum_exp(lp)); - }} + } + } } } } catch (const std::exception& e) { @@ -12021,13 +12239,13 @@ class expr_prop_fail6_model final : public model_base_crtp::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; current_statement__ = 106; context__.validate_dims("data initialization","M","int", - context__.to_vec()); - M = std::numeric_limits::min(); + std::vector{}); + M = std::numeric_limits::min(); current_statement__ = 106; M = context__.vals_i("M")[(1 - 1)]; @@ -12036,8 +12254,8 @@ class expr_prop_fail6_model final : public model_base_crtp::min(); + std::vector{}); + n_occasions = std::numeric_limits::min(); current_statement__ = 107; n_occasions = context__.vals_i("n_occasions")[(1 - 1)]; @@ -12050,8 +12268,10 @@ class expr_prop_fail6_model final : public model_base_crtp{static_cast(M), + static_cast(n_occasions)}); y = std::vector>(M, std::vector(n_occasions, std::numeric_limits::min())); + { std::vector y_flat__; @@ -12074,7 +12294,8 @@ class expr_prop_fail6_model final : public model_base_crtp(M, std::numeric_limits::min()); current_statement__ = 113; validate_non_negative_index("last", "M", M); current_statement__ = 114; - last = std::vector(M, std::numeric_limits::min()); current_statement__ = 116; if (lcm_sym309__) { int inline_sym34__; int inline_sym36__; - inline_sym36__ = std::numeric_limits::min(); + inline_sym36__ = std::numeric_limits::min(); inline_sym36__ = 0; for (int inline_sym37__ = 1; inline_sym37__ <= 1; ++inline_sym37__) { @@ -12184,19 +12411,21 @@ class expr_prop_fail6_model final : public model_base_crtp::min(); + inline_sym36__ = std::numeric_limits::min(); inline_sym36__ = 0; for (int inline_sym37__ = 1; inline_sym37__ <= 1; ++inline_sym37__) { @@ -12208,21 +12437,24 @@ class expr_prop_fail6_model final : public model_base_crtp::min(); + inline_sym41__ = std::numeric_limits::min(); inline_sym41__ = 0; for (int inline_sym42__ = 1; inline_sym42__ <= 1; ++inline_sym42__) { @@ -12231,7 +12463,7 @@ class expr_prop_fail6_model final : public model_base_crtp::min(); + inline_sym39__ = std::numeric_limits::min(); lcm_sym314__ = (lcm_sym318__ - inline_sym40__); inline_sym39__ = lcm_sym314__; @@ -12240,18 +12472,20 @@ class expr_prop_fail6_model final : public model_base_crtp::min(); + inline_sym41__ = std::numeric_limits::min(); inline_sym41__ = 0; for (int inline_sym42__ = 1; inline_sym42__ <= 1; ++inline_sym42__) { @@ -12260,7 +12494,7 @@ class expr_prop_fail6_model final : public model_base_crtp::min(); + inline_sym39__ = std::numeric_limits::min(); lcm_sym312__ = (lcm_sym317__ - inline_sym40__); inline_sym39__ = lcm_sym312__; @@ -12269,15 +12503,18 @@ class expr_prop_fail6_model final : public model_base_crtp::min(); lcm_sym311__ = (n_occasions - 1); phi_2dim__ = lcm_sym311__; @@ -12365,20 +12605,8 @@ class expr_prop_fail6_model final : public model_base_crtp lcm_sym220__; local_scalar_t__ mean_phi; - mean_phi = DUMMY_VAR__; + mean_phi = DUMMY_VAR__; current_statement__ = 1; mean_phi = in__.template read_constrain_lub( 0, 1, lp__); local_scalar_t__ mean_p; - mean_p = DUMMY_VAR__; + mean_p = DUMMY_VAR__; current_statement__ = 2; mean_p = in__.template read_constrain_lub( 0, 1, lp__); local_scalar_t__ psi; - psi = DUMMY_VAR__; + psi = DUMMY_VAR__; current_statement__ = 3; psi = in__.template read_constrain_lub(0, 1, lp__); Eigen::Matrix beta; beta = Eigen::Matrix(n_occasions); - stan::math::fill(beta, DUMMY_VAR__); + stan::math::fill(beta, DUMMY_VAR__); current_statement__ = 4; beta = in__.template read_constrain_lb, jacobian__>( 0, lp__, n_occasions); Eigen::Matrix epsilon; epsilon = Eigen::Matrix(M); - stan::math::fill(epsilon, DUMMY_VAR__); + stan::math::fill(epsilon, DUMMY_VAR__); current_statement__ = 5; epsilon = in__.template read>(M); local_scalar_t__ sigma; - sigma = DUMMY_VAR__; + sigma = DUMMY_VAR__; current_statement__ = 6; sigma = in__.template read_constrain_lub( 0, 5, lp__); Eigen::Matrix phi; phi = Eigen::Matrix(M, (n_occasions - 1)); - stan::math::fill(phi, DUMMY_VAR__); + stan::math::fill(phi, DUMMY_VAR__); Eigen::Matrix p; p = Eigen::Matrix(M, n_occasions); - stan::math::fill(p, DUMMY_VAR__); + stan::math::fill(p, DUMMY_VAR__); Eigen::Matrix b; b = Eigen::Matrix(n_occasions); - stan::math::fill(b, DUMMY_VAR__); + stan::math::fill(b, DUMMY_VAR__); Eigen::Matrix nu; nu = Eigen::Matrix(n_occasions); - stan::math::fill(nu, DUMMY_VAR__); + stan::math::fill(nu, DUMMY_VAR__); Eigen::Matrix chi; chi = Eigen::Matrix(M, n_occasions); - stan::math::fill(chi, DUMMY_VAR__); + stan::math::fill(chi, DUMMY_VAR__); lcm_sym236__ = (n_occasions - 1); assign(lcm_sym286__, rep_matrix(mean_phi, M, lcm_sym236__), @@ -12558,14 +12786,15 @@ class expr_prop_fail6_model final : public model_base_crtp inline_sym15__; int inline_sym23__; - inline_sym23__ = std::numeric_limits::min(); + inline_sym23__ = std::numeric_limits::min(); inline_sym23__ = 0; for (int inline_sym24__ = 1; inline_sym24__ <= 1; ++inline_sym24__) { int inline_sym16__; - inline_sym16__ = std::numeric_limits::min(); + inline_sym16__ = std::numeric_limits::min(); lcm_sym287__ = rows(p); int inline_sym17__; - inline_sym17__ = std::numeric_limits::min(); + inline_sym17__ = std::numeric_limits::min(); lcm_sym279__ = cols(p); current_statement__ = 24; @@ -12611,7 +12841,7 @@ class expr_prop_fail6_model final : public model_base_crtp inline_sym18__; inline_sym18__ = Eigen::Matrix(lcm_sym287__, lcm_sym279__); - stan::math::fill(inline_sym18__, DUMMY_VAR__); + stan::math::fill(inline_sym18__, DUMMY_VAR__); for (int inline_sym22__ = 1; inline_sym22__ <= lcm_sym287__; ++inline_sym22__) { @@ -12622,10 +12852,10 @@ class expr_prop_fail6_model final : public model_base_crtp::min(); + inline_sym19__ = std::numeric_limits::min(); int inline_sym20__; - inline_sym20__ = std::numeric_limits::min(); + inline_sym20__ = std::numeric_limits::min(); lcm_sym246__ = (lcm_sym241__ + 1); current_statement__ = 30; @@ -12646,11 +12876,11 @@ class expr_prop_fail6_model final : public model_base_crtp::min(); + inline_sym19__ = std::numeric_limits::min(); lcm_sym240__ = (lcm_sym279__ - inline_sym21__); int inline_sym20__; - inline_sym20__ = std::numeric_limits::min(); + inline_sym20__ = std::numeric_limits::min(); lcm_sym245__ = (lcm_sym240__ + 1); current_statement__ = 30; @@ -12672,14 +12902,16 @@ class expr_prop_fail6_model final : public model_base_crtp(beta, 1, 1)); int inline_sym32__; - inline_sym32__ = std::numeric_limits::min(); + inline_sym32__ = std::numeric_limits::min(); { int inline_sym25__; - inline_sym25__ = std::numeric_limits::min(); + inline_sym25__ = std::numeric_limits::min(); lcm_sym303__ = rvalue(dims(y), "dims(y)", index_uni(1)); int inline_sym26__; - inline_sym26__ = std::numeric_limits::min(); + inline_sym26__ = std::numeric_limits::min(); lcm_sym304__ = rvalue(dims(y), "dims(y)", index_uni(2)); current_statement__ = 80; validate_non_negative_index("qnu", "n_occasions", lcm_sym304__); Eigen::Matrix inline_sym27__; inline_sym27__ = Eigen::Matrix(lcm_sym304__); - stan::math::fill(inline_sym27__, std::numeric_limits::quiet_NaN()); + stan::math::fill(inline_sym27__, std::numeric_limits::quiet_NaN()); assign(lcm_sym237__, subtract(1.0, nu), "assigning variable lcm_sym237__"); @@ -12936,7 +13184,7 @@ class expr_prop_fail6_model final : public model_base_crtp inline_sym28__; inline_sym28__ = Eigen::Matrix(lcm_sym304__); - stan::math::fill(inline_sym28__, std::numeric_limits::quiet_NaN()); + stan::math::fill(inline_sym28__, std::numeric_limits::quiet_NaN()); assign(lcm_sym239__, subtract(1.0, transpose(rvalue(p, "p", index_uni(1)))), @@ -12957,7 +13205,7 @@ class expr_prop_fail6_model final : public model_base_crtp inline_sym29__; inline_sym29__ = Eigen::Matrix(lcm_sym289__); - stan::math::fill(inline_sym29__, DUMMY_VAR__); + stan::math::fill(inline_sym29__, DUMMY_VAR__); lcm_sym297__ = rvalue(nu, "nu", index_uni(1)); lcm_sym243__ = (lcm_sym289__ - 1); @@ -13074,7 +13322,7 @@ class expr_prop_fail6_model final : public model_base_crtp inline_sym29__; inline_sym29__ = Eigen::Matrix(lcm_sym264__); - stan::math::fill(inline_sym29__, DUMMY_VAR__); + stan::math::fill(inline_sym29__, DUMMY_VAR__); lcm_sym297__ = rvalue(nu, "nu", index_uni(1)); assign(inline_sym29__, @@ -13133,7 +13381,7 @@ class expr_prop_fail6_model final : public model_base_crtp inline_sym28__; inline_sym28__ = Eigen::Matrix(lcm_sym304__); - stan::math::fill(inline_sym28__, std::numeric_limits::quiet_NaN()); + stan::math::fill(inline_sym28__, std::numeric_limits::quiet_NaN()); assign(lcm_sym238__, subtract(1.0, @@ -13156,7 +13404,7 @@ class expr_prop_fail6_model final : public model_base_crtp inline_sym29__; inline_sym29__ = Eigen::Matrix(lcm_sym288__); - stan::math::fill(inline_sym29__, DUMMY_VAR__); + stan::math::fill(inline_sym29__, DUMMY_VAR__); lcm_sym242__ = (lcm_sym288__ - 1); assign(inline_sym29__, @@ -13270,7 +13518,8 @@ class expr_prop_fail6_model final : public model_base_crtp inline_sym29__; inline_sym29__ = Eigen::Matrix(lcm_sym264__); - stan::math::fill(inline_sym29__, DUMMY_VAR__); + stan::math::fill(inline_sym29__, DUMMY_VAR__); current_statement__ = 103; assign(inline_sym29__, @@ -13340,7 +13589,8 @@ class expr_prop_fail6_model final : public model_base_crtp lcm_sym129__; double mean_phi; - mean_phi = std::numeric_limits::quiet_NaN(); + mean_phi = std::numeric_limits::quiet_NaN(); current_statement__ = 1; mean_phi = in__.template read_constrain_lub( 0, 1, lp__); double mean_p; - mean_p = std::numeric_limits::quiet_NaN(); + mean_p = std::numeric_limits::quiet_NaN(); current_statement__ = 2; mean_p = in__.template read_constrain_lub( 0, 1, lp__); double psi; - psi = std::numeric_limits::quiet_NaN(); + psi = std::numeric_limits::quiet_NaN(); current_statement__ = 3; psi = in__.template read_constrain_lub(0, 1, lp__); Eigen::Matrix beta; beta = Eigen::Matrix(n_occasions); - stan::math::fill(beta, std::numeric_limits::quiet_NaN()); + stan::math::fill(beta, std::numeric_limits::quiet_NaN()); current_statement__ = 4; beta = in__.template read_constrain_lb, jacobian__>( 0, lp__, n_occasions); Eigen::Matrix epsilon; epsilon = Eigen::Matrix(M); - stan::math::fill(epsilon, std::numeric_limits::quiet_NaN()); + stan::math::fill(epsilon, std::numeric_limits::quiet_NaN()); current_statement__ = 5; epsilon = in__.template read>(M); double sigma; - sigma = std::numeric_limits::quiet_NaN(); + sigma = std::numeric_limits::quiet_NaN(); current_statement__ = 6; sigma = in__.template read_constrain_lub( 0, 5, lp__); Eigen::Matrix phi; phi = Eigen::Matrix(M, (n_occasions - 1)); - stan::math::fill(phi, std::numeric_limits::quiet_NaN()); + stan::math::fill(phi, std::numeric_limits::quiet_NaN()); Eigen::Matrix p; p = Eigen::Matrix(M, n_occasions); - stan::math::fill(p, std::numeric_limits::quiet_NaN()); + stan::math::fill(p, std::numeric_limits::quiet_NaN()); Eigen::Matrix b; b = Eigen::Matrix(n_occasions); - stan::math::fill(b, std::numeric_limits::quiet_NaN()); + stan::math::fill(b, std::numeric_limits::quiet_NaN()); Eigen::Matrix nu; nu = Eigen::Matrix(n_occasions); - stan::math::fill(nu, DUMMY_VAR__); + stan::math::fill(nu, DUMMY_VAR__); Eigen::Matrix chi; chi = Eigen::Matrix(M, n_occasions); - stan::math::fill(chi, DUMMY_VAR__); + stan::math::fill(chi, DUMMY_VAR__); vars__.emplace_back(mean_phi); vars__.emplace_back(mean_p); @@ -13530,13 +13780,15 @@ class expr_prop_fail6_model final : public model_base_crtp inline_sym1__; int inline_sym9__; - inline_sym9__ = std::numeric_limits::min(); + inline_sym9__ = std::numeric_limits::min(); inline_sym9__ = 0; for (int inline_sym10__ = 1; inline_sym10__ <= 1; ++inline_sym10__) { int inline_sym2__; - inline_sym2__ = std::numeric_limits::min(); + inline_sym2__ = std::numeric_limits::min(); lcm_sym166__ = rows(p); int inline_sym3__; - inline_sym3__ = std::numeric_limits::min(); + inline_sym3__ = std::numeric_limits::min(); lcm_sym159__ = cols(p); current_statement__ = 24; @@ -13609,7 +13863,7 @@ class expr_prop_fail6_model final : public model_base_crtp inline_sym4__; inline_sym4__ = Eigen::Matrix(lcm_sym166__, lcm_sym159__); - stan::math::fill(inline_sym4__, DUMMY_VAR__); + stan::math::fill(inline_sym4__, DUMMY_VAR__); for (int inline_sym8__ = 1; inline_sym8__ <= lcm_sym166__; ++inline_sym8__) { @@ -13620,10 +13874,10 @@ class expr_prop_fail6_model final : public model_base_crtp::min(); + inline_sym5__ = std::numeric_limits::min(); int inline_sym6__; - inline_sym6__ = std::numeric_limits::min(); + inline_sym6__ = std::numeric_limits::min(); lcm_sym148__ = (lcm_sym143__ + 1); current_statement__ = 30; @@ -13644,11 +13898,11 @@ class expr_prop_fail6_model final : public model_base_crtp::min(); + inline_sym5__ = std::numeric_limits::min(); lcm_sym142__ = (lcm_sym159__ - inline_sym7__); int inline_sym6__; - inline_sym6__ = std::numeric_limits::min(); + inline_sym6__ = std::numeric_limits::min(); lcm_sym147__ = (lcm_sym142__ + 1); current_statement__ = 30; @@ -13670,14 +13924,16 @@ class expr_prop_fail6_model final : public model_base_crtp::quiet_NaN(); + sigma2 = std::numeric_limits::quiet_NaN(); int Nsuper; - Nsuper = std::numeric_limits::min(); + Nsuper = std::numeric_limits::min(); std::vector N; - N = std::vector(n_occasions, std::numeric_limits::min()); + N = std::vector(n_occasions, std::numeric_limits::min()); std::vector B; - B = std::vector(n_occasions, std::numeric_limits::min()); + B = std::vector(n_occasions, std::numeric_limits::min()); std::vector> z; z = std::vector>(M, std::vector(n_occasions, std::numeric_limits::min())); + lcm_sym169__ = square(sigma); sigma2 = lcm_sym169__; current_statement__ = 50; if (lcm_sym132__) { int q; - q = std::numeric_limits::min(); + q = std::numeric_limits::min(); current_statement__ = 48; if (bernoulli_rng(psi, base_rng__)) { @@ -14031,7 +14315,8 @@ class expr_prop_fail6_model final : public model_base_crtp::min(); + q = std::numeric_limits::min(); current_statement__ = 48; if (bernoulli_rng(psi, base_rng__)) { @@ -14075,13 +14360,15 @@ class expr_prop_fail6_model final : public model_base_crtp> recruit; recruit = std::vector>(M, std::vector(n_occasions, std::numeric_limits::min())); + current_statement__ = 53; assign(recruit, rep_array(0, M, n_occasions), @@ -14097,21 +14385,21 @@ class expr_prop_fail6_model final : public model_base_crtp Nind; - Nind = std::vector(M, std::numeric_limits::min()); + Nind = std::vector(M, std::numeric_limits::min()); current_statement__ = 56; validate_non_negative_index("Nalive", "M", M); std::vector Nalive; - Nalive = std::vector(M, std::numeric_limits::min()); + Nalive = std::vector(M, std::numeric_limits::min()); current_statement__ = 65; if (lcm_sym132__) { int f; - f = std::numeric_limits::min(); + f = std::numeric_limits::min(); int inline_sym11__; int inline_sym13__; - inline_sym13__ = std::numeric_limits::min(); + inline_sym13__ = std::numeric_limits::min(); inline_sym13__ = 0; for (int inline_sym14__ = 1; inline_sym14__ <= 1; ++inline_sym14__) { @@ -14123,13 +14411,15 @@ class expr_prop_fail6_model final : public model_base_crtp::min(); + f = std::numeric_limits::min(); int inline_sym11__; int inline_sym13__; - inline_sym13__ = std::numeric_limits::min(); + inline_sym13__ = std::numeric_limits::min(); inline_sym13__ = 0; for (int inline_sym14__ = 1; inline_sym14__ <= 1; @@ -14156,20 +14446,23 @@ class expr_prop_fail6_model final : public model_base_crtp::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; double mean_phi; - mean_phi = std::numeric_limits::quiet_NaN(); + mean_phi = std::numeric_limits::quiet_NaN(); current_statement__ = 1; mean_phi = context__.vals_r("mean_phi")[(1 - 1)]; double mean_phi_free__; - mean_phi_free__ = std::numeric_limits::quiet_NaN(); + mean_phi_free__ = std::numeric_limits::quiet_NaN(); current_statement__ = 1; mean_phi_free__ = stan::math::lub_free(mean_phi, 0, 1); double mean_p; - mean_p = std::numeric_limits::quiet_NaN(); + mean_p = std::numeric_limits::quiet_NaN(); current_statement__ = 2; mean_p = context__.vals_r("mean_p")[(1 - 1)]; double mean_p_free__; - mean_p_free__ = std::numeric_limits::quiet_NaN(); + mean_p_free__ = std::numeric_limits::quiet_NaN(); current_statement__ = 2; mean_p_free__ = stan::math::lub_free(mean_p, 0, 1); double psi; - psi = std::numeric_limits::quiet_NaN(); + psi = std::numeric_limits::quiet_NaN(); current_statement__ = 3; psi = context__.vals_r("psi")[(1 - 1)]; double psi_free__; - psi_free__ = std::numeric_limits::quiet_NaN(); + psi_free__ = std::numeric_limits::quiet_NaN(); current_statement__ = 3; psi_free__ = stan::math::lub_free(psi, 0, 1); Eigen::Matrix beta; beta = Eigen::Matrix(n_occasions); - stan::math::fill(beta, std::numeric_limits::quiet_NaN()); + stan::math::fill(beta, std::numeric_limits::quiet_NaN()); { std::vector beta_flat__; @@ -14414,12 +14720,13 @@ class expr_prop_fail6_model final : public model_base_crtp beta_free__; beta_free__ = Eigen::Matrix(n_occasions); - stan::math::fill(beta_free__, std::numeric_limits::quiet_NaN()); + stan::math::fill(beta_free__, std::numeric_limits::quiet_NaN()); current_statement__ = 4; if (lcm_sym117__) { @@ -14430,11 +14737,12 @@ class expr_prop_fail6_model final : public model_base_crtp epsilon; epsilon = Eigen::Matrix(M); - stan::math::fill(epsilon, std::numeric_limits::quiet_NaN()); + stan::math::fill(epsilon, std::numeric_limits::quiet_NaN()); { std::vector epsilon_flat__; @@ -14455,16 +14763,17 @@ class expr_prop_fail6_model final : public model_base_crtp::quiet_NaN(); + sigma = std::numeric_limits::quiet_NaN(); current_statement__ = 6; sigma = context__.vals_r("sigma")[(1 - 1)]; double sigma_free__; - sigma_free__ = std::numeric_limits::quiet_NaN(); + sigma_free__ = std::numeric_limits::quiet_NaN(); current_statement__ = 6; sigma_free__ = stan::math::lub_free(sigma, 0, 5); @@ -14475,12 +14784,14 @@ class expr_prop_fail6_model final : public model_base_crtp& names__) const { - names__ = std::vector{"mean_phi", - "mean_p", - "psi", - "beta", - "epsilon", - "sigma", - "phi", - "p", - "b", - "nu", - "chi", - "sigma2", - "Nsuper", - "N", - "B", - "z"}; + names__ = std::vector{"mean_phi", "mean_p", "psi", "beta", + "epsilon", "sigma", "phi", "p", "b", "nu", "chi", "sigma2", "Nsuper", + "N", "B", "z"}; + } // get_param_names() inline void get_dims(std::vector>& dimss__) const { dimss__ = std::vector>{std::vector{}, - std::vector{}, - std::vector{}, - std::vector{static_cast(n_occasions)}, - std::vector{static_cast(M)}, - std::vector{}, - std::vector{static_cast(M), - static_cast(phi_2dim__)}, - std::vector{static_cast(M), - static_cast(n_occasions)}, - std::vector{static_cast(n_occasions)}, - std::vector{static_cast(n_occasions)}, - std::vector{static_cast(M), - static_cast(n_occasions)}, - std::vector{}, - std::vector{}, - std::vector{static_cast(n_occasions)}, - std::vector{static_cast(n_occasions)}, - std::vector{static_cast(M), - static_cast(n_occasions)}}; + std::vector{}, std::vector{}, + std::vector{static_cast(n_occasions)}, + std::vector{static_cast(M)}, std::vector{ + }, + std::vector{static_cast(M), + static_cast(phi_2dim__)}, + std::vector{static_cast(M), + static_cast(n_occasions)}, + std::vector{static_cast(n_occasions)}, + std::vector{static_cast(n_occasions)}, + std::vector{static_cast(M), + static_cast(n_occasions)}, + std::vector{}, std::vector{}, + std::vector{static_cast(n_occasions)}, + std::vector{static_cast(n_occasions)}, + std::vector{static_cast(M), + static_cast(n_occasions)}}; + } // get_dims() inline void constrained_param_names( @@ -14546,11 +14844,13 @@ class expr_prop_fail6_model final : public model_base_crtp vars_vec(vars.size()); + std::vector vars_vec; + vars_vec.reserve(vars.size()); std::vector params_i; write_array_impl(base_rng, params_r, params_i, vars_vec, emit_transformed_parameters, emit_generated_quantities, pstream); - vars.resize(vars_vec.size()); - for (int i = 0; i < vars.size(); ++i) { - vars.coeffRef(i) = vars_vec[i]; - } + vars = Eigen::Map>( + vars_vec.data(), vars_vec.size()); } template @@ -14714,7 +15041,8 @@ class expr_prop_fail6_model final : public model_base_crtp @@ -14735,13 +15063,12 @@ class expr_prop_fail6_model final : public model_base_crtp& params_r, std::ostream* pstream = nullptr) const final { - std::vector params_r_vec(params_r.size()); + std::vector params_r_vec; + params_r_vec.reserve(params_r.size()); std::vector params_i; transform_inits_impl(context, params_i, params_r_vec, pstream); - params_r.resize(params_r_vec.size()); - for (int i = 0; i < params_r.size(); ++i) { - params_r.coeffRef(i) = params_r_vec[i]; - } + params_r = Eigen::Map>( + params_r_vec.data(), params_r_vec.size()); } inline void transform_inits(const stan::io::var_context& context, std::vector& params_i, @@ -14908,13 +15235,13 @@ class expr_prop_fail7_model final : public model_base_crtp::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; current_statement__ = 20; context__.validate_dims("data initialization","K","int", - context__.to_vec()); - K = std::numeric_limits::min(); + std::vector{}); + K = std::numeric_limits::min(); current_statement__ = 20; K = context__.vals_i("K")[(1 - 1)]; @@ -14923,8 +15250,8 @@ class expr_prop_fail7_model final : public model_base_crtp::min(); + std::vector{}); + I = std::numeric_limits::min(); current_statement__ = 21; I = context__.vals_i("I")[(1 - 1)]; @@ -14933,8 +15260,8 @@ class expr_prop_fail7_model final : public model_base_crtp::min(); + std::vector{}); + J = std::numeric_limits::min(); current_statement__ = 22; J = context__.vals_i("J")[(1 - 1)]; @@ -14947,8 +15274,10 @@ class expr_prop_fail7_model final : public model_base_crtp{static_cast(I), + static_cast(J)}); y = std::vector>(I, std::vector(J, std::numeric_limits::min())); + { std::vector y_flat__; @@ -14971,7 +15300,8 @@ class expr_prop_fail7_model final : public model_base_crtp{static_cast(K)}); alpha = Eigen::Matrix(K); - stan::math::fill(alpha, std::numeric_limits::quiet_NaN()); + stan::math::fill(alpha, std::numeric_limits::quiet_NaN()); { std::vector alpha_flat__; @@ -15081,7 +15419,8 @@ class expr_prop_fail7_model final : public model_base_crtp{static_cast(K), + static_cast(K)}); beta = std::vector>(K, Eigen::Matrix(K)); - stan::math::fill(beta, std::numeric_limits::quiet_NaN()); + stan::math::fill(beta, std::numeric_limits::quiet_NaN()); { std::vector beta_flat__; @@ -15126,7 +15467,8 @@ class expr_prop_fail7_model final : public model_base_crtp pi; pi = Eigen::Matrix(K); - stan::math::fill(pi, DUMMY_VAR__); + stan::math::fill(pi, DUMMY_VAR__); current_statement__ = 1; pi = in__.template read_constrain_simplex, jacobian__>( lp__, K); std::vector>> theta; theta = std::vector>>(J, std::vector>(K, Eigen::Matrix(K))); - stan::math::fill(theta, DUMMY_VAR__); + stan::math::fill(theta, DUMMY_VAR__); current_statement__ = 2; theta = in__.template read_constrain_simplex>>, jacobian__>( @@ -15269,7 +15608,8 @@ class expr_prop_fail7_model final : public model_base_crtp( rvalue(theta, "theta", index_uni(1), index_uni(k)), - rvalue(beta, "beta", index_uni(k))));} + rvalue(beta, "beta", index_uni(k)))); + } } for (int j = 2; j <= J; ++j) { current_statement__ = 12; @@ -15284,8 +15624,10 @@ class expr_prop_fail7_model final : public model_base_crtp( rvalue(theta, "theta", index_uni(j), index_uni(k)), - rvalue(beta, "beta", index_uni(k))));} - } } + rvalue(beta, "beta", index_uni(k)))); + } + } + } } current_statement__ = 19; if (logical_gte(I, 1)) { @@ -15293,7 +15635,7 @@ class expr_prop_fail7_model final : public model_base_crtp log_q; log_q = Eigen::Matrix(K); - stan::math::fill(log_q, DUMMY_VAR__); + stan::math::fill(log_q, DUMMY_VAR__); assign(lcm_sym61__, stan::math::log(pi), "assigning variable lcm_sym61__"); @@ -15319,7 +15661,8 @@ class expr_prop_fail7_model final : public model_base_crtp log_q; log_q = Eigen::Matrix(K); - stan::math::fill(log_q, DUMMY_VAR__); + stan::math::fill(log_q, DUMMY_VAR__); current_statement__ = 14; assign(log_q, lcm_sym61__, "assigning variable log_q"); @@ -15354,10 +15697,12 @@ class expr_prop_fail7_model final : public model_base_crtp pi; pi = Eigen::Matrix(K); - stan::math::fill(pi, std::numeric_limits::quiet_NaN()); + stan::math::fill(pi, std::numeric_limits::quiet_NaN()); current_statement__ = 1; pi = in__.template read_constrain_simplex, jacobian__>( lp__, K); std::vector>> theta; theta = std::vector>>(J, std::vector>(K, Eigen::Matrix(K))); - stan::math::fill(theta, std::numeric_limits::quiet_NaN()); + stan::math::fill(theta, std::numeric_limits::quiet_NaN()); current_statement__ = 2; theta = in__.template read_constrain_simplex>>, jacobian__>( @@ -15435,7 +15780,8 @@ class expr_prop_fail7_model final : public model_base_crtp> log_Pr_z; log_Pr_z = std::vector>(I, Eigen::Matrix(K)); - stan::math::fill(log_Pr_z, std::numeric_limits::quiet_NaN()); + stan::math::fill(log_Pr_z, std::numeric_limits::quiet_NaN()); lcm_sym24__ = logical_gte(I, 1); if (lcm_sym24__) { @@ -15500,7 +15853,7 @@ class expr_prop_fail7_model final : public model_base_crtp log_q; log_q = Eigen::Matrix(K); - stan::math::fill(log_q, std::numeric_limits::quiet_NaN()); + stan::math::fill(log_q, std::numeric_limits::quiet_NaN()); assign(lcm_sym34__, stan::math::log(pi), "assigning variable lcm_sym34__"); @@ -15525,7 +15878,8 @@ class expr_prop_fail7_model final : public model_base_crtp log_q; log_q = Eigen::Matrix(K); - stan::math::fill(log_q, std::numeric_limits::quiet_NaN()); + stan::math::fill(log_q, std::numeric_limits::quiet_NaN()); current_statement__ = 5; assign(log_q, lcm_sym34__, "assigning variable log_q"); @@ -15560,11 +15914,13 @@ class expr_prop_fail7_model final : public model_base_crtp::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; Eigen::Matrix pi; pi = Eigen::Matrix(K); - stan::math::fill(pi, std::numeric_limits::quiet_NaN()); + stan::math::fill(pi, std::numeric_limits::quiet_NaN()); { std::vector pi_flat__; @@ -15651,19 +16009,20 @@ class expr_prop_fail7_model final : public model_base_crtp pi_free__; pi_free__ = Eigen::Matrix((K - 1)); - stan::math::fill(pi_free__, std::numeric_limits::quiet_NaN()); + stan::math::fill(pi_free__, std::numeric_limits::quiet_NaN()); current_statement__ = 1; assign(pi_free__, stan::math::simplex_free(pi), "assigning variable pi_free__"); std::vector>> theta; theta = std::vector>>(J, std::vector>(K, Eigen::Matrix(K))); - stan::math::fill(theta, std::numeric_limits::quiet_NaN()); + stan::math::fill(theta, std::numeric_limits::quiet_NaN()); { std::vector theta_flat__; @@ -15693,7 +16052,8 @@ class expr_prop_fail7_model final : public model_base_crtp>> theta_free__; theta_free__ = std::vector>>(J, std::vector>(K, Eigen::Matrix( - (K - 1)))); - stan::math::fill(theta_free__, std::numeric_limits::quiet_NaN()); + (K - 1)))); + stan::math::fill(theta_free__, std::numeric_limits::quiet_NaN()); current_statement__ = 2; if (lcm_sym1__) { @@ -15783,7 +16149,8 @@ class expr_prop_fail7_model final : public model_base_crtp& names__) const { - names__ = std::vector{"pi", - "theta", - "log_Pr_z"}; + names__ = std::vector{"pi", "theta", "log_Pr_z"}; + } // get_param_names() inline void get_dims(std::vector>& dimss__) const { @@ -15872,9 +16248,10 @@ class expr_prop_fail7_model final : public model_base_crtp>{std::vector{ static_cast(K) }, - std::vector{static_cast(J), static_cast(K), - static_cast(K)}, - std::vector{static_cast(I), static_cast(K)}}; + std::vector{static_cast(J), static_cast(K), + static_cast(K)}, + std::vector{static_cast(I), static_cast(K)}}; + } // get_dims() inline void constrained_param_names( @@ -15886,7 +16263,8 @@ class expr_prop_fail7_model final : public model_base_crtp vars_vec(vars.size()); + std::vector vars_vec; + vars_vec.reserve(vars.size()); std::vector params_i; write_array_impl(base_rng, params_r, params_i, vars_vec, emit_transformed_parameters, emit_generated_quantities, pstream); - vars.resize(vars_vec.size()); - for (int i = 0; i < vars.size(); ++i) { - vars.coeffRef(i) = vars_vec[i]; - } + vars = Eigen::Map>( + vars_vec.data(), vars_vec.size()); } template @@ -15985,7 +16375,8 @@ class expr_prop_fail7_model final : public model_base_crtp @@ -16006,13 +16397,12 @@ class expr_prop_fail7_model final : public model_base_crtp& params_r, std::ostream* pstream = nullptr) const final { - std::vector params_r_vec(params_r.size()); + std::vector params_r_vec; + params_r_vec.reserve(params_r.size()); std::vector params_i; transform_inits_impl(context, params_i, params_r_vec, pstream); - params_r.resize(params_r_vec.size()); - for (int i = 0; i < params_r.size(); ++i) { - params_r.coeffRef(i) = params_r_vec[i]; - } + params_r = Eigen::Map>( + params_r_vec.data(), params_r_vec.size()); } inline void transform_inits(const stan::io::var_context& context, std::vector& params_i, @@ -16149,13 +16539,13 @@ class expr_prop_fail8_model final : public model_base_crtp::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; current_statement__ = 12; context__.validate_dims("data initialization","N","int", - context__.to_vec()); - N = std::numeric_limits::min(); + std::vector{}); + N = std::numeric_limits::min(); current_statement__ = 12; N = context__.vals_i("N")[(1 - 1)]; @@ -16164,8 +16554,8 @@ class expr_prop_fail8_model final : public model_base_crtp::min(); + std::vector{}); + N_edges = std::numeric_limits::min(); current_statement__ = 13; N_edges = context__.vals_i("N_edges")[(1 - 1)]; @@ -16176,8 +16566,8 @@ class expr_prop_fail8_model final : public model_base_crtp(N_edges, std::numeric_limits::min()); + std::vector{static_cast(N_edges)}); + node1 = std::vector(N_edges, std::numeric_limits::min()); current_statement__ = 15; node1 = context__.vals_i("node1"); @@ -16191,7 +16581,8 @@ class expr_prop_fail8_model final : public model_base_crtp(N_edges, std::numeric_limits::min()); + std::vector{static_cast(N_edges)}); + node2 = std::vector(N_edges, std::numeric_limits::min()); current_statement__ = 17; node2 = context__.vals_i("node2"); @@ -16224,7 +16616,8 @@ class expr_prop_fail8_model final : public model_base_crtp(N, std::numeric_limits::min()); + std::vector{static_cast(N)}); + y = std::vector(N, std::numeric_limits::min()); current_statement__ = 19; y = context__.vals_i("y"); @@ -16263,9 +16657,9 @@ class expr_prop_fail8_model final : public model_base_crtp{static_cast(N)}); x = Eigen::Matrix(N); - stan::math::fill(x, std::numeric_limits::quiet_NaN()); + stan::math::fill(x, std::numeric_limits::quiet_NaN()); { std::vector x_flat__; @@ -16285,7 +16679,8 @@ class expr_prop_fail8_model final : public model_base_crtp lcm_sym22__; local_scalar_t__ beta0; - beta0 = DUMMY_VAR__; + beta0 = DUMMY_VAR__; current_statement__ = 1; beta0 = in__.template read(); local_scalar_t__ beta1; - beta1 = DUMMY_VAR__; + beta1 = DUMMY_VAR__; current_statement__ = 2; beta1 = in__.template read(); local_scalar_t__ tau_theta; - tau_theta = DUMMY_VAR__; + tau_theta = DUMMY_VAR__; current_statement__ = 3; tau_theta = in__.template read_constrain_lb( 0, lp__); local_scalar_t__ tau_phi; - tau_phi = DUMMY_VAR__; + tau_phi = DUMMY_VAR__; current_statement__ = 4; tau_phi = in__.template read_constrain_lb( 0, lp__); Eigen::Matrix theta_std; theta_std = Eigen::Matrix(N); - stan::math::fill(theta_std, DUMMY_VAR__); + stan::math::fill(theta_std, DUMMY_VAR__); current_statement__ = 5; theta_std = in__.template read>( N); Eigen::Matrix phi_std_raw; phi_std_raw = Eigen::Matrix(N); - stan::math::fill(phi_std_raw, DUMMY_VAR__); + stan::math::fill(phi_std_raw, DUMMY_VAR__); current_statement__ = 6; phi_std_raw = in__.template read>( N); local_scalar_t__ sigma_phi; - sigma_phi = DUMMY_VAR__; + sigma_phi = DUMMY_VAR__; lcm_sym24__ = inv_sqrt(tau_phi); sigma_phi = lcm_sym24__; Eigen::Matrix phi; phi = Eigen::Matrix(N); - stan::math::fill(phi, DUMMY_VAR__); + stan::math::fill(phi, DUMMY_VAR__); current_statement__ = 9; assign(phi, phi_std_raw, "assigning variable phi", index_min_max(1, N)); @@ -16437,47 +16820,47 @@ class expr_prop_fail8_model final : public model_base_crtp::quiet_NaN(); + beta0 = std::numeric_limits::quiet_NaN(); current_statement__ = 1; beta0 = in__.template read(); double beta1; - beta1 = std::numeric_limits::quiet_NaN(); + beta1 = std::numeric_limits::quiet_NaN(); current_statement__ = 2; beta1 = in__.template read(); double tau_theta; - tau_theta = std::numeric_limits::quiet_NaN(); + tau_theta = std::numeric_limits::quiet_NaN(); current_statement__ = 3; tau_theta = in__.template read_constrain_lb( 0, lp__); double tau_phi; - tau_phi = std::numeric_limits::quiet_NaN(); + tau_phi = std::numeric_limits::quiet_NaN(); current_statement__ = 4; tau_phi = in__.template read_constrain_lb( 0, lp__); Eigen::Matrix theta_std; theta_std = Eigen::Matrix(N); - stan::math::fill(theta_std, std::numeric_limits::quiet_NaN()); + stan::math::fill(theta_std, std::numeric_limits::quiet_NaN()); current_statement__ = 5; theta_std = in__.template read>( N); Eigen::Matrix phi_std_raw; phi_std_raw = Eigen::Matrix(N); - stan::math::fill(phi_std_raw, std::numeric_limits::quiet_NaN()); + stan::math::fill(phi_std_raw, std::numeric_limits::quiet_NaN()); current_statement__ = 6; phi_std_raw = in__.template read>( N); double sigma_phi; - sigma_phi = std::numeric_limits::quiet_NaN(); + sigma_phi = std::numeric_limits::quiet_NaN(); Eigen::Matrix phi; phi = Eigen::Matrix(N); - stan::math::fill(phi, std::numeric_limits::quiet_NaN()); + stan::math::fill(phi, std::numeric_limits::quiet_NaN()); vars__.emplace_back(beta0); vars__.emplace_back(beta1); @@ -16487,13 +16870,15 @@ class expr_prop_fail8_model final : public model_base_crtp::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; double beta0; - beta0 = std::numeric_limits::quiet_NaN(); + beta0 = std::numeric_limits::quiet_NaN(); current_statement__ = 1; beta0 = context__.vals_r("beta0")[(1 - 1)]; double beta1; - beta1 = std::numeric_limits::quiet_NaN(); + beta1 = std::numeric_limits::quiet_NaN(); current_statement__ = 2; beta1 = context__.vals_r("beta1")[(1 - 1)]; double tau_theta; - tau_theta = std::numeric_limits::quiet_NaN(); + tau_theta = std::numeric_limits::quiet_NaN(); current_statement__ = 3; tau_theta = context__.vals_r("tau_theta")[(1 - 1)]; double tau_theta_free__; - tau_theta_free__ = std::numeric_limits::quiet_NaN(); + tau_theta_free__ = std::numeric_limits::quiet_NaN(); current_statement__ = 3; tau_theta_free__ = stan::math::lb_free(tau_theta, 0); double tau_phi; - tau_phi = std::numeric_limits::quiet_NaN(); + tau_phi = std::numeric_limits::quiet_NaN(); current_statement__ = 4; tau_phi = context__.vals_r("tau_phi")[(1 - 1)]; double tau_phi_free__; - tau_phi_free__ = std::numeric_limits::quiet_NaN(); + tau_phi_free__ = std::numeric_limits::quiet_NaN(); current_statement__ = 4; tau_phi_free__ = stan::math::lb_free(tau_phi, 0); Eigen::Matrix theta_std; theta_std = Eigen::Matrix(N); - stan::math::fill(theta_std, std::numeric_limits::quiet_NaN()); + stan::math::fill(theta_std, std::numeric_limits::quiet_NaN()); { std::vector theta_std_flat__; @@ -16606,12 +16992,13 @@ class expr_prop_fail8_model final : public model_base_crtp phi_std_raw; phi_std_raw = Eigen::Matrix(N); - stan::math::fill(phi_std_raw, std::numeric_limits::quiet_NaN()); + stan::math::fill(phi_std_raw, std::numeric_limits::quiet_NaN()); { std::vector phi_std_raw_flat__; @@ -16632,7 +17019,8 @@ class expr_prop_fail8_model final : public model_base_crtp& names__) const { - names__ = std::vector{"beta0", - "beta1", - "tau_theta", - "tau_phi", - "theta_std", - "phi_std_raw", - "sigma_phi", - "phi"}; + names__ = std::vector{"beta0", "beta1", "tau_theta", + "tau_phi", "theta_std", "phi_std_raw", "sigma_phi", "phi"}; + } // get_param_names() inline void get_dims(std::vector>& dimss__) const { dimss__ = std::vector>{std::vector{}, - std::vector{}, - std::vector{}, - std::vector{}, - std::vector{static_cast(N)}, - std::vector{static_cast(N)}, - std::vector{}, - std::vector{static_cast(N)}}; + std::vector{}, std::vector{}, std::vector{ + }, std::vector{static_cast(N)}, + std::vector{static_cast(N)}, std::vector{ + }, std::vector{static_cast(N)}}; + } // get_dims() inline void constrained_param_names( @@ -16694,17 +17077,20 @@ class expr_prop_fail8_model final : public model_base_crtp vars_vec(vars.size()); + std::vector vars_vec; + vars_vec.reserve(vars.size()); std::vector params_i; write_array_impl(base_rng, params_r, params_i, vars_vec, emit_transformed_parameters, emit_generated_quantities, pstream); - vars.resize(vars_vec.size()); - for (int i = 0; i < vars.size(); ++i) { - vars.coeffRef(i) = vars_vec[i]; - } + vars = Eigen::Map>( + vars_vec.data(), vars_vec.size()); } template @@ -16781,7 +17171,8 @@ class expr_prop_fail8_model final : public model_base_crtp @@ -16802,13 +17193,12 @@ class expr_prop_fail8_model final : public model_base_crtp& params_r, std::ostream* pstream = nullptr) const final { - std::vector params_r_vec(params_r.size()); + std::vector params_r_vec; + params_r_vec.reserve(params_r.size()); std::vector params_i; transform_inits_impl(context, params_i, params_r_vec, pstream); - params_r.resize(params_r_vec.size()); - for (int i = 0; i < params_r.size(); ++i) { - params_r.coeffRef(i) = params_r_vec[i]; - } + params_r = Eigen::Map>( + params_r_vec.data(), params_r_vec.size()); } inline void transform_inits(const stan::io::var_context& context, std::vector& params_i, @@ -16957,7 +17347,8 @@ first_capture(const std::vector& y_i, std::ostream* pstream__) { if (rvalue(y_i, "y_i", index_uni(k))) { current_statement__ = 44; return k; - } } + } + } } current_statement__ = 63; return 0; @@ -16997,7 +17388,7 @@ last_capture(const std::vector& y_i, std::ostream* pstream__) { lcm_sym33__ = (size(y_i) - 1); if (logical_gte(lcm_sym33__, 0)) { int k; - k = std::numeric_limits::min(); + k = std::numeric_limits::min(); lcm_sym32__ = (size(y_i) - 0); current_statement__ = 51; @@ -17007,14 +17398,15 @@ last_capture(const std::vector& y_i, std::ostream* pstream__) { } for (int k_rev = 1; k_rev <= lcm_sym33__; ++k_rev) { int k; - k = std::numeric_limits::min(); + k = std::numeric_limits::min(); lcm_sym31__ = (size(y_i) - k_rev); current_statement__ = 51; if (y_i[(lcm_sym31__ - 1)]) { current_statement__ = 50; return lcm_sym31__; - } } + } + } } current_statement__ = 64; return 0; @@ -17067,7 +17459,7 @@ prob_uncaptured(const int& nind, const int& n_occasions, const T2__& p_arg__, validate_non_negative_index("chi", "n_occasions", n_occasions); Eigen::Matrix chi; chi = Eigen::Matrix(nind, n_occasions); - stan::math::fill(chi, DUMMY_VAR__); + stan::math::fill(chi, DUMMY_VAR__); current_statement__ = 66; if (logical_gte(nind, 1)) { @@ -17078,10 +17470,10 @@ prob_uncaptured(const int& nind, const int& n_occasions, const T2__& p_arg__, lcm_sym37__ = logical_gte(lcm_sym39__, 1); if (lcm_sym37__) { int t_curr; - t_curr = std::numeric_limits::min(); + t_curr = std::numeric_limits::min(); int t_next; - t_next = std::numeric_limits::min(); + t_next = std::numeric_limits::min(); lcm_sym41__ = (lcm_sym39__ + 1); current_statement__ = 20; @@ -17095,11 +17487,11 @@ prob_uncaptured(const int& nind, const int& n_occasions, const T2__& p_arg__, "assigning variable chi", index_uni(1), index_uni(lcm_sym39__)); for (int t = 2; t <= lcm_sym39__; ++t) { int t_curr; - t_curr = std::numeric_limits::min(); + t_curr = std::numeric_limits::min(); lcm_sym38__ = (n_occasions - t); int t_next; - t_next = std::numeric_limits::min(); + t_next = std::numeric_limits::min(); lcm_sym40__ = (lcm_sym38__ + 1); current_statement__ = 20; @@ -17122,10 +17514,10 @@ prob_uncaptured(const int& nind, const int& n_occasions, const T2__& p_arg__, current_statement__ = 65; if (lcm_sym37__) { int t_curr; - t_curr = std::numeric_limits::min(); + t_curr = std::numeric_limits::min(); int t_next; - t_next = std::numeric_limits::min(); + t_next = std::numeric_limits::min(); lcm_sym41__ = (lcm_sym39__ + 1); current_statement__ = 20; @@ -17141,11 +17533,11 @@ prob_uncaptured(const int& nind, const int& n_occasions, const T2__& p_arg__, "assigning variable chi", index_uni(i), index_uni(lcm_sym39__)); for (int t = 2; t <= lcm_sym39__; ++t) { int t_curr; - t_curr = std::numeric_limits::min(); + t_curr = std::numeric_limits::min(); lcm_sym38__ = (n_occasions - t); int t_next; - t_next = std::numeric_limits::min(); + t_next = std::numeric_limits::min(); lcm_sym40__ = (lcm_sym38__ + 1); current_statement__ = 20; @@ -17159,8 +17551,10 @@ prob_uncaptured(const int& nind, const int& n_occasions, const T2__& p_arg__, (1 - rvalue(phi, "phi", index_uni(i), index_uni(lcm_sym38__)))), "assigning variable chi", index_uni(i), - index_uni(lcm_sym38__));} - } } + index_uni(lcm_sym38__)); + } + } + } } current_statement__ = 67; return chi; @@ -17282,13 +17676,13 @@ class fails_test_model final : public model_base_crtp { int pos__; - pos__ = std::numeric_limits::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; current_statement__ = 31; context__.validate_dims("data initialization","nind","int", - context__.to_vec()); - nind = std::numeric_limits::min(); + std::vector{}); + nind = std::numeric_limits::min(); current_statement__ = 31; nind = context__.vals_i("nind")[(1 - 1)]; @@ -17297,8 +17691,8 @@ class fails_test_model final : public model_base_crtp { check_greater_or_equal(function__, "nind", nind, 0); current_statement__ = 32; context__.validate_dims("data initialization","n_occasions","int", - context__.to_vec()); - n_occasions = std::numeric_limits::min(); + std::vector{}); + n_occasions = std::numeric_limits::min(); current_statement__ = 32; n_occasions = context__.vals_i("n_occasions")[(1 - 1)]; @@ -17311,8 +17705,10 @@ class fails_test_model final : public model_base_crtp { validate_non_negative_index("y", "n_occasions", n_occasions); current_statement__ = 35; context__.validate_dims("data initialization","y","int", - context__.to_vec(nind, n_occasions)); + std::vector{static_cast(nind), + static_cast(n_occasions)}); y = std::vector>(nind, std::vector(n_occasions, std::numeric_limits::min())); + { std::vector y_flat__; @@ -17335,7 +17731,8 @@ class fails_test_model final : public model_base_crtp { assign(y, y_flat__[(pos__ - 1)], "assigning variable y", index_uni(sym2__), index_uni(1)); current_statement__ = 35; - pos__ = (pos__ + 1);} + pos__ = (pos__ + 1); + } } for (int sym1__ = 2; sym1__ <= n_occasions; ++sym1__) { current_statement__ = 35; @@ -17351,8 +17748,10 @@ class fails_test_model final : public model_base_crtp { "assigning variable y", index_uni(sym2__), index_uni(sym1__)); current_statement__ = 35; - pos__ = (pos__ + 1);} - } } + pos__ = (pos__ + 1); + } + } + } } } else { lcm_sym157__ = logical_gte(nind, 1); @@ -17372,7 +17771,8 @@ class fails_test_model final : public model_base_crtp { current_statement__ = 35; check_greater_or_equal(function__, "y[sym1__, sym2__]", rvalue(y, "y", - index_uni(1), index_uni(sym2__)), 0);} + index_uni(1), index_uni(sym2__)), 0); + } } for (int sym1__ = 2; sym1__ <= nind; ++sym1__) { current_statement__ = 35; @@ -17386,8 +17786,10 @@ class fails_test_model final : public model_base_crtp { current_statement__ = 35; current_statement__ = 35; check_greater_or_equal(function__, "y[sym1__, sym2__]", - y[(sym1__ - 1)][(sym2__ - 1)], 0);} - } } + y[(sym1__ - 1)][(sym2__ - 1)], 0); + } + } + } } current_statement__ = 35; if (lcm_sym157__) { @@ -17402,7 +17804,8 @@ class fails_test_model final : public model_base_crtp { current_statement__ = 35; check_less_or_equal(function__, "y[sym1__, sym2__]", rvalue(y, "y", - index_uni(1), index_uni(sym2__)), 1);} + index_uni(1), index_uni(sym2__)), 1); + } } for (int sym1__ = 2; sym1__ <= nind; ++sym1__) { current_statement__ = 35; @@ -17416,13 +17819,15 @@ class fails_test_model final : public model_base_crtp { current_statement__ = 35; current_statement__ = 35; check_less_or_equal(function__, "y[sym1__, sym2__]", - y[(sym1__ - 1)][(sym2__ - 1)], 1);} - } } + y[(sym1__ - 1)][(sym2__ - 1)], 1); + } + } + } } current_statement__ = 36; context__.validate_dims("data initialization","max_age","int", - context__.to_vec()); - max_age = std::numeric_limits::min(); + std::vector{}); + max_age = std::numeric_limits::min(); current_statement__ = 36; max_age = context__.vals_i("max_age")[(1 - 1)]; @@ -17435,8 +17840,10 @@ class fails_test_model final : public model_base_crtp { validate_non_negative_index("x", "n_occasions - 1", lcm_sym159__); current_statement__ = 38; context__.validate_dims("data initialization","x","int", - context__.to_vec(nind, lcm_sym159__)); + std::vector{static_cast(nind), + static_cast(lcm_sym159__)}); x = std::vector>(nind, std::vector(lcm_sym159__, std::numeric_limits::min())); + { std::vector x_flat__; @@ -17458,7 +17865,8 @@ class fails_test_model final : public model_base_crtp { assign(x, x_flat__[(pos__ - 1)], "assigning variable x", index_uni(sym2__), index_uni(1)); current_statement__ = 38; - pos__ = (pos__ + 1);} + pos__ = (pos__ + 1); + } } for (int sym1__ = 2; sym1__ <= lcm_sym159__; ++sym1__) { current_statement__ = 38; @@ -17474,8 +17882,10 @@ class fails_test_model final : public model_base_crtp { "assigning variable x", index_uni(sym2__), index_uni(sym1__)); current_statement__ = 38; - pos__ = (pos__ + 1);} - } } + pos__ = (pos__ + 1); + } + } + } } } current_statement__ = 38; @@ -17492,7 +17902,8 @@ class fails_test_model final : public model_base_crtp { current_statement__ = 38; check_greater_or_equal(function__, "x[sym1__, sym2__]", rvalue(x, "x", - index_uni(1), index_uni(sym2__)), 0);} + index_uni(1), index_uni(sym2__)), 0); + } } for (int sym1__ = 2; sym1__ <= nind; ++sym1__) { current_statement__ = 38; @@ -17506,8 +17917,10 @@ class fails_test_model final : public model_base_crtp { current_statement__ = 38; current_statement__ = 38; check_greater_or_equal(function__, "x[sym1__, sym2__]", - x[(sym1__ - 1)][(sym2__ - 1)], 0);} - } } + x[(sym1__ - 1)][(sym2__ - 1)], 0); + } + } + } } current_statement__ = 38; if (lcm_sym157__) { @@ -17538,29 +17951,28 @@ class fails_test_model final : public model_base_crtp { current_statement__ = 38; current_statement__ = 38; check_less_or_equal(function__, "x[sym1__, sym2__]", - x[(sym1__ - 1)][(sym2__ - 1)], max_age);} - } } + x[(sym1__ - 1)][(sym2__ - 1)], max_age); + } + } + } } current_statement__ = 39; - n_occ_minus_1 = std::numeric_limits::min(); current_statement__ = 39; n_occ_minus_1 = lcm_sym159__; current_statement__ = 40; validate_non_negative_index("first", "nind", nind); current_statement__ = 41; - first = std::vector(nind, std::numeric_limits::min()); current_statement__ = 42; validate_non_negative_index("last", "nind", nind); current_statement__ = 43; - last = std::vector(nind, std::numeric_limits::min()); current_statement__ = 48; if (lcm_sym157__) { int inline_sym17__; int inline_sym19__; - inline_sym19__ = std::numeric_limits::min(); + inline_sym19__ = std::numeric_limits::min(); inline_sym19__ = 0; for (int inline_sym20__ = 1; inline_sym20__ <= 1; ++inline_sym20__) { @@ -17572,19 +17984,21 @@ class fails_test_model final : public model_base_crtp { inline_sym19__ = 1; inline_sym17__ = inline_sym18__; break; - } } + } + } if (inline_sym19__) { break; } inline_sym19__ = 1; inline_sym17__ = 0; - break;} + break; + } assign(first, inline_sym17__, "assigning variable first", index_uni(1)); for (int i = 2; i <= nind; ++i) { int inline_sym17__; int inline_sym19__; - inline_sym19__ = std::numeric_limits::min(); + inline_sym19__ = std::numeric_limits::min(); inline_sym19__ = 0; for (int inline_sym20__ = 1; inline_sym20__ <= 1; ++inline_sym20__) { @@ -17596,21 +18010,24 @@ class fails_test_model final : public model_base_crtp { inline_sym19__ = 1; inline_sym17__ = inline_sym18__; break; - } } + } + } if (inline_sym19__) { break; } inline_sym19__ = 1; inline_sym17__ = 0; - break;} + break; + } assign(first, inline_sym17__, - "assigning variable first", index_uni(i));} + "assigning variable first", index_uni(i)); + } } current_statement__ = 55; if (lcm_sym157__) { int inline_sym21__; int inline_sym24__; - inline_sym24__ = std::numeric_limits::min(); + inline_sym24__ = std::numeric_limits::min(); inline_sym24__ = 0; for (int inline_sym25__ = 1; inline_sym25__ <= 1; ++inline_sym25__) { @@ -17619,7 +18036,7 @@ class fails_test_model final : public model_base_crtp { for (int inline_sym23__ = 0; inline_sym23__ <= lcm_sym163__; ++inline_sym23__) { int inline_sym22__; - inline_sym22__ = std::numeric_limits::min(); + inline_sym22__ = std::numeric_limits::min(); lcm_sym162__ = (lcm_sym166__ - inline_sym23__); inline_sym22__ = lcm_sym162__; @@ -17628,18 +18045,20 @@ class fails_test_model final : public model_base_crtp { inline_sym24__ = 1; inline_sym21__ = lcm_sym162__; break; - } } + } + } if (inline_sym24__) { break; } inline_sym24__ = 1; inline_sym21__ = 0; - break;} + break; + } assign(last, inline_sym21__, "assigning variable last", index_uni(1)); for (int i = 2; i <= nind; ++i) { int inline_sym21__; int inline_sym24__; - inline_sym24__ = std::numeric_limits::min(); + inline_sym24__ = std::numeric_limits::min(); inline_sym24__ = 0; for (int inline_sym25__ = 1; inline_sym25__ <= 1; ++inline_sym25__) { @@ -17648,7 +18067,7 @@ class fails_test_model final : public model_base_crtp { for (int inline_sym23__ = 0; inline_sym23__ <= lcm_sym161__; ++inline_sym23__) { int inline_sym22__; - inline_sym22__ = std::numeric_limits::min(); + inline_sym22__ = std::numeric_limits::min(); lcm_sym160__ = (lcm_sym165__ - inline_sym23__); inline_sym22__ = lcm_sym160__; @@ -17657,15 +18076,18 @@ class fails_test_model final : public model_base_crtp { inline_sym24__ = 1; inline_sym21__ = lcm_sym160__; break; - } } + } + } if (inline_sym24__) { break; } inline_sym24__ = 1; inline_sym21__ = 0; - break;} + break; + } assign(last, inline_sym21__, - "assigning variable last", index_uni(i));} + "assigning variable last", index_uni(i)); + } } current_statement__ = 41; if (lcm_sym157__) { @@ -17677,7 +18099,8 @@ class fails_test_model final : public model_base_crtp { current_statement__ = 41; current_statement__ = 41; check_greater_or_equal(function__, "first[sym1__]", - first[(sym1__ - 1)], 0);} + first[(sym1__ - 1)], 0); + } } current_statement__ = 41; if (lcm_sym157__) { @@ -17689,7 +18112,8 @@ class fails_test_model final : public model_base_crtp { current_statement__ = 41; current_statement__ = 41; check_less_or_equal(function__, "first[sym1__]", - first[(sym1__ - 1)], n_occasions);} + first[(sym1__ - 1)], n_occasions); + } } current_statement__ = 43; if (lcm_sym157__) { @@ -17701,7 +18125,8 @@ class fails_test_model final : public model_base_crtp { current_statement__ = 43; current_statement__ = 43; check_greater_or_equal(function__, "last[sym1__]", - last[(sym1__ - 1)], 0);} + last[(sym1__ - 1)], 0); + } } current_statement__ = 43; if (lcm_sym157__) { @@ -17713,7 +18138,8 @@ class fails_test_model final : public model_base_crtp { current_statement__ = 43; current_statement__ = 43; check_less_or_equal(function__, "last[sym1__]", last[(sym1__ - 1)], - n_occasions);} + n_occasions); + } } current_statement__ = 56; validate_non_negative_index("beta", "max_age", max_age); @@ -17734,16 +18160,8 @@ class fails_test_model final : public model_base_crtp { // Next line prevents compiler griping about no return throw std::runtime_error("*** IF YOU SEE THIS, PLEASE REPORT A BUG ***"); } - num_params_r__ = 0U; + num_params_r__ = 1 + max_age; - try { - num_params_r__ += 1; - num_params_r__ += max_age; - } catch (const std::exception& e) { - stan::lang::rethrow_located(e, locations_array__[current_statement__]); - // Next line prevents compiler griping about no return - throw std::runtime_error("*** IF YOU SEE THIS, PLEASE REPORT A BUG ***"); - } } template { int lcm_sym104__; int lcm_sym103__; local_scalar_t__ mean_p; - mean_p = DUMMY_VAR__; + mean_p = DUMMY_VAR__; current_statement__ = 1; mean_p = in__.template read_constrain_lub( 0, 1, lp__); Eigen::Matrix beta; beta = Eigen::Matrix(max_age); - stan::math::fill(beta, DUMMY_VAR__); + stan::math::fill(beta, DUMMY_VAR__); current_statement__ = 2; beta = in__.template read_constrain_lub, jacobian__>( 0, 1, lp__, max_age); Eigen::Matrix phi; phi = Eigen::Matrix(nind, (n_occasions - 1)); - stan::math::fill(phi, DUMMY_VAR__); + stan::math::fill(phi, DUMMY_VAR__); Eigen::Matrix p; p = Eigen::Matrix(nind, (n_occasions - 1)); - stan::math::fill(p, DUMMY_VAR__); + stan::math::fill(p, DUMMY_VAR__); Eigen::Matrix chi; chi = Eigen::Matrix(nind, n_occasions); - stan::math::fill(chi, DUMMY_VAR__); + stan::math::fill(chi, DUMMY_VAR__); lcm_sym104__ = logical_gte(nind, 1); if (lcm_sym104__) { @@ -17877,7 +18295,8 @@ class fails_test_model final : public model_base_crtp { "assigning variable phi", index_uni(1), index_uni(t)); current_statement__ = 10; assign(p, mean_p, - "assigning variable p", index_uni(1), index_uni(t));} + "assigning variable p", index_uni(1), index_uni(t)); + } } for (int i = 2; i <= nind; ++i) { lcm_sym140__ = rvalue(first, "first", index_uni(i)); @@ -17915,12 +18334,14 @@ class fails_test_model final : public model_base_crtp { "assigning variable phi", index_uni(i), index_uni(t)); current_statement__ = 10; assign(p, mean_p, - "assigning variable p", index_uni(i), index_uni(t));} - } } + "assigning variable p", index_uni(i), index_uni(t)); + } + } + } } Eigen::Matrix inline_sym9__; int inline_sym15__; - inline_sym15__ = std::numeric_limits::min(); + inline_sym15__ = std::numeric_limits::min(); inline_sym15__ = 0; for (int inline_sym16__ = 1; inline_sym16__ <= 1; ++inline_sym16__) { @@ -17930,7 +18351,7 @@ class fails_test_model final : public model_base_crtp { validate_non_negative_index("chi", "n_occasions", n_occasions); Eigen::Matrix inline_sym10__; inline_sym10__ = Eigen::Matrix(nind, n_occasions); - stan::math::fill(inline_sym10__, DUMMY_VAR__); + stan::math::fill(inline_sym10__, DUMMY_VAR__); for (int inline_sym14__ = 1; inline_sym14__ <= nind; ++inline_sym14__) { current_statement__ = 17; @@ -17940,10 +18361,10 @@ class fails_test_model final : public model_base_crtp { lcm_sym115__ = (n_occasions - 1); if (logical_gte(lcm_sym115__, 1)) { int inline_sym11__; - inline_sym11__ = std::numeric_limits::min(); + inline_sym11__ = std::numeric_limits::min(); int inline_sym12__; - inline_sym12__ = std::numeric_limits::min(); + inline_sym12__ = std::numeric_limits::min(); lcm_sym119__ = (lcm_sym115__ + 1); current_statement__ = 20; @@ -17965,11 +18386,11 @@ class fails_test_model final : public model_base_crtp { for (int inline_sym13__ = 2; inline_sym13__ <= lcm_sym115__; ++inline_sym13__) { int inline_sym11__; - inline_sym11__ = std::numeric_limits::min(); + inline_sym11__ = std::numeric_limits::min(); lcm_sym114__ = (n_occasions - inline_sym13__); int inline_sym12__; - inline_sym12__ = std::numeric_limits::min(); + inline_sym12__ = std::numeric_limits::min(); lcm_sym118__ = (lcm_sym114__ + 1); current_statement__ = 20; @@ -17992,14 +18413,16 @@ class fails_test_model final : public model_base_crtp { } if (inline_sym15__) { break; - } } + } + } if (inline_sym15__) { break; } inline_sym15__ = 1; assign(inline_sym9__, inline_sym10__, "assigning variable inline_sym9__"); - break;} + break; + } assign(chi, inline_sym9__, "assigning variable chi"); current_statement__ = 3; if (lcm_sym104__) { @@ -18016,7 +18439,8 @@ class fails_test_model final : public model_base_crtp { current_statement__ = 3; check_greater_or_equal(function__, "phi[sym1__, sym2__]", rvalue(phi, "phi", - index_uni(1), index_uni(sym2__)), 0);} + index_uni(1), index_uni(sym2__)), 0); + } } for (int sym1__ = 2; sym1__ <= nind; ++sym1__) { current_statement__ = 3; @@ -18032,8 +18456,10 @@ class fails_test_model final : public model_base_crtp { check_greater_or_equal(function__, "phi[sym1__, sym2__]", rvalue(phi, "phi", index_uni(sym1__), index_uni(sym2__)), - 0);} - } } + 0); + } + } + } } current_statement__ = 3; if (lcm_sym104__) { @@ -18050,7 +18476,8 @@ class fails_test_model final : public model_base_crtp { current_statement__ = 3; check_less_or_equal(function__, "phi[sym1__, sym2__]", rvalue(phi, "phi", - index_uni(1), index_uni(sym2__)), 1);} + index_uni(1), index_uni(sym2__)), 1); + } } for (int sym1__ = 2; sym1__ <= nind; ++sym1__) { current_statement__ = 3; @@ -18067,7 +18494,8 @@ class fails_test_model final : public model_base_crtp { rvalue(phi, "phi", index_uni(sym1__), index_uni(sym2__)), 1); } - } } + } + } } current_statement__ = 4; if (lcm_sym104__) { @@ -18084,7 +18512,8 @@ class fails_test_model final : public model_base_crtp { current_statement__ = 4; check_greater_or_equal(function__, "p[sym1__, sym2__]", rvalue(p, "p", - index_uni(1), index_uni(sym2__)), 0);} + index_uni(1), index_uni(sym2__)), 0); + } } for (int sym1__ = 2; sym1__ <= nind; ++sym1__) { current_statement__ = 4; @@ -18100,8 +18529,10 @@ class fails_test_model final : public model_base_crtp { check_greater_or_equal(function__, "p[sym1__, sym2__]", rvalue(p, "p", index_uni(sym1__), index_uni(sym2__)), - 0);} - } } + 0); + } + } + } } current_statement__ = 4; if (lcm_sym104__) { @@ -18117,7 +18548,8 @@ class fails_test_model final : public model_base_crtp { current_statement__ = 4; check_less_or_equal(function__, "p[sym1__, sym2__]", rvalue(p, "p", - index_uni(1), index_uni(sym2__)), 1);} + index_uni(1), index_uni(sym2__)), 1); + } } for (int sym1__ = 2; sym1__ <= nind; ++sym1__) { current_statement__ = 4; @@ -18134,7 +18566,8 @@ class fails_test_model final : public model_base_crtp { rvalue(p, "p", index_uni(sym1__), index_uni(sym2__)), 1); } - } } + } + } } current_statement__ = 5; if (lcm_sym104__) { @@ -18150,7 +18583,8 @@ class fails_test_model final : public model_base_crtp { current_statement__ = 5; check_greater_or_equal(function__, "chi[sym1__, sym2__]", rvalue(inline_sym9__, "inline_sym9__", - index_uni(1), index_uni(sym2__)), 0);} + index_uni(1), index_uni(sym2__)), 0); + } } for (int sym1__ = 2; sym1__ <= nind; ++sym1__) { current_statement__ = 5; @@ -18166,8 +18600,10 @@ class fails_test_model final : public model_base_crtp { check_greater_or_equal(function__, "chi[sym1__, sym2__]", rvalue(inline_sym9__, "inline_sym9__", index_uni(sym1__), index_uni(sym2__)), - 0);} - } } + 0); + } + } + } } current_statement__ = 5; if (lcm_sym104__) { @@ -18183,7 +18619,8 @@ class fails_test_model final : public model_base_crtp { current_statement__ = 5; check_less_or_equal(function__, "chi[sym1__, sym2__]", rvalue(inline_sym9__, "inline_sym9__", - index_uni(1), index_uni(sym2__)), 1);} + index_uni(1), index_uni(sym2__)), 1); + } } for (int sym1__ = 2; sym1__ <= nind; ++sym1__) { current_statement__ = 5; @@ -18200,7 +18637,8 @@ class fails_test_model final : public model_base_crtp { rvalue(inline_sym9__, "inline_sym9__", index_uni(sym1__), index_uni(sym2__)), 1); } - } } + } + } } { current_statement__ = 30; @@ -18229,7 +18667,8 @@ class fails_test_model final : public model_base_crtp { lp_accum__.add( bernoulli_lpmf( rvalue(y, "y", index_uni(1), index_uni(t)), - rvalue(p, "p", index_uni(1), index_uni((t - 1)))));} + rvalue(p, "p", index_uni(1), index_uni((t - 1))))); + } } current_statement__ = 27; lp_accum__.add( @@ -18263,14 +18702,16 @@ class fails_test_model final : public model_base_crtp { lp_accum__.add( bernoulli_lpmf( rvalue(y, "y", index_uni(i), index_uni(t)), - rvalue(p, "p", index_uni(i), index_uni((t - 1)))));} + rvalue(p, "p", index_uni(i), index_uni((t - 1))))); + } } current_statement__ = 27; lp_accum__.add( bernoulli_lpmf(1, rvalue(inline_sym9__, "inline_sym9__", index_uni(i), index_uni(lcm_sym146__)))); - } } + } + } } } } catch (const std::exception& e) { @@ -18355,35 +18796,36 @@ class fails_test_model final : public model_base_crtp { int lcm_sym55__; int lcm_sym54__; double mean_p; - mean_p = std::numeric_limits::quiet_NaN(); + mean_p = std::numeric_limits::quiet_NaN(); current_statement__ = 1; mean_p = in__.template read_constrain_lub( 0, 1, lp__); Eigen::Matrix beta; beta = Eigen::Matrix(max_age); - stan::math::fill(beta, std::numeric_limits::quiet_NaN()); + stan::math::fill(beta, std::numeric_limits::quiet_NaN()); current_statement__ = 2; beta = in__.template read_constrain_lub, jacobian__>( 0, 1, lp__, max_age); Eigen::Matrix phi; phi = Eigen::Matrix(nind, (n_occasions - 1)); - stan::math::fill(phi, DUMMY_VAR__); + stan::math::fill(phi, DUMMY_VAR__); Eigen::Matrix p; p = Eigen::Matrix(nind, (n_occasions - 1)); - stan::math::fill(p, std::numeric_limits::quiet_NaN()); + stan::math::fill(p, std::numeric_limits::quiet_NaN()); Eigen::Matrix chi; chi = Eigen::Matrix(nind, n_occasions); - stan::math::fill(chi, DUMMY_VAR__); + stan::math::fill(chi, DUMMY_VAR__); vars__.emplace_back(mean_p); if (logical_gte(max_age, 1)) { vars__.emplace_back(rvalue(beta, "beta", index_uni(1))); for (int sym1__ = 2; sym1__ <= max_age; ++sym1__) { - vars__.emplace_back(beta[(sym1__ - 1)]);} + vars__.emplace_back(beta[(sym1__ - 1)]); + } } if (logical_negation((primitive_value(emit_transformed_parameters__) || primitive_value(emit_generated_quantities__)))) { @@ -18424,7 +18866,8 @@ class fails_test_model final : public model_base_crtp { "assigning variable phi", index_uni(1), index_uni(t)); current_statement__ = 10; assign(p, mean_p, - "assigning variable p", index_uni(1), index_uni(t));} + "assigning variable p", index_uni(1), index_uni(t)); + } } for (int i = 2; i <= nind; ++i) { lcm_sym80__ = rvalue(first, "first", index_uni(i)); @@ -18462,12 +18905,14 @@ class fails_test_model final : public model_base_crtp { "assigning variable phi", index_uni(i), index_uni(t)); current_statement__ = 10; assign(p, mean_p, - "assigning variable p", index_uni(i), index_uni(t));} - } } + "assigning variable p", index_uni(i), index_uni(t)); + } + } + } } Eigen::Matrix inline_sym1__; int inline_sym7__; - inline_sym7__ = std::numeric_limits::min(); + inline_sym7__ = std::numeric_limits::min(); inline_sym7__ = 0; for (int inline_sym8__ = 1; inline_sym8__ <= 1; ++inline_sym8__) { @@ -18477,7 +18922,7 @@ class fails_test_model final : public model_base_crtp { validate_non_negative_index("chi", "n_occasions", n_occasions); Eigen::Matrix inline_sym2__; inline_sym2__ = Eigen::Matrix(nind, n_occasions); - stan::math::fill(inline_sym2__, DUMMY_VAR__); + stan::math::fill(inline_sym2__, DUMMY_VAR__); for (int inline_sym6__ = 1; inline_sym6__ <= nind; ++inline_sym6__) { current_statement__ = 17; @@ -18487,10 +18932,10 @@ class fails_test_model final : public model_base_crtp { lcm_sym63__ = (n_occasions - 1); if (logical_gte(lcm_sym63__, 1)) { int inline_sym3__; - inline_sym3__ = std::numeric_limits::min(); + inline_sym3__ = std::numeric_limits::min(); int inline_sym4__; - inline_sym4__ = std::numeric_limits::min(); + inline_sym4__ = std::numeric_limits::min(); lcm_sym69__ = (lcm_sym63__ + 1); current_statement__ = 20; @@ -18511,11 +18956,11 @@ class fails_test_model final : public model_base_crtp { for (int inline_sym5__ = 2; inline_sym5__ <= lcm_sym63__; ++inline_sym5__) { int inline_sym3__; - inline_sym3__ = std::numeric_limits::min(); + inline_sym3__ = std::numeric_limits::min(); lcm_sym62__ = (n_occasions - inline_sym5__); int inline_sym4__; - inline_sym4__ = std::numeric_limits::min(); + inline_sym4__ = std::numeric_limits::min(); lcm_sym68__ = (lcm_sym62__ + 1); current_statement__ = 20; @@ -18538,14 +18983,16 @@ class fails_test_model final : public model_base_crtp { } if (inline_sym7__) { break; - } } + } + } if (inline_sym7__) { break; } inline_sym7__ = 1; assign(inline_sym1__, inline_sym2__, "assigning variable inline_sym1__"); - break;} + break; + } assign(chi, inline_sym1__, "assigning variable chi"); current_statement__ = 3; if (lcm_sym56__) { @@ -18562,7 +19009,8 @@ class fails_test_model final : public model_base_crtp { current_statement__ = 3; check_greater_or_equal(function__, "phi[sym1__, sym2__]", rvalue(phi, "phi", - index_uni(1), index_uni(sym2__)), 0);} + index_uni(1), index_uni(sym2__)), 0); + } } for (int sym1__ = 2; sym1__ <= nind; ++sym1__) { current_statement__ = 3; @@ -18578,8 +19026,10 @@ class fails_test_model final : public model_base_crtp { check_greater_or_equal(function__, "phi[sym1__, sym2__]", rvalue(phi, "phi", index_uni(sym1__), index_uni(sym2__)), - 0);} - } } + 0); + } + } + } } current_statement__ = 3; if (lcm_sym56__) { @@ -18596,7 +19046,8 @@ class fails_test_model final : public model_base_crtp { current_statement__ = 3; check_less_or_equal(function__, "phi[sym1__, sym2__]", rvalue(phi, "phi", - index_uni(1), index_uni(sym2__)), 1);} + index_uni(1), index_uni(sym2__)), 1); + } } for (int sym1__ = 2; sym1__ <= nind; ++sym1__) { current_statement__ = 3; @@ -18613,7 +19064,8 @@ class fails_test_model final : public model_base_crtp { rvalue(phi, "phi", index_uni(sym1__), index_uni(sym2__)), 1); } - } } + } + } } current_statement__ = 4; if (lcm_sym56__) { @@ -18630,7 +19082,8 @@ class fails_test_model final : public model_base_crtp { current_statement__ = 4; check_greater_or_equal(function__, "p[sym1__, sym2__]", rvalue(p, "p", - index_uni(1), index_uni(sym2__)), 0);} + index_uni(1), index_uni(sym2__)), 0); + } } for (int sym1__ = 2; sym1__ <= nind; ++sym1__) { current_statement__ = 4; @@ -18646,8 +19099,10 @@ class fails_test_model final : public model_base_crtp { check_greater_or_equal(function__, "p[sym1__, sym2__]", rvalue(p, "p", index_uni(sym1__), index_uni(sym2__)), - 0);} - } } + 0); + } + } + } } current_statement__ = 4; if (lcm_sym56__) { @@ -18663,7 +19118,8 @@ class fails_test_model final : public model_base_crtp { current_statement__ = 4; check_less_or_equal(function__, "p[sym1__, sym2__]", rvalue(p, "p", - index_uni(1), index_uni(sym2__)), 1);} + index_uni(1), index_uni(sym2__)), 1); + } } for (int sym1__ = 2; sym1__ <= nind; ++sym1__) { current_statement__ = 4; @@ -18680,7 +19136,8 @@ class fails_test_model final : public model_base_crtp { rvalue(p, "p", index_uni(sym1__), index_uni(sym2__)), 1); } - } } + } + } } current_statement__ = 5; if (lcm_sym56__) { @@ -18696,7 +19153,8 @@ class fails_test_model final : public model_base_crtp { current_statement__ = 5; check_greater_or_equal(function__, "chi[sym1__, sym2__]", rvalue(inline_sym1__, "inline_sym1__", - index_uni(1), index_uni(sym2__)), 0);} + index_uni(1), index_uni(sym2__)), 0); + } } for (int sym1__ = 2; sym1__ <= nind; ++sym1__) { current_statement__ = 5; @@ -18712,8 +19170,10 @@ class fails_test_model final : public model_base_crtp { check_greater_or_equal(function__, "chi[sym1__, sym2__]", rvalue(inline_sym1__, "inline_sym1__", index_uni(sym1__), index_uni(sym2__)), - 0);} - } } + 0); + } + } + } } current_statement__ = 5; if (lcm_sym56__) { @@ -18729,7 +19189,8 @@ class fails_test_model final : public model_base_crtp { current_statement__ = 5; check_less_or_equal(function__, "chi[sym1__, sym2__]", rvalue(inline_sym1__, "inline_sym1__", - index_uni(1), index_uni(sym2__)), 1);} + index_uni(1), index_uni(sym2__)), 1); + } } for (int sym1__ = 2; sym1__ <= nind; ++sym1__) { current_statement__ = 5; @@ -18746,7 +19207,8 @@ class fails_test_model final : public model_base_crtp { rvalue(inline_sym1__, "inline_sym1__", index_uni(sym1__), index_uni(sym2__)), 1); } - } } + } + } } if (emit_transformed_parameters__) { lcm_sym63__ = (n_occasions - 1); @@ -18757,7 +19219,8 @@ class fails_test_model final : public model_base_crtp { rvalue(phi, "phi", index_uni(1), index_uni(1))); for (int sym2__ = 2; sym2__ <= nind; ++sym2__) { vars__.emplace_back( - rvalue(phi, "phi", index_uni(sym2__), index_uni(1)));} + rvalue(phi, "phi", index_uni(sym2__), index_uni(1))); + } } for (int sym1__ = 2; sym1__ <= lcm_sym63__; ++sym1__) { if (lcm_sym56__) { @@ -18765,15 +19228,18 @@ class fails_test_model final : public model_base_crtp { rvalue(phi, "phi", index_uni(1), index_uni(sym1__))); for (int sym2__ = 2; sym2__ <= nind; ++sym2__) { vars__.emplace_back( - rvalue(phi, "phi", index_uni(sym2__), index_uni(sym1__)));} - } } + rvalue(phi, "phi", index_uni(sym2__), index_uni(sym1__))); + } + } + } } if (lcm_sym57__) { if (lcm_sym56__) { vars__.emplace_back(rvalue(p, "p", index_uni(1), index_uni(1))); for (int sym2__ = 2; sym2__ <= nind; ++sym2__) { vars__.emplace_back( - rvalue(p, "p", index_uni(sym2__), index_uni(1)));} + rvalue(p, "p", index_uni(sym2__), index_uni(1))); + } } for (int sym1__ = 2; sym1__ <= lcm_sym63__; ++sym1__) { if (lcm_sym56__) { @@ -18781,8 +19247,10 @@ class fails_test_model final : public model_base_crtp { rvalue(p, "p", index_uni(1), index_uni(sym1__))); for (int sym2__ = 2; sym2__ <= nind; ++sym2__) { vars__.emplace_back( - rvalue(p, "p", index_uni(sym2__), index_uni(sym1__)));} - } } + rvalue(p, "p", index_uni(sym2__), index_uni(sym1__))); + } + } + } } if (logical_gte(n_occasions, 1)) { if (lcm_sym56__) { @@ -18792,7 +19260,8 @@ class fails_test_model final : public model_base_crtp { for (int sym2__ = 2; sym2__ <= nind; ++sym2__) { vars__.emplace_back( rvalue(inline_sym1__, "inline_sym1__", - index_uni(sym2__), index_uni(1)));} + index_uni(sym2__), index_uni(1))); + } } for (int sym1__ = 2; sym1__ <= n_occasions; ++sym1__) { if (lcm_sym56__) { @@ -18802,8 +19271,10 @@ class fails_test_model final : public model_base_crtp { for (int sym2__ = 2; sym2__ <= nind; ++sym2__) { vars__.emplace_back( rvalue(inline_sym1__, "inline_sym1__", - index_uni(sym2__), index_uni(sym1__)));} - } } + index_uni(sym2__), index_uni(sym1__))); + } + } + } } } if (logical_negation(emit_generated_quantities__)) { @@ -18837,22 +19308,22 @@ class fails_test_model final : public model_base_crtp { int lcm_sym47__; int lcm_sym46__; int pos__; - pos__ = std::numeric_limits::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; double mean_p; - mean_p = std::numeric_limits::quiet_NaN(); + mean_p = std::numeric_limits::quiet_NaN(); current_statement__ = 1; mean_p = context__.vals_r("mean_p")[(1 - 1)]; double mean_p_free__; - mean_p_free__ = std::numeric_limits::quiet_NaN(); + mean_p_free__ = std::numeric_limits::quiet_NaN(); current_statement__ = 1; mean_p_free__ = stan::math::lub_free(mean_p, 0, 1); Eigen::Matrix beta; beta = Eigen::Matrix(max_age); - stan::math::fill(beta, std::numeric_limits::quiet_NaN()); + stan::math::fill(beta, std::numeric_limits::quiet_NaN()); { std::vector beta_flat__; @@ -18872,12 +19343,13 @@ class fails_test_model final : public model_base_crtp { assign(beta, beta_flat__[(pos__ - 1)], "assigning variable beta", index_uni(sym1__)); current_statement__ = 2; - pos__ = (pos__ + 1);} + pos__ = (pos__ + 1); + } } } Eigen::Matrix beta_free__; beta_free__ = Eigen::Matrix(max_age); - stan::math::fill(beta_free__, std::numeric_limits::quiet_NaN()); + stan::math::fill(beta_free__, std::numeric_limits::quiet_NaN()); current_statement__ = 2; if (lcm_sym46__) { @@ -18888,14 +19360,16 @@ class fails_test_model final : public model_base_crtp { for (int sym1__ = 2; sym1__ <= max_age; ++sym1__) { current_statement__ = 2; assign(beta_free__, stan::math::lub_free(beta[(sym1__ - 1)], 0, 1), - "assigning variable beta_free__", index_uni(sym1__));} + "assigning variable beta_free__", index_uni(sym1__)); + } } vars__.emplace_back(mean_p_free__); if (lcm_sym46__) { vars__.emplace_back( rvalue(beta_free__, "beta_free__", index_uni(1))); for (int sym1__ = 2; sym1__ <= max_age; ++sym1__) { - vars__.emplace_back(beta_free__[(sym1__ - 1)]);} + vars__.emplace_back(beta_free__[(sym1__ - 1)]); + } } } catch (const std::exception& e) { stan::lang::rethrow_located(e, locations_array__[current_statement__]); @@ -18906,23 +19380,21 @@ class fails_test_model final : public model_base_crtp { inline void get_param_names(std::vector& names__) const { - names__ = std::vector{"mean_p", - "beta", - "phi", - "p", - "chi"}; + names__ = std::vector{"mean_p", "beta", "phi", "p", "chi"}; + } // get_param_names() inline void get_dims(std::vector>& dimss__) const { dimss__ = std::vector>{std::vector{}, - std::vector{static_cast(max_age)}, - std::vector{static_cast(nind), - static_cast(n_occ_minus_1)}, - std::vector{static_cast(nind), - static_cast(n_occ_minus_1)}, - std::vector{static_cast(nind), - static_cast(n_occasions)}}; + std::vector{static_cast(max_age)}, + std::vector{static_cast(nind), + static_cast(n_occ_minus_1)}, + std::vector{static_cast(nind), + static_cast(n_occ_minus_1)}, + std::vector{static_cast(nind), + static_cast(n_occasions)}}; + } // get_dims() inline void constrained_param_names( @@ -18935,29 +19407,36 @@ class fails_test_model final : public model_base_crtp { for (int sym187__ = 1; sym187__ <= max_age; ++sym187__) { { param_names__.emplace_back(std::string() + "beta" + '.' + std::to_string(sym187__)); - }} + } + } if (emit_transformed_parameters__) { for (int sym187__ = 1; sym187__ <= n_occ_minus_1; ++sym187__) { { for (int sym188__ = 1; sym188__ <= nind; ++sym188__) { { param_names__.emplace_back(std::string() + "phi" + '.' + std::to_string(sym188__) + '.' + std::to_string(sym187__)); - }} - }} + } + } + } + } for (int sym187__ = 1; sym187__ <= n_occ_minus_1; ++sym187__) { { for (int sym188__ = 1; sym188__ <= nind; ++sym188__) { { param_names__.emplace_back(std::string() + "p" + '.' + std::to_string(sym188__) + '.' + std::to_string(sym187__)); - }} - }} + } + } + } + } for (int sym187__ = 1; sym187__ <= n_occasions; ++sym187__) { { for (int sym188__ = 1; sym188__ <= nind; ++sym188__) { { param_names__.emplace_back(std::string() + "chi" + '.' + std::to_string(sym188__) + '.' + std::to_string(sym187__)); - }} - }} + } + } + } + } } if (emit_generated_quantities__) { @@ -18976,29 +19455,36 @@ class fails_test_model final : public model_base_crtp { for (int sym187__ = 1; sym187__ <= max_age; ++sym187__) { { param_names__.emplace_back(std::string() + "beta" + '.' + std::to_string(sym187__)); - }} + } + } if (emit_transformed_parameters__) { for (int sym187__ = 1; sym187__ <= n_occ_minus_1; ++sym187__) { { for (int sym188__ = 1; sym188__ <= nind; ++sym188__) { { param_names__.emplace_back(std::string() + "phi" + '.' + std::to_string(sym188__) + '.' + std::to_string(sym187__)); - }} - }} + } + } + } + } for (int sym187__ = 1; sym187__ <= n_occ_minus_1; ++sym187__) { { for (int sym188__ = 1; sym188__ <= nind; ++sym188__) { { param_names__.emplace_back(std::string() + "p" + '.' + std::to_string(sym188__) + '.' + std::to_string(sym187__)); - }} - }} + } + } + } + } for (int sym187__ = 1; sym187__ <= n_occasions; ++sym187__) { { for (int sym188__ = 1; sym188__ <= nind; ++sym188__) { { param_names__.emplace_back(std::string() + "chi" + '.' + std::to_string(sym188__) + '.' + std::to_string(sym187__)); - }} - }} + } + } + } + } } if (emit_generated_quantities__) { @@ -19007,14 +19493,16 @@ class fails_test_model final : public model_base_crtp { } // unconstrained_param_names() - inline std::string get_constrained_sizedtypes() const final { + inline std::string get_constrained_sizedtypes() const { + + return std::string("[{\"name\":\"mean_p\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"beta\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(max_age) + "},\"block\":\"parameters\"},{\"name\":\"phi\",\"type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(nind) + ",\"cols\":" + std::to_string(n_occ_minus_1) + "},\"block\":\"transformed_parameters\"},{\"name\":\"p\",\"type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(nind) + ",\"cols\":" + std::to_string(n_occ_minus_1) + "},\"block\":\"transformed_parameters\"},{\"name\":\"chi\",\"type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(nind) + ",\"cols\":" + std::to_string(n_occasions) + "},\"block\":\"transformed_parameters\"}]"); - return std::string("[{\"name\":\"mean_p\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"beta\",\"type\":{\"name\":\"vector\",\"length\":" << max_age << "},\"block\":\"parameters\"},{\"name\":\"phi\",\"type\":{\"name\":\"matrix\",\"rows\":" << nind << ",\"cols\":" << n_occ_minus_1 << "},\"block\":\"transformed_parameters\"},{\"name\":\"p\",\"type\":{\"name\":\"matrix\",\"rows\":" << nind << ",\"cols\":" << n_occ_minus_1 << "},\"block\":\"transformed_parameters\"},{\"name\":\"chi\",\"type\":{\"name\":\"matrix\",\"rows\":" << nind << ",\"cols\":" << n_occasions << "},\"block\":\"transformed_parameters\"}]"); } // get_constrained_sizedtypes() - inline std::string get_unconstrained_sizedtypes() const final { + inline std::string get_unconstrained_sizedtypes() const { + + return std::string("[{\"name\":\"mean_p\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"beta\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(max_age) + "},\"block\":\"parameters\"},{\"name\":\"phi\",\"type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(nind) + ",\"cols\":" + std::to_string(n_occ_minus_1) + "},\"block\":\"transformed_parameters\"},{\"name\":\"p\",\"type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(nind) + ",\"cols\":" + std::to_string(n_occ_minus_1) + "},\"block\":\"transformed_parameters\"},{\"name\":\"chi\",\"type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(nind) + ",\"cols\":" + std::to_string(n_occasions) + "},\"block\":\"transformed_parameters\"}]"); - return std::string("[{\"name\":\"mean_p\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"beta\",\"type\":{\"name\":\"vector\",\"length\":" << max_age << "},\"block\":\"parameters\"},{\"name\":\"phi\",\"type\":{\"name\":\"matrix\",\"rows\":" << nind << ",\"cols\":" << n_occ_minus_1 << "},\"block\":\"transformed_parameters\"},{\"name\":\"p\",\"type\":{\"name\":\"matrix\",\"rows\":" << nind << ",\"cols\":" << n_occ_minus_1 << "},\"block\":\"transformed_parameters\"},{\"name\":\"chi\",\"type\":{\"name\":\"matrix\",\"rows\":" << nind << ",\"cols\":" << n_occasions << "},\"block\":\"transformed_parameters\"}]"); } // get_unconstrained_sizedtypes() @@ -19026,14 +19514,13 @@ class fails_test_model final : public model_base_crtp { const bool emit_transformed_parameters = true, const bool emit_generated_quantities = true, std::ostream* pstream = nullptr) const { - std::vector vars_vec(vars.size()); + std::vector vars_vec; + vars_vec.reserve(vars.size()); std::vector params_i; write_array_impl(base_rng, params_r, params_i, vars_vec, emit_transformed_parameters, emit_generated_quantities, pstream); - vars.resize(vars_vec.size()); - for (int i = 0; i < vars.size(); ++i) { - vars.coeffRef(i) = vars_vec[i]; - } + vars = Eigen::Map>( + vars_vec.data(), vars_vec.size()); } template @@ -19043,7 +19530,8 @@ class fails_test_model final : public model_base_crtp { bool emit_transformed_parameters = true, bool emit_generated_quantities = true, std::ostream* pstream = nullptr) const { - write_array_impl(base_rng, params_r, params_i, vars, emit_transformed_parameters, emit_generated_quantities, pstream); + write_array_impl(base_rng, params_r, params_i, vars, + emit_transformed_parameters, emit_generated_quantities, pstream); } template @@ -19064,13 +19552,12 @@ class fails_test_model final : public model_base_crtp { inline void transform_inits(const stan::io::var_context& context, Eigen::Matrix& params_r, std::ostream* pstream = nullptr) const final { - std::vector params_r_vec(params_r.size()); + std::vector params_r_vec; + params_r_vec.reserve(params_r.size()); std::vector params_i; transform_inits_impl(context, params_i, params_r_vec, pstream); - params_r.resize(params_r_vec.size()); - for (int i = 0; i < params_r.size(); ++i) { - params_r.coeffRef(i) = params_r_vec[i]; - } + params_r = Eigen::Map>( + params_r_vec.data(), params_r_vec.size()); } inline void transform_inits(const stan::io::var_context& context, std::vector& params_i, @@ -19296,7 +19783,8 @@ first_capture(const std::vector& y_i, std::ostream* pstream__) { if (rvalue(y_i, "y_i", index_uni(k))) { current_statement__ = 58; return k; - } } + } + } } current_statement__ = 134; return 0; @@ -19336,7 +19824,7 @@ last_capture(const std::vector& y_i, std::ostream* pstream__) { lcm_sym57__ = (size(y_i) - 1); if (logical_gte(lcm_sym57__, 0)) { int k; - k = std::numeric_limits::min(); + k = std::numeric_limits::min(); lcm_sym56__ = (size(y_i) - 0); current_statement__ = 116; @@ -19346,14 +19834,15 @@ last_capture(const std::vector& y_i, std::ostream* pstream__) { } for (int k_rev = 1; k_rev <= lcm_sym57__; ++k_rev) { int k; - k = std::numeric_limits::min(); + k = std::numeric_limits::min(); lcm_sym55__ = (size(y_i) - k_rev); current_statement__ = 116; if (y_i[(lcm_sym55__ - 1)]) { current_statement__ = 115; return lcm_sym55__; - } } + } + } } current_statement__ = 135; return 0; @@ -19403,11 +19892,11 @@ prob_uncaptured(const T0__& p_arg__, const T1__& phi_arg__, int lcm_sym60__; { int n_ind; - n_ind = std::numeric_limits::min(); + n_ind = std::numeric_limits::min(); lcm_sym71__ = rows(p); int n_occasions; - n_occasions = std::numeric_limits::min(); + n_occasions = std::numeric_limits::min(); lcm_sym66__ = cols(p); n_occasions = lcm_sym66__; @@ -19417,7 +19906,7 @@ prob_uncaptured(const T0__& p_arg__, const T1__& phi_arg__, validate_non_negative_index("chi", "n_occasions", lcm_sym66__); Eigen::Matrix chi; chi = Eigen::Matrix(lcm_sym71__, lcm_sym66__); - stan::math::fill(chi, DUMMY_VAR__); + stan::math::fill(chi, DUMMY_VAR__); current_statement__ = 137; if (logical_gte(lcm_sym71__, 1)) { @@ -19428,10 +19917,10 @@ prob_uncaptured(const T0__& p_arg__, const T1__& phi_arg__, lcm_sym60__ = logical_gte(lcm_sym63__, 1); if (lcm_sym60__) { int t_curr; - t_curr = std::numeric_limits::min(); + t_curr = std::numeric_limits::min(); int t_next; - t_next = std::numeric_limits::min(); + t_next = std::numeric_limits::min(); lcm_sym65__ = (lcm_sym63__ + 1); current_statement__ = 20; @@ -19444,11 +19933,11 @@ prob_uncaptured(const T0__& p_arg__, const T1__& phi_arg__, "assigning variable chi", index_uni(1), index_uni(lcm_sym63__)); for (int t = 2; t <= lcm_sym63__; ++t) { int t_curr; - t_curr = std::numeric_limits::min(); + t_curr = std::numeric_limits::min(); lcm_sym62__ = (lcm_sym66__ - t); int t_next; - t_next = std::numeric_limits::min(); + t_next = std::numeric_limits::min(); lcm_sym64__ = (lcm_sym62__ + 1); current_statement__ = 20; @@ -19469,10 +19958,10 @@ prob_uncaptured(const T0__& p_arg__, const T1__& phi_arg__, current_statement__ = 136; if (lcm_sym60__) { int t_curr; - t_curr = std::numeric_limits::min(); + t_curr = std::numeric_limits::min(); int t_next; - t_next = std::numeric_limits::min(); + t_next = std::numeric_limits::min(); lcm_sym65__ = (lcm_sym63__ + 1); current_statement__ = 20; @@ -19486,11 +19975,11 @@ prob_uncaptured(const T0__& p_arg__, const T1__& phi_arg__, "assigning variable chi", index_uni(i), index_uni(lcm_sym63__)); for (int t = 2; t <= lcm_sym63__; ++t) { int t_curr; - t_curr = std::numeric_limits::min(); + t_curr = std::numeric_limits::min(); lcm_sym62__ = (lcm_sym66__ - t); int t_next; - t_next = std::numeric_limits::min(); + t_next = std::numeric_limits::min(); lcm_sym64__ = (lcm_sym62__ + 1); current_statement__ = 20; @@ -19503,8 +19992,10 @@ prob_uncaptured(const T0__& p_arg__, const T1__& phi_arg__, (1 - rvalue(phi, "phi", index_uni(i), index_uni(lcm_sym62__)))), "assigning variable chi", index_uni(i), - index_uni(lcm_sym62__));} - } } + index_uni(lcm_sym62__)); + } + } + } } current_statement__ = 138; return chi; @@ -19599,11 +20090,11 @@ jolly_seber_lp(const std::vector>& y, int lcm_sym72__; { int n_ind; - n_ind = std::numeric_limits::min(); + n_ind = std::numeric_limits::min(); lcm_sym120__ = rvalue(dims(y), "dims(y)", index_uni(1)); int n_occasions; - n_occasions = std::numeric_limits::min(); + n_occasions = std::numeric_limits::min(); lcm_sym121__ = rvalue(dims(y), "dims(y)", index_uni(2)); n_occasions = lcm_sym121__; @@ -19611,7 +20102,7 @@ jolly_seber_lp(const std::vector>& y, validate_non_negative_index("qgamma", "n_occasions", lcm_sym121__); Eigen::Matrix qgamma; qgamma = Eigen::Matrix(lcm_sym121__); - stan::math::fill(qgamma, std::numeric_limits::quiet_NaN()); + stan::math::fill(qgamma, std::numeric_limits::quiet_NaN()); assign(lcm_sym80__, subtract(1.0, gamma), "assigning variable lcm_sym80__"); @@ -19621,7 +20112,7 @@ jolly_seber_lp(const std::vector>& y, validate_non_negative_index("qp", "n_occasions", lcm_sym121__); Eigen::Matrix qp; qp = Eigen::Matrix(lcm_sym121__); - stan::math::fill(qp, std::numeric_limits::quiet_NaN()); + stan::math::fill(qp, std::numeric_limits::quiet_NaN()); assign(lcm_sym82__, subtract(1.0, transpose(rvalue(p, "p", index_uni(1)))), @@ -19640,7 +20131,7 @@ jolly_seber_lp(const std::vector>& y, validate_non_negative_index("lp", "first[i]", lcm_sym117__); Eigen::Matrix lp; lp = Eigen::Matrix(lcm_sym117__); - stan::math::fill(lp, DUMMY_VAR__); + stan::math::fill(lp, DUMMY_VAR__); lcm_sym84__ = (lcm_sym117__ - 1); assign(lp, @@ -19697,7 +20188,8 @@ jolly_seber_lp(const std::vector>& y, index_uni(1), index_min_max(t, lcm_sym84__))))) + bernoulli_lpmf(1, rvalue(p, "p", index_uni(1), index_uni(lcm_sym117__)))), - "assigning variable lp", index_uni(t));} + "assigning variable lp", index_uni(t)); + } } current_statement__ = 91; assign(lp, @@ -19733,7 +20225,8 @@ jolly_seber_lp(const std::vector>& y, lp_accum__.add( bernoulli_lpmf( rvalue(y, "y", index_uni(1), index_uni(t)), - rvalue(p, "p", index_uni(1), index_uni(t))));} + rvalue(p, "p", index_uni(1), index_uni(t)))); + } } current_statement__ = 100; lp_accum__.add( @@ -19744,7 +20237,7 @@ jolly_seber_lp(const std::vector>& y, validate_non_negative_index("lp", "n_occasions + 1", lcm_sym101__); Eigen::Matrix lp; lp = Eigen::Matrix(lcm_sym101__); - stan::math::fill(lp, DUMMY_VAR__); + stan::math::fill(lp, DUMMY_VAR__); current_statement__ = 83; assign(lp, @@ -19783,7 +20276,8 @@ jolly_seber_lp(const std::vector>& y, rvalue(p, "p", index_uni(1), index_uni(t)))) + bernoulli_lpmf(1, rvalue(chi, "chi", index_uni(1), index_uni(t)))), - "assigning variable lp", index_uni(t));} + "assigning variable lp", index_uni(t)); + } } current_statement__ = 85; assign(lp, bernoulli_lpmf(1, prod(lcm_sym80__)), @@ -19796,7 +20290,7 @@ jolly_seber_lp(const std::vector>& y, validate_non_negative_index("qp", "n_occasions", lcm_sym121__); Eigen::Matrix qp; qp = Eigen::Matrix(lcm_sym121__); - stan::math::fill(qp, std::numeric_limits::quiet_NaN()); + stan::math::fill(qp, std::numeric_limits::quiet_NaN()); assign(lcm_sym81__, subtract(1.0, transpose(rvalue(p, "p", index_uni(i)))), @@ -19815,7 +20309,7 @@ jolly_seber_lp(const std::vector>& y, validate_non_negative_index("lp", "first[i]", lcm_sym116__); Eigen::Matrix lp; lp = Eigen::Matrix(lcm_sym116__); - stan::math::fill(lp, DUMMY_VAR__); + stan::math::fill(lp, DUMMY_VAR__); lcm_sym83__ = (lcm_sym116__ - 1); assign(lp, @@ -19873,7 +20367,8 @@ jolly_seber_lp(const std::vector>& y, + bernoulli_lpmf(1, rvalue(p, "p", index_uni(i), index_uni(lcm_sym116__)))), - "assigning variable lp", index_uni(t));} + "assigning variable lp", index_uni(t)); + } } current_statement__ = 91; assign(lp, @@ -19909,7 +20404,8 @@ jolly_seber_lp(const std::vector>& y, lp_accum__.add( bernoulli_lpmf( rvalue(y, "y", index_uni(i), index_uni(t)), - rvalue(p, "p", index_uni(i), index_uni(t))));} + rvalue(p, "p", index_uni(i), index_uni(t)))); + } } current_statement__ = 100; lp_accum__.add( @@ -19920,7 +20416,7 @@ jolly_seber_lp(const std::vector>& y, validate_non_negative_index("lp", "n_occasions + 1", lcm_sym101__); Eigen::Matrix lp; lp = Eigen::Matrix(lcm_sym101__); - stan::math::fill(lp, DUMMY_VAR__); + stan::math::fill(lp, DUMMY_VAR__); current_statement__ = 83; assign(lp, @@ -19959,14 +20455,16 @@ jolly_seber_lp(const std::vector>& y, rvalue(p, "p", index_uni(i), index_uni(t)))) + bernoulli_lpmf(1, rvalue(chi, "chi", index_uni(i), index_uni(t)))), - "assigning variable lp", index_uni(t));} + "assigning variable lp", index_uni(t)); + } } current_statement__ = 85; assign(lp, bernoulli_lpmf(1, prod(lcm_sym80__)), "assigning variable lp", index_uni(lcm_sym101__)); current_statement__ = 86; lp_accum__.add(log_sum_exp(lp)); - }} + } + } } } } catch (const std::exception& e) { @@ -20012,7 +20510,7 @@ seq_cprob(const T0__& gamma_arg__, std::ostream* pstream__) { int lcm_sym122__; { int N; - N = std::numeric_limits::min(); + N = std::numeric_limits::min(); lcm_sym128__ = rows(gamma); N = lcm_sym128__; @@ -20020,10 +20518,10 @@ seq_cprob(const T0__& gamma_arg__, std::ostream* pstream__) { validate_non_negative_index("log_cprob", "N", lcm_sym128__); Eigen::Matrix log_cprob; log_cprob = Eigen::Matrix(lcm_sym128__); - stan::math::fill(log_cprob, DUMMY_VAR__); + stan::math::fill(log_cprob, DUMMY_VAR__); local_scalar_t__ log_residual_prob; - log_residual_prob = DUMMY_VAR__; + log_residual_prob = DUMMY_VAR__; current_statement__ = 143; if (logical_gte(lcm_sym128__, 1)) { @@ -20147,13 +20645,13 @@ class inlining_fail2_model final : public model_base_crtp int pos__; - pos__ = std::numeric_limits::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; current_statement__ = 103; context__.validate_dims("data initialization","M","int", - context__.to_vec()); - M = std::numeric_limits::min(); + std::vector{}); + M = std::numeric_limits::min(); current_statement__ = 103; M = context__.vals_i("M")[(1 - 1)]; @@ -20162,8 +20660,8 @@ class inlining_fail2_model final : public model_base_crtp check_greater_or_equal(function__, "M", M, 0); current_statement__ = 104; context__.validate_dims("data initialization","n_occasions","int", - context__.to_vec()); - n_occasions = std::numeric_limits::min(); + std::vector{}); + n_occasions = std::numeric_limits::min(); current_statement__ = 104; n_occasions = context__.vals_i("n_occasions")[(1 - 1)]; @@ -20176,8 +20674,10 @@ class inlining_fail2_model final : public model_base_crtp validate_non_negative_index("y", "n_occasions", n_occasions); current_statement__ = 107; context__.validate_dims("data initialization","y","int", - context__.to_vec(M, n_occasions)); + std::vector{static_cast(M), + static_cast(n_occasions)}); y = std::vector>(M, std::vector(n_occasions, std::numeric_limits::min())); + { std::vector y_flat__; @@ -20200,7 +20700,8 @@ class inlining_fail2_model final : public model_base_crtp assign(y, y_flat__[(pos__ - 1)], "assigning variable y", index_uni(sym2__), index_uni(1)); current_statement__ = 107; - pos__ = (pos__ + 1);} + pos__ = (pos__ + 1); + } } for (int sym1__ = 2; sym1__ <= n_occasions; ++sym1__) { current_statement__ = 107; @@ -20216,8 +20717,10 @@ class inlining_fail2_model final : public model_base_crtp "assigning variable y", index_uni(sym2__), index_uni(sym1__)); current_statement__ = 107; - pos__ = (pos__ + 1);} - } } + pos__ = (pos__ + 1); + } + } + } } } else { lcm_sym316__ = logical_gte(M, 1); @@ -20237,7 +20740,8 @@ class inlining_fail2_model final : public model_base_crtp current_statement__ = 107; check_greater_or_equal(function__, "y[sym1__, sym2__]", rvalue(y, "y", - index_uni(1), index_uni(sym2__)), 0);} + index_uni(1), index_uni(sym2__)), 0); + } } for (int sym1__ = 2; sym1__ <= M; ++sym1__) { current_statement__ = 107; @@ -20251,8 +20755,10 @@ class inlining_fail2_model final : public model_base_crtp current_statement__ = 107; current_statement__ = 107; check_greater_or_equal(function__, "y[sym1__, sym2__]", - y[(sym1__ - 1)][(sym2__ - 1)], 0);} - } } + y[(sym1__ - 1)][(sym2__ - 1)], 0); + } + } + } } current_statement__ = 107; if (lcm_sym316__) { @@ -20267,7 +20773,8 @@ class inlining_fail2_model final : public model_base_crtp current_statement__ = 107; check_less_or_equal(function__, "y[sym1__, sym2__]", rvalue(y, "y", - index_uni(1), index_uni(sym2__)), 1);} + index_uni(1), index_uni(sym2__)), 1); + } } for (int sym1__ = 2; sym1__ <= M; ++sym1__) { current_statement__ = 107; @@ -20281,24 +20788,24 @@ class inlining_fail2_model final : public model_base_crtp current_statement__ = 107; current_statement__ = 107; check_less_or_equal(function__, "y[sym1__, sym2__]", - y[(sym1__ - 1)][(sym2__ - 1)], 1);} - } } + y[(sym1__ - 1)][(sym2__ - 1)], 1); + } + } + } } current_statement__ = 108; validate_non_negative_index("first", "M", M); current_statement__ = 109; - first = std::vector(M, std::numeric_limits::min()); current_statement__ = 110; validate_non_negative_index("last", "M", M); current_statement__ = 111; - last = std::vector(M, std::numeric_limits::min()); current_statement__ = 113; if (lcm_sym316__) { int inline_sym41__; int inline_sym43__; - inline_sym43__ = std::numeric_limits::min(); + inline_sym43__ = std::numeric_limits::min(); inline_sym43__ = 0; for (int inline_sym44__ = 1; inline_sym44__ <= 1; ++inline_sym44__) { @@ -20310,19 +20817,21 @@ class inlining_fail2_model final : public model_base_crtp inline_sym43__ = 1; inline_sym41__ = inline_sym42__; break; - } } + } + } if (inline_sym43__) { break; } inline_sym43__ = 1; inline_sym41__ = 0; - break;} + break; + } assign(first, inline_sym41__, "assigning variable first", index_uni(1)); for (int i = 2; i <= M; ++i) { int inline_sym41__; int inline_sym43__; - inline_sym43__ = std::numeric_limits::min(); + inline_sym43__ = std::numeric_limits::min(); inline_sym43__ = 0; for (int inline_sym44__ = 1; inline_sym44__ <= 1; ++inline_sym44__) { @@ -20334,21 +20843,24 @@ class inlining_fail2_model final : public model_base_crtp inline_sym43__ = 1; inline_sym41__ = inline_sym42__; break; - } } + } + } if (inline_sym43__) { break; } inline_sym43__ = 1; inline_sym41__ = 0; - break;} + break; + } assign(first, inline_sym41__, - "assigning variable first", index_uni(i));} + "assigning variable first", index_uni(i)); + } } current_statement__ = 120; if (lcm_sym316__) { int inline_sym45__; int inline_sym48__; - inline_sym48__ = std::numeric_limits::min(); + inline_sym48__ = std::numeric_limits::min(); inline_sym48__ = 0; for (int inline_sym49__ = 1; inline_sym49__ <= 1; ++inline_sym49__) { @@ -20357,7 +20869,7 @@ class inlining_fail2_model final : public model_base_crtp for (int inline_sym47__ = 0; inline_sym47__ <= lcm_sym322__; ++inline_sym47__) { int inline_sym46__; - inline_sym46__ = std::numeric_limits::min(); + inline_sym46__ = std::numeric_limits::min(); lcm_sym321__ = (lcm_sym325__ - inline_sym47__); inline_sym46__ = lcm_sym321__; @@ -20366,18 +20878,20 @@ class inlining_fail2_model final : public model_base_crtp inline_sym48__ = 1; inline_sym45__ = lcm_sym321__; break; - } } + } + } if (inline_sym48__) { break; } inline_sym48__ = 1; inline_sym45__ = 0; - break;} + break; + } assign(last, inline_sym45__, "assigning variable last", index_uni(1)); for (int i = 2; i <= M; ++i) { int inline_sym45__; int inline_sym48__; - inline_sym48__ = std::numeric_limits::min(); + inline_sym48__ = std::numeric_limits::min(); inline_sym48__ = 0; for (int inline_sym49__ = 1; inline_sym49__ <= 1; ++inline_sym49__) { @@ -20386,7 +20900,7 @@ class inlining_fail2_model final : public model_base_crtp for (int inline_sym47__ = 0; inline_sym47__ <= lcm_sym320__; ++inline_sym47__) { int inline_sym46__; - inline_sym46__ = std::numeric_limits::min(); + inline_sym46__ = std::numeric_limits::min(); lcm_sym319__ = (lcm_sym324__ - inline_sym47__); inline_sym46__ = lcm_sym319__; @@ -20395,15 +20909,18 @@ class inlining_fail2_model final : public model_base_crtp inline_sym48__ = 1; inline_sym45__ = lcm_sym319__; break; - } } + } + } if (inline_sym48__) { break; } inline_sym48__ = 1; inline_sym45__ = 0; - break;} + break; + } assign(last, inline_sym45__, - "assigning variable last", index_uni(i));} + "assigning variable last", index_uni(i)); + } } current_statement__ = 109; if (lcm_sym316__) { @@ -20415,7 +20932,8 @@ class inlining_fail2_model final : public model_base_crtp current_statement__ = 109; current_statement__ = 109; check_greater_or_equal(function__, "first[sym1__]", - first[(sym1__ - 1)], 0);} + first[(sym1__ - 1)], 0); + } } current_statement__ = 109; if (lcm_sym316__) { @@ -20427,7 +20945,8 @@ class inlining_fail2_model final : public model_base_crtp current_statement__ = 109; current_statement__ = 109; check_less_or_equal(function__, "first[sym1__]", - first[(sym1__ - 1)], n_occasions);} + first[(sym1__ - 1)], n_occasions); + } } current_statement__ = 111; if (lcm_sym316__) { @@ -20439,7 +20958,8 @@ class inlining_fail2_model final : public model_base_crtp current_statement__ = 111; current_statement__ = 111; check_greater_or_equal(function__, "last[sym1__]", - last[(sym1__ - 1)], 0);} + last[(sym1__ - 1)], 0); + } } current_statement__ = 111; if (lcm_sym316__) { @@ -20451,12 +20971,12 @@ class inlining_fail2_model final : public model_base_crtp current_statement__ = 111; current_statement__ = 111; check_less_or_equal(function__, "last[sym1__]", last[(sym1__ - 1)], - n_occasions);} + n_occasions); + } } current_statement__ = 121; validate_non_negative_index("gamma", "n_occasions", n_occasions); current_statement__ = 122; - epsilon_1dim__ = std::numeric_limits::min(); lcm_sym318__ = (n_occasions - 1); epsilon_1dim__ = lcm_sym318__; @@ -20465,7 +20985,6 @@ class inlining_fail2_model final : public model_base_crtp current_statement__ = 123; validate_non_negative_index("phi", "M", M); current_statement__ = 124; - phi_2dim__ = std::numeric_limits::min(); current_statement__ = 124; phi_2dim__ = lcm_sym318__; @@ -20494,19 +21013,8 @@ class inlining_fail2_model final : public model_base_crtp // Next line prevents compiler griping about no return throw std::runtime_error("*** IF YOU SEE THIS, PLEASE REPORT A BUG ***"); } - num_params_r__ = 0U; + num_params_r__ = 1 + 1 + n_occasions + epsilon_1dim__ + 1; - try { - num_params_r__ += 1; - num_params_r__ += 1; - num_params_r__ += n_occasions; - num_params_r__ += epsilon_1dim__; - num_params_r__ += 1; - } catch (const std::exception& e) { - stan::lang::rethrow_located(e, locations_array__[current_statement__]); - // Next line prevents compiler griping about no return - throw std::runtime_error("*** IF YOU SEE THIS, PLEASE REPORT A BUG ***"); - } } template int lcm_sym237__; int lcm_sym236__; local_scalar_t__ mean_phi; - mean_phi = DUMMY_VAR__; + mean_phi = DUMMY_VAR__; current_statement__ = 1; mean_phi = in__.template read_constrain_lub( 0, 1, lp__); local_scalar_t__ mean_p; - mean_p = DUMMY_VAR__; + mean_p = DUMMY_VAR__; current_statement__ = 2; mean_p = in__.template read_constrain_lub( 0, 1, lp__); Eigen::Matrix gamma; gamma = Eigen::Matrix(n_occasions); - stan::math::fill(gamma, DUMMY_VAR__); + stan::math::fill(gamma, DUMMY_VAR__); current_statement__ = 3; gamma = in__.template read_constrain_lub, jacobian__>( 0, 1, lp__, n_occasions); Eigen::Matrix epsilon; epsilon = Eigen::Matrix((n_occasions - 1)); - stan::math::fill(epsilon, DUMMY_VAR__); + stan::math::fill(epsilon, DUMMY_VAR__); lcm_sym297__ = (n_occasions - 1); epsilon = in__.template read>( lcm_sym297__); local_scalar_t__ sigma; - sigma = DUMMY_VAR__; + sigma = DUMMY_VAR__; current_statement__ = 5; sigma = in__.template read_constrain_lub( 0, 5, lp__); Eigen::Matrix phi; phi = Eigen::Matrix(M, lcm_sym297__); - stan::math::fill(phi, DUMMY_VAR__); + stan::math::fill(phi, DUMMY_VAR__); Eigen::Matrix p; p = Eigen::Matrix(M, n_occasions); - stan::math::fill(p, DUMMY_VAR__); + stan::math::fill(p, DUMMY_VAR__); Eigen::Matrix chi; chi = Eigen::Matrix(M, n_occasions); - stan::math::fill(chi, DUMMY_VAR__); + stan::math::fill(chi, DUMMY_VAR__); lcm_sym240__ = logical_gte(lcm_sym297__, 1); if (lcm_sym240__) { @@ -20663,7 +21171,8 @@ class inlining_fail2_model final : public model_base_crtp for (int i = 2; i <= M; ++i) { current_statement__ = 9; assign(phi, lcm_sym292__, - "assigning variable phi", index_uni(i), index_uni(1));} + "assigning variable phi", index_uni(i), index_uni(1)); + } } for (int t = 2; t <= lcm_sym297__; ++t) { current_statement__ = 10; @@ -20676,8 +21185,10 @@ class inlining_fail2_model final : public model_base_crtp for (int i = 2; i <= M; ++i) { current_statement__ = 9; assign(phi, lcm_sym291__, - "assigning variable phi", index_uni(i), index_uni(t));} - } } + "assigning variable phi", index_uni(i), index_uni(t)); + } + } + } } } else { lcm_sym238__ = logical_gte(M, 1); @@ -20687,16 +21198,16 @@ class inlining_fail2_model final : public model_base_crtp assign(p, lcm_sym295__, "assigning variable p"); Eigen::Matrix inline_sym22__; int inline_sym30__; - inline_sym30__ = std::numeric_limits::min(); + inline_sym30__ = std::numeric_limits::min(); inline_sym30__ = 0; for (int inline_sym31__ = 1; inline_sym31__ <= 1; ++inline_sym31__) { int inline_sym23__; - inline_sym23__ = std::numeric_limits::min(); + inline_sym23__ = std::numeric_limits::min(); lcm_sym296__ = rows(lcm_sym295__); int inline_sym24__; - inline_sym24__ = std::numeric_limits::min(); + inline_sym24__ = std::numeric_limits::min(); lcm_sym288__ = cols(lcm_sym295__); current_statement__ = 14; @@ -20705,7 +21216,7 @@ class inlining_fail2_model final : public model_base_crtp validate_non_negative_index("chi", "n_occasions", lcm_sym288__); Eigen::Matrix inline_sym25__; inline_sym25__ = Eigen::Matrix(lcm_sym296__, lcm_sym288__); - stan::math::fill(inline_sym25__, DUMMY_VAR__); + stan::math::fill(inline_sym25__, DUMMY_VAR__); for (int inline_sym29__ = 1; inline_sym29__ <= lcm_sym296__; ++inline_sym29__) { @@ -20716,10 +21227,10 @@ class inlining_fail2_model final : public model_base_crtp lcm_sym253__ = (lcm_sym288__ - 1); if (logical_gte(lcm_sym253__, 1)) { int inline_sym26__; - inline_sym26__ = std::numeric_limits::min(); + inline_sym26__ = std::numeric_limits::min(); int inline_sym27__; - inline_sym27__ = std::numeric_limits::min(); + inline_sym27__ = std::numeric_limits::min(); lcm_sym257__ = (lcm_sym253__ + 1); current_statement__ = 20; @@ -20740,11 +21251,11 @@ class inlining_fail2_model final : public model_base_crtp for (int inline_sym28__ = 2; inline_sym28__ <= lcm_sym253__; ++inline_sym28__) { int inline_sym26__; - inline_sym26__ = std::numeric_limits::min(); + inline_sym26__ = std::numeric_limits::min(); lcm_sym252__ = (lcm_sym288__ - inline_sym28__); int inline_sym27__; - inline_sym27__ = std::numeric_limits::min(); + inline_sym27__ = std::numeric_limits::min(); lcm_sym256__ = (lcm_sym252__ + 1); current_statement__ = 20; @@ -20766,14 +21277,16 @@ class inlining_fail2_model final : public model_base_crtp } if (inline_sym30__) { break; - } } + } + } if (inline_sym30__) { break; } inline_sym30__ = 1; assign(inline_sym22__, inline_sym25__, "assigning variable inline_sym22__"); - break;} + break; + } assign(chi, inline_sym22__, "assigning variable chi"); current_statement__ = 6; if (lcm_sym238__) { @@ -20789,7 +21302,8 @@ class inlining_fail2_model final : public model_base_crtp current_statement__ = 6; check_greater_or_equal(function__, "phi[sym1__, sym2__]", rvalue(phi, "phi", - index_uni(1), index_uni(sym2__)), 0);} + index_uni(1), index_uni(sym2__)), 0); + } } for (int sym1__ = 2; sym1__ <= M; ++sym1__) { current_statement__ = 6; @@ -20805,8 +21319,10 @@ class inlining_fail2_model final : public model_base_crtp check_greater_or_equal(function__, "phi[sym1__, sym2__]", rvalue(phi, "phi", index_uni(sym1__), index_uni(sym2__)), - 0);} - } } + 0); + } + } + } } current_statement__ = 6; if (lcm_sym238__) { @@ -20822,7 +21338,8 @@ class inlining_fail2_model final : public model_base_crtp current_statement__ = 6; check_less_or_equal(function__, "phi[sym1__, sym2__]", rvalue(phi, "phi", - index_uni(1), index_uni(sym2__)), 1);} + index_uni(1), index_uni(sym2__)), 1); + } } for (int sym1__ = 2; sym1__ <= M; ++sym1__) { current_statement__ = 6; @@ -20839,7 +21356,8 @@ class inlining_fail2_model final : public model_base_crtp rvalue(phi, "phi", index_uni(sym1__), index_uni(sym2__)), 1); } - } } + } + } } current_statement__ = 7; if (lcm_sym238__) { @@ -20855,7 +21373,8 @@ class inlining_fail2_model final : public model_base_crtp current_statement__ = 7; check_greater_or_equal(function__, "p[sym1__, sym2__]", rvalue(lcm_sym295__, "lcm_sym295__", - index_uni(1), index_uni(sym2__)), 0);} + index_uni(1), index_uni(sym2__)), 0); + } } for (int sym1__ = 2; sym1__ <= M; ++sym1__) { current_statement__ = 7; @@ -20871,8 +21390,10 @@ class inlining_fail2_model final : public model_base_crtp check_greater_or_equal(function__, "p[sym1__, sym2__]", rvalue(lcm_sym295__, "lcm_sym295__", index_uni(sym1__), index_uni(sym2__)), - 0);} - } } + 0); + } + } + } } current_statement__ = 7; if (lcm_sym238__) { @@ -20888,7 +21409,8 @@ class inlining_fail2_model final : public model_base_crtp current_statement__ = 7; check_less_or_equal(function__, "p[sym1__, sym2__]", rvalue(lcm_sym295__, "lcm_sym295__", - index_uni(1), index_uni(sym2__)), 1);} + index_uni(1), index_uni(sym2__)), 1); + } } for (int sym1__ = 2; sym1__ <= M; ++sym1__) { current_statement__ = 7; @@ -20905,7 +21427,8 @@ class inlining_fail2_model final : public model_base_crtp rvalue(lcm_sym295__, "lcm_sym295__", index_uni(sym1__), index_uni(sym2__)), 1); } - } } + } + } } current_statement__ = 8; if (lcm_sym238__) { @@ -20921,7 +21444,8 @@ class inlining_fail2_model final : public model_base_crtp current_statement__ = 8; check_greater_or_equal(function__, "chi[sym1__, sym2__]", rvalue(inline_sym22__, "inline_sym22__", - index_uni(1), index_uni(sym2__)), 0);} + index_uni(1), index_uni(sym2__)), 0); + } } for (int sym1__ = 2; sym1__ <= M; ++sym1__) { current_statement__ = 8; @@ -20937,8 +21461,10 @@ class inlining_fail2_model final : public model_base_crtp check_greater_or_equal(function__, "chi[sym1__, sym2__]", rvalue(inline_sym22__, "inline_sym22__", index_uni(sym1__), index_uni(sym2__)), - 0);} - } } + 0); + } + } + } } current_statement__ = 8; if (lcm_sym238__) { @@ -20954,7 +21480,8 @@ class inlining_fail2_model final : public model_base_crtp current_statement__ = 8; check_less_or_equal(function__, "chi[sym1__, sym2__]", rvalue(inline_sym22__, "inline_sym22__", - index_uni(1), index_uni(sym2__)), 1);} + index_uni(1), index_uni(sym2__)), 1); + } } for (int sym1__ = 2; sym1__ <= M; ++sym1__) { current_statement__ = 8; @@ -20971,28 +21498,29 @@ class inlining_fail2_model final : public model_base_crtp rvalue(inline_sym22__, "inline_sym22__", index_uni(sym1__), index_uni(sym2__)), 1); } - } } + } + } } { current_statement__ = 75; lp_accum__.add(normal_lpdf(epsilon, 0, sigma)); int inline_sym39__; - inline_sym39__ = std::numeric_limits::min(); + inline_sym39__ = std::numeric_limits::min(); { int inline_sym32__; - inline_sym32__ = std::numeric_limits::min(); + inline_sym32__ = std::numeric_limits::min(); lcm_sym310__ = rvalue(dims(y), "dims(y)", index_uni(1)); int inline_sym33__; - inline_sym33__ = std::numeric_limits::min(); + inline_sym33__ = std::numeric_limits::min(); lcm_sym311__ = rvalue(dims(y), "dims(y)", index_uni(2)); current_statement__ = 78; validate_non_negative_index("qgamma", "n_occasions", lcm_sym311__); Eigen::Matrix inline_sym34__; inline_sym34__ = Eigen::Matrix(lcm_sym311__); - stan::math::fill(inline_sym34__, std::numeric_limits::quiet_NaN()); + stan::math::fill(inline_sym34__, std::numeric_limits::quiet_NaN()); assign(lcm_sym249__, subtract(1.0, gamma), "assigning variable lcm_sym249__"); @@ -21002,7 +21530,7 @@ class inlining_fail2_model final : public model_base_crtp validate_non_negative_index("qp", "n_occasions", lcm_sym311__); Eigen::Matrix inline_sym35__; inline_sym35__ = Eigen::Matrix(lcm_sym311__); - stan::math::fill(inline_sym35__, std::numeric_limits::quiet_NaN()); + stan::math::fill(inline_sym35__, std::numeric_limits::quiet_NaN()); assign(lcm_sym251__, subtract(1.0, @@ -21023,7 +21551,7 @@ class inlining_fail2_model final : public model_base_crtp validate_non_negative_index("lp", "first[i]", lcm_sym299__); Eigen::Matrix inline_sym36__; inline_sym36__ = Eigen::Matrix(lcm_sym299__); - stan::math::fill(inline_sym36__, DUMMY_VAR__); + stan::math::fill(inline_sym36__, DUMMY_VAR__); lcm_sym255__ = (lcm_sym299__ - 1); assign(inline_sym36__, @@ -21130,7 +21658,8 @@ class inlining_fail2_model final : public model_base_crtp bernoulli_lpmf( rvalue(y, "y", index_uni(1), index_uni(inline_sym37__)), rvalue(lcm_sym295__, "lcm_sym295__", - index_uni(1), index_uni(inline_sym37__))));} + index_uni(1), index_uni(inline_sym37__)))); + } } current_statement__ = 100; lp_accum__.add( @@ -21143,7 +21672,7 @@ class inlining_fail2_model final : public model_base_crtp lcm_sym274__); Eigen::Matrix inline_sym36__; inline_sym36__ = Eigen::Matrix(lcm_sym274__); - stan::math::fill(inline_sym36__, DUMMY_VAR__); + stan::math::fill(inline_sym36__, DUMMY_VAR__); current_statement__ = 83; assign(inline_sym36__, @@ -21204,7 +21733,7 @@ class inlining_fail2_model final : public model_base_crtp validate_non_negative_index("qp", "n_occasions", lcm_sym311__); Eigen::Matrix inline_sym35__; inline_sym35__ = Eigen::Matrix(lcm_sym311__); - stan::math::fill(inline_sym35__, std::numeric_limits::quiet_NaN()); + stan::math::fill(inline_sym35__, std::numeric_limits::quiet_NaN()); assign(lcm_sym250__, subtract(1.0, @@ -21227,7 +21756,7 @@ class inlining_fail2_model final : public model_base_crtp validate_non_negative_index("lp", "first[i]", lcm_sym298__); Eigen::Matrix inline_sym36__; inline_sym36__ = Eigen::Matrix(lcm_sym298__); - stan::math::fill(inline_sym36__, DUMMY_VAR__); + stan::math::fill(inline_sym36__, DUMMY_VAR__); lcm_sym254__ = (lcm_sym298__ - 1); assign(inline_sym36__, @@ -21342,7 +21871,8 @@ class inlining_fail2_model final : public model_base_crtp y[(inline_sym38__ - 1)][(inline_sym37__ - 1)], rvalue(lcm_sym295__, "lcm_sym295__", index_uni(inline_sym38__), - index_uni(inline_sym37__))));} + index_uni(inline_sym37__)))); + } } current_statement__ = 100; lp_accum__.add( @@ -21355,7 +21885,7 @@ class inlining_fail2_model final : public model_base_crtp lcm_sym274__); Eigen::Matrix inline_sym36__; inline_sym36__ = Eigen::Matrix(lcm_sym274__); - stan::math::fill(inline_sym36__, DUMMY_VAR__); + stan::math::fill(inline_sym36__, DUMMY_VAR__); current_statement__ = 83; assign(inline_sym36__, @@ -21411,7 +21941,8 @@ class inlining_fail2_model final : public model_base_crtp "assigning variable inline_sym36__", index_uni(lcm_sym274__)); current_statement__ = 86; lp_accum__.add(log_sum_exp(inline_sym36__)); - }} + } + } } } } @@ -21535,48 +22066,48 @@ class inlining_fail2_model final : public model_base_crtp int lcm_sym144__; Eigen::Matrix lcm_sym143__; double mean_phi; - mean_phi = std::numeric_limits::quiet_NaN(); + mean_phi = std::numeric_limits::quiet_NaN(); current_statement__ = 1; mean_phi = in__.template read_constrain_lub( 0, 1, lp__); double mean_p; - mean_p = std::numeric_limits::quiet_NaN(); + mean_p = std::numeric_limits::quiet_NaN(); current_statement__ = 2; mean_p = in__.template read_constrain_lub( 0, 1, lp__); Eigen::Matrix gamma; gamma = Eigen::Matrix(n_occasions); - stan::math::fill(gamma, std::numeric_limits::quiet_NaN()); + stan::math::fill(gamma, std::numeric_limits::quiet_NaN()); current_statement__ = 3; gamma = in__.template read_constrain_lub, jacobian__>( 0, 1, lp__, n_occasions); Eigen::Matrix epsilon; epsilon = Eigen::Matrix((n_occasions - 1)); - stan::math::fill(epsilon, std::numeric_limits::quiet_NaN()); + stan::math::fill(epsilon, std::numeric_limits::quiet_NaN()); lcm_sym198__ = (n_occasions - 1); epsilon = in__.template read>( lcm_sym198__); double sigma; - sigma = std::numeric_limits::quiet_NaN(); + sigma = std::numeric_limits::quiet_NaN(); current_statement__ = 5; sigma = in__.template read_constrain_lub( 0, 5, lp__); Eigen::Matrix phi; phi = Eigen::Matrix(M, lcm_sym198__); - stan::math::fill(phi, DUMMY_VAR__); + stan::math::fill(phi, DUMMY_VAR__); Eigen::Matrix p; p = Eigen::Matrix(M, n_occasions); - stan::math::fill(p, std::numeric_limits::quiet_NaN()); + stan::math::fill(p, std::numeric_limits::quiet_NaN()); Eigen::Matrix chi; chi = Eigen::Matrix(M, n_occasions); - stan::math::fill(chi, DUMMY_VAR__); + stan::math::fill(chi, DUMMY_VAR__); vars__.emplace_back(mean_phi); vars__.emplace_back(mean_p); @@ -21584,13 +22115,15 @@ class inlining_fail2_model final : public model_base_crtp if (lcm_sym145__) { vars__.emplace_back(rvalue(gamma, "gamma", index_uni(1))); for (int sym1__ = 2; sym1__ <= n_occasions; ++sym1__) { - vars__.emplace_back(gamma[(sym1__ - 1)]);} + vars__.emplace_back(gamma[(sym1__ - 1)]); + } } lcm_sym147__ = logical_gte(lcm_sym198__, 1); if (lcm_sym147__) { vars__.emplace_back(rvalue(epsilon, "epsilon", index_uni(1))); for (int sym1__ = 2; sym1__ <= lcm_sym198__; ++sym1__) { - vars__.emplace_back(epsilon[(sym1__ - 1)]);} + vars__.emplace_back(epsilon[(sym1__ - 1)]); + } } vars__.emplace_back(sigma); if (logical_negation((primitive_value(emit_transformed_parameters__) || @@ -21610,7 +22143,8 @@ class inlining_fail2_model final : public model_base_crtp for (int i = 2; i <= M; ++i) { current_statement__ = 9; assign(phi, lcm_sym182__, - "assigning variable phi", index_uni(i), index_uni(1));} + "assigning variable phi", index_uni(i), index_uni(1)); + } } for (int t = 2; t <= lcm_sym198__; ++t) { current_statement__ = 10; @@ -21623,8 +22157,10 @@ class inlining_fail2_model final : public model_base_crtp for (int i = 2; i <= M; ++i) { current_statement__ = 9; assign(phi, lcm_sym181__, - "assigning variable phi", index_uni(i), index_uni(t));} - } } + "assigning variable phi", index_uni(i), index_uni(t)); + } + } + } } } else { lcm_sym144__ = logical_gte(M, 1); @@ -21634,16 +22170,16 @@ class inlining_fail2_model final : public model_base_crtp assign(p, lcm_sym184__, "assigning variable p"); Eigen::Matrix inline_sym1__; int inline_sym9__; - inline_sym9__ = std::numeric_limits::min(); + inline_sym9__ = std::numeric_limits::min(); inline_sym9__ = 0; for (int inline_sym10__ = 1; inline_sym10__ <= 1; ++inline_sym10__) { int inline_sym2__; - inline_sym2__ = std::numeric_limits::min(); + inline_sym2__ = std::numeric_limits::min(); lcm_sym186__ = rows(lcm_sym184__); int inline_sym3__; - inline_sym3__ = std::numeric_limits::min(); + inline_sym3__ = std::numeric_limits::min(); lcm_sym173__ = cols(lcm_sym184__); current_statement__ = 14; @@ -21652,7 +22188,7 @@ class inlining_fail2_model final : public model_base_crtp validate_non_negative_index("chi", "n_occasions", lcm_sym173__); Eigen::Matrix inline_sym4__; inline_sym4__ = Eigen::Matrix(lcm_sym186__, lcm_sym173__); - stan::math::fill(inline_sym4__, DUMMY_VAR__); + stan::math::fill(inline_sym4__, DUMMY_VAR__); for (int inline_sym8__ = 1; inline_sym8__ <= lcm_sym186__; ++inline_sym8__) { @@ -21663,10 +22199,10 @@ class inlining_fail2_model final : public model_base_crtp lcm_sym155__ = (lcm_sym173__ - 1); if (logical_gte(lcm_sym155__, 1)) { int inline_sym5__; - inline_sym5__ = std::numeric_limits::min(); + inline_sym5__ = std::numeric_limits::min(); int inline_sym6__; - inline_sym6__ = std::numeric_limits::min(); + inline_sym6__ = std::numeric_limits::min(); lcm_sym161__ = (lcm_sym155__ + 1); current_statement__ = 20; @@ -21687,11 +22223,11 @@ class inlining_fail2_model final : public model_base_crtp for (int inline_sym7__ = 2; inline_sym7__ <= lcm_sym155__; ++inline_sym7__) { int inline_sym5__; - inline_sym5__ = std::numeric_limits::min(); + inline_sym5__ = std::numeric_limits::min(); lcm_sym154__ = (lcm_sym173__ - inline_sym7__); int inline_sym6__; - inline_sym6__ = std::numeric_limits::min(); + inline_sym6__ = std::numeric_limits::min(); lcm_sym160__ = (lcm_sym154__ + 1); current_statement__ = 20; @@ -21713,14 +22249,16 @@ class inlining_fail2_model final : public model_base_crtp } if (inline_sym9__) { break; - } } + } + } if (inline_sym9__) { break; } inline_sym9__ = 1; assign(inline_sym1__, inline_sym4__, "assigning variable inline_sym1__"); - break;} + break; + } assign(chi, inline_sym1__, "assigning variable chi"); current_statement__ = 6; if (lcm_sym144__) { @@ -21736,7 +22274,8 @@ class inlining_fail2_model final : public model_base_crtp current_statement__ = 6; check_greater_or_equal(function__, "phi[sym1__, sym2__]", rvalue(phi, "phi", - index_uni(1), index_uni(sym2__)), 0);} + index_uni(1), index_uni(sym2__)), 0); + } } for (int sym1__ = 2; sym1__ <= M; ++sym1__) { current_statement__ = 6; @@ -21752,8 +22291,10 @@ class inlining_fail2_model final : public model_base_crtp check_greater_or_equal(function__, "phi[sym1__, sym2__]", rvalue(phi, "phi", index_uni(sym1__), index_uni(sym2__)), - 0);} - } } + 0); + } + } + } } current_statement__ = 6; if (lcm_sym144__) { @@ -21769,7 +22310,8 @@ class inlining_fail2_model final : public model_base_crtp current_statement__ = 6; check_less_or_equal(function__, "phi[sym1__, sym2__]", rvalue(phi, "phi", - index_uni(1), index_uni(sym2__)), 1);} + index_uni(1), index_uni(sym2__)), 1); + } } for (int sym1__ = 2; sym1__ <= M; ++sym1__) { current_statement__ = 6; @@ -21786,7 +22328,8 @@ class inlining_fail2_model final : public model_base_crtp rvalue(phi, "phi", index_uni(sym1__), index_uni(sym2__)), 1); } - } } + } + } } current_statement__ = 7; if (lcm_sym144__) { @@ -21802,7 +22345,8 @@ class inlining_fail2_model final : public model_base_crtp current_statement__ = 7; check_greater_or_equal(function__, "p[sym1__, sym2__]", rvalue(lcm_sym184__, "lcm_sym184__", - index_uni(1), index_uni(sym2__)), 0);} + index_uni(1), index_uni(sym2__)), 0); + } } for (int sym1__ = 2; sym1__ <= M; ++sym1__) { current_statement__ = 7; @@ -21818,8 +22362,10 @@ class inlining_fail2_model final : public model_base_crtp check_greater_or_equal(function__, "p[sym1__, sym2__]", rvalue(lcm_sym184__, "lcm_sym184__", index_uni(sym1__), index_uni(sym2__)), - 0);} - } } + 0); + } + } + } } current_statement__ = 7; if (lcm_sym144__) { @@ -21835,7 +22381,8 @@ class inlining_fail2_model final : public model_base_crtp current_statement__ = 7; check_less_or_equal(function__, "p[sym1__, sym2__]", rvalue(lcm_sym184__, "lcm_sym184__", - index_uni(1), index_uni(sym2__)), 1);} + index_uni(1), index_uni(sym2__)), 1); + } } for (int sym1__ = 2; sym1__ <= M; ++sym1__) { current_statement__ = 7; @@ -21852,7 +22399,8 @@ class inlining_fail2_model final : public model_base_crtp rvalue(lcm_sym184__, "lcm_sym184__", index_uni(sym1__), index_uni(sym2__)), 1); } - } } + } + } } current_statement__ = 8; if (lcm_sym144__) { @@ -21868,7 +22416,8 @@ class inlining_fail2_model final : public model_base_crtp current_statement__ = 8; check_greater_or_equal(function__, "chi[sym1__, sym2__]", rvalue(inline_sym1__, "inline_sym1__", - index_uni(1), index_uni(sym2__)), 0);} + index_uni(1), index_uni(sym2__)), 0); + } } for (int sym1__ = 2; sym1__ <= M; ++sym1__) { current_statement__ = 8; @@ -21884,8 +22433,10 @@ class inlining_fail2_model final : public model_base_crtp check_greater_or_equal(function__, "chi[sym1__, sym2__]", rvalue(inline_sym1__, "inline_sym1__", index_uni(sym1__), index_uni(sym2__)), - 0);} - } } + 0); + } + } + } } current_statement__ = 8; if (lcm_sym144__) { @@ -21901,7 +22452,8 @@ class inlining_fail2_model final : public model_base_crtp current_statement__ = 8; check_less_or_equal(function__, "chi[sym1__, sym2__]", rvalue(inline_sym1__, "inline_sym1__", - index_uni(1), index_uni(sym2__)), 1);} + index_uni(1), index_uni(sym2__)), 1); + } } for (int sym1__ = 2; sym1__ <= M; ++sym1__) { current_statement__ = 8; @@ -21918,7 +22470,8 @@ class inlining_fail2_model final : public model_base_crtp rvalue(inline_sym1__, "inline_sym1__", index_uni(sym1__), index_uni(sym2__)), 1); } - } } + } + } } if (emit_transformed_parameters__) { if (lcm_sym147__) { @@ -21927,7 +22480,8 @@ class inlining_fail2_model final : public model_base_crtp rvalue(phi, "phi", index_uni(1), index_uni(1))); for (int sym2__ = 2; sym2__ <= M; ++sym2__) { vars__.emplace_back( - rvalue(phi, "phi", index_uni(sym2__), index_uni(1)));} + rvalue(phi, "phi", index_uni(sym2__), index_uni(1))); + } } for (int sym1__ = 2; sym1__ <= lcm_sym198__; ++sym1__) { if (lcm_sym144__) { @@ -21935,8 +22489,10 @@ class inlining_fail2_model final : public model_base_crtp rvalue(phi, "phi", index_uni(1), index_uni(sym1__))); for (int sym2__ = 2; sym2__ <= M; ++sym2__) { vars__.emplace_back( - rvalue(phi, "phi", index_uni(sym2__), index_uni(sym1__)));} - } } + rvalue(phi, "phi", index_uni(sym2__), index_uni(sym1__))); + } + } + } } if (lcm_sym145__) { if (lcm_sym144__) { @@ -21946,7 +22502,8 @@ class inlining_fail2_model final : public model_base_crtp for (int sym2__ = 2; sym2__ <= M; ++sym2__) { vars__.emplace_back( rvalue(lcm_sym184__, "lcm_sym184__", - index_uni(sym2__), index_uni(1)));} + index_uni(sym2__), index_uni(1))); + } } for (int sym1__ = 2; sym1__ <= n_occasions; ++sym1__) { if (lcm_sym144__) { @@ -21956,8 +22513,10 @@ class inlining_fail2_model final : public model_base_crtp for (int sym2__ = 2; sym2__ <= M; ++sym2__) { vars__.emplace_back( rvalue(lcm_sym184__, "lcm_sym184__", - index_uni(sym2__), index_uni(sym1__)));} - } } + index_uni(sym2__), index_uni(sym1__))); + } + } + } } if (lcm_sym145__) { if (lcm_sym144__) { @@ -21967,7 +22526,8 @@ class inlining_fail2_model final : public model_base_crtp for (int sym2__ = 2; sym2__ <= M; ++sym2__) { vars__.emplace_back( rvalue(inline_sym1__, "inline_sym1__", - index_uni(sym2__), index_uni(1)));} + index_uni(sym2__), index_uni(1))); + } } for (int sym1__ = 2; sym1__ <= n_occasions; ++sym1__) { if (lcm_sym144__) { @@ -21977,42 +22537,45 @@ class inlining_fail2_model final : public model_base_crtp for (int sym2__ = 2; sym2__ <= M; ++sym2__) { vars__.emplace_back( rvalue(inline_sym1__, "inline_sym1__", - index_uni(sym2__), index_uni(sym1__)));} - } } + index_uni(sym2__), index_uni(sym1__))); + } + } + } } } if (logical_negation(emit_generated_quantities__)) { return ; } double sigma2; - sigma2 = std::numeric_limits::quiet_NaN(); + sigma2 = std::numeric_limits::quiet_NaN(); local_scalar_t__ psi; - psi = DUMMY_VAR__; + psi = DUMMY_VAR__; Eigen::Matrix b; b = Eigen::Matrix(n_occasions); - stan::math::fill(b, DUMMY_VAR__); + stan::math::fill(b, DUMMY_VAR__); int Nsuper; - Nsuper = std::numeric_limits::min(); + Nsuper = std::numeric_limits::min(); std::vector N; - N = std::vector(n_occasions, std::numeric_limits::min()); + N = std::vector(n_occasions, std::numeric_limits::min()); std::vector B; - B = std::vector(n_occasions, std::numeric_limits::min()); + B = std::vector(n_occasions, std::numeric_limits::min()); std::vector> z; z = std::vector>(M, std::vector(n_occasions, std::numeric_limits::min())); + current_statement__ = 39; if (lcm_sym144__) { int q; - q = std::numeric_limits::min(); + q = std::numeric_limits::min(); double mu2; - mu2 = std::numeric_limits::quiet_NaN(); + mu2 = std::numeric_limits::quiet_NaN(); lcm_sym206__ = rvalue(gamma, "gamma", index_uni(1)); assign(z, bernoulli_rng(lcm_sym206__, base_rng__), @@ -22039,14 +22602,15 @@ class inlining_fail2_model final : public model_base_crtp (rvalue(gamma, "gamma", index_uni(t)) * q)); current_statement__ = 33; assign(z, bernoulli_rng(lcm_sym180__, base_rng__), - "assigning variable z", index_uni(1), index_uni(t));} + "assigning variable z", index_uni(1), index_uni(t)); + } } for (int i = 2; i <= M; ++i) { int q; - q = std::numeric_limits::min(); + q = std::numeric_limits::min(); double mu2; - mu2 = std::numeric_limits::quiet_NaN(); + mu2 = std::numeric_limits::quiet_NaN(); current_statement__ = 36; assign(z, bernoulli_rng(lcm_sym206__, base_rng__), @@ -22076,34 +22640,36 @@ class inlining_fail2_model final : public model_base_crtp (rvalue(gamma, "gamma", index_uni(t)) * q)); current_statement__ = 33; assign(z, bernoulli_rng(lcm_sym178__, base_rng__), - "assigning variable z", index_uni(i), index_uni(t));} - } } + "assigning variable z", index_uni(i), index_uni(t)); + } + } + } } { current_statement__ = 40; validate_non_negative_index("cprob", "n_occasions", n_occasions); Eigen::Matrix cprob; cprob = Eigen::Matrix(n_occasions); - stan::math::fill(cprob, std::numeric_limits::quiet_NaN()); + stan::math::fill(cprob, std::numeric_limits::quiet_NaN()); Eigen::Matrix inline_sym11__; int inline_sym16__; - inline_sym16__ = std::numeric_limits::min(); + inline_sym16__ = std::numeric_limits::min(); inline_sym16__ = 0; for (int inline_sym17__ = 1; inline_sym17__ <= 1; ++inline_sym17__) { int inline_sym12__; - inline_sym12__ = std::numeric_limits::min(); + inline_sym12__ = std::numeric_limits::min(); lcm_sym185__ = rows(gamma); current_statement__ = 43; validate_non_negative_index("log_cprob", "N", lcm_sym185__); Eigen::Matrix inline_sym13__; inline_sym13__ = Eigen::Matrix(lcm_sym185__); - stan::math::fill(inline_sym13__, DUMMY_VAR__); + stan::math::fill(inline_sym13__, DUMMY_VAR__); local_scalar_t__ inline_sym14__; - inline_sym14__ = DUMMY_VAR__; + inline_sym14__ = DUMMY_VAR__; if (logical_gte(lcm_sym185__, 1)) { current_statement__ = 46; @@ -22122,7 +22688,8 @@ class inlining_fail2_model final : public model_base_crtp "assigning variable inline_sym13__", index_uni(inline_sym15__)); current_statement__ = 47; inline_sym14__ = (inline_sym14__ + - log1m(gamma[(inline_sym15__ - 1)]));} + log1m(gamma[(inline_sym15__ - 1)])); + } } if (inline_sym16__) { break; @@ -22130,13 +22697,15 @@ class inlining_fail2_model final : public model_base_crtp inline_sym16__ = 1; assign(inline_sym11__, stan::math::exp(inline_sym13__), "assigning variable inline_sym11__"); - break;} + break; + } current_statement__ = 50; validate_non_negative_index("recruit", "M", M); current_statement__ = 51; validate_non_negative_index("recruit", "n_occasions", n_occasions); std::vector> recruit; recruit = std::vector>(M, std::vector(n_occasions, std::numeric_limits::min())); + current_statement__ = 52; assign(recruit, rep_array(0, M, n_occasions), @@ -22144,12 +22713,12 @@ class inlining_fail2_model final : public model_base_crtp current_statement__ = 53; validate_non_negative_index("Nind", "M", M); std::vector Nind; - Nind = std::vector(M, std::numeric_limits::min()); + Nind = std::vector(M, std::numeric_limits::min()); current_statement__ = 55; validate_non_negative_index("Nalive", "M", M); std::vector Nalive; - Nalive = std::vector(M, std::numeric_limits::min()); + Nalive = std::vector(M, std::numeric_limits::min()); lcm_sym189__ = square(sigma); sigma2 = lcm_sym189__; @@ -22161,11 +22730,11 @@ class inlining_fail2_model final : public model_base_crtp current_statement__ = 64; if (lcm_sym144__) { int f; - f = std::numeric_limits::min(); + f = std::numeric_limits::min(); int inline_sym18__; int inline_sym20__; - inline_sym20__ = std::numeric_limits::min(); + inline_sym20__ = std::numeric_limits::min(); inline_sym20__ = 0; for (int inline_sym21__ = 1; inline_sym21__ <= 1; ++inline_sym21__) { @@ -22177,13 +22746,15 @@ class inlining_fail2_model final : public model_base_crtp inline_sym20__ = 1; inline_sym18__ = inline_sym19__; break; - } } + } + } if (inline_sym20__) { break; } inline_sym20__ = 1; inline_sym18__ = 0; - break;} + break; + } current_statement__ = 62; if (logical_gt(inline_sym18__, 0)) { current_statement__ = 61; @@ -22193,11 +22764,11 @@ class inlining_fail2_model final : public model_base_crtp } for (int i = 2; i <= M; ++i) { int f; - f = std::numeric_limits::min(); + f = std::numeric_limits::min(); int inline_sym18__; int inline_sym20__; - inline_sym20__ = std::numeric_limits::min(); + inline_sym20__ = std::numeric_limits::min(); inline_sym20__ = 0; for (int inline_sym21__ = 1; inline_sym21__ <= 1; @@ -22210,20 +22781,23 @@ class inlining_fail2_model final : public model_base_crtp inline_sym20__ = 1; inline_sym18__ = inline_sym19__; break; - } } + } + } if (inline_sym20__) { break; } inline_sym20__ = 1; inline_sym18__ = 0; - break;} + break; + } current_statement__ = 62; if (logical_gt(inline_sym18__, 0)) { current_statement__ = 61; assign(recruit, 1, "assigning variable recruit", index_uni(i), index_uni(inline_sym18__)); - } } + } + } } current_statement__ = 68; if (lcm_sym145__) { @@ -22241,7 +22815,8 @@ class inlining_fail2_model final : public model_base_crtp current_statement__ = 66; assign(B, sum(rvalue(recruit, "recruit", index_omni(), index_uni(t))), - "assigning variable B", index_uni(t));} + "assigning variable B", index_uni(t)); + } } current_statement__ = 72; if (lcm_sym144__) { @@ -22259,7 +22834,8 @@ class inlining_fail2_model final : public model_base_crtp current_statement__ = 70; assign(Nalive, (1 - logical_negation(rvalue(Nind, "Nind", index_uni(i)))), - "assigning variable Nalive", index_uni(i));} + "assigning variable Nalive", index_uni(i)); + } } current_statement__ = 73; Nsuper = sum(Nalive); @@ -22270,33 +22846,39 @@ class inlining_fail2_model final : public model_base_crtp vars__.emplace_back( rvalue(lcm_sym143__, "lcm_sym143__", index_uni(1))); for (int sym1__ = 2; sym1__ <= n_occasions; ++sym1__) { - vars__.emplace_back(lcm_sym143__[(sym1__ - 1)]);} + vars__.emplace_back(lcm_sym143__[(sym1__ - 1)]); + } } vars__.emplace_back(Nsuper); if (lcm_sym145__) { vars__.emplace_back(rvalue(N, "N", index_uni(1))); for (int sym1__ = 2; sym1__ <= n_occasions; ++sym1__) { - vars__.emplace_back(N[(sym1__ - 1)]);} + vars__.emplace_back(N[(sym1__ - 1)]); + } } if (lcm_sym145__) { vars__.emplace_back(rvalue(B, "B", index_uni(1))); for (int sym1__ = 2; sym1__ <= n_occasions; ++sym1__) { - vars__.emplace_back(B[(sym1__ - 1)]);} + vars__.emplace_back(B[(sym1__ - 1)]); + } } if (lcm_sym145__) { if (lcm_sym144__) { vars__.emplace_back(rvalue(z, "z", index_uni(1), index_uni(1))); for (int sym2__ = 2; sym2__ <= M; ++sym2__) { vars__.emplace_back( - rvalue(z, "z", index_uni(sym2__), index_uni(1)));} + rvalue(z, "z", index_uni(sym2__), index_uni(1))); + } } for (int sym1__ = 2; sym1__ <= n_occasions; ++sym1__) { if (lcm_sym144__) { vars__.emplace_back( rvalue(z, "z", index_uni(1), index_uni(sym1__))); for (int sym2__ = 2; sym2__ <= M; ++sym2__) { - vars__.emplace_back(z[(sym2__ - 1)][(sym1__ - 1)]);} - } } + vars__.emplace_back(z[(sym2__ - 1)][(sym1__ - 1)]); + } + } + } } } catch (const std::exception& e) { stan::lang::rethrow_located(e, locations_array__[current_statement__]); @@ -22332,32 +22914,32 @@ class inlining_fail2_model final : public model_base_crtp int lcm_sym130__; int lcm_sym129__; int pos__; - pos__ = std::numeric_limits::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; double mean_phi; - mean_phi = std::numeric_limits::quiet_NaN(); + mean_phi = std::numeric_limits::quiet_NaN(); current_statement__ = 1; mean_phi = context__.vals_r("mean_phi")[(1 - 1)]; double mean_phi_free__; - mean_phi_free__ = std::numeric_limits::quiet_NaN(); + mean_phi_free__ = std::numeric_limits::quiet_NaN(); current_statement__ = 1; mean_phi_free__ = stan::math::lub_free(mean_phi, 0, 1); double mean_p; - mean_p = std::numeric_limits::quiet_NaN(); + mean_p = std::numeric_limits::quiet_NaN(); current_statement__ = 2; mean_p = context__.vals_r("mean_p")[(1 - 1)]; double mean_p_free__; - mean_p_free__ = std::numeric_limits::quiet_NaN(); + mean_p_free__ = std::numeric_limits::quiet_NaN(); current_statement__ = 2; mean_p_free__ = stan::math::lub_free(mean_p, 0, 1); Eigen::Matrix gamma; gamma = Eigen::Matrix(n_occasions); - stan::math::fill(gamma, std::numeric_limits::quiet_NaN()); + stan::math::fill(gamma, std::numeric_limits::quiet_NaN()); { std::vector gamma_flat__; @@ -22377,12 +22959,13 @@ class inlining_fail2_model final : public model_base_crtp assign(gamma, gamma_flat__[(pos__ - 1)], "assigning variable gamma", index_uni(sym1__)); current_statement__ = 3; - pos__ = (pos__ + 1);} + pos__ = (pos__ + 1); + } } } Eigen::Matrix gamma_free__; gamma_free__ = Eigen::Matrix(n_occasions); - stan::math::fill(gamma_free__, std::numeric_limits::quiet_NaN()); + stan::math::fill(gamma_free__, std::numeric_limits::quiet_NaN()); current_statement__ = 3; if (lcm_sym129__) { @@ -22394,11 +22977,12 @@ class inlining_fail2_model final : public model_base_crtp current_statement__ = 3; assign(gamma_free__, stan::math::lub_free(gamma[(sym1__ - 1)], 0, 1), - "assigning variable gamma_free__", index_uni(sym1__));} + "assigning variable gamma_free__", index_uni(sym1__)); + } } Eigen::Matrix epsilon; epsilon = Eigen::Matrix((n_occasions - 1)); - stan::math::fill(epsilon, std::numeric_limits::quiet_NaN()); + stan::math::fill(epsilon, std::numeric_limits::quiet_NaN()); { std::vector epsilon_flat__; @@ -22420,16 +23004,17 @@ class inlining_fail2_model final : public model_base_crtp assign(epsilon, epsilon_flat__[(pos__ - 1)], "assigning variable epsilon", index_uni(sym1__)); current_statement__ = 4; - pos__ = (pos__ + 1);} + pos__ = (pos__ + 1); + } } } double sigma; - sigma = std::numeric_limits::quiet_NaN(); + sigma = std::numeric_limits::quiet_NaN(); current_statement__ = 5; sigma = context__.vals_r("sigma")[(1 - 1)]; double sigma_free__; - sigma_free__ = std::numeric_limits::quiet_NaN(); + sigma_free__ = std::numeric_limits::quiet_NaN(); current_statement__ = 5; sigma_free__ = stan::math::lub_free(sigma, 0, 5); @@ -22439,12 +23024,14 @@ class inlining_fail2_model final : public model_base_crtp vars__.emplace_back( rvalue(gamma_free__, "gamma_free__", index_uni(1))); for (int sym1__ = 2; sym1__ <= n_occasions; ++sym1__) { - vars__.emplace_back(gamma_free__[(sym1__ - 1)]);} + vars__.emplace_back(gamma_free__[(sym1__ - 1)]); + } } if (lcm_sym130__) { vars__.emplace_back(rvalue(epsilon, "epsilon", index_uni(1))); for (int sym1__ = 2; sym1__ <= lcm_sym131__; ++sym1__) { - vars__.emplace_back(epsilon[(sym1__ - 1)]);} + vars__.emplace_back(epsilon[(sym1__ - 1)]); + } } vars__.emplace_back(sigma_free__); } catch (const std::exception& e) { @@ -22456,44 +23043,33 @@ class inlining_fail2_model final : public model_base_crtp inline void get_param_names(std::vector& names__) const { - names__ = std::vector{"mean_phi", - "mean_p", - "gamma", - "epsilon", - "sigma", - "phi", - "p", - "chi", - "sigma2", - "psi", - "b", - "Nsuper", - "N", - "B", - "z"}; + names__ = std::vector{"mean_phi", "mean_p", "gamma", + "epsilon", "sigma", "phi", "p", "chi", "sigma2", "psi", "b", "Nsuper", + "N", "B", "z"}; + } // get_param_names() inline void get_dims(std::vector>& dimss__) const { dimss__ = std::vector>{std::vector{}, - std::vector{}, - std::vector{static_cast(n_occasions)}, - std::vector{static_cast(epsilon_1dim__)}, - std::vector{}, - std::vector{static_cast(M), - static_cast(phi_2dim__)}, - std::vector{static_cast(M), - static_cast(n_occasions)}, - std::vector{static_cast(M), - static_cast(n_occasions)}, - std::vector{}, - std::vector{}, - std::vector{static_cast(n_occasions)}, - std::vector{}, - std::vector{static_cast(n_occasions)}, - std::vector{static_cast(n_occasions)}, - std::vector{static_cast(M), - static_cast(n_occasions)}}; + std::vector{}, + std::vector{static_cast(n_occasions)}, + std::vector{static_cast(epsilon_1dim__)}, + std::vector{}, + std::vector{static_cast(M), + static_cast(phi_2dim__)}, + std::vector{static_cast(M), + static_cast(n_occasions)}, + std::vector{static_cast(M), + static_cast(n_occasions)}, + std::vector{}, std::vector{}, + std::vector{static_cast(n_occasions)}, + std::vector{}, + std::vector{static_cast(n_occasions)}, + std::vector{static_cast(n_occasions)}, + std::vector{static_cast(M), + static_cast(n_occasions)}}; + } // get_dims() inline void constrained_param_names( @@ -22507,11 +23083,13 @@ class inlining_fail2_model final : public model_base_crtp for (int sym340__ = 1; sym340__ <= n_occasions; ++sym340__) { { param_names__.emplace_back(std::string() + "gamma" + '.' + std::to_string(sym340__)); - }} + } + } for (int sym340__ = 1; sym340__ <= epsilon_1dim__; ++sym340__) { { param_names__.emplace_back(std::string() + "epsilon" + '.' + std::to_string(sym340__)); - }} + } + } param_names__.emplace_back(std::string() + "sigma"); if (emit_transformed_parameters__) { for (int sym340__ = 1; sym340__ <= phi_2dim__; ++sym340__) { @@ -22519,22 +23097,28 @@ class inlining_fail2_model final : public model_base_crtp for (int sym341__ = 1; sym341__ <= M; ++sym341__) { { param_names__.emplace_back(std::string() + "phi" + '.' + std::to_string(sym341__) + '.' + std::to_string(sym340__)); - }} - }} + } + } + } + } for (int sym340__ = 1; sym340__ <= n_occasions; ++sym340__) { { for (int sym341__ = 1; sym341__ <= M; ++sym341__) { { param_names__.emplace_back(std::string() + "p" + '.' + std::to_string(sym341__) + '.' + std::to_string(sym340__)); - }} - }} + } + } + } + } for (int sym340__ = 1; sym340__ <= n_occasions; ++sym340__) { { for (int sym341__ = 1; sym341__ <= M; ++sym341__) { { param_names__.emplace_back(std::string() + "chi" + '.' + std::to_string(sym341__) + '.' + std::to_string(sym340__)); - }} - }} + } + } + } + } } if (emit_generated_quantities__) { @@ -22543,23 +23127,28 @@ class inlining_fail2_model final : public model_base_crtp for (int sym340__ = 1; sym340__ <= n_occasions; ++sym340__) { { param_names__.emplace_back(std::string() + "b" + '.' + std::to_string(sym340__)); - }} + } + } param_names__.emplace_back(std::string() + "Nsuper"); for (int sym340__ = 1; sym340__ <= n_occasions; ++sym340__) { { param_names__.emplace_back(std::string() + "N" + '.' + std::to_string(sym340__)); - }} + } + } for (int sym340__ = 1; sym340__ <= n_occasions; ++sym340__) { { param_names__.emplace_back(std::string() + "B" + '.' + std::to_string(sym340__)); - }} + } + } for (int sym340__ = 1; sym340__ <= n_occasions; ++sym340__) { { for (int sym341__ = 1; sym341__ <= M; ++sym341__) { { param_names__.emplace_back(std::string() + "z" + '.' + std::to_string(sym341__) + '.' + std::to_string(sym340__)); - }} - }} + } + } + } + } } } // constrained_param_names() @@ -22575,11 +23164,13 @@ class inlining_fail2_model final : public model_base_crtp for (int sym340__ = 1; sym340__ <= n_occasions; ++sym340__) { { param_names__.emplace_back(std::string() + "gamma" + '.' + std::to_string(sym340__)); - }} + } + } for (int sym340__ = 1; sym340__ <= epsilon_1dim__; ++sym340__) { { param_names__.emplace_back(std::string() + "epsilon" + '.' + std::to_string(sym340__)); - }} + } + } param_names__.emplace_back(std::string() + "sigma"); if (emit_transformed_parameters__) { for (int sym340__ = 1; sym340__ <= phi_2dim__; ++sym340__) { @@ -22587,22 +23178,28 @@ class inlining_fail2_model final : public model_base_crtp for (int sym341__ = 1; sym341__ <= M; ++sym341__) { { param_names__.emplace_back(std::string() + "phi" + '.' + std::to_string(sym341__) + '.' + std::to_string(sym340__)); - }} - }} + } + } + } + } for (int sym340__ = 1; sym340__ <= n_occasions; ++sym340__) { { for (int sym341__ = 1; sym341__ <= M; ++sym341__) { { param_names__.emplace_back(std::string() + "p" + '.' + std::to_string(sym341__) + '.' + std::to_string(sym340__)); - }} - }} + } + } + } + } for (int sym340__ = 1; sym340__ <= n_occasions; ++sym340__) { { for (int sym341__ = 1; sym341__ <= M; ++sym341__) { { param_names__.emplace_back(std::string() + "chi" + '.' + std::to_string(sym341__) + '.' + std::to_string(sym340__)); - }} - }} + } + } + } + } } if (emit_generated_quantities__) { @@ -22611,35 +23208,42 @@ class inlining_fail2_model final : public model_base_crtp for (int sym340__ = 1; sym340__ <= n_occasions; ++sym340__) { { param_names__.emplace_back(std::string() + "b" + '.' + std::to_string(sym340__)); - }} + } + } param_names__.emplace_back(std::string() + "Nsuper"); for (int sym340__ = 1; sym340__ <= n_occasions; ++sym340__) { { param_names__.emplace_back(std::string() + "N" + '.' + std::to_string(sym340__)); - }} + } + } for (int sym340__ = 1; sym340__ <= n_occasions; ++sym340__) { { param_names__.emplace_back(std::string() + "B" + '.' + std::to_string(sym340__)); - }} + } + } for (int sym340__ = 1; sym340__ <= n_occasions; ++sym340__) { { for (int sym341__ = 1; sym341__ <= M; ++sym341__) { { param_names__.emplace_back(std::string() + "z" + '.' + std::to_string(sym341__) + '.' + std::to_string(sym340__)); - }} - }} + } + } + } + } } } // unconstrained_param_names() - inline std::string get_constrained_sizedtypes() const final { + inline std::string get_constrained_sizedtypes() const { + + return std::string("[{\"name\":\"mean_phi\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"mean_p\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"gamma\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(n_occasions) + "},\"block\":\"parameters\"},{\"name\":\"epsilon\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(epsilon_1dim__) + "},\"block\":\"parameters\"},{\"name\":\"sigma\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"phi\",\"type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(M) + ",\"cols\":" + std::to_string(phi_2dim__) + "},\"block\":\"transformed_parameters\"},{\"name\":\"p\",\"type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(M) + ",\"cols\":" + std::to_string(n_occasions) + "},\"block\":\"transformed_parameters\"},{\"name\":\"chi\",\"type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(M) + ",\"cols\":" + std::to_string(n_occasions) + "},\"block\":\"transformed_parameters\"},{\"name\":\"sigma2\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"psi\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"b\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(n_occasions) + "},\"block\":\"generated_quantities\"},{\"name\":\"Nsuper\",\"type\":{\"name\":\"int\"},\"block\":\"generated_quantities\"},{\"name\":\"N\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(n_occasions) + ",\"element_type\":{\"name\":\"int\"}},\"block\":\"generated_quantities\"},{\"name\":\"B\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(n_occasions) + ",\"element_type\":{\"name\":\"int\"}},\"block\":\"generated_quantities\"},{\"name\":\"z\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(M) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(n_occasions) + ",\"element_type\":{\"name\":\"int\"}}},\"block\":\"generated_quantities\"}]"); - return std::string("[{\"name\":\"mean_phi\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"mean_p\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"gamma\",\"type\":{\"name\":\"vector\",\"length\":" << n_occasions << "},\"block\":\"parameters\"},{\"name\":\"epsilon\",\"type\":{\"name\":\"vector\",\"length\":" << epsilon_1dim__ << "},\"block\":\"parameters\"},{\"name\":\"sigma\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"phi\",\"type\":{\"name\":\"matrix\",\"rows\":" << M << ",\"cols\":" << phi_2dim__ << "},\"block\":\"transformed_parameters\"},{\"name\":\"p\",\"type\":{\"name\":\"matrix\",\"rows\":" << M << ",\"cols\":" << n_occasions << "},\"block\":\"transformed_parameters\"},{\"name\":\"chi\",\"type\":{\"name\":\"matrix\",\"rows\":" << M << ",\"cols\":" << n_occasions << "},\"block\":\"transformed_parameters\"},{\"name\":\"sigma2\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"psi\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"b\",\"type\":{\"name\":\"vector\",\"length\":" << n_occasions << "},\"block\":\"generated_quantities\"},{\"name\":\"Nsuper\",\"type\":{\"name\":\"int\"},\"block\":\"generated_quantities\"},{\"name\":\"N\",\"type\":{\"name\":\"array\",\"length\":" << n_occasions << ",\"element_type\":{\"name\":\"int\"}},\"block\":\"generated_quantities\"},{\"name\":\"B\",\"type\":{\"name\":\"array\",\"length\":" << n_occasions << ",\"element_type\":{\"name\":\"int\"}},\"block\":\"generated_quantities\"},{\"name\":\"z\",\"type\":{\"name\":\"array\",\"length\":" << M << ",\"element_type\":{\"name\":\"array\",\"length\":" << n_occasions << ",\"element_type\":{\"name\":\"int\"}}},\"block\":\"generated_quantities\"}]"); } // get_constrained_sizedtypes() - inline std::string get_unconstrained_sizedtypes() const final { + inline std::string get_unconstrained_sizedtypes() const { + + return std::string("[{\"name\":\"mean_phi\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"mean_p\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"gamma\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(n_occasions) + "},\"block\":\"parameters\"},{\"name\":\"epsilon\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(epsilon_1dim__) + "},\"block\":\"parameters\"},{\"name\":\"sigma\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"phi\",\"type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(M) + ",\"cols\":" + std::to_string(phi_2dim__) + "},\"block\":\"transformed_parameters\"},{\"name\":\"p\",\"type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(M) + ",\"cols\":" + std::to_string(n_occasions) + "},\"block\":\"transformed_parameters\"},{\"name\":\"chi\",\"type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(M) + ",\"cols\":" + std::to_string(n_occasions) + "},\"block\":\"transformed_parameters\"},{\"name\":\"sigma2\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"psi\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"b\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(n_occasions) + "},\"block\":\"generated_quantities\"},{\"name\":\"Nsuper\",\"type\":{\"name\":\"int\"},\"block\":\"generated_quantities\"},{\"name\":\"N\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(n_occasions) + ",\"element_type\":{\"name\":\"int\"}},\"block\":\"generated_quantities\"},{\"name\":\"B\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(n_occasions) + ",\"element_type\":{\"name\":\"int\"}},\"block\":\"generated_quantities\"},{\"name\":\"z\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(M) + ",\"element_type\":{\"name\":\"array\",\"length\":" + std::to_string(n_occasions) + ",\"element_type\":{\"name\":\"int\"}}},\"block\":\"generated_quantities\"}]"); - return std::string("[{\"name\":\"mean_phi\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"mean_p\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"gamma\",\"type\":{\"name\":\"vector\",\"length\":" << n_occasions << "},\"block\":\"parameters\"},{\"name\":\"epsilon\",\"type\":{\"name\":\"vector\",\"length\":" << epsilon_1dim__ << "},\"block\":\"parameters\"},{\"name\":\"sigma\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"phi\",\"type\":{\"name\":\"matrix\",\"rows\":" << M << ",\"cols\":" << phi_2dim__ << "},\"block\":\"transformed_parameters\"},{\"name\":\"p\",\"type\":{\"name\":\"matrix\",\"rows\":" << M << ",\"cols\":" << n_occasions << "},\"block\":\"transformed_parameters\"},{\"name\":\"chi\",\"type\":{\"name\":\"matrix\",\"rows\":" << M << ",\"cols\":" << n_occasions << "},\"block\":\"transformed_parameters\"},{\"name\":\"sigma2\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"psi\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"b\",\"type\":{\"name\":\"vector\",\"length\":" << n_occasions << "},\"block\":\"generated_quantities\"},{\"name\":\"Nsuper\",\"type\":{\"name\":\"int\"},\"block\":\"generated_quantities\"},{\"name\":\"N\",\"type\":{\"name\":\"array\",\"length\":" << n_occasions << ",\"element_type\":{\"name\":\"int\"}},\"block\":\"generated_quantities\"},{\"name\":\"B\",\"type\":{\"name\":\"array\",\"length\":" << n_occasions << ",\"element_type\":{\"name\":\"int\"}},\"block\":\"generated_quantities\"},{\"name\":\"z\",\"type\":{\"name\":\"array\",\"length\":" << M << ",\"element_type\":{\"name\":\"array\",\"length\":" << n_occasions << ",\"element_type\":{\"name\":\"int\"}}},\"block\":\"generated_quantities\"}]"); } // get_unconstrained_sizedtypes() @@ -22651,14 +23255,13 @@ class inlining_fail2_model final : public model_base_crtp const bool emit_transformed_parameters = true, const bool emit_generated_quantities = true, std::ostream* pstream = nullptr) const { - std::vector vars_vec(vars.size()); + std::vector vars_vec; + vars_vec.reserve(vars.size()); std::vector params_i; write_array_impl(base_rng, params_r, params_i, vars_vec, emit_transformed_parameters, emit_generated_quantities, pstream); - vars.resize(vars_vec.size()); - for (int i = 0; i < vars.size(); ++i) { - vars.coeffRef(i) = vars_vec[i]; - } + vars = Eigen::Map>( + vars_vec.data(), vars_vec.size()); } template @@ -22668,7 +23271,8 @@ class inlining_fail2_model final : public model_base_crtp bool emit_transformed_parameters = true, bool emit_generated_quantities = true, std::ostream* pstream = nullptr) const { - write_array_impl(base_rng, params_r, params_i, vars, emit_transformed_parameters, emit_generated_quantities, pstream); + write_array_impl(base_rng, params_r, params_i, vars, + emit_transformed_parameters, emit_generated_quantities, pstream); } template @@ -22689,13 +23293,12 @@ class inlining_fail2_model final : public model_base_crtp inline void transform_inits(const stan::io::var_context& context, Eigen::Matrix& params_r, std::ostream* pstream = nullptr) const final { - std::vector params_r_vec(params_r.size()); + std::vector params_r_vec; + params_r_vec.reserve(params_r.size()); std::vector params_i; transform_inits_impl(context, params_i, params_r_vec, pstream); - params_r.resize(params_r_vec.size()); - for (int i = 0; i < params_r.size(); ++i) { - params_r.coeffRef(i) = params_r_vec[i]; - } + params_r = Eigen::Map>( + params_r_vec.data(), params_r_vec.size()); } inline void transform_inits(const stan::io::var_context& context, std::vector& params_i, @@ -22792,23 +23395,21 @@ class lcm_experiment_model final : public model_base_crtp try { int pos__; - pos__ = std::numeric_limits::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; current_statement__ = 1; context__.validate_dims("data initialization","j","int", - context__.to_vec()); - j = std::numeric_limits::min(); + std::vector{}); + j = std::numeric_limits::min(); current_statement__ = 1; j = context__.vals_i("j")[(1 - 1)]; current_statement__ = 2; - z = std::numeric_limits::quiet_NaN(); current_statement__ = 2; z = 1; current_statement__ = 3; - x = std::numeric_limits::quiet_NaN(); { current_statement__ = 4; @@ -22817,7 +23418,6 @@ class lcm_experiment_model final : public model_base_crtp z = normal_rng(lcm_sym3__, 1, base_rng__); } current_statement__ = 6; - i = std::numeric_limits::quiet_NaN(); current_statement__ = 6; i = normal_rng(lcm_sym3__, 1, base_rng__); @@ -22828,13 +23428,6 @@ class lcm_experiment_model final : public model_base_crtp } num_params_r__ = 0U; - try { - - } catch (const std::exception& e) { - stan::lang::rethrow_located(e, locations_array__[current_statement__]); - // Next line prevents compiler griping about no return - throw std::runtime_error("*** IF YOU SEE THIS, PLEASE REPORT A BUG ***"); - } } template try { int pos__; - pos__ = std::numeric_limits::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; } catch (const std::exception& e) { @@ -22930,11 +23523,13 @@ class lcm_experiment_model final : public model_base_crtp inline void get_param_names(std::vector& names__) const { names__ = std::vector{}; + } // get_param_names() inline void get_dims(std::vector>& dimss__) const { dimss__ = std::vector>{}; + } // get_dims() inline void constrained_param_names( @@ -22971,14 +23566,16 @@ class lcm_experiment_model final : public model_base_crtp } // unconstrained_param_names() - inline std::string get_constrained_sizedtypes() const final { + inline std::string get_constrained_sizedtypes() const { return std::string("[]"); + } // get_constrained_sizedtypes() - inline std::string get_unconstrained_sizedtypes() const final { + inline std::string get_unconstrained_sizedtypes() const { return std::string("[]"); + } // get_unconstrained_sizedtypes() @@ -22990,14 +23587,13 @@ class lcm_experiment_model final : public model_base_crtp const bool emit_transformed_parameters = true, const bool emit_generated_quantities = true, std::ostream* pstream = nullptr) const { - std::vector vars_vec(vars.size()); + std::vector vars_vec; + vars_vec.reserve(vars.size()); std::vector params_i; write_array_impl(base_rng, params_r, params_i, vars_vec, emit_transformed_parameters, emit_generated_quantities, pstream); - vars.resize(vars_vec.size()); - for (int i = 0; i < vars.size(); ++i) { - vars.coeffRef(i) = vars_vec[i]; - } + vars = Eigen::Map>( + vars_vec.data(), vars_vec.size()); } template @@ -23007,7 +23603,8 @@ class lcm_experiment_model final : public model_base_crtp bool emit_transformed_parameters = true, bool emit_generated_quantities = true, std::ostream* pstream = nullptr) const { - write_array_impl(base_rng, params_r, params_i, vars, emit_transformed_parameters, emit_generated_quantities, pstream); + write_array_impl(base_rng, params_r, params_i, vars, + emit_transformed_parameters, emit_generated_quantities, pstream); } template @@ -23028,13 +23625,12 @@ class lcm_experiment_model final : public model_base_crtp inline void transform_inits(const stan::io::var_context& context, Eigen::Matrix& params_r, std::ostream* pstream = nullptr) const final { - std::vector params_r_vec(params_r.size()); + std::vector params_r_vec; + params_r_vec.reserve(params_r.size()); std::vector params_i; transform_inits_impl(context, params_i, params_r_vec, pstream); - params_r.resize(params_r_vec.size()); - for (int i = 0; i < params_r.size(); ++i) { - params_r.coeffRef(i) = params_r_vec[i]; - } + params_r = Eigen::Map>( + params_r_vec.data(), params_r_vec.size()); } inline void transform_inits(const stan::io::var_context& context, std::vector& params_i, @@ -23127,7 +23723,7 @@ class lcm_experiment2_model final : public model_base_crtp::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; } catch (const std::exception& e) { @@ -23135,15 +23731,8 @@ class lcm_experiment2_model final : public model_base_crtp(); { local_scalar_t__ y; - y = DUMMY_VAR__; + y = DUMMY_VAR__; lcm_sym5__ = stan::math::log(x); { @@ -23223,7 +23812,7 @@ class lcm_experiment2_model final : public model_base_crtp::quiet_NaN(); + x = std::numeric_limits::quiet_NaN(); current_statement__ = 1; x = in__.template read(); @@ -23255,11 +23844,11 @@ class lcm_experiment2_model final : public model_base_crtp::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; double x; - x = std::numeric_limits::quiet_NaN(); + x = std::numeric_limits::quiet_NaN(); current_statement__ = 1; x = context__.vals_r("x")[(1 - 1)]; @@ -23274,11 +23863,13 @@ class lcm_experiment2_model final : public model_base_crtp& names__) const { names__ = std::vector{"x"}; + } // get_param_names() inline void get_dims(std::vector>& dimss__) const { dimss__ = std::vector>{std::vector{}}; + } // get_dims() inline void constrained_param_names( @@ -23315,14 +23906,16 @@ class lcm_experiment2_model final : public model_base_crtp vars_vec(vars.size()); + std::vector vars_vec; + vars_vec.reserve(vars.size()); std::vector params_i; write_array_impl(base_rng, params_r, params_i, vars_vec, emit_transformed_parameters, emit_generated_quantities, pstream); - vars.resize(vars_vec.size()); - for (int i = 0; i < vars.size(); ++i) { - vars.coeffRef(i) = vars_vec[i]; - } + vars = Eigen::Map>( + vars_vec.data(), vars_vec.size()); } template @@ -23351,7 +23943,8 @@ class lcm_experiment2_model final : public model_base_crtp @@ -23372,13 +23965,12 @@ class lcm_experiment2_model final : public model_base_crtp& params_r, std::ostream* pstream = nullptr) const final { - std::vector params_r_vec(params_r.size()); + std::vector params_r_vec; + params_r_vec.reserve(params_r.size()); std::vector params_i; transform_inits_impl(context, params_i, params_r_vec, pstream); - params_r.resize(params_r_vec.size()); - for (int i = 0; i < params_r.size(); ++i) { - params_r.coeffRef(i) = params_r_vec[i]; - } + params_r = Eigen::Map>( + params_r_vec.data(), params_r_vec.size()); } inline void transform_inits(const stan::io::var_context& context, std::vector& params_i, @@ -23471,13 +24063,13 @@ class lcm_fails_model final : public model_base_crtp { (void) DUMMY_VAR__; // suppress unused var warning try { int pos__; - pos__ = std::numeric_limits::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; current_statement__ = 3; context__.validate_dims("data initialization","J","int", - context__.to_vec()); - J = std::numeric_limits::min(); + std::vector{}); + J = std::numeric_limits::min(); current_statement__ = 3; J = context__.vals_i("J")[(1 - 1)]; @@ -23488,8 +24080,8 @@ class lcm_fails_model final : public model_base_crtp { validate_non_negative_index("y", "J", J); current_statement__ = 5; context__.validate_dims("data initialization","y","double", - context__.to_vec(J)); - y = std::vector(J, std::numeric_limits::quiet_NaN()); + std::vector{static_cast(J)}); + y = std::vector(J, std::numeric_limits::quiet_NaN()); current_statement__ = 5; y = context__.vals_r("y"); @@ -23500,15 +24092,8 @@ class lcm_fails_model final : public model_base_crtp { // Next line prevents compiler griping about no return throw std::runtime_error("*** IF YOU SEE THIS, PLEASE REPORT A BUG ***"); } - num_params_r__ = 0U; + num_params_r__ = J; - try { - num_params_r__ += J; - } catch (const std::exception& e) { - stan::lang::rethrow_located(e, locations_array__[current_statement__]); - // Next line prevents compiler griping about no return - throw std::runtime_error("*** IF YOU SEE THIS, PLEASE REPORT A BUG ***"); - } } template { try { double lcm_sym9__; std::vector theta; - theta = std::vector(J, DUMMY_VAR__); + theta = std::vector(J, DUMMY_VAR__); current_statement__ = 1; theta = in__.template read>(J); @@ -23578,13 +24163,15 @@ class lcm_fails_model final : public model_base_crtp { int lcm_sym4__; std::vector theta; theta = std::vector(J, std::numeric_limits::quiet_NaN()); + current_statement__ = 1; theta = in__.template read>(J); if (logical_gte(J, 1)) { vars__.emplace_back(rvalue(theta, "theta", index_uni(1))); for (int sym1__ = 2; sym1__ <= J; ++sym1__) { - vars__.emplace_back(theta[(sym1__ - 1)]);} + vars__.emplace_back(theta[(sym1__ - 1)]); + } } if (logical_negation((primitive_value(emit_transformed_parameters__) || primitive_value(emit_generated_quantities__)))) { @@ -23616,18 +24203,20 @@ class lcm_fails_model final : public model_base_crtp { double lcm_sym2__; int lcm_sym1__; int pos__; - pos__ = std::numeric_limits::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; std::vector theta; theta = std::vector(J, std::numeric_limits::quiet_NaN()); + current_statement__ = 1; theta = context__.vals_r("theta"); if (logical_gte(J, 1)) { vars__.emplace_back(rvalue(theta, "theta", index_uni(1))); for (int sym1__ = 2; sym1__ <= J; ++sym1__) { - vars__.emplace_back(theta[(sym1__ - 1)]);} + vars__.emplace_back(theta[(sym1__ - 1)]); + } } } catch (const std::exception& e) { stan::lang::rethrow_located(e, locations_array__[current_statement__]); @@ -23639,6 +24228,7 @@ class lcm_fails_model final : public model_base_crtp { inline void get_param_names(std::vector& names__) const { names__ = std::vector{"theta"}; + } // get_param_names() inline void get_dims(std::vector>& dimss__) const { @@ -23646,6 +24236,7 @@ class lcm_fails_model final : public model_base_crtp { dimss__ = std::vector>{std::vector{ static_cast(J) }}; + } // get_dims() inline void constrained_param_names( @@ -23657,7 +24248,8 @@ class lcm_fails_model final : public model_base_crtp { for (int sym10__ = 1; sym10__ <= J; ++sym10__) { { param_names__.emplace_back(std::string() + "theta" + '.' + std::to_string(sym10__)); - }} + } + } if (emit_transformed_parameters__) { } @@ -23677,7 +24269,8 @@ class lcm_fails_model final : public model_base_crtp { for (int sym10__ = 1; sym10__ <= J; ++sym10__) { { param_names__.emplace_back(std::string() + "theta" + '.' + std::to_string(sym10__)); - }} + } + } if (emit_transformed_parameters__) { } @@ -23688,14 +24281,16 @@ class lcm_fails_model final : public model_base_crtp { } // unconstrained_param_names() - inline std::string get_constrained_sizedtypes() const final { + inline std::string get_constrained_sizedtypes() const { + + return std::string("[{\"name\":\"theta\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(J) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"}]"); - return std::string("[{\"name\":\"theta\",\"type\":{\"name\":\"array\",\"length\":" << J << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"}]"); } // get_constrained_sizedtypes() - inline std::string get_unconstrained_sizedtypes() const final { + inline std::string get_unconstrained_sizedtypes() const { + + return std::string("[{\"name\":\"theta\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(J) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"}]"); - return std::string("[{\"name\":\"theta\",\"type\":{\"name\":\"array\",\"length\":" << J << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"}]"); } // get_unconstrained_sizedtypes() @@ -23707,14 +24302,13 @@ class lcm_fails_model final : public model_base_crtp { const bool emit_transformed_parameters = true, const bool emit_generated_quantities = true, std::ostream* pstream = nullptr) const { - std::vector vars_vec(vars.size()); + std::vector vars_vec; + vars_vec.reserve(vars.size()); std::vector params_i; write_array_impl(base_rng, params_r, params_i, vars_vec, emit_transformed_parameters, emit_generated_quantities, pstream); - vars.resize(vars_vec.size()); - for (int i = 0; i < vars.size(); ++i) { - vars.coeffRef(i) = vars_vec[i]; - } + vars = Eigen::Map>( + vars_vec.data(), vars_vec.size()); } template @@ -23724,7 +24318,8 @@ class lcm_fails_model final : public model_base_crtp { bool emit_transformed_parameters = true, bool emit_generated_quantities = true, std::ostream* pstream = nullptr) const { - write_array_impl(base_rng, params_r, params_i, vars, emit_transformed_parameters, emit_generated_quantities, pstream); + write_array_impl(base_rng, params_r, params_i, vars, + emit_transformed_parameters, emit_generated_quantities, pstream); } template @@ -23745,13 +24340,12 @@ class lcm_fails_model final : public model_base_crtp { inline void transform_inits(const stan::io::var_context& context, Eigen::Matrix& params_r, std::ostream* pstream = nullptr) const final { - std::vector params_r_vec(params_r.size()); + std::vector params_r_vec; + params_r_vec.reserve(params_r.size()); std::vector params_i; transform_inits_impl(context, params_i, params_r_vec, pstream); - params_r.resize(params_r_vec.size()); - for (int i = 0; i < params_r.size(); ++i) { - params_r.coeffRef(i) = params_r_vec[i]; - } + params_r = Eigen::Map>( + params_r_vec.data(), params_r_vec.size()); } inline void transform_inits(const stan::io::var_context& context, std::vector& params_i, @@ -23896,7 +24490,8 @@ first_capture(const std::vector& y_i, std::ostream* pstream__) { if (rvalue(y_i, "y_i", index_uni(k))) { current_statement__ = 41; return k; - } } + } + } } current_statement__ = 59; return 0; @@ -23936,7 +24531,7 @@ last_capture(const std::vector& y_i, std::ostream* pstream__) { lcm_sym33__ = (size(y_i) - 1); if (logical_gte(lcm_sym33__, 0)) { int k; - k = std::numeric_limits::min(); + k = std::numeric_limits::min(); lcm_sym32__ = (size(y_i) - 0); current_statement__ = 48; @@ -23946,14 +24541,15 @@ last_capture(const std::vector& y_i, std::ostream* pstream__) { } for (int k_rev = 1; k_rev <= lcm_sym33__; ++k_rev) { int k; - k = std::numeric_limits::min(); + k = std::numeric_limits::min(); lcm_sym31__ = (size(y_i) - k_rev); current_statement__ = 48; if (y_i[(lcm_sym31__ - 1)]) { current_statement__ = 47; return lcm_sym31__; - } } + } + } } current_statement__ = 60; return 0; @@ -24006,7 +24602,7 @@ prob_uncaptured(const int& nind, const int& n_occasions, const T2__& p_arg__, validate_non_negative_index("chi", "n_occasions", n_occasions); Eigen::Matrix chi; chi = Eigen::Matrix(nind, n_occasions); - stan::math::fill(chi, DUMMY_VAR__); + stan::math::fill(chi, DUMMY_VAR__); current_statement__ = 62; if (logical_gte(nind, 1)) { @@ -24017,10 +24613,10 @@ prob_uncaptured(const int& nind, const int& n_occasions, const T2__& p_arg__, lcm_sym37__ = logical_gte(lcm_sym39__, 1); if (lcm_sym37__) { int t_curr; - t_curr = std::numeric_limits::min(); + t_curr = std::numeric_limits::min(); int t_next; - t_next = std::numeric_limits::min(); + t_next = std::numeric_limits::min(); lcm_sym41__ = (lcm_sym39__ + 1); current_statement__ = 20; @@ -24034,11 +24630,11 @@ prob_uncaptured(const int& nind, const int& n_occasions, const T2__& p_arg__, "assigning variable chi", index_uni(1), index_uni(lcm_sym39__)); for (int t = 2; t <= lcm_sym39__; ++t) { int t_curr; - t_curr = std::numeric_limits::min(); + t_curr = std::numeric_limits::min(); lcm_sym38__ = (n_occasions - t); int t_next; - t_next = std::numeric_limits::min(); + t_next = std::numeric_limits::min(); lcm_sym40__ = (lcm_sym38__ + 1); current_statement__ = 20; @@ -24061,10 +24657,10 @@ prob_uncaptured(const int& nind, const int& n_occasions, const T2__& p_arg__, current_statement__ = 61; if (lcm_sym37__) { int t_curr; - t_curr = std::numeric_limits::min(); + t_curr = std::numeric_limits::min(); int t_next; - t_next = std::numeric_limits::min(); + t_next = std::numeric_limits::min(); lcm_sym41__ = (lcm_sym39__ + 1); current_statement__ = 20; @@ -24080,11 +24676,11 @@ prob_uncaptured(const int& nind, const int& n_occasions, const T2__& p_arg__, "assigning variable chi", index_uni(i), index_uni(lcm_sym39__)); for (int t = 2; t <= lcm_sym39__; ++t) { int t_curr; - t_curr = std::numeric_limits::min(); + t_curr = std::numeric_limits::min(); lcm_sym38__ = (n_occasions - t); int t_next; - t_next = std::numeric_limits::min(); + t_next = std::numeric_limits::min(); lcm_sym40__ = (lcm_sym38__ + 1); current_statement__ = 20; @@ -24098,8 +24694,10 @@ prob_uncaptured(const int& nind, const int& n_occasions, const T2__& p_arg__, (1 - rvalue(phi, "phi", index_uni(i), index_uni(lcm_sym38__)))), "assigning variable chi", index_uni(i), - index_uni(lcm_sym38__));} - } } + index_uni(lcm_sym38__)); + } + } + } } current_statement__ = 63; return chi; @@ -24205,13 +24803,13 @@ class lcm_fails2_model final : public model_base_crtp { int pos__; - pos__ = std::numeric_limits::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; current_statement__ = 31; context__.validate_dims("data initialization","nind","int", - context__.to_vec()); - nind = std::numeric_limits::min(); + std::vector{}); + nind = std::numeric_limits::min(); current_statement__ = 31; nind = context__.vals_i("nind")[(1 - 1)]; @@ -24220,8 +24818,8 @@ class lcm_fails2_model final : public model_base_crtp { check_greater_or_equal(function__, "nind", nind, 0); current_statement__ = 32; context__.validate_dims("data initialization","n_occasions","int", - context__.to_vec()); - n_occasions = std::numeric_limits::min(); + std::vector{}); + n_occasions = std::numeric_limits::min(); current_statement__ = 32; n_occasions = context__.vals_i("n_occasions")[(1 - 1)]; @@ -24234,8 +24832,10 @@ class lcm_fails2_model final : public model_base_crtp { validate_non_negative_index("y", "n_occasions", n_occasions); current_statement__ = 35; context__.validate_dims("data initialization","y","int", - context__.to_vec(nind, n_occasions)); + std::vector{static_cast(nind), + static_cast(n_occasions)}); y = std::vector>(nind, std::vector(n_occasions, std::numeric_limits::min())); + { std::vector y_flat__; @@ -24258,7 +24858,8 @@ class lcm_fails2_model final : public model_base_crtp { assign(y, y_flat__[(pos__ - 1)], "assigning variable y", index_uni(sym2__), index_uni(1)); current_statement__ = 35; - pos__ = (pos__ + 1);} + pos__ = (pos__ + 1); + } } for (int sym1__ = 2; sym1__ <= n_occasions; ++sym1__) { current_statement__ = 35; @@ -24274,8 +24875,10 @@ class lcm_fails2_model final : public model_base_crtp { "assigning variable y", index_uni(sym2__), index_uni(sym1__)); current_statement__ = 35; - pos__ = (pos__ + 1);} - } } + pos__ = (pos__ + 1); + } + } + } } } else { lcm_sym138__ = logical_gte(nind, 1); @@ -24295,7 +24898,8 @@ class lcm_fails2_model final : public model_base_crtp { current_statement__ = 35; check_greater_or_equal(function__, "y[sym1__, sym2__]", rvalue(y, "y", - index_uni(1), index_uni(sym2__)), 0);} + index_uni(1), index_uni(sym2__)), 0); + } } for (int sym1__ = 2; sym1__ <= nind; ++sym1__) { current_statement__ = 35; @@ -24309,8 +24913,10 @@ class lcm_fails2_model final : public model_base_crtp { current_statement__ = 35; current_statement__ = 35; check_greater_or_equal(function__, "y[sym1__, sym2__]", - y[(sym1__ - 1)][(sym2__ - 1)], 0);} - } } + y[(sym1__ - 1)][(sym2__ - 1)], 0); + } + } + } } current_statement__ = 35; if (lcm_sym138__) { @@ -24325,7 +24931,8 @@ class lcm_fails2_model final : public model_base_crtp { current_statement__ = 35; check_less_or_equal(function__, "y[sym1__, sym2__]", rvalue(y, "y", - index_uni(1), index_uni(sym2__)), 1);} + index_uni(1), index_uni(sym2__)), 1); + } } for (int sym1__ = 2; sym1__ <= nind; ++sym1__) { current_statement__ = 35; @@ -24339,29 +24946,28 @@ class lcm_fails2_model final : public model_base_crtp { current_statement__ = 35; current_statement__ = 35; check_less_or_equal(function__, "y[sym1__, sym2__]", - y[(sym1__ - 1)][(sym2__ - 1)], 1);} - } } + y[(sym1__ - 1)][(sym2__ - 1)], 1); + } + } + } } current_statement__ = 36; - n_occ_minus_1 = std::numeric_limits::min(); lcm_sym139__ = (n_occasions - 1); n_occ_minus_1 = lcm_sym139__; current_statement__ = 37; validate_non_negative_index("first", "nind", nind); current_statement__ = 38; - first = std::vector(nind, std::numeric_limits::min()); current_statement__ = 39; validate_non_negative_index("last", "nind", nind); current_statement__ = 40; - last = std::vector(nind, std::numeric_limits::min()); current_statement__ = 45; if (lcm_sym138__) { int inline_sym17__; int inline_sym19__; - inline_sym19__ = std::numeric_limits::min(); + inline_sym19__ = std::numeric_limits::min(); inline_sym19__ = 0; for (int inline_sym20__ = 1; inline_sym20__ <= 1; ++inline_sym20__) { @@ -24373,19 +24979,21 @@ class lcm_fails2_model final : public model_base_crtp { inline_sym19__ = 1; inline_sym17__ = inline_sym18__; break; - } } + } + } if (inline_sym19__) { break; } inline_sym19__ = 1; inline_sym17__ = 0; - break;} + break; + } assign(first, inline_sym17__, "assigning variable first", index_uni(1)); for (int i = 2; i <= nind; ++i) { int inline_sym17__; int inline_sym19__; - inline_sym19__ = std::numeric_limits::min(); + inline_sym19__ = std::numeric_limits::min(); inline_sym19__ = 0; for (int inline_sym20__ = 1; inline_sym20__ <= 1; ++inline_sym20__) { @@ -24397,21 +25005,24 @@ class lcm_fails2_model final : public model_base_crtp { inline_sym19__ = 1; inline_sym17__ = inline_sym18__; break; - } } + } + } if (inline_sym19__) { break; } inline_sym19__ = 1; inline_sym17__ = 0; - break;} + break; + } assign(first, inline_sym17__, - "assigning variable first", index_uni(i));} + "assigning variable first", index_uni(i)); + } } current_statement__ = 52; if (lcm_sym138__) { int inline_sym21__; int inline_sym24__; - inline_sym24__ = std::numeric_limits::min(); + inline_sym24__ = std::numeric_limits::min(); inline_sym24__ = 0; for (int inline_sym25__ = 1; inline_sym25__ <= 1; ++inline_sym25__) { @@ -24420,7 +25031,7 @@ class lcm_fails2_model final : public model_base_crtp { for (int inline_sym23__ = 0; inline_sym23__ <= lcm_sym143__; ++inline_sym23__) { int inline_sym22__; - inline_sym22__ = std::numeric_limits::min(); + inline_sym22__ = std::numeric_limits::min(); lcm_sym142__ = (lcm_sym146__ - inline_sym23__); inline_sym22__ = lcm_sym142__; @@ -24429,18 +25040,20 @@ class lcm_fails2_model final : public model_base_crtp { inline_sym24__ = 1; inline_sym21__ = lcm_sym142__; break; - } } + } + } if (inline_sym24__) { break; } inline_sym24__ = 1; inline_sym21__ = 0; - break;} + break; + } assign(last, inline_sym21__, "assigning variable last", index_uni(1)); for (int i = 2; i <= nind; ++i) { int inline_sym21__; int inline_sym24__; - inline_sym24__ = std::numeric_limits::min(); + inline_sym24__ = std::numeric_limits::min(); inline_sym24__ = 0; for (int inline_sym25__ = 1; inline_sym25__ <= 1; ++inline_sym25__) { @@ -24449,7 +25062,7 @@ class lcm_fails2_model final : public model_base_crtp { for (int inline_sym23__ = 0; inline_sym23__ <= lcm_sym141__; ++inline_sym23__) { int inline_sym22__; - inline_sym22__ = std::numeric_limits::min(); + inline_sym22__ = std::numeric_limits::min(); lcm_sym140__ = (lcm_sym145__ - inline_sym23__); inline_sym22__ = lcm_sym140__; @@ -24458,15 +25071,18 @@ class lcm_fails2_model final : public model_base_crtp { inline_sym24__ = 1; inline_sym21__ = lcm_sym140__; break; - } } + } + } if (inline_sym24__) { break; } inline_sym24__ = 1; inline_sym21__ = 0; - break;} + break; + } assign(last, inline_sym21__, - "assigning variable last", index_uni(i));} + "assigning variable last", index_uni(i)); + } } current_statement__ = 38; if (lcm_sym138__) { @@ -24478,7 +25094,8 @@ class lcm_fails2_model final : public model_base_crtp { current_statement__ = 38; current_statement__ = 38; check_greater_or_equal(function__, "first[sym1__]", - first[(sym1__ - 1)], 0);} + first[(sym1__ - 1)], 0); + } } current_statement__ = 38; if (lcm_sym138__) { @@ -24490,7 +25107,8 @@ class lcm_fails2_model final : public model_base_crtp { current_statement__ = 38; current_statement__ = 38; check_less_or_equal(function__, "first[sym1__]", - first[(sym1__ - 1)], n_occasions);} + first[(sym1__ - 1)], n_occasions); + } } current_statement__ = 40; if (lcm_sym138__) { @@ -24502,7 +25120,8 @@ class lcm_fails2_model final : public model_base_crtp { current_statement__ = 40; current_statement__ = 40; check_greater_or_equal(function__, "last[sym1__]", - last[(sym1__ - 1)], 0);} + last[(sym1__ - 1)], 0); + } } current_statement__ = 40; if (lcm_sym138__) { @@ -24514,7 +25133,8 @@ class lcm_fails2_model final : public model_base_crtp { current_statement__ = 40; current_statement__ = 40; check_less_or_equal(function__, "last[sym1__]", last[(sym1__ - 1)], - n_occasions);} + n_occasions); + } } current_statement__ = 53; validate_non_negative_index("phi", "nind", nind); @@ -24533,16 +25153,8 @@ class lcm_fails2_model final : public model_base_crtp { // Next line prevents compiler griping about no return throw std::runtime_error("*** IF YOU SEE THIS, PLEASE REPORT A BUG ***"); } - num_params_r__ = 0U; + num_params_r__ = 1 + 1; - try { - num_params_r__ += 1; - num_params_r__ += 1; - } catch (const std::exception& e) { - stan::lang::rethrow_located(e, locations_array__[current_statement__]); - // Next line prevents compiler griping about no return - throw std::runtime_error("*** IF YOU SEE THIS, PLEASE REPORT A BUG ***"); - } } template { int lcm_sym89__; int lcm_sym88__; local_scalar_t__ mean_phi; - mean_phi = DUMMY_VAR__; + mean_phi = DUMMY_VAR__; current_statement__ = 1; mean_phi = in__.template read_constrain_lub( 0, 1, lp__); local_scalar_t__ mean_p; - mean_p = DUMMY_VAR__; + mean_p = DUMMY_VAR__; current_statement__ = 2; mean_p = in__.template read_constrain_lub( 0, 1, lp__); Eigen::Matrix phi; phi = Eigen::Matrix(nind, (n_occasions - 1)); - stan::math::fill(phi, DUMMY_VAR__); + stan::math::fill(phi, DUMMY_VAR__); Eigen::Matrix p; p = Eigen::Matrix(nind, (n_occasions - 1)); - stan::math::fill(p, DUMMY_VAR__); + stan::math::fill(p, DUMMY_VAR__); Eigen::Matrix chi; chi = Eigen::Matrix(nind, n_occasions); - stan::math::fill(chi, DUMMY_VAR__); + stan::math::fill(chi, DUMMY_VAR__); lcm_sym89__ = logical_gte(nind, 1); if (lcm_sym89__) { @@ -24667,7 +25279,8 @@ class lcm_fails2_model final : public model_base_crtp { "assigning variable phi", index_uni(1), index_uni(t)); current_statement__ = 10; assign(p, mean_p, - "assigning variable p", index_uni(1), index_uni(t));} + "assigning variable p", index_uni(1), index_uni(t)); + } } for (int i = 2; i <= nind; ++i) { lcm_sym121__ = rvalue(first, "first", index_uni(i)); @@ -24700,12 +25313,14 @@ class lcm_fails2_model final : public model_base_crtp { "assigning variable phi", index_uni(i), index_uni(t)); current_statement__ = 10; assign(p, mean_p, - "assigning variable p", index_uni(i), index_uni(t));} - } } + "assigning variable p", index_uni(i), index_uni(t)); + } + } + } } Eigen::Matrix inline_sym9__; int inline_sym15__; - inline_sym15__ = std::numeric_limits::min(); + inline_sym15__ = std::numeric_limits::min(); inline_sym15__ = 0; for (int inline_sym16__ = 1; inline_sym16__ <= 1; ++inline_sym16__) { @@ -24715,7 +25330,7 @@ class lcm_fails2_model final : public model_base_crtp { validate_non_negative_index("chi", "n_occasions", n_occasions); Eigen::Matrix inline_sym10__; inline_sym10__ = Eigen::Matrix(nind, n_occasions); - stan::math::fill(inline_sym10__, DUMMY_VAR__); + stan::math::fill(inline_sym10__, DUMMY_VAR__); for (int inline_sym14__ = 1; inline_sym14__ <= nind; ++inline_sym14__) { current_statement__ = 17; @@ -24725,10 +25340,10 @@ class lcm_fails2_model final : public model_base_crtp { lcm_sym100__ = (n_occasions - 1); if (logical_gte(lcm_sym100__, 1)) { int inline_sym11__; - inline_sym11__ = std::numeric_limits::min(); + inline_sym11__ = std::numeric_limits::min(); int inline_sym12__; - inline_sym12__ = std::numeric_limits::min(); + inline_sym12__ = std::numeric_limits::min(); lcm_sym104__ = (lcm_sym100__ + 1); current_statement__ = 20; @@ -24750,11 +25365,11 @@ class lcm_fails2_model final : public model_base_crtp { for (int inline_sym13__ = 2; inline_sym13__ <= lcm_sym100__; ++inline_sym13__) { int inline_sym11__; - inline_sym11__ = std::numeric_limits::min(); + inline_sym11__ = std::numeric_limits::min(); lcm_sym99__ = (n_occasions - inline_sym13__); int inline_sym12__; - inline_sym12__ = std::numeric_limits::min(); + inline_sym12__ = std::numeric_limits::min(); lcm_sym103__ = (lcm_sym99__ + 1); current_statement__ = 20; @@ -24777,14 +25392,16 @@ class lcm_fails2_model final : public model_base_crtp { } if (inline_sym15__) { break; - } } + } + } if (inline_sym15__) { break; } inline_sym15__ = 1; assign(inline_sym9__, inline_sym10__, "assigning variable inline_sym9__"); - break;} + break; + } assign(chi, inline_sym9__, "assigning variable chi"); current_statement__ = 3; if (lcm_sym89__) { @@ -24801,7 +25418,8 @@ class lcm_fails2_model final : public model_base_crtp { current_statement__ = 3; check_greater_or_equal(function__, "phi[sym1__, sym2__]", rvalue(phi, "phi", - index_uni(1), index_uni(sym2__)), 0);} + index_uni(1), index_uni(sym2__)), 0); + } } for (int sym1__ = 2; sym1__ <= nind; ++sym1__) { current_statement__ = 3; @@ -24817,8 +25435,10 @@ class lcm_fails2_model final : public model_base_crtp { check_greater_or_equal(function__, "phi[sym1__, sym2__]", rvalue(phi, "phi", index_uni(sym1__), index_uni(sym2__)), - 0);} - } } + 0); + } + } + } } current_statement__ = 3; if (lcm_sym89__) { @@ -24835,7 +25455,8 @@ class lcm_fails2_model final : public model_base_crtp { current_statement__ = 3; check_less_or_equal(function__, "phi[sym1__, sym2__]", rvalue(phi, "phi", - index_uni(1), index_uni(sym2__)), 1);} + index_uni(1), index_uni(sym2__)), 1); + } } for (int sym1__ = 2; sym1__ <= nind; ++sym1__) { current_statement__ = 3; @@ -24852,7 +25473,8 @@ class lcm_fails2_model final : public model_base_crtp { rvalue(phi, "phi", index_uni(sym1__), index_uni(sym2__)), 1); } - } } + } + } } current_statement__ = 4; if (lcm_sym89__) { @@ -24869,7 +25491,8 @@ class lcm_fails2_model final : public model_base_crtp { current_statement__ = 4; check_greater_or_equal(function__, "p[sym1__, sym2__]", rvalue(p, "p", - index_uni(1), index_uni(sym2__)), 0);} + index_uni(1), index_uni(sym2__)), 0); + } } for (int sym1__ = 2; sym1__ <= nind; ++sym1__) { current_statement__ = 4; @@ -24885,8 +25508,10 @@ class lcm_fails2_model final : public model_base_crtp { check_greater_or_equal(function__, "p[sym1__, sym2__]", rvalue(p, "p", index_uni(sym1__), index_uni(sym2__)), - 0);} - } } + 0); + } + } + } } current_statement__ = 4; if (lcm_sym89__) { @@ -24902,7 +25527,8 @@ class lcm_fails2_model final : public model_base_crtp { current_statement__ = 4; check_less_or_equal(function__, "p[sym1__, sym2__]", rvalue(p, "p", - index_uni(1), index_uni(sym2__)), 1);} + index_uni(1), index_uni(sym2__)), 1); + } } for (int sym1__ = 2; sym1__ <= nind; ++sym1__) { current_statement__ = 4; @@ -24919,7 +25545,8 @@ class lcm_fails2_model final : public model_base_crtp { rvalue(p, "p", index_uni(sym1__), index_uni(sym2__)), 1); } - } } + } + } } current_statement__ = 5; if (lcm_sym89__) { @@ -24935,7 +25562,8 @@ class lcm_fails2_model final : public model_base_crtp { current_statement__ = 5; check_greater_or_equal(function__, "chi[sym1__, sym2__]", rvalue(inline_sym9__, "inline_sym9__", - index_uni(1), index_uni(sym2__)), 0);} + index_uni(1), index_uni(sym2__)), 0); + } } for (int sym1__ = 2; sym1__ <= nind; ++sym1__) { current_statement__ = 5; @@ -24951,8 +25579,10 @@ class lcm_fails2_model final : public model_base_crtp { check_greater_or_equal(function__, "chi[sym1__, sym2__]", rvalue(inline_sym9__, "inline_sym9__", index_uni(sym1__), index_uni(sym2__)), - 0);} - } } + 0); + } + } + } } current_statement__ = 5; if (lcm_sym89__) { @@ -24968,7 +25598,8 @@ class lcm_fails2_model final : public model_base_crtp { current_statement__ = 5; check_less_or_equal(function__, "chi[sym1__, sym2__]", rvalue(inline_sym9__, "inline_sym9__", - index_uni(1), index_uni(sym2__)), 1);} + index_uni(1), index_uni(sym2__)), 1); + } } for (int sym1__ = 2; sym1__ <= nind; ++sym1__) { current_statement__ = 5; @@ -24985,7 +25616,8 @@ class lcm_fails2_model final : public model_base_crtp { rvalue(inline_sym9__, "inline_sym9__", index_uni(sym1__), index_uni(sym2__)), 1); } - } } + } + } } { current_statement__ = 30; @@ -25014,7 +25646,8 @@ class lcm_fails2_model final : public model_base_crtp { lp_accum__.add( bernoulli_lpmf( rvalue(y, "y", index_uni(1), index_uni(t)), - rvalue(p, "p", index_uni(1), index_uni((t - 1)))));} + rvalue(p, "p", index_uni(1), index_uni((t - 1))))); + } } current_statement__ = 27; lp_accum__.add( @@ -25048,14 +25681,16 @@ class lcm_fails2_model final : public model_base_crtp { lp_accum__.add( bernoulli_lpmf( rvalue(y, "y", index_uni(i), index_uni(t)), - rvalue(p, "p", index_uni(i), index_uni((t - 1)))));} + rvalue(p, "p", index_uni(i), index_uni((t - 1))))); + } } current_statement__ = 27; lp_accum__.add( bernoulli_lpmf(1, rvalue(inline_sym9__, "inline_sym9__", index_uni(i), index_uni(lcm_sym127__)))); - } } + } + } } } } catch (const std::exception& e) { @@ -25133,28 +25768,28 @@ class lcm_fails2_model final : public model_base_crtp { int lcm_sym47__; int lcm_sym46__; double mean_phi; - mean_phi = std::numeric_limits::quiet_NaN(); + mean_phi = std::numeric_limits::quiet_NaN(); current_statement__ = 1; mean_phi = in__.template read_constrain_lub( 0, 1, lp__); double mean_p; - mean_p = std::numeric_limits::quiet_NaN(); + mean_p = std::numeric_limits::quiet_NaN(); current_statement__ = 2; mean_p = in__.template read_constrain_lub( 0, 1, lp__); Eigen::Matrix phi; phi = Eigen::Matrix(nind, (n_occasions - 1)); - stan::math::fill(phi, std::numeric_limits::quiet_NaN()); + stan::math::fill(phi, std::numeric_limits::quiet_NaN()); Eigen::Matrix p; p = Eigen::Matrix(nind, (n_occasions - 1)); - stan::math::fill(p, std::numeric_limits::quiet_NaN()); + stan::math::fill(p, std::numeric_limits::quiet_NaN()); Eigen::Matrix chi; chi = Eigen::Matrix(nind, n_occasions); - stan::math::fill(chi, DUMMY_VAR__); + stan::math::fill(chi, DUMMY_VAR__); vars__.emplace_back(mean_phi); vars__.emplace_back(mean_p); @@ -25193,7 +25828,8 @@ class lcm_fails2_model final : public model_base_crtp { "assigning variable phi", index_uni(1), index_uni(t)); current_statement__ = 10; assign(p, mean_p, - "assigning variable p", index_uni(1), index_uni(t));} + "assigning variable p", index_uni(1), index_uni(t)); + } } for (int i = 2; i <= nind; ++i) { lcm_sym65__ = rvalue(first, "first", index_uni(i)); @@ -25226,12 +25862,14 @@ class lcm_fails2_model final : public model_base_crtp { "assigning variable phi", index_uni(i), index_uni(t)); current_statement__ = 10; assign(p, mean_p, - "assigning variable p", index_uni(i), index_uni(t));} - } } + "assigning variable p", index_uni(i), index_uni(t)); + } + } + } } Eigen::Matrix inline_sym1__; int inline_sym7__; - inline_sym7__ = std::numeric_limits::min(); + inline_sym7__ = std::numeric_limits::min(); inline_sym7__ = 0; for (int inline_sym8__ = 1; inline_sym8__ <= 1; ++inline_sym8__) { @@ -25241,7 +25879,7 @@ class lcm_fails2_model final : public model_base_crtp { validate_non_negative_index("chi", "n_occasions", n_occasions); Eigen::Matrix inline_sym2__; inline_sym2__ = Eigen::Matrix(nind, n_occasions); - stan::math::fill(inline_sym2__, DUMMY_VAR__); + stan::math::fill(inline_sym2__, DUMMY_VAR__); for (int inline_sym6__ = 1; inline_sym6__ <= nind; ++inline_sym6__) { current_statement__ = 17; @@ -25251,10 +25889,10 @@ class lcm_fails2_model final : public model_base_crtp { lcm_sym54__ = (n_occasions - 1); if (logical_gte(lcm_sym54__, 1)) { int inline_sym3__; - inline_sym3__ = std::numeric_limits::min(); + inline_sym3__ = std::numeric_limits::min(); int inline_sym4__; - inline_sym4__ = std::numeric_limits::min(); + inline_sym4__ = std::numeric_limits::min(); lcm_sym60__ = (lcm_sym54__ + 1); current_statement__ = 20; @@ -25275,11 +25913,11 @@ class lcm_fails2_model final : public model_base_crtp { for (int inline_sym5__ = 2; inline_sym5__ <= lcm_sym54__; ++inline_sym5__) { int inline_sym3__; - inline_sym3__ = std::numeric_limits::min(); + inline_sym3__ = std::numeric_limits::min(); lcm_sym53__ = (n_occasions - inline_sym5__); int inline_sym4__; - inline_sym4__ = std::numeric_limits::min(); + inline_sym4__ = std::numeric_limits::min(); lcm_sym59__ = (lcm_sym53__ + 1); current_statement__ = 20; @@ -25302,14 +25940,16 @@ class lcm_fails2_model final : public model_base_crtp { } if (inline_sym7__) { break; - } } + } + } if (inline_sym7__) { break; } inline_sym7__ = 1; assign(inline_sym1__, inline_sym2__, "assigning variable inline_sym1__"); - break;} + break; + } assign(chi, inline_sym1__, "assigning variable chi"); current_statement__ = 3; if (lcm_sym47__) { @@ -25326,7 +25966,8 @@ class lcm_fails2_model final : public model_base_crtp { current_statement__ = 3; check_greater_or_equal(function__, "phi[sym1__, sym2__]", rvalue(phi, "phi", - index_uni(1), index_uni(sym2__)), 0);} + index_uni(1), index_uni(sym2__)), 0); + } } for (int sym1__ = 2; sym1__ <= nind; ++sym1__) { current_statement__ = 3; @@ -25342,8 +25983,10 @@ class lcm_fails2_model final : public model_base_crtp { check_greater_or_equal(function__, "phi[sym1__, sym2__]", rvalue(phi, "phi", index_uni(sym1__), index_uni(sym2__)), - 0);} - } } + 0); + } + } + } } current_statement__ = 3; if (lcm_sym47__) { @@ -25360,7 +26003,8 @@ class lcm_fails2_model final : public model_base_crtp { current_statement__ = 3; check_less_or_equal(function__, "phi[sym1__, sym2__]", rvalue(phi, "phi", - index_uni(1), index_uni(sym2__)), 1);} + index_uni(1), index_uni(sym2__)), 1); + } } for (int sym1__ = 2; sym1__ <= nind; ++sym1__) { current_statement__ = 3; @@ -25377,7 +26021,8 @@ class lcm_fails2_model final : public model_base_crtp { rvalue(phi, "phi", index_uni(sym1__), index_uni(sym2__)), 1); } - } } + } + } } current_statement__ = 4; if (lcm_sym47__) { @@ -25394,7 +26039,8 @@ class lcm_fails2_model final : public model_base_crtp { current_statement__ = 4; check_greater_or_equal(function__, "p[sym1__, sym2__]", rvalue(p, "p", - index_uni(1), index_uni(sym2__)), 0);} + index_uni(1), index_uni(sym2__)), 0); + } } for (int sym1__ = 2; sym1__ <= nind; ++sym1__) { current_statement__ = 4; @@ -25410,8 +26056,10 @@ class lcm_fails2_model final : public model_base_crtp { check_greater_or_equal(function__, "p[sym1__, sym2__]", rvalue(p, "p", index_uni(sym1__), index_uni(sym2__)), - 0);} - } } + 0); + } + } + } } current_statement__ = 4; if (lcm_sym47__) { @@ -25427,7 +26075,8 @@ class lcm_fails2_model final : public model_base_crtp { current_statement__ = 4; check_less_or_equal(function__, "p[sym1__, sym2__]", rvalue(p, "p", - index_uni(1), index_uni(sym2__)), 1);} + index_uni(1), index_uni(sym2__)), 1); + } } for (int sym1__ = 2; sym1__ <= nind; ++sym1__) { current_statement__ = 4; @@ -25444,7 +26093,8 @@ class lcm_fails2_model final : public model_base_crtp { rvalue(p, "p", index_uni(sym1__), index_uni(sym2__)), 1); } - } } + } + } } current_statement__ = 5; if (lcm_sym47__) { @@ -25460,7 +26110,8 @@ class lcm_fails2_model final : public model_base_crtp { current_statement__ = 5; check_greater_or_equal(function__, "chi[sym1__, sym2__]", rvalue(inline_sym1__, "inline_sym1__", - index_uni(1), index_uni(sym2__)), 0);} + index_uni(1), index_uni(sym2__)), 0); + } } for (int sym1__ = 2; sym1__ <= nind; ++sym1__) { current_statement__ = 5; @@ -25476,8 +26127,10 @@ class lcm_fails2_model final : public model_base_crtp { check_greater_or_equal(function__, "chi[sym1__, sym2__]", rvalue(inline_sym1__, "inline_sym1__", index_uni(sym1__), index_uni(sym2__)), - 0);} - } } + 0); + } + } + } } current_statement__ = 5; if (lcm_sym47__) { @@ -25493,7 +26146,8 @@ class lcm_fails2_model final : public model_base_crtp { current_statement__ = 5; check_less_or_equal(function__, "chi[sym1__, sym2__]", rvalue(inline_sym1__, "inline_sym1__", - index_uni(1), index_uni(sym2__)), 1);} + index_uni(1), index_uni(sym2__)), 1); + } } for (int sym1__ = 2; sym1__ <= nind; ++sym1__) { current_statement__ = 5; @@ -25510,7 +26164,8 @@ class lcm_fails2_model final : public model_base_crtp { rvalue(inline_sym1__, "inline_sym1__", index_uni(sym1__), index_uni(sym2__)), 1); } - } } + } + } } if (emit_transformed_parameters__) { lcm_sym54__ = (n_occasions - 1); @@ -25521,7 +26176,8 @@ class lcm_fails2_model final : public model_base_crtp { rvalue(phi, "phi", index_uni(1), index_uni(1))); for (int sym2__ = 2; sym2__ <= nind; ++sym2__) { vars__.emplace_back( - rvalue(phi, "phi", index_uni(sym2__), index_uni(1)));} + rvalue(phi, "phi", index_uni(sym2__), index_uni(1))); + } } for (int sym1__ = 2; sym1__ <= lcm_sym54__; ++sym1__) { if (lcm_sym47__) { @@ -25529,15 +26185,18 @@ class lcm_fails2_model final : public model_base_crtp { rvalue(phi, "phi", index_uni(1), index_uni(sym1__))); for (int sym2__ = 2; sym2__ <= nind; ++sym2__) { vars__.emplace_back( - rvalue(phi, "phi", index_uni(sym2__), index_uni(sym1__)));} - } } + rvalue(phi, "phi", index_uni(sym2__), index_uni(sym1__))); + } + } + } } if (lcm_sym48__) { if (lcm_sym47__) { vars__.emplace_back(rvalue(p, "p", index_uni(1), index_uni(1))); for (int sym2__ = 2; sym2__ <= nind; ++sym2__) { vars__.emplace_back( - rvalue(p, "p", index_uni(sym2__), index_uni(1)));} + rvalue(p, "p", index_uni(sym2__), index_uni(1))); + } } for (int sym1__ = 2; sym1__ <= lcm_sym54__; ++sym1__) { if (lcm_sym47__) { @@ -25545,8 +26204,10 @@ class lcm_fails2_model final : public model_base_crtp { rvalue(p, "p", index_uni(1), index_uni(sym1__))); for (int sym2__ = 2; sym2__ <= nind; ++sym2__) { vars__.emplace_back( - rvalue(p, "p", index_uni(sym2__), index_uni(sym1__)));} - } } + rvalue(p, "p", index_uni(sym2__), index_uni(sym1__))); + } + } + } } if (logical_gte(n_occasions, 1)) { if (lcm_sym47__) { @@ -25556,7 +26217,8 @@ class lcm_fails2_model final : public model_base_crtp { for (int sym2__ = 2; sym2__ <= nind; ++sym2__) { vars__.emplace_back( rvalue(inline_sym1__, "inline_sym1__", - index_uni(sym2__), index_uni(1)));} + index_uni(sym2__), index_uni(1))); + } } for (int sym1__ = 2; sym1__ <= n_occasions; ++sym1__) { if (lcm_sym47__) { @@ -25566,8 +26228,10 @@ class lcm_fails2_model final : public model_base_crtp { for (int sym2__ = 2; sym2__ <= nind; ++sym2__) { vars__.emplace_back( rvalue(inline_sym1__, "inline_sym1__", - index_uni(sym2__), index_uni(sym1__)));} - } } + index_uni(sym2__), index_uni(sym1__))); + } + } + } } } if (logical_negation(emit_generated_quantities__)) { @@ -25593,26 +26257,26 @@ class lcm_fails2_model final : public model_base_crtp { try { int pos__; - pos__ = std::numeric_limits::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; double mean_phi; - mean_phi = std::numeric_limits::quiet_NaN(); + mean_phi = std::numeric_limits::quiet_NaN(); current_statement__ = 1; mean_phi = context__.vals_r("mean_phi")[(1 - 1)]; double mean_phi_free__; - mean_phi_free__ = std::numeric_limits::quiet_NaN(); + mean_phi_free__ = std::numeric_limits::quiet_NaN(); current_statement__ = 1; mean_phi_free__ = stan::math::lub_free(mean_phi, 0, 1); double mean_p; - mean_p = std::numeric_limits::quiet_NaN(); + mean_p = std::numeric_limits::quiet_NaN(); current_statement__ = 2; mean_p = context__.vals_r("mean_p")[(1 - 1)]; double mean_p_free__; - mean_p_free__ = std::numeric_limits::quiet_NaN(); + mean_p_free__ = std::numeric_limits::quiet_NaN(); current_statement__ = 2; mean_p_free__ = stan::math::lub_free(mean_p, 0, 1); @@ -25627,23 +26291,22 @@ class lcm_fails2_model final : public model_base_crtp { inline void get_param_names(std::vector& names__) const { - names__ = std::vector{"mean_phi", - "mean_p", - "phi", - "p", - "chi"}; + names__ = std::vector{"mean_phi", "mean_p", "phi", "p", + "chi"}; + } // get_param_names() inline void get_dims(std::vector>& dimss__) const { dimss__ = std::vector>{std::vector{}, - std::vector{}, - std::vector{static_cast(nind), - static_cast(n_occ_minus_1)}, - std::vector{static_cast(nind), - static_cast(n_occ_minus_1)}, - std::vector{static_cast(nind), - static_cast(n_occasions)}}; + std::vector{}, + std::vector{static_cast(nind), + static_cast(n_occ_minus_1)}, + std::vector{static_cast(nind), + static_cast(n_occ_minus_1)}, + std::vector{static_cast(nind), + static_cast(n_occasions)}}; + } // get_dims() inline void constrained_param_names( @@ -25660,22 +26323,28 @@ class lcm_fails2_model final : public model_base_crtp { for (int sym162__ = 1; sym162__ <= nind; ++sym162__) { { param_names__.emplace_back(std::string() + "phi" + '.' + std::to_string(sym162__) + '.' + std::to_string(sym161__)); - }} - }} + } + } + } + } for (int sym161__ = 1; sym161__ <= n_occ_minus_1; ++sym161__) { { for (int sym162__ = 1; sym162__ <= nind; ++sym162__) { { param_names__.emplace_back(std::string() + "p" + '.' + std::to_string(sym162__) + '.' + std::to_string(sym161__)); - }} - }} + } + } + } + } for (int sym161__ = 1; sym161__ <= n_occasions; ++sym161__) { { for (int sym162__ = 1; sym162__ <= nind; ++sym162__) { { param_names__.emplace_back(std::string() + "chi" + '.' + std::to_string(sym162__) + '.' + std::to_string(sym161__)); - }} - }} + } + } + } + } } if (emit_generated_quantities__) { @@ -25698,22 +26367,28 @@ class lcm_fails2_model final : public model_base_crtp { for (int sym162__ = 1; sym162__ <= nind; ++sym162__) { { param_names__.emplace_back(std::string() + "phi" + '.' + std::to_string(sym162__) + '.' + std::to_string(sym161__)); - }} - }} + } + } + } + } for (int sym161__ = 1; sym161__ <= n_occ_minus_1; ++sym161__) { { for (int sym162__ = 1; sym162__ <= nind; ++sym162__) { { param_names__.emplace_back(std::string() + "p" + '.' + std::to_string(sym162__) + '.' + std::to_string(sym161__)); - }} - }} + } + } + } + } for (int sym161__ = 1; sym161__ <= n_occasions; ++sym161__) { { for (int sym162__ = 1; sym162__ <= nind; ++sym162__) { { param_names__.emplace_back(std::string() + "chi" + '.' + std::to_string(sym162__) + '.' + std::to_string(sym161__)); - }} - }} + } + } + } + } } if (emit_generated_quantities__) { @@ -25722,14 +26397,16 @@ class lcm_fails2_model final : public model_base_crtp { } // unconstrained_param_names() - inline std::string get_constrained_sizedtypes() const final { + inline std::string get_constrained_sizedtypes() const { + + return std::string("[{\"name\":\"mean_phi\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"mean_p\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"phi\",\"type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(nind) + ",\"cols\":" + std::to_string(n_occ_minus_1) + "},\"block\":\"transformed_parameters\"},{\"name\":\"p\",\"type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(nind) + ",\"cols\":" + std::to_string(n_occ_minus_1) + "},\"block\":\"transformed_parameters\"},{\"name\":\"chi\",\"type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(nind) + ",\"cols\":" + std::to_string(n_occasions) + "},\"block\":\"transformed_parameters\"}]"); - return std::string("[{\"name\":\"mean_phi\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"mean_p\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"phi\",\"type\":{\"name\":\"matrix\",\"rows\":" << nind << ",\"cols\":" << n_occ_minus_1 << "},\"block\":\"transformed_parameters\"},{\"name\":\"p\",\"type\":{\"name\":\"matrix\",\"rows\":" << nind << ",\"cols\":" << n_occ_minus_1 << "},\"block\":\"transformed_parameters\"},{\"name\":\"chi\",\"type\":{\"name\":\"matrix\",\"rows\":" << nind << ",\"cols\":" << n_occasions << "},\"block\":\"transformed_parameters\"}]"); } // get_constrained_sizedtypes() - inline std::string get_unconstrained_sizedtypes() const final { + inline std::string get_unconstrained_sizedtypes() const { + + return std::string("[{\"name\":\"mean_phi\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"mean_p\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"phi\",\"type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(nind) + ",\"cols\":" + std::to_string(n_occ_minus_1) + "},\"block\":\"transformed_parameters\"},{\"name\":\"p\",\"type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(nind) + ",\"cols\":" + std::to_string(n_occ_minus_1) + "},\"block\":\"transformed_parameters\"},{\"name\":\"chi\",\"type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(nind) + ",\"cols\":" + std::to_string(n_occasions) + "},\"block\":\"transformed_parameters\"}]"); - return std::string("[{\"name\":\"mean_phi\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"mean_p\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"phi\",\"type\":{\"name\":\"matrix\",\"rows\":" << nind << ",\"cols\":" << n_occ_minus_1 << "},\"block\":\"transformed_parameters\"},{\"name\":\"p\",\"type\":{\"name\":\"matrix\",\"rows\":" << nind << ",\"cols\":" << n_occ_minus_1 << "},\"block\":\"transformed_parameters\"},{\"name\":\"chi\",\"type\":{\"name\":\"matrix\",\"rows\":" << nind << ",\"cols\":" << n_occasions << "},\"block\":\"transformed_parameters\"}]"); } // get_unconstrained_sizedtypes() @@ -25741,14 +26418,13 @@ class lcm_fails2_model final : public model_base_crtp { const bool emit_transformed_parameters = true, const bool emit_generated_quantities = true, std::ostream* pstream = nullptr) const { - std::vector vars_vec(vars.size()); + std::vector vars_vec; + vars_vec.reserve(vars.size()); std::vector params_i; write_array_impl(base_rng, params_r, params_i, vars_vec, emit_transformed_parameters, emit_generated_quantities, pstream); - vars.resize(vars_vec.size()); - for (int i = 0; i < vars.size(); ++i) { - vars.coeffRef(i) = vars_vec[i]; - } + vars = Eigen::Map>( + vars_vec.data(), vars_vec.size()); } template @@ -25758,7 +26434,8 @@ class lcm_fails2_model final : public model_base_crtp { bool emit_transformed_parameters = true, bool emit_generated_quantities = true, std::ostream* pstream = nullptr) const { - write_array_impl(base_rng, params_r, params_i, vars, emit_transformed_parameters, emit_generated_quantities, pstream); + write_array_impl(base_rng, params_r, params_i, vars, + emit_transformed_parameters, emit_generated_quantities, pstream); } template @@ -25779,13 +26456,12 @@ class lcm_fails2_model final : public model_base_crtp { inline void transform_inits(const stan::io::var_context& context, Eigen::Matrix& params_r, std::ostream* pstream = nullptr) const final { - std::vector params_r_vec(params_r.size()); + std::vector params_r_vec; + params_r_vec.reserve(params_r.size()); std::vector params_i; transform_inits_impl(context, params_i, params_r_vec, pstream); - params_r.resize(params_r_vec.size()); - for (int i = 0; i < params_r.size(); ++i) { - params_r.coeffRef(i) = params_r_vec[i]; - } + params_r = Eigen::Map>( + params_r_vec.data(), params_r_vec.size()); } inline void transform_inits(const stan::io::var_context& context, std::vector& params_i, @@ -25974,13 +26650,13 @@ class lupdf_inlining_model final : public model_base_crtp (void) DUMMY_VAR__; // suppress unused var warning try { int pos__; - pos__ = std::numeric_limits::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; current_statement__ = 9; context__.validate_dims("data initialization","n","int", - context__.to_vec()); - n = std::numeric_limits::min(); + std::vector{}); + n = std::numeric_limits::min(); current_statement__ = 9; n = context__.vals_i("n")[(1 - 1)]; @@ -25989,15 +26665,8 @@ class lupdf_inlining_model final : public model_base_crtp // Next line prevents compiler griping about no return throw std::runtime_error("*** IF YOU SEE THIS, PLEASE REPORT A BUG ***"); } - num_params_r__ = 0U; + num_params_r__ = 1; - try { - num_params_r__ += 1; - } catch (const std::exception& e) { - stan::lang::rethrow_located(e, locations_array__[current_statement__]); - // Next line prevents compiler griping about no return - throw std::runtime_error("*** IF YOU SEE THIS, PLEASE REPORT A BUG ***"); - } } template double lcm_sym46__; double lcm_sym45__; local_scalar_t__ mu; - mu = DUMMY_VAR__; + mu = DUMMY_VAR__; current_statement__ = 1; mu = in__.template read(); local_scalar_t__ tp; - tp = DUMMY_VAR__; + tp = DUMMY_VAR__; local_scalar_t__ inline_sym25__; int inline_sym26__; - inline_sym26__ = std::numeric_limits::min(); + inline_sym26__ = std::numeric_limits::min(); for (int inline_sym27__ = 1; inline_sym27__ <= 1; ++inline_sym27__) { inline_sym25__ = normal_lpdf(mu, 1.0, 1); - break;} + break; + } tp = inline_sym25__; { local_scalar_t__ inline_sym28__; int inline_sym32__; - inline_sym32__ = std::numeric_limits::min(); + inline_sym32__ = std::numeric_limits::min(); inline_sym32__ = 0; for (int inline_sym33__ = 1; inline_sym33__ <= 1; ++inline_sym33__) { local_scalar_t__ inline_sym29__; int inline_sym30__; - inline_sym30__ = std::numeric_limits::min(); + inline_sym30__ = std::numeric_limits::min(); for (int inline_sym31__ = 1; inline_sym31__ <= 1; ++inline_sym31__) { inline_sym29__ = normal_lpdf(mu, 0.5, 1); - break;} + break; + } if (inline_sym32__) { break; } inline_sym32__ = 1; inline_sym28__ = inline_sym29__; - break;} + break; + } lp_accum__.add(inline_sym28__); local_scalar_t__ inline_sym34__; int inline_sym35__; - inline_sym35__ = std::numeric_limits::min(); + inline_sym35__ = std::numeric_limits::min(); for (int inline_sym36__ = 1; inline_sym36__ <= 1; ++inline_sym36__) { inline_sym34__ = poisson_lpmf(n, mu); - break;} + break; + } lp_accum__.add(inline_sym34__); } } catch (const std::exception& e) { @@ -26105,12 +26778,12 @@ class lupdf_inlining_model final : public model_base_crtp int lcm_sym41__; int lcm_sym40__; double mu; - mu = std::numeric_limits::quiet_NaN(); + mu = std::numeric_limits::quiet_NaN(); current_statement__ = 1; mu = in__.template read(); double tp; - tp = std::numeric_limits::quiet_NaN(); + tp = std::numeric_limits::quiet_NaN(); vars__.emplace_back(mu); if (logical_negation((primitive_value(emit_transformed_parameters__) || @@ -26119,11 +26792,12 @@ class lupdf_inlining_model final : public model_base_crtp } double inline_sym13__; int inline_sym14__; - inline_sym14__ = std::numeric_limits::min(); + inline_sym14__ = std::numeric_limits::min(); for (int inline_sym15__ = 1; inline_sym15__ <= 1; ++inline_sym15__) { inline_sym13__ = normal_lpdf(mu, 1.0, 1); - break;} + break; + } tp = inline_sym13__; if (emit_transformed_parameters__) { vars__.emplace_back(inline_sym13__); @@ -26132,38 +26806,41 @@ class lupdf_inlining_model final : public model_base_crtp return ; } double lbaz; - lbaz = std::numeric_limits::quiet_NaN(); + lbaz = std::numeric_limits::quiet_NaN(); double inline_sym16__; int inline_sym20__; - inline_sym20__ = std::numeric_limits::min(); + inline_sym20__ = std::numeric_limits::min(); inline_sym20__ = 0; for (int inline_sym21__ = 1; inline_sym21__ <= 1; ++inline_sym21__) { double inline_sym17__; int inline_sym18__; - inline_sym18__ = std::numeric_limits::min(); + inline_sym18__ = std::numeric_limits::min(); for (int inline_sym19__ = 1; inline_sym19__ <= 1; ++inline_sym19__) { inline_sym17__ = normal_lpdf(mu, 0.5, 1); - break;} + break; + } if (inline_sym20__) { break; } inline_sym20__ = 1; inline_sym16__ = inline_sym17__; - break;} + break; + } lbaz = inline_sym16__; double lbar; - lbar = std::numeric_limits::quiet_NaN(); + lbar = std::numeric_limits::quiet_NaN(); double inline_sym22__; int inline_sym23__; - inline_sym23__ = std::numeric_limits::min(); + inline_sym23__ = std::numeric_limits::min(); for (int inline_sym24__ = 1; inline_sym24__ <= 1; ++inline_sym24__) { inline_sym22__ = poisson_lpmf(n, mu); - break;} + break; + } lbar = inline_sym22__; vars__.emplace_back(inline_sym16__); vars__.emplace_back(inline_sym22__); @@ -26187,11 +26864,11 @@ class lupdf_inlining_model final : public model_base_crtp try { int pos__; - pos__ = std::numeric_limits::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; double mu; - mu = std::numeric_limits::quiet_NaN(); + mu = std::numeric_limits::quiet_NaN(); current_statement__ = 1; mu = context__.vals_r("mu")[(1 - 1)]; @@ -26205,18 +26882,16 @@ class lupdf_inlining_model final : public model_base_crtp inline void get_param_names(std::vector& names__) const { - names__ = std::vector{"mu", - "tp", - "lbaz", - "lbar"}; + names__ = std::vector{"mu", "tp", "lbaz", "lbar"}; + } // get_param_names() inline void get_dims(std::vector>& dimss__) const { dimss__ = std::vector>{std::vector{}, - std::vector{}, - std::vector{}, - std::vector{}}; + std::vector{}, std::vector{}, std::vector{ + }}; + } // get_dims() inline void constrained_param_names( @@ -26255,14 +26930,16 @@ class lupdf_inlining_model final : public model_base_crtp } // unconstrained_param_names() - inline std::string get_constrained_sizedtypes() const final { + inline std::string get_constrained_sizedtypes() const { return std::string("[{\"name\":\"mu\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"tp\",\"type\":{\"name\":\"real\"},\"block\":\"transformed_parameters\"},{\"name\":\"lbaz\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"lbar\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"}]"); + } // get_constrained_sizedtypes() - inline std::string get_unconstrained_sizedtypes() const final { + inline std::string get_unconstrained_sizedtypes() const { return std::string("[{\"name\":\"mu\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"tp\",\"type\":{\"name\":\"real\"},\"block\":\"transformed_parameters\"},{\"name\":\"lbaz\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"lbar\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"}]"); + } // get_unconstrained_sizedtypes() @@ -26274,14 +26951,13 @@ class lupdf_inlining_model final : public model_base_crtp const bool emit_transformed_parameters = true, const bool emit_generated_quantities = true, std::ostream* pstream = nullptr) const { - std::vector vars_vec(vars.size()); + std::vector vars_vec; + vars_vec.reserve(vars.size()); std::vector params_i; write_array_impl(base_rng, params_r, params_i, vars_vec, emit_transformed_parameters, emit_generated_quantities, pstream); - vars.resize(vars_vec.size()); - for (int i = 0; i < vars.size(); ++i) { - vars.coeffRef(i) = vars_vec[i]; - } + vars = Eigen::Map>( + vars_vec.data(), vars_vec.size()); } template @@ -26291,7 +26967,8 @@ class lupdf_inlining_model final : public model_base_crtp bool emit_transformed_parameters = true, bool emit_generated_quantities = true, std::ostream* pstream = nullptr) const { - write_array_impl(base_rng, params_r, params_i, vars, emit_transformed_parameters, emit_generated_quantities, pstream); + write_array_impl(base_rng, params_r, params_i, vars, + emit_transformed_parameters, emit_generated_quantities, pstream); } template @@ -26312,13 +26989,12 @@ class lupdf_inlining_model final : public model_base_crtp inline void transform_inits(const stan::io::var_context& context, Eigen::Matrix& params_r, std::ostream* pstream = nullptr) const final { - std::vector params_r_vec(params_r.size()); + std::vector params_r_vec; + params_r_vec.reserve(params_r.size()); std::vector params_i; transform_inits_impl(context, params_i, params_r_vec, pstream); - params_r.resize(params_r_vec.size()); - for (int i = 0; i < params_r.size(); ++i) { - params_r.coeffRef(i) = params_r_vec[i]; - } + params_r = Eigen::Map>( + params_r_vec.data(), params_r_vec.size()); } inline void transform_inits(const stan::io::var_context& context, std::vector& params_i, @@ -26494,13 +27170,13 @@ class off_dce_model final : public model_base_crtp { int pos__; - pos__ = std::numeric_limits::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; current_statement__ = 31; context__.validate_dims("data initialization","R","int", - context__.to_vec()); - R = std::numeric_limits::min(); + std::vector{}); + R = std::numeric_limits::min(); current_statement__ = 31; R = context__.vals_i("R")[(1 - 1)]; @@ -26509,8 +27185,8 @@ class off_dce_model final : public model_base_crtp { check_greater_or_equal(function__, "R", R, 1); current_statement__ = 32; context__.validate_dims("data initialization","T","int", - context__.to_vec()); - T = std::numeric_limits::min(); + std::vector{}); + T = std::numeric_limits::min(); current_statement__ = 32; T = context__.vals_i("T")[(1 - 1)]; @@ -26523,8 +27199,10 @@ class off_dce_model final : public model_base_crtp { validate_non_negative_index("y", "T", T); current_statement__ = 35; context__.validate_dims("data initialization","y","int", - context__.to_vec(R, T)); + std::vector{static_cast(R), + static_cast(T)}); y = std::vector>(R, std::vector(T, std::numeric_limits::min())); + { std::vector y_flat__; @@ -26547,7 +27225,8 @@ class off_dce_model final : public model_base_crtp { assign(y, y_flat__[(pos__ - 1)], "assigning variable y", index_uni(sym2__), index_uni(1)); current_statement__ = 35; - pos__ = (pos__ + 1);} + pos__ = (pos__ + 1); + } } for (int sym1__ = 2; sym1__ <= T; ++sym1__) { current_statement__ = 35; @@ -26563,8 +27242,10 @@ class off_dce_model final : public model_base_crtp { "assigning variable y", index_uni(sym2__), index_uni(sym1__)); current_statement__ = 35; - pos__ = (pos__ + 1);} - } } + pos__ = (pos__ + 1); + } + } + } } } else { lcm_sym41__ = logical_gte(R, 1); @@ -26584,7 +27265,8 @@ class off_dce_model final : public model_base_crtp { current_statement__ = 35; check_greater_or_equal(function__, "y[sym1__, sym2__]", rvalue(y, "y", - index_uni(1), index_uni(sym2__)), 0);} + index_uni(1), index_uni(sym2__)), 0); + } } for (int sym1__ = 2; sym1__ <= R; ++sym1__) { current_statement__ = 35; @@ -26598,8 +27280,10 @@ class off_dce_model final : public model_base_crtp { current_statement__ = 35; current_statement__ = 35; check_greater_or_equal(function__, "y[sym1__, sym2__]", - y[(sym1__ - 1)][(sym2__ - 1)], 0);} - } } + y[(sym1__ - 1)][(sym2__ - 1)], 0); + } + } + } } current_statement__ = 35; if (lcm_sym41__) { @@ -26614,7 +27298,8 @@ class off_dce_model final : public model_base_crtp { current_statement__ = 35; check_less_or_equal(function__, "y[sym1__, sym2__]", rvalue(y, "y", - index_uni(1), index_uni(sym2__)), 1);} + index_uni(1), index_uni(sym2__)), 1); + } } for (int sym1__ = 2; sym1__ <= R; ++sym1__) { current_statement__ = 35; @@ -26628,16 +27313,18 @@ class off_dce_model final : public model_base_crtp { current_statement__ = 35; current_statement__ = 35; check_less_or_equal(function__, "y[sym1__, sym2__]", - y[(sym1__ - 1)][(sym2__ - 1)], 1);} - } } + y[(sym1__ - 1)][(sym2__ - 1)], 1); + } + } + } } current_statement__ = 36; validate_non_negative_index("X", "R", R); current_statement__ = 37; context__.validate_dims("data initialization","X","double", - context__.to_vec(R)); + std::vector{static_cast(R)}); X = Eigen::Matrix(R); - stan::math::fill(X, std::numeric_limits::quiet_NaN()); + stan::math::fill(X, std::numeric_limits::quiet_NaN()); { std::vector X_flat__; @@ -26657,16 +27344,15 @@ class off_dce_model final : public model_base_crtp { assign(X, X_flat__[(pos__ - 1)], "assigning variable X", index_uni(sym1__)); current_statement__ = 37; - pos__ = (pos__ + 1);} + pos__ = (pos__ + 1); + } } } current_statement__ = 38; validate_non_negative_index("sum_y", "R", R); current_statement__ = 39; - sum_y = std::vector(R, std::numeric_limits::min()); current_statement__ = 40; - occ_obs = std::numeric_limits::min(); current_statement__ = 41; occ_obs = 0; @@ -26688,7 +27374,8 @@ class off_dce_model final : public model_base_crtp { if (rvalue(sum_y, "sum_y", index_uni(i))) { current_statement__ = 43; occ_obs = (occ_obs + 1); - } } + } + } } current_statement__ = 39; if (lcm_sym41__) { @@ -26700,7 +27387,8 @@ class off_dce_model final : public model_base_crtp { current_statement__ = 39; current_statement__ = 39; check_greater_or_equal(function__, "sum_y[sym1__]", - sum_y[(sym1__ - 1)], 0);} + sum_y[(sym1__ - 1)], 0); + } } current_statement__ = 39; if (lcm_sym41__) { @@ -26712,7 +27400,8 @@ class off_dce_model final : public model_base_crtp { current_statement__ = 39; current_statement__ = 39; check_less_or_equal(function__, "sum_y[sym1__]", - sum_y[(sym1__ - 1)], T);} + sum_y[(sym1__ - 1)], T); + } } current_statement__ = 40; current_statement__ = 40; @@ -26735,18 +27424,8 @@ class off_dce_model final : public model_base_crtp { // Next line prevents compiler griping about no return throw std::runtime_error("*** IF YOU SEE THIS, PLEASE REPORT A BUG ***"); } - num_params_r__ = 0U; + num_params_r__ = 1 + 1 + 1 + 1; - try { - num_params_r__ += 1; - num_params_r__ += 1; - num_params_r__ += 1; - num_params_r__ += 1; - } catch (const std::exception& e) { - stan::lang::rethrow_located(e, locations_array__[current_statement__]); - // Next line prevents compiler griping about no return - throw std::runtime_error("*** IF YOU SEE THIS, PLEASE REPORT A BUG ***"); - } } template { Eigen::Matrix lcm_sym31__; int lcm_sym30__; local_scalar_t__ alpha_occ; - alpha_occ = DUMMY_VAR__; + alpha_occ = DUMMY_VAR__; current_statement__ = 1; alpha_occ = in__.template read(); local_scalar_t__ beta_occ; - beta_occ = DUMMY_VAR__; + beta_occ = DUMMY_VAR__; current_statement__ = 2; beta_occ = in__.template read(); local_scalar_t__ alpha_p; - alpha_p = DUMMY_VAR__; + alpha_p = DUMMY_VAR__; current_statement__ = 3; alpha_p = in__.template read(); local_scalar_t__ beta_p; - beta_p = DUMMY_VAR__; + beta_p = DUMMY_VAR__; current_statement__ = 4; beta_p = in__.template read(); Eigen::Matrix logit_psi; logit_psi = Eigen::Matrix(R); - stan::math::fill(logit_psi, DUMMY_VAR__); + stan::math::fill(logit_psi, DUMMY_VAR__); Eigen::Matrix logit_p; logit_p = Eigen::Matrix(R, T); - stan::math::fill(logit_p, DUMMY_VAR__); + stan::math::fill(logit_p, DUMMY_VAR__); assign(lcm_sym31__, add(alpha_occ, multiply(beta_occ, X)), "assigning variable lcm_sym31__"); @@ -26857,7 +27536,8 @@ class off_dce_model final : public model_base_crtp { rvalue(lcm_sym38__, "lcm_sym38__", index_uni(i)))), bernoulli_logit_lpmf(0, rvalue(lcm_sym31__, "lcm_sym31__", index_uni(i))))); - }} + } + } } } } catch (const std::exception& e) { @@ -26921,32 +27601,32 @@ class off_dce_model final : public model_base_crtp { double lcm_sym2__; double lcm_sym1__; double alpha_occ; - alpha_occ = std::numeric_limits::quiet_NaN(); + alpha_occ = std::numeric_limits::quiet_NaN(); current_statement__ = 1; alpha_occ = in__.template read(); double beta_occ; - beta_occ = std::numeric_limits::quiet_NaN(); + beta_occ = std::numeric_limits::quiet_NaN(); current_statement__ = 2; beta_occ = in__.template read(); double alpha_p; - alpha_p = std::numeric_limits::quiet_NaN(); + alpha_p = std::numeric_limits::quiet_NaN(); current_statement__ = 3; alpha_p = in__.template read(); double beta_p; - beta_p = std::numeric_limits::quiet_NaN(); + beta_p = std::numeric_limits::quiet_NaN(); current_statement__ = 4; beta_p = in__.template read(); Eigen::Matrix logit_psi; logit_psi = Eigen::Matrix(R); - stan::math::fill(logit_psi, std::numeric_limits::quiet_NaN()); + stan::math::fill(logit_psi, std::numeric_limits::quiet_NaN()); Eigen::Matrix logit_p; logit_p = Eigen::Matrix(R, T); - stan::math::fill(logit_p, std::numeric_limits::quiet_NaN()); + stan::math::fill(logit_p, std::numeric_limits::quiet_NaN()); vars__.emplace_back(alpha_occ); vars__.emplace_back(beta_occ); @@ -26969,7 +27649,8 @@ class off_dce_model final : public model_base_crtp { vars__.emplace_back( rvalue(lcm_sym9__, "lcm_sym9__", index_uni(1))); for (int sym1__ = 2; sym1__ <= R; ++sym1__) { - vars__.emplace_back(lcm_sym9__[(sym1__ - 1)]);} + vars__.emplace_back(lcm_sym9__[(sym1__ - 1)]); + } } if (logical_gte(T, 1)) { if (lcm_sym5__) { @@ -26979,7 +27660,8 @@ class off_dce_model final : public model_base_crtp { for (int sym2__ = 2; sym2__ <= R; ++sym2__) { vars__.emplace_back( rvalue(lcm_sym18__, "lcm_sym18__", - index_uni(sym2__), index_uni(1)));} + index_uni(sym2__), index_uni(1))); + } } for (int sym1__ = 2; sym1__ <= T; ++sym1__) { if (lcm_sym5__) { @@ -26989,8 +27671,10 @@ class off_dce_model final : public model_base_crtp { for (int sym2__ = 2; sym2__ <= R; ++sym2__) { vars__.emplace_back( rvalue(lcm_sym18__, "lcm_sym18__", - index_uni(sym2__), index_uni(sym1__)));} - } } + index_uni(sym2__), index_uni(sym1__))); + } + } + } } } } else { @@ -27000,20 +27684,21 @@ class off_dce_model final : public model_base_crtp { return ; } int occ_fs; - occ_fs = std::numeric_limits::min(); + occ_fs = std::numeric_limits::min(); std::vector psi_con; psi_con = std::vector(R, std::numeric_limits::quiet_NaN()); + std::vector z; - z = std::vector(R, std::numeric_limits::min()); + z = std::vector(R, std::numeric_limits::min()); current_statement__ = 22; if (lcm_sym5__) { current_statement__ = 20; if (logical_eq(rvalue(sum_y, "sum_y", index_uni(1)), 0)) { double psi; - psi = std::numeric_limits::quiet_NaN(); + psi = std::numeric_limits::quiet_NaN(); lcm_sym25__ = rvalue(lcm_sym9__, "lcm_sym9__", index_uni(1)); lcm_sym15__ = inv_logit(lcm_sym25__); @@ -27021,7 +27706,7 @@ class off_dce_model final : public model_base_crtp { validate_non_negative_index("q", "T", T); Eigen::Matrix q; q = Eigen::Matrix(T); - stan::math::fill(q, std::numeric_limits::quiet_NaN()); + stan::math::fill(q, std::numeric_limits::quiet_NaN()); assign(lcm_sym11__, transpose( @@ -27029,7 +27714,7 @@ class off_dce_model final : public model_base_crtp { minus(rvalue(lcm_sym18__, "lcm_sym18__", index_uni(1))))), "assigning variable lcm_sym11__"); double qT; - qT = std::numeric_limits::quiet_NaN(); + qT = std::numeric_limits::quiet_NaN(); lcm_sym17__ = prod(lcm_sym11__); current_statement__ = 17; @@ -27051,7 +27736,7 @@ class off_dce_model final : public model_base_crtp { current_statement__ = 20; if (logical_eq(rvalue(sum_y, "sum_y", index_uni(i)), 0)) { double psi; - psi = std::numeric_limits::quiet_NaN(); + psi = std::numeric_limits::quiet_NaN(); lcm_sym14__ = inv_logit( rvalue(lcm_sym9__, "lcm_sym9__", index_uni(i))); @@ -27059,7 +27744,7 @@ class off_dce_model final : public model_base_crtp { validate_non_negative_index("q", "T", T); Eigen::Matrix q; q = Eigen::Matrix(T); - stan::math::fill(q, std::numeric_limits::quiet_NaN()); + stan::math::fill(q, std::numeric_limits::quiet_NaN()); assign(lcm_sym10__, transpose( @@ -27067,7 +27752,7 @@ class off_dce_model final : public model_base_crtp { minus(rvalue(lcm_sym18__, "lcm_sym18__", index_uni(i))))), "assigning variable lcm_sym10__"); double qT; - qT = std::numeric_limits::quiet_NaN(); + qT = std::numeric_limits::quiet_NaN(); lcm_sym16__ = prod(lcm_sym10__); current_statement__ = 17; @@ -27084,7 +27769,8 @@ class off_dce_model final : public model_base_crtp { assign(psi_con, 1, "assigning variable psi_con", index_uni(i)); current_statement__ = 11; assign(z, 1, "assigning variable z", index_uni(i)); - }} + } + } } lcm_sym19__ = sum(z); occ_fs = lcm_sym19__; @@ -27092,12 +27778,14 @@ class off_dce_model final : public model_base_crtp { if (lcm_sym5__) { vars__.emplace_back(rvalue(psi_con, "psi_con", index_uni(1))); for (int sym1__ = 2; sym1__ <= R; ++sym1__) { - vars__.emplace_back(psi_con[(sym1__ - 1)]);} + vars__.emplace_back(psi_con[(sym1__ - 1)]); + } } if (lcm_sym5__) { vars__.emplace_back(rvalue(z, "z", index_uni(1))); for (int sym1__ = 2; sym1__ <= R; ++sym1__) { - vars__.emplace_back(z[(sym1__ - 1)]);} + vars__.emplace_back(z[(sym1__ - 1)]); + } } } catch (const std::exception& e) { stan::lang::rethrow_located(e, locations_array__[current_statement__]); @@ -27119,26 +27807,26 @@ class off_dce_model final : public model_base_crtp { try { int pos__; - pos__ = std::numeric_limits::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; double alpha_occ; - alpha_occ = std::numeric_limits::quiet_NaN(); + alpha_occ = std::numeric_limits::quiet_NaN(); current_statement__ = 1; alpha_occ = context__.vals_r("alpha_occ")[(1 - 1)]; double beta_occ; - beta_occ = std::numeric_limits::quiet_NaN(); + beta_occ = std::numeric_limits::quiet_NaN(); current_statement__ = 2; beta_occ = context__.vals_r("beta_occ")[(1 - 1)]; double alpha_p; - alpha_p = std::numeric_limits::quiet_NaN(); + alpha_p = std::numeric_limits::quiet_NaN(); current_statement__ = 3; alpha_p = context__.vals_r("alpha_p")[(1 - 1)]; double beta_p; - beta_p = std::numeric_limits::quiet_NaN(); + beta_p = std::numeric_limits::quiet_NaN(); current_statement__ = 4; beta_p = context__.vals_r("beta_p")[(1 - 1)]; @@ -27155,28 +27843,20 @@ class off_dce_model final : public model_base_crtp { inline void get_param_names(std::vector& names__) const { - names__ = std::vector{"alpha_occ", - "beta_occ", - "alpha_p", - "beta_p", - "logit_psi", - "logit_p", - "occ_fs", - "psi_con", - "z"}; + names__ = std::vector{"alpha_occ", "beta_occ", "alpha_p", + "beta_p", "logit_psi", "logit_p", "occ_fs", "psi_con", "z"}; + } // get_param_names() inline void get_dims(std::vector>& dimss__) const { dimss__ = std::vector>{std::vector{}, - std::vector{}, - std::vector{}, - std::vector{}, - std::vector{static_cast(R)}, - std::vector{static_cast(R), static_cast(T)}, - std::vector{}, - std::vector{static_cast(R)}, - std::vector{static_cast(R)}}; + std::vector{}, std::vector{}, std::vector{ + }, std::vector{static_cast(R)}, + std::vector{static_cast(R), static_cast(T)}, + std::vector{}, std::vector{static_cast(R)}, + std::vector{static_cast(R)}}; + } // get_dims() inline void constrained_param_names( @@ -27193,14 +27873,17 @@ class off_dce_model final : public model_base_crtp { for (int sym58__ = 1; sym58__ <= R; ++sym58__) { { param_names__.emplace_back(std::string() + "logit_psi" + '.' + std::to_string(sym58__)); - }} + } + } for (int sym58__ = 1; sym58__ <= T; ++sym58__) { { for (int sym59__ = 1; sym59__ <= R; ++sym59__) { { param_names__.emplace_back(std::string() + "logit_p" + '.' + std::to_string(sym59__) + '.' + std::to_string(sym58__)); - }} - }} + } + } + } + } } if (emit_generated_quantities__) { @@ -27208,11 +27891,13 @@ class off_dce_model final : public model_base_crtp { for (int sym58__ = 1; sym58__ <= R; ++sym58__) { { param_names__.emplace_back(std::string() + "psi_con" + '.' + std::to_string(sym58__)); - }} + } + } for (int sym58__ = 1; sym58__ <= R; ++sym58__) { { param_names__.emplace_back(std::string() + "z" + '.' + std::to_string(sym58__)); - }} + } + } } } // constrained_param_names() @@ -27231,14 +27916,17 @@ class off_dce_model final : public model_base_crtp { for (int sym58__ = 1; sym58__ <= R; ++sym58__) { { param_names__.emplace_back(std::string() + "logit_psi" + '.' + std::to_string(sym58__)); - }} + } + } for (int sym58__ = 1; sym58__ <= T; ++sym58__) { { for (int sym59__ = 1; sym59__ <= R; ++sym59__) { { param_names__.emplace_back(std::string() + "logit_p" + '.' + std::to_string(sym59__) + '.' + std::to_string(sym58__)); - }} - }} + } + } + } + } } if (emit_generated_quantities__) { @@ -27246,23 +27934,27 @@ class off_dce_model final : public model_base_crtp { for (int sym58__ = 1; sym58__ <= R; ++sym58__) { { param_names__.emplace_back(std::string() + "psi_con" + '.' + std::to_string(sym58__)); - }} + } + } for (int sym58__ = 1; sym58__ <= R; ++sym58__) { { param_names__.emplace_back(std::string() + "z" + '.' + std::to_string(sym58__)); - }} + } + } } } // unconstrained_param_names() - inline std::string get_constrained_sizedtypes() const final { + inline std::string get_constrained_sizedtypes() const { + + return std::string("[{\"name\":\"alpha_occ\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"beta_occ\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"alpha_p\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"beta_p\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"logit_psi\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(R) + "},\"block\":\"transformed_parameters\"},{\"name\":\"logit_p\",\"type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(R) + ",\"cols\":" + std::to_string(T) + "},\"block\":\"transformed_parameters\"},{\"name\":\"occ_fs\",\"type\":{\"name\":\"int\"},\"block\":\"generated_quantities\"},{\"name\":\"psi_con\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(R) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"generated_quantities\"},{\"name\":\"z\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(R) + ",\"element_type\":{\"name\":\"int\"}},\"block\":\"generated_quantities\"}]"); - return std::string("[{\"name\":\"alpha_occ\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"beta_occ\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"alpha_p\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"beta_p\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"logit_psi\",\"type\":{\"name\":\"vector\",\"length\":" << R << "},\"block\":\"transformed_parameters\"},{\"name\":\"logit_p\",\"type\":{\"name\":\"matrix\",\"rows\":" << R << ",\"cols\":" << T << "},\"block\":\"transformed_parameters\"},{\"name\":\"occ_fs\",\"type\":{\"name\":\"int\"},\"block\":\"generated_quantities\"},{\"name\":\"psi_con\",\"type\":{\"name\":\"array\",\"length\":" << R << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"generated_quantities\"},{\"name\":\"z\",\"type\":{\"name\":\"array\",\"length\":" << R << ",\"element_type\":{\"name\":\"int\"}},\"block\":\"generated_quantities\"}]"); } // get_constrained_sizedtypes() - inline std::string get_unconstrained_sizedtypes() const final { + inline std::string get_unconstrained_sizedtypes() const { + + return std::string("[{\"name\":\"alpha_occ\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"beta_occ\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"alpha_p\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"beta_p\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"logit_psi\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(R) + "},\"block\":\"transformed_parameters\"},{\"name\":\"logit_p\",\"type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(R) + ",\"cols\":" + std::to_string(T) + "},\"block\":\"transformed_parameters\"},{\"name\":\"occ_fs\",\"type\":{\"name\":\"int\"},\"block\":\"generated_quantities\"},{\"name\":\"psi_con\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(R) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"generated_quantities\"},{\"name\":\"z\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(R) + ",\"element_type\":{\"name\":\"int\"}},\"block\":\"generated_quantities\"}]"); - return std::string("[{\"name\":\"alpha_occ\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"beta_occ\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"alpha_p\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"beta_p\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"logit_psi\",\"type\":{\"name\":\"vector\",\"length\":" << R << "},\"block\":\"transformed_parameters\"},{\"name\":\"logit_p\",\"type\":{\"name\":\"matrix\",\"rows\":" << R << ",\"cols\":" << T << "},\"block\":\"transformed_parameters\"},{\"name\":\"occ_fs\",\"type\":{\"name\":\"int\"},\"block\":\"generated_quantities\"},{\"name\":\"psi_con\",\"type\":{\"name\":\"array\",\"length\":" << R << ",\"element_type\":{\"name\":\"real\"}},\"block\":\"generated_quantities\"},{\"name\":\"z\",\"type\":{\"name\":\"array\",\"length\":" << R << ",\"element_type\":{\"name\":\"int\"}},\"block\":\"generated_quantities\"}]"); } // get_unconstrained_sizedtypes() @@ -27274,14 +27966,13 @@ class off_dce_model final : public model_base_crtp { const bool emit_transformed_parameters = true, const bool emit_generated_quantities = true, std::ostream* pstream = nullptr) const { - std::vector vars_vec(vars.size()); + std::vector vars_vec; + vars_vec.reserve(vars.size()); std::vector params_i; write_array_impl(base_rng, params_r, params_i, vars_vec, emit_transformed_parameters, emit_generated_quantities, pstream); - vars.resize(vars_vec.size()); - for (int i = 0; i < vars.size(); ++i) { - vars.coeffRef(i) = vars_vec[i]; - } + vars = Eigen::Map>( + vars_vec.data(), vars_vec.size()); } template @@ -27291,7 +27982,8 @@ class off_dce_model final : public model_base_crtp { bool emit_transformed_parameters = true, bool emit_generated_quantities = true, std::ostream* pstream = nullptr) const { - write_array_impl(base_rng, params_r, params_i, vars, emit_transformed_parameters, emit_generated_quantities, pstream); + write_array_impl(base_rng, params_r, params_i, vars, + emit_transformed_parameters, emit_generated_quantities, pstream); } template @@ -27312,13 +28004,12 @@ class off_dce_model final : public model_base_crtp { inline void transform_inits(const stan::io::var_context& context, Eigen::Matrix& params_r, std::ostream* pstream = nullptr) const final { - std::vector params_r_vec(params_r.size()); + std::vector params_r_vec; + params_r_vec.reserve(params_r.size()); std::vector params_i; transform_inits_impl(context, params_i, params_r_vec, pstream); - params_r.resize(params_r_vec.size()); - for (int i = 0; i < params_r.size(); ++i) { - params_r.coeffRef(i) = params_r_vec[i]; - } + params_r = Eigen::Map>( + params_r_vec.data(), params_r_vec.size()); } inline void transform_inits(const stan::io::var_context& context, std::vector& params_i, @@ -27463,13 +28154,13 @@ class off_small_model final : public model_base_crtp { int pos__; - pos__ = std::numeric_limits::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; current_statement__ = 20; context__.validate_dims("data initialization","J","int", - context__.to_vec()); - J = std::numeric_limits::min(); + std::vector{}); + J = std::numeric_limits::min(); current_statement__ = 20; J = context__.vals_i("J")[(1 - 1)]; @@ -27478,8 +28169,8 @@ class off_small_model final : public model_base_crtp { check_greater_or_equal(function__, "J", J, 0); current_statement__ = 21; context__.validate_dims("data initialization","N","int", - context__.to_vec()); - N = std::numeric_limits::min(); + std::vector{}); + N = std::numeric_limits::min(); current_statement__ = 21; N = context__.vals_i("N")[(1 - 1)]; @@ -27490,8 +28181,8 @@ class off_small_model final : public model_base_crtp { validate_non_negative_index("person", "N", N); current_statement__ = 23; context__.validate_dims("data initialization","person","int", - context__.to_vec(N)); - person = std::vector(N, std::numeric_limits::min()); + std::vector{static_cast(N)}); + person = std::vector(N, std::numeric_limits::min()); current_statement__ = 23; person = context__.vals_i("person"); @@ -27505,7 +28196,8 @@ class off_small_model final : public model_base_crtp { current_statement__ = 23; current_statement__ = 23; check_greater_or_equal(function__, "person[sym1__]", - person[(sym1__ - 1)], 1);} + person[(sym1__ - 1)], 1); + } } current_statement__ = 23; if (lcm_sym40__) { @@ -27517,15 +28209,16 @@ class off_small_model final : public model_base_crtp { current_statement__ = 23; current_statement__ = 23; check_less_or_equal(function__, "person[sym1__]", - person[(sym1__ - 1)], J);} + person[(sym1__ - 1)], J); + } } current_statement__ = 24; validate_non_negative_index("time", "N", N); current_statement__ = 25; context__.validate_dims("data initialization","time","double", - context__.to_vec(N)); + std::vector{static_cast(N)}); time = Eigen::Matrix(N); - stan::math::fill(time, std::numeric_limits::quiet_NaN()); + stan::math::fill(time, std::numeric_limits::quiet_NaN()); { std::vector time_flat__; @@ -27545,16 +28238,17 @@ class off_small_model final : public model_base_crtp { assign(time, time_flat__[(pos__ - 1)], "assigning variable time", index_uni(sym1__)); current_statement__ = 25; - pos__ = (pos__ + 1);} + pos__ = (pos__ + 1); + } } } current_statement__ = 26; validate_non_negative_index("treatment", "N", N); current_statement__ = 27; context__.validate_dims("data initialization","treatment","double", - context__.to_vec(N)); + std::vector{static_cast(N)}); treatment = Eigen::Matrix(N); - stan::math::fill(treatment, std::numeric_limits::quiet_NaN()); + stan::math::fill(treatment, std::numeric_limits::quiet_NaN()); { std::vector treatment_flat__; @@ -27575,16 +28269,17 @@ class off_small_model final : public model_base_crtp { assign(treatment, treatment_flat__[(pos__ - 1)], "assigning variable treatment", index_uni(sym1__)); current_statement__ = 27; - pos__ = (pos__ + 1);} + pos__ = (pos__ + 1); + } } } current_statement__ = 28; validate_non_negative_index("y", "N", N); current_statement__ = 29; context__.validate_dims("data initialization","y","double", - context__.to_vec(N)); + std::vector{static_cast(N)}); y = Eigen::Matrix(N); - stan::math::fill(y, std::numeric_limits::quiet_NaN()); + stan::math::fill(y, std::numeric_limits::quiet_NaN()); { std::vector y_flat__; @@ -27604,7 +28299,8 @@ class off_small_model final : public model_base_crtp { assign(y, y_flat__[(pos__ - 1)], "assigning variable y", index_uni(sym1__)); current_statement__ = 29; - pos__ = (pos__ + 1);} + pos__ = (pos__ + 1); + } } } current_statement__ = 30; @@ -27622,22 +28318,8 @@ class off_small_model final : public model_base_crtp { // Next line prevents compiler griping about no return throw std::runtime_error("*** IF YOU SEE THIS, PLEASE REPORT A BUG ***"); } - num_params_r__ = 0U; + num_params_r__ = 1 + J + J + 1 + 1 + 1 + 1 + 1; - try { - num_params_r__ += 1; - num_params_r__ += J; - num_params_r__ += J; - num_params_r__ += 1; - num_params_r__ += 1; - num_params_r__ += 1; - num_params_r__ += 1; - num_params_r__ += 1; - } catch (const std::exception& e) { - stan::lang::rethrow_located(e, locations_array__[current_statement__]); - // Next line prevents compiler griping about no return - throw std::runtime_error("*** IF YOU SEE THIS, PLEASE REPORT A BUG ***"); - } } template { Eigen::Matrix lcm_sym30__; int lcm_sym29__; local_scalar_t__ beta; - beta = DUMMY_VAR__; + beta = DUMMY_VAR__; current_statement__ = 1; beta = in__.template read(); Eigen::Matrix eta1; eta1 = Eigen::Matrix(J); - stan::math::fill(eta1, DUMMY_VAR__); + stan::math::fill(eta1, DUMMY_VAR__); current_statement__ = 2; eta1 = in__.template read>(J); Eigen::Matrix eta2; eta2 = Eigen::Matrix(J); - stan::math::fill(eta2, DUMMY_VAR__); + stan::math::fill(eta2, DUMMY_VAR__); current_statement__ = 3; eta2 = in__.template read>(J); local_scalar_t__ mu_a1; - mu_a1 = DUMMY_VAR__; + mu_a1 = DUMMY_VAR__; current_statement__ = 4; mu_a1 = in__.template read(); local_scalar_t__ mu_a2; - mu_a2 = DUMMY_VAR__; + mu_a2 = DUMMY_VAR__; current_statement__ = 5; mu_a2 = in__.template read(); local_scalar_t__ sigma_a1; - sigma_a1 = DUMMY_VAR__; + sigma_a1 = DUMMY_VAR__; current_statement__ = 6; sigma_a1 = in__.template read_constrain_lub( 0, 100, lp__); local_scalar_t__ sigma_a2; - sigma_a2 = DUMMY_VAR__; + sigma_a2 = DUMMY_VAR__; current_statement__ = 7; sigma_a2 = in__.template read_constrain_lub( 0, 100, lp__); local_scalar_t__ sigma_y; - sigma_y = DUMMY_VAR__; + sigma_y = DUMMY_VAR__; current_statement__ = 8; sigma_y = in__.template read_constrain_lub( 0, 100, lp__); Eigen::Matrix a1; a1 = Eigen::Matrix(J); - stan::math::fill(a1, DUMMY_VAR__); + stan::math::fill(a1, DUMMY_VAR__); Eigen::Matrix a2; a2 = Eigen::Matrix(J); - stan::math::fill(a2, DUMMY_VAR__); + stan::math::fill(a2, DUMMY_VAR__); Eigen::Matrix y_hat; y_hat = Eigen::Matrix(N); - stan::math::fill(y_hat, DUMMY_VAR__); + stan::math::fill(y_hat, DUMMY_VAR__); assign(lcm_sym30__, add((10 * mu_a1), multiply(sigma_a1, eta1)), "assigning variable lcm_sym30__"); @@ -27756,7 +28438,8 @@ class off_small_model final : public model_base_crtp { rvalue(treatment, "treatment", index_uni(i)), rvalue(lcm_sym30__, "lcm_sym30__", index_uni(rvalue(person, "person", index_uni(i)))))), - "assigning variable y_hat", index_uni(i));} + "assigning variable y_hat", index_uni(i)); + } } { current_statement__ = 14; @@ -27823,73 +28506,75 @@ class off_small_model final : public model_base_crtp { int lcm_sym12__; int lcm_sym11__; double beta; - beta = std::numeric_limits::quiet_NaN(); + beta = std::numeric_limits::quiet_NaN(); current_statement__ = 1; beta = in__.template read(); Eigen::Matrix eta1; eta1 = Eigen::Matrix(J); - stan::math::fill(eta1, std::numeric_limits::quiet_NaN()); + stan::math::fill(eta1, std::numeric_limits::quiet_NaN()); current_statement__ = 2; eta1 = in__.template read>(J); Eigen::Matrix eta2; eta2 = Eigen::Matrix(J); - stan::math::fill(eta2, std::numeric_limits::quiet_NaN()); + stan::math::fill(eta2, std::numeric_limits::quiet_NaN()); current_statement__ = 3; eta2 = in__.template read>(J); double mu_a1; - mu_a1 = std::numeric_limits::quiet_NaN(); + mu_a1 = std::numeric_limits::quiet_NaN(); current_statement__ = 4; mu_a1 = in__.template read(); double mu_a2; - mu_a2 = std::numeric_limits::quiet_NaN(); + mu_a2 = std::numeric_limits::quiet_NaN(); current_statement__ = 5; mu_a2 = in__.template read(); double sigma_a1; - sigma_a1 = std::numeric_limits::quiet_NaN(); + sigma_a1 = std::numeric_limits::quiet_NaN(); current_statement__ = 6; sigma_a1 = in__.template read_constrain_lub( 0, 100, lp__); double sigma_a2; - sigma_a2 = std::numeric_limits::quiet_NaN(); + sigma_a2 = std::numeric_limits::quiet_NaN(); current_statement__ = 7; sigma_a2 = in__.template read_constrain_lub( 0, 100, lp__); double sigma_y; - sigma_y = std::numeric_limits::quiet_NaN(); + sigma_y = std::numeric_limits::quiet_NaN(); current_statement__ = 8; sigma_y = in__.template read_constrain_lub( 0, 100, lp__); Eigen::Matrix a1; a1 = Eigen::Matrix(J); - stan::math::fill(a1, std::numeric_limits::quiet_NaN()); + stan::math::fill(a1, std::numeric_limits::quiet_NaN()); Eigen::Matrix a2; a2 = Eigen::Matrix(J); - stan::math::fill(a2, std::numeric_limits::quiet_NaN()); + stan::math::fill(a2, std::numeric_limits::quiet_NaN()); Eigen::Matrix y_hat; y_hat = Eigen::Matrix(N); - stan::math::fill(y_hat, DUMMY_VAR__); + stan::math::fill(y_hat, DUMMY_VAR__); vars__.emplace_back(beta); lcm_sym11__ = logical_gte(J, 1); if (lcm_sym11__) { vars__.emplace_back(rvalue(eta1, "eta1", index_uni(1))); for (int sym1__ = 2; sym1__ <= J; ++sym1__) { - vars__.emplace_back(eta1[(sym1__ - 1)]);} + vars__.emplace_back(eta1[(sym1__ - 1)]); + } } if (lcm_sym11__) { vars__.emplace_back(rvalue(eta2, "eta2", index_uni(1))); for (int sym1__ = 2; sym1__ <= J; ++sym1__) { - vars__.emplace_back(eta2[(sym1__ - 1)]);} + vars__.emplace_back(eta2[(sym1__ - 1)]); + } } vars__.emplace_back(mu_a1); vars__.emplace_back(mu_a2); @@ -27930,25 +28615,29 @@ class off_small_model final : public model_base_crtp { rvalue(treatment, "treatment", index_uni(i)), rvalue(lcm_sym15__, "lcm_sym15__", index_uni(rvalue(person, "person", index_uni(i)))))), - "assigning variable y_hat", index_uni(i));} + "assigning variable y_hat", index_uni(i)); + } } if (emit_transformed_parameters__) { if (lcm_sym11__) { vars__.emplace_back( rvalue(lcm_sym15__, "lcm_sym15__", index_uni(1))); for (int sym1__ = 2; sym1__ <= J; ++sym1__) { - vars__.emplace_back(lcm_sym15__[(sym1__ - 1)]);} + vars__.emplace_back(lcm_sym15__[(sym1__ - 1)]); + } } if (lcm_sym11__) { vars__.emplace_back( rvalue(lcm_sym16__, "lcm_sym16__", index_uni(1))); for (int sym1__ = 2; sym1__ <= J; ++sym1__) { - vars__.emplace_back(lcm_sym16__[(sym1__ - 1)]);} + vars__.emplace_back(lcm_sym16__[(sym1__ - 1)]); + } } if (lcm_sym12__) { vars__.emplace_back(rvalue(y_hat, "y_hat", index_uni(1))); for (int sym1__ = 2; sym1__ <= N; ++sym1__) { - vars__.emplace_back(y_hat[(sym1__ - 1)]);} + vars__.emplace_back(y_hat[(sym1__ - 1)]); + } } } if (logical_negation(emit_generated_quantities__)) { @@ -27984,17 +28673,17 @@ class off_small_model final : public model_base_crtp { int lcm_sym2__; int lcm_sym1__; int pos__; - pos__ = std::numeric_limits::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; double beta; - beta = std::numeric_limits::quiet_NaN(); + beta = std::numeric_limits::quiet_NaN(); current_statement__ = 1; beta = context__.vals_r("beta")[(1 - 1)]; Eigen::Matrix eta1; eta1 = Eigen::Matrix(J); - stan::math::fill(eta1, std::numeric_limits::quiet_NaN()); + stan::math::fill(eta1, std::numeric_limits::quiet_NaN()); { std::vector eta1_flat__; @@ -28014,12 +28703,13 @@ class off_small_model final : public model_base_crtp { assign(eta1, eta1_flat__[(pos__ - 1)], "assigning variable eta1", index_uni(sym1__)); current_statement__ = 2; - pos__ = (pos__ + 1);} + pos__ = (pos__ + 1); + } } } Eigen::Matrix eta2; eta2 = Eigen::Matrix(J); - stan::math::fill(eta2, std::numeric_limits::quiet_NaN()); + stan::math::fill(eta2, std::numeric_limits::quiet_NaN()); { std::vector eta2_flat__; @@ -28039,46 +28729,47 @@ class off_small_model final : public model_base_crtp { assign(eta2, eta2_flat__[(pos__ - 1)], "assigning variable eta2", index_uni(sym1__)); current_statement__ = 3; - pos__ = (pos__ + 1);} + pos__ = (pos__ + 1); + } } } double mu_a1; - mu_a1 = std::numeric_limits::quiet_NaN(); + mu_a1 = std::numeric_limits::quiet_NaN(); current_statement__ = 4; mu_a1 = context__.vals_r("mu_a1")[(1 - 1)]; double mu_a2; - mu_a2 = std::numeric_limits::quiet_NaN(); + mu_a2 = std::numeric_limits::quiet_NaN(); current_statement__ = 5; mu_a2 = context__.vals_r("mu_a2")[(1 - 1)]; double sigma_a1; - sigma_a1 = std::numeric_limits::quiet_NaN(); + sigma_a1 = std::numeric_limits::quiet_NaN(); current_statement__ = 6; sigma_a1 = context__.vals_r("sigma_a1")[(1 - 1)]; double sigma_a1_free__; - sigma_a1_free__ = std::numeric_limits::quiet_NaN(); + sigma_a1_free__ = std::numeric_limits::quiet_NaN(); current_statement__ = 6; sigma_a1_free__ = stan::math::lub_free(sigma_a1, 0, 100); double sigma_a2; - sigma_a2 = std::numeric_limits::quiet_NaN(); + sigma_a2 = std::numeric_limits::quiet_NaN(); current_statement__ = 7; sigma_a2 = context__.vals_r("sigma_a2")[(1 - 1)]; double sigma_a2_free__; - sigma_a2_free__ = std::numeric_limits::quiet_NaN(); + sigma_a2_free__ = std::numeric_limits::quiet_NaN(); current_statement__ = 7; sigma_a2_free__ = stan::math::lub_free(sigma_a2, 0, 100); double sigma_y; - sigma_y = std::numeric_limits::quiet_NaN(); + sigma_y = std::numeric_limits::quiet_NaN(); current_statement__ = 8; sigma_y = context__.vals_r("sigma_y")[(1 - 1)]; double sigma_y_free__; - sigma_y_free__ = std::numeric_limits::quiet_NaN(); + sigma_y_free__ = std::numeric_limits::quiet_NaN(); current_statement__ = 8; sigma_y_free__ = stan::math::lub_free(sigma_y, 0, 100); @@ -28086,12 +28777,14 @@ class off_small_model final : public model_base_crtp { if (lcm_sym1__) { vars__.emplace_back(rvalue(eta1, "eta1", index_uni(1))); for (int sym1__ = 2; sym1__ <= J; ++sym1__) { - vars__.emplace_back(eta1[(sym1__ - 1)]);} + vars__.emplace_back(eta1[(sym1__ - 1)]); + } } if (lcm_sym1__) { vars__.emplace_back(rvalue(eta2, "eta2", index_uni(1))); for (int sym1__ = 2; sym1__ <= J; ++sym1__) { - vars__.emplace_back(eta2[(sym1__ - 1)]);} + vars__.emplace_back(eta2[(sym1__ - 1)]); + } } vars__.emplace_back(mu_a1); vars__.emplace_back(mu_a2); @@ -28107,32 +28800,21 @@ class off_small_model final : public model_base_crtp { inline void get_param_names(std::vector& names__) const { - names__ = std::vector{"beta", - "eta1", - "eta2", - "mu_a1", - "mu_a2", - "sigma_a1", - "sigma_a2", - "sigma_y", - "a1", - "a2", - "y_hat"}; + names__ = std::vector{"beta", "eta1", "eta2", "mu_a1", + "mu_a2", "sigma_a1", "sigma_a2", "sigma_y", "a1", "a2", "y_hat"}; + } // get_param_names() inline void get_dims(std::vector>& dimss__) const { dimss__ = std::vector>{std::vector{}, - std::vector{static_cast(J)}, - std::vector{static_cast(J)}, - std::vector{}, - std::vector{}, - std::vector{}, - std::vector{}, - std::vector{}, - std::vector{static_cast(J)}, - std::vector{static_cast(J)}, - std::vector{static_cast(N)}}; + std::vector{static_cast(J)}, + std::vector{static_cast(J)}, std::vector{ + }, std::vector{}, std::vector{}, std::vector{ + }, std::vector{}, std::vector{static_cast(J)}, + std::vector{static_cast(J)}, + std::vector{static_cast(N)}}; + } // get_dims() inline void constrained_param_names( @@ -28145,11 +28827,13 @@ class off_small_model final : public model_base_crtp { for (int sym50__ = 1; sym50__ <= J; ++sym50__) { { param_names__.emplace_back(std::string() + "eta1" + '.' + std::to_string(sym50__)); - }} + } + } for (int sym50__ = 1; sym50__ <= J; ++sym50__) { { param_names__.emplace_back(std::string() + "eta2" + '.' + std::to_string(sym50__)); - }} + } + } param_names__.emplace_back(std::string() + "mu_a1"); param_names__.emplace_back(std::string() + "mu_a2"); param_names__.emplace_back(std::string() + "sigma_a1"); @@ -28159,15 +28843,18 @@ class off_small_model final : public model_base_crtp { for (int sym50__ = 1; sym50__ <= J; ++sym50__) { { param_names__.emplace_back(std::string() + "a1" + '.' + std::to_string(sym50__)); - }} + } + } for (int sym50__ = 1; sym50__ <= J; ++sym50__) { { param_names__.emplace_back(std::string() + "a2" + '.' + std::to_string(sym50__)); - }} + } + } for (int sym50__ = 1; sym50__ <= N; ++sym50__) { { param_names__.emplace_back(std::string() + "y_hat" + '.' + std::to_string(sym50__)); - }} + } + } } if (emit_generated_quantities__) { @@ -28186,11 +28873,13 @@ class off_small_model final : public model_base_crtp { for (int sym50__ = 1; sym50__ <= J; ++sym50__) { { param_names__.emplace_back(std::string() + "eta1" + '.' + std::to_string(sym50__)); - }} + } + } for (int sym50__ = 1; sym50__ <= J; ++sym50__) { { param_names__.emplace_back(std::string() + "eta2" + '.' + std::to_string(sym50__)); - }} + } + } param_names__.emplace_back(std::string() + "mu_a1"); param_names__.emplace_back(std::string() + "mu_a2"); param_names__.emplace_back(std::string() + "sigma_a1"); @@ -28200,15 +28889,18 @@ class off_small_model final : public model_base_crtp { for (int sym50__ = 1; sym50__ <= J; ++sym50__) { { param_names__.emplace_back(std::string() + "a1" + '.' + std::to_string(sym50__)); - }} + } + } for (int sym50__ = 1; sym50__ <= J; ++sym50__) { { param_names__.emplace_back(std::string() + "a2" + '.' + std::to_string(sym50__)); - }} + } + } for (int sym50__ = 1; sym50__ <= N; ++sym50__) { { param_names__.emplace_back(std::string() + "y_hat" + '.' + std::to_string(sym50__)); - }} + } + } } if (emit_generated_quantities__) { @@ -28217,14 +28909,16 @@ class off_small_model final : public model_base_crtp { } // unconstrained_param_names() - inline std::string get_constrained_sizedtypes() const final { + inline std::string get_constrained_sizedtypes() const { + + return std::string("[{\"name\":\"beta\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"eta1\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(J) + "},\"block\":\"parameters\"},{\"name\":\"eta2\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(J) + "},\"block\":\"parameters\"},{\"name\":\"mu_a1\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"mu_a2\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"sigma_a1\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"sigma_a2\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"sigma_y\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"a1\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(J) + "},\"block\":\"transformed_parameters\"},{\"name\":\"a2\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(J) + "},\"block\":\"transformed_parameters\"},{\"name\":\"y_hat\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(N) + "},\"block\":\"transformed_parameters\"}]"); - return std::string("[{\"name\":\"beta\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"eta1\",\"type\":{\"name\":\"vector\",\"length\":" << J << "},\"block\":\"parameters\"},{\"name\":\"eta2\",\"type\":{\"name\":\"vector\",\"length\":" << J << "},\"block\":\"parameters\"},{\"name\":\"mu_a1\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"mu_a2\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"sigma_a1\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"sigma_a2\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"sigma_y\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"a1\",\"type\":{\"name\":\"vector\",\"length\":" << J << "},\"block\":\"transformed_parameters\"},{\"name\":\"a2\",\"type\":{\"name\":\"vector\",\"length\":" << J << "},\"block\":\"transformed_parameters\"},{\"name\":\"y_hat\",\"type\":{\"name\":\"vector\",\"length\":" << N << "},\"block\":\"transformed_parameters\"}]"); } // get_constrained_sizedtypes() - inline std::string get_unconstrained_sizedtypes() const final { + inline std::string get_unconstrained_sizedtypes() const { + + return std::string("[{\"name\":\"beta\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"eta1\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(J) + "},\"block\":\"parameters\"},{\"name\":\"eta2\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(J) + "},\"block\":\"parameters\"},{\"name\":\"mu_a1\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"mu_a2\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"sigma_a1\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"sigma_a2\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"sigma_y\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"a1\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(J) + "},\"block\":\"transformed_parameters\"},{\"name\":\"a2\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(J) + "},\"block\":\"transformed_parameters\"},{\"name\":\"y_hat\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(N) + "},\"block\":\"transformed_parameters\"}]"); - return std::string("[{\"name\":\"beta\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"eta1\",\"type\":{\"name\":\"vector\",\"length\":" << J << "},\"block\":\"parameters\"},{\"name\":\"eta2\",\"type\":{\"name\":\"vector\",\"length\":" << J << "},\"block\":\"parameters\"},{\"name\":\"mu_a1\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"mu_a2\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"sigma_a1\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"sigma_a2\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"sigma_y\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"a1\",\"type\":{\"name\":\"vector\",\"length\":" << J << "},\"block\":\"transformed_parameters\"},{\"name\":\"a2\",\"type\":{\"name\":\"vector\",\"length\":" << J << "},\"block\":\"transformed_parameters\"},{\"name\":\"y_hat\",\"type\":{\"name\":\"vector\",\"length\":" << N << "},\"block\":\"transformed_parameters\"}]"); } // get_unconstrained_sizedtypes() @@ -28236,14 +28930,13 @@ class off_small_model final : public model_base_crtp { const bool emit_transformed_parameters = true, const bool emit_generated_quantities = true, std::ostream* pstream = nullptr) const { - std::vector vars_vec(vars.size()); + std::vector vars_vec; + vars_vec.reserve(vars.size()); std::vector params_i; write_array_impl(base_rng, params_r, params_i, vars_vec, emit_transformed_parameters, emit_generated_quantities, pstream); - vars.resize(vars_vec.size()); - for (int i = 0; i < vars.size(); ++i) { - vars.coeffRef(i) = vars_vec[i]; - } + vars = Eigen::Map>( + vars_vec.data(), vars_vec.size()); } template @@ -28253,7 +28946,8 @@ class off_small_model final : public model_base_crtp { bool emit_transformed_parameters = true, bool emit_generated_quantities = true, std::ostream* pstream = nullptr) const { - write_array_impl(base_rng, params_r, params_i, vars, emit_transformed_parameters, emit_generated_quantities, pstream); + write_array_impl(base_rng, params_r, params_i, vars, + emit_transformed_parameters, emit_generated_quantities, pstream); } template @@ -28274,13 +28968,12 @@ class off_small_model final : public model_base_crtp { inline void transform_inits(const stan::io::var_context& context, Eigen::Matrix& params_r, std::ostream* pstream = nullptr) const final { - std::vector params_r_vec(params_r.size()); + std::vector params_r_vec; + params_r_vec.reserve(params_r.size()); std::vector params_i; transform_inits_impl(context, params_i, params_r_vec, pstream); - params_r.resize(params_r_vec.size()); - for (int i = 0; i < params_r.size(); ++i) { - params_r.coeffRef(i) = params_r_vec[i]; - } + params_r = Eigen::Map>( + params_r_vec.data(), params_r_vec.size()); } inline void transform_inits(const stan::io::var_context& context, std::vector& params_i, @@ -28565,7 +29258,7 @@ class optimizations_model final : public model_base_crtp { (void) DUMMY_VAR__; // suppress unused var warning try { int pos__; - pos__ = std::numeric_limits::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; } catch (const std::exception& e) { @@ -28573,19 +29266,8 @@ class optimizations_model final : public model_base_crtp { // Next line prevents compiler griping about no return throw std::runtime_error("*** IF YOU SEE THIS, PLEASE REPORT A BUG ***"); } - num_params_r__ = 0U; + num_params_r__ = 1 + 1 + (3 * 2) + 2 + 3; - try { - num_params_r__ += 1; - num_params_r__ += 1; - num_params_r__ += 3 * 2; - num_params_r__ += 2; - num_params_r__ += 3; - } catch (const std::exception& e) { - stan::lang::rethrow_located(e, locations_array__[current_statement__]); - // Next line prevents compiler griping about no return - throw std::runtime_error("*** IF YOU SEE THIS, PLEASE REPORT A BUG ***"); - } } template { int lcm_sym67__; int lcm_sym66__; local_scalar_t__ theta; - theta = DUMMY_VAR__; + theta = DUMMY_VAR__; current_statement__ = 1; theta = in__.template read(); local_scalar_t__ phi; - phi = DUMMY_VAR__; + phi = DUMMY_VAR__; current_statement__ = 2; phi = in__.template read(); Eigen::Matrix x_matrix; x_matrix = Eigen::Matrix(3, 2); - stan::math::fill(x_matrix, DUMMY_VAR__); + stan::math::fill(x_matrix, DUMMY_VAR__); current_statement__ = 3; x_matrix = in__.template read>( 3, 2); Eigen::Matrix x_vector; x_vector = Eigen::Matrix(2); - stan::math::fill(x_vector, DUMMY_VAR__); + stan::math::fill(x_vector, DUMMY_VAR__); current_statement__ = 4; x_vector = in__.template read>( 2); Eigen::Matrix x_cov; x_cov = Eigen::Matrix(2, 2); - stan::math::fill(x_cov, DUMMY_VAR__); + stan::math::fill(x_cov, DUMMY_VAR__); current_statement__ = 5; x_cov = in__.template read_constrain_cov_matrix, jacobian__>( lp__, 2); { double x; - x = std::numeric_limits::quiet_NaN(); + x = std::numeric_limits::quiet_NaN(); int inline_sym1__; - inline_sym1__ = std::numeric_limits::min(); + inline_sym1__ = std::numeric_limits::min(); for (int inline_sym2__ = 1; inline_sym2__ <= 1; ++inline_sym2__) { current_statement__ = 7; - lp_accum__.add(3);} + lp_accum__.add(3); + } int inline_sym3__; int inline_sym4__; - inline_sym4__ = std::numeric_limits::min(); + inline_sym4__ = std::numeric_limits::min(); for (int inline_sym5__ = 1; inline_sym5__ <= 1; ++inline_sym5__) { { @@ -28671,14 +29354,15 @@ class optimizations_model final : public model_base_crtp { break; } inline_sym3__ = 5; - break;} + break; + } if (pstream__) { stan_print(pstream__, inline_sym3__); stan_print(pstream__, "\n"); } int inline_sym6__; int inline_sym7__; - inline_sym7__ = std::numeric_limits::min(); + inline_sym7__ = std::numeric_limits::min(); for (int inline_sym8__ = 1; inline_sym8__ <= 1; ++inline_sym8__) { { @@ -28686,7 +29370,8 @@ class optimizations_model final : public model_base_crtp { break; } inline_sym6__ = 6; - break;} + break; + } if (inline_sym6__) { current_statement__ = 11; if (pstream__) { @@ -28697,7 +29382,7 @@ class optimizations_model final : public model_base_crtp { int inline_sym9__; int inline_sym12__; int inline_sym10__; - inline_sym10__ = std::numeric_limits::min(); + inline_sym10__ = std::numeric_limits::min(); for (int inline_sym11__ = 1; inline_sym11__ <= 1; ++inline_sym11__) { { @@ -28705,9 +29390,10 @@ class optimizations_model final : public model_base_crtp { break; } inline_sym9__ = 9; - break;} + break; + } int inline_sym13__; - inline_sym13__ = std::numeric_limits::min(); + inline_sym13__ = std::numeric_limits::min(); for (int inline_sym14__ = 1; inline_sym14__ <= 1; ++inline_sym14__) { { @@ -28715,12 +29401,13 @@ class optimizations_model final : public model_base_crtp { break; } inline_sym12__ = 7; - break;} + break; + } if (logical_gte(inline_sym12__, inline_sym9__)) { { int inline_sym15__; int inline_sym16__; - inline_sym16__ = std::numeric_limits::min(); + inline_sym16__ = std::numeric_limits::min(); for (int inline_sym17__ = 1; inline_sym17__ <= 1; ++inline_sym17__) { @@ -28729,18 +29416,20 @@ class optimizations_model final : public model_base_crtp { break; } inline_sym15__ = 10; - break;} + break; + } lp_accum__.add(inline_sym15__); int inline_sym18__; - inline_sym18__ = std::numeric_limits::min(); + inline_sym18__ = std::numeric_limits::min(); for (int inline_sym19__ = 1; inline_sym19__ <= 1; ++inline_sym19__) { current_statement__ = 7; - lp_accum__.add(3);} + lp_accum__.add(3); + } } int inline_sym13__; - inline_sym13__ = std::numeric_limits::min(); + inline_sym13__ = std::numeric_limits::min(); lcm_sym75__ = (inline_sym9__ + 1); for (int inline_sym14__ = 1; inline_sym14__ <= 1; ++inline_sym14__) { @@ -28751,12 +29440,13 @@ class optimizations_model final : public model_base_crtp { } inline_sym12__ = 7; lcm_sym75__ = (inline_sym9__ + 1); - break;} + break; + } for (int i = lcm_sym75__; i <= inline_sym12__; ++i) { { int inline_sym15__; int inline_sym16__; - inline_sym16__ = std::numeric_limits::min(); + inline_sym16__ = std::numeric_limits::min(); for (int inline_sym17__ = 1; inline_sym17__ <= 1; ++inline_sym17__) { @@ -28765,18 +29455,20 @@ class optimizations_model final : public model_base_crtp { break; } inline_sym15__ = 10; - break;} + break; + } lp_accum__.add(inline_sym15__); int inline_sym18__; - inline_sym18__ = std::numeric_limits::min(); + inline_sym18__ = std::numeric_limits::min(); for (int inline_sym19__ = 1; inline_sym19__ <= 1; ++inline_sym19__) { current_statement__ = 7; - lp_accum__.add(3);} + lp_accum__.add(3); + } } int inline_sym13__; - inline_sym13__ = std::numeric_limits::min(); + inline_sym13__ = std::numeric_limits::min(); for (int inline_sym14__ = 1; inline_sym14__ <= 1; ++inline_sym14__) { @@ -28785,7 +29477,9 @@ class optimizations_model final : public model_base_crtp { break; } inline_sym12__ = 7; - break;}} + break; + } + } } { current_statement__ = 13; @@ -28824,7 +29518,8 @@ class optimizations_model final : public model_base_crtp { lp_accum__.add(53); for (int k = lcm_sym76__; k <= lcm_sym78__; ++k) { current_statement__ = 15; - lp_accum__.add(53);} + lp_accum__.add(53); + } } } { @@ -28834,7 +29529,8 @@ class optimizations_model final : public model_base_crtp { lp_accum__.add(53); for (int k = lcm_sym76__; k <= lcm_sym78__; ++k) { current_statement__ = 15; - lp_accum__.add(53);} + lp_accum__.add(53); + } } } } @@ -28848,7 +29544,8 @@ class optimizations_model final : public model_base_crtp { lp_accum__.add(53); for (int k = lcm_sym73__; k <= lcm_sym77__; ++k) { current_statement__ = 15; - lp_accum__.add(53);} + lp_accum__.add(53); + } } } else { lcm_sym73__ = (2 + 1); @@ -28860,8 +29557,10 @@ class optimizations_model final : public model_base_crtp { lp_accum__.add(53); for (int k = lcm_sym76__; k <= lcm_sym78__; ++k) { current_statement__ = 15; - lp_accum__.add(53);} - } } + lp_accum__.add(53); + } + } + } } } { @@ -28874,7 +29573,8 @@ class optimizations_model final : public model_base_crtp { lp_accum__.add(53); for (int k = lcm_sym73__; k <= lcm_sym77__; ++k) { current_statement__ = 15; - lp_accum__.add(53);} + lp_accum__.add(53); + } } } else { lcm_sym73__ = (3 + 1); @@ -28886,8 +29586,10 @@ class optimizations_model final : public model_base_crtp { lp_accum__.add(53); for (int k = lcm_sym76__; k <= lcm_sym78__; ++k) { current_statement__ = 15; - lp_accum__.add(53);} - } } + lp_accum__.add(53); + } + } + } } } { @@ -28900,7 +29602,8 @@ class optimizations_model final : public model_base_crtp { lp_accum__.add(53); for (int k = lcm_sym73__; k <= lcm_sym77__; ++k) { current_statement__ = 15; - lp_accum__.add(53);} + lp_accum__.add(53); + } } } else { lcm_sym73__ = (4 + 1); @@ -28912,8 +29615,10 @@ class optimizations_model final : public model_base_crtp { lp_accum__.add(53); for (int k = lcm_sym76__; k <= lcm_sym78__; ++k) { current_statement__ = 15; - lp_accum__.add(53);} - } } + lp_accum__.add(53); + } + } + } } } { @@ -28926,7 +29631,8 @@ class optimizations_model final : public model_base_crtp { lp_accum__.add(53); for (int k = lcm_sym73__; k <= lcm_sym77__; ++k) { current_statement__ = 15; - lp_accum__.add(53);} + lp_accum__.add(53); + } } } else { lcm_sym73__ = (5 + 1); @@ -28938,8 +29644,10 @@ class optimizations_model final : public model_base_crtp { lp_accum__.add(53); for (int k = lcm_sym76__; k <= lcm_sym78__; ++k) { current_statement__ = 15; - lp_accum__.add(53);} - } } + lp_accum__.add(53); + } + } + } } } } @@ -28950,7 +29658,8 @@ class optimizations_model final : public model_base_crtp { break; } current_statement__ = 21; - lp_accum__.add(2);} + lp_accum__.add(2); + } current_statement__ = 28; for (int i = 1; i <= 5; ++i) { current_statement__ = 25; @@ -28958,7 +29667,8 @@ class optimizations_model final : public model_base_crtp { continue; } current_statement__ = 26; - lp_accum__.add(2);} + lp_accum__.add(2); + } current_statement__ = 33; for (int i = 1; i <= 5; ++i) { current_statement__ = 30; @@ -28966,7 +29676,8 @@ class optimizations_model final : public model_base_crtp { continue; } current_statement__ = 31; - lp_accum__.add(2);} + lp_accum__.add(2); + } current_statement__ = 34; x = 3; current_statement__ = 35; @@ -28992,7 +29703,7 @@ class optimizations_model final : public model_base_crtp { current_statement__ = 43; lp_accum__.add(x); double z; - z = std::numeric_limits::quiet_NaN(); + z = std::numeric_limits::quiet_NaN(); current_statement__ = 45; z = x; @@ -29009,14 +29720,14 @@ class optimizations_model final : public model_base_crtp { lp_accum__.add(2); { double y; - y = std::numeric_limits::quiet_NaN(); + y = std::numeric_limits::quiet_NaN(); current_statement__ = 52; lp_accum__.add(24); } { double y; - y = std::numeric_limits::quiet_NaN(); + y = std::numeric_limits::quiet_NaN(); current_statement__ = 55; lp_accum__.add(245); @@ -29027,37 +29738,40 @@ class optimizations_model final : public model_base_crtp { } int inline_sym20__; int inline_sym21__; - inline_sym21__ = std::numeric_limits::min(); + inline_sym21__ = std::numeric_limits::min(); for (int inline_sym22__ = 1; inline_sym22__ <= 1; ++inline_sym22__) { current_statement__ = 59; lp_accum__.add(2); - break;} + break; + } current_statement__ = 62; while (576) { break; } int inline_sym23__; int inline_sym24__; - inline_sym24__ = std::numeric_limits::min(); + inline_sym24__ = std::numeric_limits::min(); for (int inline_sym25__ = 1; inline_sym25__ <= 1; ++inline_sym25__) { current_statement__ = 59; lp_accum__.add(2); inline_sym23__ = 24; - break;} + break; + } while (inline_sym23__) { { break; } int inline_sym24__; - inline_sym24__ = std::numeric_limits::min(); + inline_sym24__ = std::numeric_limits::min(); for (int inline_sym25__ = 1; inline_sym25__ <= 1; ++inline_sym25__) { current_statement__ = 59; lp_accum__.add(2); inline_sym23__ = 24; - break;} + break; + } } current_statement__ = 65; for (int i = 31; i <= 225; ++i) { continue;} @@ -29065,32 +29779,35 @@ class optimizations_model final : public model_base_crtp { for (int i = 31; i <= 225; ++i) { break;} int inline_sym26__; int inline_sym27__; - inline_sym27__ = std::numeric_limits::min(); + inline_sym27__ = std::numeric_limits::min(); for (int inline_sym28__ = 1; inline_sym28__ <= 1; ++inline_sym28__) { current_statement__ = 59; lp_accum__.add(2); inline_sym26__ = 24; - break;} + break; + } for (int i = inline_sym26__; i <= 225; ++i) { continue;} int inline_sym29__; int inline_sym30__; - inline_sym30__ = std::numeric_limits::min(); + inline_sym30__ = std::numeric_limits::min(); for (int inline_sym31__ = 1; inline_sym31__ <= 1; ++inline_sym31__) { current_statement__ = 59; lp_accum__.add(2); inline_sym29__ = 24; - break;} + break; + } for (int i = inline_sym29__; i <= 225; ++i) { break;} int inline_sym32__; int inline_sym33__; - inline_sym33__ = std::numeric_limits::min(); + inline_sym33__ = std::numeric_limits::min(); for (int inline_sym34__ = 1; inline_sym34__ <= 1; ++inline_sym34__) { current_statement__ = 59; lp_accum__.add(2); - break;} + break; + } { current_statement__ = 70; lp_accum__.add(1); @@ -29104,7 +29821,7 @@ class optimizations_model final : public model_base_crtp { } } double temp; - temp = std::numeric_limits::quiet_NaN(); + temp = std::numeric_limits::quiet_NaN(); { current_statement__ = 77; @@ -29114,7 +29831,7 @@ class optimizations_model final : public model_base_crtp { } } double temp2; - temp2 = std::numeric_limits::quiet_NaN(); + temp2 = std::numeric_limits::quiet_NaN(); { current_statement__ = 80; @@ -29129,14 +29846,14 @@ class optimizations_model final : public model_base_crtp { } } double dataonlyvar; - dataonlyvar = std::numeric_limits::quiet_NaN(); + dataonlyvar = std::numeric_limits::quiet_NaN(); current_statement__ = 83; dataonlyvar = 3; current_statement__ = 84; lp_accum__.add(dataonlyvar); local_scalar_t__ paramvar; - paramvar = DUMMY_VAR__; + paramvar = DUMMY_VAR__; { current_statement__ = 86; @@ -29190,32 +29907,32 @@ class optimizations_model final : public model_base_crtp { int lcm_sym55__; int lcm_sym54__; double theta; - theta = std::numeric_limits::quiet_NaN(); + theta = std::numeric_limits::quiet_NaN(); current_statement__ = 1; theta = in__.template read(); double phi; - phi = std::numeric_limits::quiet_NaN(); + phi = std::numeric_limits::quiet_NaN(); current_statement__ = 2; phi = in__.template read(); Eigen::Matrix x_matrix; x_matrix = Eigen::Matrix(3, 2); - stan::math::fill(x_matrix, std::numeric_limits::quiet_NaN()); + stan::math::fill(x_matrix, std::numeric_limits::quiet_NaN()); current_statement__ = 3; x_matrix = in__.template read>( 3, 2); Eigen::Matrix x_vector; x_vector = Eigen::Matrix(2); - stan::math::fill(x_vector, std::numeric_limits::quiet_NaN()); + stan::math::fill(x_vector, std::numeric_limits::quiet_NaN()); current_statement__ = 4; x_vector = in__.template read>( 2); Eigen::Matrix x_cov; x_cov = Eigen::Matrix(2, 2); - stan::math::fill(x_cov, std::numeric_limits::quiet_NaN()); + stan::math::fill(x_cov, std::numeric_limits::quiet_NaN()); current_statement__ = 5; x_cov = in__.template read_constrain_cov_matrix, jacobian__>( @@ -29318,22 +30035,22 @@ class optimizations_model final : public model_base_crtp { double lcm_sym40__; int lcm_sym39__; int pos__; - pos__ = std::numeric_limits::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; double theta; - theta = std::numeric_limits::quiet_NaN(); + theta = std::numeric_limits::quiet_NaN(); current_statement__ = 1; theta = context__.vals_r("theta")[(1 - 1)]; double phi; - phi = std::numeric_limits::quiet_NaN(); + phi = std::numeric_limits::quiet_NaN(); current_statement__ = 2; phi = context__.vals_r("phi")[(1 - 1)]; Eigen::Matrix x_matrix; x_matrix = Eigen::Matrix(3, 2); - stan::math::fill(x_matrix, std::numeric_limits::quiet_NaN()); + stan::math::fill(x_matrix, std::numeric_limits::quiet_NaN()); { std::vector x_matrix_flat__; @@ -29391,7 +30108,7 @@ class optimizations_model final : public model_base_crtp { } Eigen::Matrix x_vector; x_vector = Eigen::Matrix(2); - stan::math::fill(x_vector, std::numeric_limits::quiet_NaN()); + stan::math::fill(x_vector, std::numeric_limits::quiet_NaN()); { std::vector x_vector_flat__; @@ -29417,7 +30134,7 @@ class optimizations_model final : public model_base_crtp { } Eigen::Matrix x_cov; x_cov = Eigen::Matrix(2, 2); - stan::math::fill(x_cov, std::numeric_limits::quiet_NaN()); + stan::math::fill(x_cov, std::numeric_limits::quiet_NaN()); { std::vector x_cov_flat__; @@ -29460,7 +30177,7 @@ class optimizations_model final : public model_base_crtp { } Eigen::Matrix x_cov_free__; x_cov_free__ = Eigen::Matrix(3); - stan::math::fill(x_cov_free__, std::numeric_limits::quiet_NaN()); + stan::math::fill(x_cov_free__, std::numeric_limits::quiet_NaN()); current_statement__ = 5; assign(x_cov_free__, stan::math::cov_matrix_free(x_cov), @@ -29522,20 +30239,19 @@ class optimizations_model final : public model_base_crtp { inline void get_param_names(std::vector& names__) const { - names__ = std::vector{"theta", - "phi", - "x_matrix", - "x_vector", - "x_cov"}; + names__ = std::vector{"theta", "phi", "x_matrix", + "x_vector", "x_cov"}; + } // get_param_names() inline void get_dims(std::vector>& dimss__) const { dimss__ = std::vector>{std::vector{}, - std::vector{}, - std::vector{static_cast(3), static_cast(2)}, - std::vector{static_cast(2)}, - std::vector{static_cast(2), static_cast(2)}}; + std::vector{}, + std::vector{static_cast(3), static_cast(2)}, + std::vector{static_cast(2)}, + std::vector{static_cast(2), static_cast(2)}}; + } // get_dims() inline void constrained_param_names( @@ -29551,19 +30267,24 @@ class optimizations_model final : public model_base_crtp { for (int sym81__ = 1; sym81__ <= 3; ++sym81__) { { param_names__.emplace_back(std::string() + "x_matrix" + '.' + std::to_string(sym81__) + '.' + std::to_string(sym80__)); - }} - }} + } + } + } + } for (int sym80__ = 1; sym80__ <= 2; ++sym80__) { { param_names__.emplace_back(std::string() + "x_vector" + '.' + std::to_string(sym80__)); - }} + } + } for (int sym80__ = 1; sym80__ <= 2; ++sym80__) { { for (int sym81__ = 1; sym81__ <= 2; ++sym81__) { { param_names__.emplace_back(std::string() + "x_cov" + '.' + std::to_string(sym81__) + '.' + std::to_string(sym80__)); - }} - }} + } + } + } + } if (emit_transformed_parameters__) { } @@ -29587,16 +30308,20 @@ class optimizations_model final : public model_base_crtp { for (int sym81__ = 1; sym81__ <= 3; ++sym81__) { { param_names__.emplace_back(std::string() + "x_matrix" + '.' + std::to_string(sym81__) + '.' + std::to_string(sym80__)); - }} - }} + } + } + } + } for (int sym80__ = 1; sym80__ <= 2; ++sym80__) { { param_names__.emplace_back(std::string() + "x_vector" + '.' + std::to_string(sym80__)); - }} + } + } for (int sym80__ = 1; sym80__ <= 3; ++sym80__) { { param_names__.emplace_back(std::string() + "x_cov" + '.' + std::to_string(sym80__)); - }} + } + } if (emit_transformed_parameters__) { } @@ -29607,14 +30332,16 @@ class optimizations_model final : public model_base_crtp { } // unconstrained_param_names() - inline std::string get_constrained_sizedtypes() const final { + inline std::string get_constrained_sizedtypes() const { + + return std::string("[{\"name\":\"theta\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"phi\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"x_matrix\",\"type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(3) + ",\"cols\":" + std::to_string(2) + "},\"block\":\"parameters\"},{\"name\":\"x_vector\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(2) + "},\"block\":\"parameters\"},{\"name\":\"x_cov\",\"type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(2) + ",\"cols\":" + std::to_string(2) + "},\"block\":\"parameters\"}]"); - return std::string("[{\"name\":\"theta\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"phi\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"x_matrix\",\"type\":{\"name\":\"matrix\",\"rows\":" << 3 << ",\"cols\":" << 2 << "},\"block\":\"parameters\"},{\"name\":\"x_vector\",\"type\":{\"name\":\"vector\",\"length\":" << 2 << "},\"block\":\"parameters\"},{\"name\":\"x_cov\",\"type\":{\"name\":\"matrix\",\"rows\":" << 2 << ",\"cols\":" << 2 << "},\"block\":\"parameters\"}]"); } // get_constrained_sizedtypes() - inline std::string get_unconstrained_sizedtypes() const final { + inline std::string get_unconstrained_sizedtypes() const { + + return std::string("[{\"name\":\"theta\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"phi\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"x_matrix\",\"type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(3) + ",\"cols\":" + std::to_string(2) + "},\"block\":\"parameters\"},{\"name\":\"x_vector\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(2) + "},\"block\":\"parameters\"},{\"name\":\"x_cov\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(3) + "},\"block\":\"parameters\"}]"); - return std::string("[{\"name\":\"theta\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"phi\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"x_matrix\",\"type\":{\"name\":\"matrix\",\"rows\":" << 3 << ",\"cols\":" << 2 << "},\"block\":\"parameters\"},{\"name\":\"x_vector\",\"type\":{\"name\":\"vector\",\"length\":" << 2 << "},\"block\":\"parameters\"},{\"name\":\"x_cov\",\"type\":{\"name\":\"vector\",\"length\":" << 3 << "},\"block\":\"parameters\"}]"); } // get_unconstrained_sizedtypes() @@ -29626,14 +30353,13 @@ class optimizations_model final : public model_base_crtp { const bool emit_transformed_parameters = true, const bool emit_generated_quantities = true, std::ostream* pstream = nullptr) const { - std::vector vars_vec(vars.size()); + std::vector vars_vec; + vars_vec.reserve(vars.size()); std::vector params_i; write_array_impl(base_rng, params_r, params_i, vars_vec, emit_transformed_parameters, emit_generated_quantities, pstream); - vars.resize(vars_vec.size()); - for (int i = 0; i < vars.size(); ++i) { - vars.coeffRef(i) = vars_vec[i]; - } + vars = Eigen::Map>( + vars_vec.data(), vars_vec.size()); } template @@ -29643,7 +30369,8 @@ class optimizations_model final : public model_base_crtp { bool emit_transformed_parameters = true, bool emit_generated_quantities = true, std::ostream* pstream = nullptr) const { - write_array_impl(base_rng, params_r, params_i, vars, emit_transformed_parameters, emit_generated_quantities, pstream); + write_array_impl(base_rng, params_r, params_i, vars, + emit_transformed_parameters, emit_generated_quantities, pstream); } template @@ -29664,13 +30391,12 @@ class optimizations_model final : public model_base_crtp { inline void transform_inits(const stan::io::var_context& context, Eigen::Matrix& params_r, std::ostream* pstream = nullptr) const final { - std::vector params_r_vec(params_r.size()); + std::vector params_r_vec; + params_r_vec.reserve(params_r.size()); std::vector params_i; transform_inits_impl(context, params_i, params_r_vec, pstream); - params_r.resize(params_r_vec.size()); - for (int i = 0; i < params_r.size(); ++i) { - params_r.coeffRef(i) = params_r_vec[i]; - } + params_r = Eigen::Map>( + params_r_vec.data(), params_r_vec.size()); } inline void transform_inits(const stan::io::var_context& context, std::vector& params_i, @@ -29809,13 +30535,13 @@ class partial_eval_model final : public model_base_crtp { int pos__; - pos__ = std::numeric_limits::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; current_statement__ = 13; context__.validate_dims("data initialization","N","int", - context__.to_vec()); - N = std::numeric_limits::min(); + std::vector{}); + N = std::numeric_limits::min(); current_statement__ = 13; N = context__.vals_i("N")[(1 - 1)]; @@ -29824,8 +30550,8 @@ class partial_eval_model final : public model_base_crtp { check_greater_or_equal(function__, "N", N, 0); current_statement__ = 14; context__.validate_dims("data initialization","n_pair","int", - context__.to_vec()); - n_pair = std::numeric_limits::min(); + std::vector{}); + n_pair = std::numeric_limits::min(); current_statement__ = 14; n_pair = context__.vals_i("n_pair")[(1 - 1)]; @@ -29836,8 +30562,8 @@ class partial_eval_model final : public model_base_crtp { validate_non_negative_index("pair", "N", N); current_statement__ = 16; context__.validate_dims("data initialization","pair","int", - context__.to_vec(N)); - pair = std::vector(N, std::numeric_limits::min()); + std::vector{static_cast(N)}); + pair = std::vector(N, std::numeric_limits::min()); current_statement__ = 16; pair = context__.vals_i("pair"); @@ -29851,7 +30577,8 @@ class partial_eval_model final : public model_base_crtp { current_statement__ = 16; current_statement__ = 16; check_greater_or_equal(function__, "pair[sym1__]", - pair[(sym1__ - 1)], 1);} + pair[(sym1__ - 1)], 1); + } } current_statement__ = 16; if (lcm_sym30__) { @@ -29863,15 +30590,16 @@ class partial_eval_model final : public model_base_crtp { current_statement__ = 16; current_statement__ = 16; check_less_or_equal(function__, "pair[sym1__]", pair[(sym1__ - 1)], - n_pair);} + n_pair); + } } current_statement__ = 17; validate_non_negative_index("pre_test", "N", N); current_statement__ = 18; context__.validate_dims("data initialization","pre_test","double", - context__.to_vec(N)); + std::vector{static_cast(N)}); pre_test = Eigen::Matrix(N); - stan::math::fill(pre_test, std::numeric_limits::quiet_NaN()); + stan::math::fill(pre_test, std::numeric_limits::quiet_NaN()); { std::vector pre_test_flat__; @@ -29892,16 +30620,17 @@ class partial_eval_model final : public model_base_crtp { assign(pre_test, pre_test_flat__[(pos__ - 1)], "assigning variable pre_test", index_uni(sym1__)); current_statement__ = 18; - pos__ = (pos__ + 1);} + pos__ = (pos__ + 1); + } } } current_statement__ = 19; validate_non_negative_index("treatment", "N", N); current_statement__ = 20; context__.validate_dims("data initialization","treatment","double", - context__.to_vec(N)); + std::vector{static_cast(N)}); treatment = Eigen::Matrix(N); - stan::math::fill(treatment, std::numeric_limits::quiet_NaN()); + stan::math::fill(treatment, std::numeric_limits::quiet_NaN()); { std::vector treatment_flat__; @@ -29922,7 +30651,8 @@ class partial_eval_model final : public model_base_crtp { assign(treatment, treatment_flat__[(pos__ - 1)], "assigning variable treatment", index_uni(sym1__)); current_statement__ = 20; - pos__ = (pos__ + 1);} + pos__ = (pos__ + 1); + } } } current_statement__ = 20; @@ -29936,7 +30666,8 @@ class partial_eval_model final : public model_base_crtp { current_statement__ = 20; current_statement__ = 20; check_greater_or_equal(function__, "treatment[sym1__]", - treatment[(sym1__ - 1)], 0);} + treatment[(sym1__ - 1)], 0); + } } current_statement__ = 20; if (lcm_sym30__) { @@ -29948,15 +30679,16 @@ class partial_eval_model final : public model_base_crtp { current_statement__ = 20; current_statement__ = 20; check_less_or_equal(function__, "treatment[sym1__]", - treatment[(sym1__ - 1)], 1);} + treatment[(sym1__ - 1)], 1); + } } current_statement__ = 21; validate_non_negative_index("y", "N", N); current_statement__ = 22; context__.validate_dims("data initialization","y","double", - context__.to_vec(N)); + std::vector{static_cast(N)}); y = Eigen::Matrix(N); - stan::math::fill(y, std::numeric_limits::quiet_NaN()); + stan::math::fill(y, std::numeric_limits::quiet_NaN()); { std::vector y_flat__; @@ -29976,7 +30708,8 @@ class partial_eval_model final : public model_base_crtp { assign(y, y_flat__[(pos__ - 1)], "assigning variable y", index_uni(sym1__)); current_statement__ = 22; - pos__ = (pos__ + 1);} + pos__ = (pos__ + 1); + } } } current_statement__ = 23; @@ -29988,19 +30721,8 @@ class partial_eval_model final : public model_base_crtp { // Next line prevents compiler griping about no return throw std::runtime_error("*** IF YOU SEE THIS, PLEASE REPORT A BUG ***"); } - num_params_r__ = 0U; + num_params_r__ = n_pair + 2 + 1 + 1 + 1; - try { - num_params_r__ += n_pair; - num_params_r__ += 2; - num_params_r__ += 1; - num_params_r__ += 1; - num_params_r__ += 1; - } catch (const std::exception& e) { - stan::lang::rethrow_located(e, locations_array__[current_statement__]); - // Next line prevents compiler griping about no return - throw std::runtime_error("*** IF YOU SEE THIS, PLEASE REPORT A BUG ***"); - } } template { int lcm_sym23__; Eigen::Matrix a; a = Eigen::Matrix(n_pair); - stan::math::fill(a, DUMMY_VAR__); + stan::math::fill(a, DUMMY_VAR__); current_statement__ = 1; a = in__.template read>(n_pair); Eigen::Matrix beta; beta = Eigen::Matrix(2); - stan::math::fill(beta, DUMMY_VAR__); + stan::math::fill(beta, DUMMY_VAR__); current_statement__ = 2; beta = in__.template read>(2); local_scalar_t__ mu_a; - mu_a = DUMMY_VAR__; + mu_a = DUMMY_VAR__; current_statement__ = 3; mu_a = in__.template read(); local_scalar_t__ sigma_a; - sigma_a = DUMMY_VAR__; + sigma_a = DUMMY_VAR__; current_statement__ = 4; sigma_a = in__.template read_constrain_lub( 0, 100, lp__); local_scalar_t__ sigma_y; - sigma_y = DUMMY_VAR__; + sigma_y = DUMMY_VAR__; current_statement__ = 5; sigma_y = in__.template read_constrain_lub( 0, 100, lp__); Eigen::Matrix y_hat; y_hat = Eigen::Matrix(N); - stan::math::fill(y_hat, DUMMY_VAR__); + stan::math::fill(y_hat, DUMMY_VAR__); current_statement__ = 8; if (logical_gte(N, 1)) { @@ -30079,7 +30801,8 @@ class partial_eval_model final : public model_base_crtp { stan::math::fma(rvalue(beta, "beta", index_uni(1)), rvalue(treatment, "treatment", index_uni(i)), rvalue(a, "a", index_uni(rvalue(pair, "pair", index_uni(i)))))), - "assigning variable y_hat", index_uni(i));} + "assigning variable y_hat", index_uni(i)); + } } { current_statement__ = 9; @@ -30137,41 +30860,42 @@ class partial_eval_model final : public model_base_crtp { int lcm_sym11__; Eigen::Matrix a; a = Eigen::Matrix(n_pair); - stan::math::fill(a, std::numeric_limits::quiet_NaN()); + stan::math::fill(a, std::numeric_limits::quiet_NaN()); current_statement__ = 1; a = in__.template read>(n_pair); Eigen::Matrix beta; beta = Eigen::Matrix(2); - stan::math::fill(beta, std::numeric_limits::quiet_NaN()); + stan::math::fill(beta, std::numeric_limits::quiet_NaN()); current_statement__ = 2; beta = in__.template read>(2); double mu_a; - mu_a = std::numeric_limits::quiet_NaN(); + mu_a = std::numeric_limits::quiet_NaN(); current_statement__ = 3; mu_a = in__.template read(); double sigma_a; - sigma_a = std::numeric_limits::quiet_NaN(); + sigma_a = std::numeric_limits::quiet_NaN(); current_statement__ = 4; sigma_a = in__.template read_constrain_lub( 0, 100, lp__); double sigma_y; - sigma_y = std::numeric_limits::quiet_NaN(); + sigma_y = std::numeric_limits::quiet_NaN(); current_statement__ = 5; sigma_y = in__.template read_constrain_lub( 0, 100, lp__); Eigen::Matrix y_hat; y_hat = Eigen::Matrix(N); - stan::math::fill(y_hat, DUMMY_VAR__); + stan::math::fill(y_hat, DUMMY_VAR__); if (logical_gte(n_pair, 1)) { vars__.emplace_back(rvalue(a, "a", index_uni(1))); for (int sym1__ = 2; sym1__ <= n_pair; ++sym1__) { - vars__.emplace_back(a[(sym1__ - 1)]);} + vars__.emplace_back(a[(sym1__ - 1)]); + } } { vars__.emplace_back(rvalue(beta, "beta", index_uni(1))); @@ -30204,13 +30928,15 @@ class partial_eval_model final : public model_base_crtp { stan::math::fma(rvalue(beta, "beta", index_uni(1)), rvalue(treatment, "treatment", index_uni(i)), rvalue(a, "a", index_uni(rvalue(pair, "pair", index_uni(i)))))), - "assigning variable y_hat", index_uni(i));} + "assigning variable y_hat", index_uni(i)); + } } if (emit_transformed_parameters__) { if (lcm_sym11__) { vars__.emplace_back(rvalue(y_hat, "y_hat", index_uni(1))); for (int sym1__ = 2; sym1__ <= N; ++sym1__) { - vars__.emplace_back(y_hat[(sym1__ - 1)]);} + vars__.emplace_back(y_hat[(sym1__ - 1)]); + } } } if (logical_negation(emit_generated_quantities__)) { @@ -30246,12 +30972,12 @@ class partial_eval_model final : public model_base_crtp { int lcm_sym2__; int lcm_sym1__; int pos__; - pos__ = std::numeric_limits::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; Eigen::Matrix a; a = Eigen::Matrix(n_pair); - stan::math::fill(a, std::numeric_limits::quiet_NaN()); + stan::math::fill(a, std::numeric_limits::quiet_NaN()); { std::vector a_flat__; @@ -30271,12 +30997,13 @@ class partial_eval_model final : public model_base_crtp { assign(a, a_flat__[(pos__ - 1)], "assigning variable a", index_uni(sym1__)); current_statement__ = 1; - pos__ = (pos__ + 1);} + pos__ = (pos__ + 1); + } } } Eigen::Matrix beta; beta = Eigen::Matrix(2); - stan::math::fill(beta, std::numeric_limits::quiet_NaN()); + stan::math::fill(beta, std::numeric_limits::quiet_NaN()); { std::vector beta_flat__; @@ -30300,34 +31027,35 @@ class partial_eval_model final : public model_base_crtp { } } double mu_a; - mu_a = std::numeric_limits::quiet_NaN(); + mu_a = std::numeric_limits::quiet_NaN(); current_statement__ = 3; mu_a = context__.vals_r("mu_a")[(1 - 1)]; double sigma_a; - sigma_a = std::numeric_limits::quiet_NaN(); + sigma_a = std::numeric_limits::quiet_NaN(); current_statement__ = 4; sigma_a = context__.vals_r("sigma_a")[(1 - 1)]; double sigma_a_free__; - sigma_a_free__ = std::numeric_limits::quiet_NaN(); + sigma_a_free__ = std::numeric_limits::quiet_NaN(); current_statement__ = 4; sigma_a_free__ = stan::math::lub_free(sigma_a, 0, 100); double sigma_y; - sigma_y = std::numeric_limits::quiet_NaN(); + sigma_y = std::numeric_limits::quiet_NaN(); current_statement__ = 5; sigma_y = context__.vals_r("sigma_y")[(1 - 1)]; double sigma_y_free__; - sigma_y_free__ = std::numeric_limits::quiet_NaN(); + sigma_y_free__ = std::numeric_limits::quiet_NaN(); current_statement__ = 5; sigma_y_free__ = stan::math::lub_free(sigma_y, 0, 100); if (lcm_sym1__) { vars__.emplace_back(rvalue(a, "a", index_uni(1))); for (int sym1__ = 2; sym1__ <= n_pair; ++sym1__) { - vars__.emplace_back(a[(sym1__ - 1)]);} + vars__.emplace_back(a[(sym1__ - 1)]); + } } { vars__.emplace_back(rvalue(beta, "beta", index_uni(1))); @@ -30347,12 +31075,9 @@ class partial_eval_model final : public model_base_crtp { inline void get_param_names(std::vector& names__) const { - names__ = std::vector{"a", - "beta", - "mu_a", - "sigma_a", - "sigma_y", - "y_hat"}; + names__ = std::vector{"a", "beta", "mu_a", "sigma_a", + "sigma_y", "y_hat"}; + } // get_param_names() inline void get_dims(std::vector>& dimss__) const { @@ -30360,11 +31085,10 @@ class partial_eval_model final : public model_base_crtp { dimss__ = std::vector>{std::vector{ static_cast(n_pair) }, - std::vector{static_cast(2)}, - std::vector{}, - std::vector{}, - std::vector{}, - std::vector{static_cast(N)}}; + std::vector{static_cast(2)}, std::vector{ + }, std::vector{}, std::vector{}, + std::vector{static_cast(N)}}; + } // get_dims() inline void constrained_param_names( @@ -30376,11 +31100,13 @@ class partial_eval_model final : public model_base_crtp { for (int sym42__ = 1; sym42__ <= n_pair; ++sym42__) { { param_names__.emplace_back(std::string() + "a" + '.' + std::to_string(sym42__)); - }} + } + } for (int sym42__ = 1; sym42__ <= 2; ++sym42__) { { param_names__.emplace_back(std::string() + "beta" + '.' + std::to_string(sym42__)); - }} + } + } param_names__.emplace_back(std::string() + "mu_a"); param_names__.emplace_back(std::string() + "sigma_a"); param_names__.emplace_back(std::string() + "sigma_y"); @@ -30388,7 +31114,8 @@ class partial_eval_model final : public model_base_crtp { for (int sym42__ = 1; sym42__ <= N; ++sym42__) { { param_names__.emplace_back(std::string() + "y_hat" + '.' + std::to_string(sym42__)); - }} + } + } } if (emit_generated_quantities__) { @@ -30406,11 +31133,13 @@ class partial_eval_model final : public model_base_crtp { for (int sym42__ = 1; sym42__ <= n_pair; ++sym42__) { { param_names__.emplace_back(std::string() + "a" + '.' + std::to_string(sym42__)); - }} + } + } for (int sym42__ = 1; sym42__ <= 2; ++sym42__) { { param_names__.emplace_back(std::string() + "beta" + '.' + std::to_string(sym42__)); - }} + } + } param_names__.emplace_back(std::string() + "mu_a"); param_names__.emplace_back(std::string() + "sigma_a"); param_names__.emplace_back(std::string() + "sigma_y"); @@ -30418,7 +31147,8 @@ class partial_eval_model final : public model_base_crtp { for (int sym42__ = 1; sym42__ <= N; ++sym42__) { { param_names__.emplace_back(std::string() + "y_hat" + '.' + std::to_string(sym42__)); - }} + } + } } if (emit_generated_quantities__) { @@ -30427,14 +31157,16 @@ class partial_eval_model final : public model_base_crtp { } // unconstrained_param_names() - inline std::string get_constrained_sizedtypes() const final { + inline std::string get_constrained_sizedtypes() const { + + return std::string("[{\"name\":\"a\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(n_pair) + "},\"block\":\"parameters\"},{\"name\":\"beta\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(2) + "},\"block\":\"parameters\"},{\"name\":\"mu_a\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"sigma_a\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"sigma_y\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"y_hat\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(N) + "},\"block\":\"transformed_parameters\"}]"); - return std::string("[{\"name\":\"a\",\"type\":{\"name\":\"vector\",\"length\":" << n_pair << "},\"block\":\"parameters\"},{\"name\":\"beta\",\"type\":{\"name\":\"vector\",\"length\":" << 2 << "},\"block\":\"parameters\"},{\"name\":\"mu_a\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"sigma_a\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"sigma_y\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"y_hat\",\"type\":{\"name\":\"vector\",\"length\":" << N << "},\"block\":\"transformed_parameters\"}]"); } // get_constrained_sizedtypes() - inline std::string get_unconstrained_sizedtypes() const final { + inline std::string get_unconstrained_sizedtypes() const { + + return std::string("[{\"name\":\"a\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(n_pair) + "},\"block\":\"parameters\"},{\"name\":\"beta\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(2) + "},\"block\":\"parameters\"},{\"name\":\"mu_a\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"sigma_a\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"sigma_y\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"y_hat\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(N) + "},\"block\":\"transformed_parameters\"}]"); - return std::string("[{\"name\":\"a\",\"type\":{\"name\":\"vector\",\"length\":" << n_pair << "},\"block\":\"parameters\"},{\"name\":\"beta\",\"type\":{\"name\":\"vector\",\"length\":" << 2 << "},\"block\":\"parameters\"},{\"name\":\"mu_a\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"sigma_a\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"sigma_y\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"y_hat\",\"type\":{\"name\":\"vector\",\"length\":" << N << "},\"block\":\"transformed_parameters\"}]"); } // get_unconstrained_sizedtypes() @@ -30446,14 +31178,13 @@ class partial_eval_model final : public model_base_crtp { const bool emit_transformed_parameters = true, const bool emit_generated_quantities = true, std::ostream* pstream = nullptr) const { - std::vector vars_vec(vars.size()); + std::vector vars_vec; + vars_vec.reserve(vars.size()); std::vector params_i; write_array_impl(base_rng, params_r, params_i, vars_vec, emit_transformed_parameters, emit_generated_quantities, pstream); - vars.resize(vars_vec.size()); - for (int i = 0; i < vars.size(); ++i) { - vars.coeffRef(i) = vars_vec[i]; - } + vars = Eigen::Map>( + vars_vec.data(), vars_vec.size()); } template @@ -30463,7 +31194,8 @@ class partial_eval_model final : public model_base_crtp { bool emit_transformed_parameters = true, bool emit_generated_quantities = true, std::ostream* pstream = nullptr) const { - write_array_impl(base_rng, params_r, params_i, vars, emit_transformed_parameters, emit_generated_quantities, pstream); + write_array_impl(base_rng, params_r, params_i, vars, + emit_transformed_parameters, emit_generated_quantities, pstream); } template @@ -30484,13 +31216,12 @@ class partial_eval_model final : public model_base_crtp { inline void transform_inits(const stan::io::var_context& context, Eigen::Matrix& params_r, std::ostream* pstream = nullptr) const final { - std::vector params_r_vec(params_r.size()); + std::vector params_r_vec; + params_r_vec.reserve(params_r.size()); std::vector params_i; transform_inits_impl(context, params_i, params_r_vec, pstream); - params_r.resize(params_r_vec.size()); - for (int i = 0; i < params_r.size(); ++i) { - params_r.coeffRef(i) = params_r_vec[i]; - } + params_r = Eigen::Map>( + params_r_vec.data(), params_r_vec.size()); } inline void transform_inits(const stan::io::var_context& context, std::vector& params_i, @@ -30636,13 +31367,13 @@ class stalled1_failure_model final : public model_base_crtp::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; current_statement__ = 17; context__.validate_dims("data initialization","I","int", - context__.to_vec()); - I = std::numeric_limits::min(); + std::vector{}); + I = std::numeric_limits::min(); current_statement__ = 17; I = context__.vals_i("I")[(1 - 1)]; @@ -30653,8 +31384,8 @@ class stalled1_failure_model final : public model_base_crtp(I, std::numeric_limits::min()); + std::vector{static_cast(I)}); + n = std::vector(I, std::numeric_limits::min()); current_statement__ = 19; n = context__.vals_i("n"); @@ -30674,8 +31405,8 @@ class stalled1_failure_model final : public model_base_crtp(I, std::numeric_limits::min()); + std::vector{static_cast(I)}); + N = std::vector(I, std::numeric_limits::min()); current_statement__ = 21; N = context__.vals_i("N"); @@ -30695,9 +31426,9 @@ class stalled1_failure_model final : public model_base_crtp{static_cast(I)}); x1 = Eigen::Matrix(I); - stan::math::fill(x1, std::numeric_limits::quiet_NaN()); + stan::math::fill(x1, std::numeric_limits::quiet_NaN()); { std::vector x1_flat__; @@ -30717,16 +31448,17 @@ class stalled1_failure_model final : public model_base_crtp{static_cast(I)}); x2 = Eigen::Matrix(I); - stan::math::fill(x2, std::numeric_limits::quiet_NaN()); + stan::math::fill(x2, std::numeric_limits::quiet_NaN()); { std::vector x2_flat__; @@ -30746,17 +31478,15 @@ class stalled1_failure_model final : public model_base_crtp::min(); current_statement__ = 27; validate_non_negative_index("x1x2", "I", I); current_statement__ = 28; - x1x2 = Eigen::Matrix(I); - stan::math::fill(x1x2, std::numeric_limits::quiet_NaN()); current_statement__ = 29; K = 8; @@ -30771,20 +31501,8 @@ class stalled1_failure_model final : public model_base_crtp(); local_scalar_t__ alpha1; - alpha1 = DUMMY_VAR__; + alpha1 = DUMMY_VAR__; current_statement__ = 2; alpha1 = in__.template read(); local_scalar_t__ alpha2; - alpha2 = DUMMY_VAR__; + alpha2 = DUMMY_VAR__; current_statement__ = 3; alpha2 = in__.template read(); local_scalar_t__ alpha12; - alpha12 = DUMMY_VAR__; + alpha12 = DUMMY_VAR__; current_statement__ = 4; alpha12 = in__.template read(); local_scalar_t__ tau; - tau = DUMMY_VAR__; + tau = DUMMY_VAR__; current_statement__ = 5; tau = in__.template read_constrain_lb(0, lp__); std::vector> b; b = std::vector>(I, Eigen::Matrix(8)); - stan::math::fill(b, DUMMY_VAR__); + stan::math::fill(b, DUMMY_VAR__); current_statement__ = 6; b = in__.template read>>( I, 8); local_scalar_t__ sigma; - sigma = DUMMY_VAR__; + sigma = DUMMY_VAR__; lcm_sym17__ = (1 / stan::math::sqrt(tau)); sigma = lcm_sym17__; @@ -30895,7 +31613,8 @@ class stalled1_failure_model final : public model_base_crtp::quiet_NaN(); + alpha0 = std::numeric_limits::quiet_NaN(); current_statement__ = 1; alpha0 = in__.template read(); double alpha1; - alpha1 = std::numeric_limits::quiet_NaN(); + alpha1 = std::numeric_limits::quiet_NaN(); current_statement__ = 2; alpha1 = in__.template read(); double alpha2; - alpha2 = std::numeric_limits::quiet_NaN(); + alpha2 = std::numeric_limits::quiet_NaN(); current_statement__ = 3; alpha2 = in__.template read(); double alpha12; - alpha12 = std::numeric_limits::quiet_NaN(); + alpha12 = std::numeric_limits::quiet_NaN(); current_statement__ = 4; alpha12 = in__.template read(); double tau; - tau = std::numeric_limits::quiet_NaN(); + tau = std::numeric_limits::quiet_NaN(); current_statement__ = 5; tau = in__.template read_constrain_lb(0, lp__); std::vector> b; b = std::vector>(I, Eigen::Matrix(8)); - stan::math::fill(b, std::numeric_limits::quiet_NaN()); + stan::math::fill(b, std::numeric_limits::quiet_NaN()); current_statement__ = 6; b = in__.template read>>( I, 8); double sigma; - sigma = std::numeric_limits::quiet_NaN(); + sigma = std::numeric_limits::quiet_NaN(); vars__.emplace_back(alpha0); vars__.emplace_back(alpha1); @@ -30985,14 +31704,16 @@ class stalled1_failure_model final : public model_base_crtp::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; double alpha0; - alpha0 = std::numeric_limits::quiet_NaN(); + alpha0 = std::numeric_limits::quiet_NaN(); current_statement__ = 1; alpha0 = context__.vals_r("alpha0")[(1 - 1)]; double alpha1; - alpha1 = std::numeric_limits::quiet_NaN(); + alpha1 = std::numeric_limits::quiet_NaN(); current_statement__ = 2; alpha1 = context__.vals_r("alpha1")[(1 - 1)]; double alpha2; - alpha2 = std::numeric_limits::quiet_NaN(); + alpha2 = std::numeric_limits::quiet_NaN(); current_statement__ = 3; alpha2 = context__.vals_r("alpha2")[(1 - 1)]; double alpha12; - alpha12 = std::numeric_limits::quiet_NaN(); + alpha12 = std::numeric_limits::quiet_NaN(); current_statement__ = 4; alpha12 = context__.vals_r("alpha12")[(1 - 1)]; double tau; - tau = std::numeric_limits::quiet_NaN(); + tau = std::numeric_limits::quiet_NaN(); current_statement__ = 5; tau = context__.vals_r("tau")[(1 - 1)]; double tau_free__; - tau_free__ = std::numeric_limits::quiet_NaN(); + tau_free__ = std::numeric_limits::quiet_NaN(); current_statement__ = 5; tau_free__ = stan::math::lb_free(tau, 0); std::vector> b; b = std::vector>(I, Eigen::Matrix(8)); - stan::math::fill(b, std::numeric_limits::quiet_NaN()); + stan::math::fill(b, std::numeric_limits::quiet_NaN()); { std::vector b_flat__; @@ -31141,7 +31868,8 @@ class stalled1_failure_model final : public model_base_crtp& names__) const { - names__ = std::vector{"alpha0", - "alpha1", - "alpha2", - "alpha12", - "tau", - "b", - "sigma"}; + names__ = std::vector{"alpha0", "alpha1", "alpha2", + "alpha12", "tau", "b", "sigma"}; + } // get_param_names() inline void get_dims(std::vector>& dimss__) const { dimss__ = std::vector>{std::vector{}, - std::vector{}, - std::vector{}, - std::vector{}, - std::vector{}, - std::vector{static_cast(I), static_cast(K)}, - std::vector{}}; + std::vector{}, std::vector{}, std::vector{ + }, std::vector{}, + std::vector{static_cast(I), static_cast(K)}, + std::vector{}}; + } // get_dims() inline void constrained_param_names( @@ -31367,8 +32098,10 @@ class stalled1_failure_model final : public model_base_crtp vars_vec(vars.size()); + std::vector vars_vec; + vars_vec.reserve(vars.size()); std::vector params_i; write_array_impl(base_rng, params_r, params_i, vars_vec, emit_transformed_parameters, emit_generated_quantities, pstream); - vars.resize(vars_vec.size()); - for (int i = 0; i < vars.size(); ++i) { - vars.coeffRef(i) = vars_vec[i]; - } + vars = Eigen::Map>( + vars_vec.data(), vars_vec.size()); } template @@ -31443,7 +32179,8 @@ class stalled1_failure_model final : public model_base_crtp @@ -31464,13 +32201,12 @@ class stalled1_failure_model final : public model_base_crtp& params_r, std::ostream* pstream = nullptr) const final { - std::vector params_r_vec(params_r.size()); + std::vector params_r_vec; + params_r_vec.reserve(params_r.size()); std::vector params_i; transform_inits_impl(context, params_i, params_r_vec, pstream); - params_r.resize(params_r_vec.size()); - for (int i = 0; i < params_r.size(); ++i) { - params_r.coeffRef(i) = params_r_vec[i]; - } + params_r = Eigen::Map>( + params_r_vec.data(), params_r_vec.size()); } inline void transform_inits(const stan::io::var_context& context, std::vector& params_i, @@ -31582,7 +32318,7 @@ class unroll_limit_model final : public model_base_crtp { (void) DUMMY_VAR__; // suppress unused var warning try { int pos__; - pos__ = std::numeric_limits::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; } catch (const std::exception& e) { @@ -31592,13 +32328,6 @@ class unroll_limit_model final : public model_base_crtp { } num_params_r__ = 0U; - try { - - } catch (const std::exception& e) { - stan::lang::rethrow_located(e, locations_array__[current_statement__]); - // Next line prevents compiler griping about no return - throw std::runtime_error("*** IF YOU SEE THIS, PLEASE REPORT A BUG ***"); - } } template { return ; } int x; - x = std::numeric_limits::min(); + x = std::numeric_limits::min(); { current_statement__ = 2; x = (x + 2); for (int i = 2; i <= 100; ++i) { current_statement__ = 2; - x = (x + (1 + i));} + x = (x + (1 + i)); + } } { current_statement__ = 5; @@ -31934,7 +32664,8 @@ class unroll_limit_model final : public model_base_crtp { x = (x + -5); for (int i = -9; i <= 40; ++i) { current_statement__ = 11; - x = (x + (5 + i));} + x = (x + (5 + i)); + } } vars__.emplace_back(x); } catch (const std::exception& e) { @@ -31957,7 +32688,7 @@ class unroll_limit_model final : public model_base_crtp { try { int pos__; - pos__ = std::numeric_limits::min(); + pos__ = std::numeric_limits::min(); pos__ = 1; } catch (const std::exception& e) { @@ -31970,11 +32701,13 @@ class unroll_limit_model final : public model_base_crtp { inline void get_param_names(std::vector& names__) const { names__ = std::vector{"x"}; + } // get_param_names() inline void get_dims(std::vector>& dimss__) const { dimss__ = std::vector>{std::vector{}}; + } // get_dims() inline void constrained_param_names( @@ -32011,14 +32744,16 @@ class unroll_limit_model final : public model_base_crtp { } // unconstrained_param_names() - inline std::string get_constrained_sizedtypes() const final { + inline std::string get_constrained_sizedtypes() const { return std::string("[{\"name\":\"x\",\"type\":{\"name\":\"int\"},\"block\":\"generated_quantities\"}]"); + } // get_constrained_sizedtypes() - inline std::string get_unconstrained_sizedtypes() const final { + inline std::string get_unconstrained_sizedtypes() const { return std::string("[{\"name\":\"x\",\"type\":{\"name\":\"int\"},\"block\":\"generated_quantities\"}]"); + } // get_unconstrained_sizedtypes() @@ -32030,14 +32765,13 @@ class unroll_limit_model final : public model_base_crtp { const bool emit_transformed_parameters = true, const bool emit_generated_quantities = true, std::ostream* pstream = nullptr) const { - std::vector vars_vec(vars.size()); + std::vector vars_vec; + vars_vec.reserve(vars.size()); std::vector params_i; write_array_impl(base_rng, params_r, params_i, vars_vec, emit_transformed_parameters, emit_generated_quantities, pstream); - vars.resize(vars_vec.size()); - for (int i = 0; i < vars.size(); ++i) { - vars.coeffRef(i) = vars_vec[i]; - } + vars = Eigen::Map>( + vars_vec.data(), vars_vec.size()); } template @@ -32047,7 +32781,8 @@ class unroll_limit_model final : public model_base_crtp { bool emit_transformed_parameters = true, bool emit_generated_quantities = true, std::ostream* pstream = nullptr) const { - write_array_impl(base_rng, params_r, params_i, vars, emit_transformed_parameters, emit_generated_quantities, pstream); + write_array_impl(base_rng, params_r, params_i, vars, + emit_transformed_parameters, emit_generated_quantities, pstream); } template @@ -32068,13 +32803,12 @@ class unroll_limit_model final : public model_base_crtp { inline void transform_inits(const stan::io::var_context& context, Eigen::Matrix& params_r, std::ostream* pstream = nullptr) const final { - std::vector params_r_vec(params_r.size()); + std::vector params_r_vec; + params_r_vec.reserve(params_r.size()); std::vector params_i; transform_inits_impl(context, params_i, params_r_vec, pstream); - params_r.resize(params_r_vec.size()); - for (int i = 0; i < params_r.size(); ++i) { - params_r.coeffRef(i) = params_r_vec[i]; - } + params_r = Eigen::Map>( + params_r_vec.data(), params_r_vec.size()); } inline void transform_inits(const stan::io::var_context& context, std::vector& params_i, From 24e44ba8d6b4e693adf1d1366e0fc7c20eab9660 Mon Sep 17 00:00:00 2001 From: Steve Bronder Date: Mon, 5 Apr 2021 14:45:55 -0400 Subject: [PATCH 3/7] dune promote --- src/stan_math_backend/Stan_math_code_gen.ml | 6 +++--- src/stan_math_backend/Statement_gen.ml | 6 ++---- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/stan_math_backend/Stan_math_code_gen.ml b/src/stan_math_backend/Stan_math_code_gen.ml index e1349d6cda..4bfd4f5d1f 100644 --- a/src/stan_math_backend/Stan_math_code_gen.ml +++ b/src/stan_math_backend/Stan_math_code_gen.ml @@ -389,7 +389,7 @@ let pp_ctor ppf p = match is_input_data with | true -> pp_validate_data ppf (decl_id, st) ; - pp_set_size ppf (decl_id, st, DataOnly); + pp_set_size ppf (decl_id, st, DataOnly) | false -> () ) | Unsized _ -> () ) | _ -> pp_statement ppf s @@ -499,8 +499,8 @@ let pp_get_dims ppf {Program.output_vars; _} = ["std::vector>& dimss__"] nop (fun ppf -> - pf ppf "@[dimss__ = std::vector>{%a};@]@," pp_output_var - dim_list ) + pf ppf "@[dimss__ = std::vector>{%a};@]@," + pp_output_var dim_list ) ~cv_attr:["const"] let pp_method_b ppf rt name params intro ?(outro = nop) ?(cv_attr = ["const"]) diff --git a/src/stan_math_backend/Statement_gen.ml b/src/stan_math_backend/Statement_gen.ml index 6e314eb415..db9fbd5319 100644 --- a/src/stan_math_backend/Statement_gen.ml +++ b/src/stan_math_backend/Statement_gen.ml @@ -46,8 +46,6 @@ let pp_set_size ppf (decl_id, st, adtype) = in pf ppf "@[%s = %a;@,%a @]@," decl_id pp_size_ctor st print_fill st - - let%expect_test "set size mat array" = let int = Expr.Helpers.int in strf "@[%a@]" pp_set_size @@ -61,8 +59,8 @@ let%expect_test "set size mat array" = (** [pp_for_loop ppf (loopvar, lower, upper, pp_body, body)] tries to pretty print a for-loop from lower to upper given some loopvar.*) let pp_for_loop ppf (loopvar, lower, upper, pp_body, body) = - pf ppf "@[for (@[int %s = %a;@ %s <= %a;@ ++%s@])" loopvar pp_expr - lower loopvar pp_expr upper loopvar ; + pf ppf "@[for (@[int %s = %a;@ %s <= %a;@ ++%s@])" loopvar pp_expr lower + loopvar pp_expr upper loopvar ; pf ppf " %a@]" pp_body body let rec integer_el_type = function From a6ed5cbb79d483e0a06ad5ee5a3e363a8831e83a Mon Sep 17 00:00:00 2001 From: Steve Bronder Date: Mon, 5 Apr 2021 15:28:26 -0400 Subject: [PATCH 4/7] remove na fill for data --- src/stan_math_backend/Stan_math_code_gen.ml | 3 +- .../cli-args/filename_good.expected | 2 + test/integration/good/code-gen/cl.expected | 26 +- test/integration/good/code-gen/cpp.expected | 287 +++++++----------- .../good/code-gen/expressions/cpp.expected | 3 - .../good/code-gen/opencl/cpp.expected | 20 -- .../good/code-gen/profiling/cpp.expected | 5 +- .../good/compiler-optimizations/cpp.expected | 176 +++-------- 8 files changed, 165 insertions(+), 357 deletions(-) diff --git a/src/stan_math_backend/Stan_math_code_gen.ml b/src/stan_math_backend/Stan_math_code_gen.ml index 4bfd4f5d1f..02a8c6af82 100644 --- a/src/stan_math_backend/Stan_math_code_gen.ml +++ b/src/stan_math_backend/Stan_math_code_gen.ml @@ -389,8 +389,7 @@ let pp_ctor ppf p = match is_input_data with | true -> pp_validate_data ppf (decl_id, st) ; - pp_set_size ppf (decl_id, st, DataOnly) - | false -> () ) + | false -> pp_set_size ppf (decl_id, st, DataOnly) ) | Unsized _ -> () ) | _ -> pp_statement ppf s in diff --git a/test/integration/cli-args/filename_good.expected b/test/integration/cli-args/filename_good.expected index f476efb5ba..df294783a4 100644 --- a/test/integration/cli-args/filename_good.expected +++ b/test/integration/cli-args/filename_good.expected @@ -59,8 +59,10 @@ class filename_good_model final : public model_base_crtp { pos__ = 1; current_statement__ = 1; + p = std::numeric_limits::quiet_NaN(); current_statement__ = 2; + q = std::numeric_limits::quiet_NaN(); current_statement__ = 2; q = (p + 5); diff --git a/test/integration/good/code-gen/cl.expected b/test/integration/good/code-gen/cl.expected index 990752c85b..33c6dfe8c2 100644 --- a/test/integration/good/code-gen/cl.expected +++ b/test/integration/good/code-gen/cl.expected @@ -298,7 +298,6 @@ class optimize_glm_model final : public model_base_crtp { current_statement__ = 176; context__.validate_dims("data initialization","k","int", std::vector{}); - k = std::numeric_limits::min(); current_statement__ = 176; k = context__.vals_i("k")[(1 - 1)]; @@ -307,7 +306,6 @@ class optimize_glm_model final : public model_base_crtp { current_statement__ = 177; context__.validate_dims("data initialization","n","int", std::vector{}); - n = std::numeric_limits::min(); current_statement__ = 177; n = context__.vals_i("n")[(1 - 1)]; @@ -321,8 +319,6 @@ class optimize_glm_model final : public model_base_crtp { context__.validate_dims("data initialization","X_d","double", std::vector{static_cast(n), static_cast(k)}); - X_d = Eigen::Matrix(n, k); - stan::math::fill(X_d, std::numeric_limits::quiet_NaN()); { std::vector X_d_flat__; @@ -350,8 +346,6 @@ class optimize_glm_model final : public model_base_crtp { context__.validate_dims("data initialization","X_d_a","double", std::vector{static_cast(2), static_cast(n), static_cast(k)}); - X_d_a = std::vector>(2, Eigen::Matrix(n, k)); - stan::math::fill(X_d_a, std::numeric_limits::quiet_NaN()); { std::vector X_d_a_flat__; @@ -381,8 +375,6 @@ class optimize_glm_model final : public model_base_crtp { current_statement__ = 185; context__.validate_dims("data initialization","y_v_d","double", std::vector{static_cast(n)}); - y_v_d = Eigen::Matrix(n); - stan::math::fill(y_v_d, std::numeric_limits::quiet_NaN()); { std::vector y_v_d_flat__; @@ -404,8 +396,6 @@ class optimize_glm_model final : public model_base_crtp { current_statement__ = 187; context__.validate_dims("data initialization","X_rv_d","double", std::vector{static_cast(n)}); - X_rv_d = Eigen::Matrix(n); - stan::math::fill(X_rv_d, std::numeric_limits::quiet_NaN()); { std::vector X_rv_d_flat__; @@ -427,7 +417,6 @@ class optimize_glm_model final : public model_base_crtp { current_statement__ = 189; context__.validate_dims("data initialization","y_vi_d","int", std::vector{static_cast(n)}); - y_vi_d = std::vector(n, std::numeric_limits::min()); current_statement__ = 189; y_vi_d = context__.vals_i("y_vi_d"); @@ -436,53 +425,62 @@ class optimize_glm_model final : public model_base_crtp { current_statement__ = 191; context__.validate_dims("data initialization","y2_vi_d","int", std::vector{static_cast(n)}); - y2_vi_d = std::vector(n, std::numeric_limits::min()); current_statement__ = 191; y2_vi_d = context__.vals_i("y2_vi_d"); current_statement__ = 192; context__.validate_dims("data initialization","y_s_d","int", std::vector{}); - y_s_d = std::numeric_limits::min(); current_statement__ = 192; y_s_d = context__.vals_i("y_s_d")[(1 - 1)]; current_statement__ = 193; context__.validate_dims("data initialization","y_r_d","double", std::vector{}); - y_r_d = std::numeric_limits::quiet_NaN(); current_statement__ = 193; y_r_d = context__.vals_r("y_r_d")[(1 - 1)]; current_statement__ = 194; + k_td = std::numeric_limits::min(); current_statement__ = 195; + n_td = std::numeric_limits::min(); current_statement__ = 196; validate_non_negative_index("X_d_td", "n", n); current_statement__ = 197; validate_non_negative_index("X_d_td", "k", k); current_statement__ = 198; + X_d_td = Eigen::Matrix(n, k); + stan::math::fill(X_d_td, std::numeric_limits::quiet_NaN()); current_statement__ = 199; validate_non_negative_index("y_v_d_td", "n", n); current_statement__ = 200; + y_v_d_td = Eigen::Matrix(n); + stan::math::fill(y_v_d_td, std::numeric_limits::quiet_NaN()); current_statement__ = 201; validate_non_negative_index("X_rv_d_td", "n", n); current_statement__ = 202; + X_rv_d_td = Eigen::Matrix(n); + stan::math::fill(X_rv_d_td, std::numeric_limits::quiet_NaN()); current_statement__ = 203; validate_non_negative_index("y_vi_d_td", "n", n); current_statement__ = 204; + y_vi_d_td = std::vector(n, std::numeric_limits::min()); current_statement__ = 205; validate_non_negative_index("y2_vi_d_td", "n", n); current_statement__ = 206; + y2_vi_d_td = std::vector(n, std::numeric_limits::min()); current_statement__ = 207; + y_s_d_td = std::numeric_limits::min(); current_statement__ = 208; + y_r_d_td = std::numeric_limits::quiet_NaN(); current_statement__ = 194; check_greater_or_equal(function__, "k_td", k_td, 1); diff --git a/test/integration/good/code-gen/cpp.expected b/test/integration/good/code-gen/cpp.expected index 0e4667c18f..a3b0002a9f 100644 --- a/test/integration/good/code-gen/cpp.expected +++ b/test/integration/good/code-gen/cpp.expected @@ -75,7 +75,6 @@ class _8_schools_ncp_model final : public model_base_crtp<_8_schools_ncp_model> current_statement__ = 9; context__.validate_dims("data initialization","J","int", std::vector{}); - J = std::numeric_limits::min(); current_statement__ = 9; J = context__.vals_i("J")[(1 - 1)]; @@ -86,7 +85,6 @@ class _8_schools_ncp_model final : public model_base_crtp<_8_schools_ncp_model> current_statement__ = 11; context__.validate_dims("data initialization","y","double", std::vector{static_cast(J)}); - y = std::vector(J, std::numeric_limits::quiet_NaN()); current_statement__ = 11; y = context__.vals_r("y"); @@ -95,8 +93,6 @@ class _8_schools_ncp_model final : public model_base_crtp<_8_schools_ncp_model> current_statement__ = 13; context__.validate_dims("data initialization","sigma","double", std::vector{static_cast(J)}); - sigma = std::vector(J, std::numeric_limits::quiet_NaN()); - current_statement__ = 13; sigma = context__.vals_r("sigma"); @@ -541,7 +537,6 @@ class _8start_with_number_model final : public model_base_crtp<_8start_with_numb current_statement__ = 2; context__.validate_dims("data initialization","good_model","int", std::vector{}); - good_model = std::numeric_limits::min(); current_statement__ = 2; good_model = context__.vals_i("good_model")[(1 - 1)]; @@ -878,7 +873,6 @@ class eight_schools_ncp_model final : public model_base_crtp{}); - J = std::numeric_limits::min(); current_statement__ = 9; J = context__.vals_i("J")[(1 - 1)]; @@ -889,7 +883,6 @@ class eight_schools_ncp_model final : public model_base_crtp{static_cast(J)}); - y = std::vector(J, std::numeric_limits::quiet_NaN()); current_statement__ = 11; y = context__.vals_r("y"); @@ -898,8 +891,6 @@ class eight_schools_ncp_model final : public model_base_crtp{static_cast(J)}); - sigma = std::vector(J, std::numeric_limits::quiet_NaN()); - current_statement__ = 13; sigma = context__.vals_r("sigma"); @@ -1346,6 +1337,7 @@ class mixed_type_arrays_model final : public model_base_crtp(3, std::numeric_limits::quiet_NaN()); } catch (const std::exception& e) { stan::lang::rethrow_located(e, locations_array__[current_statement__]); @@ -4655,7 +4647,6 @@ class mother_model final : public model_base_crtp { current_statement__ = 186; context__.validate_dims("data initialization","N","int", std::vector{}); - N = std::numeric_limits::min(); current_statement__ = 186; N = context__.vals_i("N")[(1 - 1)]; @@ -4664,7 +4655,6 @@ class mother_model final : public model_base_crtp { current_statement__ = 187; context__.validate_dims("data initialization","M","int", std::vector{}); - M = std::numeric_limits::min(); current_statement__ = 187; M = context__.vals_i("M")[(1 - 1)]; @@ -4673,7 +4663,6 @@ class mother_model final : public model_base_crtp { current_statement__ = 188; context__.validate_dims("data initialization","K","int", std::vector{}); - K = std::numeric_limits::min(); current_statement__ = 188; K = context__.vals_i("K")[(1 - 1)]; @@ -4686,7 +4675,6 @@ class mother_model final : public model_base_crtp { current_statement__ = 190; context__.validate_dims("data initialization","d_int_1d_ar","int", std::vector{static_cast(N)}); - d_int_1d_ar = std::vector(N, std::numeric_limits::min()); current_statement__ = 190; d_int_1d_ar = context__.vals_i("d_int_1d_ar"); @@ -4706,8 +4694,6 @@ class mother_model final : public model_base_crtp { context__.validate_dims("data initialization","d_int_3d_ar","int", std::vector{static_cast(N), static_cast(M), static_cast(K)}); - d_int_3d_ar = std::vector>>(N, std::vector>(M, std::vector(K, std::numeric_limits::min()))); - { std::vector d_int_3d_ar_flat__; @@ -4749,7 +4735,6 @@ class mother_model final : public model_base_crtp { current_statement__ = 195; context__.validate_dims("data initialization","J","double", std::vector{}); - J = std::numeric_limits::quiet_NaN(); current_statement__ = 195; J = context__.vals_r("J")[(1 - 1)]; @@ -4762,8 +4747,6 @@ class mother_model final : public model_base_crtp { current_statement__ = 197; context__.validate_dims("data initialization","d_real_1d_ar","double", std::vector{static_cast(N)}); - d_real_1d_ar = std::vector(N, std::numeric_limits::quiet_NaN()); - current_statement__ = 197; d_real_1d_ar = context__.vals_r("d_real_1d_ar"); @@ -4777,8 +4760,6 @@ class mother_model final : public model_base_crtp { context__.validate_dims("data initialization","d_real_3d_ar","double", std::vector{static_cast(N), static_cast(M), static_cast(K)}); - d_real_3d_ar = std::vector>>(N, std::vector>(M, std::vector(K, std::numeric_limits::quiet_NaN()))); - { std::vector d_real_3d_ar_flat__; @@ -4808,8 +4789,6 @@ class mother_model final : public model_base_crtp { current_statement__ = 203; context__.validate_dims("data initialization","d_vec","double", std::vector{static_cast(N)}); - d_vec = Eigen::Matrix(N); - stan::math::fill(d_vec, std::numeric_limits::quiet_NaN()); { std::vector d_vec_flat__; @@ -4834,8 +4813,6 @@ class mother_model final : public model_base_crtp { context__.validate_dims("data initialization","d_1d_vec","double", std::vector{static_cast(N), static_cast(N)}); - d_1d_vec = std::vector>(N, Eigen::Matrix(N)); - stan::math::fill(d_1d_vec, std::numeric_limits::quiet_NaN()); { std::vector d_1d_vec_flat__; @@ -4869,8 +4846,6 @@ class mother_model final : public model_base_crtp { std::vector{static_cast(N), static_cast(M), static_cast(K), static_cast(N)}); - d_3d_vec = std::vector>>>(N, std::vector>>(M, std::vector>(K, Eigen::Matrix(N)))); - stan::math::fill(d_3d_vec, std::numeric_limits::quiet_NaN()); { std::vector d_3d_vec_flat__; @@ -4904,8 +4879,6 @@ class mother_model final : public model_base_crtp { current_statement__ = 213; context__.validate_dims("data initialization","d_row_vec","double", std::vector{static_cast(N)}); - d_row_vec = Eigen::Matrix(N); - stan::math::fill(d_row_vec, std::numeric_limits::quiet_NaN()); { std::vector d_row_vec_flat__; @@ -4930,8 +4903,6 @@ class mother_model final : public model_base_crtp { context__.validate_dims("data initialization","d_1d_row_vec","double", std::vector{static_cast(N), static_cast(N)}); - d_1d_row_vec = std::vector>(N, Eigen::Matrix(N)); - stan::math::fill(d_1d_row_vec, std::numeric_limits::quiet_NaN()); { std::vector d_1d_row_vec_flat__; @@ -4965,8 +4936,6 @@ class mother_model final : public model_base_crtp { std::vector{static_cast(N), static_cast(M), static_cast(K), static_cast(N)}); - d_3d_row_vec = std::vector>>>(N, std::vector>>(M, std::vector>(K, Eigen::Matrix(N)))); - stan::math::fill(d_3d_row_vec, std::numeric_limits::quiet_NaN()); { std::vector d_3d_row_vec_flat__; @@ -5000,8 +4969,6 @@ class mother_model final : public model_base_crtp { std::vector{static_cast(4), static_cast(5), static_cast(2), static_cast(3)}); - d_ar_mat = std::vector>>(4, std::vector>(5, Eigen::Matrix(2, 3))); - stan::math::fill(d_ar_mat, std::numeric_limits::quiet_NaN()); { std::vector d_ar_mat_flat__; @@ -5073,8 +5040,6 @@ class mother_model final : public model_base_crtp { current_statement__ = 224; context__.validate_dims("data initialization","d_simplex","double", std::vector{static_cast(N)}); - d_simplex = Eigen::Matrix(N); - stan::math::fill(d_simplex, std::numeric_limits::quiet_NaN()); { std::vector d_simplex_flat__; @@ -5101,8 +5066,6 @@ class mother_model final : public model_base_crtp { context__.validate_dims("data initialization","d_1d_simplex","double", std::vector{static_cast(N), static_cast(N)}); - d_1d_simplex = std::vector>(N, Eigen::Matrix(N)); - stan::math::fill(d_1d_simplex, std::numeric_limits::quiet_NaN()); { std::vector d_1d_simplex_flat__; @@ -5142,8 +5105,6 @@ class mother_model final : public model_base_crtp { std::vector{static_cast(N), static_cast(M), static_cast(K), static_cast(N)}); - d_3d_simplex = std::vector>>>(N, std::vector>>(M, std::vector>(K, Eigen::Matrix(N)))); - stan::math::fill(d_3d_simplex, std::numeric_limits::quiet_NaN()); { std::vector d_3d_simplex_flat__; @@ -5189,8 +5150,6 @@ class mother_model final : public model_base_crtp { context__.validate_dims("data initialization","d_cfcov_54","double", std::vector{static_cast(5), static_cast(4)}); - d_cfcov_54 = Eigen::Matrix(5, 4); - stan::math::fill(d_cfcov_54, std::numeric_limits::quiet_NaN()); { std::vector d_cfcov_54_flat__; @@ -5217,8 +5176,6 @@ class mother_model final : public model_base_crtp { context__.validate_dims("data initialization","d_cfcov_33","double", std::vector{static_cast(3), static_cast(3)}); - d_cfcov_33 = Eigen::Matrix(3, 3); - stan::math::fill(d_cfcov_33, std::numeric_limits::quiet_NaN()); { std::vector d_cfcov_33_flat__; @@ -5247,8 +5204,6 @@ class mother_model final : public model_base_crtp { context__.validate_dims("data initialization","d_cfcov_33_ar","double", std::vector{static_cast(K), static_cast(3), static_cast(3)}); - d_cfcov_33_ar = std::vector>(K, Eigen::Matrix(3, 3)); - stan::math::fill(d_cfcov_33_ar, std::numeric_limits::quiet_NaN()); { std::vector d_cfcov_33_ar_flat__; @@ -5282,7 +5237,6 @@ class mother_model final : public model_base_crtp { current_statement__ = 237; context__.validate_dims("data initialization","d_int","int", std::vector{}); - d_int = std::numeric_limits::min(); current_statement__ = 237; d_int = context__.vals_i("d_int")[(1 - 1)]; @@ -5291,8 +5245,6 @@ class mother_model final : public model_base_crtp { current_statement__ = 239; context__.validate_dims("data initialization","d_int_array","int", std::vector{static_cast(d_int)}); - d_int_array = std::vector(d_int, std::numeric_limits::min()); - current_statement__ = 239; d_int_array = context__.vals_i("d_int_array"); @@ -5302,8 +5254,6 @@ class mother_model final : public model_base_crtp { context__.validate_dims("data initialization","d_int_array_2d","int", std::vector{static_cast(d_int), static_cast(2)}); - d_int_array_2d = std::vector>(d_int, std::vector(2, std::numeric_limits::min())); - { std::vector d_int_array_2d_flat__; @@ -5330,8 +5280,6 @@ class mother_model final : public model_base_crtp { context__.validate_dims("data initialization","d_int_array_3d","int", std::vector{static_cast(d_int), static_cast(2), static_cast(3)}); - d_int_array_3d = std::vector>>(d_int, std::vector>(2, std::vector(3, std::numeric_limits::min()))); - { std::vector d_int_array_3d_flat__; @@ -5359,7 +5307,6 @@ class mother_model final : public model_base_crtp { current_statement__ = 244; context__.validate_dims("data initialization","d_real","double", std::vector{}); - d_real = std::numeric_limits::quiet_NaN(); current_statement__ = 244; d_real = context__.vals_r("d_real")[(1 - 1)]; @@ -5368,8 +5315,6 @@ class mother_model final : public model_base_crtp { current_statement__ = 246; context__.validate_dims("data initialization","d_real_array","double", std::vector{static_cast(d_int)}); - d_real_array = std::vector(d_int, std::numeric_limits::quiet_NaN()); - current_statement__ = 246; d_real_array = context__.vals_r("d_real_array"); @@ -5380,8 +5325,6 @@ class mother_model final : public model_base_crtp { "double", std::vector{static_cast(d_int), static_cast(2)}); - d_real_array_2d = std::vector>(d_int, std::vector(2, std::numeric_limits::quiet_NaN())); - { std::vector d_real_array_2d_flat__; @@ -5409,8 +5352,6 @@ class mother_model final : public model_base_crtp { "double", std::vector{static_cast(d_int), static_cast(2), static_cast(3)}); - d_real_array_3d = std::vector>>(d_int, std::vector>(2, std::vector(3, std::numeric_limits::quiet_NaN()))); - { std::vector d_real_array_3d_flat__; @@ -5443,8 +5384,6 @@ class mother_model final : public model_base_crtp { context__.validate_dims("data initialization","d_matrix","double", std::vector{static_cast(d_int), static_cast(d_int)}); - d_matrix = Eigen::Matrix(d_int, d_int); - stan::math::fill(d_matrix, std::numeric_limits::quiet_NaN()); { std::vector d_matrix_flat__; @@ -5476,8 +5415,6 @@ class mother_model final : public model_base_crtp { "double", std::vector{static_cast(d_int), static_cast(d_int), static_cast(d_int)}); - d_matrix_array = std::vector>(d_int, Eigen::Matrix(d_int, d_int)); - stan::math::fill(d_matrix_array, std::numeric_limits::quiet_NaN()); { std::vector d_matrix_array_flat__; @@ -5514,8 +5451,6 @@ class mother_model final : public model_base_crtp { std::vector{static_cast(d_int), static_cast(2), static_cast(d_int), static_cast(d_int)}); - d_matrix_array_2d = std::vector>>(d_int, std::vector>(2, Eigen::Matrix(d_int, d_int))); - stan::math::fill(d_matrix_array_2d, std::numeric_limits::quiet_NaN()); { std::vector d_matrix_array_2d_flat__; @@ -5557,8 +5492,6 @@ class mother_model final : public model_base_crtp { std::vector{static_cast(d_int), static_cast(2), static_cast(3), static_cast(d_int), static_cast(d_int)}); - d_matrix_array_3d = std::vector>>>(d_int, std::vector>>(2, std::vector>(3, Eigen::Matrix(d_int, d_int)))); - stan::math::fill(d_matrix_array_3d, std::numeric_limits::quiet_NaN()); { std::vector d_matrix_array_3d_flat__; @@ -5597,8 +5530,6 @@ class mother_model final : public model_base_crtp { current_statement__ = 267; context__.validate_dims("data initialization","d_vector","double", std::vector{static_cast(d_int)}); - d_vector = Eigen::Matrix(d_int); - stan::math::fill(d_vector, std::numeric_limits::quiet_NaN()); { std::vector d_vector_flat__; @@ -5624,8 +5555,6 @@ class mother_model final : public model_base_crtp { "double", std::vector{static_cast(d_int), static_cast(d_int)}); - d_vector_array = std::vector>(d_int, Eigen::Matrix(d_int)); - stan::math::fill(d_vector_array, std::numeric_limits::quiet_NaN()); { std::vector d_vector_array_flat__; @@ -5655,8 +5584,6 @@ class mother_model final : public model_base_crtp { "double", std::vector{static_cast(d_int), static_cast(2), static_cast(d_int)}); - d_vector_array_2d = std::vector>>(d_int, std::vector>(2, Eigen::Matrix(d_int))); - stan::math::fill(d_vector_array_2d, std::numeric_limits::quiet_NaN()); { std::vector d_vector_array_2d_flat__; @@ -5692,8 +5619,6 @@ class mother_model final : public model_base_crtp { std::vector{static_cast(d_int), static_cast(2), static_cast(3), static_cast(d_int)}); - d_vector_array_3d = std::vector>>>(d_int, std::vector>>(2, std::vector>(3, Eigen::Matrix(d_int)))); - stan::math::fill(d_vector_array_3d, std::numeric_limits::quiet_NaN()); { std::vector d_vector_array_3d_flat__; @@ -5728,8 +5653,6 @@ class mother_model final : public model_base_crtp { current_statement__ = 278; context__.validate_dims("data initialization","d_row_vector","double", std::vector{static_cast(d_int)}); - d_row_vector = Eigen::Matrix(d_int); - stan::math::fill(d_row_vector, std::numeric_limits::quiet_NaN()); { std::vector d_row_vector_flat__; @@ -5755,8 +5678,6 @@ class mother_model final : public model_base_crtp { "double", std::vector{static_cast(d_int), static_cast(d_int)}); - d_row_vector_array = std::vector>(d_int, Eigen::Matrix(d_int)); - stan::math::fill(d_row_vector_array, std::numeric_limits::quiet_NaN()); { std::vector d_row_vector_array_flat__; @@ -5787,8 +5708,6 @@ class mother_model final : public model_base_crtp { "double", std::vector{static_cast(d_int), static_cast(2), static_cast(d_int)}); - d_row_vector_array_2d = std::vector>>(d_int, std::vector>(2, Eigen::Matrix(d_int))); - stan::math::fill(d_row_vector_array_2d, std::numeric_limits::quiet_NaN()); { std::vector d_row_vector_array_2d_flat__; @@ -5824,8 +5743,6 @@ class mother_model final : public model_base_crtp { std::vector{static_cast(d_int), static_cast(2), static_cast(3), static_cast(d_int)}); - d_row_vector_array_3d = std::vector>>>(d_int, std::vector>>(2, std::vector>(3, Eigen::Matrix(d_int)))); - stan::math::fill(d_row_vector_array_3d, std::numeric_limits::quiet_NaN()); { std::vector d_row_vector_array_3d_flat__; @@ -5856,40 +5773,52 @@ class mother_model final : public model_base_crtp { } } current_statement__ = 288; + td_int = std::numeric_limits::min(); current_statement__ = 289; validate_non_negative_index("td_1d", "N", N); current_statement__ = 290; + td_1d = std::vector(N, std::numeric_limits::min()); current_statement__ = 291; validate_non_negative_index("td_1dk", "M", M); current_statement__ = 292; + td_1dk = std::vector(M, std::numeric_limits::min()); current_statement__ = 292; assign(td_1dk, rep_array(1, M), "assigning variable td_1dk"); current_statement__ = 293; + td_a = std::numeric_limits::min(); current_statement__ = 293; td_a = N; current_statement__ = 294; + td_b = std::numeric_limits::quiet_NaN(); current_statement__ = 294; td_b = (N * J); current_statement__ = 295; + td_c = std::numeric_limits::quiet_NaN(); current_statement__ = 295; td_c = foo_bar1(td_b, pstream__); current_statement__ = 296; + td_ar_mat = std::vector>>(4, std::vector>(5, Eigen::Matrix(2, 3))); + stan::math::fill(td_ar_mat, std::numeric_limits::quiet_NaN()); current_statement__ = 297; validate_non_negative_index("td_simplex", "N", N); current_statement__ = 298; + td_simplex = Eigen::Matrix(N); + stan::math::fill(td_simplex, std::numeric_limits::quiet_NaN()); current_statement__ = 299; validate_non_negative_index("td_1d_simplex", "N", N); current_statement__ = 300; validate_non_negative_index("td_1d_simplex", "N", N); current_statement__ = 301; + td_1d_simplex = std::vector>(N, Eigen::Matrix(N)); + stan::math::fill(td_1d_simplex, std::numeric_limits::quiet_NaN()); current_statement__ = 302; validate_non_negative_index("td_3d_simplex", "N", N); @@ -5900,22 +5829,39 @@ class mother_model final : public model_base_crtp { current_statement__ = 305; validate_non_negative_index("td_3d_simplex", "N", N); current_statement__ = 306; + td_3d_simplex = std::vector>>>(N, std::vector>>(M, std::vector>(K, Eigen::Matrix(N)))); + stan::math::fill(td_3d_simplex, std::numeric_limits::quiet_NaN()); current_statement__ = 307; + td_cfcov_54 = Eigen::Matrix(5, 5); + stan::math::fill(td_cfcov_54, std::numeric_limits::quiet_NaN()); current_statement__ = 308; + td_cfcov_33 = Eigen::Matrix(3, 3); + stan::math::fill(td_cfcov_33, std::numeric_limits::quiet_NaN()); current_statement__ = 309; + x = Eigen::Matrix(2); + stan::math::fill(x, std::numeric_limits::quiet_NaN()); current_statement__ = 310; + y = Eigen::Matrix(2); + stan::math::fill(y, std::numeric_limits::quiet_NaN()); current_statement__ = 311; + dat = std::vector(0, std::numeric_limits::quiet_NaN()); + current_statement__ = 312; + dat_int = std::vector(0, std::numeric_limits::min()); current_statement__ = 313; + x_r = std::vector>(0, std::vector(0, std::numeric_limits::quiet_NaN())); + current_statement__ = 314; + x_i = std::vector>(0, std::vector(0, std::numeric_limits::min())); + current_statement__ = 315; td_int = (primitive_value(1) || primitive_value(2)); @@ -6050,37 +5996,50 @@ class mother_model final : public model_base_crtp { rvalue(td_1d_simplex, "td_1d_simplex", index_uni(1), index_min_max(1, N)), "assigning variable td_simplex"); current_statement__ = 357; + arr_mul_ind = std::vector>(2, std::vector(2, std::numeric_limits::min())); + current_statement__ = 358; assign(arr_mul_ind, std::vector{1, 1}, "assigning variable arr_mul_ind", index_uni(1), index_min_max(1, 2)); current_statement__ = 359; + x_mul_ind = std::vector(2, std::numeric_limits::quiet_NaN()); + current_statement__ = 359; assign(x_mul_ind, std::vector{1, 2}, "assigning variable x_mul_ind"); current_statement__ = 360; + transformed_data_real = std::numeric_limits::quiet_NaN(); current_statement__ = 361; validate_non_negative_index("transformed_data_real_array", "d_int", d_int); current_statement__ = 362; + transformed_data_real_array = std::vector(d_int, std::numeric_limits::quiet_NaN()); + current_statement__ = 363; validate_non_negative_index("transformed_data_real_array_2d", "d_int", d_int); current_statement__ = 364; + transformed_data_real_array_2d = std::vector>(d_int, std::vector(2, std::numeric_limits::quiet_NaN())); + current_statement__ = 365; validate_non_negative_index("transformed_data_real_array_3d", "d_int", d_int); current_statement__ = 366; + transformed_data_real_array_3d = std::vector>>(d_int, std::vector>(2, std::vector(3, std::numeric_limits::quiet_NaN()))); + current_statement__ = 367; validate_non_negative_index("transformed_data_matrix", "d_int", d_int); current_statement__ = 368; validate_non_negative_index("transformed_data_matrix", "d_int", d_int); current_statement__ = 369; + transformed_data_matrix = Eigen::Matrix(d_int, d_int); + stan::math::fill(transformed_data_matrix, std::numeric_limits::quiet_NaN()); current_statement__ = 370; validate_non_negative_index("transformed_data_matrix_array", "d_int", @@ -6092,6 +6051,8 @@ class mother_model final : public model_base_crtp { validate_non_negative_index("transformed_data_matrix_array", "d_int", d_int); current_statement__ = 373; + transformed_data_matrix_array = std::vector>(d_int, Eigen::Matrix(d_int, d_int)); + stan::math::fill(transformed_data_matrix_array, std::numeric_limits::quiet_NaN()); current_statement__ = 374; validate_non_negative_index("transformed_data_matrix_array_2d", @@ -6103,6 +6064,8 @@ class mother_model final : public model_base_crtp { validate_non_negative_index("transformed_data_matrix_array_2d", "d_int", d_int); current_statement__ = 377; + transformed_data_matrix_array_2d = std::vector>>(d_int, std::vector>(2, Eigen::Matrix(d_int, d_int))); + stan::math::fill(transformed_data_matrix_array_2d, std::numeric_limits::quiet_NaN()); current_statement__ = 378; validate_non_negative_index("transformed_data_matrix_array_3d", @@ -6114,10 +6077,14 @@ class mother_model final : public model_base_crtp { validate_non_negative_index("transformed_data_matrix_array_3d", "d_int", d_int); current_statement__ = 381; + transformed_data_matrix_array_3d = std::vector>>>(d_int, std::vector>>(2, std::vector>(3, Eigen::Matrix(d_int, d_int)))); + stan::math::fill(transformed_data_matrix_array_3d, std::numeric_limits::quiet_NaN()); current_statement__ = 382; validate_non_negative_index("transformed_data_vector", "d_int", d_int); current_statement__ = 383; + transformed_data_vector = Eigen::Matrix(d_int); + stan::math::fill(transformed_data_vector, std::numeric_limits::quiet_NaN()); current_statement__ = 384; validate_non_negative_index("transformed_data_vector_array", "d_int", @@ -6126,6 +6093,8 @@ class mother_model final : public model_base_crtp { validate_non_negative_index("transformed_data_vector_array", "d_int", d_int); current_statement__ = 386; + transformed_data_vector_array = std::vector>(d_int, Eigen::Matrix(d_int)); + stan::math::fill(transformed_data_vector_array, std::numeric_limits::quiet_NaN()); current_statement__ = 387; validate_non_negative_index("transformed_data_vector_array_2d", @@ -6134,6 +6103,8 @@ class mother_model final : public model_base_crtp { validate_non_negative_index("transformed_data_vector_array_2d", "d_int", d_int); current_statement__ = 389; + transformed_data_vector_array_2d = std::vector>>(d_int, std::vector>(2, Eigen::Matrix(d_int))); + stan::math::fill(transformed_data_vector_array_2d, std::numeric_limits::quiet_NaN()); current_statement__ = 390; validate_non_negative_index("transformed_data_vector_array_3d", @@ -6142,11 +6113,15 @@ class mother_model final : public model_base_crtp { validate_non_negative_index("transformed_data_vector_array_3d", "d_int", d_int); current_statement__ = 392; + transformed_data_vector_array_3d = std::vector>>>(d_int, std::vector>>(2, std::vector>(3, Eigen::Matrix(d_int)))); + stan::math::fill(transformed_data_vector_array_3d, std::numeric_limits::quiet_NaN()); current_statement__ = 393; validate_non_negative_index("transformed_data_row_vector", "d_int", d_int); current_statement__ = 394; + transformed_data_row_vector = Eigen::Matrix(d_int); + stan::math::fill(transformed_data_row_vector, std::numeric_limits::quiet_NaN()); current_statement__ = 395; validate_non_negative_index("transformed_data_row_vector_array", @@ -6155,6 +6130,8 @@ class mother_model final : public model_base_crtp { validate_non_negative_index("transformed_data_row_vector_array", "d_int", d_int); current_statement__ = 397; + transformed_data_row_vector_array = std::vector>(d_int, Eigen::Matrix(d_int)); + stan::math::fill(transformed_data_row_vector_array, std::numeric_limits::quiet_NaN()); current_statement__ = 398; validate_non_negative_index("transformed_data_row_vector_array_2d", @@ -6163,6 +6140,8 @@ class mother_model final : public model_base_crtp { validate_non_negative_index("transformed_data_row_vector_array_2d", "d_int", d_int); current_statement__ = 400; + transformed_data_row_vector_array_2d = std::vector>>(d_int, std::vector>(2, Eigen::Matrix(d_int))); + stan::math::fill(transformed_data_row_vector_array_2d, std::numeric_limits::quiet_NaN()); current_statement__ = 401; validate_non_negative_index("transformed_data_row_vector_array_3d", @@ -6171,6 +6150,8 @@ class mother_model final : public model_base_crtp { validate_non_negative_index("transformed_data_row_vector_array_3d", "d_int", d_int); current_statement__ = 403; + transformed_data_row_vector_array_3d = std::vector>>>(d_int, std::vector>>(2, std::vector>(3, Eigen::Matrix(d_int)))); + stan::math::fill(transformed_data_row_vector_array_3d, std::numeric_limits::quiet_NaN()); current_statement__ = 404; transformed_data_real = pow(d_int, d_int); @@ -11184,7 +11165,6 @@ class motherHOF_model final : public model_base_crtp { current_statement__ = 123; context__.validate_dims("data initialization","T","int", std::vector{}); - T = std::numeric_limits::min(); current_statement__ = 123; T = context__.vals_i("T")[(1 - 1)]; @@ -11193,15 +11173,12 @@ class motherHOF_model final : public model_base_crtp { current_statement__ = 124; context__.validate_dims("data initialization","y0_d","double", std::vector{static_cast(2)}); - y0_d = std::vector(2, std::numeric_limits::quiet_NaN()); - current_statement__ = 124; y0_d = context__.vals_r("y0_d"); current_statement__ = 125; context__.validate_dims("data initialization","t0","double", std::vector{}); - t0 = std::numeric_limits::quiet_NaN(); current_statement__ = 125; t0 = context__.vals_r("t0")[(1 - 1)]; @@ -11210,52 +11187,42 @@ class motherHOF_model final : public model_base_crtp { current_statement__ = 127; context__.validate_dims("data initialization","ts","double", std::vector{static_cast(T)}); - ts = std::vector(T, std::numeric_limits::quiet_NaN()); current_statement__ = 127; ts = context__.vals_r("ts"); current_statement__ = 128; context__.validate_dims("data initialization","theta_d","double", std::vector{static_cast(1)}); - theta_d = std::vector(1, std::numeric_limits::quiet_NaN()); - current_statement__ = 128; theta_d = context__.vals_r("theta_d"); current_statement__ = 129; context__.validate_dims("data initialization","x","double", std::vector{static_cast(0)}); - x = std::vector(0, std::numeric_limits::quiet_NaN()); current_statement__ = 129; x = context__.vals_r("x"); current_statement__ = 130; context__.validate_dims("data initialization","x_int","int", std::vector{static_cast(0)}); - x_int = std::vector(0, std::numeric_limits::min()); current_statement__ = 130; x_int = context__.vals_i("x_int"); current_statement__ = 131; context__.validate_dims("data initialization","x_d_r","double", std::vector{static_cast(0)}); - x_d_r = std::vector(0, std::numeric_limits::quiet_NaN()); - current_statement__ = 131; x_d_r = context__.vals_r("x_d_r"); current_statement__ = 132; context__.validate_dims("data initialization","x_d_i","int", std::vector{static_cast(0)}); - x_d_i = std::vector(0, std::numeric_limits::min()); current_statement__ = 132; x_d_i = context__.vals_i("x_d_i"); current_statement__ = 133; context__.validate_dims("data initialization","shared_params_d", "double", std::vector{static_cast(3)}); - shared_params_d = Eigen::Matrix(3); - stan::math::fill(shared_params_d, std::numeric_limits::quiet_NaN()); { std::vector shared_params_d_flat__; @@ -11276,8 +11243,6 @@ class motherHOF_model final : public model_base_crtp { context__.validate_dims("data initialization","job_params_d","double", std::vector{static_cast(3), static_cast(3)}); - job_params_d = std::vector>(3, Eigen::Matrix(3)); - stan::math::fill(job_params_d, std::numeric_limits::quiet_NaN()); { std::vector job_params_d_flat__; @@ -11302,8 +11267,6 @@ class motherHOF_model final : public model_base_crtp { context__.validate_dims("data initialization","data_r","double", std::vector{static_cast(3), static_cast(3)}); - data_r = std::vector>(3, std::vector(3, std::numeric_limits::quiet_NaN())); - { std::vector data_r_flat__; @@ -11328,8 +11291,6 @@ class motherHOF_model final : public model_base_crtp { context__.validate_dims("data initialization","data_i","int", std::vector{static_cast(3), static_cast(3)}); - data_i = std::vector>(3, std::vector(3, std::numeric_limits::min())); - { std::vector data_i_flat__; @@ -13514,21 +13475,18 @@ class new_integrate_interface_model final : public model_base_crtp{}); - N = std::numeric_limits::min(); current_statement__ = 601; N = context__.vals_i("N")[(1 - 1)]; current_statement__ = 602; context__.validate_dims("data initialization","id","int", std::vector{}); - id = std::numeric_limits::min(); current_statement__ = 602; id = context__.vals_i("id")[(1 - 1)]; current_statement__ = 603; context__.validate_dims("data initialization","rd","double", std::vector{}); - rd = std::numeric_limits::quiet_NaN(); current_statement__ = 603; rd = context__.vals_r("rd")[(1 - 1)]; @@ -13537,8 +13495,6 @@ class new_integrate_interface_model final : public model_base_crtp{static_cast(N)}); - rad = std::vector(N, std::numeric_limits::quiet_NaN()); - current_statement__ = 605; rad = context__.vals_r("rad"); @@ -13547,8 +13503,6 @@ class new_integrate_interface_model final : public model_base_crtp{static_cast(N)}); - vd = Eigen::Matrix(N); - stan::math::fill(vd, std::numeric_limits::quiet_NaN()); { std::vector vd_flat__; @@ -13570,6 +13524,8 @@ class new_integrate_interface_model final : public model_base_crtp>(N, Eigen::Matrix(N)); + stan::math::fill(zd, std::numeric_limits::quiet_NaN()); current_statement__ = 610; assign(zd, @@ -16983,7 +16939,6 @@ class old_integrate_interface_model final : public model_base_crtp{}); - N = std::numeric_limits::min(); current_statement__ = 18; N = context__.vals_i("N")[(1 - 1)]; @@ -16994,15 +16949,12 @@ class old_integrate_interface_model final : public model_base_crtp{static_cast(N)}); - ts = std::vector(N, std::numeric_limits::quiet_NaN()); current_statement__ = 20; ts = context__.vals_r("ts"); current_statement__ = 21; context__.validate_dims("data initialization","y_init","double", std::vector{static_cast(2)}); - y_init = std::vector(2, std::numeric_limits::quiet_NaN()); - current_statement__ = 21; y_init = context__.vals_r("y_init"); @@ -17012,8 +16964,6 @@ class old_integrate_interface_model final : public model_base_crtp{static_cast(N), static_cast(2)}); - y = std::vector>(N, std::vector(2, std::numeric_limits::quiet_NaN())); - { std::vector y_flat__; @@ -17849,7 +17799,6 @@ class optimize_glm_model final : public model_base_crtp { current_statement__ = 176; context__.validate_dims("data initialization","k","int", std::vector{}); - k = std::numeric_limits::min(); current_statement__ = 176; k = context__.vals_i("k")[(1 - 1)]; @@ -17858,7 +17807,6 @@ class optimize_glm_model final : public model_base_crtp { current_statement__ = 177; context__.validate_dims("data initialization","n","int", std::vector{}); - n = std::numeric_limits::min(); current_statement__ = 177; n = context__.vals_i("n")[(1 - 1)]; @@ -17872,8 +17820,6 @@ class optimize_glm_model final : public model_base_crtp { context__.validate_dims("data initialization","X_d","double", std::vector{static_cast(n), static_cast(k)}); - X_d = Eigen::Matrix(n, k); - stan::math::fill(X_d, std::numeric_limits::quiet_NaN()); { std::vector X_d_flat__; @@ -17901,8 +17847,6 @@ class optimize_glm_model final : public model_base_crtp { context__.validate_dims("data initialization","X_d_a","double", std::vector{static_cast(2), static_cast(n), static_cast(k)}); - X_d_a = std::vector>(2, Eigen::Matrix(n, k)); - stan::math::fill(X_d_a, std::numeric_limits::quiet_NaN()); { std::vector X_d_a_flat__; @@ -17932,8 +17876,6 @@ class optimize_glm_model final : public model_base_crtp { current_statement__ = 185; context__.validate_dims("data initialization","y_v_d","double", std::vector{static_cast(n)}); - y_v_d = Eigen::Matrix(n); - stan::math::fill(y_v_d, std::numeric_limits::quiet_NaN()); { std::vector y_v_d_flat__; @@ -17955,8 +17897,6 @@ class optimize_glm_model final : public model_base_crtp { current_statement__ = 187; context__.validate_dims("data initialization","X_rv_d","double", std::vector{static_cast(n)}); - X_rv_d = Eigen::Matrix(n); - stan::math::fill(X_rv_d, std::numeric_limits::quiet_NaN()); { std::vector X_rv_d_flat__; @@ -17978,7 +17918,6 @@ class optimize_glm_model final : public model_base_crtp { current_statement__ = 189; context__.validate_dims("data initialization","y_vi_d","int", std::vector{static_cast(n)}); - y_vi_d = std::vector(n, std::numeric_limits::min()); current_statement__ = 189; y_vi_d = context__.vals_i("y_vi_d"); @@ -17987,53 +17926,62 @@ class optimize_glm_model final : public model_base_crtp { current_statement__ = 191; context__.validate_dims("data initialization","y2_vi_d","int", std::vector{static_cast(n)}); - y2_vi_d = std::vector(n, std::numeric_limits::min()); current_statement__ = 191; y2_vi_d = context__.vals_i("y2_vi_d"); current_statement__ = 192; context__.validate_dims("data initialization","y_s_d","int", std::vector{}); - y_s_d = std::numeric_limits::min(); current_statement__ = 192; y_s_d = context__.vals_i("y_s_d")[(1 - 1)]; current_statement__ = 193; context__.validate_dims("data initialization","y_r_d","double", std::vector{}); - y_r_d = std::numeric_limits::quiet_NaN(); current_statement__ = 193; y_r_d = context__.vals_r("y_r_d")[(1 - 1)]; current_statement__ = 194; + k_td = std::numeric_limits::min(); current_statement__ = 195; + n_td = std::numeric_limits::min(); current_statement__ = 196; validate_non_negative_index("X_d_td", "n", n); current_statement__ = 197; validate_non_negative_index("X_d_td", "k", k); current_statement__ = 198; + X_d_td = Eigen::Matrix(n, k); + stan::math::fill(X_d_td, std::numeric_limits::quiet_NaN()); current_statement__ = 199; validate_non_negative_index("y_v_d_td", "n", n); current_statement__ = 200; + y_v_d_td = Eigen::Matrix(n); + stan::math::fill(y_v_d_td, std::numeric_limits::quiet_NaN()); current_statement__ = 201; validate_non_negative_index("X_rv_d_td", "n", n); current_statement__ = 202; + X_rv_d_td = Eigen::Matrix(n); + stan::math::fill(X_rv_d_td, std::numeric_limits::quiet_NaN()); current_statement__ = 203; validate_non_negative_index("y_vi_d_td", "n", n); current_statement__ = 204; + y_vi_d_td = std::vector(n, std::numeric_limits::min()); current_statement__ = 205; validate_non_negative_index("y2_vi_d_td", "n", n); current_statement__ = 206; + y2_vi_d_td = std::vector(n, std::numeric_limits::min()); current_statement__ = 207; + y_s_d_td = std::numeric_limits::min(); current_statement__ = 208; + y_r_d_td = std::numeric_limits::quiet_NaN(); current_statement__ = 194; check_greater_or_equal(function__, "k_td", k_td, 1); @@ -19288,14 +19236,12 @@ class param_constraint_model final : public model_base_crtp{}); - nt = std::numeric_limits::min(); current_statement__ = 3; nt = context__.vals_i("nt")[(1 - 1)]; current_statement__ = 4; context__.validate_dims("data initialization","NS","int", std::vector{}); - NS = std::numeric_limits::min(); current_statement__ = 4; NS = context__.vals_i("NS")[(1 - 1)]; @@ -19927,6 +19873,7 @@ class reduce_sum_m1_model final : public model_base_crtp { pos__ = 1; current_statement__ = 8; + N = std::numeric_limits::min(); current_statement__ = 8; N = 100; @@ -21450,12 +21397,14 @@ class reduce_sum_m2_model final : public model_base_crtp { pos__ = 1; current_statement__ = 33; + N = std::numeric_limits::min(); current_statement__ = 33; N = 2; current_statement__ = 34; validate_non_negative_index("x", "N", N); current_statement__ = 35; + x = std::vector(N, std::numeric_limits::quiet_NaN()); current_statement__ = 36; validate_non_negative_index("a8", "N", N); @@ -25080,7 +25029,6 @@ class reduce_sum_m3_model final : public model_base_crtp { current_statement__ = 67; context__.validate_dims("data initialization","N","int", std::vector{}); - N = std::numeric_limits::min(); current_statement__ = 67; N = context__.vals_i("N")[(1 - 1)]; @@ -25089,8 +25037,6 @@ class reduce_sum_m3_model final : public model_base_crtp { current_statement__ = 69; context__.validate_dims("data initialization","y1d","double", std::vector{static_cast(N)}); - y1d = std::vector(N, std::numeric_limits::quiet_NaN()); - current_statement__ = 69; y1d = context__.vals_r("y1d"); @@ -25102,8 +25048,6 @@ class reduce_sum_m3_model final : public model_base_crtp { context__.validate_dims("data initialization","y2d","double", std::vector{static_cast(N), static_cast(N)}); - y2d = std::vector>(N, Eigen::Matrix(N)); - stan::math::fill(y2d, std::numeric_limits::quiet_NaN()); { std::vector y2d_flat__; @@ -25131,8 +25075,6 @@ class reduce_sum_m3_model final : public model_base_crtp { context__.validate_dims("data initialization","y3d","double", std::vector{static_cast(N), static_cast(N)}); - y3d = std::vector>(N, Eigen::Matrix(N)); - stan::math::fill(y3d, std::numeric_limits::quiet_NaN()); { std::vector y3d_flat__; @@ -25162,8 +25104,6 @@ class reduce_sum_m3_model final : public model_base_crtp { context__.validate_dims("data initialization","y4d","double", std::vector{static_cast(N), static_cast(N), static_cast(N)}); - y4d = std::vector>(N, Eigen::Matrix(N, N)); - stan::math::fill(y4d, std::numeric_limits::quiet_NaN()); { std::vector y4d_flat__; @@ -25196,8 +25136,6 @@ class reduce_sum_m3_model final : public model_base_crtp { context__.validate_dims("data initialization","y5d","double", std::vector{static_cast(N), static_cast(N)}); - y5d = std::vector>(N, std::vector(N, std::numeric_limits::quiet_NaN())); - { std::vector y5d_flat__; @@ -25227,8 +25165,6 @@ class reduce_sum_m3_model final : public model_base_crtp { context__.validate_dims("data initialization","y6d","double", std::vector{static_cast(N), static_cast(N), static_cast(N)}); - y6d = std::vector>>(N, std::vector>(N, Eigen::Matrix(N))); - stan::math::fill(y6d, std::numeric_limits::quiet_NaN()); { std::vector y6d_flat__; @@ -25263,8 +25199,6 @@ class reduce_sum_m3_model final : public model_base_crtp { context__.validate_dims("data initialization","y7d","double", std::vector{static_cast(N), static_cast(N), static_cast(N)}); - y7d = std::vector>>(N, std::vector>(N, Eigen::Matrix(N))); - stan::math::fill(y7d, std::numeric_limits::quiet_NaN()); { std::vector y7d_flat__; @@ -25302,8 +25236,6 @@ class reduce_sum_m3_model final : public model_base_crtp { std::vector{static_cast(N), static_cast(N), static_cast(N), static_cast(N)}); - y8d = std::vector>>(N, std::vector>(N, Eigen::Matrix(N, N))); - stan::math::fill(y8d, std::numeric_limits::quiet_NaN()); { std::vector y8d_flat__; @@ -25335,7 +25267,6 @@ class reduce_sum_m3_model final : public model_base_crtp { current_statement__ = 96; context__.validate_dims("data initialization","y9d","double", std::vector{}); - y9d = std::numeric_limits::quiet_NaN(); current_statement__ = 96; y9d = context__.vals_r("y9d")[(1 - 1)]; @@ -25344,8 +25275,6 @@ class reduce_sum_m3_model final : public model_base_crtp { current_statement__ = 98; context__.validate_dims("data initialization","y10d","double", std::vector{static_cast(N)}); - y10d = Eigen::Matrix(N); - stan::math::fill(y10d, std::numeric_limits::quiet_NaN()); { std::vector y10d_flat__; @@ -25367,8 +25296,6 @@ class reduce_sum_m3_model final : public model_base_crtp { current_statement__ = 100; context__.validate_dims("data initialization","y11d","double", std::vector{static_cast(N)}); - y11d = Eigen::Matrix(N); - stan::math::fill(y11d, std::numeric_limits::quiet_NaN()); { std::vector y11d_flat__; @@ -25393,8 +25320,6 @@ class reduce_sum_m3_model final : public model_base_crtp { context__.validate_dims("data initialization","y12d","double", std::vector{static_cast(N), static_cast(N)}); - y12d = Eigen::Matrix(N, N); - stan::math::fill(y12d, std::numeric_limits::quiet_NaN()); { std::vector y12d_flat__; @@ -25417,7 +25342,6 @@ class reduce_sum_m3_model final : public model_base_crtp { current_statement__ = 104; context__.validate_dims("data initialization","y13d","int", std::vector{}); - y13d = std::numeric_limits::min(); current_statement__ = 104; y13d = context__.vals_i("y13d")[(1 - 1)]; @@ -25426,7 +25350,6 @@ class reduce_sum_m3_model final : public model_base_crtp { current_statement__ = 106; context__.validate_dims("data initialization","y14d","int", std::vector{static_cast(N)}); - y14d = std::vector(N, std::numeric_limits::min()); current_statement__ = 106; y14d = context__.vals_i("y14d"); @@ -25438,8 +25361,6 @@ class reduce_sum_m3_model final : public model_base_crtp { context__.validate_dims("data initialization","y15d","int", std::vector{static_cast(N), static_cast(N)}); - y15d = std::vector>(N, std::vector(N, std::numeric_limits::min())); - { std::vector y15d_flat__; @@ -25469,8 +25390,6 @@ class reduce_sum_m3_model final : public model_base_crtp { context__.validate_dims("data initialization","y16d","int", std::vector{static_cast(N), static_cast(N), static_cast(N)}); - y16d = std::vector>>(N, std::vector>(N, std::vector(N, std::numeric_limits::min()))); - { std::vector y16d_flat__; @@ -25505,8 +25424,6 @@ class reduce_sum_m3_model final : public model_base_crtp { context__.validate_dims("data initialization","y17d","double", std::vector{static_cast(N), static_cast(N), static_cast(N)}); - y17d = std::vector>>(N, std::vector>(N, std::vector(N, std::numeric_limits::quiet_NaN()))); - { std::vector y17d_flat__; @@ -25532,107 +25449,133 @@ class reduce_sum_m3_model final : public model_base_crtp { } } current_statement__ = 118; + td1 = std::numeric_limits::quiet_NaN(); current_statement__ = 118; td1 = reduce_sum(y1d, 1, pstream__); current_statement__ = 119; + td1a = std::numeric_limits::quiet_NaN(); current_statement__ = 119; td1a = (reduce_sum(y1d, 1, pstream__) + reduce_sum(y1d, 1, pstream__)); current_statement__ = 120; + td2 = std::numeric_limits::quiet_NaN(); current_statement__ = 120; td2 = reduce_sum(y2d, 1, pstream__); current_statement__ = 121; + td3 = std::numeric_limits::quiet_NaN(); current_statement__ = 121; td3 = reduce_sum(y3d, 1, pstream__); current_statement__ = 122; + td4 = std::numeric_limits::quiet_NaN(); current_statement__ = 122; td4 = reduce_sum(y4d, 1, pstream__); current_statement__ = 123; + td5 = std::numeric_limits::quiet_NaN(); current_statement__ = 123; td5 = reduce_sum(y5d, 1, pstream__); current_statement__ = 124; + td6 = std::numeric_limits::quiet_NaN(); current_statement__ = 124; td6 = reduce_sum(y6d, 1, pstream__); current_statement__ = 125; + td7 = std::numeric_limits::quiet_NaN(); current_statement__ = 125; td7 = reduce_sum(y7d, 1, pstream__); current_statement__ = 126; + td8 = std::numeric_limits::quiet_NaN(); current_statement__ = 126; td8 = reduce_sum(y8d, 1, pstream__); current_statement__ = 127; + td9 = std::numeric_limits::quiet_NaN(); current_statement__ = 127; td9 = reduce_sum(y14d, 1, pstream__); current_statement__ = 128; + td10 = std::numeric_limits::quiet_NaN(); current_statement__ = 128; td10 = reduce_sum(y15d, 1, pstream__); current_statement__ = 129; + td11 = std::numeric_limits::quiet_NaN(); current_statement__ = 129; td11 = reduce_sum(y16d, 1, pstream__); current_statement__ = 130; + td12 = std::numeric_limits::quiet_NaN(); current_statement__ = 130; td12 = reduce_sum(y17d, 1, pstream__); current_statement__ = 131; + tgd1 = std::numeric_limits::quiet_NaN(); current_statement__ = 131; tgd1 = reduce_sum(y1d, 1, pstream__, y9d); current_statement__ = 132; + tgd2 = std::numeric_limits::quiet_NaN(); current_statement__ = 132; tgd2 = reduce_sum(y1d, 1, pstream__, y10d); current_statement__ = 133; + tgd3 = std::numeric_limits::quiet_NaN(); current_statement__ = 133; tgd3 = reduce_sum(y1d, 1, pstream__, y11d); current_statement__ = 134; + tgd4 = std::numeric_limits::quiet_NaN(); current_statement__ = 134; tgd4 = reduce_sum(y1d, 1, pstream__, y12d); current_statement__ = 135; + tgd5 = std::numeric_limits::quiet_NaN(); current_statement__ = 135; tgd5 = reduce_sum(y1d, 1, pstream__, y1d); current_statement__ = 136; + tgd6 = std::numeric_limits::quiet_NaN(); current_statement__ = 136; tgd6 = reduce_sum(y1d, 1, pstream__, y2d); current_statement__ = 137; + tgd7 = std::numeric_limits::quiet_NaN(); current_statement__ = 137; tgd7 = reduce_sum(y1d, 1, pstream__, y3d); current_statement__ = 138; + tgd8 = std::numeric_limits::quiet_NaN(); current_statement__ = 138; tgd8 = reduce_sum(y1d, 1, pstream__, y4d); current_statement__ = 139; + tgd9 = std::numeric_limits::quiet_NaN(); current_statement__ = 139; tgd9 = reduce_sum(y1d, 1, pstream__, y5d); current_statement__ = 140; + tgd10 = std::numeric_limits::quiet_NaN(); current_statement__ = 140; tgd10 = reduce_sum(y1d, 1, pstream__, y6d); current_statement__ = 141; + tgd11 = std::numeric_limits::quiet_NaN(); current_statement__ = 141; tgd11 = reduce_sum(y1d, 1, pstream__, y7d); current_statement__ = 142; + tgd12 = std::numeric_limits::quiet_NaN(); current_statement__ = 142; tgd12 = reduce_sum(y1d, 1, pstream__, y8d); current_statement__ = 143; + tsd = std::numeric_limits::quiet_NaN(); current_statement__ = 143; tsd = reduce_sum(y1d, 1, pstream__, y13d, y9d, y10d, @@ -27689,7 +27632,6 @@ class tilde_block_model final : public model_base_crtp { current_statement__ = 7; context__.validate_dims("data initialization","t","int", std::vector{}); - t = std::numeric_limits::min(); current_statement__ = 7; t = context__.vals_i("t")[(1 - 1)]; @@ -28162,7 +28104,6 @@ class transform_model final : public model_base_crtp { current_statement__ = 37; context__.validate_dims("data initialization","n","int", std::vector{}); - n = std::numeric_limits::min(); current_statement__ = 37; n = context__.vals_i("n")[(1 - 1)]; @@ -28171,7 +28112,6 @@ class transform_model final : public model_base_crtp { current_statement__ = 38; context__.validate_dims("data initialization","m","int", std::vector{}); - m = std::numeric_limits::min(); current_statement__ = 38; m = context__.vals_i("m")[(1 - 1)]; @@ -28180,7 +28120,6 @@ class transform_model final : public model_base_crtp { current_statement__ = 39; context__.validate_dims("data initialization","k","int", std::vector{}); - k = std::numeric_limits::min(); current_statement__ = 39; k = context__.vals_i("k")[(1 - 1)]; @@ -28196,8 +28135,6 @@ class transform_model final : public model_base_crtp { context__.validate_dims("data initialization","ds","double", std::vector{static_cast(n), static_cast(m), static_cast(k)}); - ds = std::vector>>(n, std::vector>(m, std::vector(k, std::numeric_limits::quiet_NaN()))); - { std::vector ds_flat__; @@ -28232,8 +28169,6 @@ class transform_model final : public model_base_crtp { context__.validate_dims("data initialization","dv","double", std::vector{static_cast(n), static_cast(m), static_cast(k)}); - dv = std::vector>>(n, std::vector>(m, Eigen::Matrix(k))); - stan::math::fill(dv, std::numeric_limits::quiet_NaN()); { std::vector dv_flat__; @@ -28268,8 +28203,6 @@ class transform_model final : public model_base_crtp { context__.validate_dims("data initialization","dr","double", std::vector{static_cast(n), static_cast(m), static_cast(k)}); - dr = std::vector>>(n, std::vector>(m, Eigen::Matrix(k))); - stan::math::fill(dr, std::numeric_limits::quiet_NaN()); { std::vector dr_flat__; @@ -28304,8 +28237,6 @@ class transform_model final : public model_base_crtp { context__.validate_dims("data initialization","dm","double", std::vector{static_cast(n), static_cast(m), static_cast(k)}); - dm = std::vector>(n, Eigen::Matrix(m, k)); - stan::math::fill(dm, std::numeric_limits::quiet_NaN()); { std::vector dm_flat__; @@ -31379,14 +31310,12 @@ class truncate_model final : public model_base_crtp { current_statement__ = 19; context__.validate_dims("data initialization","n","int", std::vector{}); - n = std::numeric_limits::min(); current_statement__ = 19; n = context__.vals_i("n")[(1 - 1)]; current_statement__ = 20; context__.validate_dims("data initialization","x","double", std::vector{}); - x = std::numeric_limits::quiet_NaN(); current_statement__ = 20; x = context__.vals_r("x")[(1 - 1)]; diff --git a/test/integration/good/code-gen/expressions/cpp.expected b/test/integration/good/code-gen/expressions/cpp.expected index 5f547ade2e..5b6ac59d6c 100644 --- a/test/integration/good/code-gen/expressions/cpp.expected +++ b/test/integration/good/code-gen/expressions/cpp.expected @@ -186,7 +186,6 @@ class simple_function_model final : public model_base_crtp{}); - N = std::numeric_limits::min(); current_statement__ = 1; N = context__.vals_i("N")[(1 - 1)]; @@ -198,8 +197,6 @@ class simple_function_model final : public model_base_crtp{static_cast(N), static_cast(N)}); - m = Eigen::Matrix(N, N); - stan::math::fill(m, std::numeric_limits::quiet_NaN()); { std::vector m_flat__; diff --git a/test/integration/good/code-gen/opencl/cpp.expected b/test/integration/good/code-gen/opencl/cpp.expected index 8887e97c96..737b3a9d74 100644 --- a/test/integration/good/code-gen/opencl/cpp.expected +++ b/test/integration/good/code-gen/opencl/cpp.expected @@ -837,7 +837,6 @@ class distributions_model final : public model_base_crtp { current_statement__ = 756; context__.validate_dims("data initialization","d_int","int", std::vector{}); - d_int = std::numeric_limits::min(); current_statement__ = 756; d_int = context__.vals_i("d_int")[(1 - 1)]; @@ -846,15 +845,12 @@ class distributions_model final : public model_base_crtp { current_statement__ = 758; context__.validate_dims("data initialization","d_int_array","int", std::vector{static_cast(d_int)}); - d_int_array = std::vector(d_int, std::numeric_limits::min()); - current_statement__ = 758; d_int_array = context__.vals_i("d_int_array"); current_statement__ = 759; context__.validate_dims("data initialization","d_real","double", std::vector{}); - d_real = std::numeric_limits::quiet_NaN(); current_statement__ = 759; d_real = context__.vals_r("d_real")[(1 - 1)]; @@ -863,8 +859,6 @@ class distributions_model final : public model_base_crtp { current_statement__ = 761; context__.validate_dims("data initialization","d_real_array","double", std::vector{static_cast(d_int)}); - d_real_array = std::vector(d_int, std::numeric_limits::quiet_NaN()); - current_statement__ = 761; d_real_array = context__.vals_r("d_real_array"); @@ -873,8 +867,6 @@ class distributions_model final : public model_base_crtp { current_statement__ = 763; context__.validate_dims("data initialization","d_vector","double", std::vector{static_cast(d_int)}); - d_vector = Eigen::Matrix(d_int); - stan::math::fill(d_vector, std::numeric_limits::quiet_NaN()); { std::vector d_vector_flat__; @@ -896,8 +888,6 @@ class distributions_model final : public model_base_crtp { current_statement__ = 765; context__.validate_dims("data initialization","d_row_vector","double", std::vector{static_cast(d_int)}); - d_row_vector = Eigen::Matrix(d_int); - stan::math::fill(d_row_vector, std::numeric_limits::quiet_NaN()); { std::vector d_row_vector_flat__; @@ -6469,7 +6459,6 @@ class restricted_model final : public model_base_crtp { current_statement__ = 25; context__.validate_dims("data initialization","d_int","int", std::vector{}); - d_int = std::numeric_limits::min(); current_statement__ = 25; d_int = context__.vals_i("d_int")[(1 - 1)]; @@ -6478,15 +6467,12 @@ class restricted_model final : public model_base_crtp { current_statement__ = 27; context__.validate_dims("data initialization","d_int_array","int", std::vector{static_cast(d_int)}); - d_int_array = std::vector(d_int, std::numeric_limits::min()); - current_statement__ = 27; d_int_array = context__.vals_i("d_int_array"); current_statement__ = 28; context__.validate_dims("data initialization","d_real","double", std::vector{}); - d_real = std::numeric_limits::quiet_NaN(); current_statement__ = 28; d_real = context__.vals_r("d_real")[(1 - 1)]; @@ -6495,8 +6481,6 @@ class restricted_model final : public model_base_crtp { current_statement__ = 30; context__.validate_dims("data initialization","d_real_array","double", std::vector{static_cast(d_int)}); - d_real_array = std::vector(d_int, std::numeric_limits::quiet_NaN()); - current_statement__ = 30; d_real_array = context__.vals_r("d_real_array"); @@ -6505,8 +6489,6 @@ class restricted_model final : public model_base_crtp { current_statement__ = 32; context__.validate_dims("data initialization","d_vector","double", std::vector{static_cast(d_int)}); - d_vector = Eigen::Matrix(d_int); - stan::math::fill(d_vector, std::numeric_limits::quiet_NaN()); { std::vector d_vector_flat__; @@ -6528,8 +6510,6 @@ class restricted_model final : public model_base_crtp { current_statement__ = 34; context__.validate_dims("data initialization","d_row_vector","double", std::vector{static_cast(d_int)}); - d_row_vector = Eigen::Matrix(d_int); - stan::math::fill(d_row_vector, std::numeric_limits::quiet_NaN()); { std::vector d_row_vector_flat__; diff --git a/test/integration/good/code-gen/profiling/cpp.expected b/test/integration/good/code-gen/profiling/cpp.expected index 64be0b4f1c..66dd0c92c5 100644 --- a/test/integration/good/code-gen/profiling/cpp.expected +++ b/test/integration/good/code-gen/profiling/cpp.expected @@ -89,7 +89,6 @@ class simple_function_model final : public model_base_crtp{}); - N = std::numeric_limits::min(); current_statement__ = 21; N = context__.vals_i("N")[(1 - 1)]; @@ -100,7 +99,6 @@ class simple_function_model final : public model_base_crtp{static_cast(N)}); - x = std::vector(N, std::numeric_limits::quiet_NaN()); current_statement__ = 23; x = context__.vals_r("x"); @@ -109,8 +107,6 @@ class simple_function_model final : public model_base_crtp{static_cast(N)}); - y = Eigen::Matrix(N); - stan::math::fill(y, std::numeric_limits::quiet_NaN()); { std::vector y_flat__; @@ -128,6 +124,7 @@ class simple_function_model final : public model_base_crtp::quiet_NaN(); current_statement__ = 28; { diff --git a/test/integration/good/compiler-optimizations/cpp.expected b/test/integration/good/compiler-optimizations/cpp.expected index 637df706ff..137d562914 100644 --- a/test/integration/good/compiler-optimizations/cpp.expected +++ b/test/integration/good/compiler-optimizations/cpp.expected @@ -169,7 +169,6 @@ class ad_level_failing_model final : public model_base_crtp{}); - N_t = std::numeric_limits::min(); current_statement__ = 16; N_t = context__.vals_i("N_t")[(1 - 1)]; @@ -180,15 +179,12 @@ class ad_level_failing_model final : public model_base_crtp{static_cast(N_t)}); - t = std::vector(N_t, std::numeric_limits::quiet_NaN()); - current_statement__ = 18; t = context__.vals_r("t"); current_statement__ = 19; context__.validate_dims("data initialization","y0","double", std::vector{static_cast(4)}); - y0 = std::vector(4, std::numeric_limits::quiet_NaN()); current_statement__ = 19; y0 = context__.vals_r("y0"); @@ -197,7 +193,6 @@ class ad_level_failing_model final : public model_base_crtp{static_cast(N_t)}); - stoi_hat = std::vector(N_t, std::numeric_limits::min()); current_statement__ = 21; stoi_hat = context__.vals_i("stoi_hat"); @@ -206,22 +201,25 @@ class ad_level_failing_model final : public model_base_crtp{static_cast(N_t)}); - B_hat = std::vector(N_t, std::numeric_limits::quiet_NaN()); - current_statement__ = 23; B_hat = context__.vals_r("B_hat"); current_statement__ = 24; + t0 = std::numeric_limits::quiet_NaN(); current_statement__ = 24; t0 = 0; current_statement__ = 25; + kappa = std::numeric_limits::quiet_NaN(); current_statement__ = 25; kappa = 1000000; current_statement__ = 26; + x_r = std::vector(0, std::numeric_limits::quiet_NaN()); + current_statement__ = 27; + x_i = std::vector(0, std::numeric_limits::min()); current_statement__ = 25; check_greater_or_equal(function__, "kappa", 1000000, 0); @@ -1300,7 +1298,6 @@ class copy_fail_model final : public model_base_crtp { current_statement__ = 31; context__.validate_dims("data initialization","nind","int", std::vector{}); - nind = std::numeric_limits::min(); current_statement__ = 31; nind = context__.vals_i("nind")[(1 - 1)]; @@ -1309,7 +1306,6 @@ class copy_fail_model final : public model_base_crtp { current_statement__ = 32; context__.validate_dims("data initialization","n_occasions","int", std::vector{}); - n_occasions = std::numeric_limits::min(); current_statement__ = 32; n_occasions = context__.vals_i("n_occasions")[(1 - 1)]; @@ -1323,8 +1319,6 @@ class copy_fail_model final : public model_base_crtp { context__.validate_dims("data initialization","y","int", std::vector{static_cast(nind), static_cast(n_occasions)}); - y = std::vector>(nind, std::vector(n_occasions, std::numeric_limits::min())); - { std::vector y_flat__; @@ -1435,7 +1429,6 @@ class copy_fail_model final : public model_base_crtp { current_statement__ = 36; context__.validate_dims("data initialization","max_age","int", std::vector{}); - max_age = std::numeric_limits::min(); current_statement__ = 36; max_age = context__.vals_i("max_age")[(1 - 1)]; @@ -1449,8 +1442,6 @@ class copy_fail_model final : public model_base_crtp { context__.validate_dims("data initialization","x","int", std::vector{static_cast(nind), static_cast(lcm_sym159__)}); - x = std::vector>(nind, std::vector(lcm_sym159__, std::numeric_limits::min())); - { std::vector x_flat__; @@ -1556,16 +1547,19 @@ class copy_fail_model final : public model_base_crtp { } } current_statement__ = 39; + n_occ_minus_1 = std::numeric_limits::min(); current_statement__ = 39; n_occ_minus_1 = lcm_sym159__; current_statement__ = 40; validate_non_negative_index("first", "nind", nind); current_statement__ = 41; + first = std::vector(nind, std::numeric_limits::min()); current_statement__ = 42; validate_non_negative_index("last", "nind", nind); current_statement__ = 43; + last = std::vector(nind, std::numeric_limits::min()); current_statement__ = 48; if (lcm_sym157__) { @@ -3307,7 +3301,6 @@ class dce_fail_model final : public model_base_crtp { current_statement__ = 39; context__.validate_dims("data initialization","N","int", std::vector{}); - N = std::numeric_limits::min(); current_statement__ = 39; N = context__.vals_i("N")[(1 - 1)]; @@ -3316,7 +3309,6 @@ class dce_fail_model final : public model_base_crtp { current_statement__ = 40; context__.validate_dims("data initialization","n_age","int", std::vector{}); - n_age = std::numeric_limits::min(); current_statement__ = 40; n_age = context__.vals_i("n_age")[(1 - 1)]; @@ -3325,7 +3317,6 @@ class dce_fail_model final : public model_base_crtp { current_statement__ = 41; context__.validate_dims("data initialization","n_edu","int", std::vector{}); - n_edu = std::numeric_limits::min(); current_statement__ = 41; n_edu = context__.vals_i("n_edu")[(1 - 1)]; @@ -3334,7 +3325,6 @@ class dce_fail_model final : public model_base_crtp { current_statement__ = 42; context__.validate_dims("data initialization","n_region","int", std::vector{}); - n_region = std::numeric_limits::min(); current_statement__ = 42; n_region = context__.vals_i("n_region")[(1 - 1)]; @@ -3343,7 +3333,6 @@ class dce_fail_model final : public model_base_crtp { current_statement__ = 43; context__.validate_dims("data initialization","n_state","int", std::vector{}); - n_state = std::numeric_limits::min(); current_statement__ = 43; n_state = context__.vals_i("n_state")[(1 - 1)]; @@ -3354,7 +3343,6 @@ class dce_fail_model final : public model_base_crtp { current_statement__ = 45; context__.validate_dims("data initialization","female","int", std::vector{static_cast(N)}); - female = std::vector(N, std::numeric_limits::min()); current_statement__ = 45; female = context__.vals_i("female"); @@ -3385,7 +3373,6 @@ class dce_fail_model final : public model_base_crtp { current_statement__ = 47; context__.validate_dims("data initialization","black","int", std::vector{static_cast(N)}); - black = std::vector(N, std::numeric_limits::min()); current_statement__ = 47; black = context__.vals_i("black"); @@ -3416,7 +3403,6 @@ class dce_fail_model final : public model_base_crtp { current_statement__ = 49; context__.validate_dims("data initialization","age","int", std::vector{static_cast(N)}); - age = std::vector(N, std::numeric_limits::min()); current_statement__ = 49; age = context__.vals_i("age"); @@ -3447,7 +3433,6 @@ class dce_fail_model final : public model_base_crtp { current_statement__ = 51; context__.validate_dims("data initialization","edu","int", std::vector{static_cast(N)}); - edu = std::vector(N, std::numeric_limits::min()); current_statement__ = 51; edu = context__.vals_i("edu"); @@ -3478,7 +3463,6 @@ class dce_fail_model final : public model_base_crtp { current_statement__ = 53; context__.validate_dims("data initialization","region","int", std::vector{static_cast(n_state)}); - region = std::vector(n_state, std::numeric_limits::min()); current_statement__ = 53; region = context__.vals_i("region"); @@ -3509,7 +3493,6 @@ class dce_fail_model final : public model_base_crtp { current_statement__ = 55; context__.validate_dims("data initialization","state","int", std::vector{static_cast(N)}); - state = std::vector(N, std::numeric_limits::min()); current_statement__ = 55; state = context__.vals_i("state"); @@ -3540,7 +3523,6 @@ class dce_fail_model final : public model_base_crtp { current_statement__ = 57; context__.validate_dims("data initialization","y","int", std::vector{static_cast(N)}); - y = std::vector(N, std::numeric_limits::min()); current_statement__ = 57; y = context__.vals_i("y"); @@ -3569,8 +3551,6 @@ class dce_fail_model final : public model_base_crtp { current_statement__ = 59; context__.validate_dims("data initialization","v_prev","double", std::vector{static_cast(n_state)}); - v_prev = Eigen::Matrix(n_state); - stan::math::fill(v_prev, std::numeric_limits::quiet_NaN()); { std::vector v_prev_flat__; @@ -4763,17 +4743,20 @@ class expr_prop_experiment_model final : public model_base_crtp{}); - j = std::numeric_limits::min(); current_statement__ = 1; j = context__.vals_i("j")[(1 - 1)]; current_statement__ = 2; + z = std::numeric_limits::quiet_NaN(); current_statement__ = 3; + x = std::numeric_limits::quiet_NaN(); current_statement__ = 4; + y = std::numeric_limits::quiet_NaN(); current_statement__ = 5; + i = std::numeric_limits::quiet_NaN(); current_statement__ = 5; i = normal_rng(5, 1, base_rng__); @@ -5098,15 +5081,16 @@ class expr_prop_experiment2_model final : public model_base_crtp{}); - j = std::numeric_limits::min(); current_statement__ = 1; j = context__.vals_i("j")[(1 - 1)]; current_statement__ = 2; + z = std::numeric_limits::quiet_NaN(); current_statement__ = 2; z = 1; current_statement__ = 3; + y = std::numeric_limits::quiet_NaN(); { double x; @@ -5443,7 +5427,6 @@ class expr_prop_fail_model final : public model_base_crtp current_statement__ = 9; context__.validate_dims("data initialization","N","int", std::vector{}); - N = std::numeric_limits::min(); current_statement__ = 9; N = context__.vals_i("N")[(1 - 1)]; @@ -5454,8 +5437,6 @@ class expr_prop_fail_model final : public model_base_crtp current_statement__ = 11; context__.validate_dims("data initialization","y","double", std::vector{static_cast(N)}); - y = Eigen::Matrix(N); - stan::math::fill(y, std::numeric_limits::quiet_NaN()); { std::vector y_flat__; @@ -6003,7 +5984,6 @@ class expr_prop_fail2_model final : public model_base_crtp{}); - J = std::numeric_limits::min(); current_statement__ = 6; J = context__.vals_i("J")[(1 - 1)]; @@ -6014,7 +5994,6 @@ class expr_prop_fail2_model final : public model_base_crtp{static_cast(J)}); - y = std::vector(J, std::numeric_limits::quiet_NaN()); current_statement__ = 8; y = context__.vals_r("y"); @@ -6023,8 +6002,6 @@ class expr_prop_fail2_model final : public model_base_crtp{static_cast(J)}); - sigma = std::vector(J, std::numeric_limits::quiet_NaN()); - current_statement__ = 10; sigma = context__.vals_r("sigma"); @@ -6552,7 +6529,6 @@ class expr_prop_fail3_model final : public model_base_crtp{}); - N = std::numeric_limits::min(); current_statement__ = 22; N = context__.vals_i("N")[(1 - 1)]; @@ -6561,7 +6537,6 @@ class expr_prop_fail3_model final : public model_base_crtp{}); - n_age = std::numeric_limits::min(); current_statement__ = 23; n_age = context__.vals_i("n_age")[(1 - 1)]; @@ -6570,7 +6545,6 @@ class expr_prop_fail3_model final : public model_base_crtp{}); - n_age_edu = std::numeric_limits::min(); current_statement__ = 24; n_age_edu = context__.vals_i("n_age_edu")[(1 - 1)]; @@ -6579,7 +6553,6 @@ class expr_prop_fail3_model final : public model_base_crtp{}); - n_edu = std::numeric_limits::min(); current_statement__ = 25; n_edu = context__.vals_i("n_edu")[(1 - 1)]; @@ -6588,7 +6561,6 @@ class expr_prop_fail3_model final : public model_base_crtp{}); - n_region_full = std::numeric_limits::min(); current_statement__ = 26; n_region_full = context__.vals_i("n_region_full")[(1 - 1)]; @@ -6597,7 +6569,6 @@ class expr_prop_fail3_model final : public model_base_crtp{}); - n_state = std::numeric_limits::min(); current_statement__ = 27; n_state = context__.vals_i("n_state")[(1 - 1)]; @@ -6608,7 +6579,6 @@ class expr_prop_fail3_model final : public model_base_crtp{static_cast(N)}); - age = std::vector(N, std::numeric_limits::min()); current_statement__ = 29; age = context__.vals_i("age"); @@ -6639,7 +6609,6 @@ class expr_prop_fail3_model final : public model_base_crtp{static_cast(N)}); - age_edu = std::vector(N, std::numeric_limits::min()); current_statement__ = 31; age_edu = context__.vals_i("age_edu"); @@ -6671,8 +6640,6 @@ class expr_prop_fail3_model final : public model_base_crtp{static_cast(N)}); - black = Eigen::Matrix(N); - stan::math::fill(black, std::numeric_limits::quiet_NaN()); { std::vector black_flat__; @@ -6723,7 +6690,6 @@ class expr_prop_fail3_model final : public model_base_crtp{static_cast(N)}); - edu = std::vector(N, std::numeric_limits::min()); current_statement__ = 35; edu = context__.vals_i("edu"); @@ -6754,8 +6720,6 @@ class expr_prop_fail3_model final : public model_base_crtp{static_cast(N)}); - female = Eigen::Matrix(N); - stan::math::fill(female, std::numeric_limits::quiet_NaN()); { std::vector female_flat__; @@ -6807,7 +6771,6 @@ class expr_prop_fail3_model final : public model_base_crtp{static_cast(N)}); - region_full = std::vector(N, std::numeric_limits::min()); current_statement__ = 39; region_full = context__.vals_i("region_full"); @@ -6840,7 +6803,6 @@ class expr_prop_fail3_model final : public model_base_crtp{static_cast(N)}); - state = std::vector(N, std::numeric_limits::min()); current_statement__ = 41; state = context__.vals_i("state"); @@ -6871,8 +6833,6 @@ class expr_prop_fail3_model final : public model_base_crtp{static_cast(N)}); - v_prev_full = Eigen::Matrix(N); - stan::math::fill(v_prev_full, std::numeric_limits::quiet_NaN()); { std::vector v_prev_full_flat__; @@ -6902,7 +6862,6 @@ class expr_prop_fail3_model final : public model_base_crtp{static_cast(N)}); - y = std::vector(N, std::numeric_limits::min()); current_statement__ = 45; y = context__.vals_i("y"); @@ -8060,7 +8019,6 @@ class expr_prop_fail4_model final : public model_base_crtp{}); - N = std::numeric_limits::min(); current_statement__ = 28; N = context__.vals_i("N")[(1 - 1)]; @@ -8069,7 +8027,6 @@ class expr_prop_fail4_model final : public model_base_crtp{}); - N_edges = std::numeric_limits::min(); current_statement__ = 29; N_edges = context__.vals_i("N_edges")[(1 - 1)]; @@ -8080,7 +8037,6 @@ class expr_prop_fail4_model final : public model_base_crtp{static_cast(N_edges)}); - node1 = std::vector(N_edges, std::numeric_limits::min()); current_statement__ = 31; node1 = context__.vals_i("node1"); @@ -8111,7 +8067,6 @@ class expr_prop_fail4_model final : public model_base_crtp{static_cast(N_edges)}); - node2 = std::vector(N_edges, std::numeric_limits::min()); current_statement__ = 33; node2 = context__.vals_i("node2"); @@ -8142,8 +8097,6 @@ class expr_prop_fail4_model final : public model_base_crtp{static_cast(N)}); - E = Eigen::Matrix(N); - stan::math::fill(E, std::numeric_limits::quiet_NaN()); { std::vector E_flat__; @@ -8180,10 +8133,13 @@ class expr_prop_fail4_model final : public model_base_crtp(N); + stan::math::fill(log_E, std::numeric_limits::quiet_NaN()); current_statement__ = 37; assign(log_E, stan::math::log(E), "assigning variable log_E"); current_statement__ = 38; + phi_std_raw_1dim__ = std::numeric_limits::min(); lcm_sym42__ = (N - 1); phi_std_raw_1dim__ = lcm_sym42__; @@ -9239,7 +9195,6 @@ class expr_prop_fail5_model final : public model_base_crtp{}); - nind = std::numeric_limits::min(); current_statement__ = 37; nind = context__.vals_i("nind")[(1 - 1)]; @@ -9248,7 +9203,6 @@ class expr_prop_fail5_model final : public model_base_crtp{}); - n_occasions = std::numeric_limits::min(); current_statement__ = 38; n_occasions = context__.vals_i("n_occasions")[(1 - 1)]; @@ -9262,8 +9216,6 @@ class expr_prop_fail5_model final : public model_base_crtp{static_cast(nind), static_cast(n_occasions)}); - y = std::vector>(nind, std::vector(n_occasions, std::numeric_limits::min())); - { std::vector y_flat__; @@ -9372,16 +9324,19 @@ class expr_prop_fail5_model final : public model_base_crtp::min(); lcm_sym155__ = (n_occasions - 1); n_occ_minus_1 = lcm_sym155__; current_statement__ = 43; validate_non_negative_index("first", "nind", nind); current_statement__ = 44; + first = std::vector(nind, std::numeric_limits::min()); current_statement__ = 45; validate_non_negative_index("last", "nind", nind); current_statement__ = 46; + last = std::vector(nind, std::numeric_limits::min()); current_statement__ = 51; if (lcm_sym154__) { @@ -11995,7 +11950,6 @@ class expr_prop_fail6_model final : public model_base_crtp{}); - M = std::numeric_limits::min(); current_statement__ = 106; M = context__.vals_i("M")[(1 - 1)]; @@ -12004,7 +11958,6 @@ class expr_prop_fail6_model final : public model_base_crtp{}); - n_occasions = std::numeric_limits::min(); current_statement__ = 107; n_occasions = context__.vals_i("n_occasions")[(1 - 1)]; @@ -12018,8 +11971,6 @@ class expr_prop_fail6_model final : public model_base_crtp{static_cast(M), static_cast(n_occasions)}); - y = std::vector>(M, std::vector(n_occasions, std::numeric_limits::min())); - { std::vector y_flat__; @@ -12130,10 +12081,12 @@ class expr_prop_fail6_model final : public model_base_crtp(M, std::numeric_limits::min()); current_statement__ = 113; validate_non_negative_index("last", "M", M); current_statement__ = 114; + last = std::vector(M, std::numeric_limits::min()); current_statement__ = 116; if (lcm_sym309__) { @@ -12307,6 +12260,7 @@ class expr_prop_fail6_model final : public model_base_crtp::min(); lcm_sym311__ = (n_occasions - 1); phi_2dim__ = lcm_sym311__; @@ -14901,7 +14855,6 @@ class expr_prop_fail7_model final : public model_base_crtp{}); - K = std::numeric_limits::min(); current_statement__ = 20; K = context__.vals_i("K")[(1 - 1)]; @@ -14910,7 +14863,6 @@ class expr_prop_fail7_model final : public model_base_crtp{}); - I = std::numeric_limits::min(); current_statement__ = 21; I = context__.vals_i("I")[(1 - 1)]; @@ -14919,7 +14871,6 @@ class expr_prop_fail7_model final : public model_base_crtp{}); - J = std::numeric_limits::min(); current_statement__ = 22; J = context__.vals_i("J")[(1 - 1)]; @@ -14933,8 +14884,6 @@ class expr_prop_fail7_model final : public model_base_crtp{static_cast(I), static_cast(J)}); - y = std::vector>(I, std::vector(J, std::numeric_limits::min())); - { std::vector y_flat__; @@ -15047,8 +14996,6 @@ class expr_prop_fail7_model final : public model_base_crtp{static_cast(K)}); - alpha = Eigen::Matrix(K); - stan::math::fill(alpha, std::numeric_limits::quiet_NaN()); { std::vector alpha_flat__; @@ -15091,8 +15038,6 @@ class expr_prop_fail7_model final : public model_base_crtp{static_cast(K), static_cast(K)}); - beta = std::vector>(K, Eigen::Matrix(K)); - stan::math::fill(beta, std::numeric_limits::quiet_NaN()); { std::vector beta_flat__; @@ -16188,7 +16133,6 @@ class expr_prop_fail8_model final : public model_base_crtp{}); - N = std::numeric_limits::min(); current_statement__ = 12; N = context__.vals_i("N")[(1 - 1)]; @@ -16197,7 +16141,6 @@ class expr_prop_fail8_model final : public model_base_crtp{}); - N_edges = std::numeric_limits::min(); current_statement__ = 13; N_edges = context__.vals_i("N_edges")[(1 - 1)]; @@ -16208,7 +16151,6 @@ class expr_prop_fail8_model final : public model_base_crtp{static_cast(N_edges)}); - node1 = std::vector(N_edges, std::numeric_limits::min()); current_statement__ = 15; node1 = context__.vals_i("node1"); @@ -16239,7 +16181,6 @@ class expr_prop_fail8_model final : public model_base_crtp{static_cast(N_edges)}); - node2 = std::vector(N_edges, std::numeric_limits::min()); current_statement__ = 17; node2 = context__.vals_i("node2"); @@ -16270,7 +16211,6 @@ class expr_prop_fail8_model final : public model_base_crtp{static_cast(N)}); - y = std::vector(N, std::numeric_limits::min()); current_statement__ = 19; y = context__.vals_i("y"); @@ -16289,8 +16229,6 @@ class expr_prop_fail8_model final : public model_base_crtp{static_cast(N)}); - x = Eigen::Matrix(N); - stan::math::fill(x, std::numeric_limits::quiet_NaN()); { std::vector x_flat__; @@ -17311,7 +17249,6 @@ class fails_test_model final : public model_base_crtp { current_statement__ = 31; context__.validate_dims("data initialization","nind","int", std::vector{}); - nind = std::numeric_limits::min(); current_statement__ = 31; nind = context__.vals_i("nind")[(1 - 1)]; @@ -17320,7 +17257,6 @@ class fails_test_model final : public model_base_crtp { current_statement__ = 32; context__.validate_dims("data initialization","n_occasions","int", std::vector{}); - n_occasions = std::numeric_limits::min(); current_statement__ = 32; n_occasions = context__.vals_i("n_occasions")[(1 - 1)]; @@ -17334,8 +17270,6 @@ class fails_test_model final : public model_base_crtp { context__.validate_dims("data initialization","y","int", std::vector{static_cast(nind), static_cast(n_occasions)}); - y = std::vector>(nind, std::vector(n_occasions, std::numeric_limits::min())); - { std::vector y_flat__; @@ -17446,7 +17380,6 @@ class fails_test_model final : public model_base_crtp { current_statement__ = 36; context__.validate_dims("data initialization","max_age","int", std::vector{}); - max_age = std::numeric_limits::min(); current_statement__ = 36; max_age = context__.vals_i("max_age")[(1 - 1)]; @@ -17460,8 +17393,6 @@ class fails_test_model final : public model_base_crtp { context__.validate_dims("data initialization","x","int", std::vector{static_cast(nind), static_cast(lcm_sym159__)}); - x = std::vector>(nind, std::vector(lcm_sym159__, std::numeric_limits::min())); - { std::vector x_flat__; @@ -17567,16 +17498,19 @@ class fails_test_model final : public model_base_crtp { } } current_statement__ = 39; + n_occ_minus_1 = std::numeric_limits::min(); current_statement__ = 39; n_occ_minus_1 = lcm_sym159__; current_statement__ = 40; validate_non_negative_index("first", "nind", nind); current_statement__ = 41; + first = std::vector(nind, std::numeric_limits::min()); current_statement__ = 42; validate_non_negative_index("last", "nind", nind); current_statement__ = 43; + last = std::vector(nind, std::numeric_limits::min()); current_statement__ = 48; if (lcm_sym157__) { @@ -20205,7 +20139,6 @@ class inlining_fail2_model final : public model_base_crtp current_statement__ = 103; context__.validate_dims("data initialization","M","int", std::vector{}); - M = std::numeric_limits::min(); current_statement__ = 103; M = context__.vals_i("M")[(1 - 1)]; @@ -20214,7 +20147,6 @@ class inlining_fail2_model final : public model_base_crtp current_statement__ = 104; context__.validate_dims("data initialization","n_occasions","int", std::vector{}); - n_occasions = std::numeric_limits::min(); current_statement__ = 104; n_occasions = context__.vals_i("n_occasions")[(1 - 1)]; @@ -20228,8 +20160,6 @@ class inlining_fail2_model final : public model_base_crtp context__.validate_dims("data initialization","y","int", std::vector{static_cast(M), static_cast(n_occasions)}); - y = std::vector>(M, std::vector(n_occasions, std::numeric_limits::min())); - { std::vector y_flat__; @@ -20340,10 +20270,12 @@ class inlining_fail2_model final : public model_base_crtp current_statement__ = 108; validate_non_negative_index("first", "M", M); current_statement__ = 109; + first = std::vector(M, std::numeric_limits::min()); current_statement__ = 110; validate_non_negative_index("last", "M", M); current_statement__ = 111; + last = std::vector(M, std::numeric_limits::min()); current_statement__ = 113; if (lcm_sym316__) { @@ -20513,6 +20445,7 @@ class inlining_fail2_model final : public model_base_crtp current_statement__ = 121; validate_non_negative_index("gamma", "n_occasions", n_occasions); current_statement__ = 122; + epsilon_1dim__ = std::numeric_limits::min(); lcm_sym318__ = (n_occasions - 1); epsilon_1dim__ = lcm_sym318__; @@ -20521,6 +20454,7 @@ class inlining_fail2_model final : public model_base_crtp current_statement__ = 123; validate_non_negative_index("phi", "M", M); current_statement__ = 124; + phi_2dim__ = std::numeric_limits::min(); current_statement__ = 124; phi_2dim__ = lcm_sym318__; @@ -22889,15 +22823,16 @@ class lcm_experiment_model final : public model_base_crtp current_statement__ = 1; context__.validate_dims("data initialization","j","int", std::vector{}); - j = std::numeric_limits::min(); current_statement__ = 1; j = context__.vals_i("j")[(1 - 1)]; current_statement__ = 2; + z = std::numeric_limits::quiet_NaN(); current_statement__ = 2; z = 1; current_statement__ = 3; + x = std::numeric_limits::quiet_NaN(); { current_statement__ = 4; @@ -22906,6 +22841,7 @@ class lcm_experiment_model final : public model_base_crtp z = normal_rng(lcm_sym3__, 1, base_rng__); } current_statement__ = 6; + i = std::numeric_limits::quiet_NaN(); current_statement__ = 6; i = normal_rng(lcm_sym3__, 1, base_rng__); @@ -23557,7 +23493,6 @@ class lcm_fails_model final : public model_base_crtp { current_statement__ = 3; context__.validate_dims("data initialization","J","int", std::vector{}); - J = std::numeric_limits::min(); current_statement__ = 3; J = context__.vals_i("J")[(1 - 1)]; @@ -23568,7 +23503,6 @@ class lcm_fails_model final : public model_base_crtp { current_statement__ = 5; context__.validate_dims("data initialization","y","double", std::vector{static_cast(J)}); - y = std::vector(J, std::numeric_limits::quiet_NaN()); current_statement__ = 5; y = context__.vals_r("y"); @@ -24296,7 +24230,6 @@ class lcm_fails2_model final : public model_base_crtp { current_statement__ = 31; context__.validate_dims("data initialization","nind","int", std::vector{}); - nind = std::numeric_limits::min(); current_statement__ = 31; nind = context__.vals_i("nind")[(1 - 1)]; @@ -24305,7 +24238,6 @@ class lcm_fails2_model final : public model_base_crtp { current_statement__ = 32; context__.validate_dims("data initialization","n_occasions","int", std::vector{}); - n_occasions = std::numeric_limits::min(); current_statement__ = 32; n_occasions = context__.vals_i("n_occasions")[(1 - 1)]; @@ -24319,8 +24251,6 @@ class lcm_fails2_model final : public model_base_crtp { context__.validate_dims("data initialization","y","int", std::vector{static_cast(nind), static_cast(n_occasions)}); - y = std::vector>(nind, std::vector(n_occasions, std::numeric_limits::min())); - { std::vector y_flat__; @@ -24429,16 +24359,19 @@ class lcm_fails2_model final : public model_base_crtp { } } current_statement__ = 36; + n_occ_minus_1 = std::numeric_limits::min(); lcm_sym139__ = (n_occasions - 1); n_occ_minus_1 = lcm_sym139__; current_statement__ = 37; validate_non_negative_index("first", "nind", nind); current_statement__ = 38; + first = std::vector(nind, std::numeric_limits::min()); current_statement__ = 39; validate_non_negative_index("last", "nind", nind); current_statement__ = 40; + last = std::vector(nind, std::numeric_limits::min()); current_statement__ = 45; if (lcm_sym138__) { @@ -26077,7 +26010,6 @@ class lupdf_inlining_model final : public model_base_crtp current_statement__ = 9; context__.validate_dims("data initialization","n","int", std::vector{}); - n = std::numeric_limits::min(); current_statement__ = 9; n = context__.vals_i("n")[(1 - 1)]; @@ -26597,7 +26529,6 @@ class off_dce_model final : public model_base_crtp { current_statement__ = 31; context__.validate_dims("data initialization","R","int", std::vector{}); - R = std::numeric_limits::min(); current_statement__ = 31; R = context__.vals_i("R")[(1 - 1)]; @@ -26606,7 +26537,6 @@ class off_dce_model final : public model_base_crtp { current_statement__ = 32; context__.validate_dims("data initialization","T","int", std::vector{}); - T = std::numeric_limits::min(); current_statement__ = 32; T = context__.vals_i("T")[(1 - 1)]; @@ -26620,8 +26550,6 @@ class off_dce_model final : public model_base_crtp { context__.validate_dims("data initialization","y","int", std::vector{static_cast(R), static_cast(T)}); - y = std::vector>(R, std::vector(T, std::numeric_limits::min())); - { std::vector y_flat__; @@ -26734,8 +26662,6 @@ class off_dce_model final : public model_base_crtp { current_statement__ = 37; context__.validate_dims("data initialization","X","double", std::vector{static_cast(R)}); - X = Eigen::Matrix(R); - stan::math::fill(X, std::numeric_limits::quiet_NaN()); { std::vector X_flat__; @@ -26762,8 +26688,10 @@ class off_dce_model final : public model_base_crtp { current_statement__ = 38; validate_non_negative_index("sum_y", "R", R); current_statement__ = 39; + sum_y = std::vector(R, std::numeric_limits::min()); current_statement__ = 40; + occ_obs = std::numeric_limits::min(); current_statement__ = 41; occ_obs = 0; @@ -27565,7 +27493,6 @@ class off_small_model final : public model_base_crtp { current_statement__ = 20; context__.validate_dims("data initialization","J","int", std::vector{}); - J = std::numeric_limits::min(); current_statement__ = 20; J = context__.vals_i("J")[(1 - 1)]; @@ -27574,7 +27501,6 @@ class off_small_model final : public model_base_crtp { current_statement__ = 21; context__.validate_dims("data initialization","N","int", std::vector{}); - N = std::numeric_limits::min(); current_statement__ = 21; N = context__.vals_i("N")[(1 - 1)]; @@ -27585,7 +27511,6 @@ class off_small_model final : public model_base_crtp { current_statement__ = 23; context__.validate_dims("data initialization","person","int", std::vector{static_cast(N)}); - person = std::vector(N, std::numeric_limits::min()); current_statement__ = 23; person = context__.vals_i("person"); @@ -27616,8 +27541,6 @@ class off_small_model final : public model_base_crtp { current_statement__ = 25; context__.validate_dims("data initialization","time","double", std::vector{static_cast(N)}); - time = Eigen::Matrix(N); - stan::math::fill(time, std::numeric_limits::quiet_NaN()); { std::vector time_flat__; @@ -27646,8 +27569,6 @@ class off_small_model final : public model_base_crtp { current_statement__ = 27; context__.validate_dims("data initialization","treatment","double", std::vector{static_cast(N)}); - treatment = Eigen::Matrix(N); - stan::math::fill(treatment, std::numeric_limits::quiet_NaN()); { std::vector treatment_flat__; @@ -27677,8 +27598,6 @@ class off_small_model final : public model_base_crtp { current_statement__ = 29; context__.validate_dims("data initialization","y","double", std::vector{static_cast(N)}); - y = Eigen::Matrix(N); - stan::math::fill(y, std::numeric_limits::quiet_NaN()); { std::vector y_flat__; @@ -29940,7 +29859,6 @@ class partial_eval_model final : public model_base_crtp { current_statement__ = 13; context__.validate_dims("data initialization","N","int", std::vector{}); - N = std::numeric_limits::min(); current_statement__ = 13; N = context__.vals_i("N")[(1 - 1)]; @@ -29949,7 +29867,6 @@ class partial_eval_model final : public model_base_crtp { current_statement__ = 14; context__.validate_dims("data initialization","n_pair","int", std::vector{}); - n_pair = std::numeric_limits::min(); current_statement__ = 14; n_pair = context__.vals_i("n_pair")[(1 - 1)]; @@ -29960,7 +29877,6 @@ class partial_eval_model final : public model_base_crtp { current_statement__ = 16; context__.validate_dims("data initialization","pair","int", std::vector{static_cast(N)}); - pair = std::vector(N, std::numeric_limits::min()); current_statement__ = 16; pair = context__.vals_i("pair"); @@ -29991,8 +29907,6 @@ class partial_eval_model final : public model_base_crtp { current_statement__ = 18; context__.validate_dims("data initialization","pre_test","double", std::vector{static_cast(N)}); - pre_test = Eigen::Matrix(N); - stan::math::fill(pre_test, std::numeric_limits::quiet_NaN()); { std::vector pre_test_flat__; @@ -30022,8 +29936,6 @@ class partial_eval_model final : public model_base_crtp { current_statement__ = 20; context__.validate_dims("data initialization","treatment","double", std::vector{static_cast(N)}); - treatment = Eigen::Matrix(N); - stan::math::fill(treatment, std::numeric_limits::quiet_NaN()); { std::vector treatment_flat__; @@ -30076,8 +29988,6 @@ class partial_eval_model final : public model_base_crtp { current_statement__ = 22; context__.validate_dims("data initialization","y","double", std::vector{static_cast(N)}); - y = Eigen::Matrix(N); - stan::math::fill(y, std::numeric_limits::quiet_NaN()); { std::vector y_flat__; @@ -30762,7 +30672,6 @@ class stalled1_failure_model final : public model_base_crtp{}); - I = std::numeric_limits::min(); current_statement__ = 17; I = context__.vals_i("I")[(1 - 1)]; @@ -30773,7 +30682,6 @@ class stalled1_failure_model final : public model_base_crtp{static_cast(I)}); - n = std::vector(I, std::numeric_limits::min()); current_statement__ = 19; n = context__.vals_i("n"); @@ -30792,7 +30700,6 @@ class stalled1_failure_model final : public model_base_crtp{static_cast(I)}); - N = std::vector(I, std::numeric_limits::min()); current_statement__ = 21; N = context__.vals_i("N"); @@ -30811,8 +30718,6 @@ class stalled1_failure_model final : public model_base_crtp{static_cast(I)}); - x1 = Eigen::Matrix(I); - stan::math::fill(x1, std::numeric_limits::quiet_NaN()); { std::vector x1_flat__; @@ -30841,8 +30746,6 @@ class stalled1_failure_model final : public model_base_crtp{static_cast(I)}); - x2 = Eigen::Matrix(I); - stan::math::fill(x2, std::numeric_limits::quiet_NaN()); { std::vector x2_flat__; @@ -30867,10 +30770,13 @@ class stalled1_failure_model final : public model_base_crtp::min(); current_statement__ = 27; validate_non_negative_index("x1x2", "I", I); current_statement__ = 28; + x1x2 = Eigen::Matrix(I); + stan::math::fill(x1x2, std::numeric_limits::quiet_NaN()); current_statement__ = 29; K = 8; From 6c7eb4736e8f4b2b2ada9f2b2c1c9ad0d27f3120 Mon Sep 17 00:00:00 2001 From: Steve Bronder Date: Mon, 5 Apr 2021 16:04:48 -0400 Subject: [PATCH 5/7] fix decl for td and d --- src/stan_math_backend/Stan_math_code_gen.ml | 3 +- src/stan_math_backend/Statement_gen.ml | 18 +- test/integration/good/code-gen/cl.expected | 11 ++ test/integration/good/code-gen/cpp.expected | 163 ++++++++++++++++++ .../good/code-gen/expressions/cpp.expected | 2 + .../good/code-gen/opencl/cpp.expected | 16 ++ .../good/code-gen/profiling/cpp.expected | 3 + .../good/compiler-optimizations/cpp.expected | 118 +++++++++++++ 8 files changed, 325 insertions(+), 9 deletions(-) diff --git a/src/stan_math_backend/Stan_math_code_gen.ml b/src/stan_math_backend/Stan_math_code_gen.ml index 02a8c6af82..89174b9ff4 100644 --- a/src/stan_math_backend/Stan_math_code_gen.ml +++ b/src/stan_math_backend/Stan_math_code_gen.ml @@ -389,7 +389,8 @@ let pp_ctor ppf p = match is_input_data with | true -> pp_validate_data ppf (decl_id, st) ; - | false -> pp_set_size ppf (decl_id, st, DataOnly) ) + pp_set_size ppf (decl_id, st, DataOnly, false) + | false -> pp_set_size ppf (decl_id, st, DataOnly, true) ) | Unsized _ -> () ) | _ -> pp_statement ppf s in diff --git a/src/stan_math_backend/Statement_gen.ml b/src/stan_math_backend/Statement_gen.ml index db9fbd5319..e28f6c57cf 100644 --- a/src/stan_math_backend/Statement_gen.ml +++ b/src/stan_math_backend/Statement_gen.ml @@ -21,7 +21,7 @@ let rec contains_eigen (ut : UnsizedType.t) : bool = | UMatrix | URowVector | UVector -> true | UInt | UReal | UMathLibraryFunction | UFun _ -> false -let pp_set_size ppf (decl_id, st, adtype) = +let pp_set_size ppf (decl_id, st, adtype, (needs_filled : bool)) = (* TODO: generate optimal adtypes for expressions and declarations *) let real_nan = match adtype with @@ -40,21 +40,23 @@ let pp_set_size ppf (decl_id, st, adtype) = | SArray (t, d) -> pf ppf "%a(%a, %a)" pp_st st pp_expr d pp_size_ctor t in let print_fill ppf st = - match contains_eigen (SizedType.to_unsized st) with - | true -> pf ppf "stan::math::fill(%s, %s);" decl_id real_nan - | false -> () + match (contains_eigen (SizedType.to_unsized st), needs_filled) with + | true, true -> pf ppf "stan::math::fill(%s, %s);" decl_id real_nan + | _, _ -> () in pf ppf "@[%s = %a;@,%a @]@," decl_id pp_size_ctor st print_fill st let%expect_test "set size mat array" = let int = Expr.Helpers.int in strf "@[%a@]" pp_set_size - ("d", SArray (SArray (SMatrix (int 2, int 3), int 4), int 5), DataOnly) + ( "d" + , SArray (SArray (SMatrix (int 2, int 3), int 4), int 5) + , DataOnly + , false ) |> print_endline ; [%expect {| - d = std::vector>>(5, std::vector>(4, Eigen::Matrix(2, 3))); - stan::math::fill(d, std::numeric_limits::quiet_NaN()); |}] + d = std::vector>>(5, std::vector>(4, Eigen::Matrix(2, 3))); |}] (** [pp_for_loop ppf (loopvar, lower, upper, pp_body, body)] tries to pretty print a for-loop from lower to upper given some loopvar.*) @@ -80,7 +82,7 @@ let pp_decl ppf (vident, ut, adtype) = let pp_sized_decl ppf (vident, st, adtype) = pf ppf "%a@,%a" pp_decl (vident, SizedType.to_unsized st, adtype) - pp_set_size (vident, st, adtype) + pp_set_size (vident, st, adtype, true) let pp_possibly_sized_decl ppf (vident, pst, adtype) = match pst with diff --git a/test/integration/good/code-gen/cl.expected b/test/integration/good/code-gen/cl.expected index 33c6dfe8c2..ee5e5e35ac 100644 --- a/test/integration/good/code-gen/cl.expected +++ b/test/integration/good/code-gen/cl.expected @@ -298,6 +298,7 @@ class optimize_glm_model final : public model_base_crtp { current_statement__ = 176; context__.validate_dims("data initialization","k","int", std::vector{}); + k = std::numeric_limits::min(); current_statement__ = 176; k = context__.vals_i("k")[(1 - 1)]; @@ -306,6 +307,7 @@ class optimize_glm_model final : public model_base_crtp { current_statement__ = 177; context__.validate_dims("data initialization","n","int", std::vector{}); + n = std::numeric_limits::min(); current_statement__ = 177; n = context__.vals_i("n")[(1 - 1)]; @@ -319,6 +321,7 @@ class optimize_glm_model final : public model_base_crtp { context__.validate_dims("data initialization","X_d","double", std::vector{static_cast(n), static_cast(k)}); + X_d = Eigen::Matrix(n, k); { std::vector X_d_flat__; @@ -346,6 +349,8 @@ class optimize_glm_model final : public model_base_crtp { context__.validate_dims("data initialization","X_d_a","double", std::vector{static_cast(2), static_cast(n), static_cast(k)}); + X_d_a = std::vector>(2, Eigen::Matrix(n, k)); + { std::vector X_d_a_flat__; @@ -375,6 +380,7 @@ class optimize_glm_model final : public model_base_crtp { current_statement__ = 185; context__.validate_dims("data initialization","y_v_d","double", std::vector{static_cast(n)}); + y_v_d = Eigen::Matrix(n); { std::vector y_v_d_flat__; @@ -396,6 +402,7 @@ class optimize_glm_model final : public model_base_crtp { current_statement__ = 187; context__.validate_dims("data initialization","X_rv_d","double", std::vector{static_cast(n)}); + X_rv_d = Eigen::Matrix(n); { std::vector X_rv_d_flat__; @@ -417,6 +424,7 @@ class optimize_glm_model final : public model_base_crtp { current_statement__ = 189; context__.validate_dims("data initialization","y_vi_d","int", std::vector{static_cast(n)}); + y_vi_d = std::vector(n, std::numeric_limits::min()); current_statement__ = 189; y_vi_d = context__.vals_i("y_vi_d"); @@ -425,18 +433,21 @@ class optimize_glm_model final : public model_base_crtp { current_statement__ = 191; context__.validate_dims("data initialization","y2_vi_d","int", std::vector{static_cast(n)}); + y2_vi_d = std::vector(n, std::numeric_limits::min()); current_statement__ = 191; y2_vi_d = context__.vals_i("y2_vi_d"); current_statement__ = 192; context__.validate_dims("data initialization","y_s_d","int", std::vector{}); + y_s_d = std::numeric_limits::min(); current_statement__ = 192; y_s_d = context__.vals_i("y_s_d")[(1 - 1)]; current_statement__ = 193; context__.validate_dims("data initialization","y_r_d","double", std::vector{}); + y_r_d = std::numeric_limits::quiet_NaN(); current_statement__ = 193; y_r_d = context__.vals_r("y_r_d")[(1 - 1)]; diff --git a/test/integration/good/code-gen/cpp.expected b/test/integration/good/code-gen/cpp.expected index a3b0002a9f..6e4a1e3cbb 100644 --- a/test/integration/good/code-gen/cpp.expected +++ b/test/integration/good/code-gen/cpp.expected @@ -75,6 +75,7 @@ class _8_schools_ncp_model final : public model_base_crtp<_8_schools_ncp_model> current_statement__ = 9; context__.validate_dims("data initialization","J","int", std::vector{}); + J = std::numeric_limits::min(); current_statement__ = 9; J = context__.vals_i("J")[(1 - 1)]; @@ -85,6 +86,7 @@ class _8_schools_ncp_model final : public model_base_crtp<_8_schools_ncp_model> current_statement__ = 11; context__.validate_dims("data initialization","y","double", std::vector{static_cast(J)}); + y = std::vector(J, std::numeric_limits::quiet_NaN()); current_statement__ = 11; y = context__.vals_r("y"); @@ -93,6 +95,8 @@ class _8_schools_ncp_model final : public model_base_crtp<_8_schools_ncp_model> current_statement__ = 13; context__.validate_dims("data initialization","sigma","double", std::vector{static_cast(J)}); + sigma = std::vector(J, std::numeric_limits::quiet_NaN()); + current_statement__ = 13; sigma = context__.vals_r("sigma"); @@ -537,6 +541,7 @@ class _8start_with_number_model final : public model_base_crtp<_8start_with_numb current_statement__ = 2; context__.validate_dims("data initialization","good_model","int", std::vector{}); + good_model = std::numeric_limits::min(); current_statement__ = 2; good_model = context__.vals_i("good_model")[(1 - 1)]; @@ -873,6 +878,7 @@ class eight_schools_ncp_model final : public model_base_crtp{}); + J = std::numeric_limits::min(); current_statement__ = 9; J = context__.vals_i("J")[(1 - 1)]; @@ -883,6 +889,7 @@ class eight_schools_ncp_model final : public model_base_crtp{static_cast(J)}); + y = std::vector(J, std::numeric_limits::quiet_NaN()); current_statement__ = 11; y = context__.vals_r("y"); @@ -891,6 +898,8 @@ class eight_schools_ncp_model final : public model_base_crtp{static_cast(J)}); + sigma = std::vector(J, std::numeric_limits::quiet_NaN()); + current_statement__ = 13; sigma = context__.vals_r("sigma"); @@ -4647,6 +4656,7 @@ class mother_model final : public model_base_crtp { current_statement__ = 186; context__.validate_dims("data initialization","N","int", std::vector{}); + N = std::numeric_limits::min(); current_statement__ = 186; N = context__.vals_i("N")[(1 - 1)]; @@ -4655,6 +4665,7 @@ class mother_model final : public model_base_crtp { current_statement__ = 187; context__.validate_dims("data initialization","M","int", std::vector{}); + M = std::numeric_limits::min(); current_statement__ = 187; M = context__.vals_i("M")[(1 - 1)]; @@ -4663,6 +4674,7 @@ class mother_model final : public model_base_crtp { current_statement__ = 188; context__.validate_dims("data initialization","K","int", std::vector{}); + K = std::numeric_limits::min(); current_statement__ = 188; K = context__.vals_i("K")[(1 - 1)]; @@ -4675,6 +4687,7 @@ class mother_model final : public model_base_crtp { current_statement__ = 190; context__.validate_dims("data initialization","d_int_1d_ar","int", std::vector{static_cast(N)}); + d_int_1d_ar = std::vector(N, std::numeric_limits::min()); current_statement__ = 190; d_int_1d_ar = context__.vals_i("d_int_1d_ar"); @@ -4694,6 +4707,8 @@ class mother_model final : public model_base_crtp { context__.validate_dims("data initialization","d_int_3d_ar","int", std::vector{static_cast(N), static_cast(M), static_cast(K)}); + d_int_3d_ar = std::vector>>(N, std::vector>(M, std::vector(K, std::numeric_limits::min()))); + { std::vector d_int_3d_ar_flat__; @@ -4735,6 +4750,7 @@ class mother_model final : public model_base_crtp { current_statement__ = 195; context__.validate_dims("data initialization","J","double", std::vector{}); + J = std::numeric_limits::quiet_NaN(); current_statement__ = 195; J = context__.vals_r("J")[(1 - 1)]; @@ -4747,6 +4763,8 @@ class mother_model final : public model_base_crtp { current_statement__ = 197; context__.validate_dims("data initialization","d_real_1d_ar","double", std::vector{static_cast(N)}); + d_real_1d_ar = std::vector(N, std::numeric_limits::quiet_NaN()); + current_statement__ = 197; d_real_1d_ar = context__.vals_r("d_real_1d_ar"); @@ -4760,6 +4778,8 @@ class mother_model final : public model_base_crtp { context__.validate_dims("data initialization","d_real_3d_ar","double", std::vector{static_cast(N), static_cast(M), static_cast(K)}); + d_real_3d_ar = std::vector>>(N, std::vector>(M, std::vector(K, std::numeric_limits::quiet_NaN()))); + { std::vector d_real_3d_ar_flat__; @@ -4789,6 +4809,7 @@ class mother_model final : public model_base_crtp { current_statement__ = 203; context__.validate_dims("data initialization","d_vec","double", std::vector{static_cast(N)}); + d_vec = Eigen::Matrix(N); { std::vector d_vec_flat__; @@ -4813,6 +4834,8 @@ class mother_model final : public model_base_crtp { context__.validate_dims("data initialization","d_1d_vec","double", std::vector{static_cast(N), static_cast(N)}); + d_1d_vec = std::vector>(N, Eigen::Matrix(N)); + { std::vector d_1d_vec_flat__; @@ -4846,6 +4869,8 @@ class mother_model final : public model_base_crtp { std::vector{static_cast(N), static_cast(M), static_cast(K), static_cast(N)}); + d_3d_vec = std::vector>>>(N, std::vector>>(M, std::vector>(K, Eigen::Matrix(N)))); + { std::vector d_3d_vec_flat__; @@ -4879,6 +4904,7 @@ class mother_model final : public model_base_crtp { current_statement__ = 213; context__.validate_dims("data initialization","d_row_vec","double", std::vector{static_cast(N)}); + d_row_vec = Eigen::Matrix(N); { std::vector d_row_vec_flat__; @@ -4903,6 +4929,8 @@ class mother_model final : public model_base_crtp { context__.validate_dims("data initialization","d_1d_row_vec","double", std::vector{static_cast(N), static_cast(N)}); + d_1d_row_vec = std::vector>(N, Eigen::Matrix(N)); + { std::vector d_1d_row_vec_flat__; @@ -4936,6 +4964,8 @@ class mother_model final : public model_base_crtp { std::vector{static_cast(N), static_cast(M), static_cast(K), static_cast(N)}); + d_3d_row_vec = std::vector>>>(N, std::vector>>(M, std::vector>(K, Eigen::Matrix(N)))); + { std::vector d_3d_row_vec_flat__; @@ -4969,6 +4999,8 @@ class mother_model final : public model_base_crtp { std::vector{static_cast(4), static_cast(5), static_cast(2), static_cast(3)}); + d_ar_mat = std::vector>>(4, std::vector>(5, Eigen::Matrix(2, 3))); + { std::vector d_ar_mat_flat__; @@ -5040,6 +5072,7 @@ class mother_model final : public model_base_crtp { current_statement__ = 224; context__.validate_dims("data initialization","d_simplex","double", std::vector{static_cast(N)}); + d_simplex = Eigen::Matrix(N); { std::vector d_simplex_flat__; @@ -5066,6 +5099,8 @@ class mother_model final : public model_base_crtp { context__.validate_dims("data initialization","d_1d_simplex","double", std::vector{static_cast(N), static_cast(N)}); + d_1d_simplex = std::vector>(N, Eigen::Matrix(N)); + { std::vector d_1d_simplex_flat__; @@ -5105,6 +5140,8 @@ class mother_model final : public model_base_crtp { std::vector{static_cast(N), static_cast(M), static_cast(K), static_cast(N)}); + d_3d_simplex = std::vector>>>(N, std::vector>>(M, std::vector>(K, Eigen::Matrix(N)))); + { std::vector d_3d_simplex_flat__; @@ -5150,6 +5187,7 @@ class mother_model final : public model_base_crtp { context__.validate_dims("data initialization","d_cfcov_54","double", std::vector{static_cast(5), static_cast(4)}); + d_cfcov_54 = Eigen::Matrix(5, 4); { std::vector d_cfcov_54_flat__; @@ -5176,6 +5214,7 @@ class mother_model final : public model_base_crtp { context__.validate_dims("data initialization","d_cfcov_33","double", std::vector{static_cast(3), static_cast(3)}); + d_cfcov_33 = Eigen::Matrix(3, 3); { std::vector d_cfcov_33_flat__; @@ -5204,6 +5243,8 @@ class mother_model final : public model_base_crtp { context__.validate_dims("data initialization","d_cfcov_33_ar","double", std::vector{static_cast(K), static_cast(3), static_cast(3)}); + d_cfcov_33_ar = std::vector>(K, Eigen::Matrix(3, 3)); + { std::vector d_cfcov_33_ar_flat__; @@ -5237,6 +5278,7 @@ class mother_model final : public model_base_crtp { current_statement__ = 237; context__.validate_dims("data initialization","d_int","int", std::vector{}); + d_int = std::numeric_limits::min(); current_statement__ = 237; d_int = context__.vals_i("d_int")[(1 - 1)]; @@ -5245,6 +5287,8 @@ class mother_model final : public model_base_crtp { current_statement__ = 239; context__.validate_dims("data initialization","d_int_array","int", std::vector{static_cast(d_int)}); + d_int_array = std::vector(d_int, std::numeric_limits::min()); + current_statement__ = 239; d_int_array = context__.vals_i("d_int_array"); @@ -5254,6 +5298,8 @@ class mother_model final : public model_base_crtp { context__.validate_dims("data initialization","d_int_array_2d","int", std::vector{static_cast(d_int), static_cast(2)}); + d_int_array_2d = std::vector>(d_int, std::vector(2, std::numeric_limits::min())); + { std::vector d_int_array_2d_flat__; @@ -5280,6 +5326,8 @@ class mother_model final : public model_base_crtp { context__.validate_dims("data initialization","d_int_array_3d","int", std::vector{static_cast(d_int), static_cast(2), static_cast(3)}); + d_int_array_3d = std::vector>>(d_int, std::vector>(2, std::vector(3, std::numeric_limits::min()))); + { std::vector d_int_array_3d_flat__; @@ -5307,6 +5355,7 @@ class mother_model final : public model_base_crtp { current_statement__ = 244; context__.validate_dims("data initialization","d_real","double", std::vector{}); + d_real = std::numeric_limits::quiet_NaN(); current_statement__ = 244; d_real = context__.vals_r("d_real")[(1 - 1)]; @@ -5315,6 +5364,8 @@ class mother_model final : public model_base_crtp { current_statement__ = 246; context__.validate_dims("data initialization","d_real_array","double", std::vector{static_cast(d_int)}); + d_real_array = std::vector(d_int, std::numeric_limits::quiet_NaN()); + current_statement__ = 246; d_real_array = context__.vals_r("d_real_array"); @@ -5325,6 +5376,8 @@ class mother_model final : public model_base_crtp { "double", std::vector{static_cast(d_int), static_cast(2)}); + d_real_array_2d = std::vector>(d_int, std::vector(2, std::numeric_limits::quiet_NaN())); + { std::vector d_real_array_2d_flat__; @@ -5352,6 +5405,8 @@ class mother_model final : public model_base_crtp { "double", std::vector{static_cast(d_int), static_cast(2), static_cast(3)}); + d_real_array_3d = std::vector>>(d_int, std::vector>(2, std::vector(3, std::numeric_limits::quiet_NaN()))); + { std::vector d_real_array_3d_flat__; @@ -5384,6 +5439,7 @@ class mother_model final : public model_base_crtp { context__.validate_dims("data initialization","d_matrix","double", std::vector{static_cast(d_int), static_cast(d_int)}); + d_matrix = Eigen::Matrix(d_int, d_int); { std::vector d_matrix_flat__; @@ -5415,6 +5471,8 @@ class mother_model final : public model_base_crtp { "double", std::vector{static_cast(d_int), static_cast(d_int), static_cast(d_int)}); + d_matrix_array = std::vector>(d_int, Eigen::Matrix(d_int, d_int)); + { std::vector d_matrix_array_flat__; @@ -5451,6 +5509,8 @@ class mother_model final : public model_base_crtp { std::vector{static_cast(d_int), static_cast(2), static_cast(d_int), static_cast(d_int)}); + d_matrix_array_2d = std::vector>>(d_int, std::vector>(2, Eigen::Matrix(d_int, d_int))); + { std::vector d_matrix_array_2d_flat__; @@ -5492,6 +5552,8 @@ class mother_model final : public model_base_crtp { std::vector{static_cast(d_int), static_cast(2), static_cast(3), static_cast(d_int), static_cast(d_int)}); + d_matrix_array_3d = std::vector>>>(d_int, std::vector>>(2, std::vector>(3, Eigen::Matrix(d_int, d_int)))); + { std::vector d_matrix_array_3d_flat__; @@ -5530,6 +5592,7 @@ class mother_model final : public model_base_crtp { current_statement__ = 267; context__.validate_dims("data initialization","d_vector","double", std::vector{static_cast(d_int)}); + d_vector = Eigen::Matrix(d_int); { std::vector d_vector_flat__; @@ -5555,6 +5618,8 @@ class mother_model final : public model_base_crtp { "double", std::vector{static_cast(d_int), static_cast(d_int)}); + d_vector_array = std::vector>(d_int, Eigen::Matrix(d_int)); + { std::vector d_vector_array_flat__; @@ -5584,6 +5649,8 @@ class mother_model final : public model_base_crtp { "double", std::vector{static_cast(d_int), static_cast(2), static_cast(d_int)}); + d_vector_array_2d = std::vector>>(d_int, std::vector>(2, Eigen::Matrix(d_int))); + { std::vector d_vector_array_2d_flat__; @@ -5619,6 +5686,8 @@ class mother_model final : public model_base_crtp { std::vector{static_cast(d_int), static_cast(2), static_cast(3), static_cast(d_int)}); + d_vector_array_3d = std::vector>>>(d_int, std::vector>>(2, std::vector>(3, Eigen::Matrix(d_int)))); + { std::vector d_vector_array_3d_flat__; @@ -5653,6 +5722,7 @@ class mother_model final : public model_base_crtp { current_statement__ = 278; context__.validate_dims("data initialization","d_row_vector","double", std::vector{static_cast(d_int)}); + d_row_vector = Eigen::Matrix(d_int); { std::vector d_row_vector_flat__; @@ -5678,6 +5748,8 @@ class mother_model final : public model_base_crtp { "double", std::vector{static_cast(d_int), static_cast(d_int)}); + d_row_vector_array = std::vector>(d_int, Eigen::Matrix(d_int)); + { std::vector d_row_vector_array_flat__; @@ -5708,6 +5780,8 @@ class mother_model final : public model_base_crtp { "double", std::vector{static_cast(d_int), static_cast(2), static_cast(d_int)}); + d_row_vector_array_2d = std::vector>>(d_int, std::vector>(2, Eigen::Matrix(d_int))); + { std::vector d_row_vector_array_2d_flat__; @@ -5743,6 +5817,8 @@ class mother_model final : public model_base_crtp { std::vector{static_cast(d_int), static_cast(2), static_cast(3), static_cast(d_int)}); + d_row_vector_array_3d = std::vector>>>(d_int, std::vector>>(2, std::vector>(3, Eigen::Matrix(d_int)))); + { std::vector d_row_vector_array_3d_flat__; @@ -11165,6 +11241,7 @@ class motherHOF_model final : public model_base_crtp { current_statement__ = 123; context__.validate_dims("data initialization","T","int", std::vector{}); + T = std::numeric_limits::min(); current_statement__ = 123; T = context__.vals_i("T")[(1 - 1)]; @@ -11173,12 +11250,15 @@ class motherHOF_model final : public model_base_crtp { current_statement__ = 124; context__.validate_dims("data initialization","y0_d","double", std::vector{static_cast(2)}); + y0_d = std::vector(2, std::numeric_limits::quiet_NaN()); + current_statement__ = 124; y0_d = context__.vals_r("y0_d"); current_statement__ = 125; context__.validate_dims("data initialization","t0","double", std::vector{}); + t0 = std::numeric_limits::quiet_NaN(); current_statement__ = 125; t0 = context__.vals_r("t0")[(1 - 1)]; @@ -11187,42 +11267,51 @@ class motherHOF_model final : public model_base_crtp { current_statement__ = 127; context__.validate_dims("data initialization","ts","double", std::vector{static_cast(T)}); + ts = std::vector(T, std::numeric_limits::quiet_NaN()); current_statement__ = 127; ts = context__.vals_r("ts"); current_statement__ = 128; context__.validate_dims("data initialization","theta_d","double", std::vector{static_cast(1)}); + theta_d = std::vector(1, std::numeric_limits::quiet_NaN()); + current_statement__ = 128; theta_d = context__.vals_r("theta_d"); current_statement__ = 129; context__.validate_dims("data initialization","x","double", std::vector{static_cast(0)}); + x = std::vector(0, std::numeric_limits::quiet_NaN()); current_statement__ = 129; x = context__.vals_r("x"); current_statement__ = 130; context__.validate_dims("data initialization","x_int","int", std::vector{static_cast(0)}); + x_int = std::vector(0, std::numeric_limits::min()); current_statement__ = 130; x_int = context__.vals_i("x_int"); current_statement__ = 131; context__.validate_dims("data initialization","x_d_r","double", std::vector{static_cast(0)}); + x_d_r = std::vector(0, std::numeric_limits::quiet_NaN()); + current_statement__ = 131; x_d_r = context__.vals_r("x_d_r"); current_statement__ = 132; context__.validate_dims("data initialization","x_d_i","int", std::vector{static_cast(0)}); + x_d_i = std::vector(0, std::numeric_limits::min()); current_statement__ = 132; x_d_i = context__.vals_i("x_d_i"); current_statement__ = 133; context__.validate_dims("data initialization","shared_params_d", "double", std::vector{static_cast(3)}); + shared_params_d = Eigen::Matrix(3); { std::vector shared_params_d_flat__; @@ -11243,6 +11332,8 @@ class motherHOF_model final : public model_base_crtp { context__.validate_dims("data initialization","job_params_d","double", std::vector{static_cast(3), static_cast(3)}); + job_params_d = std::vector>(3, Eigen::Matrix(3)); + { std::vector job_params_d_flat__; @@ -11267,6 +11358,8 @@ class motherHOF_model final : public model_base_crtp { context__.validate_dims("data initialization","data_r","double", std::vector{static_cast(3), static_cast(3)}); + data_r = std::vector>(3, std::vector(3, std::numeric_limits::quiet_NaN())); + { std::vector data_r_flat__; @@ -11291,6 +11384,8 @@ class motherHOF_model final : public model_base_crtp { context__.validate_dims("data initialization","data_i","int", std::vector{static_cast(3), static_cast(3)}); + data_i = std::vector>(3, std::vector(3, std::numeric_limits::min())); + { std::vector data_i_flat__; @@ -13475,18 +13570,21 @@ class new_integrate_interface_model final : public model_base_crtp{}); + N = std::numeric_limits::min(); current_statement__ = 601; N = context__.vals_i("N")[(1 - 1)]; current_statement__ = 602; context__.validate_dims("data initialization","id","int", std::vector{}); + id = std::numeric_limits::min(); current_statement__ = 602; id = context__.vals_i("id")[(1 - 1)]; current_statement__ = 603; context__.validate_dims("data initialization","rd","double", std::vector{}); + rd = std::numeric_limits::quiet_NaN(); current_statement__ = 603; rd = context__.vals_r("rd")[(1 - 1)]; @@ -13495,6 +13593,8 @@ class new_integrate_interface_model final : public model_base_crtp{static_cast(N)}); + rad = std::vector(N, std::numeric_limits::quiet_NaN()); + current_statement__ = 605; rad = context__.vals_r("rad"); @@ -13503,6 +13603,7 @@ class new_integrate_interface_model final : public model_base_crtp{static_cast(N)}); + vd = Eigen::Matrix(N); { std::vector vd_flat__; @@ -16939,6 +17040,7 @@ class old_integrate_interface_model final : public model_base_crtp{}); + N = std::numeric_limits::min(); current_statement__ = 18; N = context__.vals_i("N")[(1 - 1)]; @@ -16949,12 +17051,15 @@ class old_integrate_interface_model final : public model_base_crtp{static_cast(N)}); + ts = std::vector(N, std::numeric_limits::quiet_NaN()); current_statement__ = 20; ts = context__.vals_r("ts"); current_statement__ = 21; context__.validate_dims("data initialization","y_init","double", std::vector{static_cast(2)}); + y_init = std::vector(2, std::numeric_limits::quiet_NaN()); + current_statement__ = 21; y_init = context__.vals_r("y_init"); @@ -16964,6 +17069,8 @@ class old_integrate_interface_model final : public model_base_crtp{static_cast(N), static_cast(2)}); + y = std::vector>(N, std::vector(2, std::numeric_limits::quiet_NaN())); + { std::vector y_flat__; @@ -17799,6 +17906,7 @@ class optimize_glm_model final : public model_base_crtp { current_statement__ = 176; context__.validate_dims("data initialization","k","int", std::vector{}); + k = std::numeric_limits::min(); current_statement__ = 176; k = context__.vals_i("k")[(1 - 1)]; @@ -17807,6 +17915,7 @@ class optimize_glm_model final : public model_base_crtp { current_statement__ = 177; context__.validate_dims("data initialization","n","int", std::vector{}); + n = std::numeric_limits::min(); current_statement__ = 177; n = context__.vals_i("n")[(1 - 1)]; @@ -17820,6 +17929,7 @@ class optimize_glm_model final : public model_base_crtp { context__.validate_dims("data initialization","X_d","double", std::vector{static_cast(n), static_cast(k)}); + X_d = Eigen::Matrix(n, k); { std::vector X_d_flat__; @@ -17847,6 +17957,8 @@ class optimize_glm_model final : public model_base_crtp { context__.validate_dims("data initialization","X_d_a","double", std::vector{static_cast(2), static_cast(n), static_cast(k)}); + X_d_a = std::vector>(2, Eigen::Matrix(n, k)); + { std::vector X_d_a_flat__; @@ -17876,6 +17988,7 @@ class optimize_glm_model final : public model_base_crtp { current_statement__ = 185; context__.validate_dims("data initialization","y_v_d","double", std::vector{static_cast(n)}); + y_v_d = Eigen::Matrix(n); { std::vector y_v_d_flat__; @@ -17897,6 +18010,7 @@ class optimize_glm_model final : public model_base_crtp { current_statement__ = 187; context__.validate_dims("data initialization","X_rv_d","double", std::vector{static_cast(n)}); + X_rv_d = Eigen::Matrix(n); { std::vector X_rv_d_flat__; @@ -17918,6 +18032,7 @@ class optimize_glm_model final : public model_base_crtp { current_statement__ = 189; context__.validate_dims("data initialization","y_vi_d","int", std::vector{static_cast(n)}); + y_vi_d = std::vector(n, std::numeric_limits::min()); current_statement__ = 189; y_vi_d = context__.vals_i("y_vi_d"); @@ -17926,18 +18041,21 @@ class optimize_glm_model final : public model_base_crtp { current_statement__ = 191; context__.validate_dims("data initialization","y2_vi_d","int", std::vector{static_cast(n)}); + y2_vi_d = std::vector(n, std::numeric_limits::min()); current_statement__ = 191; y2_vi_d = context__.vals_i("y2_vi_d"); current_statement__ = 192; context__.validate_dims("data initialization","y_s_d","int", std::vector{}); + y_s_d = std::numeric_limits::min(); current_statement__ = 192; y_s_d = context__.vals_i("y_s_d")[(1 - 1)]; current_statement__ = 193; context__.validate_dims("data initialization","y_r_d","double", std::vector{}); + y_r_d = std::numeric_limits::quiet_NaN(); current_statement__ = 193; y_r_d = context__.vals_r("y_r_d")[(1 - 1)]; @@ -19236,12 +19354,14 @@ class param_constraint_model final : public model_base_crtp{}); + nt = std::numeric_limits::min(); current_statement__ = 3; nt = context__.vals_i("nt")[(1 - 1)]; current_statement__ = 4; context__.validate_dims("data initialization","NS","int", std::vector{}); + NS = std::numeric_limits::min(); current_statement__ = 4; NS = context__.vals_i("NS")[(1 - 1)]; @@ -25029,6 +25149,7 @@ class reduce_sum_m3_model final : public model_base_crtp { current_statement__ = 67; context__.validate_dims("data initialization","N","int", std::vector{}); + N = std::numeric_limits::min(); current_statement__ = 67; N = context__.vals_i("N")[(1 - 1)]; @@ -25037,6 +25158,8 @@ class reduce_sum_m3_model final : public model_base_crtp { current_statement__ = 69; context__.validate_dims("data initialization","y1d","double", std::vector{static_cast(N)}); + y1d = std::vector(N, std::numeric_limits::quiet_NaN()); + current_statement__ = 69; y1d = context__.vals_r("y1d"); @@ -25048,6 +25171,8 @@ class reduce_sum_m3_model final : public model_base_crtp { context__.validate_dims("data initialization","y2d","double", std::vector{static_cast(N), static_cast(N)}); + y2d = std::vector>(N, Eigen::Matrix(N)); + { std::vector y2d_flat__; @@ -25075,6 +25200,8 @@ class reduce_sum_m3_model final : public model_base_crtp { context__.validate_dims("data initialization","y3d","double", std::vector{static_cast(N), static_cast(N)}); + y3d = std::vector>(N, Eigen::Matrix(N)); + { std::vector y3d_flat__; @@ -25104,6 +25231,8 @@ class reduce_sum_m3_model final : public model_base_crtp { context__.validate_dims("data initialization","y4d","double", std::vector{static_cast(N), static_cast(N), static_cast(N)}); + y4d = std::vector>(N, Eigen::Matrix(N, N)); + { std::vector y4d_flat__; @@ -25136,6 +25265,8 @@ class reduce_sum_m3_model final : public model_base_crtp { context__.validate_dims("data initialization","y5d","double", std::vector{static_cast(N), static_cast(N)}); + y5d = std::vector>(N, std::vector(N, std::numeric_limits::quiet_NaN())); + { std::vector y5d_flat__; @@ -25165,6 +25296,8 @@ class reduce_sum_m3_model final : public model_base_crtp { context__.validate_dims("data initialization","y6d","double", std::vector{static_cast(N), static_cast(N), static_cast(N)}); + y6d = std::vector>>(N, std::vector>(N, Eigen::Matrix(N))); + { std::vector y6d_flat__; @@ -25199,6 +25332,8 @@ class reduce_sum_m3_model final : public model_base_crtp { context__.validate_dims("data initialization","y7d","double", std::vector{static_cast(N), static_cast(N), static_cast(N)}); + y7d = std::vector>>(N, std::vector>(N, Eigen::Matrix(N))); + { std::vector y7d_flat__; @@ -25236,6 +25371,8 @@ class reduce_sum_m3_model final : public model_base_crtp { std::vector{static_cast(N), static_cast(N), static_cast(N), static_cast(N)}); + y8d = std::vector>>(N, std::vector>(N, Eigen::Matrix(N, N))); + { std::vector y8d_flat__; @@ -25267,6 +25404,7 @@ class reduce_sum_m3_model final : public model_base_crtp { current_statement__ = 96; context__.validate_dims("data initialization","y9d","double", std::vector{}); + y9d = std::numeric_limits::quiet_NaN(); current_statement__ = 96; y9d = context__.vals_r("y9d")[(1 - 1)]; @@ -25275,6 +25413,7 @@ class reduce_sum_m3_model final : public model_base_crtp { current_statement__ = 98; context__.validate_dims("data initialization","y10d","double", std::vector{static_cast(N)}); + y10d = Eigen::Matrix(N); { std::vector y10d_flat__; @@ -25296,6 +25435,7 @@ class reduce_sum_m3_model final : public model_base_crtp { current_statement__ = 100; context__.validate_dims("data initialization","y11d","double", std::vector{static_cast(N)}); + y11d = Eigen::Matrix(N); { std::vector y11d_flat__; @@ -25320,6 +25460,7 @@ class reduce_sum_m3_model final : public model_base_crtp { context__.validate_dims("data initialization","y12d","double", std::vector{static_cast(N), static_cast(N)}); + y12d = Eigen::Matrix(N, N); { std::vector y12d_flat__; @@ -25342,6 +25483,7 @@ class reduce_sum_m3_model final : public model_base_crtp { current_statement__ = 104; context__.validate_dims("data initialization","y13d","int", std::vector{}); + y13d = std::numeric_limits::min(); current_statement__ = 104; y13d = context__.vals_i("y13d")[(1 - 1)]; @@ -25350,6 +25492,7 @@ class reduce_sum_m3_model final : public model_base_crtp { current_statement__ = 106; context__.validate_dims("data initialization","y14d","int", std::vector{static_cast(N)}); + y14d = std::vector(N, std::numeric_limits::min()); current_statement__ = 106; y14d = context__.vals_i("y14d"); @@ -25361,6 +25504,8 @@ class reduce_sum_m3_model final : public model_base_crtp { context__.validate_dims("data initialization","y15d","int", std::vector{static_cast(N), static_cast(N)}); + y15d = std::vector>(N, std::vector(N, std::numeric_limits::min())); + { std::vector y15d_flat__; @@ -25390,6 +25535,8 @@ class reduce_sum_m3_model final : public model_base_crtp { context__.validate_dims("data initialization","y16d","int", std::vector{static_cast(N), static_cast(N), static_cast(N)}); + y16d = std::vector>>(N, std::vector>(N, std::vector(N, std::numeric_limits::min()))); + { std::vector y16d_flat__; @@ -25424,6 +25571,8 @@ class reduce_sum_m3_model final : public model_base_crtp { context__.validate_dims("data initialization","y17d","double", std::vector{static_cast(N), static_cast(N), static_cast(N)}); + y17d = std::vector>>(N, std::vector>(N, std::vector(N, std::numeric_limits::quiet_NaN()))); + { std::vector y17d_flat__; @@ -27632,6 +27781,7 @@ class tilde_block_model final : public model_base_crtp { current_statement__ = 7; context__.validate_dims("data initialization","t","int", std::vector{}); + t = std::numeric_limits::min(); current_statement__ = 7; t = context__.vals_i("t")[(1 - 1)]; @@ -28104,6 +28254,7 @@ class transform_model final : public model_base_crtp { current_statement__ = 37; context__.validate_dims("data initialization","n","int", std::vector{}); + n = std::numeric_limits::min(); current_statement__ = 37; n = context__.vals_i("n")[(1 - 1)]; @@ -28112,6 +28263,7 @@ class transform_model final : public model_base_crtp { current_statement__ = 38; context__.validate_dims("data initialization","m","int", std::vector{}); + m = std::numeric_limits::min(); current_statement__ = 38; m = context__.vals_i("m")[(1 - 1)]; @@ -28120,6 +28272,7 @@ class transform_model final : public model_base_crtp { current_statement__ = 39; context__.validate_dims("data initialization","k","int", std::vector{}); + k = std::numeric_limits::min(); current_statement__ = 39; k = context__.vals_i("k")[(1 - 1)]; @@ -28135,6 +28288,8 @@ class transform_model final : public model_base_crtp { context__.validate_dims("data initialization","ds","double", std::vector{static_cast(n), static_cast(m), static_cast(k)}); + ds = std::vector>>(n, std::vector>(m, std::vector(k, std::numeric_limits::quiet_NaN()))); + { std::vector ds_flat__; @@ -28169,6 +28324,8 @@ class transform_model final : public model_base_crtp { context__.validate_dims("data initialization","dv","double", std::vector{static_cast(n), static_cast(m), static_cast(k)}); + dv = std::vector>>(n, std::vector>(m, Eigen::Matrix(k))); + { std::vector dv_flat__; @@ -28203,6 +28360,8 @@ class transform_model final : public model_base_crtp { context__.validate_dims("data initialization","dr","double", std::vector{static_cast(n), static_cast(m), static_cast(k)}); + dr = std::vector>>(n, std::vector>(m, Eigen::Matrix(k))); + { std::vector dr_flat__; @@ -28237,6 +28396,8 @@ class transform_model final : public model_base_crtp { context__.validate_dims("data initialization","dm","double", std::vector{static_cast(n), static_cast(m), static_cast(k)}); + dm = std::vector>(n, Eigen::Matrix(m, k)); + { std::vector dm_flat__; @@ -31310,12 +31471,14 @@ class truncate_model final : public model_base_crtp { current_statement__ = 19; context__.validate_dims("data initialization","n","int", std::vector{}); + n = std::numeric_limits::min(); current_statement__ = 19; n = context__.vals_i("n")[(1 - 1)]; current_statement__ = 20; context__.validate_dims("data initialization","x","double", std::vector{}); + x = std::numeric_limits::quiet_NaN(); current_statement__ = 20; x = context__.vals_r("x")[(1 - 1)]; diff --git a/test/integration/good/code-gen/expressions/cpp.expected b/test/integration/good/code-gen/expressions/cpp.expected index 5b6ac59d6c..a454611e49 100644 --- a/test/integration/good/code-gen/expressions/cpp.expected +++ b/test/integration/good/code-gen/expressions/cpp.expected @@ -186,6 +186,7 @@ class simple_function_model final : public model_base_crtp{}); + N = std::numeric_limits::min(); current_statement__ = 1; N = context__.vals_i("N")[(1 - 1)]; @@ -197,6 +198,7 @@ class simple_function_model final : public model_base_crtp{static_cast(N), static_cast(N)}); + m = Eigen::Matrix(N, N); { std::vector m_flat__; diff --git a/test/integration/good/code-gen/opencl/cpp.expected b/test/integration/good/code-gen/opencl/cpp.expected index 737b3a9d74..61fdff87b1 100644 --- a/test/integration/good/code-gen/opencl/cpp.expected +++ b/test/integration/good/code-gen/opencl/cpp.expected @@ -837,6 +837,7 @@ class distributions_model final : public model_base_crtp { current_statement__ = 756; context__.validate_dims("data initialization","d_int","int", std::vector{}); + d_int = std::numeric_limits::min(); current_statement__ = 756; d_int = context__.vals_i("d_int")[(1 - 1)]; @@ -845,12 +846,15 @@ class distributions_model final : public model_base_crtp { current_statement__ = 758; context__.validate_dims("data initialization","d_int_array","int", std::vector{static_cast(d_int)}); + d_int_array = std::vector(d_int, std::numeric_limits::min()); + current_statement__ = 758; d_int_array = context__.vals_i("d_int_array"); current_statement__ = 759; context__.validate_dims("data initialization","d_real","double", std::vector{}); + d_real = std::numeric_limits::quiet_NaN(); current_statement__ = 759; d_real = context__.vals_r("d_real")[(1 - 1)]; @@ -859,6 +863,8 @@ class distributions_model final : public model_base_crtp { current_statement__ = 761; context__.validate_dims("data initialization","d_real_array","double", std::vector{static_cast(d_int)}); + d_real_array = std::vector(d_int, std::numeric_limits::quiet_NaN()); + current_statement__ = 761; d_real_array = context__.vals_r("d_real_array"); @@ -867,6 +873,7 @@ class distributions_model final : public model_base_crtp { current_statement__ = 763; context__.validate_dims("data initialization","d_vector","double", std::vector{static_cast(d_int)}); + d_vector = Eigen::Matrix(d_int); { std::vector d_vector_flat__; @@ -888,6 +895,7 @@ class distributions_model final : public model_base_crtp { current_statement__ = 765; context__.validate_dims("data initialization","d_row_vector","double", std::vector{static_cast(d_int)}); + d_row_vector = Eigen::Matrix(d_int); { std::vector d_row_vector_flat__; @@ -6459,6 +6467,7 @@ class restricted_model final : public model_base_crtp { current_statement__ = 25; context__.validate_dims("data initialization","d_int","int", std::vector{}); + d_int = std::numeric_limits::min(); current_statement__ = 25; d_int = context__.vals_i("d_int")[(1 - 1)]; @@ -6467,12 +6476,15 @@ class restricted_model final : public model_base_crtp { current_statement__ = 27; context__.validate_dims("data initialization","d_int_array","int", std::vector{static_cast(d_int)}); + d_int_array = std::vector(d_int, std::numeric_limits::min()); + current_statement__ = 27; d_int_array = context__.vals_i("d_int_array"); current_statement__ = 28; context__.validate_dims("data initialization","d_real","double", std::vector{}); + d_real = std::numeric_limits::quiet_NaN(); current_statement__ = 28; d_real = context__.vals_r("d_real")[(1 - 1)]; @@ -6481,6 +6493,8 @@ class restricted_model final : public model_base_crtp { current_statement__ = 30; context__.validate_dims("data initialization","d_real_array","double", std::vector{static_cast(d_int)}); + d_real_array = std::vector(d_int, std::numeric_limits::quiet_NaN()); + current_statement__ = 30; d_real_array = context__.vals_r("d_real_array"); @@ -6489,6 +6503,7 @@ class restricted_model final : public model_base_crtp { current_statement__ = 32; context__.validate_dims("data initialization","d_vector","double", std::vector{static_cast(d_int)}); + d_vector = Eigen::Matrix(d_int); { std::vector d_vector_flat__; @@ -6510,6 +6525,7 @@ class restricted_model final : public model_base_crtp { current_statement__ = 34; context__.validate_dims("data initialization","d_row_vector","double", std::vector{static_cast(d_int)}); + d_row_vector = Eigen::Matrix(d_int); { std::vector d_row_vector_flat__; diff --git a/test/integration/good/code-gen/profiling/cpp.expected b/test/integration/good/code-gen/profiling/cpp.expected index 66dd0c92c5..d3b3f8e93b 100644 --- a/test/integration/good/code-gen/profiling/cpp.expected +++ b/test/integration/good/code-gen/profiling/cpp.expected @@ -89,6 +89,7 @@ class simple_function_model final : public model_base_crtp{}); + N = std::numeric_limits::min(); current_statement__ = 21; N = context__.vals_i("N")[(1 - 1)]; @@ -99,6 +100,7 @@ class simple_function_model final : public model_base_crtp{static_cast(N)}); + x = std::vector(N, std::numeric_limits::quiet_NaN()); current_statement__ = 23; x = context__.vals_r("x"); @@ -107,6 +109,7 @@ class simple_function_model final : public model_base_crtp{static_cast(N)}); + y = Eigen::Matrix(N); { std::vector y_flat__; diff --git a/test/integration/good/compiler-optimizations/cpp.expected b/test/integration/good/compiler-optimizations/cpp.expected index 137d562914..24da187836 100644 --- a/test/integration/good/compiler-optimizations/cpp.expected +++ b/test/integration/good/compiler-optimizations/cpp.expected @@ -169,6 +169,7 @@ class ad_level_failing_model final : public model_base_crtp{}); + N_t = std::numeric_limits::min(); current_statement__ = 16; N_t = context__.vals_i("N_t")[(1 - 1)]; @@ -179,12 +180,15 @@ class ad_level_failing_model final : public model_base_crtp{static_cast(N_t)}); + t = std::vector(N_t, std::numeric_limits::quiet_NaN()); + current_statement__ = 18; t = context__.vals_r("t"); current_statement__ = 19; context__.validate_dims("data initialization","y0","double", std::vector{static_cast(4)}); + y0 = std::vector(4, std::numeric_limits::quiet_NaN()); current_statement__ = 19; y0 = context__.vals_r("y0"); @@ -193,6 +197,7 @@ class ad_level_failing_model final : public model_base_crtp{static_cast(N_t)}); + stoi_hat = std::vector(N_t, std::numeric_limits::min()); current_statement__ = 21; stoi_hat = context__.vals_i("stoi_hat"); @@ -201,6 +206,8 @@ class ad_level_failing_model final : public model_base_crtp{static_cast(N_t)}); + B_hat = std::vector(N_t, std::numeric_limits::quiet_NaN()); + current_statement__ = 23; B_hat = context__.vals_r("B_hat"); @@ -1298,6 +1305,7 @@ class copy_fail_model final : public model_base_crtp { current_statement__ = 31; context__.validate_dims("data initialization","nind","int", std::vector{}); + nind = std::numeric_limits::min(); current_statement__ = 31; nind = context__.vals_i("nind")[(1 - 1)]; @@ -1306,6 +1314,7 @@ class copy_fail_model final : public model_base_crtp { current_statement__ = 32; context__.validate_dims("data initialization","n_occasions","int", std::vector{}); + n_occasions = std::numeric_limits::min(); current_statement__ = 32; n_occasions = context__.vals_i("n_occasions")[(1 - 1)]; @@ -1319,6 +1328,8 @@ class copy_fail_model final : public model_base_crtp { context__.validate_dims("data initialization","y","int", std::vector{static_cast(nind), static_cast(n_occasions)}); + y = std::vector>(nind, std::vector(n_occasions, std::numeric_limits::min())); + { std::vector y_flat__; @@ -1429,6 +1440,7 @@ class copy_fail_model final : public model_base_crtp { current_statement__ = 36; context__.validate_dims("data initialization","max_age","int", std::vector{}); + max_age = std::numeric_limits::min(); current_statement__ = 36; max_age = context__.vals_i("max_age")[(1 - 1)]; @@ -1442,6 +1454,8 @@ class copy_fail_model final : public model_base_crtp { context__.validate_dims("data initialization","x","int", std::vector{static_cast(nind), static_cast(lcm_sym159__)}); + x = std::vector>(nind, std::vector(lcm_sym159__, std::numeric_limits::min())); + { std::vector x_flat__; @@ -3301,6 +3315,7 @@ class dce_fail_model final : public model_base_crtp { current_statement__ = 39; context__.validate_dims("data initialization","N","int", std::vector{}); + N = std::numeric_limits::min(); current_statement__ = 39; N = context__.vals_i("N")[(1 - 1)]; @@ -3309,6 +3324,7 @@ class dce_fail_model final : public model_base_crtp { current_statement__ = 40; context__.validate_dims("data initialization","n_age","int", std::vector{}); + n_age = std::numeric_limits::min(); current_statement__ = 40; n_age = context__.vals_i("n_age")[(1 - 1)]; @@ -3317,6 +3333,7 @@ class dce_fail_model final : public model_base_crtp { current_statement__ = 41; context__.validate_dims("data initialization","n_edu","int", std::vector{}); + n_edu = std::numeric_limits::min(); current_statement__ = 41; n_edu = context__.vals_i("n_edu")[(1 - 1)]; @@ -3325,6 +3342,7 @@ class dce_fail_model final : public model_base_crtp { current_statement__ = 42; context__.validate_dims("data initialization","n_region","int", std::vector{}); + n_region = std::numeric_limits::min(); current_statement__ = 42; n_region = context__.vals_i("n_region")[(1 - 1)]; @@ -3333,6 +3351,7 @@ class dce_fail_model final : public model_base_crtp { current_statement__ = 43; context__.validate_dims("data initialization","n_state","int", std::vector{}); + n_state = std::numeric_limits::min(); current_statement__ = 43; n_state = context__.vals_i("n_state")[(1 - 1)]; @@ -3343,6 +3362,7 @@ class dce_fail_model final : public model_base_crtp { current_statement__ = 45; context__.validate_dims("data initialization","female","int", std::vector{static_cast(N)}); + female = std::vector(N, std::numeric_limits::min()); current_statement__ = 45; female = context__.vals_i("female"); @@ -3373,6 +3393,7 @@ class dce_fail_model final : public model_base_crtp { current_statement__ = 47; context__.validate_dims("data initialization","black","int", std::vector{static_cast(N)}); + black = std::vector(N, std::numeric_limits::min()); current_statement__ = 47; black = context__.vals_i("black"); @@ -3403,6 +3424,7 @@ class dce_fail_model final : public model_base_crtp { current_statement__ = 49; context__.validate_dims("data initialization","age","int", std::vector{static_cast(N)}); + age = std::vector(N, std::numeric_limits::min()); current_statement__ = 49; age = context__.vals_i("age"); @@ -3433,6 +3455,7 @@ class dce_fail_model final : public model_base_crtp { current_statement__ = 51; context__.validate_dims("data initialization","edu","int", std::vector{static_cast(N)}); + edu = std::vector(N, std::numeric_limits::min()); current_statement__ = 51; edu = context__.vals_i("edu"); @@ -3463,6 +3486,7 @@ class dce_fail_model final : public model_base_crtp { current_statement__ = 53; context__.validate_dims("data initialization","region","int", std::vector{static_cast(n_state)}); + region = std::vector(n_state, std::numeric_limits::min()); current_statement__ = 53; region = context__.vals_i("region"); @@ -3493,6 +3517,7 @@ class dce_fail_model final : public model_base_crtp { current_statement__ = 55; context__.validate_dims("data initialization","state","int", std::vector{static_cast(N)}); + state = std::vector(N, std::numeric_limits::min()); current_statement__ = 55; state = context__.vals_i("state"); @@ -3523,6 +3548,7 @@ class dce_fail_model final : public model_base_crtp { current_statement__ = 57; context__.validate_dims("data initialization","y","int", std::vector{static_cast(N)}); + y = std::vector(N, std::numeric_limits::min()); current_statement__ = 57; y = context__.vals_i("y"); @@ -3551,6 +3577,7 @@ class dce_fail_model final : public model_base_crtp { current_statement__ = 59; context__.validate_dims("data initialization","v_prev","double", std::vector{static_cast(n_state)}); + v_prev = Eigen::Matrix(n_state); { std::vector v_prev_flat__; @@ -4743,6 +4770,7 @@ class expr_prop_experiment_model final : public model_base_crtp{}); + j = std::numeric_limits::min(); current_statement__ = 1; j = context__.vals_i("j")[(1 - 1)]; @@ -5081,6 +5109,7 @@ class expr_prop_experiment2_model final : public model_base_crtp{}); + j = std::numeric_limits::min(); current_statement__ = 1; j = context__.vals_i("j")[(1 - 1)]; @@ -5427,6 +5456,7 @@ class expr_prop_fail_model final : public model_base_crtp current_statement__ = 9; context__.validate_dims("data initialization","N","int", std::vector{}); + N = std::numeric_limits::min(); current_statement__ = 9; N = context__.vals_i("N")[(1 - 1)]; @@ -5437,6 +5467,7 @@ class expr_prop_fail_model final : public model_base_crtp current_statement__ = 11; context__.validate_dims("data initialization","y","double", std::vector{static_cast(N)}); + y = Eigen::Matrix(N); { std::vector y_flat__; @@ -5984,6 +6015,7 @@ class expr_prop_fail2_model final : public model_base_crtp{}); + J = std::numeric_limits::min(); current_statement__ = 6; J = context__.vals_i("J")[(1 - 1)]; @@ -5994,6 +6026,7 @@ class expr_prop_fail2_model final : public model_base_crtp{static_cast(J)}); + y = std::vector(J, std::numeric_limits::quiet_NaN()); current_statement__ = 8; y = context__.vals_r("y"); @@ -6002,6 +6035,8 @@ class expr_prop_fail2_model final : public model_base_crtp{static_cast(J)}); + sigma = std::vector(J, std::numeric_limits::quiet_NaN()); + current_statement__ = 10; sigma = context__.vals_r("sigma"); @@ -6529,6 +6564,7 @@ class expr_prop_fail3_model final : public model_base_crtp{}); + N = std::numeric_limits::min(); current_statement__ = 22; N = context__.vals_i("N")[(1 - 1)]; @@ -6537,6 +6573,7 @@ class expr_prop_fail3_model final : public model_base_crtp{}); + n_age = std::numeric_limits::min(); current_statement__ = 23; n_age = context__.vals_i("n_age")[(1 - 1)]; @@ -6545,6 +6582,7 @@ class expr_prop_fail3_model final : public model_base_crtp{}); + n_age_edu = std::numeric_limits::min(); current_statement__ = 24; n_age_edu = context__.vals_i("n_age_edu")[(1 - 1)]; @@ -6553,6 +6591,7 @@ class expr_prop_fail3_model final : public model_base_crtp{}); + n_edu = std::numeric_limits::min(); current_statement__ = 25; n_edu = context__.vals_i("n_edu")[(1 - 1)]; @@ -6561,6 +6600,7 @@ class expr_prop_fail3_model final : public model_base_crtp{}); + n_region_full = std::numeric_limits::min(); current_statement__ = 26; n_region_full = context__.vals_i("n_region_full")[(1 - 1)]; @@ -6569,6 +6609,7 @@ class expr_prop_fail3_model final : public model_base_crtp{}); + n_state = std::numeric_limits::min(); current_statement__ = 27; n_state = context__.vals_i("n_state")[(1 - 1)]; @@ -6579,6 +6620,7 @@ class expr_prop_fail3_model final : public model_base_crtp{static_cast(N)}); + age = std::vector(N, std::numeric_limits::min()); current_statement__ = 29; age = context__.vals_i("age"); @@ -6609,6 +6651,7 @@ class expr_prop_fail3_model final : public model_base_crtp{static_cast(N)}); + age_edu = std::vector(N, std::numeric_limits::min()); current_statement__ = 31; age_edu = context__.vals_i("age_edu"); @@ -6640,6 +6683,7 @@ class expr_prop_fail3_model final : public model_base_crtp{static_cast(N)}); + black = Eigen::Matrix(N); { std::vector black_flat__; @@ -6690,6 +6734,7 @@ class expr_prop_fail3_model final : public model_base_crtp{static_cast(N)}); + edu = std::vector(N, std::numeric_limits::min()); current_statement__ = 35; edu = context__.vals_i("edu"); @@ -6720,6 +6765,7 @@ class expr_prop_fail3_model final : public model_base_crtp{static_cast(N)}); + female = Eigen::Matrix(N); { std::vector female_flat__; @@ -6771,6 +6817,7 @@ class expr_prop_fail3_model final : public model_base_crtp{static_cast(N)}); + region_full = std::vector(N, std::numeric_limits::min()); current_statement__ = 39; region_full = context__.vals_i("region_full"); @@ -6803,6 +6850,7 @@ class expr_prop_fail3_model final : public model_base_crtp{static_cast(N)}); + state = std::vector(N, std::numeric_limits::min()); current_statement__ = 41; state = context__.vals_i("state"); @@ -6833,6 +6881,7 @@ class expr_prop_fail3_model final : public model_base_crtp{static_cast(N)}); + v_prev_full = Eigen::Matrix(N); { std::vector v_prev_full_flat__; @@ -6862,6 +6911,7 @@ class expr_prop_fail3_model final : public model_base_crtp{static_cast(N)}); + y = std::vector(N, std::numeric_limits::min()); current_statement__ = 45; y = context__.vals_i("y"); @@ -8019,6 +8069,7 @@ class expr_prop_fail4_model final : public model_base_crtp{}); + N = std::numeric_limits::min(); current_statement__ = 28; N = context__.vals_i("N")[(1 - 1)]; @@ -8027,6 +8078,7 @@ class expr_prop_fail4_model final : public model_base_crtp{}); + N_edges = std::numeric_limits::min(); current_statement__ = 29; N_edges = context__.vals_i("N_edges")[(1 - 1)]; @@ -8037,6 +8089,7 @@ class expr_prop_fail4_model final : public model_base_crtp{static_cast(N_edges)}); + node1 = std::vector(N_edges, std::numeric_limits::min()); current_statement__ = 31; node1 = context__.vals_i("node1"); @@ -8067,6 +8120,7 @@ class expr_prop_fail4_model final : public model_base_crtp{static_cast(N_edges)}); + node2 = std::vector(N_edges, std::numeric_limits::min()); current_statement__ = 33; node2 = context__.vals_i("node2"); @@ -8097,6 +8151,7 @@ class expr_prop_fail4_model final : public model_base_crtp{static_cast(N)}); + E = Eigen::Matrix(N); { std::vector E_flat__; @@ -9195,6 +9250,7 @@ class expr_prop_fail5_model final : public model_base_crtp{}); + nind = std::numeric_limits::min(); current_statement__ = 37; nind = context__.vals_i("nind")[(1 - 1)]; @@ -9203,6 +9259,7 @@ class expr_prop_fail5_model final : public model_base_crtp{}); + n_occasions = std::numeric_limits::min(); current_statement__ = 38; n_occasions = context__.vals_i("n_occasions")[(1 - 1)]; @@ -9216,6 +9273,8 @@ class expr_prop_fail5_model final : public model_base_crtp{static_cast(nind), static_cast(n_occasions)}); + y = std::vector>(nind, std::vector(n_occasions, std::numeric_limits::min())); + { std::vector y_flat__; @@ -11950,6 +12009,7 @@ class expr_prop_fail6_model final : public model_base_crtp{}); + M = std::numeric_limits::min(); current_statement__ = 106; M = context__.vals_i("M")[(1 - 1)]; @@ -11958,6 +12018,7 @@ class expr_prop_fail6_model final : public model_base_crtp{}); + n_occasions = std::numeric_limits::min(); current_statement__ = 107; n_occasions = context__.vals_i("n_occasions")[(1 - 1)]; @@ -11971,6 +12032,8 @@ class expr_prop_fail6_model final : public model_base_crtp{static_cast(M), static_cast(n_occasions)}); + y = std::vector>(M, std::vector(n_occasions, std::numeric_limits::min())); + { std::vector y_flat__; @@ -14855,6 +14918,7 @@ class expr_prop_fail7_model final : public model_base_crtp{}); + K = std::numeric_limits::min(); current_statement__ = 20; K = context__.vals_i("K")[(1 - 1)]; @@ -14863,6 +14927,7 @@ class expr_prop_fail7_model final : public model_base_crtp{}); + I = std::numeric_limits::min(); current_statement__ = 21; I = context__.vals_i("I")[(1 - 1)]; @@ -14871,6 +14936,7 @@ class expr_prop_fail7_model final : public model_base_crtp{}); + J = std::numeric_limits::min(); current_statement__ = 22; J = context__.vals_i("J")[(1 - 1)]; @@ -14884,6 +14950,8 @@ class expr_prop_fail7_model final : public model_base_crtp{static_cast(I), static_cast(J)}); + y = std::vector>(I, std::vector(J, std::numeric_limits::min())); + { std::vector y_flat__; @@ -14996,6 +15064,7 @@ class expr_prop_fail7_model final : public model_base_crtp{static_cast(K)}); + alpha = Eigen::Matrix(K); { std::vector alpha_flat__; @@ -15038,6 +15107,8 @@ class expr_prop_fail7_model final : public model_base_crtp{static_cast(K), static_cast(K)}); + beta = std::vector>(K, Eigen::Matrix(K)); + { std::vector beta_flat__; @@ -16133,6 +16204,7 @@ class expr_prop_fail8_model final : public model_base_crtp{}); + N = std::numeric_limits::min(); current_statement__ = 12; N = context__.vals_i("N")[(1 - 1)]; @@ -16141,6 +16213,7 @@ class expr_prop_fail8_model final : public model_base_crtp{}); + N_edges = std::numeric_limits::min(); current_statement__ = 13; N_edges = context__.vals_i("N_edges")[(1 - 1)]; @@ -16151,6 +16224,7 @@ class expr_prop_fail8_model final : public model_base_crtp{static_cast(N_edges)}); + node1 = std::vector(N_edges, std::numeric_limits::min()); current_statement__ = 15; node1 = context__.vals_i("node1"); @@ -16181,6 +16255,7 @@ class expr_prop_fail8_model final : public model_base_crtp{static_cast(N_edges)}); + node2 = std::vector(N_edges, std::numeric_limits::min()); current_statement__ = 17; node2 = context__.vals_i("node2"); @@ -16211,6 +16286,7 @@ class expr_prop_fail8_model final : public model_base_crtp{static_cast(N)}); + y = std::vector(N, std::numeric_limits::min()); current_statement__ = 19; y = context__.vals_i("y"); @@ -16229,6 +16305,7 @@ class expr_prop_fail8_model final : public model_base_crtp{static_cast(N)}); + x = Eigen::Matrix(N); { std::vector x_flat__; @@ -17249,6 +17326,7 @@ class fails_test_model final : public model_base_crtp { current_statement__ = 31; context__.validate_dims("data initialization","nind","int", std::vector{}); + nind = std::numeric_limits::min(); current_statement__ = 31; nind = context__.vals_i("nind")[(1 - 1)]; @@ -17257,6 +17335,7 @@ class fails_test_model final : public model_base_crtp { current_statement__ = 32; context__.validate_dims("data initialization","n_occasions","int", std::vector{}); + n_occasions = std::numeric_limits::min(); current_statement__ = 32; n_occasions = context__.vals_i("n_occasions")[(1 - 1)]; @@ -17270,6 +17349,8 @@ class fails_test_model final : public model_base_crtp { context__.validate_dims("data initialization","y","int", std::vector{static_cast(nind), static_cast(n_occasions)}); + y = std::vector>(nind, std::vector(n_occasions, std::numeric_limits::min())); + { std::vector y_flat__; @@ -17380,6 +17461,7 @@ class fails_test_model final : public model_base_crtp { current_statement__ = 36; context__.validate_dims("data initialization","max_age","int", std::vector{}); + max_age = std::numeric_limits::min(); current_statement__ = 36; max_age = context__.vals_i("max_age")[(1 - 1)]; @@ -17393,6 +17475,8 @@ class fails_test_model final : public model_base_crtp { context__.validate_dims("data initialization","x","int", std::vector{static_cast(nind), static_cast(lcm_sym159__)}); + x = std::vector>(nind, std::vector(lcm_sym159__, std::numeric_limits::min())); + { std::vector x_flat__; @@ -20139,6 +20223,7 @@ class inlining_fail2_model final : public model_base_crtp current_statement__ = 103; context__.validate_dims("data initialization","M","int", std::vector{}); + M = std::numeric_limits::min(); current_statement__ = 103; M = context__.vals_i("M")[(1 - 1)]; @@ -20147,6 +20232,7 @@ class inlining_fail2_model final : public model_base_crtp current_statement__ = 104; context__.validate_dims("data initialization","n_occasions","int", std::vector{}); + n_occasions = std::numeric_limits::min(); current_statement__ = 104; n_occasions = context__.vals_i("n_occasions")[(1 - 1)]; @@ -20160,6 +20246,8 @@ class inlining_fail2_model final : public model_base_crtp context__.validate_dims("data initialization","y","int", std::vector{static_cast(M), static_cast(n_occasions)}); + y = std::vector>(M, std::vector(n_occasions, std::numeric_limits::min())); + { std::vector y_flat__; @@ -22823,6 +22911,7 @@ class lcm_experiment_model final : public model_base_crtp current_statement__ = 1; context__.validate_dims("data initialization","j","int", std::vector{}); + j = std::numeric_limits::min(); current_statement__ = 1; j = context__.vals_i("j")[(1 - 1)]; @@ -23493,6 +23582,7 @@ class lcm_fails_model final : public model_base_crtp { current_statement__ = 3; context__.validate_dims("data initialization","J","int", std::vector{}); + J = std::numeric_limits::min(); current_statement__ = 3; J = context__.vals_i("J")[(1 - 1)]; @@ -23503,6 +23593,7 @@ class lcm_fails_model final : public model_base_crtp { current_statement__ = 5; context__.validate_dims("data initialization","y","double", std::vector{static_cast(J)}); + y = std::vector(J, std::numeric_limits::quiet_NaN()); current_statement__ = 5; y = context__.vals_r("y"); @@ -24230,6 +24321,7 @@ class lcm_fails2_model final : public model_base_crtp { current_statement__ = 31; context__.validate_dims("data initialization","nind","int", std::vector{}); + nind = std::numeric_limits::min(); current_statement__ = 31; nind = context__.vals_i("nind")[(1 - 1)]; @@ -24238,6 +24330,7 @@ class lcm_fails2_model final : public model_base_crtp { current_statement__ = 32; context__.validate_dims("data initialization","n_occasions","int", std::vector{}); + n_occasions = std::numeric_limits::min(); current_statement__ = 32; n_occasions = context__.vals_i("n_occasions")[(1 - 1)]; @@ -24251,6 +24344,8 @@ class lcm_fails2_model final : public model_base_crtp { context__.validate_dims("data initialization","y","int", std::vector{static_cast(nind), static_cast(n_occasions)}); + y = std::vector>(nind, std::vector(n_occasions, std::numeric_limits::min())); + { std::vector y_flat__; @@ -26010,6 +26105,7 @@ class lupdf_inlining_model final : public model_base_crtp current_statement__ = 9; context__.validate_dims("data initialization","n","int", std::vector{}); + n = std::numeric_limits::min(); current_statement__ = 9; n = context__.vals_i("n")[(1 - 1)]; @@ -26529,6 +26625,7 @@ class off_dce_model final : public model_base_crtp { current_statement__ = 31; context__.validate_dims("data initialization","R","int", std::vector{}); + R = std::numeric_limits::min(); current_statement__ = 31; R = context__.vals_i("R")[(1 - 1)]; @@ -26537,6 +26634,7 @@ class off_dce_model final : public model_base_crtp { current_statement__ = 32; context__.validate_dims("data initialization","T","int", std::vector{}); + T = std::numeric_limits::min(); current_statement__ = 32; T = context__.vals_i("T")[(1 - 1)]; @@ -26550,6 +26648,8 @@ class off_dce_model final : public model_base_crtp { context__.validate_dims("data initialization","y","int", std::vector{static_cast(R), static_cast(T)}); + y = std::vector>(R, std::vector(T, std::numeric_limits::min())); + { std::vector y_flat__; @@ -26662,6 +26762,7 @@ class off_dce_model final : public model_base_crtp { current_statement__ = 37; context__.validate_dims("data initialization","X","double", std::vector{static_cast(R)}); + X = Eigen::Matrix(R); { std::vector X_flat__; @@ -27493,6 +27594,7 @@ class off_small_model final : public model_base_crtp { current_statement__ = 20; context__.validate_dims("data initialization","J","int", std::vector{}); + J = std::numeric_limits::min(); current_statement__ = 20; J = context__.vals_i("J")[(1 - 1)]; @@ -27501,6 +27603,7 @@ class off_small_model final : public model_base_crtp { current_statement__ = 21; context__.validate_dims("data initialization","N","int", std::vector{}); + N = std::numeric_limits::min(); current_statement__ = 21; N = context__.vals_i("N")[(1 - 1)]; @@ -27511,6 +27614,7 @@ class off_small_model final : public model_base_crtp { current_statement__ = 23; context__.validate_dims("data initialization","person","int", std::vector{static_cast(N)}); + person = std::vector(N, std::numeric_limits::min()); current_statement__ = 23; person = context__.vals_i("person"); @@ -27541,6 +27645,7 @@ class off_small_model final : public model_base_crtp { current_statement__ = 25; context__.validate_dims("data initialization","time","double", std::vector{static_cast(N)}); + time = Eigen::Matrix(N); { std::vector time_flat__; @@ -27569,6 +27674,7 @@ class off_small_model final : public model_base_crtp { current_statement__ = 27; context__.validate_dims("data initialization","treatment","double", std::vector{static_cast(N)}); + treatment = Eigen::Matrix(N); { std::vector treatment_flat__; @@ -27598,6 +27704,7 @@ class off_small_model final : public model_base_crtp { current_statement__ = 29; context__.validate_dims("data initialization","y","double", std::vector{static_cast(N)}); + y = Eigen::Matrix(N); { std::vector y_flat__; @@ -29859,6 +29966,7 @@ class partial_eval_model final : public model_base_crtp { current_statement__ = 13; context__.validate_dims("data initialization","N","int", std::vector{}); + N = std::numeric_limits::min(); current_statement__ = 13; N = context__.vals_i("N")[(1 - 1)]; @@ -29867,6 +29975,7 @@ class partial_eval_model final : public model_base_crtp { current_statement__ = 14; context__.validate_dims("data initialization","n_pair","int", std::vector{}); + n_pair = std::numeric_limits::min(); current_statement__ = 14; n_pair = context__.vals_i("n_pair")[(1 - 1)]; @@ -29877,6 +29986,7 @@ class partial_eval_model final : public model_base_crtp { current_statement__ = 16; context__.validate_dims("data initialization","pair","int", std::vector{static_cast(N)}); + pair = std::vector(N, std::numeric_limits::min()); current_statement__ = 16; pair = context__.vals_i("pair"); @@ -29907,6 +30017,7 @@ class partial_eval_model final : public model_base_crtp { current_statement__ = 18; context__.validate_dims("data initialization","pre_test","double", std::vector{static_cast(N)}); + pre_test = Eigen::Matrix(N); { std::vector pre_test_flat__; @@ -29936,6 +30047,7 @@ class partial_eval_model final : public model_base_crtp { current_statement__ = 20; context__.validate_dims("data initialization","treatment","double", std::vector{static_cast(N)}); + treatment = Eigen::Matrix(N); { std::vector treatment_flat__; @@ -29988,6 +30100,7 @@ class partial_eval_model final : public model_base_crtp { current_statement__ = 22; context__.validate_dims("data initialization","y","double", std::vector{static_cast(N)}); + y = Eigen::Matrix(N); { std::vector y_flat__; @@ -30672,6 +30785,7 @@ class stalled1_failure_model final : public model_base_crtp{}); + I = std::numeric_limits::min(); current_statement__ = 17; I = context__.vals_i("I")[(1 - 1)]; @@ -30682,6 +30796,7 @@ class stalled1_failure_model final : public model_base_crtp{static_cast(I)}); + n = std::vector(I, std::numeric_limits::min()); current_statement__ = 19; n = context__.vals_i("n"); @@ -30700,6 +30815,7 @@ class stalled1_failure_model final : public model_base_crtp{static_cast(I)}); + N = std::vector(I, std::numeric_limits::min()); current_statement__ = 21; N = context__.vals_i("N"); @@ -30718,6 +30834,7 @@ class stalled1_failure_model final : public model_base_crtp{static_cast(I)}); + x1 = Eigen::Matrix(I); { std::vector x1_flat__; @@ -30746,6 +30863,7 @@ class stalled1_failure_model final : public model_base_crtp{static_cast(I)}); + x2 = Eigen::Matrix(I); { std::vector x2_flat__; From 64c65ef31c715172a66281ed221941c3f06348e4 Mon Sep 17 00:00:00 2001 From: Steve Bronder Date: Mon, 5 Apr 2021 18:46:31 -0400 Subject: [PATCH 6/7] remove \n from cpp json print --- src/stan_math_backend/Cpp_Json.ml | 1 + 1 file changed, 1 insertion(+) diff --git a/src/stan_math_backend/Cpp_Json.ml b/src/stan_math_backend/Cpp_Json.ml index 784094af0d..e461f0d8e2 100644 --- a/src/stan_math_backend/Cpp_Json.ml +++ b/src/stan_math_backend/Cpp_Json.ml @@ -56,6 +56,7 @@ let replace_cpp_expr s = |> Str.global_replace (Str.regexp {|"|}) {|\"|} |> Str.global_replace (Str.regexp {|\\"\+|}) {|" +|} |> Str.global_replace (Str.regexp {|\+\\"|}) {|+ "|} + |> Str.global_replace (Str.regexp {|\\n|}) {||} let wrap_in_quotes s = "\"" ^ s ^ "\"" From f21d61fb6eb26007029e5ba81cd02e4ecca60e6e Mon Sep 17 00:00:00 2001 From: Steve Bronder Date: Wed, 7 Apr 2021 11:34:04 -0400 Subject: [PATCH 7/7] fix typo --- src/stan_math_backend/Cpp_Json.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/stan_math_backend/Cpp_Json.ml b/src/stan_math_backend/Cpp_Json.ml index e461f0d8e2..26f48a3613 100644 --- a/src/stan_math_backend/Cpp_Json.ml +++ b/src/stan_math_backend/Cpp_Json.ml @@ -50,7 +50,7 @@ let%expect_test "outvar to json pretty" = } |}] (*Adds a backslash to all the inner quotes and then - unblash the ones near a plus*) + unslash the ones near a plus*) let replace_cpp_expr s = s |> Str.global_replace (Str.regexp {|"|}) {|\"|}