diff --git a/src/analysis_and_optimization/Mir_utils.ml b/src/analysis_and_optimization/Mir_utils.ml index c1b0c36873..b83cec086b 100644 --- a/src/analysis_and_optimization/Mir_utils.ml +++ b/src/analysis_and_optimization/Mir_utils.ml @@ -27,6 +27,8 @@ let fold_stmts ~take_expr ~take_stmt ~(init : 'c) (stmts : Stmt.Located.t List.t let rec num_expr_value (v : Expr.Typed.t) : (float * string) option = match v with + (* internal type promotions should be ignored *) + | {pattern= Fixed.Pattern.Promotion (e, _, _); _} -> num_expr_value e | {pattern= Fixed.Pattern.Lit (Real, str); _} |{pattern= Fixed.Pattern.Lit (Int, str); _} -> Some (float_of_string str, str) diff --git a/src/analysis_and_optimization/Monotone_framework.ml b/src/analysis_and_optimization/Monotone_framework.ml index 0d6c93e595..f0e03238ed 100644 --- a/src/analysis_and_optimization/Monotone_framework.ml +++ b/src/analysis_and_optimization/Monotone_framework.ml @@ -326,7 +326,9 @@ let constant_propagation_transfer ?(preserve_stability = false) We could do the same for matrix and array expressions if we wanted. *) | Assignment ((s, t, []), e) -> ( match Partial_evaluator.try_eval_expr (subst_expr m e) with - | {pattern= Lit (_, _); _} as e' + | { pattern= + Promotion ({pattern= Lit (_, _); _}, _, _) | Lit (_, _) + ; _ } as e' when not (preserve_stability && UnsizedType.is_autodiffable t) -> Map.set m ~key:s ~data:e' diff --git a/src/analysis_and_optimization/Partial_evaluator.ml b/src/analysis_and_optimization/Partial_evaluator.ml index 6ec4ad19e6..7633b968cf 100644 --- a/src/analysis_and_optimization/Partial_evaluator.ml +++ b/src/analysis_and_optimization/Partial_evaluator.ml @@ -93,7 +93,8 @@ let rec eval_expr ?(preserve_stability = false) (e : Expr.Typed.t) = pattern= ( match e.pattern with | Var _ | Lit (_, _) -> e.pattern - | Promotion (expr, ut, ad) -> Promotion (eval_expr expr, ut, ad) + | Promotion (expr, ut, ad) -> + Promotion (eval_expr ~preserve_stability expr, ut, ad) | FunApp (kind, l) -> ( let l = List.map ~f:(eval_expr ~preserve_stability) l in match kind with diff --git a/src/frontend/Debug_data_generation.ml b/src/frontend/Debug_data_generation.ml index ded4fae456..e64c9e3282 100644 --- a/src/frontend/Debug_data_generation.ml +++ b/src/frontend/Debug_data_generation.ml @@ -34,6 +34,10 @@ let unwrap_num_exn m e = let m = Map.Poly.map m ~f:Ast_to_Mir.trans_expr in let e = Analysis_and_optimization.Mir_utils.subst_expr m e in let e = Analysis_and_optimization.Partial_evaluator.eval_expr e in + let rec strip_promotions (e : Middle.Expr.Typed.t) = + match e.pattern with Promotion (e, _, _) -> strip_promotions e | _ -> e + in + let e = strip_promotions e in match e.pattern with | Lit (_, s) -> Float.of_string s | _ -> diff --git a/src/frontend/Promotion.ml b/src/frontend/Promotion.ml new file mode 100644 index 0000000000..3f427ce3a6 --- /dev/null +++ b/src/frontend/Promotion.ml @@ -0,0 +1,96 @@ +open Core_kernel +open Core_kernel.Poly +module UnsizedType = Middle.UnsizedType + +(** Type to represent promotions in the typechecker. + This can be used to return information about how to promote + expressions for use in [Ast.Promotion] *) +type t = + | NoPromotion + | IntToReal + | ToVar (* used in arrays, not functions *) + | ToComplexVar (* used in arrays, not functions *) + | IntToComplex + | RealToComplex + +let promote_inner (exp : Ast.typed_expression) prom = + let emeta = exp.emeta in + match prom with + | ToVar -> + Ast. + { expr= Ast.Promotion (exp, UReal, AutoDiffable) + ; emeta= + { emeta with + type_= UnsizedType.promote_array emeta.type_ UReal + ; ad_level= AutoDiffable } } + | ToComplexVar -> + Ast. + { expr= Ast.Promotion (exp, UComplex, AutoDiffable) + ; emeta= + { emeta with + type_= UnsizedType.promote_array emeta.type_ UComplex + ; ad_level= AutoDiffable } } + | IntToReal when UnsizedType.is_int_type emeta.type_ -> + Ast. + { expr= Ast.Promotion (exp, UReal, emeta.ad_level) + ; emeta= {emeta with type_= UnsizedType.promote_array emeta.type_ UReal} + } + | (IntToComplex | RealToComplex) + when not (UnsizedType.is_complex_type emeta.type_) -> + (* these two promotions are separated for cost, but are actually the same promotion *) + { expr= Promotion (exp, UComplex, emeta.ad_level) + ; emeta= {emeta with type_= UnsizedType.promote_array emeta.type_ UComplex} + } + | _ -> exp + +let rec promote (exp : Ast.typed_expression) prom = + (* promote arrays and rowvector literals at the lowest level to avoid unnecessary copies *) + let open Ast in + match exp.expr with + | ArrayExpr es -> + let pes = List.map ~f:(fun e -> promote e prom) es in + let fst = List.hd_exn pes in + let type_, ad_level = (fst.emeta.type_, fst.emeta.ad_level) in + { expr= ArrayExpr pes + ; emeta= + { exp.emeta with + type_= UnsizedType.promote_array exp.emeta.type_ type_ + ; ad_level } } + | RowVectorExpr (_ :: _ as es) -> + let pes = List.map ~f:(fun e -> promote e prom) es in + let fst = List.hd_exn pes in + let ad_level = fst.emeta.ad_level in + {expr= RowVectorExpr pes; emeta= {exp.emeta with ad_level}} + | _ -> promote_inner exp prom + +let promote_list es promotions = List.map2_exn es promotions ~f:promote + +(** Get the promotion needed to make the second type into the first. + Types NEED to have previously been checked to be promotable +*) +let rec get_type_promotion_exn (ad, ty) (ad2, ty2) = + match (ty, ty2) with + | UnsizedType.(UReal, (UReal | UInt) | UVector, UVector | UMatrix, UMatrix) + when ad <> ad2 -> + ToVar + | UComplex, (UReal | UInt | UComplex) when ad <> ad2 -> ToComplexVar + | UReal, UInt -> IntToReal + | UComplex, UInt -> IntToComplex + | UComplex, UReal -> RealToComplex + | UArray nt1, UArray nt2 -> get_type_promotion_exn (ad, nt1) (ad2, nt2) + | t1, t2 when t1 = t2 -> NoPromotion + | _, _ -> + Common.FatalError.fatal_error_msg + [%message + "Tried to get promotion of mismatched types!" + (ty : UnsizedType.t) + (ty2 : UnsizedType.t)] + +(** Calculate the "cost"/number of promotions performed. + Used to disambiguate function signatures +*) +let promotion_cost p = + match p with + | NoPromotion | ToVar | ToComplexVar -> 0 + | RealToComplex | IntToReal -> 1 + | IntToComplex -> 2 diff --git a/src/frontend/SignatureMismatch.ml b/src/frontend/SignatureMismatch.ml index 5dff83c061..4fc86b2a79 100644 --- a/src/frontend/SignatureMismatch.ml +++ b/src/frontend/SignatureMismatch.ml @@ -79,12 +79,6 @@ type signature_error = (UnsizedType.returntype * (UnsizedType.autodifftype * UnsizedType.t) list) * function_mismatch -type promotions = - | None - | IntToRealPromotion - | IntToComplexPromotion - | RealToComplexPromotion - type ('unique, 'error) generic_match_result = | UniqueMatch of 'unique | AmbiguousMatch of @@ -95,7 +89,7 @@ type ('unique, 'error) generic_match_result = type match_result = ( UnsizedType.returntype * (bool Middle.Fun_kind.suffix -> Ast.fun_kind) - * promotions list + * Promotion.t list , signature_error list * bool ) generic_match_result @@ -133,10 +127,10 @@ let rec compare_errors e1 e2 = let rec check_same_type depth t1 t2 = let wrap_func = Result.map_error ~f:(fun e -> TypeMismatch (t1, t2, Some e)) in match (t1, t2) with - | t1, t2 when t1 = t2 -> Ok None - | UnsizedType.(UReal, UInt) when depth < 1 -> Ok IntToRealPromotion - | UnsizedType.(UComplex, UInt) when depth < 1 -> Ok IntToComplexPromotion - | UnsizedType.(UComplex, UReal) when depth < 1 -> Ok RealToComplexPromotion + | t1, t2 when t1 = t2 -> Ok Promotion.NoPromotion + | UnsizedType.(UReal, UInt) when depth < 1 -> Ok IntToReal + | UnsizedType.(UComplex, UInt) when depth < 1 -> Ok IntToComplex + | UnsizedType.(UComplex, UReal) when depth < 1 -> Ok RealToComplex (* Arrays: Try to recursively promote, but make sure the error is for these types, not the recursive call *) | UArray nt1, UArray nt2 -> @@ -153,12 +147,12 @@ let rec check_same_type depth t1 t2 = Error (ReturnTypeMismatch (rt1, rt2)) |> wrap_func | UFun (l1, _, _, _), UFun (l2, _, _, _) -> ( match check_compatible_arguments (depth + 1) l2 l1 with - | Ok _ -> Ok None + | Ok _ -> Ok NoPromotion | Error e -> Error (InputMismatch e) |> wrap_func ) | t1, t2 -> Error (TypeMismatch (t1, t2, None)) and check_compatible_arguments depth typs args2 : - (promotions list, function_mismatch) result = + (Promotion.t list, function_mismatch) result = match List.zip typs args2 with | List.Or_unequal_lengths.Unequal_lengths -> Error (ArgNumMismatch (List.length typs, List.length args2)) @@ -173,6 +167,7 @@ and check_compatible_arguments depth typs args2 : else Error (ArgError (i + 1, DataOnlyError)) ) |> Result.all +let check_of_same_type_mod_conv = check_same_type 0 let check_compatible_arguments_mod_conv = check_compatible_arguments 0 let max_n_errors = 5 @@ -184,30 +179,9 @@ let extract_function_types f = Some (return, args, (fun x -> UserDefined x), mem) | _ -> None -let promote es promotions = - List.map2_exn es promotions ~f:(fun (exp : Ast.typed_expression) prom -> - let open UnsizedType in - let emeta = exp.emeta in - match prom with - | IntToRealPromotion when is_int_type emeta.type_ -> - Ast. - { expr= Ast.Promotion (exp, UReal, emeta.ad_level) - ; emeta= {emeta with type_= promote_array emeta.type_ UReal} } - | (IntToComplexPromotion | RealToComplexPromotion) - when not (is_complex_type emeta.type_) -> - { expr= Promotion (exp, UComplex, emeta.ad_level) - ; emeta= {emeta with type_= promote_array emeta.type_ UComplex} } - | _ -> exp ) - -let promotion_cost p = - match p with - | None -> 0 - | RealToComplexPromotion | IntToRealPromotion -> 1 - | IntToComplexPromotion -> 2 - let unique_minimum_promotion promotion_options = let size (_, p) = - List.fold ~init:0 ~f:(fun acc p -> acc + promotion_cost p) p in + List.fold ~init:0 ~f:(fun acc p -> acc + Promotion.promotion_cost p) p in let sizes = List.map ~f:size promotion_options in let min_promotion = List.min_elt ~compare:Int.compare sizes in let sizes_and_promotons = List.zip_exn sizes promotion_options in diff --git a/src/frontend/SignatureMismatch.mli b/src/frontend/SignatureMismatch.mli index 94507e0ee3..fbcbe4eb42 100644 --- a/src/frontend/SignatureMismatch.mli +++ b/src/frontend/SignatureMismatch.mli @@ -19,13 +19,6 @@ type signature_error = (UnsizedType.returntype * (UnsizedType.autodifftype * UnsizedType.t) list) * function_mismatch -(** Indicate a promotion by the resulting type *) -type promotions = private - | None - | IntToRealPromotion - | IntToComplexPromotion - | RealToComplexPromotion - type ('unique, 'error) generic_match_result = | UniqueMatch of 'unique | AmbiguousMatch of @@ -37,23 +30,20 @@ type ('unique, 'error) generic_match_result = type match_result = ( UnsizedType.returntype * (bool Middle.Fun_kind.suffix -> Ast.fun_kind) - * promotions list + * Promotion.t list , signature_error list * bool ) generic_match_result +val check_of_same_type_mod_conv : + UnsizedType.t -> UnsizedType.t -> (Promotion.t, type_mismatch) result + val check_compatible_arguments_mod_conv : (UnsizedType.autodifftype * UnsizedType.t) list -> (UnsizedType.autodifftype * UnsizedType.t) list - -> (promotions list, function_mismatch) result - -val promote : - Ast.typed_expression list -> promotions list -> Ast.typed_expression list -(** Given a list of expressions (arguments) and a list of [promotions], - return a list of expressions which include the - [Promotion] expression as appropiate *) + -> (Promotion.t list, function_mismatch) result val unique_minimum_promotion : - ('a * promotions list) list -> ('a * promotions list, 'a list option) result + ('a * Promotion.t list) list -> ('a * Promotion.t list, 'a list option) result val matching_function : Environment.t @@ -71,7 +61,7 @@ val check_variadic_args : -> (UnsizedType.autodifftype * UnsizedType.t) list -> UnsizedType.t -> (UnsizedType.autodifftype * UnsizedType.t) list - -> ( UnsizedType.t * promotions list + -> ( UnsizedType.t * Promotion.t list , (UnsizedType.autodifftype * UnsizedType.t) list * function_mismatch ) result (** Check variadic function arguments. diff --git a/src/frontend/Typechecker.ml b/src/frontend/Typechecker.ml index 4324179e53..51754f48d1 100644 --- a/src/frontend/Typechecker.ml +++ b/src/frontend/Typechecker.ml @@ -257,44 +257,52 @@ let check_variable cf loc tenv id = mk_typed_expression ~expr:(Variable id) ~ad_level ~type_ ~loc let get_consistent_types ad_level type_ es = + let ad = + UnsizedType.lub_ad_type + (ad_level :: List.map ~f:(fun e -> e.emeta.ad_level) es) in let f state e = match state with | Error e -> Error e - | Ok (ad, ty) -> ( - let ad = - if UnsizedType.autodifftype_can_convert e.emeta.ad_level ad then - e.emeta.ad_level - else ad in - match UnsizedType.common_type (ty, e.emeta.type_) with - | Some ty -> Ok (ad, ty) - | None -> Error (ty, e.emeta) ) in - List.fold ~init:(Ok (ad_level, type_)) ~f es + | Ok ty -> ( + match UnsizedType.common_type (ty, e.emeta.type_) with + | Some ty -> Ok ty + | None -> Error (ty, e.emeta) ) in + List.fold ~init:(Ok type_) ~f es + |> Result.map ~f:(fun ty -> + let promotions = + List.map (get_arg_types es) + ~f:(Promotion.get_type_promotion_exn (ad, ty)) in + (ad, ty, promotions) ) let check_array_expr loc es = match es with | [] -> Semantic_error.empty_array loc |> error - | {emeta= {ad_level; type_; _}; _} :: elements -> ( - match get_consistent_types ad_level type_ elements with + | {emeta= {ad_level; type_; _}; _} :: _ -> ( + match get_consistent_types ad_level type_ es with | Error (ty, meta) -> Semantic_error.mismatched_array_types meta.loc ty meta.type_ |> error - | Ok (ad_level, type_) -> + | Ok (ad_level, type_, promotions) -> let type_ = UnsizedType.UArray type_ in - mk_typed_expression ~expr:(ArrayExpr es) ~ad_level ~type_ ~loc ) + mk_typed_expression + ~expr:(ArrayExpr (Promotion.promote_list es promotions)) + ~ad_level ~type_ ~loc ) let check_rowvector loc es = match es with - | {emeta= {ad_level; type_= UnsizedType.URowVector; _}; _} :: elements -> ( - match get_consistent_types ad_level URowVector elements with - | Ok (ad_level, _) -> - mk_typed_expression ~expr:(RowVectorExpr es) ~ad_level ~type_:UMatrix - ~loc + | {emeta= {ad_level; type_= UnsizedType.URowVector; _}; _} :: _ -> ( + match get_consistent_types ad_level URowVector es with + | Ok (ad_level, _, promotions) -> + mk_typed_expression + ~expr:(RowVectorExpr (Promotion.promote_list es promotions)) + ~ad_level ~type_:UMatrix ~loc | Error (_, meta) -> Semantic_error.invalid_matrix_types meta.loc meta.type_ |> error ) | _ -> ( match get_consistent_types DataOnly UReal es with - | Ok (ad_level, _) -> - mk_typed_expression ~expr:(RowVectorExpr es) ~ad_level ~type_:URowVector - ~loc + | Ok (ad_level, _, promotions) -> + mk_typed_expression + ~expr:(RowVectorExpr (Promotion.promote_list es promotions)) + ~ad_level ~type_:URowVector ~loc | Error (_, meta) -> Semantic_error.invalid_row_vector_types meta.loc meta.type_ |> error ) @@ -450,7 +458,7 @@ let check_normal_fn ~is_cond_dist loc tenv id es = (mk_fun_app ~is_cond_dist ( fnk (Fun_kind.suffix_from_name id.name) , id - , SignatureMismatch.promote es promotions ) ) + , Promotion.promote_list es promotions ) ) ~ad_level:(expr_ad_lub es) ~type_:ut ~loc | AmbiguousMatch sigs -> Semantic_error.ambiguous_function_promotion loc id.name @@ -552,7 +560,7 @@ and check_reduce_sum ~is_cond_dist loc cf tenv id tes = mk_typed_expression ~expr: (mk_fun_app ~is_cond_dist - (StanLib FnPlain, id, SignatureMismatch.promote tes promotions) ) + (StanLib FnPlain, id, Promotion.promote_list tes promotions) ) ~ad_level:(expr_ad_lub tes) ~type_:UnsizedType.UReal ~loc | AmbiguousMatch ps -> Semantic_error.ambiguous_function_promotion loc fname.name None ps @@ -599,7 +607,7 @@ and check_variadic_ode ~is_cond_dist loc cf tenv id tes = mk_typed_expression ~expr: (mk_fun_app ~is_cond_dist - (StanLib FnPlain, id, SignatureMismatch.promote tes promotions) ) + (StanLib FnPlain, id, Promotion.promote_list tes promotions) ) ~ad_level:(expr_ad_lub tes) ~type_:Stan_math_signatures.variadic_ode_return_type ~loc | AmbiguousMatch ps -> @@ -645,7 +653,7 @@ and check_variadic_dae ~is_cond_dist loc cf tenv id tes = mk_typed_expression ~expr: (mk_fun_app ~is_cond_dist - (StanLib FnPlain, id, SignatureMismatch.promote tes promotions) ) + (StanLib FnPlain, id, Promotion.promote_list tes promotions) ) ~ad_level:(expr_ad_lub tes) ~type_:Stan_math_signatures.variadic_dae_return_type ~loc | AmbiguousMatch ps -> @@ -852,7 +860,7 @@ let check_nrfn loc tenv id es = (NRFunApp ( fnk (Fun_kind.suffix_from_name id.name) , id - , SignatureMismatch.promote es promotions ) ) + , Promotion.promote_list es promotions ) ) ~return_type:NoReturnType ~loc | UniqueMatch (ReturnType _, _, _) -> Semantic_error.nonreturning_fn_expected_returning_found loc id.name @@ -886,23 +894,24 @@ let verify_assignment_global loc cf block is_global id = if (not is_global) || block = cf.current_block then () else Semantic_error.cannot_assign_to_global loc id.name |> error -let verify_assignment_operator loc assop lhs rhs = +let check_assignment_operator loc assop lhs rhs = let err op = Semantic_error.illtyped_assignment loc op lhs.lmeta.type_ rhs.emeta.type_ in match assop with - | Assign | ArrowAssign -> - if - UnsizedType.check_of_same_type_mod_array_conv "" lhs.lmeta.type_ - rhs.emeta.type_ - then () - else err Operator.Equals |> error + | Assign | ArrowAssign -> ( + match + SignatureMismatch.check_of_same_type_mod_conv lhs.lmeta.type_ + rhs.emeta.type_ + with + | Ok p -> Promotion.promote rhs p + | Error _ -> err Operator.Equals |> error ) | OperatorAssign op -> ( let args = List.map ~f:arg_type [Ast.expr_of_lvalue lhs; rhs] in let return_type = Stan_math_signatures.assignmentoperator_stan_math_return_type op args in - match return_type with Some Void -> () | _ -> err op |> error ) + match return_type with Some Void -> rhs | _ -> err op |> error ) let check_lvalue cf tenv = function | {lval= LVariable id; lmeta= ({loc} : located_meta)} -> @@ -969,9 +978,9 @@ let check_assignment loc cf tenv assign_lhs assign_op assign_rhs = |> error in verify_assignment_global loc cf block global assign_id ; verify_assignment_read_only loc readonly assign_id ; - verify_assignment_operator loc assign_op lhs rhs ; + let rhs' = check_assignment_operator loc assign_op lhs rhs in mk_typed_statement ~return_type:NoReturnType ~loc - ~stmt:(Assignment {assign_lhs= lhs; assign_op; assign_rhs= rhs}) + ~stmt:(Assignment {assign_lhs= lhs; assign_op; assign_rhs= rhs'}) (* target plus-equals / increment log-prob *) @@ -1361,17 +1370,18 @@ and check_sizedtype cf tenv sizedty = and check_var_decl_initial_value loc cf tenv id init_val_opt = match init_val_opt with - | Some e -> + | Some e -> ( let lhs = check_lvalue cf tenv {lval= LVariable id; lmeta= {loc}} in let rhs = check_expression cf tenv e in - if - UnsizedType.check_of_same_type_mod_array_conv "" lhs.lmeta.type_ + match + SignatureMismatch.check_of_same_type_mod_conv lhs.lmeta.type_ rhs.emeta.type_ - then Some rhs - else - Semantic_error.illtyped_assignment loc Equals lhs.lmeta.type_ - rhs.emeta.type_ - |> error + with + | Ok p -> Some (Promotion.promote rhs p) + | Error _ -> + Semantic_error.illtyped_assignment loc Equals lhs.lmeta.type_ + rhs.emeta.type_ + |> error ) | None -> None and check_transformation cf tenv ut trans = diff --git a/src/middle/Expr.ml b/src/middle/Expr.ml index b5fee8335b..cf88a80bf2 100644 --- a/src/middle/Expr.ml +++ b/src/middle/Expr.ml @@ -44,7 +44,7 @@ module Fixed = struct | EAnd (l, r) -> Fmt.pf ppf "%a && %a" pp_e l pp_e r | EOr (l, r) -> Fmt.pf ppf "%a || %a" pp_e l pp_e r | Promotion (from, ut, _) -> - Fmt.pf ppf "%a -> %a" pp_e from UnsizedType.pp ut + Fmt.pf ppf "promote(@[%a,@ %a@])" pp_e from UnsizedType.pp ut include Foldable.Make (struct type nonrec 'a t = 'a t diff --git a/src/middle/UnsizedType.ml b/src/middle/UnsizedType.ml index 97bcda968b..eb6048e6f9 100644 --- a/src/middle/UnsizedType.ml +++ b/src/middle/UnsizedType.ml @@ -102,12 +102,6 @@ let check_of_same_type_mod_conv name t1 t2 = | Unequal_lengths -> false ) | _ -> t1 = t2 -let rec check_of_same_type_mod_array_conv name t1 t2 = - match (t1, t2) with - | UArray t1elt, UArray t2elt -> - check_of_same_type_mod_array_conv name t1elt t2elt - | _ -> check_of_same_type_mod_conv name t1 t2 - let check_compatible_arguments_mod_conv name args1 args2 = match List.for_all2 @@ -148,11 +142,14 @@ let is_dataonlytype possibly_adtype : bool = let is_scalar_type = function UReal | UInt -> true | _ -> false -let rec promote_array ut scalar = - match (ut, scalar) with - | (UInt | UReal), (UReal | UComplex) -> scalar - | UArray ut2, _ -> UArray (promote_array ut2 scalar) - | _, _ -> ut +let promote_array ut scalar = + let scalar = fst (unwind_array_type scalar) in + let rec loop ut = + match (ut, scalar) with + | (UInt | UReal), (UReal | UComplex) -> scalar + | UArray ut2, _ -> UArray (loop ut2) + | _, _ -> ut in + loop ut let rec is_int_type ut = match ut with UInt -> true | UArray ut -> is_int_type ut | _ -> false diff --git a/src/stan_math_backend/Expression_gen.ml b/src/stan_math_backend/Expression_gen.ml index b8c88d677a..998b64aaae 100644 --- a/src/stan_math_backend/Expression_gen.ml +++ b/src/stan_math_backend/Expression_gen.ml @@ -457,8 +457,7 @@ and pp_user_defined_fun ppf (f, suffix, es) = and pp_compiler_internal_fn ad ut f ppf es = let pp_array_literal ut ppf es = pf ppf "std::vector<%a>{@,%a}" pp_unsizedtype_local (ad, ut) - (list ~sep:comma (pp_promoted ad ut)) - es in + (list ~sep:comma pp_expr) es in match f with | Internal_fun.FnMakeArray -> let ut = @@ -516,20 +515,6 @@ and pp_compiler_internal_fn ad ut f ppf es = gen_fun_app FnPlain ppf (Internal_fun.to_string f) es Common.Helpers.AoS (Some UnsizedType.Void) -and pp_promoted ad ut ppf e = - match e with - | Expr.{Fixed.meta= {Typed.Meta.type_; adlevel; _}; _} - when type_ = ut && adlevel = ad -> - pp_expr ppf e - | {pattern= FunApp (CompilerInternal Internal_fun.FnMakeArray, es); _} -> - pp_compiler_internal_fn ad ut Internal_fun.FnMakeArray ppf es - | _ -> ( - match ut with - | UnsizedType.UComplex -> pf ppf "@[%a@]" pp_expr e - | _ -> - pf ppf "stan::math::promote_scalar<%s>(@[%a@])" - (local_scalar ut ad) pp_expr e ) - and pp_indexed ppf (vident, indices, pretty) = pf ppf "@[stan::model::rvalue(@,%s,@ %S,@ %a)@]" vident pretty pp_indexes indices @@ -561,11 +546,13 @@ and pp_expr ppf Expr.Fixed.{pattern; meta} = | Lit (Str, s) -> pf ppf "\"%s\"" (Cpp_str.escaped s) | Lit (Imaginary, s) -> pf ppf "stan::math::to_complex(0, %s)" s | Lit ((Real | Int), s) -> pf ppf "%s" s + | Promotion (expr, UReal, _) when is_scalar expr -> pp_expr ppf expr + | Promotion (expr, UComplex, DataOnly) when is_scalar expr -> + (* this is in principle a little better than promote_scalar since it is constexpr *) + pf ppf "stan::math::to_complex(%a, 0)" pp_expr expr | Promotion (expr, ut, ad) -> - if is_scalar expr && ut = UReal then pp_expr ppf expr - else - pf ppf "stan::math::promote_scalar<%a>(%a)" pp_unsizedtype_local - (ad, ut) pp_expr expr + pf ppf "stan::math::promote_scalar<%a>(%a)" pp_unsizedtype_local (ad, ut) + pp_expr expr | FunApp ( StanLib (op, _, _) , [ { meta= {type_= URowVector; _} diff --git a/src/stan_math_backend/Statement_gen.ml b/src/stan_math_backend/Statement_gen.ml index d9cad227bc..3ec85032a0 100644 --- a/src/stan_math_backend/Statement_gen.ml +++ b/src/stan_math_backend/Statement_gen.ml @@ -306,6 +306,9 @@ let pp_bool_expr ppf expr = let rec pp_statement (ppf : Format.formatter) Stmt.Fixed.{pattern; meta} = (* ({stmt; smeta} : (mtype_loc_ad, 'a) stmt_with) = *) + let remove_promotions (e : 'a Expr.Fixed.t) = + (* assignment handles one level of promotion internally, don't do it twice *) + match e.pattern with Promotion (e, _, _) -> e | _ -> e in let pp_stmt_list = list ~sep:cut pp_statement in ( match pattern with | Block _ | SList _ | Decl _ | Skip | Break | Continue -> () @@ -318,8 +321,10 @@ let rec pp_statement (ppf : Format.formatter) Stmt.Fixed.{pattern; meta} = pf ppf "@[%s = %a;@]" vident pp_expr rhs | Assignment ((vident, _, []), ({meta= Expr.Typed.Meta.{type_= UInt; _}; _} as rhs)) + |Assignment + ((vident, _, []), ({meta= Expr.Typed.Meta.{type_= UComplex; _}; _} as rhs)) |Assignment ((vident, _, []), ({meta= {type_= UReal; _}; _} as rhs)) -> - pf ppf "@[%s = %a;@]" vident pp_expr rhs + pf ppf "@[%s = %a;@]" vident pp_expr (remove_promotions rhs) | Assignment ((assignee, UInt, idcs), rhs) |Assignment ((assignee, UReal, idcs), rhs) when List.for_all ~f:is_single_index idcs -> @@ -342,7 +347,7 @@ let rec pp_statement (ppf : Format.formatter) Stmt.Fixed.{pattern; meta} = { e with Expr.Fixed.pattern= FunApp (CompilerInternal FnDeepCopy, [e]) } | _ -> recurse e in - let rhs = maybe_deep_copy rhs in + let rhs = maybe_deep_copy (remove_promotions rhs) in pf ppf "@[stan::model::assign(@,%s,@ %a,@ %S%s%a@]);" assignee pp_expr rhs (str "assigning variable %s" assignee) diff --git a/test/integration/cli-args/warn-pedantic/stanc.expected b/test/integration/cli-args/warn-pedantic/stanc.expected index 34dcb8f9b4..aa6e57c3b2 100644 --- a/test/integration/cli-args/warn-pedantic/stanc.expected +++ b/test/integration/cli-args/warn-pedantic/stanc.expected @@ -431,9 +431,6 @@ Warning in 'param-depend-control.stan', line 13, column 2: A control flow Warning in 'param-depend-control.stan', line 8, column 2: A control flow statement depends on parameter(s): a. $ ../../../../../install/default/bin/stanc --warn-pedantic unbounded-sigma.stan -Warning in 'unbounded-sigma.stan', line 15, column 11: A normal distribution - is given value -1 as a scale parameter (argument 2), but a scale - parameter is not strictly positive. Warning in 'unbounded-sigma.stan', line 12, column 17: A normal distribution is given parameter sigma_c as a scale parameter (argument 2), but sigma_c was not constrained to be strictly positive. diff --git a/test/integration/good/code-gen/cpp.expected b/test/integration/good/code-gen/cpp.expected index fa9a36366a..81940be9fd 100644 --- a/test/integration/good/code-gen/cpp.expected +++ b/test/integration/good/code-gen/cpp.expected @@ -1602,8 +1602,7 @@ class complex_scalar_model final : public model_base_crtp current_statement__ = 346; - stan::model::assign(d_complex, context__.vals_c("d_complex")[(1 - 1)], - "assigning variable d_complex"); + d_complex = context__.vals_c("d_complex")[(1 - 1)]; current_statement__ = 347; context__.validate_dims("data initialization","d_complex_array", "double", @@ -1709,40 +1708,32 @@ class complex_scalar_model final : public model_base_crtp current_statement__ = 359; td_complex = 1.1; current_statement__ = 360; - stan::model::assign(td_complex, d_complex, - "assigning variable td_complex"); + td_complex = d_complex; current_statement__ = 361; - stan::model::assign(td_complex, - stan::model::rvalue(d_complex_array, "d_complex_array", - stan::model::index_uni(1)), "assigning variable td_complex"); + td_complex = stan::model::rvalue(d_complex_array, "d_complex_array", + stan::model::index_uni(1)); current_statement__ = 362; - stan::model::assign(td_complex, stan::math::to_complex(), - "assigning variable td_complex"); + td_complex = stan::math::to_complex(); current_statement__ = 363; - stan::model::assign(td_complex, stan::math::to_complex(1), - "assigning variable td_complex"); + td_complex = stan::math::to_complex(1); current_statement__ = 364; - stan::model::assign(td_complex, stan::math::to_complex(1.2), - "assigning variable td_complex"); + td_complex = stan::math::to_complex(1.2); current_statement__ = 365; - stan::model::assign(td_complex, stan::math::to_complex(1, 2), - "assigning variable td_complex"); + td_complex = stan::math::to_complex(1, 2); current_statement__ = 366; - stan::model::assign(td_complex, stan::math::to_complex(1.1, 2), - "assigning variable td_complex"); + td_complex = stan::math::to_complex(1.1, 2); current_statement__ = 367; - stan::model::assign(td_complex, stan::math::to_complex(1, 2.2), - "assigning variable td_complex"); + td_complex = stan::math::to_complex(1, 2.2); current_statement__ = 368; - stan::model::assign(td_complex, stan::math::to_complex(1.1, 2.2), - "assigning variable td_complex"); + td_complex = stan::math::to_complex(1.1, 2.2); current_statement__ = 369; stan::model::assign(td_complex_array, d_complex_array, "assigning variable td_complex_array"); current_statement__ = 370; stan::model::assign(td_complex_array, - std::vector>{td_complex, 1, - stan::math::to_complex(2, 3)}, "assigning variable td_complex_array"); + std::vector>{td_complex, + stan::math::to_complex(1, 0), stan::math::to_complex(2, 3)}, + "assigning variable td_complex_array"); current_statement__ = 371; stan::model::assign(td_complex_array, stan::math::to_complex(5.1, 6), "assigning variable td_complex_array", stan::model::index_uni(1)); @@ -1752,7 +1743,8 @@ class complex_scalar_model final : public model_base_crtp current_statement__ = 373; stan::model::assign(td_complex_array_2d, std::vector>>{ - std::vector>{1, td_complex, 3}, + std::vector>{stan::math::to_complex(1, 0), + td_complex, stan::math::to_complex(3, 0)}, std::vector>{stan::math::to_complex(), stan::math::to_complex(1.1), stan::math::to_complex(1, 2.1)}}, "assigning variable td_complex_array_2d"); @@ -1770,7 +1762,7 @@ class complex_scalar_model final : public model_base_crtp current_statement__ = 377; stan::model::assign(td_complex_array_2d, std::vector>{td_complex, - stan::math::to_complex(1, 2), 2.4}, + stan::math::to_complex(1, 2), stan::math::to_complex(2.4, 0)}, "assigning variable td_complex_array_2d", stan::model::index_uni(1)); current_statement__ = 382; for (int td_j = 1; td_j <= 2; ++td_j) { @@ -1796,11 +1788,9 @@ class complex_scalar_model final : public model_base_crtp { std::complex td_k; current_statement__ = 384; - stan::model::assign(td_k, td_j[(sym1__ - 1)], - "assigning variable td_k"); + td_k = td_j[(sym1__ - 1)]; current_statement__ = 385; - stan::model::assign(td_complex, td_k, - "assigning variable td_complex"); + td_complex = td_k; } } } @@ -1828,17 +1818,13 @@ class complex_scalar_model final : public model_base_crtp "td_complex_array_2d", stan::model::index_uni(1), stan::model::index_uni(1))); current_statement__ = 392; - stan::model::assign(td_complex, foo(pstream__), - "assigning variable td_complex"); + td_complex = foo(pstream__); current_statement__ = 393; td_r = foo1(td_complex, pstream__); current_statement__ = 394; - stan::model::assign(td_complex, foo2(td_r, pstream__), - "assigning variable td_complex"); + td_complex = foo2(td_r, pstream__); current_statement__ = 395; - stan::model::assign(td_complex, - foo3(stan::model::deep_copy(td_complex), pstream__), - "assigning variable td_complex"); + td_complex = foo3(td_complex, pstream__); current_statement__ = 396; stan::model::assign(td_complex_array, foo4(pstream__), "assigning variable td_complex_array"); @@ -1936,40 +1922,29 @@ class complex_scalar_model final : public model_base_crtp current_statement__ = 14; tp_complex = 1.1; current_statement__ = 15; - stan::model::assign(tp_complex, d_complex, - "assigning variable tp_complex"); + tp_complex = d_complex; current_statement__ = 16; - stan::model::assign(tp_complex, - stan::model::rvalue(d_complex_array, "d_complex_array", - stan::model::index_uni(1)), "assigning variable tp_complex"); + tp_complex = stan::model::rvalue(d_complex_array, "d_complex_array", + stan::model::index_uni(1)); current_statement__ = 17; - stan::model::assign(tp_complex, p_complex, - "assigning variable tp_complex"); + tp_complex = p_complex; current_statement__ = 18; - stan::model::assign(tp_complex, - stan::model::rvalue(p_complex_array, "p_complex_array", - stan::model::index_uni(1)), "assigning variable tp_complex"); + tp_complex = stan::model::rvalue(p_complex_array, "p_complex_array", + stan::model::index_uni(1)); current_statement__ = 19; - stan::model::assign(tp_complex, stan::math::to_complex(), - "assigning variable tp_complex"); + tp_complex = stan::math::to_complex(); current_statement__ = 20; - stan::model::assign(tp_complex, stan::math::to_complex(1), - "assigning variable tp_complex"); + tp_complex = stan::math::to_complex(1); current_statement__ = 21; - stan::model::assign(tp_complex, stan::math::to_complex(1.2), - "assigning variable tp_complex"); + tp_complex = stan::math::to_complex(1.2); current_statement__ = 22; - stan::model::assign(tp_complex, stan::math::to_complex(1, 2), - "assigning variable tp_complex"); + tp_complex = stan::math::to_complex(1, 2); current_statement__ = 23; - stan::model::assign(tp_complex, stan::math::to_complex(1.1, 2), - "assigning variable tp_complex"); + tp_complex = stan::math::to_complex(1.1, 2); current_statement__ = 24; - stan::model::assign(tp_complex, stan::math::to_complex(1, 2.2), - "assigning variable tp_complex"); + tp_complex = stan::math::to_complex(1, 2.2); current_statement__ = 25; - stan::model::assign(tp_complex, stan::math::to_complex(1.1, 2.2), - "assigning variable tp_complex"); + tp_complex = stan::math::to_complex(1.1, 2.2); current_statement__ = 26; stan::model::assign(tp_complex_array, d_complex_array, "assigning variable tp_complex_array"); @@ -1978,8 +1953,11 @@ class complex_scalar_model final : public model_base_crtp "assigning variable tp_complex_array"); current_statement__ = 28; stan::model::assign(tp_complex_array, - std::vector>{tp_complex, 1, - stan::math::to_complex(2, 3)}, "assigning variable tp_complex_array"); + std::vector>{tp_complex, + stan::math::promote_scalar>(1), + stan::math::promote_scalar>(stan::math::to_complex( + 2, 3))}, + "assigning variable tp_complex_array"); current_statement__ = 29; stan::model::assign(tp_complex_array, stan::math::to_complex(5.1, 6), "assigning variable tp_complex_array", stan::model::index_uni(1)); @@ -1992,9 +1970,17 @@ class complex_scalar_model final : public model_base_crtp current_statement__ = 32; stan::model::assign(tp_complex_array_2d, std::vector>>{ - std::vector>{1, tp_complex, 3}, - std::vector>{stan::math::to_complex(), - stan::math::to_complex(1.1), stan::math::to_complex(1, 2.1)}}, + std::vector>{ + stan::math::promote_scalar>(1), + tp_complex, + stan::math::promote_scalar>(3)}, + std::vector>{ + stan::math::promote_scalar>(stan::math::to_complex( + )), + stan::math::promote_scalar>(stan::math::to_complex( + 1.1)), + stan::math::promote_scalar>(stan::math::to_complex( + 1, 2.1))}}, "assigning variable tp_complex_array_2d"); current_statement__ = 33; stan::model::assign(tp_complex_array_2d, stan::math::to_complex(1, 2), @@ -2010,7 +1996,9 @@ class complex_scalar_model final : public model_base_crtp current_statement__ = 36; stan::model::assign(tp_complex_array_2d, std::vector>{tp_complex, - stan::math::to_complex(1, 2), 2.4}, + stan::math::promote_scalar>(stan::math::to_complex( + 1, 2)), + stan::math::promote_scalar>(2.4)}, "assigning variable tp_complex_array_2d", stan::model::index_uni(1)); current_statement__ = 41; for (int tp_j = 1; tp_j <= 2; ++tp_j) { @@ -2036,11 +2024,9 @@ class complex_scalar_model final : public model_base_crtp { std::complex tp_k; current_statement__ = 43; - stan::model::assign(tp_k, tp_j[(sym1__ - 1)], - "assigning variable tp_k"); + tp_k = tp_j[(sym1__ - 1)]; current_statement__ = 44; - stan::model::assign(tp_complex, tp_k, - "assigning variable tp_complex"); + tp_complex = tp_k; } } } @@ -2068,17 +2054,13 @@ class complex_scalar_model final : public model_base_crtp "tp_complex_array_2d", stan::model::index_uni(1), stan::model::index_uni(1))); current_statement__ = 51; - stan::model::assign(tp_complex, foo(pstream__), - "assigning variable tp_complex"); + tp_complex = foo(pstream__); current_statement__ = 52; tp_r = foo1(tp_complex, pstream__); current_statement__ = 53; - stan::model::assign(tp_complex, foo2(tp_r, pstream__), - "assigning variable tp_complex"); + tp_complex = foo2(tp_r, pstream__); current_statement__ = 54; - stan::model::assign(tp_complex, - foo3(stan::model::deep_copy(tp_complex), pstream__), - "assigning variable tp_complex"); + tp_complex = foo3(tp_complex, pstream__); current_statement__ = 55; stan::model::assign(tp_complex_array, foo4(pstream__), "assigning variable tp_complex_array"); @@ -2214,40 +2196,29 @@ class complex_scalar_model final : public model_base_crtp current_statement__ = 14; tp_complex = 1.1; current_statement__ = 15; - stan::model::assign(tp_complex, d_complex, - "assigning variable tp_complex"); + tp_complex = d_complex; current_statement__ = 16; - stan::model::assign(tp_complex, - stan::model::rvalue(d_complex_array, "d_complex_array", - stan::model::index_uni(1)), "assigning variable tp_complex"); + tp_complex = stan::model::rvalue(d_complex_array, "d_complex_array", + stan::model::index_uni(1)); current_statement__ = 17; - stan::model::assign(tp_complex, p_complex, - "assigning variable tp_complex"); + tp_complex = p_complex; current_statement__ = 18; - stan::model::assign(tp_complex, - stan::model::rvalue(p_complex_array, "p_complex_array", - stan::model::index_uni(1)), "assigning variable tp_complex"); + tp_complex = stan::model::rvalue(p_complex_array, "p_complex_array", + stan::model::index_uni(1)); current_statement__ = 19; - stan::model::assign(tp_complex, stan::math::to_complex(), - "assigning variable tp_complex"); + tp_complex = stan::math::to_complex(); current_statement__ = 20; - stan::model::assign(tp_complex, stan::math::to_complex(1), - "assigning variable tp_complex"); + tp_complex = stan::math::to_complex(1); current_statement__ = 21; - stan::model::assign(tp_complex, stan::math::to_complex(1.2), - "assigning variable tp_complex"); + tp_complex = stan::math::to_complex(1.2); current_statement__ = 22; - stan::model::assign(tp_complex, stan::math::to_complex(1, 2), - "assigning variable tp_complex"); + tp_complex = stan::math::to_complex(1, 2); current_statement__ = 23; - stan::model::assign(tp_complex, stan::math::to_complex(1.1, 2), - "assigning variable tp_complex"); + tp_complex = stan::math::to_complex(1.1, 2); current_statement__ = 24; - stan::model::assign(tp_complex, stan::math::to_complex(1, 2.2), - "assigning variable tp_complex"); + tp_complex = stan::math::to_complex(1, 2.2); current_statement__ = 25; - stan::model::assign(tp_complex, stan::math::to_complex(1.1, 2.2), - "assigning variable tp_complex"); + tp_complex = stan::math::to_complex(1.1, 2.2); current_statement__ = 26; stan::model::assign(tp_complex_array, d_complex_array, "assigning variable tp_complex_array"); @@ -2256,8 +2227,11 @@ class complex_scalar_model final : public model_base_crtp "assigning variable tp_complex_array"); current_statement__ = 28; stan::model::assign(tp_complex_array, - std::vector>{tp_complex, 1, - stan::math::to_complex(2, 3)}, "assigning variable tp_complex_array"); + std::vector>{tp_complex, + stan::math::promote_scalar>(1), + stan::math::promote_scalar>(stan::math::to_complex( + 2, 3))}, + "assigning variable tp_complex_array"); current_statement__ = 29; stan::model::assign(tp_complex_array, stan::math::to_complex(5.1, 6), "assigning variable tp_complex_array", stan::model::index_uni(1)); @@ -2270,9 +2244,17 @@ class complex_scalar_model final : public model_base_crtp current_statement__ = 32; stan::model::assign(tp_complex_array_2d, std::vector>>{ - std::vector>{1, tp_complex, 3}, - std::vector>{stan::math::to_complex(), - stan::math::to_complex(1.1), stan::math::to_complex(1, 2.1)}}, + std::vector>{ + stan::math::promote_scalar>(1), + tp_complex, + stan::math::promote_scalar>(3)}, + std::vector>{ + stan::math::promote_scalar>(stan::math::to_complex( + )), + stan::math::promote_scalar>(stan::math::to_complex( + 1.1)), + stan::math::promote_scalar>(stan::math::to_complex( + 1, 2.1))}}, "assigning variable tp_complex_array_2d"); current_statement__ = 33; stan::model::assign(tp_complex_array_2d, stan::math::to_complex(1, 2), @@ -2288,7 +2270,9 @@ class complex_scalar_model final : public model_base_crtp current_statement__ = 36; stan::model::assign(tp_complex_array_2d, std::vector>{tp_complex, - stan::math::to_complex(1, 2), 2.4}, + stan::math::promote_scalar>(stan::math::to_complex( + 1, 2)), + stan::math::promote_scalar>(2.4)}, "assigning variable tp_complex_array_2d", stan::model::index_uni(1)); current_statement__ = 41; for (int tp_j = 1; tp_j <= 2; ++tp_j) { @@ -2314,11 +2298,9 @@ class complex_scalar_model final : public model_base_crtp { std::complex tp_k; current_statement__ = 43; - stan::model::assign(tp_k, tp_j[(sym1__ - 1)], - "assigning variable tp_k"); + tp_k = tp_j[(sym1__ - 1)]; current_statement__ = 44; - stan::model::assign(tp_complex, tp_k, - "assigning variable tp_complex"); + tp_complex = tp_k; } } } @@ -2346,17 +2328,13 @@ class complex_scalar_model final : public model_base_crtp "tp_complex_array_2d", stan::model::index_uni(1), stan::model::index_uni(1))); current_statement__ = 51; - stan::model::assign(tp_complex, foo(pstream__), - "assigning variable tp_complex"); + tp_complex = foo(pstream__); current_statement__ = 52; tp_r = foo1(tp_complex, pstream__); current_statement__ = 53; - stan::model::assign(tp_complex, foo2(tp_r, pstream__), - "assigning variable tp_complex"); + tp_complex = foo2(tp_r, pstream__); current_statement__ = 54; - stan::model::assign(tp_complex, - foo3(stan::model::deep_copy(tp_complex), pstream__), - "assigning variable tp_complex"); + tp_complex = foo3(tp_complex, pstream__); current_statement__ = 55; stan::model::assign(tp_complex_array, foo4(pstream__), "assigning variable tp_complex_array"); @@ -2426,40 +2404,29 @@ class complex_scalar_model final : public model_base_crtp current_statement__ = 73; gq_complex = 1.1; current_statement__ = 74; - stan::model::assign(gq_complex, d_complex, - "assigning variable gq_complex"); + gq_complex = d_complex; current_statement__ = 75; - stan::model::assign(gq_complex, - stan::model::rvalue(d_complex_array, "d_complex_array", - stan::model::index_uni(1)), "assigning variable gq_complex"); + gq_complex = stan::model::rvalue(d_complex_array, "d_complex_array", + stan::model::index_uni(1)); current_statement__ = 76; - stan::model::assign(gq_complex, p_complex, - "assigning variable gq_complex"); + gq_complex = p_complex; current_statement__ = 77; - stan::model::assign(gq_complex, - stan::model::rvalue(p_complex_array, "p_complex_array", - stan::model::index_uni(1)), "assigning variable gq_complex"); + gq_complex = stan::model::rvalue(p_complex_array, "p_complex_array", + stan::model::index_uni(1)); current_statement__ = 78; - stan::model::assign(gq_complex, stan::math::to_complex(), - "assigning variable gq_complex"); + gq_complex = stan::math::to_complex(); current_statement__ = 79; - stan::model::assign(gq_complex, stan::math::to_complex(1), - "assigning variable gq_complex"); + gq_complex = stan::math::to_complex(1); current_statement__ = 80; - stan::model::assign(gq_complex, stan::math::to_complex(1.2), - "assigning variable gq_complex"); + gq_complex = stan::math::to_complex(1.2); current_statement__ = 81; - stan::model::assign(gq_complex, stan::math::to_complex(1, 2), - "assigning variable gq_complex"); + gq_complex = stan::math::to_complex(1, 2); current_statement__ = 82; - stan::model::assign(gq_complex, stan::math::to_complex(1.1, 2), - "assigning variable gq_complex"); + gq_complex = stan::math::to_complex(1.1, 2); current_statement__ = 83; - stan::model::assign(gq_complex, stan::math::to_complex(1, 2.2), - "assigning variable gq_complex"); + gq_complex = stan::math::to_complex(1, 2.2); current_statement__ = 84; - stan::model::assign(gq_complex, stan::math::to_complex(1.1, 2.2), - "assigning variable gq_complex"); + gq_complex = stan::math::to_complex(1.1, 2.2); current_statement__ = 85; stan::model::assign(gq_complex_array, d_complex_array, "assigning variable gq_complex_array"); @@ -2468,8 +2435,9 @@ class complex_scalar_model final : public model_base_crtp "assigning variable gq_complex_array"); current_statement__ = 87; stan::model::assign(gq_complex_array, - std::vector>{gq_complex, 1, - stan::math::to_complex(2, 3)}, "assigning variable gq_complex_array"); + std::vector>{gq_complex, + stan::math::to_complex(1, 0), stan::math::to_complex(2, 3)}, + "assigning variable gq_complex_array"); current_statement__ = 88; stan::model::assign(gq_complex_array, stan::math::to_complex(5.1, 6), "assigning variable gq_complex_array", stan::model::index_uni(1)); @@ -2482,7 +2450,8 @@ class complex_scalar_model final : public model_base_crtp current_statement__ = 91; stan::model::assign(gq_complex_array_2d, std::vector>>{ - std::vector>{1, gq_complex, 3}, + std::vector>{stan::math::to_complex(1, 0), + gq_complex, stan::math::to_complex(3, 0)}, std::vector>{stan::math::to_complex(), stan::math::to_complex(1.1), stan::math::to_complex(1, 2.1)}}, "assigning variable gq_complex_array_2d"); @@ -2500,7 +2469,7 @@ class complex_scalar_model final : public model_base_crtp current_statement__ = 95; stan::model::assign(gq_complex_array_2d, std::vector>{gq_complex, - stan::math::to_complex(1, 2), 2.4}, + stan::math::to_complex(1, 2), stan::math::to_complex(2.4, 0)}, "assigning variable gq_complex_array_2d", stan::model::index_uni(1)); current_statement__ = 100; for (int gq_j = 1; gq_j <= 2; ++gq_j) { @@ -2526,11 +2495,9 @@ class complex_scalar_model final : public model_base_crtp { std::complex gq_k; current_statement__ = 102; - stan::model::assign(gq_k, gq_j[(sym1__ - 1)], - "assigning variable gq_k"); + gq_k = gq_j[(sym1__ - 1)]; current_statement__ = 103; - stan::model::assign(gq_complex, gq_k, - "assigning variable gq_complex"); + gq_complex = gq_k; } } } @@ -2558,17 +2525,13 @@ class complex_scalar_model final : public model_base_crtp "gq_complex_array_2d", stan::model::index_uni(1), stan::model::index_uni(1))); current_statement__ = 110; - stan::model::assign(gq_complex, foo(pstream__), - "assigning variable gq_complex"); + gq_complex = foo(pstream__); current_statement__ = 111; gq_r = foo1(gq_complex, pstream__); current_statement__ = 112; - stan::model::assign(gq_complex, foo2(gq_r, pstream__), - "assigning variable gq_complex"); + gq_complex = foo2(gq_r, pstream__); current_statement__ = 113; - stan::model::assign(gq_complex, - foo3(stan::model::deep_copy(gq_complex), pstream__), - "assigning variable gq_complex"); + gq_complex = foo3(gq_complex, pstream__); current_statement__ = 114; stan::model::assign(gq_complex_array, foo4(pstream__), "assigning variable gq_complex_array"); @@ -2594,223 +2557,156 @@ class complex_scalar_model final : public model_base_crtp std::complex(std::numeric_limits::quiet_NaN(), std::numeric_limits::quiet_NaN()); current_statement__ = 121; - stan::model::assign(z, stan::math::to_complex(1, 2), - "assigning variable z"); + z = stan::math::to_complex(1, 2); std::complex y = std::complex(std::numeric_limits::quiet_NaN(), std::numeric_limits::quiet_NaN()); current_statement__ = 122; - stan::model::assign(y, stan::math::to_complex(3, 4), - "assigning variable y"); + y = stan::math::to_complex(3, 4); std::vector i_arr = std::vector(0, std::numeric_limits::min()); std::vector i_arr_1 = std::vector(1, std::numeric_limits::min()); current_statement__ = 125; - stan::model::assign(gq_complex, (z + y), - "assigning variable gq_complex"); + gq_complex = (z + y); current_statement__ = 126; - stan::model::assign(gq_complex, (z + gq_r), - "assigning variable gq_complex"); + gq_complex = (z + gq_r); current_statement__ = 127; - stan::model::assign(gq_complex, (gq_r + z), - "assigning variable gq_complex"); + gq_complex = (gq_r + z); current_statement__ = 128; - stan::model::assign(gq_complex, (z + gq_i), - "assigning variable gq_complex"); + gq_complex = (z + gq_i); current_statement__ = 129; - stan::model::assign(gq_complex, (gq_i + z), - "assigning variable gq_complex"); + gq_complex = (gq_i + z); current_statement__ = 130; - stan::model::assign(gq_complex, (d_complex + p_complex), - "assigning variable gq_complex"); + gq_complex = (d_complex + p_complex); current_statement__ = 131; - stan::model::assign(gq_complex, (d_complex + d_r), - "assigning variable gq_complex"); + gq_complex = (d_complex + d_r); current_statement__ = 132; - stan::model::assign(gq_complex, (d_complex + p_r), - "assigning variable gq_complex"); + gq_complex = (d_complex + p_r); current_statement__ = 133; - stan::model::assign(gq_complex, (d_r + p_complex), - "assigning variable gq_complex"); + gq_complex = (d_r + p_complex); current_statement__ = 134; - stan::model::assign(gq_complex, (p_complex + p_r), - "assigning variable gq_complex"); + gq_complex = (p_complex + p_r); current_statement__ = 135; - stan::model::assign(gq_complex, (d_complex + gq_i), - "assigning variable gq_complex"); + gq_complex = (d_complex + gq_i); current_statement__ = 136; - stan::model::assign(gq_complex, (gq_i + p_complex), - "assigning variable gq_complex"); + gq_complex = (gq_i + p_complex); current_statement__ = 137; - stan::model::assign(gq_complex, (z - y), - "assigning variable gq_complex"); + gq_complex = (z - y); current_statement__ = 138; - stan::model::assign(gq_complex, (z - gq_r), - "assigning variable gq_complex"); + gq_complex = (z - gq_r); current_statement__ = 139; - stan::model::assign(gq_complex, (gq_r - z), - "assigning variable gq_complex"); + gq_complex = (gq_r - z); current_statement__ = 140; - stan::model::assign(gq_complex, (z - gq_i), - "assigning variable gq_complex"); + gq_complex = (z - gq_i); current_statement__ = 141; - stan::model::assign(gq_complex, (gq_i - z), - "assigning variable gq_complex"); + gq_complex = (gq_i - z); current_statement__ = 142; - stan::model::assign(gq_complex, (d_complex - p_complex), - "assigning variable gq_complex"); + gq_complex = (d_complex - p_complex); current_statement__ = 143; - stan::model::assign(gq_complex, (d_complex - d_r), - "assigning variable gq_complex"); + gq_complex = (d_complex - d_r); current_statement__ = 144; - stan::model::assign(gq_complex, (d_complex - p_r), - "assigning variable gq_complex"); + gq_complex = (d_complex - p_r); current_statement__ = 145; - stan::model::assign(gq_complex, (d_r - p_complex), - "assigning variable gq_complex"); + gq_complex = (d_r - p_complex); current_statement__ = 146; - stan::model::assign(gq_complex, (p_complex - p_r), - "assigning variable gq_complex"); + gq_complex = (p_complex - p_r); current_statement__ = 147; - stan::model::assign(gq_complex, (d_complex - gq_i), - "assigning variable gq_complex"); + gq_complex = (d_complex - gq_i); current_statement__ = 148; - stan::model::assign(gq_complex, (gq_i - p_complex), - "assigning variable gq_complex"); + gq_complex = (gq_i - p_complex); current_statement__ = 149; - stan::model::assign(gq_complex, (z * y), - "assigning variable gq_complex"); + gq_complex = (z * y); current_statement__ = 150; - stan::model::assign(gq_complex, (z * gq_r), - "assigning variable gq_complex"); + gq_complex = (z * gq_r); current_statement__ = 151; - stan::model::assign(gq_complex, (gq_r * z), - "assigning variable gq_complex"); + gq_complex = (gq_r * z); current_statement__ = 152; - stan::model::assign(gq_complex, (z * gq_i), - "assigning variable gq_complex"); + gq_complex = (z * gq_i); current_statement__ = 153; - stan::model::assign(gq_complex, (gq_i * z), - "assigning variable gq_complex"); + gq_complex = (gq_i * z); current_statement__ = 154; - stan::model::assign(gq_complex, (d_complex * p_complex), - "assigning variable gq_complex"); + gq_complex = (d_complex * p_complex); current_statement__ = 155; - stan::model::assign(gq_complex, (d_complex * d_r), - "assigning variable gq_complex"); + gq_complex = (d_complex * d_r); current_statement__ = 156; - stan::model::assign(gq_complex, (d_complex * p_r), - "assigning variable gq_complex"); + gq_complex = (d_complex * p_r); current_statement__ = 157; - stan::model::assign(gq_complex, (d_r * p_complex), - "assigning variable gq_complex"); + gq_complex = (d_r * p_complex); current_statement__ = 158; - stan::model::assign(gq_complex, (p_complex * p_r), - "assigning variable gq_complex"); + gq_complex = (p_complex * p_r); current_statement__ = 159; - stan::model::assign(gq_complex, (d_complex * gq_i), - "assigning variable gq_complex"); + gq_complex = (d_complex * gq_i); current_statement__ = 160; - stan::model::assign(gq_complex, (gq_i * p_complex), - "assigning variable gq_complex"); + gq_complex = (gq_i * p_complex); current_statement__ = 161; - stan::model::assign(gq_complex, (z / y), - "assigning variable gq_complex"); + gq_complex = (z / y); current_statement__ = 162; - stan::model::assign(gq_complex, (z / gq_r), - "assigning variable gq_complex"); + gq_complex = (z / gq_r); current_statement__ = 163; - stan::model::assign(gq_complex, (gq_r / z), - "assigning variable gq_complex"); + gq_complex = (gq_r / z); current_statement__ = 164; - stan::model::assign(gq_complex, (z / gq_i), - "assigning variable gq_complex"); + gq_complex = (z / gq_i); current_statement__ = 165; - stan::model::assign(gq_complex, (gq_i / z), - "assigning variable gq_complex"); + gq_complex = (gq_i / z); current_statement__ = 166; - stan::model::assign(gq_complex, (d_complex / p_complex), - "assigning variable gq_complex"); + gq_complex = (d_complex / p_complex); current_statement__ = 167; - stan::model::assign(gq_complex, (d_complex / d_r), - "assigning variable gq_complex"); + gq_complex = (d_complex / d_r); current_statement__ = 168; - stan::model::assign(gq_complex, (d_complex / p_r), - "assigning variable gq_complex"); + gq_complex = (d_complex / p_r); current_statement__ = 169; - stan::model::assign(gq_complex, (d_r / p_complex), - "assigning variable gq_complex"); + gq_complex = (d_r / p_complex); current_statement__ = 170; - stan::model::assign(gq_complex, (p_complex / p_r), - "assigning variable gq_complex"); + gq_complex = (p_complex / p_r); current_statement__ = 171; - stan::model::assign(gq_complex, (d_complex / gq_i), - "assigning variable gq_complex"); + gq_complex = (d_complex / gq_i); current_statement__ = 172; - stan::model::assign(gq_complex, (gq_i / p_complex), - "assigning variable gq_complex"); + gq_complex = (gq_i / p_complex); current_statement__ = 173; - stan::model::assign(gq_complex, stan::math::pow(z, y), - "assigning variable gq_complex"); + gq_complex = stan::math::pow(z, y); current_statement__ = 174; - stan::model::assign(gq_complex, stan::math::pow(z, gq_r), - "assigning variable gq_complex"); + gq_complex = stan::math::pow(z, gq_r); current_statement__ = 175; - stan::model::assign(gq_complex, stan::math::pow(gq_r, z), - "assigning variable gq_complex"); + gq_complex = stan::math::pow(gq_r, z); current_statement__ = 176; - stan::model::assign(gq_complex, stan::math::pow(z, gq_i), - "assigning variable gq_complex"); + gq_complex = stan::math::pow(z, gq_i); current_statement__ = 177; - stan::model::assign(gq_complex, stan::math::pow(gq_i, z), - "assigning variable gq_complex"); + gq_complex = stan::math::pow(gq_i, z); current_statement__ = 178; - stan::model::assign(gq_complex, stan::math::pow(d_complex, p_complex), - "assigning variable gq_complex"); + gq_complex = stan::math::pow(d_complex, p_complex); current_statement__ = 179; - stan::model::assign(gq_complex, stan::math::pow(d_complex, d_r), - "assigning variable gq_complex"); + gq_complex = stan::math::pow(d_complex, d_r); current_statement__ = 180; - stan::model::assign(gq_complex, stan::math::pow(d_complex, p_r), - "assigning variable gq_complex"); + gq_complex = stan::math::pow(d_complex, p_r); current_statement__ = 181; - stan::model::assign(gq_complex, stan::math::pow(d_r, p_complex), - "assigning variable gq_complex"); + gq_complex = stan::math::pow(d_r, p_complex); current_statement__ = 182; - stan::model::assign(gq_complex, stan::math::pow(p_complex, p_r), - "assigning variable gq_complex"); + gq_complex = stan::math::pow(p_complex, p_r); current_statement__ = 183; - stan::model::assign(gq_complex, stan::math::pow(d_complex, gq_i), - "assigning variable gq_complex"); + gq_complex = stan::math::pow(d_complex, gq_i); current_statement__ = 184; - stan::model::assign(gq_complex, stan::math::pow(gq_i, p_complex), - "assigning variable gq_complex"); + gq_complex = stan::math::pow(gq_i, p_complex); current_statement__ = 185; - stan::model::assign(gq_complex, -z, "assigning variable gq_complex"); + gq_complex = -z; current_statement__ = 186; gq_complex = -gq_r; current_statement__ = 187; gq_complex = -gq_i; current_statement__ = 188; - stan::model::assign(gq_complex, -d_complex, - "assigning variable gq_complex"); + gq_complex = -d_complex; current_statement__ = 189; gq_complex = -d_r; current_statement__ = 190; - stan::model::assign(gq_complex, -p_complex, - "assigning variable gq_complex"); + gq_complex = -p_complex; current_statement__ = 191; gq_complex = -p_r; current_statement__ = 192; - stan::model::assign(gq_complex, (gq_i ? z : y), - "assigning variable gq_complex"); + gq_complex = (gq_i ? z : y); current_statement__ = 193; - stan::model::assign(gq_complex, (gq_i ? p_complex : z), - "assigning variable gq_complex"); + gq_complex = (gq_i ? p_complex : z); current_statement__ = 194; - stan::model::assign(gq_complex, (gq_i ? d_complex : z), - "assigning variable gq_complex"); + gq_complex = (gq_i ? d_complex : z); current_statement__ = 195; gq_i = stan::math::logical_eq(z, z); current_statement__ = 196; @@ -2858,86 +2754,59 @@ class complex_scalar_model final : public model_base_crtp current_statement__ = 217; gq_r = stan::math::abs(d_complex); current_statement__ = 218; - stan::model::assign(gq_complex, stan::math::acos(z), - "assigning variable gq_complex"); + gq_complex = stan::math::acos(z); current_statement__ = 219; - stan::model::assign(gq_complex, stan::math::acos(p_complex), - "assigning variable gq_complex"); + gq_complex = stan::math::acos(p_complex); current_statement__ = 220; - stan::model::assign(gq_complex, stan::math::acos(d_complex), - "assigning variable gq_complex"); + gq_complex = stan::math::acos(d_complex); current_statement__ = 221; - stan::model::assign(gq_complex, stan::math::acosh(z), - "assigning variable gq_complex"); + gq_complex = stan::math::acosh(z); current_statement__ = 222; - stan::model::assign(gq_complex, stan::math::acosh(p_complex), - "assigning variable gq_complex"); + gq_complex = stan::math::acosh(p_complex); current_statement__ = 223; - stan::model::assign(gq_complex, stan::math::acosh(d_complex), - "assigning variable gq_complex"); + gq_complex = stan::math::acosh(d_complex); current_statement__ = 224; - stan::model::assign(gq_complex, stan::math::asin(z), - "assigning variable gq_complex"); + gq_complex = stan::math::asin(z); current_statement__ = 225; - stan::model::assign(gq_complex, stan::math::asin(p_complex), - "assigning variable gq_complex"); + gq_complex = stan::math::asin(p_complex); current_statement__ = 226; - stan::model::assign(gq_complex, stan::math::asin(d_complex), - "assigning variable gq_complex"); + gq_complex = stan::math::asin(d_complex); current_statement__ = 227; - stan::model::assign(gq_complex, stan::math::asinh(z), - "assigning variable gq_complex"); + gq_complex = stan::math::asinh(z); current_statement__ = 228; - stan::model::assign(gq_complex, stan::math::asinh(p_complex), - "assigning variable gq_complex"); + gq_complex = stan::math::asinh(p_complex); current_statement__ = 229; - stan::model::assign(gq_complex, stan::math::asinh(d_complex), - "assigning variable gq_complex"); + gq_complex = stan::math::asinh(d_complex); current_statement__ = 230; - stan::model::assign(gq_complex, stan::math::atan(z), - "assigning variable gq_complex"); + gq_complex = stan::math::atan(z); current_statement__ = 231; - stan::model::assign(gq_complex, stan::math::atan(p_complex), - "assigning variable gq_complex"); + gq_complex = stan::math::atan(p_complex); current_statement__ = 232; - stan::model::assign(gq_complex, stan::math::atan(d_complex), - "assigning variable gq_complex"); + gq_complex = stan::math::atan(d_complex); current_statement__ = 233; - stan::model::assign(gq_complex, stan::math::atanh(z), - "assigning variable gq_complex"); + gq_complex = stan::math::atanh(z); current_statement__ = 234; - stan::model::assign(gq_complex, stan::math::atanh(p_complex), - "assigning variable gq_complex"); + gq_complex = stan::math::atanh(p_complex); current_statement__ = 235; - stan::model::assign(gq_complex, stan::math::atanh(d_complex), - "assigning variable gq_complex"); + gq_complex = stan::math::atanh(d_complex); current_statement__ = 236; - stan::model::assign(gq_complex, stan::math::conj(z), - "assigning variable gq_complex"); + gq_complex = stan::math::conj(z); current_statement__ = 237; - stan::model::assign(gq_complex, stan::math::conj(p_complex), - "assigning variable gq_complex"); + gq_complex = stan::math::conj(p_complex); current_statement__ = 238; - stan::model::assign(gq_complex, stan::math::conj(d_complex), - "assigning variable gq_complex"); + gq_complex = stan::math::conj(d_complex); current_statement__ = 239; - stan::model::assign(gq_complex, stan::math::cos(z), - "assigning variable gq_complex"); + gq_complex = stan::math::cos(z); current_statement__ = 240; - stan::model::assign(gq_complex, stan::math::cos(p_complex), - "assigning variable gq_complex"); + gq_complex = stan::math::cos(p_complex); current_statement__ = 241; - stan::model::assign(gq_complex, stan::math::cos(d_complex), - "assigning variable gq_complex"); + gq_complex = stan::math::cos(d_complex); current_statement__ = 242; - stan::model::assign(gq_complex, stan::math::cosh(z), - "assigning variable gq_complex"); + gq_complex = stan::math::cosh(z); current_statement__ = 243; - stan::model::assign(gq_complex, stan::math::cosh(p_complex), - "assigning variable gq_complex"); + gq_complex = stan::math::cosh(p_complex); current_statement__ = 244; - stan::model::assign(gq_complex, stan::math::cosh(d_complex), - "assigning variable gq_complex"); + gq_complex = stan::math::cosh(d_complex); current_statement__ = 245; stan::model::assign(i_arr, stan::math::dims(z), "assigning variable i_arr"); @@ -2957,14 +2826,11 @@ class complex_scalar_model final : public model_base_crtp stan::model::assign(i_arr_1, stan::math::dims(d_complex_array), "assigning variable i_arr_1"); current_statement__ = 251; - stan::model::assign(gq_complex, stan::math::exp(z), - "assigning variable gq_complex"); + gq_complex = stan::math::exp(z); current_statement__ = 252; - stan::model::assign(gq_complex, stan::math::exp(p_complex), - "assigning variable gq_complex"); + gq_complex = stan::math::exp(p_complex); current_statement__ = 253; - stan::model::assign(gq_complex, stan::math::exp(d_complex), - "assigning variable gq_complex"); + gq_complex = stan::math::exp(d_complex); current_statement__ = 254; gq_r = stan::math::get_imag(z); current_statement__ = 255; @@ -2990,23 +2856,17 @@ class complex_scalar_model final : public model_base_crtp stan::math::head(d_complex_array, 1), "assigning variable gq_complex_array"); current_statement__ = 263; - stan::model::assign(gq_complex, stan::math::log(z), - "assigning variable gq_complex"); + gq_complex = stan::math::log(z); current_statement__ = 264; - stan::model::assign(gq_complex, stan::math::log(p_complex), - "assigning variable gq_complex"); + gq_complex = stan::math::log(p_complex); current_statement__ = 265; - stan::model::assign(gq_complex, stan::math::log(d_complex), - "assigning variable gq_complex"); + gq_complex = stan::math::log(d_complex); current_statement__ = 266; - stan::model::assign(gq_complex, stan::math::log10(z), - "assigning variable gq_complex"); + gq_complex = stan::math::log10(z); current_statement__ = 267; - stan::model::assign(gq_complex, stan::math::log10(p_complex), - "assigning variable gq_complex"); + gq_complex = stan::math::log10(p_complex); current_statement__ = 268; - stan::model::assign(gq_complex, stan::math::log10(d_complex), - "assigning variable gq_complex"); + gq_complex = stan::math::log10(d_complex); current_statement__ = 269; gq_r = stan::math::norm(z); current_statement__ = 270; @@ -3020,80 +2880,55 @@ class complex_scalar_model final : public model_base_crtp current_statement__ = 274; gq_i = stan::math::num_elements(d_complex_array); current_statement__ = 275; - stan::model::assign(gq_complex, stan::math::polar(gq_r, gq_r), - "assigning variable gq_complex"); + gq_complex = stan::math::polar(gq_r, gq_r); current_statement__ = 276; - stan::model::assign(gq_complex, stan::math::polar(gq_i, gq_i), - "assigning variable gq_complex"); + gq_complex = stan::math::polar(gq_i, gq_i); current_statement__ = 277; - stan::model::assign(gq_complex, stan::math::polar(gq_r, gq_i), - "assigning variable gq_complex"); + gq_complex = stan::math::polar(gq_r, gq_i); current_statement__ = 278; - stan::model::assign(gq_complex, stan::math::polar(gq_i, gq_r), - "assigning variable gq_complex"); + gq_complex = stan::math::polar(gq_i, gq_r); current_statement__ = 279; - stan::model::assign(gq_complex, stan::math::polar(p_r, gq_r), - "assigning variable gq_complex"); + gq_complex = stan::math::polar(p_r, gq_r); current_statement__ = 280; - stan::model::assign(gq_complex, stan::math::polar(d_r, gq_r), - "assigning variable gq_complex"); + gq_complex = stan::math::polar(d_r, gq_r); current_statement__ = 281; - stan::model::assign(gq_complex, stan::math::polar(p_r, d_r), - "assigning variable gq_complex"); + gq_complex = stan::math::polar(p_r, d_r); current_statement__ = 282; - stan::model::assign(gq_complex, stan::math::pow(z, gq_r), - "assigning variable gq_complex"); + gq_complex = stan::math::pow(z, gq_r); current_statement__ = 283; - stan::model::assign(gq_complex, stan::math::pow(z, gq_i), - "assigning variable gq_complex"); + gq_complex = stan::math::pow(z, gq_i); current_statement__ = 284; - stan::model::assign(gq_complex, stan::math::pow(z, z), - "assigning variable gq_complex"); + gq_complex = stan::math::pow(z, z); current_statement__ = 285; - stan::model::assign(gq_complex, stan::math::pow(p_complex, p_r), - "assigning variable gq_complex"); + gq_complex = stan::math::pow(p_complex, p_r); current_statement__ = 286; - stan::model::assign(gq_complex, stan::math::pow(p_complex, d_r), - "assigning variable gq_complex"); + gq_complex = stan::math::pow(p_complex, d_r); current_statement__ = 287; - stan::model::assign(gq_complex, stan::math::pow(p_complex, gq_r), - "assigning variable gq_complex"); + gq_complex = stan::math::pow(p_complex, gq_r); current_statement__ = 288; - stan::model::assign(gq_complex, stan::math::pow(p_complex, z), - "assigning variable gq_complex"); + gq_complex = stan::math::pow(p_complex, z); current_statement__ = 289; - stan::model::assign(gq_complex, stan::math::pow(p_complex, d_complex), - "assigning variable gq_complex"); + gq_complex = stan::math::pow(p_complex, d_complex); current_statement__ = 290; - stan::model::assign(gq_complex, stan::math::pow(p_complex, p_complex), - "assigning variable gq_complex"); + gq_complex = stan::math::pow(p_complex, p_complex); current_statement__ = 291; - stan::model::assign(gq_complex, stan::math::pow(d_complex, p_r), - "assigning variable gq_complex"); + gq_complex = stan::math::pow(d_complex, p_r); current_statement__ = 292; - stan::model::assign(gq_complex, stan::math::pow(d_complex, d_r), - "assigning variable gq_complex"); + gq_complex = stan::math::pow(d_complex, d_r); current_statement__ = 293; - stan::model::assign(gq_complex, stan::math::pow(d_complex, gq_r), - "assigning variable gq_complex"); + gq_complex = stan::math::pow(d_complex, gq_r); current_statement__ = 294; - stan::model::assign(gq_complex, stan::math::pow(d_complex, z), - "assigning variable gq_complex"); + gq_complex = stan::math::pow(d_complex, z); current_statement__ = 295; - stan::model::assign(gq_complex, stan::math::pow(d_complex, d_complex), - "assigning variable gq_complex"); + gq_complex = stan::math::pow(d_complex, d_complex); current_statement__ = 296; - stan::model::assign(gq_complex, stan::math::pow(d_complex, p_complex), - "assigning variable gq_complex"); + gq_complex = stan::math::pow(d_complex, p_complex); current_statement__ = 297; - stan::model::assign(gq_complex, stan::math::proj(z), - "assigning variable gq_complex"); + gq_complex = stan::math::proj(z); current_statement__ = 298; - stan::model::assign(gq_complex, stan::math::proj(p_complex), - "assigning variable gq_complex"); + gq_complex = stan::math::proj(p_complex); current_statement__ = 299; - stan::model::assign(gq_complex, stan::math::proj(d_complex), - "assigning variable gq_complex"); + gq_complex = stan::math::proj(d_complex); current_statement__ = 300; stan::model::assign(gq_complex_array, stan::math::reverse(stan::model::deep_copy(gq_complex_array)), @@ -3107,23 +2942,17 @@ class complex_scalar_model final : public model_base_crtp stan::math::reverse(d_complex_array), "assigning variable gq_complex_array"); current_statement__ = 303; - stan::model::assign(gq_complex, stan::math::sin(z), - "assigning variable gq_complex"); + gq_complex = stan::math::sin(z); current_statement__ = 304; - stan::model::assign(gq_complex, stan::math::sin(p_complex), - "assigning variable gq_complex"); + gq_complex = stan::math::sin(p_complex); current_statement__ = 305; - stan::model::assign(gq_complex, stan::math::sin(d_complex), - "assigning variable gq_complex"); + gq_complex = stan::math::sin(d_complex); current_statement__ = 306; - stan::model::assign(gq_complex, stan::math::sinh(z), - "assigning variable gq_complex"); + gq_complex = stan::math::sinh(z); current_statement__ = 307; - stan::model::assign(gq_complex, stan::math::sinh(p_complex), - "assigning variable gq_complex"); + gq_complex = stan::math::sinh(p_complex); current_statement__ = 308; - stan::model::assign(gq_complex, stan::math::sinh(d_complex), - "assigning variable gq_complex"); + gq_complex = stan::math::sinh(d_complex); current_statement__ = 309; gq_i = stan::math::size(gq_complex_array); current_statement__ = 310; @@ -3131,14 +2960,11 @@ class complex_scalar_model final : public model_base_crtp current_statement__ = 311; gq_i = stan::math::size(d_complex_array); current_statement__ = 312; - stan::model::assign(gq_complex, stan::math::sqrt(z), - "assigning variable gq_complex"); + gq_complex = stan::math::sqrt(z); current_statement__ = 313; - stan::model::assign(gq_complex, stan::math::sqrt(p_complex), - "assigning variable gq_complex"); + gq_complex = stan::math::sqrt(p_complex); current_statement__ = 314; - stan::model::assign(gq_complex, stan::math::sqrt(d_complex), - "assigning variable gq_complex"); + gq_complex = stan::math::sqrt(d_complex); current_statement__ = 315; stan::model::assign(gq_complex_array, stan::math::tail(stan::model::deep_copy(gq_complex_array), 1), @@ -3152,76 +2978,54 @@ class complex_scalar_model final : public model_base_crtp stan::math::tail(d_complex_array, 1), "assigning variable gq_complex_array"); current_statement__ = 318; - stan::model::assign(gq_complex, stan::math::tan(z), - "assigning variable gq_complex"); + gq_complex = stan::math::tan(z); current_statement__ = 319; - stan::model::assign(gq_complex, stan::math::tan(p_complex), - "assigning variable gq_complex"); + gq_complex = stan::math::tan(p_complex); current_statement__ = 320; - stan::model::assign(gq_complex, stan::math::tan(d_complex), - "assigning variable gq_complex"); + gq_complex = stan::math::tan(d_complex); current_statement__ = 321; - stan::model::assign(gq_complex, stan::math::tanh(z), - "assigning variable gq_complex"); + gq_complex = stan::math::tanh(z); current_statement__ = 322; - stan::model::assign(gq_complex, stan::math::tanh(p_complex), - "assigning variable gq_complex"); + gq_complex = stan::math::tanh(p_complex); current_statement__ = 323; - stan::model::assign(gq_complex, stan::math::tanh(d_complex), - "assigning variable gq_complex"); + gq_complex = stan::math::tanh(d_complex); current_statement__ = 324; - stan::model::assign(gq_complex, stan::math::to_complex(), - "assigning variable gq_complex"); + gq_complex = stan::math::to_complex(); current_statement__ = 325; - stan::model::assign(gq_complex, stan::math::to_complex(gq_r, gq_r), - "assigning variable gq_complex"); + gq_complex = stan::math::to_complex(gq_r, gq_r); current_statement__ = 326; - stan::model::assign(gq_complex, stan::math::to_complex(gq_i, gq_i), - "assigning variable gq_complex"); + gq_complex = stan::math::to_complex(gq_i, gq_i); current_statement__ = 327; - stan::model::assign(gq_complex, stan::math::to_complex(gq_r, gq_i), - "assigning variable gq_complex"); + gq_complex = stan::math::to_complex(gq_r, gq_i); current_statement__ = 328; - stan::model::assign(gq_complex, stan::math::to_complex(gq_i, gq_r), - "assigning variable gq_complex"); + gq_complex = stan::math::to_complex(gq_i, gq_r); current_statement__ = 329; - stan::model::assign(gq_complex, stan::math::to_complex(gq_r), - "assigning variable gq_complex"); + gq_complex = stan::math::to_complex(gq_r); current_statement__ = 330; - stan::model::assign(gq_complex, stan::math::to_complex(gq_i), - "assigning variable gq_complex"); + gq_complex = stan::math::to_complex(gq_i); current_statement__ = 331; - stan::model::assign(gq_complex, stan::math::to_complex(p_r, gq_r), - "assigning variable gq_complex"); + gq_complex = stan::math::to_complex(p_r, gq_r); current_statement__ = 332; - stan::model::assign(gq_complex, stan::math::to_complex(p_r, d_r), - "assigning variable gq_complex"); + gq_complex = stan::math::to_complex(p_r, d_r); current_statement__ = 333; - stan::model::assign(gq_complex, stan::math::to_complex(d_r, gq_r), - "assigning variable gq_complex"); + gq_complex = stan::math::to_complex(d_r, gq_r); current_statement__ = 334; - stan::model::assign(gq_complex, stan::math::to_complex(p_r), - "assigning variable gq_complex"); + gq_complex = stan::math::to_complex(p_r); current_statement__ = 335; - stan::model::assign(gq_complex, stan::math::to_complex(d_r), - "assigning variable gq_complex"); + gq_complex = stan::math::to_complex(d_r); std::complex zi = std::complex(std::numeric_limits::quiet_NaN(), std::numeric_limits::quiet_NaN()); current_statement__ = 336; - stan::model::assign(zi, (1 + stan::math::to_complex(0, 3.14)), - "assigning variable zi"); + zi = (1 + stan::math::to_complex(0, 3.14)); current_statement__ = 337; - stan::model::assign(zi, - (stan::model::deep_copy(zi) * stan::math::to_complex(0, 0)), - "assigning variable zi"); + zi = (zi * stan::math::to_complex(0, 0)); std::complex yi = std::complex(std::numeric_limits::quiet_NaN(), std::numeric_limits::quiet_NaN()); current_statement__ = 338; - stan::model::assign(yi, - ((stan::math::to_complex(0, 1.1) + stan::math::to_complex(0.0, 2.2)) - + stan::math::to_complex()), "assigning variable yi"); + yi = ((stan::math::to_complex(0, 1.1) + + stan::math::to_complex(0.0, 2.2)) + stan::math::to_complex()); double x = std::numeric_limits::quiet_NaN(); current_statement__ = 339; x = stan::math::get_real( @@ -3269,8 +3073,7 @@ class complex_scalar_model final : public model_base_crtp out__.write(p_r); std::complex p_complex = std::complex(DUMMY_VAR__, DUMMY_VAR__); - stan::model::assign(p_complex, in__.read(), - "assigning variable p_complex"); + p_complex = in__.read(); out__.write(p_complex); std::vector> p_complex_array = std::vector>(2, @@ -5286,23 +5089,15 @@ class mixed_type_arrays_model final : public model_base_crtp(3, DUMMY_VAR__)); current_statement__ = 3; stan::model::assign(w, std::vector>{ - std::vector{ - stan::math::promote_scalar(1.0), - stan::math::promote_scalar(2), - stan::math::promote_scalar(3)}, xx, xx}, + std::vector{1.0, 2, 3}, xx, xx}, "assigning variable w"); std::vector> td_arr33 = std::vector>(3, std::vector(3, DUMMY_VAR__)); current_statement__ = 4; stan::model::assign(td_arr33, std::vector>{ - std::vector{stan::math::promote_scalar(1), - stan::math::promote_scalar(2), - stan::math::promote_scalar(3)}, std::vector{ - stan::math::promote_scalar(1), 2., - stan::math::promote_scalar(3)}, std::vector{1., 2., - stan::math::promote_scalar(3)}}, - "assigning variable td_arr33"); + std::vector{1, 2, 3}, std::vector{1, 2., 3}, + std::vector{1., 2., 3}}, "assigning variable td_arr33"); } catch (const std::exception& e) { stan::lang::rethrow_located(e, locations_array__[current_statement__]); } @@ -5360,20 +5155,12 @@ class mixed_type_arrays_model final : public model_base_crtp>{ - std::vector{ - stan::math::promote_scalar(1.0), - stan::math::promote_scalar(2), - stan::math::promote_scalar(3)}, xx, xx}, + std::vector{1.0, 2, 3}, xx, xx}, "assigning variable w"); current_statement__ = 4; stan::model::assign(td_arr33, std::vector>{ - std::vector{stan::math::promote_scalar(1), - stan::math::promote_scalar(2), - stan::math::promote_scalar(3)}, std::vector{ - stan::math::promote_scalar(1), 2., - stan::math::promote_scalar(3)}, std::vector{1., 2., - stan::math::promote_scalar(3)}}, - "assigning variable td_arr33"); + std::vector{1, 2, 3}, std::vector{1, 2., 3}, + std::vector{1., 2., 3}}, "assigning variable td_arr33"); if (emit_transformed_parameters__) { for (int sym1__ = 1; sym1__ <= 3; ++sym1__) { for (int sym2__ = 1; sym2__ <= 3; ++sym2__) { @@ -10676,7 +10463,7 @@ int foo_functor__::operator()(const int& n, std::ostream* pstream__) const current_statement__ = 363; - stan::model::assign(x_mul_ind, std::vector{1, 2}, + stan::model::assign(x_mul_ind, std::vector{1, 2}, "assigning variable x_mul_ind"); current_statement__ = 364; transformed_data_real = std::numeric_limits::quiet_NaN(); @@ -24307,14 +24094,11 @@ class overloading_templating_model final : public model_base_crtp(y, - foo(std::vector{stan::math::promote_scalar( - 1), 2.3}, pstream__), 1)); + foo(std::vector{1, 2.3}, pstream__), 1)); current_statement__ = 11; lp_accum__.add( stan::math::normal_lpdf(std::vector{5.5, 6.5}, - foo(std::vector{z, - stan::math::promote_scalar(2.3)}, pstream__), - 1)); + foo(std::vector{z, 2.3}, pstream__), 1)); } } catch (const std::exception& e) { stan::lang::rethrow_located(e, locations_array__[current_statement__]); @@ -25513,9 +25297,7 @@ ident_functor__::operator()(const std::complex& x, std::complex(std::numeric_limits::quiet_NaN(), std::numeric_limits::quiet_NaN()); current_statement__ = 2; - stan::model::assign(zi, - ident(stan::math::promote_scalar>(z), pstream__), - "assigning variable zi"); + zi = ident(stan::math::to_complex(z, 0), pstream__); std::vector zs = std::vector(4, std::numeric_limits::min()); current_statement__ = 3; diff --git a/test/integration/good/code-gen/expressions/cpp.expected b/test/integration/good/code-gen/expressions/cpp.expected index fae4c44fbc..e34627528a 100644 --- a/test/integration/good/code-gen/expressions/cpp.expected +++ b/test/integration/good/code-gen/expressions/cpp.expected @@ -663,19 +663,16 @@ class ternary_if_model final : public model_base_crtp { std::complex z = std::complex(DUMMY_VAR__, DUMMY_VAR__); current_statement__ = 7; - stan::model::assign(z, - (1 ? stan::math::to_complex(0, 3) : - stan::math::promote_scalar>(2)), - "assigning variable z"); + z = (1 ? stan::math::to_complex(0, 3) : stan::math::to_complex(2, 0)); { std::complex z2 = std::complex(DUMMY_VAR__, DUMMY_VAR__); current_statement__ = 8; z2 = (1 ? r : 2); current_statement__ = 9; - stan::model::assign(z2, - (1 ? stan::math::promote_scalar>(0) - : zp), "assigning variable z2"); + z2 = (1 ? + stan::math::promote_scalar>(0) + : zp); } } catch (const std::exception& e) { stan::lang::rethrow_located(e, locations_array__[current_statement__]); @@ -758,10 +755,7 @@ class ternary_if_model final : public model_base_crtp { stan::math::eval(stan::math::multiply(2, a))), "assigning variable d"); current_statement__ = 7; - stan::model::assign(z, - (1 ? stan::math::to_complex(0, 3) : - stan::math::promote_scalar>(2)), - "assigning variable z"); + z = (1 ? stan::math::to_complex(0, 3) : stan::math::to_complex(2, 0)); if (emit_transformed_parameters__) { out__.write(c); out__.write(d); @@ -809,8 +803,7 @@ class ternary_if_model final : public model_base_crtp { out__.write(r); std::complex zp = std::complex(DUMMY_VAR__, DUMMY_VAR__); - stan::model::assign(zp, in__.read(), - "assigning variable zp"); + zp = in__.read(); out__.write(zp); } catch (const std::exception& e) { stan::lang::rethrow_located(e, locations_array__[current_statement__]); diff --git a/test/integration/good/code-gen/mir.expected b/test/integration/good/code-gen/mir.expected index 735716c9d5..05b05d80f8 100644 --- a/test/integration/good/code-gen/mir.expected +++ b/test/integration/good/code-gen/mir.expected @@ -733,9 +733,15 @@ (meta )) ((pattern (Assignment (z UReal ()) - ((pattern (Lit Int 0)) + ((pattern + (Promotion + ((pattern (Lit Int 0)) + (meta + ((type_ UInt) (loc ) + (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) + ((type_ UReal) (loc ) (adlevel DataOnly)))))) (meta )) ((pattern Break) (meta ))))) @@ -899,9 +905,15 @@ (meta )) ((pattern (Assignment (z UReal ()) - ((pattern (Lit Int 0)) + ((pattern + (Promotion + ((pattern (Lit Int 0)) + (meta + ((type_ UInt) (loc ) + (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) + ((type_ UReal) (loc ) (adlevel DataOnly)))))) (meta )) ((pattern Break) (meta ))))) @@ -1025,9 +1037,15 @@ (meta )) ((pattern (Assignment (z UReal ()) - ((pattern (Lit Int 0)) + ((pattern + (Promotion + ((pattern (Lit Int 0)) + (meta + ((type_ UInt) (loc ) + (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) + ((type_ UReal) (loc ) (adlevel DataOnly)))))) (meta )) ((pattern Break) (meta ))))) @@ -1414,15 +1432,30 @@ (FunApp (StanLib Transpose__ FnPlain AoS) (((pattern (FunApp (CompilerInternal FnMakeRowVec) - (((pattern (Lit Int 1)) + (((pattern + (Promotion + ((pattern (Lit Int 1)) + (meta + ((type_ UInt) (loc ) (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))) - ((pattern (Lit Int 2)) + ((type_ UReal) (loc ) (adlevel DataOnly)))) + ((pattern + (Promotion + ((pattern (Lit Int 2)) + (meta + ((type_ UInt) (loc ) (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))) - ((pattern (Lit Int 3)) + ((type_ UReal) (loc ) (adlevel DataOnly)))) + ((pattern + (Promotion + ((pattern (Lit Int 3)) + (meta + ((type_ UInt) (loc ) (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly))))))) + ((type_ UReal) (loc ) (adlevel DataOnly))))))) (meta ((type_ URowVector) (loc ) (adlevel DataOnly))))))) (meta ((type_ UVector) (loc ) (adlevel DataOnly))))))) @@ -1903,104 +1936,254 @@ (FunApp (CompilerInternal FnMakeRowVec) (((pattern (FunApp (CompilerInternal FnMakeRowVec) - (((pattern (Lit Int 1)) + (((pattern + (Promotion + ((pattern (Lit Int 1)) + (meta + ((type_ UInt) (loc ) (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))) - ((pattern (Lit Int 2)) + ((type_ UReal) (loc ) (adlevel DataOnly)))) + ((pattern + (Promotion + ((pattern (Lit Int 2)) + (meta + ((type_ UInt) (loc ) (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))) - ((pattern (Lit Int 3)) + ((type_ UReal) (loc ) (adlevel DataOnly)))) + ((pattern + (Promotion + ((pattern (Lit Int 3)) + (meta + ((type_ UInt) (loc ) (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))) - ((pattern (Lit Int 4)) + ((type_ UReal) (loc ) (adlevel DataOnly)))) + ((pattern + (Promotion + ((pattern (Lit Int 4)) + (meta + ((type_ UInt) (loc ) (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))) - ((pattern (Lit Int 5)) + ((type_ UReal) (loc ) (adlevel DataOnly)))) + ((pattern + (Promotion + ((pattern (Lit Int 5)) + (meta + ((type_ UInt) (loc ) (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))) - ((pattern (Lit Int 6)) + ((type_ UReal) (loc ) (adlevel DataOnly)))) + ((pattern + (Promotion + ((pattern (Lit Int 6)) + (meta + ((type_ UInt) (loc ) (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))) - ((pattern (Lit Int 7)) + ((type_ UReal) (loc ) (adlevel DataOnly)))) + ((pattern + (Promotion + ((pattern (Lit Int 7)) + (meta + ((type_ UInt) (loc ) (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))) - ((pattern (Lit Int 8)) + ((type_ UReal) (loc ) (adlevel DataOnly)))) + ((pattern + (Promotion + ((pattern (Lit Int 8)) + (meta + ((type_ UInt) (loc ) (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))) - ((pattern (Lit Int 9)) + ((type_ UReal) (loc ) (adlevel DataOnly)))) + ((pattern + (Promotion + ((pattern (Lit Int 9)) + (meta + ((type_ UInt) (loc ) (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))) - ((pattern (Lit Int 10)) + ((type_ UReal) (loc ) (adlevel DataOnly)))) + ((pattern + (Promotion + ((pattern (Lit Int 10)) + (meta + ((type_ UInt) (loc ) (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly))))))) + ((type_ UReal) (loc ) (adlevel DataOnly))))))) (meta ((type_ URowVector) (loc ) (adlevel DataOnly)))) ((pattern (FunApp (CompilerInternal FnMakeRowVec) - (((pattern (Lit Int 1)) + (((pattern + (Promotion + ((pattern (Lit Int 1)) + (meta + ((type_ UInt) (loc ) (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))) - ((pattern (Lit Int 2)) + ((type_ UReal) (loc ) (adlevel DataOnly)))) + ((pattern + (Promotion + ((pattern (Lit Int 2)) + (meta + ((type_ UInt) (loc ) (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))) - ((pattern (Lit Int 3)) + ((type_ UReal) (loc ) (adlevel DataOnly)))) + ((pattern + (Promotion + ((pattern (Lit Int 3)) + (meta + ((type_ UInt) (loc ) (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))) - ((pattern (Lit Int 4)) + ((type_ UReal) (loc ) (adlevel DataOnly)))) + ((pattern + (Promotion + ((pattern (Lit Int 4)) + (meta + ((type_ UInt) (loc ) (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))) - ((pattern (Lit Int 5)) + ((type_ UReal) (loc ) (adlevel DataOnly)))) + ((pattern + (Promotion + ((pattern (Lit Int 5)) + (meta + ((type_ UInt) (loc ) (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))) - ((pattern (Lit Int 6)) + ((type_ UReal) (loc ) (adlevel DataOnly)))) + ((pattern + (Promotion + ((pattern (Lit Int 6)) + (meta + ((type_ UInt) (loc ) (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))) - ((pattern (Lit Int 7)) + ((type_ UReal) (loc ) (adlevel DataOnly)))) + ((pattern + (Promotion + ((pattern (Lit Int 7)) + (meta + ((type_ UInt) (loc ) (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))) - ((pattern (Lit Int 8)) + ((type_ UReal) (loc ) (adlevel DataOnly)))) + ((pattern + (Promotion + ((pattern (Lit Int 8)) + (meta + ((type_ UInt) (loc ) (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))) - ((pattern (Lit Int 9)) + ((type_ UReal) (loc ) (adlevel DataOnly)))) + ((pattern + (Promotion + ((pattern (Lit Int 9)) + (meta + ((type_ UInt) (loc ) (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))) - ((pattern (Lit Int 10)) + ((type_ UReal) (loc ) (adlevel DataOnly)))) + ((pattern + (Promotion + ((pattern (Lit Int 10)) + (meta + ((type_ UInt) (loc ) (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly))))))) + ((type_ UReal) (loc ) (adlevel DataOnly))))))) (meta ((type_ URowVector) (loc ) (adlevel DataOnly)))) ((pattern (FunApp (CompilerInternal FnMakeRowVec) - (((pattern (Lit Int 1)) + (((pattern + (Promotion + ((pattern (Lit Int 1)) + (meta + ((type_ UInt) (loc ) (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))) - ((pattern (Lit Int 2)) + ((type_ UReal) (loc ) (adlevel DataOnly)))) + ((pattern + (Promotion + ((pattern (Lit Int 2)) + (meta + ((type_ UInt) (loc ) (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))) - ((pattern (Lit Int 3)) + ((type_ UReal) (loc ) (adlevel DataOnly)))) + ((pattern + (Promotion + ((pattern (Lit Int 3)) + (meta + ((type_ UInt) (loc ) (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))) - ((pattern (Lit Int 4)) + ((type_ UReal) (loc ) (adlevel DataOnly)))) + ((pattern + (Promotion + ((pattern (Lit Int 4)) + (meta + ((type_ UInt) (loc ) (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))) - ((pattern (Lit Int 5)) + ((type_ UReal) (loc ) (adlevel DataOnly)))) + ((pattern + (Promotion + ((pattern (Lit Int 5)) + (meta + ((type_ UInt) (loc ) (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))) - ((pattern (Lit Int 6)) + ((type_ UReal) (loc ) (adlevel DataOnly)))) + ((pattern + (Promotion + ((pattern (Lit Int 6)) + (meta + ((type_ UInt) (loc ) (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))) - ((pattern (Lit Int 7)) + ((type_ UReal) (loc ) (adlevel DataOnly)))) + ((pattern + (Promotion + ((pattern (Lit Int 7)) + (meta + ((type_ UInt) (loc ) (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))) - ((pattern (Lit Int 8)) + ((type_ UReal) (loc ) (adlevel DataOnly)))) + ((pattern + (Promotion + ((pattern (Lit Int 8)) + (meta + ((type_ UInt) (loc ) (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))) - ((pattern (Lit Int 9)) + ((type_ UReal) (loc ) (adlevel DataOnly)))) + ((pattern + (Promotion + ((pattern (Lit Int 9)) + (meta + ((type_ UInt) (loc ) (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))) - ((pattern (Lit Int 10)) + ((type_ UReal) (loc ) (adlevel DataOnly)))) + ((pattern + (Promotion + ((pattern (Lit Int 10)) + (meta + ((type_ UInt) (loc ) (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly))))))) + ((type_ UReal) (loc ) (adlevel DataOnly))))))) (meta ((type_ URowVector) (loc ) (adlevel DataOnly))))))) (meta ((type_ UMatrix) (loc ) (adlevel DataOnly))))))) @@ -2017,36 +2200,86 @@ (FunApp (StanLib Transpose__ FnPlain AoS) (((pattern (FunApp (CompilerInternal FnMakeRowVec) - (((pattern (Lit Int 1)) + (((pattern + (Promotion + ((pattern (Lit Int 1)) + (meta + ((type_ UInt) (loc ) (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))) - ((pattern (Lit Int 2)) + ((type_ UReal) (loc ) (adlevel DataOnly)))) + ((pattern + (Promotion + ((pattern (Lit Int 2)) + (meta + ((type_ UInt) (loc ) (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))) - ((pattern (Lit Int 3)) + ((type_ UReal) (loc ) (adlevel DataOnly)))) + ((pattern + (Promotion + ((pattern (Lit Int 3)) + (meta + ((type_ UInt) (loc ) (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))) - ((pattern (Lit Int 4)) + ((type_ UReal) (loc ) (adlevel DataOnly)))) + ((pattern + (Promotion + ((pattern (Lit Int 4)) + (meta + ((type_ UInt) (loc ) (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))) - ((pattern (Lit Int 5)) + ((type_ UReal) (loc ) (adlevel DataOnly)))) + ((pattern + (Promotion + ((pattern (Lit Int 5)) + (meta + ((type_ UInt) (loc ) (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))) - ((pattern (Lit Int 6)) + ((type_ UReal) (loc ) (adlevel DataOnly)))) + ((pattern + (Promotion + ((pattern (Lit Int 6)) + (meta + ((type_ UInt) (loc ) (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))) - ((pattern (Lit Int 7)) + ((type_ UReal) (loc ) (adlevel DataOnly)))) + ((pattern + (Promotion + ((pattern (Lit Int 7)) + (meta + ((type_ UInt) (loc ) (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))) - ((pattern (Lit Int 8)) + ((type_ UReal) (loc ) (adlevel DataOnly)))) + ((pattern + (Promotion + ((pattern (Lit Int 8)) + (meta + ((type_ UInt) (loc ) (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))) - ((pattern (Lit Int 9)) + ((type_ UReal) (loc ) (adlevel DataOnly)))) + ((pattern + (Promotion + ((pattern (Lit Int 9)) + (meta + ((type_ UInt) (loc ) (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))) - ((pattern (Lit Int 10)) + ((type_ UReal) (loc ) (adlevel DataOnly)))) + ((pattern + (Promotion + ((pattern (Lit Int 10)) + (meta + ((type_ UInt) (loc ) (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly))))))) + ((type_ UReal) (loc ) (adlevel DataOnly))))))) (meta ((type_ URowVector) (loc ) (adlevel DataOnly))))))) (meta ((type_ UVector) (loc ) (adlevel DataOnly))))))) @@ -2110,36 +2343,96 @@ (FunApp (StanLib Transpose__ FnPlain AoS) (((pattern (FunApp (CompilerInternal FnMakeRowVec) - (((pattern (Lit Int 1)) + (((pattern + (Promotion + ((pattern (Lit Int 1)) + (meta + ((type_ UInt) (loc ) + (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))) - ((pattern (Lit Int 2)) + ((type_ UReal) (loc ) (adlevel DataOnly)))) + ((pattern + (Promotion + ((pattern (Lit Int 2)) + (meta + ((type_ UInt) (loc ) + (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))) - ((pattern (Lit Int 3)) + ((type_ UReal) (loc ) (adlevel DataOnly)))) + ((pattern + (Promotion + ((pattern (Lit Int 3)) + (meta + ((type_ UInt) (loc ) + (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))) - ((pattern (Lit Int 4)) + ((type_ UReal) (loc ) (adlevel DataOnly)))) + ((pattern + (Promotion + ((pattern (Lit Int 4)) + (meta + ((type_ UInt) (loc ) + (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))) - ((pattern (Lit Int 5)) + ((type_ UReal) (loc ) (adlevel DataOnly)))) + ((pattern + (Promotion + ((pattern (Lit Int 5)) + (meta + ((type_ UInt) (loc ) + (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))) - ((pattern (Lit Int 6)) + ((type_ UReal) (loc ) (adlevel DataOnly)))) + ((pattern + (Promotion + ((pattern (Lit Int 6)) + (meta + ((type_ UInt) (loc ) + (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))) - ((pattern (Lit Int 7)) + ((type_ UReal) (loc ) (adlevel DataOnly)))) + ((pattern + (Promotion + ((pattern (Lit Int 7)) + (meta + ((type_ UInt) (loc ) + (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))) - ((pattern (Lit Int 8)) + ((type_ UReal) (loc ) (adlevel DataOnly)))) + ((pattern + (Promotion + ((pattern (Lit Int 8)) + (meta + ((type_ UInt) (loc ) + (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))) - ((pattern (Lit Int 9)) + ((type_ UReal) (loc ) (adlevel DataOnly)))) + ((pattern + (Promotion + ((pattern (Lit Int 9)) + (meta + ((type_ UInt) (loc ) + (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))) - ((pattern (Lit Int 10)) + ((type_ UReal) (loc ) (adlevel DataOnly)))) + ((pattern + (Promotion + ((pattern (Lit Int 10)) + (meta + ((type_ UInt) (loc ) + (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly))))))) + ((type_ UReal) (loc ) (adlevel DataOnly))))))) (meta ((type_ URowVector) (loc ) (adlevel DataOnly))))))) (meta ((type_ UVector) (loc ) (adlevel DataOnly))))))) @@ -4544,9 +4837,14 @@ (meta )) ((pattern (Assignment (z UReal ()) - ((pattern (Lit Int 0)) + ((pattern + (Promotion + ((pattern (Lit Int 0)) + (meta + ((type_ UInt) (loc ) (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))))) + ((type_ UReal) (loc ) (adlevel DataOnly)))))) (meta ))))) (meta ))))) (meta ))))) @@ -4635,9 +4933,15 @@ (meta )) ((pattern (Assignment (z UReal ()) - ((pattern (Var i)) + ((pattern + (Promotion + ((pattern (Var i)) + (meta + ((type_ UInt) (loc ) + (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))))) + ((type_ UReal) (loc ) (adlevel DataOnly)))))) (meta ))))) (meta ))))) (meta ))))) @@ -4736,14 +5040,22 @@ (initialize true))) (meta )) ((pattern - (Assignment (x_mul_ind (UArray UInt) ()) + (Assignment (x_mul_ind (UArray UReal) ()) ((pattern (FunApp (CompilerInternal FnMakeArray) - (((pattern (Lit Int 1)) - (meta ((type_ UInt) (loc ) (adlevel DataOnly)))) - ((pattern (Lit Int 2)) - (meta ((type_ UInt) (loc ) (adlevel DataOnly))))))) - (meta ((type_ (UArray UInt)) (loc ) (adlevel DataOnly)))))) + (((pattern + (Promotion + ((pattern (Lit Int 1)) + (meta ((type_ UInt) (loc ) (adlevel DataOnly)))) + UReal DataOnly)) + (meta ((type_ UReal) (loc ) (adlevel DataOnly)))) + ((pattern + (Promotion + ((pattern (Lit Int 2)) + (meta ((type_ UInt) (loc ) (adlevel DataOnly)))) + UReal DataOnly)) + (meta ((type_ UReal) (loc ) (adlevel DataOnly))))))) + (meta ((type_ (UArray UReal)) (loc ) (adlevel DataOnly)))))) (meta )) ((pattern (Decl (decl_adtype DataOnly) (decl_id transformed_data_real) diff --git a/test/integration/good/code-gen/transformed_mir.expected b/test/integration/good/code-gen/transformed_mir.expected index d3505b9f4a..5683bee7ef 100644 --- a/test/integration/good/code-gen/transformed_mir.expected +++ b/test/integration/good/code-gen/transformed_mir.expected @@ -751,9 +751,15 @@ (meta )) ((pattern (Assignment (z UReal ()) - ((pattern (Lit Int 0)) + ((pattern + (Promotion + ((pattern (Lit Int 0)) + (meta + ((type_ UInt) (loc ) + (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) + ((type_ UReal) (loc ) (adlevel DataOnly)))))) (meta )) ((pattern Break) (meta ))))) @@ -917,9 +923,15 @@ (meta )) ((pattern (Assignment (z UReal ()) - ((pattern (Lit Int 0)) + ((pattern + (Promotion + ((pattern (Lit Int 0)) + (meta + ((type_ UInt) (loc ) + (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) + ((type_ UReal) (loc ) (adlevel DataOnly)))))) (meta )) ((pattern Break) (meta ))))) @@ -1043,9 +1055,15 @@ (meta )) ((pattern (Assignment (z UReal ()) - ((pattern (Lit Int 0)) + ((pattern + (Promotion + ((pattern (Lit Int 0)) + (meta + ((type_ UInt) (loc ) + (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) + ((type_ UReal) (loc ) (adlevel DataOnly)))))) (meta )) ((pattern Break) (meta ))))) @@ -1446,15 +1464,30 @@ (FunApp (StanLib Transpose__ FnPlain AoS) (((pattern (FunApp (CompilerInternal FnMakeRowVec) - (((pattern (Lit Int 1)) + (((pattern + (Promotion + ((pattern (Lit Int 1)) + (meta + ((type_ UInt) (loc ) (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))) - ((pattern (Lit Int 2)) + ((type_ UReal) (loc ) (adlevel DataOnly)))) + ((pattern + (Promotion + ((pattern (Lit Int 2)) + (meta + ((type_ UInt) (loc ) (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))) - ((pattern (Lit Int 3)) + ((type_ UReal) (loc ) (adlevel DataOnly)))) + ((pattern + (Promotion + ((pattern (Lit Int 3)) + (meta + ((type_ UInt) (loc ) (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly))))))) + ((type_ UReal) (loc ) (adlevel DataOnly))))))) (meta ((type_ URowVector) (loc ) (adlevel DataOnly))))))) (meta ((type_ UVector) (loc ) (adlevel DataOnly))))))) @@ -1935,104 +1968,254 @@ (FunApp (CompilerInternal FnMakeRowVec) (((pattern (FunApp (CompilerInternal FnMakeRowVec) - (((pattern (Lit Int 1)) + (((pattern + (Promotion + ((pattern (Lit Int 1)) + (meta + ((type_ UInt) (loc ) (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))) - ((pattern (Lit Int 2)) + ((type_ UReal) (loc ) (adlevel DataOnly)))) + ((pattern + (Promotion + ((pattern (Lit Int 2)) + (meta + ((type_ UInt) (loc ) (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))) - ((pattern (Lit Int 3)) + ((type_ UReal) (loc ) (adlevel DataOnly)))) + ((pattern + (Promotion + ((pattern (Lit Int 3)) + (meta + ((type_ UInt) (loc ) (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))) - ((pattern (Lit Int 4)) + ((type_ UReal) (loc ) (adlevel DataOnly)))) + ((pattern + (Promotion + ((pattern (Lit Int 4)) + (meta + ((type_ UInt) (loc ) (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))) - ((pattern (Lit Int 5)) + ((type_ UReal) (loc ) (adlevel DataOnly)))) + ((pattern + (Promotion + ((pattern (Lit Int 5)) + (meta + ((type_ UInt) (loc ) (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))) - ((pattern (Lit Int 6)) + ((type_ UReal) (loc ) (adlevel DataOnly)))) + ((pattern + (Promotion + ((pattern (Lit Int 6)) + (meta + ((type_ UInt) (loc ) (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))) - ((pattern (Lit Int 7)) + ((type_ UReal) (loc ) (adlevel DataOnly)))) + ((pattern + (Promotion + ((pattern (Lit Int 7)) + (meta + ((type_ UInt) (loc ) (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))) - ((pattern (Lit Int 8)) + ((type_ UReal) (loc ) (adlevel DataOnly)))) + ((pattern + (Promotion + ((pattern (Lit Int 8)) + (meta + ((type_ UInt) (loc ) (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))) - ((pattern (Lit Int 9)) + ((type_ UReal) (loc ) (adlevel DataOnly)))) + ((pattern + (Promotion + ((pattern (Lit Int 9)) + (meta + ((type_ UInt) (loc ) (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))) - ((pattern (Lit Int 10)) + ((type_ UReal) (loc ) (adlevel DataOnly)))) + ((pattern + (Promotion + ((pattern (Lit Int 10)) + (meta + ((type_ UInt) (loc ) (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly))))))) + ((type_ UReal) (loc ) (adlevel DataOnly))))))) (meta ((type_ URowVector) (loc ) (adlevel DataOnly)))) ((pattern (FunApp (CompilerInternal FnMakeRowVec) - (((pattern (Lit Int 1)) + (((pattern + (Promotion + ((pattern (Lit Int 1)) + (meta + ((type_ UInt) (loc ) (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))) - ((pattern (Lit Int 2)) + ((type_ UReal) (loc ) (adlevel DataOnly)))) + ((pattern + (Promotion + ((pattern (Lit Int 2)) + (meta + ((type_ UInt) (loc ) (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))) - ((pattern (Lit Int 3)) + ((type_ UReal) (loc ) (adlevel DataOnly)))) + ((pattern + (Promotion + ((pattern (Lit Int 3)) + (meta + ((type_ UInt) (loc ) (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))) - ((pattern (Lit Int 4)) + ((type_ UReal) (loc ) (adlevel DataOnly)))) + ((pattern + (Promotion + ((pattern (Lit Int 4)) + (meta + ((type_ UInt) (loc ) (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))) - ((pattern (Lit Int 5)) + ((type_ UReal) (loc ) (adlevel DataOnly)))) + ((pattern + (Promotion + ((pattern (Lit Int 5)) + (meta + ((type_ UInt) (loc ) (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))) - ((pattern (Lit Int 6)) + ((type_ UReal) (loc ) (adlevel DataOnly)))) + ((pattern + (Promotion + ((pattern (Lit Int 6)) + (meta + ((type_ UInt) (loc ) (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))) - ((pattern (Lit Int 7)) + ((type_ UReal) (loc ) (adlevel DataOnly)))) + ((pattern + (Promotion + ((pattern (Lit Int 7)) + (meta + ((type_ UInt) (loc ) (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))) - ((pattern (Lit Int 8)) + ((type_ UReal) (loc ) (adlevel DataOnly)))) + ((pattern + (Promotion + ((pattern (Lit Int 8)) + (meta + ((type_ UInt) (loc ) (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))) - ((pattern (Lit Int 9)) + ((type_ UReal) (loc ) (adlevel DataOnly)))) + ((pattern + (Promotion + ((pattern (Lit Int 9)) + (meta + ((type_ UInt) (loc ) (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))) - ((pattern (Lit Int 10)) + ((type_ UReal) (loc ) (adlevel DataOnly)))) + ((pattern + (Promotion + ((pattern (Lit Int 10)) + (meta + ((type_ UInt) (loc ) (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly))))))) + ((type_ UReal) (loc ) (adlevel DataOnly))))))) (meta ((type_ URowVector) (loc ) (adlevel DataOnly)))) ((pattern (FunApp (CompilerInternal FnMakeRowVec) - (((pattern (Lit Int 1)) + (((pattern + (Promotion + ((pattern (Lit Int 1)) + (meta + ((type_ UInt) (loc ) (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))) - ((pattern (Lit Int 2)) + ((type_ UReal) (loc ) (adlevel DataOnly)))) + ((pattern + (Promotion + ((pattern (Lit Int 2)) + (meta + ((type_ UInt) (loc ) (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))) - ((pattern (Lit Int 3)) + ((type_ UReal) (loc ) (adlevel DataOnly)))) + ((pattern + (Promotion + ((pattern (Lit Int 3)) + (meta + ((type_ UInt) (loc ) (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))) - ((pattern (Lit Int 4)) + ((type_ UReal) (loc ) (adlevel DataOnly)))) + ((pattern + (Promotion + ((pattern (Lit Int 4)) + (meta + ((type_ UInt) (loc ) (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))) - ((pattern (Lit Int 5)) + ((type_ UReal) (loc ) (adlevel DataOnly)))) + ((pattern + (Promotion + ((pattern (Lit Int 5)) + (meta + ((type_ UInt) (loc ) (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))) - ((pattern (Lit Int 6)) + ((type_ UReal) (loc ) (adlevel DataOnly)))) + ((pattern + (Promotion + ((pattern (Lit Int 6)) + (meta + ((type_ UInt) (loc ) (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))) - ((pattern (Lit Int 7)) + ((type_ UReal) (loc ) (adlevel DataOnly)))) + ((pattern + (Promotion + ((pattern (Lit Int 7)) + (meta + ((type_ UInt) (loc ) (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))) - ((pattern (Lit Int 8)) + ((type_ UReal) (loc ) (adlevel DataOnly)))) + ((pattern + (Promotion + ((pattern (Lit Int 8)) + (meta + ((type_ UInt) (loc ) (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))) - ((pattern (Lit Int 9)) + ((type_ UReal) (loc ) (adlevel DataOnly)))) + ((pattern + (Promotion + ((pattern (Lit Int 9)) + (meta + ((type_ UInt) (loc ) (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))) - ((pattern (Lit Int 10)) + ((type_ UReal) (loc ) (adlevel DataOnly)))) + ((pattern + (Promotion + ((pattern (Lit Int 10)) + (meta + ((type_ UInt) (loc ) (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly))))))) + ((type_ UReal) (loc ) (adlevel DataOnly))))))) (meta ((type_ URowVector) (loc ) (adlevel DataOnly))))))) (meta ((type_ UMatrix) (loc ) (adlevel DataOnly))))))) @@ -2049,36 +2232,86 @@ (FunApp (StanLib Transpose__ FnPlain AoS) (((pattern (FunApp (CompilerInternal FnMakeRowVec) - (((pattern (Lit Int 1)) + (((pattern + (Promotion + ((pattern (Lit Int 1)) + (meta + ((type_ UInt) (loc ) (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))) - ((pattern (Lit Int 2)) + ((type_ UReal) (loc ) (adlevel DataOnly)))) + ((pattern + (Promotion + ((pattern (Lit Int 2)) + (meta + ((type_ UInt) (loc ) (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))) - ((pattern (Lit Int 3)) + ((type_ UReal) (loc ) (adlevel DataOnly)))) + ((pattern + (Promotion + ((pattern (Lit Int 3)) + (meta + ((type_ UInt) (loc ) (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))) - ((pattern (Lit Int 4)) + ((type_ UReal) (loc ) (adlevel DataOnly)))) + ((pattern + (Promotion + ((pattern (Lit Int 4)) + (meta + ((type_ UInt) (loc ) (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))) - ((pattern (Lit Int 5)) + ((type_ UReal) (loc ) (adlevel DataOnly)))) + ((pattern + (Promotion + ((pattern (Lit Int 5)) + (meta + ((type_ UInt) (loc ) (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))) - ((pattern (Lit Int 6)) + ((type_ UReal) (loc ) (adlevel DataOnly)))) + ((pattern + (Promotion + ((pattern (Lit Int 6)) + (meta + ((type_ UInt) (loc ) (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))) - ((pattern (Lit Int 7)) + ((type_ UReal) (loc ) (adlevel DataOnly)))) + ((pattern + (Promotion + ((pattern (Lit Int 7)) + (meta + ((type_ UInt) (loc ) (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))) - ((pattern (Lit Int 8)) + ((type_ UReal) (loc ) (adlevel DataOnly)))) + ((pattern + (Promotion + ((pattern (Lit Int 8)) + (meta + ((type_ UInt) (loc ) (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))) - ((pattern (Lit Int 9)) + ((type_ UReal) (loc ) (adlevel DataOnly)))) + ((pattern + (Promotion + ((pattern (Lit Int 9)) + (meta + ((type_ UInt) (loc ) (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))) - ((pattern (Lit Int 10)) + ((type_ UReal) (loc ) (adlevel DataOnly)))) + ((pattern + (Promotion + ((pattern (Lit Int 10)) + (meta + ((type_ UInt) (loc ) (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly))))))) + ((type_ UReal) (loc ) (adlevel DataOnly))))))) (meta ((type_ URowVector) (loc ) (adlevel DataOnly))))))) (meta ((type_ UVector) (loc ) (adlevel DataOnly))))))) @@ -2142,36 +2375,96 @@ (FunApp (StanLib Transpose__ FnPlain AoS) (((pattern (FunApp (CompilerInternal FnMakeRowVec) - (((pattern (Lit Int 1)) + (((pattern + (Promotion + ((pattern (Lit Int 1)) + (meta + ((type_ UInt) (loc ) + (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))) - ((pattern (Lit Int 2)) + ((type_ UReal) (loc ) (adlevel DataOnly)))) + ((pattern + (Promotion + ((pattern (Lit Int 2)) + (meta + ((type_ UInt) (loc ) + (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))) - ((pattern (Lit Int 3)) + ((type_ UReal) (loc ) (adlevel DataOnly)))) + ((pattern + (Promotion + ((pattern (Lit Int 3)) + (meta + ((type_ UInt) (loc ) + (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))) - ((pattern (Lit Int 4)) + ((type_ UReal) (loc ) (adlevel DataOnly)))) + ((pattern + (Promotion + ((pattern (Lit Int 4)) + (meta + ((type_ UInt) (loc ) + (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))) - ((pattern (Lit Int 5)) + ((type_ UReal) (loc ) (adlevel DataOnly)))) + ((pattern + (Promotion + ((pattern (Lit Int 5)) + (meta + ((type_ UInt) (loc ) + (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))) - ((pattern (Lit Int 6)) + ((type_ UReal) (loc ) (adlevel DataOnly)))) + ((pattern + (Promotion + ((pattern (Lit Int 6)) + (meta + ((type_ UInt) (loc ) + (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))) - ((pattern (Lit Int 7)) + ((type_ UReal) (loc ) (adlevel DataOnly)))) + ((pattern + (Promotion + ((pattern (Lit Int 7)) + (meta + ((type_ UInt) (loc ) + (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))) - ((pattern (Lit Int 8)) + ((type_ UReal) (loc ) (adlevel DataOnly)))) + ((pattern + (Promotion + ((pattern (Lit Int 8)) + (meta + ((type_ UInt) (loc ) + (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))) - ((pattern (Lit Int 9)) + ((type_ UReal) (loc ) (adlevel DataOnly)))) + ((pattern + (Promotion + ((pattern (Lit Int 9)) + (meta + ((type_ UInt) (loc ) + (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))) - ((pattern (Lit Int 10)) + ((type_ UReal) (loc ) (adlevel DataOnly)))) + ((pattern + (Promotion + ((pattern (Lit Int 10)) + (meta + ((type_ UInt) (loc ) + (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly))))))) + ((type_ UReal) (loc ) (adlevel DataOnly))))))) (meta ((type_ URowVector) (loc ) (adlevel DataOnly))))))) (meta ((type_ UVector) (loc ) (adlevel DataOnly))))))) @@ -7951,9 +8244,14 @@ (meta )) ((pattern (Assignment (z UReal ()) - ((pattern (Lit Int 0)) + ((pattern + (Promotion + ((pattern (Lit Int 0)) + (meta + ((type_ UInt) (loc ) (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))))) + ((type_ UReal) (loc ) (adlevel DataOnly)))))) (meta ))))) (meta ))))) (meta ))))) @@ -8042,9 +8340,15 @@ (meta )) ((pattern (Assignment (z UReal ()) - ((pattern (Var i)) + ((pattern + (Promotion + ((pattern (Var i)) + (meta + ((type_ UInt) (loc ) + (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))))) + ((type_ UReal) (loc ) (adlevel DataOnly)))))) (meta ))))) (meta ))))) (meta ))))) @@ -8143,14 +8447,22 @@ (initialize true))) (meta )) ((pattern - (Assignment (x_mul_ind (UArray UInt) ()) + (Assignment (x_mul_ind (UArray UReal) ()) ((pattern (FunApp (CompilerInternal FnMakeArray) - (((pattern (Lit Int 1)) - (meta ((type_ UInt) (loc ) (adlevel DataOnly)))) - ((pattern (Lit Int 2)) - (meta ((type_ UInt) (loc ) (adlevel DataOnly))))))) - (meta ((type_ (UArray UInt)) (loc ) (adlevel DataOnly)))))) + (((pattern + (Promotion + ((pattern (Lit Int 1)) + (meta ((type_ UInt) (loc ) (adlevel DataOnly)))) + UReal DataOnly)) + (meta ((type_ UReal) (loc ) (adlevel DataOnly)))) + ((pattern + (Promotion + ((pattern (Lit Int 2)) + (meta ((type_ UInt) (loc ) (adlevel DataOnly)))) + UReal DataOnly)) + (meta ((type_ UReal) (loc ) (adlevel DataOnly))))))) + (meta ((type_ (UArray UReal)) (loc ) (adlevel DataOnly)))))) (meta )) ((pattern (Decl (decl_adtype DataOnly) (decl_id transformed_data_real) diff --git a/test/integration/good/compiler-optimizations/cpp.expected b/test/integration/good/compiler-optimizations/cpp.expected index d32566c370..9de3abbf2c 100644 --- a/test/integration/good/compiler-optimizations/cpp.expected +++ b/test/integration/good/compiler-optimizations/cpp.expected @@ -2103,6 +2103,8 @@ simple_SIR_functor__::operator()(const T0__& t, const std::vector& y, class ad_level_failing_model final : public model_base_crtp { private: + double lcm_sym26__; + double lcm_sym25__; int N_t; std::vector t; std::vector y0; @@ -2137,6 +2139,8 @@ class ad_level_failing_model final : public model_base_crtp::quiet_NaN()); (void) DUMMY_VAR__; // suppress unused var warning try { + + int pos__; pos__ = 1; current_statement__ = 16; @@ -2198,7 +2202,7 @@ class ad_level_failing_model final : public model_base_crtp::quiet_NaN(); - current_statement__ = 25; + lcm_sym26__ = 1000000; kappa = 1000000; current_statement__ = 26; x_r = std::vector(0, std::numeric_limits::quiet_NaN()); @@ -2271,8 +2275,7 @@ class ad_level_failing_model final : public model_base_crtp theta = std::vector(5, std::numeric_limits::quiet_NaN()); stan::model::assign(lcm_sym24__, std::vector{beta, - stan::math::promote_scalar(1000000), gamma, xi, - delta}, "assigning variable lcm_sym24__"); + 1000000, gamma, xi, delta}, "assigning variable lcm_sym24__"); stan::model::assign(lcm_sym19__, stan::math::integrate_ode_rk45(simple_SIR_functor__(), y0, 0, t, lcm_sym24__, x_r, x_i, pstream__), @@ -2400,9 +2403,8 @@ class ad_level_failing_model final : public model_base_crtp theta = std::vector(5, std::numeric_limits::quiet_NaN()); - stan::model::assign(lcm_sym9__, std::vector{beta, - stan::math::promote_scalar(1000000), gamma, xi, delta}, - "assigning variable lcm_sym9__"); + stan::model::assign(lcm_sym9__, std::vector{beta, 1000000, + gamma, xi, delta}, "assigning variable lcm_sym9__"); stan::model::assign(lcm_sym8__, stan::math::integrate_ode_rk45(simple_SIR_functor__(), y0, 0, t, lcm_sym9__, x_r, x_i, pstream__), "assigning variable lcm_sym8__"); @@ -2527,11 +2529,11 @@ class ad_level_failing_model final : public model_base_crtp locations_array__ = " (in 'copy_fail.stan', line 72, column 2 to column 52)", " (in 'copy_fail.stan', line 73, column 2 to column 50)", " (in 'copy_fail.stan', line 74, column 2 to column 50)", - " (in 'copy_fail.stan', line 79, column 6 to column 20)", " (in 'copy_fail.stan', line 80, column 6 to column 18)", + " (in 'copy_fail.stan', line 79, column 6 to column 20)", " (in 'copy_fail.stan', line 78, column 34 to line 81, column 5)", " (in 'copy_fail.stan', line 83, column 6 to column 32)", " (in 'copy_fail.stan', line 84, column 6 to column 23)", @@ -3061,6 +3063,8 @@ last_capture_functor__::operator()(const std::vector& y_i, class copy_fail_model final : public model_base_crtp { private: + int lcm_sym131__; + int lcm_sym130__; int lcm_sym129__; int lcm_sym128__; int lcm_sym127__; @@ -3078,8 +3082,6 @@ last_capture_functor__::operator()(const std::vector& y_i, int lcm_sym115__; int lcm_sym114__; int lcm_sym113__; - int lcm_sym112__; - int lcm_sym111__; int nind; int n_occasions; std::vector> y; @@ -3177,8 +3179,8 @@ last_capture_functor__::operator()(const std::vector& y_i, current_statement__ = 36; if (stan::math::logical_gte(n_occasions, 1)) { { - lcm_sym112__ = stan::math::logical_gte(nind, 1); - if (lcm_sym112__) { + lcm_sym114__ = stan::math::logical_gte(nind, 1); + if (lcm_sym114__) { current_statement__ = 36; stan::model::assign(y, stan::model::rvalue(y_flat__, "y_flat__", @@ -3198,7 +3200,7 @@ last_capture_functor__::operator()(const std::vector& y_i, } for (int sym1__ = 2; sym1__ <= n_occasions; ++sym1__) { current_statement__ = 36; - if (lcm_sym112__) { + if (lcm_sym114__) { current_statement__ = 36; stan::model::assign(y, y_flat__[(pos__ - 1)], "assigning variable y", stan::model::index_uni(1), @@ -3217,7 +3219,7 @@ last_capture_functor__::operator()(const std::vector& y_i, } } } else { - lcm_sym112__ = stan::math::logical_gte(nind, 1); + lcm_sym114__ = stan::math::logical_gte(nind, 1); } } current_statement__ = 36; @@ -3236,16 +3238,16 @@ last_capture_functor__::operator()(const std::vector& y_i, stan::math::check_greater_or_equal(function__, "max_age", max_age, 1); current_statement__ = 38; stan::math::validate_non_negative_index("x", "nind", nind); - lcm_sym114__ = (n_occasions - 1); + lcm_sym116__ = (n_occasions - 1); stan::math::validate_non_negative_index("x", "n_occasions - 1", - lcm_sym114__); + lcm_sym116__); current_statement__ = 39; context__.validate_dims("data initialization","x","int", std::vector{static_cast(nind), - static_cast(lcm_sym114__)}); + static_cast(lcm_sym116__)}); x = std::vector>(nind, - std::vector(lcm_sym114__, std::numeric_limits::min())); + std::vector(lcm_sym116__, std::numeric_limits::min())); { @@ -3255,9 +3257,9 @@ last_capture_functor__::operator()(const std::vector& y_i, current_statement__ = 39; pos__ = 1; current_statement__ = 39; - if (stan::math::logical_gte(lcm_sym114__, 1)) { + if (stan::math::logical_gte(lcm_sym116__, 1)) { current_statement__ = 39; - if (lcm_sym112__) { + if (lcm_sym114__) { current_statement__ = 39; stan::model::assign(x, stan::model::rvalue(x_flat__, "x_flat__", @@ -3275,9 +3277,9 @@ last_capture_functor__::operator()(const std::vector& y_i, pos__ = (pos__ + 1); } } - for (int sym1__ = 2; sym1__ <= lcm_sym114__; ++sym1__) { + for (int sym1__ = 2; sym1__ <= lcm_sym116__; ++sym1__) { current_statement__ = 39; - if (lcm_sym112__) { + if (lcm_sym114__) { current_statement__ = 39; stan::model::assign(x, x_flat__[(pos__ - 1)], "assigning variable x", stan::model::index_uni(1), @@ -3305,7 +3307,7 @@ last_capture_functor__::operator()(const std::vector& y_i, current_statement__ = 40; - n_occ_minus_1 = lcm_sym114__; + n_occ_minus_1 = lcm_sym116__; current_statement__ = 41; stan::math::validate_non_negative_index("first", "nind", nind); current_statement__ = 42; @@ -3319,15 +3321,15 @@ last_capture_functor__::operator()(const std::vector& y_i, current_statement__ = 49; - if (lcm_sym112__) { + if (lcm_sym114__) { int inline_sym17__; int inline_sym19__; inline_sym19__ = 0; for (int inline_sym20__ = 1; inline_sym20__ <= 1; ++inline_sym20__) { - lcm_sym121__ = stan::math::size( + lcm_sym123__ = stan::math::size( stan::model::rvalue(y, "y", stan::model::index_uni(1))); - for (int inline_sym18__ = 1; inline_sym18__ <= lcm_sym121__; + for (int inline_sym18__ = 1; inline_sym18__ <= lcm_sym123__; ++inline_sym18__) { current_statement__ = 46; if (stan::model::rvalue(y, "y", stan::model::index_uni(1))[ @@ -3351,10 +3353,10 @@ last_capture_functor__::operator()(const std::vector& y_i, int inline_sym19__; inline_sym19__ = 0; for (int inline_sym20__ = 1; inline_sym20__ <= 1; ++inline_sym20__) { - lcm_sym120__ = stan::math::size( + lcm_sym122__ = stan::math::size( stan::model::rvalue(y, "y", stan::model::index_uni(i))); - for (int inline_sym18__ = 1; inline_sym18__ <= lcm_sym120__; + for (int inline_sym18__ = 1; inline_sym18__ <= lcm_sym122__; ++inline_sym18__) { current_statement__ = 46; if (stan::model::rvalue(y, "y", stan::model::index_uni(i))[ @@ -3376,25 +3378,25 @@ last_capture_functor__::operator()(const std::vector& y_i, } } current_statement__ = 56; - if (lcm_sym112__) { + if (lcm_sym114__) { int inline_sym21__; int inline_sym24__; inline_sym24__ = 0; for (int inline_sym25__ = 1; inline_sym25__ <= 1; ++inline_sym25__) { - lcm_sym121__ = stan::math::size( + lcm_sym123__ = stan::math::size( stan::model::rvalue(y, "y", stan::model::index_uni(1))); - lcm_sym118__ = (lcm_sym121__ - 1); - for (int inline_sym23__ = 0; inline_sym23__ <= lcm_sym118__; + lcm_sym120__ = (lcm_sym123__ - 1); + for (int inline_sym23__ = 0; inline_sym23__ <= lcm_sym120__; ++inline_sym23__) { int inline_sym22__ = std::numeric_limits::min(); - lcm_sym117__ = (lcm_sym121__ - inline_sym23__); - inline_sym22__ = lcm_sym117__; + lcm_sym119__ = (lcm_sym123__ - inline_sym23__); + inline_sym22__ = lcm_sym119__; current_statement__ = 52; if (stan::model::rvalue(y, "y", stan::model::index_uni(1))[ - (lcm_sym117__ - 1)]) { + (lcm_sym119__ - 1)]) { inline_sym24__ = 1; - inline_sym21__ = lcm_sym117__; + inline_sym21__ = lcm_sym119__; break; } } @@ -3412,20 +3414,20 @@ last_capture_functor__::operator()(const std::vector& y_i, int inline_sym24__; inline_sym24__ = 0; for (int inline_sym25__ = 1; inline_sym25__ <= 1; ++inline_sym25__) { - lcm_sym120__ = stan::math::size( + lcm_sym122__ = stan::math::size( stan::model::rvalue(y, "y", stan::model::index_uni(i))); - lcm_sym116__ = (lcm_sym120__ - 1); - for (int inline_sym23__ = 0; inline_sym23__ <= lcm_sym116__; + lcm_sym118__ = (lcm_sym122__ - 1); + for (int inline_sym23__ = 0; inline_sym23__ <= lcm_sym118__; ++inline_sym23__) { int inline_sym22__ = std::numeric_limits::min(); - lcm_sym115__ = (lcm_sym120__ - inline_sym23__); - inline_sym22__ = lcm_sym115__; + lcm_sym117__ = (lcm_sym122__ - inline_sym23__); + inline_sym22__ = lcm_sym117__; current_statement__ = 52; if (stan::model::rvalue(y, "y", stan::model::index_uni(i))[ - (lcm_sym115__ - 1)]) { + (lcm_sym117__ - 1)]) { inline_sym24__ = 1; - inline_sym21__ = lcm_sym115__; + inline_sym21__ = lcm_sym117__; break; } } @@ -3454,12 +3456,12 @@ last_capture_functor__::operator()(const std::vector& y_i, stan::math::validate_non_negative_index("phi", "nind", nind); current_statement__ = 59; stan::math::validate_non_negative_index("phi", "n_occ_minus_1", - lcm_sym114__); + lcm_sym116__); current_statement__ = 60; stan::math::validate_non_negative_index("p", "nind", nind); current_statement__ = 61; stan::math::validate_non_negative_index("p", "n_occ_minus_1", - lcm_sym114__); + lcm_sym116__); current_statement__ = 62; stan::math::validate_non_negative_index("chi", "nind", nind); current_statement__ = 63; @@ -3490,10 +3492,12 @@ last_capture_functor__::operator()(const std::vector& y_i, (void) function__; // suppress unused var warning try { + double lcm_sym112__; + int lcm_sym111__; int lcm_sym110__; int lcm_sym109__; int lcm_sym108__; - int lcm_sym107__; + double lcm_sym107__; double lcm_sym106__; double lcm_sym105__; double lcm_sym104__; @@ -3509,7 +3513,7 @@ last_capture_functor__::operator()(const std::vector& y_i, double lcm_sym94__; double lcm_sym93__; double lcm_sym92__; - double lcm_sym91__; + int lcm_sym91__; int lcm_sym90__; int lcm_sym89__; int lcm_sym88__; @@ -3529,7 +3533,6 @@ last_capture_functor__::operator()(const std::vector& y_i, int lcm_sym74__; int lcm_sym73__; int lcm_sym72__; - int lcm_sym71__; local_scalar_t__ mean_p; current_statement__ = 1; mean_p = in__.template read_constrain_lub& y_i, Eigen::Matrix chi = Eigen::Matrix::Constant(nind, n_occasions, DUMMY_VAR__); - lcm_sym71__ = stan::math::logical_gte(nind, 1); - if (lcm_sym71__) { - lcm_sym108__ = stan::model::rvalue(first, "first", + lcm_sym72__ = stan::math::logical_gte(nind, 1); + if (lcm_sym72__) { + lcm_sym109__ = stan::model::rvalue(first, "first", stan::model::index_uni(1)); - lcm_sym84__ = (lcm_sym108__ - 1); - if (stan::math::logical_gte(lcm_sym84__, 1)) { - current_statement__ = 6; + lcm_sym85__ = (lcm_sym109__ - 1); + if (stan::math::logical_gte(lcm_sym85__, 1)) { stan::model::assign(phi, 0, "assigning variable phi", stan::model::index_uni(1), stan::model::index_uni(1)); - current_statement__ = 7; + current_statement__ = 6; stan::model::assign(p, 0, "assigning variable p", stan::model::index_uni(1), stan::model::index_uni(1)); - for (int t = 2; t <= lcm_sym84__; ++t) { - current_statement__ = 6; + for (int t = 2; t <= lcm_sym85__; ++t) { + current_statement__ = 7; stan::model::assign(phi, 0, "assigning variable phi", stan::model::index_uni(1), stan::model::index_uni(t)); - current_statement__ = 7; + current_statement__ = 6; stan::model::assign(p, 0, "assigning variable p", stan::model::index_uni(1), stan::model::index_uni(t)); } } - lcm_sym82__ = (n_occasions - 1); - if (stan::math::logical_gte(lcm_sym82__, lcm_sym108__)) { + lcm_sym83__ = (n_occasions - 1); + if (stan::math::logical_gte(lcm_sym83__, lcm_sym109__)) { current_statement__ = 9; stan::model::assign(phi, stan::model::rvalue(beta, "beta", stan::model::index_uni(stan::model::rvalue(x, "x", stan::model::index_uni(1), - stan::model::index_uni(lcm_sym108__)))), + stan::model::index_uni(lcm_sym109__)))), "assigning variable phi", stan::model::index_uni(1), - stan::model::index_uni(lcm_sym108__)); - lcm_sym90__ = (lcm_sym108__ + 1); + stan::model::index_uni(lcm_sym109__)); + lcm_sym91__ = (lcm_sym109__ + 1); stan::model::assign(p, mean_p, "assigning variable p", stan::model::index_uni(1), - stan::model::index_uni(lcm_sym108__)); - for (int t = lcm_sym90__; t <= lcm_sym82__; ++t) { + stan::model::index_uni(lcm_sym109__)); + for (int t = lcm_sym91__; t <= lcm_sym83__; ++t) { current_statement__ = 9; stan::model::assign(phi, stan::model::rvalue(beta, "beta", @@ -3603,44 +3605,43 @@ last_capture_functor__::operator()(const std::vector& y_i, } } for (int i = 2; i <= nind; ++i) { - lcm_sym107__ = stan::model::rvalue(first, "first", + lcm_sym108__ = stan::model::rvalue(first, "first", stan::model::index_uni(i)); - lcm_sym83__ = (lcm_sym107__ - 1); - if (stan::math::logical_gte(lcm_sym83__, 1)) { - current_statement__ = 6; + lcm_sym84__ = (lcm_sym108__ - 1); + if (stan::math::logical_gte(lcm_sym84__, 1)) { stan::model::assign(phi, 0, "assigning variable phi", stan::model::index_uni(i), stan::model::index_uni(1)); - current_statement__ = 7; + current_statement__ = 6; stan::model::assign(p, 0, "assigning variable p", stan::model::index_uni(i), stan::model::index_uni(1)); - for (int t = 2; t <= lcm_sym83__; ++t) { - current_statement__ = 6; + for (int t = 2; t <= lcm_sym84__; ++t) { + current_statement__ = 7; stan::model::assign(phi, 0, "assigning variable phi", stan::model::index_uni(i), stan::model::index_uni(t)); - current_statement__ = 7; + current_statement__ = 6; stan::model::assign(p, 0, "assigning variable p", stan::model::index_uni(i), stan::model::index_uni(t)); } } current_statement__ = 12; - if (stan::math::logical_gte(lcm_sym82__, lcm_sym107__)) { + if (stan::math::logical_gte(lcm_sym83__, lcm_sym108__)) { current_statement__ = 9; stan::model::assign(phi, stan::model::rvalue(beta, "beta", stan::model::index_uni(stan::model::rvalue(x, "x", stan::model::index_uni(i), - stan::model::index_uni(lcm_sym107__)))), + stan::model::index_uni(lcm_sym108__)))), "assigning variable phi", stan::model::index_uni(i), - stan::model::index_uni(lcm_sym107__)); - lcm_sym89__ = (lcm_sym107__ + 1); + stan::model::index_uni(lcm_sym108__)); + lcm_sym90__ = (lcm_sym108__ + 1); stan::model::assign(p, mean_p, "assigning variable p", stan::model::index_uni(i), - stan::model::index_uni(lcm_sym107__)); - for (int t = lcm_sym89__; t <= lcm_sym82__; ++t) { + stan::model::index_uni(lcm_sym108__)); + for (int t = lcm_sym90__; t <= lcm_sym83__; ++t) { current_statement__ = 9; stan::model::assign(phi, stan::model::rvalue(beta, "beta", @@ -3674,55 +3675,55 @@ last_capture_functor__::operator()(const std::vector& y_i, stan::model::assign(inline_sym10__, 1.0, "assigning variable inline_sym10__", stan::model::index_uni(inline_sym14__), stan::model::index_uni(n_occasions)); - lcm_sym82__ = (n_occasions - 1); - if (stan::math::logical_gte(lcm_sym82__, 1)) { + lcm_sym83__ = (n_occasions - 1); + if (stan::math::logical_gte(lcm_sym83__, 1)) { int inline_sym11__ = std::numeric_limits::min(); int inline_sym12__ = std::numeric_limits::min(); - lcm_sym86__ = (lcm_sym82__ + 1); + lcm_sym87__ = (lcm_sym83__ + 1); current_statement__ = 21; stan::model::assign(inline_sym10__, stan::math::fma( (stan::model::rvalue(phi, "phi", stan::model::index_uni(inline_sym14__), - stan::model::index_uni(lcm_sym82__)) * + stan::model::index_uni(lcm_sym83__)) * (1 - stan::model::rvalue(p, "p", stan::model::index_uni(inline_sym14__), - stan::model::index_uni((lcm_sym86__ - 1))))), + stan::model::index_uni((lcm_sym87__ - 1))))), stan::model::rvalue(inline_sym10__, "inline_sym10__", stan::model::index_uni(inline_sym14__), - stan::model::index_uni(lcm_sym86__)), + stan::model::index_uni(lcm_sym87__)), (1 - stan::model::rvalue(phi, "phi", stan::model::index_uni(inline_sym14__), - stan::model::index_uni(lcm_sym82__)))), + stan::model::index_uni(lcm_sym83__)))), "assigning variable inline_sym10__", stan::model::index_uni(inline_sym14__), - stan::model::index_uni(lcm_sym82__)); - for (int inline_sym13__ = 2; inline_sym13__ <= lcm_sym82__; + stan::model::index_uni(lcm_sym83__)); + for (int inline_sym13__ = 2; inline_sym13__ <= lcm_sym83__; ++inline_sym13__) { int inline_sym11__ = std::numeric_limits::min(); - lcm_sym81__ = (n_occasions - inline_sym13__); + lcm_sym82__ = (n_occasions - inline_sym13__); int inline_sym12__ = std::numeric_limits::min(); - lcm_sym85__ = (lcm_sym81__ + 1); + lcm_sym86__ = (lcm_sym82__ + 1); current_statement__ = 21; stan::model::assign(inline_sym10__, stan::math::fma( (stan::model::rvalue(phi, "phi", stan::model::index_uni(inline_sym14__), - stan::model::index_uni(lcm_sym81__)) * + stan::model::index_uni(lcm_sym82__)) * (1 - stan::model::rvalue(p, "p", stan::model::index_uni(inline_sym14__), - stan::model::index_uni((lcm_sym85__ - 1))))), + stan::model::index_uni((lcm_sym86__ - 1))))), stan::model::rvalue(inline_sym10__, "inline_sym10__", stan::model::index_uni(inline_sym14__), - stan::model::index_uni(lcm_sym85__)), + stan::model::index_uni(lcm_sym86__)), (1 - stan::model::rvalue(phi, "phi", stan::model::index_uni(inline_sym14__), - stan::model::index_uni(lcm_sym81__)))), + stan::model::index_uni(lcm_sym82__)))), "assigning variable inline_sym10__", stan::model::index_uni(inline_sym14__), - stan::model::index_uni(lcm_sym81__)); + stan::model::index_uni(lcm_sym82__)); } } if (inline_sym15__) { @@ -3752,30 +3753,30 @@ last_capture_functor__::operator()(const std::vector& y_i, stan::math::check_less_or_equal(function__, "chi", inline_sym9__, 1); { current_statement__ = 31; - if (lcm_sym71__) { - lcm_sym108__ = stan::model::rvalue(first, "first", + if (lcm_sym72__) { + lcm_sym109__ = stan::model::rvalue(first, "first", stan::model::index_uni(1)); - if (stan::math::logical_gt(lcm_sym108__, 0)) { - lcm_sym110__ = stan::model::rvalue(last, "last", + if (stan::math::logical_gt(lcm_sym109__, 0)) { + lcm_sym111__ = stan::model::rvalue(last, "last", stan::model::index_uni(1)); - lcm_sym90__ = (lcm_sym108__ + 1); - if (stan::math::logical_gte(lcm_sym110__, lcm_sym90__)) { + lcm_sym91__ = (lcm_sym109__ + 1); + if (stan::math::logical_gte(lcm_sym111__, lcm_sym91__)) { current_statement__ = 25; lp_accum__.add( stan::math::bernoulli_lpmf(1, stan::model::rvalue(phi, "phi", stan::model::index_uni(1), - stan::model::index_uni((lcm_sym90__ - 1))))); - lcm_sym88__ = (lcm_sym90__ + 1); + stan::model::index_uni((lcm_sym91__ - 1))))); + lcm_sym89__ = (lcm_sym91__ + 1); lp_accum__.add( stan::math::bernoulli_lpmf( stan::model::rvalue(y, "y", stan::model::index_uni(1), - stan::model::index_uni(lcm_sym90__)), + stan::model::index_uni(lcm_sym91__)), stan::model::rvalue(p, "p", stan::model::index_uni(1), - stan::model::index_uni((lcm_sym90__ - 1))))); - for (int t = lcm_sym88__; t <= lcm_sym110__; ++t) { + stan::model::index_uni((lcm_sym91__ - 1))))); + for (int t = lcm_sym89__; t <= lcm_sym111__; ++t) { current_statement__ = 25; lp_accum__.add( stan::math::bernoulli_lpmf(1, @@ -3797,32 +3798,32 @@ last_capture_functor__::operator()(const std::vector& y_i, stan::math::bernoulli_lpmf(1, stan::model::rvalue(inline_sym9__, "inline_sym9__", stan::model::index_uni(1), - stan::model::index_uni(lcm_sym110__)))); + stan::model::index_uni(lcm_sym111__)))); } for (int i = 2; i <= nind; ++i) { - lcm_sym107__ = stan::model::rvalue(first, "first", + lcm_sym108__ = stan::model::rvalue(first, "first", stan::model::index_uni(i)); - if (stan::math::logical_gt(lcm_sym107__, 0)) { - lcm_sym109__ = stan::model::rvalue(last, "last", + if (stan::math::logical_gt(lcm_sym108__, 0)) { + lcm_sym110__ = stan::model::rvalue(last, "last", stan::model::index_uni(i)); - lcm_sym89__ = (lcm_sym107__ + 1); - if (stan::math::logical_gte(lcm_sym109__, lcm_sym89__)) { + lcm_sym90__ = (lcm_sym108__ + 1); + if (stan::math::logical_gte(lcm_sym110__, lcm_sym90__)) { current_statement__ = 25; lp_accum__.add( stan::math::bernoulli_lpmf(1, stan::model::rvalue(phi, "phi", stan::model::index_uni(i), - stan::model::index_uni((lcm_sym89__ - 1))))); - lcm_sym87__ = (lcm_sym89__ + 1); + stan::model::index_uni((lcm_sym90__ - 1))))); + lcm_sym88__ = (lcm_sym90__ + 1); lp_accum__.add( stan::math::bernoulli_lpmf( stan::model::rvalue(y, "y", stan::model::index_uni(i), - stan::model::index_uni(lcm_sym89__)), + stan::model::index_uni(lcm_sym90__)), stan::model::rvalue(p, "p", stan::model::index_uni(i), - stan::model::index_uni((lcm_sym89__ - 1))))); - for (int t = lcm_sym87__; t <= lcm_sym109__; ++t) { + stan::model::index_uni((lcm_sym90__ - 1))))); + for (int t = lcm_sym88__; t <= lcm_sym110__; ++t) { current_statement__ = 25; lp_accum__.add( stan::math::bernoulli_lpmf(1, @@ -3844,7 +3845,7 @@ last_capture_functor__::operator()(const std::vector& y_i, stan::math::bernoulli_lpmf(1, stan::model::rvalue(inline_sym9__, "inline_sym9__", stan::model::index_uni(i), - stan::model::index_uni(lcm_sym109__)))); + stan::model::index_uni(lcm_sym110__)))); } } } @@ -3881,6 +3882,7 @@ last_capture_functor__::operator()(const std::vector& y_i, (void) function__; // suppress unused var warning try { + double lcm_sym71__; int lcm_sym70__; int lcm_sym69__; double lcm_sym68__; @@ -3936,20 +3938,19 @@ last_capture_functor__::operator()(const std::vector& y_i, stan::model::index_uni(1)); lcm_sym56__ = (lcm_sym70__ - 1); if (stan::math::logical_gte(lcm_sym56__, 1)) { - current_statement__ = 6; stan::model::assign(phi, 0, "assigning variable phi", stan::model::index_uni(1), stan::model::index_uni(1)); - current_statement__ = 7; + current_statement__ = 6; stan::model::assign(p, 0, "assigning variable p", stan::model::index_uni(1), stan::model::index_uni(1)); for (int t = 2; t <= lcm_sym56__; ++t) { - current_statement__ = 6; + current_statement__ = 7; stan::model::assign(phi, 0, "assigning variable phi", stan::model::index_uni(1), stan::model::index_uni(t)); - current_statement__ = 7; + current_statement__ = 6; stan::model::assign(p, 0, "assigning variable p", stan::model::index_uni(1), stan::model::index_uni(t)); @@ -3989,20 +3990,19 @@ last_capture_functor__::operator()(const std::vector& y_i, stan::model::index_uni(i)); lcm_sym55__ = (lcm_sym69__ - 1); if (stan::math::logical_gte(lcm_sym55__, 1)) { - current_statement__ = 6; stan::model::assign(phi, 0, "assigning variable phi", stan::model::index_uni(i), stan::model::index_uni(1)); - current_statement__ = 7; + current_statement__ = 6; stan::model::assign(p, 0, "assigning variable p", stan::model::index_uni(i), stan::model::index_uni(1)); for (int t = 2; t <= lcm_sym55__; ++t) { - current_statement__ = 6; + current_statement__ = 7; stan::model::assign(phi, 0, "assigning variable phi", stan::model::index_uni(i), stan::model::index_uni(t)); - current_statement__ = 7; + current_statement__ = 6; stan::model::assign(p, 0, "assigning variable p", stan::model::index_uni(i), stan::model::index_uni(t)); @@ -4207,35 +4207,35 @@ last_capture_functor__::operator()(const std::vector& y_i, final { param_names__.emplace_back(std::string() + "mean_p"); - for (int sym130__ = 1; sym130__ <= max_age; ++sym130__) { + for (int sym132__ = 1; sym132__ <= max_age; ++sym132__) { { - param_names__.emplace_back(std::string() + "beta" + '.' + std::to_string(sym130__)); + param_names__.emplace_back(std::string() + "beta" + '.' + std::to_string(sym132__)); } } if (emit_transformed_parameters__) { - for (int sym130__ = 1; sym130__ <= n_occ_minus_1; ++sym130__) { + for (int sym132__ = 1; sym132__ <= n_occ_minus_1; ++sym132__) { { - for (int sym131__ = 1; sym131__ <= nind; ++sym131__) { + for (int sym133__ = 1; sym133__ <= nind; ++sym133__) { { - param_names__.emplace_back(std::string() + "phi" + '.' + std::to_string(sym131__) + '.' + std::to_string(sym130__)); + param_names__.emplace_back(std::string() + "phi" + '.' + std::to_string(sym133__) + '.' + std::to_string(sym132__)); } } } } - for (int sym130__ = 1; sym130__ <= n_occ_minus_1; ++sym130__) { + for (int sym132__ = 1; sym132__ <= n_occ_minus_1; ++sym132__) { { - for (int sym131__ = 1; sym131__ <= nind; ++sym131__) { + for (int sym133__ = 1; sym133__ <= nind; ++sym133__) { { - param_names__.emplace_back(std::string() + "p" + '.' + std::to_string(sym131__) + '.' + std::to_string(sym130__)); + param_names__.emplace_back(std::string() + "p" + '.' + std::to_string(sym133__) + '.' + std::to_string(sym132__)); } } } } - for (int sym130__ = 1; sym130__ <= n_occasions; ++sym130__) { + for (int sym132__ = 1; sym132__ <= n_occasions; ++sym132__) { { - for (int sym131__ = 1; sym131__ <= nind; ++sym131__) { + for (int sym133__ = 1; sym133__ <= nind; ++sym133__) { { - param_names__.emplace_back(std::string() + "chi" + '.' + std::to_string(sym131__) + '.' + std::to_string(sym130__)); + param_names__.emplace_back(std::string() + "chi" + '.' + std::to_string(sym133__) + '.' + std::to_string(sym132__)); } } } @@ -4255,35 +4255,35 @@ last_capture_functor__::operator()(const std::vector& y_i, final { param_names__.emplace_back(std::string() + "mean_p"); - for (int sym130__ = 1; sym130__ <= max_age; ++sym130__) { + for (int sym132__ = 1; sym132__ <= max_age; ++sym132__) { { - param_names__.emplace_back(std::string() + "beta" + '.' + std::to_string(sym130__)); + param_names__.emplace_back(std::string() + "beta" + '.' + std::to_string(sym132__)); } } if (emit_transformed_parameters__) { - for (int sym130__ = 1; sym130__ <= n_occ_minus_1; ++sym130__) { + for (int sym132__ = 1; sym132__ <= n_occ_minus_1; ++sym132__) { { - for (int sym131__ = 1; sym131__ <= nind; ++sym131__) { + for (int sym133__ = 1; sym133__ <= nind; ++sym133__) { { - param_names__.emplace_back(std::string() + "phi" + '.' + std::to_string(sym131__) + '.' + std::to_string(sym130__)); + param_names__.emplace_back(std::string() + "phi" + '.' + std::to_string(sym133__) + '.' + std::to_string(sym132__)); } } } } - for (int sym130__ = 1; sym130__ <= n_occ_minus_1; ++sym130__) { + for (int sym132__ = 1; sym132__ <= n_occ_minus_1; ++sym132__) { { - for (int sym131__ = 1; sym131__ <= nind; ++sym131__) { + for (int sym133__ = 1; sym133__ <= nind; ++sym133__) { { - param_names__.emplace_back(std::string() + "p" + '.' + std::to_string(sym131__) + '.' + std::to_string(sym130__)); + param_names__.emplace_back(std::string() + "p" + '.' + std::to_string(sym133__) + '.' + std::to_string(sym132__)); } } } } - for (int sym130__ = 1; sym130__ <= n_occasions; ++sym130__) { + for (int sym132__ = 1; sym132__ <= n_occasions; ++sym132__) { { - for (int sym131__ = 1; sym131__ <= nind; ++sym131__) { + for (int sym133__ = 1; sym133__ <= nind; ++sym133__) { { - param_names__.emplace_back(std::string() + "chi" + '.' + std::to_string(sym131__) + '.' + std::to_string(sym130__)); + param_names__.emplace_back(std::string() + "chi" + '.' + std::to_string(sym133__) + '.' + std::to_string(sym132__)); } } } @@ -5951,6 +5951,7 @@ static constexpr std::array locations_array__ = class expr_prop_experiment2_model final : public model_base_crtp { private: + double lcm_sym5__; double lcm_sym4__; int j; double z; @@ -5981,6 +5982,7 @@ class expr_prop_experiment2_model final : public model_base_crtp locations_array__ = " (in 'expr-prop-fail5.stan', line 77, column 2 to column 50)", " (in 'expr-prop-fail5.stan', line 78, column 2 to column 50)", " (in 'expr-prop-fail5.stan', line 79, column 2 to column 10)", - " (in 'expr-prop-fail5.stan', line 85, column 6 to column 20)", " (in 'expr-prop-fail5.stan', line 86, column 6 to column 18)", + " (in 'expr-prop-fail5.stan', line 85, column 6 to column 20)", " (in 'expr-prop-fail5.stan', line 84, column 34 to line 87, column 5)", " (in 'expr-prop-fail5.stan', line 89, column 6 to column 45)", " (in 'expr-prop-fail5.stan', line 90, column 6 to column 23)", @@ -9493,6 +9495,8 @@ last_capture_functor__::operator()(const std::vector& y_i, class expr_prop_fail5_model final : public model_base_crtp { private: + int lcm_sym128__; + int lcm_sym127__; int lcm_sym126__; int lcm_sym125__; int lcm_sym124__; @@ -9507,8 +9511,6 @@ class expr_prop_fail5_model final : public model_base_crtp> y; @@ -9601,8 +9603,8 @@ class expr_prop_fail5_model final : public model_base_crtp::min(); - lcm_sym113__ = (n_occasions - 1); - n_occ_minus_1 = lcm_sym113__; + lcm_sym115__ = (n_occasions - 1); + n_occ_minus_1 = lcm_sym115__; current_statement__ = 43; stan::math::validate_non_negative_index("first", "nind", nind); current_statement__ = 44; @@ -9667,15 +9669,15 @@ class expr_prop_fail5_model final : public model_base_crtp::min(); - lcm_sym116__ = (lcm_sym120__ - inline_sym23__); - inline_sym22__ = lcm_sym116__; + lcm_sym118__ = (lcm_sym122__ - inline_sym23__); + inline_sym22__ = lcm_sym118__; current_statement__ = 54; if (stan::model::rvalue(y, "y", stan::model::index_uni(1))[ - (lcm_sym116__ - 1)]) { + (lcm_sym118__ - 1)]) { inline_sym24__ = 1; - inline_sym21__ = lcm_sym116__; + inline_sym21__ = lcm_sym118__; break; } } @@ -9760,20 +9762,20 @@ class expr_prop_fail5_model final : public model_base_crtp::min(); - lcm_sym114__ = (lcm_sym119__ - inline_sym23__); - inline_sym22__ = lcm_sym114__; + lcm_sym116__ = (lcm_sym121__ - inline_sym23__); + inline_sym22__ = lcm_sym116__; current_statement__ = 54; if (stan::model::rvalue(y, "y", stan::model::index_uni(i))[ - (lcm_sym114__ - 1)]) { + (lcm_sym116__ - 1)]) { inline_sym24__ = 1; - inline_sym21__ = lcm_sym114__; + inline_sym21__ = lcm_sym116__; break; } } @@ -9802,12 +9804,12 @@ class expr_prop_fail5_model final : public model_base_crtp::Constant(nind, n_occasions, DUMMY_VAR__); local_scalar_t__ mu = DUMMY_VAR__; - lcm_sym105__ = stan::math::logit(mean_phi); - mu = lcm_sym105__; - lcm_sym71__ = stan::math::logical_gte(nind, 1); - if (lcm_sym71__) { - lcm_sym108__ = stan::model::rvalue(first, "first", + lcm_sym106__ = stan::math::logit(mean_phi); + mu = lcm_sym106__; + lcm_sym72__ = stan::math::logical_gte(nind, 1); + if (lcm_sym72__) { + lcm_sym109__ = stan::model::rvalue(first, "first", stan::model::index_uni(1)); - lcm_sym84__ = (lcm_sym108__ - 1); - if (stan::math::logical_gte(lcm_sym84__, 1)) { - current_statement__ = 9; + lcm_sym85__ = (lcm_sym109__ - 1); + if (stan::math::logical_gte(lcm_sym85__, 1)) { stan::model::assign(phi, 0, "assigning variable phi", stan::model::index_uni(1), stan::model::index_uni(1)); - current_statement__ = 10; + current_statement__ = 9; stan::model::assign(p, 0, "assigning variable p", stan::model::index_uni(1), stan::model::index_uni(1)); - for (int t = 2; t <= lcm_sym84__; ++t) { - current_statement__ = 9; + for (int t = 2; t <= lcm_sym85__; ++t) { + current_statement__ = 10; stan::model::assign(phi, 0, "assigning variable phi", stan::model::index_uni(1), stan::model::index_uni(t)); - current_statement__ = 10; + current_statement__ = 9; stan::model::assign(p, 0, "assigning variable p", stan::model::index_uni(1), stan::model::index_uni(t)); } } - lcm_sym82__ = (n_occasions - 1); - if (stan::math::logical_gte(lcm_sym82__, lcm_sym108__)) { - lcm_sym104__ = stan::math::inv_logit( - (lcm_sym105__ + + lcm_sym83__ = (n_occasions - 1); + if (stan::math::logical_gte(lcm_sym83__, lcm_sym109__)) { + lcm_sym105__ = stan::math::inv_logit( + (lcm_sym106__ + stan::model::rvalue(epsilon, "epsilon", stan::model::index_uni(1)))); - stan::model::assign(phi, lcm_sym104__, + stan::model::assign(phi, lcm_sym105__, "assigning variable phi", stan::model::index_uni(1), - stan::model::index_uni(lcm_sym108__)); - lcm_sym90__ = (lcm_sym108__ + 1); + stan::model::index_uni(lcm_sym109__)); + lcm_sym91__ = (lcm_sym109__ + 1); stan::model::assign(p, mean_p, "assigning variable p", stan::model::index_uni(1), - stan::model::index_uni(lcm_sym108__)); - for (int t = lcm_sym90__; t <= lcm_sym82__; ++t) { + stan::model::index_uni(lcm_sym109__)); + for (int t = lcm_sym91__; t <= lcm_sym83__; ++t) { current_statement__ = 12; - stan::model::assign(phi, lcm_sym104__, + stan::model::assign(phi, lcm_sym105__, "assigning variable phi", stan::model::index_uni(1), stan::model::index_uni(t)); current_statement__ = 13; @@ -9956,45 +9958,44 @@ class expr_prop_fail5_model final : public model_base_crtp::min(); int inline_sym12__ = std::numeric_limits::min(); - lcm_sym86__ = (lcm_sym82__ + 1); + lcm_sym87__ = (lcm_sym83__ + 1); current_statement__ = 24; stan::model::assign(inline_sym10__, stan::math::fma( (stan::model::rvalue(phi, "phi", stan::model::index_uni(inline_sym14__), - stan::model::index_uni(lcm_sym82__)) * + stan::model::index_uni(lcm_sym83__)) * (1 - stan::model::rvalue(p, "p", stan::model::index_uni(inline_sym14__), - stan::model::index_uni((lcm_sym86__ - 1))))), + stan::model::index_uni((lcm_sym87__ - 1))))), stan::model::rvalue(inline_sym10__, "inline_sym10__", stan::model::index_uni(inline_sym14__), - stan::model::index_uni(lcm_sym86__)), + stan::model::index_uni(lcm_sym87__)), (1 - stan::model::rvalue(phi, "phi", stan::model::index_uni(inline_sym14__), - stan::model::index_uni(lcm_sym82__)))), + stan::model::index_uni(lcm_sym83__)))), "assigning variable inline_sym10__", stan::model::index_uni(inline_sym14__), - stan::model::index_uni(lcm_sym82__)); - for (int inline_sym13__ = 2; inline_sym13__ <= lcm_sym82__; + stan::model::index_uni(lcm_sym83__)); + for (int inline_sym13__ = 2; inline_sym13__ <= lcm_sym83__; ++inline_sym13__) { int inline_sym11__ = std::numeric_limits::min(); int inline_sym12__ = std::numeric_limits::min(); - lcm_sym81__ = (n_occasions - inline_sym13__); - lcm_sym85__ = (lcm_sym81__ + 1); + lcm_sym82__ = (n_occasions - inline_sym13__); + lcm_sym86__ = (lcm_sym82__ + 1); current_statement__ = 24; stan::model::assign(inline_sym10__, stan::math::fma( (stan::model::rvalue(phi, "phi", stan::model::index_uni(inline_sym14__), - stan::model::index_uni(lcm_sym81__)) * + stan::model::index_uni(lcm_sym82__)) * (1 - stan::model::rvalue(p, "p", stan::model::index_uni(inline_sym14__), - stan::model::index_uni((lcm_sym85__ - 1))))), + stan::model::index_uni((lcm_sym86__ - 1))))), stan::model::rvalue(inline_sym10__, "inline_sym10__", stan::model::index_uni(inline_sym14__), - stan::model::index_uni(lcm_sym85__)), + stan::model::index_uni(lcm_sym86__)), (1 - stan::model::rvalue(phi, "phi", stan::model::index_uni(inline_sym14__), - stan::model::index_uni(lcm_sym81__)))), + stan::model::index_uni(lcm_sym82__)))), "assigning variable inline_sym10__", stan::model::index_uni(inline_sym14__), - stan::model::index_uni(lcm_sym81__)); + stan::model::index_uni(lcm_sym82__)); } } if (inline_sym15__) { @@ -10102,30 +10103,30 @@ class expr_prop_fail5_model final : public model_base_crtp(epsilon, 0, sigma)); current_statement__ = 36; - if (lcm_sym71__) { - lcm_sym108__ = stan::model::rvalue(first, "first", + if (lcm_sym72__) { + lcm_sym109__ = stan::model::rvalue(first, "first", stan::model::index_uni(1)); - if (stan::math::logical_gt(lcm_sym108__, 0)) { - lcm_sym110__ = stan::model::rvalue(last, "last", + if (stan::math::logical_gt(lcm_sym109__, 0)) { + lcm_sym111__ = stan::model::rvalue(last, "last", stan::model::index_uni(1)); - lcm_sym90__ = (lcm_sym108__ + 1); - if (stan::math::logical_gte(lcm_sym110__, lcm_sym90__)) { + lcm_sym91__ = (lcm_sym109__ + 1); + if (stan::math::logical_gte(lcm_sym111__, lcm_sym91__)) { current_statement__ = 30; lp_accum__.add( stan::math::bernoulli_lpmf(1, stan::model::rvalue(phi, "phi", stan::model::index_uni(1), - stan::model::index_uni((lcm_sym90__ - 1))))); - lcm_sym88__ = (lcm_sym90__ + 1); + stan::model::index_uni((lcm_sym91__ - 1))))); + lcm_sym89__ = (lcm_sym91__ + 1); lp_accum__.add( stan::math::bernoulli_lpmf( stan::model::rvalue(y, "y", stan::model::index_uni(1), - stan::model::index_uni(lcm_sym90__)), + stan::model::index_uni(lcm_sym91__)), stan::model::rvalue(p, "p", stan::model::index_uni(1), - stan::model::index_uni((lcm_sym90__ - 1))))); - for (int t = lcm_sym88__; t <= lcm_sym110__; ++t) { + stan::model::index_uni((lcm_sym91__ - 1))))); + for (int t = lcm_sym89__; t <= lcm_sym111__; ++t) { current_statement__ = 30; lp_accum__.add( stan::math::bernoulli_lpmf(1, @@ -10147,32 +10148,32 @@ class expr_prop_fail5_model final : public model_base_crtp(1, stan::model::rvalue(inline_sym9__, "inline_sym9__", stan::model::index_uni(1), - stan::model::index_uni(lcm_sym110__)))); + stan::model::index_uni(lcm_sym111__)))); } for (int i = 2; i <= nind; ++i) { - lcm_sym107__ = stan::model::rvalue(first, "first", + lcm_sym108__ = stan::model::rvalue(first, "first", stan::model::index_uni(i)); - if (stan::math::logical_gt(lcm_sym107__, 0)) { - lcm_sym109__ = stan::model::rvalue(last, "last", + if (stan::math::logical_gt(lcm_sym108__, 0)) { + lcm_sym110__ = stan::model::rvalue(last, "last", stan::model::index_uni(i)); - lcm_sym89__ = (lcm_sym107__ + 1); - if (stan::math::logical_gte(lcm_sym109__, lcm_sym89__)) { + lcm_sym90__ = (lcm_sym108__ + 1); + if (stan::math::logical_gte(lcm_sym110__, lcm_sym90__)) { current_statement__ = 30; lp_accum__.add( stan::math::bernoulli_lpmf(1, stan::model::rvalue(phi, "phi", stan::model::index_uni(i), - stan::model::index_uni((lcm_sym89__ - 1))))); - lcm_sym87__ = (lcm_sym89__ + 1); + stan::model::index_uni((lcm_sym90__ - 1))))); + lcm_sym88__ = (lcm_sym90__ + 1); lp_accum__.add( stan::math::bernoulli_lpmf( stan::model::rvalue(y, "y", stan::model::index_uni(i), - stan::model::index_uni(lcm_sym89__)), + stan::model::index_uni(lcm_sym90__)), stan::model::rvalue(p, "p", stan::model::index_uni(i), - stan::model::index_uni((lcm_sym89__ - 1))))); - for (int t = lcm_sym87__; t <= lcm_sym109__; ++t) { + stan::model::index_uni((lcm_sym90__ - 1))))); + for (int t = lcm_sym88__; t <= lcm_sym110__; ++t) { current_statement__ = 30; lp_accum__.add( stan::math::bernoulli_lpmf(1, @@ -10194,7 +10195,7 @@ class expr_prop_fail5_model final : public model_base_crtp(1, stan::model::rvalue(inline_sym9__, "inline_sym9__", stan::model::index_uni(i), - stan::model::index_uni(lcm_sym109__)))); + stan::model::index_uni(lcm_sym110__)))); } } } @@ -10231,6 +10232,7 @@ class expr_prop_fail5_model final : public model_base_crtp locations_array__ = " (in 'fails-test.stan', line 72, column 2 to column 52)", " (in 'fails-test.stan', line 73, column 2 to column 50)", " (in 'fails-test.stan', line 74, column 2 to column 50)", - " (in 'fails-test.stan', line 79, column 6 to column 20)", " (in 'fails-test.stan', line 80, column 6 to column 18)", + " (in 'fails-test.stan', line 79, column 6 to column 20)", " (in 'fails-test.stan', line 78, column 34 to line 81, column 5)", " (in 'fails-test.stan', line 83, column 6 to column 32)", " (in 'fails-test.stan', line 84, column 6 to column 23)", @@ -16110,6 +16110,8 @@ last_capture_functor__::operator()(const std::vector& y_i, class fails_test_model final : public model_base_crtp { private: + int lcm_sym131__; + int lcm_sym130__; int lcm_sym129__; int lcm_sym128__; int lcm_sym127__; @@ -16127,8 +16129,6 @@ last_capture_functor__::operator()(const std::vector& y_i, int lcm_sym115__; int lcm_sym114__; int lcm_sym113__; - int lcm_sym112__; - int lcm_sym111__; int nind; int n_occasions; std::vector> y; @@ -16226,8 +16226,8 @@ last_capture_functor__::operator()(const std::vector& y_i, current_statement__ = 36; if (stan::math::logical_gte(n_occasions, 1)) { { - lcm_sym112__ = stan::math::logical_gte(nind, 1); - if (lcm_sym112__) { + lcm_sym114__ = stan::math::logical_gte(nind, 1); + if (lcm_sym114__) { current_statement__ = 36; stan::model::assign(y, stan::model::rvalue(y_flat__, "y_flat__", @@ -16247,7 +16247,7 @@ last_capture_functor__::operator()(const std::vector& y_i, } for (int sym1__ = 2; sym1__ <= n_occasions; ++sym1__) { current_statement__ = 36; - if (lcm_sym112__) { + if (lcm_sym114__) { current_statement__ = 36; stan::model::assign(y, y_flat__[(pos__ - 1)], "assigning variable y", stan::model::index_uni(1), @@ -16266,7 +16266,7 @@ last_capture_functor__::operator()(const std::vector& y_i, } } } else { - lcm_sym112__ = stan::math::logical_gte(nind, 1); + lcm_sym114__ = stan::math::logical_gte(nind, 1); } } current_statement__ = 36; @@ -16285,16 +16285,16 @@ last_capture_functor__::operator()(const std::vector& y_i, stan::math::check_greater_or_equal(function__, "max_age", max_age, 1); current_statement__ = 38; stan::math::validate_non_negative_index("x", "nind", nind); - lcm_sym114__ = (n_occasions - 1); + lcm_sym116__ = (n_occasions - 1); stan::math::validate_non_negative_index("x", "n_occasions - 1", - lcm_sym114__); + lcm_sym116__); current_statement__ = 39; context__.validate_dims("data initialization","x","int", std::vector{static_cast(nind), - static_cast(lcm_sym114__)}); + static_cast(lcm_sym116__)}); x = std::vector>(nind, - std::vector(lcm_sym114__, std::numeric_limits::min())); + std::vector(lcm_sym116__, std::numeric_limits::min())); { @@ -16304,9 +16304,9 @@ last_capture_functor__::operator()(const std::vector& y_i, current_statement__ = 39; pos__ = 1; current_statement__ = 39; - if (stan::math::logical_gte(lcm_sym114__, 1)) { + if (stan::math::logical_gte(lcm_sym116__, 1)) { current_statement__ = 39; - if (lcm_sym112__) { + if (lcm_sym114__) { current_statement__ = 39; stan::model::assign(x, stan::model::rvalue(x_flat__, "x_flat__", @@ -16324,9 +16324,9 @@ last_capture_functor__::operator()(const std::vector& y_i, pos__ = (pos__ + 1); } } - for (int sym1__ = 2; sym1__ <= lcm_sym114__; ++sym1__) { + for (int sym1__ = 2; sym1__ <= lcm_sym116__; ++sym1__) { current_statement__ = 39; - if (lcm_sym112__) { + if (lcm_sym114__) { current_statement__ = 39; stan::model::assign(x, x_flat__[(pos__ - 1)], "assigning variable x", stan::model::index_uni(1), @@ -16354,7 +16354,7 @@ last_capture_functor__::operator()(const std::vector& y_i, current_statement__ = 40; - n_occ_minus_1 = lcm_sym114__; + n_occ_minus_1 = lcm_sym116__; current_statement__ = 41; stan::math::validate_non_negative_index("first", "nind", nind); current_statement__ = 42; @@ -16368,15 +16368,15 @@ last_capture_functor__::operator()(const std::vector& y_i, current_statement__ = 49; - if (lcm_sym112__) { + if (lcm_sym114__) { int inline_sym17__; int inline_sym19__; inline_sym19__ = 0; for (int inline_sym20__ = 1; inline_sym20__ <= 1; ++inline_sym20__) { - lcm_sym121__ = stan::math::size( + lcm_sym123__ = stan::math::size( stan::model::rvalue(y, "y", stan::model::index_uni(1))); - for (int inline_sym18__ = 1; inline_sym18__ <= lcm_sym121__; + for (int inline_sym18__ = 1; inline_sym18__ <= lcm_sym123__; ++inline_sym18__) { current_statement__ = 46; if (stan::model::rvalue(y, "y", stan::model::index_uni(1))[ @@ -16400,10 +16400,10 @@ last_capture_functor__::operator()(const std::vector& y_i, int inline_sym19__; inline_sym19__ = 0; for (int inline_sym20__ = 1; inline_sym20__ <= 1; ++inline_sym20__) { - lcm_sym120__ = stan::math::size( + lcm_sym122__ = stan::math::size( stan::model::rvalue(y, "y", stan::model::index_uni(i))); - for (int inline_sym18__ = 1; inline_sym18__ <= lcm_sym120__; + for (int inline_sym18__ = 1; inline_sym18__ <= lcm_sym122__; ++inline_sym18__) { current_statement__ = 46; if (stan::model::rvalue(y, "y", stan::model::index_uni(i))[ @@ -16425,25 +16425,25 @@ last_capture_functor__::operator()(const std::vector& y_i, } } current_statement__ = 56; - if (lcm_sym112__) { + if (lcm_sym114__) { int inline_sym21__; int inline_sym24__; inline_sym24__ = 0; for (int inline_sym25__ = 1; inline_sym25__ <= 1; ++inline_sym25__) { - lcm_sym121__ = stan::math::size( + lcm_sym123__ = stan::math::size( stan::model::rvalue(y, "y", stan::model::index_uni(1))); - lcm_sym118__ = (lcm_sym121__ - 1); - for (int inline_sym23__ = 0; inline_sym23__ <= lcm_sym118__; + lcm_sym120__ = (lcm_sym123__ - 1); + for (int inline_sym23__ = 0; inline_sym23__ <= lcm_sym120__; ++inline_sym23__) { int inline_sym22__ = std::numeric_limits::min(); - lcm_sym117__ = (lcm_sym121__ - inline_sym23__); - inline_sym22__ = lcm_sym117__; + lcm_sym119__ = (lcm_sym123__ - inline_sym23__); + inline_sym22__ = lcm_sym119__; current_statement__ = 52; if (stan::model::rvalue(y, "y", stan::model::index_uni(1))[ - (lcm_sym117__ - 1)]) { + (lcm_sym119__ - 1)]) { inline_sym24__ = 1; - inline_sym21__ = lcm_sym117__; + inline_sym21__ = lcm_sym119__; break; } } @@ -16461,20 +16461,20 @@ last_capture_functor__::operator()(const std::vector& y_i, int inline_sym24__; inline_sym24__ = 0; for (int inline_sym25__ = 1; inline_sym25__ <= 1; ++inline_sym25__) { - lcm_sym120__ = stan::math::size( + lcm_sym122__ = stan::math::size( stan::model::rvalue(y, "y", stan::model::index_uni(i))); - lcm_sym116__ = (lcm_sym120__ - 1); - for (int inline_sym23__ = 0; inline_sym23__ <= lcm_sym116__; + lcm_sym118__ = (lcm_sym122__ - 1); + for (int inline_sym23__ = 0; inline_sym23__ <= lcm_sym118__; ++inline_sym23__) { int inline_sym22__ = std::numeric_limits::min(); - lcm_sym115__ = (lcm_sym120__ - inline_sym23__); - inline_sym22__ = lcm_sym115__; + lcm_sym117__ = (lcm_sym122__ - inline_sym23__); + inline_sym22__ = lcm_sym117__; current_statement__ = 52; if (stan::model::rvalue(y, "y", stan::model::index_uni(i))[ - (lcm_sym115__ - 1)]) { + (lcm_sym117__ - 1)]) { inline_sym24__ = 1; - inline_sym21__ = lcm_sym115__; + inline_sym21__ = lcm_sym117__; break; } } @@ -16503,12 +16503,12 @@ last_capture_functor__::operator()(const std::vector& y_i, stan::math::validate_non_negative_index("phi", "nind", nind); current_statement__ = 59; stan::math::validate_non_negative_index("phi", "n_occ_minus_1", - lcm_sym114__); + lcm_sym116__); current_statement__ = 60; stan::math::validate_non_negative_index("p", "nind", nind); current_statement__ = 61; stan::math::validate_non_negative_index("p", "n_occ_minus_1", - lcm_sym114__); + lcm_sym116__); current_statement__ = 62; stan::math::validate_non_negative_index("chi", "nind", nind); current_statement__ = 63; @@ -16539,10 +16539,12 @@ last_capture_functor__::operator()(const std::vector& y_i, (void) function__; // suppress unused var warning try { + double lcm_sym112__; + int lcm_sym111__; int lcm_sym110__; int lcm_sym109__; int lcm_sym108__; - int lcm_sym107__; + double lcm_sym107__; double lcm_sym106__; double lcm_sym105__; double lcm_sym104__; @@ -16558,7 +16560,7 @@ last_capture_functor__::operator()(const std::vector& y_i, double lcm_sym94__; double lcm_sym93__; double lcm_sym92__; - double lcm_sym91__; + int lcm_sym91__; int lcm_sym90__; int lcm_sym89__; int lcm_sym88__; @@ -16578,7 +16580,6 @@ last_capture_functor__::operator()(const std::vector& y_i, int lcm_sym74__; int lcm_sym73__; int lcm_sym72__; - int lcm_sym71__; local_scalar_t__ mean_p; current_statement__ = 1; mean_p = in__.template read_constrain_lub& y_i, Eigen::Matrix chi = Eigen::Matrix::Constant(nind, n_occasions, DUMMY_VAR__); - lcm_sym71__ = stan::math::logical_gte(nind, 1); - if (lcm_sym71__) { - lcm_sym108__ = stan::model::rvalue(first, "first", + lcm_sym72__ = stan::math::logical_gte(nind, 1); + if (lcm_sym72__) { + lcm_sym109__ = stan::model::rvalue(first, "first", stan::model::index_uni(1)); - lcm_sym84__ = (lcm_sym108__ - 1); - if (stan::math::logical_gte(lcm_sym84__, 1)) { - current_statement__ = 6; + lcm_sym85__ = (lcm_sym109__ - 1); + if (stan::math::logical_gte(lcm_sym85__, 1)) { stan::model::assign(phi, 0, "assigning variable phi", stan::model::index_uni(1), stan::model::index_uni(1)); - current_statement__ = 7; + current_statement__ = 6; stan::model::assign(p, 0, "assigning variable p", stan::model::index_uni(1), stan::model::index_uni(1)); - for (int t = 2; t <= lcm_sym84__; ++t) { - current_statement__ = 6; + for (int t = 2; t <= lcm_sym85__; ++t) { + current_statement__ = 7; stan::model::assign(phi, 0, "assigning variable phi", stan::model::index_uni(1), stan::model::index_uni(t)); - current_statement__ = 7; + current_statement__ = 6; stan::model::assign(p, 0, "assigning variable p", stan::model::index_uni(1), stan::model::index_uni(t)); } } - lcm_sym82__ = (n_occasions - 1); - if (stan::math::logical_gte(lcm_sym82__, lcm_sym108__)) { + lcm_sym83__ = (n_occasions - 1); + if (stan::math::logical_gte(lcm_sym83__, lcm_sym109__)) { current_statement__ = 9; stan::model::assign(phi, stan::model::rvalue(beta, "beta", stan::model::index_uni(stan::model::rvalue(x, "x", stan::model::index_uni(1), - stan::model::index_uni(lcm_sym108__)))), + stan::model::index_uni(lcm_sym109__)))), "assigning variable phi", stan::model::index_uni(1), - stan::model::index_uni(lcm_sym108__)); - lcm_sym90__ = (lcm_sym108__ + 1); + stan::model::index_uni(lcm_sym109__)); + lcm_sym91__ = (lcm_sym109__ + 1); stan::model::assign(p, mean_p, "assigning variable p", stan::model::index_uni(1), - stan::model::index_uni(lcm_sym108__)); - for (int t = lcm_sym90__; t <= lcm_sym82__; ++t) { + stan::model::index_uni(lcm_sym109__)); + for (int t = lcm_sym91__; t <= lcm_sym83__; ++t) { current_statement__ = 9; stan::model::assign(phi, stan::model::rvalue(beta, "beta", @@ -16652,44 +16652,43 @@ last_capture_functor__::operator()(const std::vector& y_i, } } for (int i = 2; i <= nind; ++i) { - lcm_sym107__ = stan::model::rvalue(first, "first", + lcm_sym108__ = stan::model::rvalue(first, "first", stan::model::index_uni(i)); - lcm_sym83__ = (lcm_sym107__ - 1); - if (stan::math::logical_gte(lcm_sym83__, 1)) { - current_statement__ = 6; + lcm_sym84__ = (lcm_sym108__ - 1); + if (stan::math::logical_gte(lcm_sym84__, 1)) { stan::model::assign(phi, 0, "assigning variable phi", stan::model::index_uni(i), stan::model::index_uni(1)); - current_statement__ = 7; + current_statement__ = 6; stan::model::assign(p, 0, "assigning variable p", stan::model::index_uni(i), stan::model::index_uni(1)); - for (int t = 2; t <= lcm_sym83__; ++t) { - current_statement__ = 6; + for (int t = 2; t <= lcm_sym84__; ++t) { + current_statement__ = 7; stan::model::assign(phi, 0, "assigning variable phi", stan::model::index_uni(i), stan::model::index_uni(t)); - current_statement__ = 7; + current_statement__ = 6; stan::model::assign(p, 0, "assigning variable p", stan::model::index_uni(i), stan::model::index_uni(t)); } } current_statement__ = 12; - if (stan::math::logical_gte(lcm_sym82__, lcm_sym107__)) { + if (stan::math::logical_gte(lcm_sym83__, lcm_sym108__)) { current_statement__ = 9; stan::model::assign(phi, stan::model::rvalue(beta, "beta", stan::model::index_uni(stan::model::rvalue(x, "x", stan::model::index_uni(i), - stan::model::index_uni(lcm_sym107__)))), + stan::model::index_uni(lcm_sym108__)))), "assigning variable phi", stan::model::index_uni(i), - stan::model::index_uni(lcm_sym107__)); - lcm_sym89__ = (lcm_sym107__ + 1); + stan::model::index_uni(lcm_sym108__)); + lcm_sym90__ = (lcm_sym108__ + 1); stan::model::assign(p, mean_p, "assigning variable p", stan::model::index_uni(i), - stan::model::index_uni(lcm_sym107__)); - for (int t = lcm_sym89__; t <= lcm_sym82__; ++t) { + stan::model::index_uni(lcm_sym108__)); + for (int t = lcm_sym90__; t <= lcm_sym83__; ++t) { current_statement__ = 9; stan::model::assign(phi, stan::model::rvalue(beta, "beta", @@ -16723,55 +16722,55 @@ last_capture_functor__::operator()(const std::vector& y_i, stan::model::assign(inline_sym10__, 1.0, "assigning variable inline_sym10__", stan::model::index_uni(inline_sym14__), stan::model::index_uni(n_occasions)); - lcm_sym82__ = (n_occasions - 1); - if (stan::math::logical_gte(lcm_sym82__, 1)) { + lcm_sym83__ = (n_occasions - 1); + if (stan::math::logical_gte(lcm_sym83__, 1)) { int inline_sym11__ = std::numeric_limits::min(); int inline_sym12__ = std::numeric_limits::min(); - lcm_sym86__ = (lcm_sym82__ + 1); + lcm_sym87__ = (lcm_sym83__ + 1); current_statement__ = 21; stan::model::assign(inline_sym10__, stan::math::fma( (stan::model::rvalue(phi, "phi", stan::model::index_uni(inline_sym14__), - stan::model::index_uni(lcm_sym82__)) * + stan::model::index_uni(lcm_sym83__)) * (1 - stan::model::rvalue(p, "p", stan::model::index_uni(inline_sym14__), - stan::model::index_uni((lcm_sym86__ - 1))))), + stan::model::index_uni((lcm_sym87__ - 1))))), stan::model::rvalue(inline_sym10__, "inline_sym10__", stan::model::index_uni(inline_sym14__), - stan::model::index_uni(lcm_sym86__)), + stan::model::index_uni(lcm_sym87__)), (1 - stan::model::rvalue(phi, "phi", stan::model::index_uni(inline_sym14__), - stan::model::index_uni(lcm_sym82__)))), + stan::model::index_uni(lcm_sym83__)))), "assigning variable inline_sym10__", stan::model::index_uni(inline_sym14__), - stan::model::index_uni(lcm_sym82__)); - for (int inline_sym13__ = 2; inline_sym13__ <= lcm_sym82__; + stan::model::index_uni(lcm_sym83__)); + for (int inline_sym13__ = 2; inline_sym13__ <= lcm_sym83__; ++inline_sym13__) { int inline_sym11__ = std::numeric_limits::min(); - lcm_sym81__ = (n_occasions - inline_sym13__); + lcm_sym82__ = (n_occasions - inline_sym13__); int inline_sym12__ = std::numeric_limits::min(); - lcm_sym85__ = (lcm_sym81__ + 1); + lcm_sym86__ = (lcm_sym82__ + 1); current_statement__ = 21; stan::model::assign(inline_sym10__, stan::math::fma( (stan::model::rvalue(phi, "phi", stan::model::index_uni(inline_sym14__), - stan::model::index_uni(lcm_sym81__)) * + stan::model::index_uni(lcm_sym82__)) * (1 - stan::model::rvalue(p, "p", stan::model::index_uni(inline_sym14__), - stan::model::index_uni((lcm_sym85__ - 1))))), + stan::model::index_uni((lcm_sym86__ - 1))))), stan::model::rvalue(inline_sym10__, "inline_sym10__", stan::model::index_uni(inline_sym14__), - stan::model::index_uni(lcm_sym85__)), + stan::model::index_uni(lcm_sym86__)), (1 - stan::model::rvalue(phi, "phi", stan::model::index_uni(inline_sym14__), - stan::model::index_uni(lcm_sym81__)))), + stan::model::index_uni(lcm_sym82__)))), "assigning variable inline_sym10__", stan::model::index_uni(inline_sym14__), - stan::model::index_uni(lcm_sym81__)); + stan::model::index_uni(lcm_sym82__)); } } if (inline_sym15__) { @@ -16801,30 +16800,30 @@ last_capture_functor__::operator()(const std::vector& y_i, stan::math::check_less_or_equal(function__, "chi", inline_sym9__, 1); { current_statement__ = 31; - if (lcm_sym71__) { - lcm_sym108__ = stan::model::rvalue(first, "first", + if (lcm_sym72__) { + lcm_sym109__ = stan::model::rvalue(first, "first", stan::model::index_uni(1)); - if (stan::math::logical_gt(lcm_sym108__, 0)) { - lcm_sym110__ = stan::model::rvalue(last, "last", + if (stan::math::logical_gt(lcm_sym109__, 0)) { + lcm_sym111__ = stan::model::rvalue(last, "last", stan::model::index_uni(1)); - lcm_sym90__ = (lcm_sym108__ + 1); - if (stan::math::logical_gte(lcm_sym110__, lcm_sym90__)) { + lcm_sym91__ = (lcm_sym109__ + 1); + if (stan::math::logical_gte(lcm_sym111__, lcm_sym91__)) { current_statement__ = 25; lp_accum__.add( stan::math::bernoulli_lpmf(1, stan::model::rvalue(phi, "phi", stan::model::index_uni(1), - stan::model::index_uni((lcm_sym90__ - 1))))); - lcm_sym88__ = (lcm_sym90__ + 1); + stan::model::index_uni((lcm_sym91__ - 1))))); + lcm_sym89__ = (lcm_sym91__ + 1); lp_accum__.add( stan::math::bernoulli_lpmf( stan::model::rvalue(y, "y", stan::model::index_uni(1), - stan::model::index_uni(lcm_sym90__)), + stan::model::index_uni(lcm_sym91__)), stan::model::rvalue(p, "p", stan::model::index_uni(1), - stan::model::index_uni((lcm_sym90__ - 1))))); - for (int t = lcm_sym88__; t <= lcm_sym110__; ++t) { + stan::model::index_uni((lcm_sym91__ - 1))))); + for (int t = lcm_sym89__; t <= lcm_sym111__; ++t) { current_statement__ = 25; lp_accum__.add( stan::math::bernoulli_lpmf(1, @@ -16846,32 +16845,32 @@ last_capture_functor__::operator()(const std::vector& y_i, stan::math::bernoulli_lpmf(1, stan::model::rvalue(inline_sym9__, "inline_sym9__", stan::model::index_uni(1), - stan::model::index_uni(lcm_sym110__)))); + stan::model::index_uni(lcm_sym111__)))); } for (int i = 2; i <= nind; ++i) { - lcm_sym107__ = stan::model::rvalue(first, "first", + lcm_sym108__ = stan::model::rvalue(first, "first", stan::model::index_uni(i)); - if (stan::math::logical_gt(lcm_sym107__, 0)) { - lcm_sym109__ = stan::model::rvalue(last, "last", + if (stan::math::logical_gt(lcm_sym108__, 0)) { + lcm_sym110__ = stan::model::rvalue(last, "last", stan::model::index_uni(i)); - lcm_sym89__ = (lcm_sym107__ + 1); - if (stan::math::logical_gte(lcm_sym109__, lcm_sym89__)) { + lcm_sym90__ = (lcm_sym108__ + 1); + if (stan::math::logical_gte(lcm_sym110__, lcm_sym90__)) { current_statement__ = 25; lp_accum__.add( stan::math::bernoulli_lpmf(1, stan::model::rvalue(phi, "phi", stan::model::index_uni(i), - stan::model::index_uni((lcm_sym89__ - 1))))); - lcm_sym87__ = (lcm_sym89__ + 1); + stan::model::index_uni((lcm_sym90__ - 1))))); + lcm_sym88__ = (lcm_sym90__ + 1); lp_accum__.add( stan::math::bernoulli_lpmf( stan::model::rvalue(y, "y", stan::model::index_uni(i), - stan::model::index_uni(lcm_sym89__)), + stan::model::index_uni(lcm_sym90__)), stan::model::rvalue(p, "p", stan::model::index_uni(i), - stan::model::index_uni((lcm_sym89__ - 1))))); - for (int t = lcm_sym87__; t <= lcm_sym109__; ++t) { + stan::model::index_uni((lcm_sym90__ - 1))))); + for (int t = lcm_sym88__; t <= lcm_sym110__; ++t) { current_statement__ = 25; lp_accum__.add( stan::math::bernoulli_lpmf(1, @@ -16893,7 +16892,7 @@ last_capture_functor__::operator()(const std::vector& y_i, stan::math::bernoulli_lpmf(1, stan::model::rvalue(inline_sym9__, "inline_sym9__", stan::model::index_uni(i), - stan::model::index_uni(lcm_sym109__)))); + stan::model::index_uni(lcm_sym110__)))); } } } @@ -16930,6 +16929,7 @@ last_capture_functor__::operator()(const std::vector& y_i, (void) function__; // suppress unused var warning try { + double lcm_sym71__; int lcm_sym70__; int lcm_sym69__; double lcm_sym68__; @@ -16985,20 +16985,19 @@ last_capture_functor__::operator()(const std::vector& y_i, stan::model::index_uni(1)); lcm_sym56__ = (lcm_sym70__ - 1); if (stan::math::logical_gte(lcm_sym56__, 1)) { - current_statement__ = 6; stan::model::assign(phi, 0, "assigning variable phi", stan::model::index_uni(1), stan::model::index_uni(1)); - current_statement__ = 7; + current_statement__ = 6; stan::model::assign(p, 0, "assigning variable p", stan::model::index_uni(1), stan::model::index_uni(1)); for (int t = 2; t <= lcm_sym56__; ++t) { - current_statement__ = 6; + current_statement__ = 7; stan::model::assign(phi, 0, "assigning variable phi", stan::model::index_uni(1), stan::model::index_uni(t)); - current_statement__ = 7; + current_statement__ = 6; stan::model::assign(p, 0, "assigning variable p", stan::model::index_uni(1), stan::model::index_uni(t)); @@ -17038,20 +17037,19 @@ last_capture_functor__::operator()(const std::vector& y_i, stan::model::index_uni(i)); lcm_sym55__ = (lcm_sym69__ - 1); if (stan::math::logical_gte(lcm_sym55__, 1)) { - current_statement__ = 6; stan::model::assign(phi, 0, "assigning variable phi", stan::model::index_uni(i), stan::model::index_uni(1)); - current_statement__ = 7; + current_statement__ = 6; stan::model::assign(p, 0, "assigning variable p", stan::model::index_uni(i), stan::model::index_uni(1)); for (int t = 2; t <= lcm_sym55__; ++t) { - current_statement__ = 6; + current_statement__ = 7; stan::model::assign(phi, 0, "assigning variable phi", stan::model::index_uni(i), stan::model::index_uni(t)); - current_statement__ = 7; + current_statement__ = 6; stan::model::assign(p, 0, "assigning variable p", stan::model::index_uni(i), stan::model::index_uni(t)); @@ -17256,35 +17254,35 @@ last_capture_functor__::operator()(const std::vector& y_i, final { param_names__.emplace_back(std::string() + "mean_p"); - for (int sym130__ = 1; sym130__ <= max_age; ++sym130__) { + for (int sym132__ = 1; sym132__ <= max_age; ++sym132__) { { - param_names__.emplace_back(std::string() + "beta" + '.' + std::to_string(sym130__)); + param_names__.emplace_back(std::string() + "beta" + '.' + std::to_string(sym132__)); } } if (emit_transformed_parameters__) { - for (int sym130__ = 1; sym130__ <= n_occ_minus_1; ++sym130__) { + for (int sym132__ = 1; sym132__ <= n_occ_minus_1; ++sym132__) { { - for (int sym131__ = 1; sym131__ <= nind; ++sym131__) { + for (int sym133__ = 1; sym133__ <= nind; ++sym133__) { { - param_names__.emplace_back(std::string() + "phi" + '.' + std::to_string(sym131__) + '.' + std::to_string(sym130__)); + param_names__.emplace_back(std::string() + "phi" + '.' + std::to_string(sym133__) + '.' + std::to_string(sym132__)); } } } } - for (int sym130__ = 1; sym130__ <= n_occ_minus_1; ++sym130__) { + for (int sym132__ = 1; sym132__ <= n_occ_minus_1; ++sym132__) { { - for (int sym131__ = 1; sym131__ <= nind; ++sym131__) { + for (int sym133__ = 1; sym133__ <= nind; ++sym133__) { { - param_names__.emplace_back(std::string() + "p" + '.' + std::to_string(sym131__) + '.' + std::to_string(sym130__)); + param_names__.emplace_back(std::string() + "p" + '.' + std::to_string(sym133__) + '.' + std::to_string(sym132__)); } } } } - for (int sym130__ = 1; sym130__ <= n_occasions; ++sym130__) { + for (int sym132__ = 1; sym132__ <= n_occasions; ++sym132__) { { - for (int sym131__ = 1; sym131__ <= nind; ++sym131__) { + for (int sym133__ = 1; sym133__ <= nind; ++sym133__) { { - param_names__.emplace_back(std::string() + "chi" + '.' + std::to_string(sym131__) + '.' + std::to_string(sym130__)); + param_names__.emplace_back(std::string() + "chi" + '.' + std::to_string(sym133__) + '.' + std::to_string(sym132__)); } } } @@ -17304,35 +17302,35 @@ last_capture_functor__::operator()(const std::vector& y_i, final { param_names__.emplace_back(std::string() + "mean_p"); - for (int sym130__ = 1; sym130__ <= max_age; ++sym130__) { + for (int sym132__ = 1; sym132__ <= max_age; ++sym132__) { { - param_names__.emplace_back(std::string() + "beta" + '.' + std::to_string(sym130__)); + param_names__.emplace_back(std::string() + "beta" + '.' + std::to_string(sym132__)); } } if (emit_transformed_parameters__) { - for (int sym130__ = 1; sym130__ <= n_occ_minus_1; ++sym130__) { + for (int sym132__ = 1; sym132__ <= n_occ_minus_1; ++sym132__) { { - for (int sym131__ = 1; sym131__ <= nind; ++sym131__) { + for (int sym133__ = 1; sym133__ <= nind; ++sym133__) { { - param_names__.emplace_back(std::string() + "phi" + '.' + std::to_string(sym131__) + '.' + std::to_string(sym130__)); + param_names__.emplace_back(std::string() + "phi" + '.' + std::to_string(sym133__) + '.' + std::to_string(sym132__)); } } } } - for (int sym130__ = 1; sym130__ <= n_occ_minus_1; ++sym130__) { + for (int sym132__ = 1; sym132__ <= n_occ_minus_1; ++sym132__) { { - for (int sym131__ = 1; sym131__ <= nind; ++sym131__) { + for (int sym133__ = 1; sym133__ <= nind; ++sym133__) { { - param_names__.emplace_back(std::string() + "p" + '.' + std::to_string(sym131__) + '.' + std::to_string(sym130__)); + param_names__.emplace_back(std::string() + "p" + '.' + std::to_string(sym133__) + '.' + std::to_string(sym132__)); } } } } - for (int sym130__ = 1; sym130__ <= n_occasions; ++sym130__) { + for (int sym132__ = 1; sym132__ <= n_occasions; ++sym132__) { { - for (int sym131__ = 1; sym131__ <= nind; ++sym131__) { + for (int sym133__ = 1; sym133__ <= nind; ++sym133__) { { - param_names__.emplace_back(std::string() + "chi" + '.' + std::to_string(sym131__) + '.' + std::to_string(sym130__)); + param_names__.emplace_back(std::string() + "chi" + '.' + std::to_string(sym133__) + '.' + std::to_string(sym132__)); } } } @@ -18472,6 +18470,7 @@ template * = nullptr> local_scalar_t__ DUMMY_VAR__(std::numeric_limits::quiet_NaN()); (void) DUMMY_VAR__; // suppress unused var warning try { + double lcm_sym129__; int lcm_sym128__; Eigen::Matrix lcm_sym127__; double lcm_sym126__; @@ -18578,6 +18577,8 @@ prob_uncaptured_functor__::operator()(const T0__& p, const T1__& phi, class inlining_fail2_model final : public model_base_crtp { private: + int lcm_sym279__; + int lcm_sym278__; int lcm_sym277__; int lcm_sym276__; int lcm_sym275__; @@ -18592,8 +18593,6 @@ class inlining_fail2_model final : public model_base_crtp int lcm_sym266__; int lcm_sym265__; int lcm_sym264__; - int lcm_sym263__; - int lcm_sym262__; int M; int n_occasions; std::vector> y; @@ -18687,8 +18686,8 @@ class inlining_fail2_model final : public model_base_crtp current_statement__ = 106; if (stan::math::logical_gte(n_occasions, 1)) { { - lcm_sym262__ = stan::math::logical_gte(M, 1); - if (lcm_sym262__) { + lcm_sym264__ = stan::math::logical_gte(M, 1); + if (lcm_sym264__) { current_statement__ = 106; stan::model::assign(y, stan::model::rvalue(y_flat__, "y_flat__", @@ -18708,7 +18707,7 @@ class inlining_fail2_model final : public model_base_crtp } for (int sym1__ = 2; sym1__ <= n_occasions; ++sym1__) { current_statement__ = 106; - if (lcm_sym262__) { + if (lcm_sym264__) { current_statement__ = 106; stan::model::assign(y, y_flat__[(pos__ - 1)], "assigning variable y", stan::model::index_uni(1), @@ -18727,7 +18726,7 @@ class inlining_fail2_model final : public model_base_crtp } } } else { - lcm_sym262__ = stan::math::logical_gte(M, 1); + lcm_sym264__ = stan::math::logical_gte(M, 1); } } current_statement__ = 106; @@ -18747,15 +18746,15 @@ class inlining_fail2_model final : public model_base_crtp current_statement__ = 112; - if (lcm_sym262__) { + if (lcm_sym264__) { int inline_sym41__; int inline_sym43__; inline_sym43__ = 0; for (int inline_sym44__ = 1; inline_sym44__ <= 1; ++inline_sym44__) { - lcm_sym271__ = stan::math::size( + lcm_sym273__ = stan::math::size( stan::model::rvalue(y, "y", stan::model::index_uni(1))); - for (int inline_sym42__ = 1; inline_sym42__ <= lcm_sym271__; + for (int inline_sym42__ = 1; inline_sym42__ <= lcm_sym273__; ++inline_sym42__) { current_statement__ = 59; if (stan::model::rvalue(y, "y", stan::model::index_uni(1))[ @@ -18779,10 +18778,10 @@ class inlining_fail2_model final : public model_base_crtp int inline_sym43__; inline_sym43__ = 0; for (int inline_sym44__ = 1; inline_sym44__ <= 1; ++inline_sym44__) { - lcm_sym270__ = stan::math::size( + lcm_sym272__ = stan::math::size( stan::model::rvalue(y, "y", stan::model::index_uni(i))); - for (int inline_sym42__ = 1; inline_sym42__ <= lcm_sym270__; + for (int inline_sym42__ = 1; inline_sym42__ <= lcm_sym272__; ++inline_sym42__) { current_statement__ = 59; if (stan::model::rvalue(y, "y", stan::model::index_uni(i))[ @@ -18804,25 +18803,25 @@ class inlining_fail2_model final : public model_base_crtp } } current_statement__ = 119; - if (lcm_sym262__) { + if (lcm_sym264__) { int inline_sym45__; int inline_sym48__; inline_sym48__ = 0; for (int inline_sym49__ = 1; inline_sym49__ <= 1; ++inline_sym49__) { - lcm_sym271__ = stan::math::size( + lcm_sym273__ = stan::math::size( stan::model::rvalue(y, "y", stan::model::index_uni(1))); - lcm_sym268__ = (lcm_sym271__ - 1); - for (int inline_sym47__ = 0; inline_sym47__ <= lcm_sym268__; + lcm_sym270__ = (lcm_sym273__ - 1); + for (int inline_sym47__ = 0; inline_sym47__ <= lcm_sym270__; ++inline_sym47__) { int inline_sym46__ = std::numeric_limits::min(); - lcm_sym267__ = (lcm_sym271__ - inline_sym47__); - inline_sym46__ = lcm_sym267__; + lcm_sym269__ = (lcm_sym273__ - inline_sym47__); + inline_sym46__ = lcm_sym269__; current_statement__ = 115; if (stan::model::rvalue(y, "y", stan::model::index_uni(1))[ - (lcm_sym267__ - 1)]) { + (lcm_sym269__ - 1)]) { inline_sym48__ = 1; - inline_sym45__ = lcm_sym267__; + inline_sym45__ = lcm_sym269__; break; } } @@ -18840,20 +18839,20 @@ class inlining_fail2_model final : public model_base_crtp int inline_sym48__; inline_sym48__ = 0; for (int inline_sym49__ = 1; inline_sym49__ <= 1; ++inline_sym49__) { - lcm_sym270__ = stan::math::size( + lcm_sym272__ = stan::math::size( stan::model::rvalue(y, "y", stan::model::index_uni(i))); - lcm_sym266__ = (lcm_sym270__ - 1); - for (int inline_sym47__ = 0; inline_sym47__ <= lcm_sym266__; + lcm_sym268__ = (lcm_sym272__ - 1); + for (int inline_sym47__ = 0; inline_sym47__ <= lcm_sym268__; ++inline_sym47__) { int inline_sym46__ = std::numeric_limits::min(); - lcm_sym265__ = (lcm_sym270__ - inline_sym47__); - inline_sym46__ = lcm_sym265__; + lcm_sym267__ = (lcm_sym272__ - inline_sym47__); + inline_sym46__ = lcm_sym267__; current_statement__ = 115; if (stan::model::rvalue(y, "y", stan::model::index_uni(i))[ - (lcm_sym265__ - 1)]) { + (lcm_sym267__ - 1)]) { inline_sym48__ = 1; - inline_sym45__ = lcm_sym265__; + inline_sym45__ = lcm_sym267__; break; } } @@ -18883,11 +18882,11 @@ class inlining_fail2_model final : public model_base_crtp epsilon_1dim__ = std::numeric_limits::min(); - lcm_sym264__ = (n_occasions - 1); - epsilon_1dim__ = lcm_sym264__; + lcm_sym266__ = (n_occasions - 1); + epsilon_1dim__ = lcm_sym266__; current_statement__ = 121; stan::math::validate_non_negative_index("epsilon", "n_occasions - 1", - lcm_sym264__); + lcm_sym266__); current_statement__ = 122; stan::math::validate_non_negative_index("phi", "M", M); current_statement__ = 123; @@ -18895,10 +18894,10 @@ class inlining_fail2_model final : public model_base_crtp current_statement__ = 123; - phi_2dim__ = lcm_sym264__; + phi_2dim__ = lcm_sym266__; current_statement__ = 123; stan::math::validate_non_negative_index("phi", "n_occasions - 1", - lcm_sym264__); + lcm_sym266__); current_statement__ = 124; stan::math::validate_non_negative_index("p", "M", M); current_statement__ = 125; @@ -18943,21 +18942,23 @@ class inlining_fail2_model final : public model_base_crtp (void) function__; // suppress unused var warning try { + int lcm_sym263__; + int lcm_sym262__; int lcm_sym261__; int lcm_sym260__; int lcm_sym259__; int lcm_sym258__; - int lcm_sym257__; int lcm_sym256__; - int lcm_sym254__; - Eigen::Matrix lcm_sym253__; - double lcm_sym252__; - double lcm_sym251__; - local_scalar_t__ lcm_sym250__; - local_scalar_t__ lcm_sym249__; - double lcm_sym248__; + Eigen::Matrix lcm_sym255__; + double lcm_sym254__; + double lcm_sym253__; + local_scalar_t__ lcm_sym252__; + local_scalar_t__ lcm_sym251__; + double lcm_sym250__; + double lcm_sym249__; + int lcm_sym248__; double lcm_sym247__; - int lcm_sym246__; + double lcm_sym246__; double lcm_sym245__; double lcm_sym244__; double lcm_sym243__; @@ -18969,11 +18970,11 @@ class inlining_fail2_model final : public model_base_crtp double lcm_sym237__; double lcm_sym236__; double lcm_sym235__; - double lcm_sym234__; - double lcm_sym233__; + int lcm_sym234__; + int lcm_sym233__; int lcm_sym232__; - int lcm_sym231__; - int lcm_sym230__; + double lcm_sym231__; + double lcm_sym230__; double lcm_sym229__; double lcm_sym228__; double lcm_sym227__; @@ -18986,18 +18987,18 @@ class inlining_fail2_model final : public model_base_crtp double lcm_sym220__; double lcm_sym219__; double lcm_sym218__; - double lcm_sym217__; - double lcm_sym216__; + int lcm_sym217__; + int lcm_sym216__; int lcm_sym215__; int lcm_sym214__; int lcm_sym213__; int lcm_sym212__; - int lcm_sym211__; - int lcm_sym210__; + Eigen::Matrix lcm_sym211__; + Eigen::Matrix lcm_sym210__; Eigen::Matrix lcm_sym209__; - Eigen::Matrix lcm_sym208__; - Eigen::Matrix lcm_sym207__; - int lcm_sym255__; + int lcm_sym257__; + int lcm_sym207__; + int lcm_sym206__; int lcm_sym205__; int lcm_sym204__; int lcm_sym203__; @@ -19007,8 +19008,6 @@ class inlining_fail2_model final : public model_base_crtp int lcm_sym199__; int lcm_sym198__; int lcm_sym197__; - int lcm_sym196__; - int lcm_sym195__; local_scalar_t__ mean_phi; current_statement__ = 1; mean_phi = in__.template read_constrain_lub Eigen::Matrix epsilon = Eigen::Matrix::Constant((n_occasions - 1), DUMMY_VAR__); - lcm_sym255__ = (n_occasions - 1); + lcm_sym257__ = (n_occasions - 1); epsilon = in__.template read>( - lcm_sym255__); + lcm_sym257__); local_scalar_t__ sigma; current_statement__ = 5; sigma = in__.template read_constrain_lub( 0, 5, lp__); Eigen::Matrix phi = - Eigen::Matrix::Constant(M, lcm_sym255__, + Eigen::Matrix::Constant(M, lcm_sym257__, DUMMY_VAR__); Eigen::Matrix p = Eigen::Matrix::Constant(M, n_occasions, @@ -19042,117 +19041,117 @@ class inlining_fail2_model final : public model_base_crtp Eigen::Matrix::Constant(M, n_occasions, DUMMY_VAR__); current_statement__ = 11; - if (stan::math::logical_gte(lcm_sym255__, 1)) { - lcm_sym197__ = stan::math::logical_gte(M, 1); - if (lcm_sym197__) { - lcm_sym250__ = stan::math::inv_logit( + if (stan::math::logical_gte(lcm_sym257__, 1)) { + lcm_sym199__ = stan::math::logical_gte(M, 1); + if (lcm_sym199__) { + lcm_sym252__ = stan::math::inv_logit( (stan::math::logit(mean_phi) + stan::model::rvalue(epsilon, "epsilon", stan::model::index_uni(1)))); - stan::model::assign(phi, lcm_sym250__, + stan::model::assign(phi, lcm_sym252__, "assigning variable phi", stan::model::index_uni(1), stan::model::index_uni(1)); for (int i = 2; i <= M; ++i) { current_statement__ = 9; - stan::model::assign(phi, lcm_sym250__, + stan::model::assign(phi, lcm_sym252__, "assigning variable phi", stan::model::index_uni(i), stan::model::index_uni(1)); } } - for (int t = 2; t <= lcm_sym255__; ++t) { + for (int t = 2; t <= lcm_sym257__; ++t) { current_statement__ = 10; - if (lcm_sym197__) { - lcm_sym249__ = stan::math::inv_logit( + if (lcm_sym199__) { + lcm_sym251__ = stan::math::inv_logit( (stan::math::logit(mean_phi) + stan::model::rvalue(epsilon, "epsilon", stan::model::index_uni(t)))); - stan::model::assign(phi, lcm_sym249__, + stan::model::assign(phi, lcm_sym251__, "assigning variable phi", stan::model::index_uni(1), stan::model::index_uni(t)); for (int i = 2; i <= M; ++i) { current_statement__ = 9; - stan::model::assign(phi, lcm_sym249__, + stan::model::assign(phi, lcm_sym251__, "assigning variable phi", stan::model::index_uni(i), stan::model::index_uni(t)); } } } } - stan::model::assign(lcm_sym253__, + stan::model::assign(lcm_sym255__, stan::math::rep_matrix(mean_p, M, n_occasions), - "assigning variable lcm_sym253__"); - stan::model::assign(p, lcm_sym253__, "assigning variable p"); + "assigning variable lcm_sym255__"); + stan::model::assign(p, lcm_sym255__, "assigning variable p"); Eigen::Matrix inline_sym22__; int inline_sym30__; inline_sym30__ = 0; for (int inline_sym31__ = 1; inline_sym31__ <= 1; ++inline_sym31__) { int inline_sym23__ = std::numeric_limits::min(); - lcm_sym254__ = stan::math::rows(lcm_sym253__); + lcm_sym256__ = stan::math::rows(lcm_sym255__); int inline_sym24__ = std::numeric_limits::min(); - lcm_sym246__ = stan::math::cols(lcm_sym253__); + lcm_sym248__ = stan::math::cols(lcm_sym255__); current_statement__ = 14; - stan::math::validate_non_negative_index("chi", "n_ind", lcm_sym254__); + stan::math::validate_non_negative_index("chi", "n_ind", lcm_sym256__); current_statement__ = 15; stan::math::validate_non_negative_index("chi", "n_occasions", - lcm_sym246__); + lcm_sym248__); Eigen::Matrix inline_sym25__ = - Eigen::Matrix::Constant(lcm_sym254__, - lcm_sym246__, DUMMY_VAR__); - for (int inline_sym29__ = 1; inline_sym29__ <= lcm_sym254__; + Eigen::Matrix::Constant(lcm_sym256__, + lcm_sym248__, DUMMY_VAR__); + for (int inline_sym29__ = 1; inline_sym29__ <= lcm_sym256__; ++inline_sym29__) { current_statement__ = 17; stan::model::assign(inline_sym25__, 1.0, "assigning variable inline_sym25__", stan::model::index_uni(inline_sym29__), - stan::model::index_uni(lcm_sym246__)); - lcm_sym211__ = (lcm_sym246__ - 1); - if (stan::math::logical_gte(lcm_sym211__, 1)) { + stan::model::index_uni(lcm_sym248__)); + lcm_sym213__ = (lcm_sym248__ - 1); + if (stan::math::logical_gte(lcm_sym213__, 1)) { int inline_sym26__ = std::numeric_limits::min(); int inline_sym27__ = std::numeric_limits::min(); - lcm_sym215__ = (lcm_sym211__ + 1); + lcm_sym217__ = (lcm_sym213__ + 1); current_statement__ = 20; stan::model::assign(inline_sym25__, stan::math::fma( (stan::model::rvalue(phi, "phi", stan::model::index_uni(inline_sym29__), - stan::model::index_uni(lcm_sym211__)) * + stan::model::index_uni(lcm_sym213__)) * (1 - - stan::model::rvalue(lcm_sym253__, "lcm_sym253__", + stan::model::rvalue(lcm_sym255__, "lcm_sym255__", stan::model::index_uni(inline_sym29__), - stan::model::index_uni(lcm_sym215__)))), + stan::model::index_uni(lcm_sym217__)))), stan::model::rvalue(inline_sym25__, "inline_sym25__", stan::model::index_uni(inline_sym29__), - stan::model::index_uni(lcm_sym215__)), + stan::model::index_uni(lcm_sym217__)), (1 - stan::model::rvalue(phi, "phi", stan::model::index_uni(inline_sym29__), - stan::model::index_uni(lcm_sym211__)))), + stan::model::index_uni(lcm_sym213__)))), "assigning variable inline_sym25__", stan::model::index_uni(inline_sym29__), - stan::model::index_uni(lcm_sym211__)); - for (int inline_sym28__ = 2; inline_sym28__ <= lcm_sym211__; + stan::model::index_uni(lcm_sym213__)); + for (int inline_sym28__ = 2; inline_sym28__ <= lcm_sym213__; ++inline_sym28__) { int inline_sym26__ = std::numeric_limits::min(); - lcm_sym210__ = (lcm_sym246__ - inline_sym28__); + lcm_sym212__ = (lcm_sym248__ - inline_sym28__); int inline_sym27__ = std::numeric_limits::min(); - lcm_sym214__ = (lcm_sym210__ + 1); + lcm_sym216__ = (lcm_sym212__ + 1); current_statement__ = 20; stan::model::assign(inline_sym25__, stan::math::fma( (stan::model::rvalue(phi, "phi", stan::model::index_uni(inline_sym29__), - stan::model::index_uni(lcm_sym210__)) * + stan::model::index_uni(lcm_sym212__)) * (1 - - stan::model::rvalue(lcm_sym253__, "lcm_sym253__", + stan::model::rvalue(lcm_sym255__, "lcm_sym255__", stan::model::index_uni(inline_sym29__), - stan::model::index_uni(lcm_sym214__)))), + stan::model::index_uni(lcm_sym216__)))), stan::model::rvalue(inline_sym25__, "inline_sym25__", stan::model::index_uni(inline_sym29__), - stan::model::index_uni(lcm_sym214__)), + stan::model::index_uni(lcm_sym216__)), (1 - stan::model::rvalue(phi, "phi", stan::model::index_uni(inline_sym29__), - stan::model::index_uni(lcm_sym210__)))), + stan::model::index_uni(lcm_sym212__)))), "assigning variable inline_sym25__", stan::model::index_uni(inline_sym29__), - stan::model::index_uni(lcm_sym210__)); + stan::model::index_uni(lcm_sym212__)); } } if (inline_sym30__) { @@ -19173,9 +19172,9 @@ class inlining_fail2_model final : public model_base_crtp current_statement__ = 6; stan::math::check_less_or_equal(function__, "phi", phi, 1); current_statement__ = 7; - stan::math::check_greater_or_equal(function__, "p", lcm_sym253__, 0); + stan::math::check_greater_or_equal(function__, "p", lcm_sym255__, 0); current_statement__ = 7; - stan::math::check_less_or_equal(function__, "p", lcm_sym253__, 1); + stan::math::check_less_or_equal(function__, "p", lcm_sym255__, 1); current_statement__ = 8; stan::math::check_greater_or_equal(function__, "chi", inline_sym22__, 0); current_statement__ = 8; @@ -19186,126 +19185,126 @@ class inlining_fail2_model final : public model_base_crtp int inline_sym39__ = std::numeric_limits::min(); { int inline_sym32__ = std::numeric_limits::min(); - lcm_sym260__ = stan::model::rvalue(stan::math::dims(y), "dims(y)", + lcm_sym262__ = stan::model::rvalue(stan::math::dims(y), "dims(y)", stan::model::index_uni(1)); int inline_sym33__ = std::numeric_limits::min(); - lcm_sym261__ = stan::model::rvalue(stan::math::dims(y), "dims(y)", + lcm_sym263__ = stan::model::rvalue(stan::math::dims(y), "dims(y)", stan::model::index_uni(2)); current_statement__ = 77; stan::math::validate_non_negative_index("qgamma", "n_occasions", - lcm_sym261__); + lcm_sym263__); Eigen::Matrix inline_sym34__ = - Eigen::Matrix::Constant(lcm_sym261__, + Eigen::Matrix::Constant(lcm_sym263__, std::numeric_limits::quiet_NaN()); - stan::model::assign(lcm_sym207__, stan::math::subtract(1.0, gamma), - "assigning variable lcm_sym207__"); - lcm_sym204__ = stan::math::logical_gte(lcm_sym260__, 1); - if (lcm_sym204__) { + stan::model::assign(lcm_sym209__, stan::math::subtract(1.0, gamma), + "assigning variable lcm_sym209__"); + lcm_sym206__ = stan::math::logical_gte(lcm_sym262__, 1); + if (lcm_sym206__) { current_statement__ = 79; stan::math::validate_non_negative_index("qp", "n_occasions", - lcm_sym261__); + lcm_sym263__); Eigen::Matrix inline_sym35__ = - Eigen::Matrix::Constant(lcm_sym261__, + Eigen::Matrix::Constant(lcm_sym263__, std::numeric_limits::quiet_NaN()); - stan::model::assign(lcm_sym209__, + stan::model::assign(lcm_sym211__, stan::math::subtract(1.0, stan::math::transpose( - stan::model::rvalue(lcm_sym253__, "lcm_sym253__", + stan::model::rvalue(lcm_sym255__, "lcm_sym255__", stan::model::index_uni(1)))), - "assigning variable lcm_sym209__"); - lcm_sym257__ = stan::model::rvalue(first, "first", + "assigning variable lcm_sym211__"); + lcm_sym259__ = stan::model::rvalue(first, "first", stan::model::index_uni(1)); - if (lcm_sym257__) { + if (lcm_sym259__) { current_statement__ = 95; - if (stan::math::logical_eq(lcm_sym257__, 1)) { + if (stan::math::logical_eq(lcm_sym259__, 1)) { current_statement__ = 93; lp_accum__.add( stan::math::bernoulli_lpmf(1, (stan::model::rvalue(gamma, "gamma", stan::model::index_uni(1)) * - stan::model::rvalue(lcm_sym253__, "lcm_sym253__", + stan::model::rvalue(lcm_sym255__, "lcm_sym255__", stan::model::index_uni(1), stan::model::index_uni(1))))); } else { current_statement__ = 87; stan::math::validate_non_negative_index("lp", "first[i]", - lcm_sym257__); + lcm_sym259__); Eigen::Matrix inline_sym36__ = Eigen::Matrix::Constant( - lcm_sym257__, DUMMY_VAR__); - lcm_sym213__ = (lcm_sym257__ - 1); + lcm_sym259__, DUMMY_VAR__); + lcm_sym215__ = (lcm_sym259__ - 1); stan::model::assign(inline_sym36__, (((stan::math::bernoulli_lpmf(1, stan::model::rvalue(gamma, "gamma", stan::model::index_uni(1))) + stan::math::bernoulli_lpmf(1, stan::math::prod( - stan::model::rvalue(lcm_sym209__, "lcm_sym209__", - stan::model::index_min_max(1, lcm_sym213__))))) + + stan::model::rvalue(lcm_sym211__, "lcm_sym211__", + stan::model::index_min_max(1, lcm_sym215__))))) + stan::math::bernoulli_lpmf(1, stan::math::prod( stan::model::rvalue(phi, "phi", stan::model::index_uni(1), - stan::model::index_min_max(1, lcm_sym213__))))) + stan::model::index_min_max(1, lcm_sym215__))))) + stan::math::bernoulli_lpmf(1, - stan::model::rvalue(lcm_sym253__, "lcm_sym253__", + stan::model::rvalue(lcm_sym255__, "lcm_sym255__", stan::model::index_uni(1), - stan::model::index_uni(lcm_sym257__)))), + stan::model::index_uni(lcm_sym259__)))), "assigning variable inline_sym36__", stan::model::index_uni(1)); - if (stan::math::logical_gte(lcm_sym213__, 2)) { + if (stan::math::logical_gte(lcm_sym215__, 2)) { current_statement__ = 89; stan::model::assign(inline_sym36__, ((((stan::math::bernoulli_lpmf(1, stan::math::prod( - stan::model::rvalue(lcm_sym207__, "lcm_sym207__", + stan::model::rvalue(lcm_sym209__, "lcm_sym209__", stan::model::index_min_max(1, 1)))) + stan::math::bernoulli_lpmf(1, stan::model::rvalue(gamma, "gamma", stan::model::index_uni(2)))) + stan::math::bernoulli_lpmf(1, stan::math::prod( - stan::model::rvalue(lcm_sym209__, "lcm_sym209__", - stan::model::index_min_max(2, lcm_sym213__))))) + stan::model::rvalue(lcm_sym211__, "lcm_sym211__", + stan::model::index_min_max(2, lcm_sym215__))))) + stan::math::bernoulli_lpmf(1, stan::math::prod( stan::model::rvalue(phi, "phi", stan::model::index_uni(1), - stan::model::index_min_max(2, lcm_sym213__))))) + stan::model::index_min_max(2, lcm_sym215__))))) + stan::math::bernoulli_lpmf(1, - stan::model::rvalue(lcm_sym253__, "lcm_sym253__", + stan::model::rvalue(lcm_sym255__, "lcm_sym255__", stan::model::index_uni(1), - stan::model::index_uni(lcm_sym257__)))), + stan::model::index_uni(lcm_sym259__)))), "assigning variable inline_sym36__", stan::model::index_uni(2)); for (int inline_sym37__ = 3; - inline_sym37__ <= lcm_sym213__; ++inline_sym37__) { + inline_sym37__ <= lcm_sym215__; ++inline_sym37__) { current_statement__ = 89; stan::model::assign(inline_sym36__, ((((stan::math::bernoulli_lpmf(1, stan::math::prod( - stan::model::rvalue(lcm_sym207__, - "lcm_sym207__", + stan::model::rvalue(lcm_sym209__, + "lcm_sym209__", stan::model::index_min_max(1, (inline_sym37__ - 1))))) + stan::math::bernoulli_lpmf(1, gamma[(inline_sym37__ - 1)])) + stan::math::bernoulli_lpmf(1, stan::math::prod( - stan::model::rvalue(lcm_sym209__, - "lcm_sym209__", - stan::model::index_min_max(inline_sym37__, lcm_sym213__))))) + stan::model::rvalue(lcm_sym211__, + "lcm_sym211__", + stan::model::index_min_max(inline_sym37__, lcm_sym215__))))) + stan::math::bernoulli_lpmf(1, stan::math::prod( stan::model::rvalue(phi, "phi", stan::model::index_uni(1), - stan::model::index_min_max(inline_sym37__, lcm_sym213__))))) + stan::model::index_min_max(inline_sym37__, lcm_sym215__))))) + stan::math::bernoulli_lpmf(1, - stan::model::rvalue(lcm_sym253__, "lcm_sym253__", + stan::model::rvalue(lcm_sym255__, "lcm_sym255__", stan::model::index_uni(1), - stan::model::index_uni(lcm_sym257__)))), + stan::model::index_uni(lcm_sym259__)))), "assigning variable inline_sym36__", stan::model::index_uni(inline_sym37__)); } } @@ -19313,38 +19312,38 @@ class inlining_fail2_model final : public model_base_crtp stan::model::assign(inline_sym36__, ((stan::math::bernoulli_lpmf(1, stan::math::prod( - stan::model::rvalue(lcm_sym207__, "lcm_sym207__", - stan::model::index_min_max(1, lcm_sym213__)))) + + stan::model::rvalue(lcm_sym209__, "lcm_sym209__", + stan::model::index_min_max(1, lcm_sym215__)))) + stan::math::bernoulli_lpmf(1, - gamma[(lcm_sym257__ - 1)])) + + gamma[(lcm_sym259__ - 1)])) + stan::math::bernoulli_lpmf(1, - stan::model::rvalue(lcm_sym253__, "lcm_sym253__", + stan::model::rvalue(lcm_sym255__, "lcm_sym255__", stan::model::index_uni(1), - stan::model::index_uni(lcm_sym257__)))), - "assigning variable inline_sym36__", stan::model::index_uni(lcm_sym257__)); + stan::model::index_uni(lcm_sym259__)))), + "assigning variable inline_sym36__", stan::model::index_uni(lcm_sym259__)); current_statement__ = 91; lp_accum__.add(stan::math::log_sum_exp(inline_sym36__)); } - lcm_sym259__ = stan::model::rvalue(last, "last", + lcm_sym261__ = stan::model::rvalue(last, "last", stan::model::index_uni(1)); - if (stan::math::logical_gte(lcm_sym259__, (lcm_sym257__ + 1))) { + if (stan::math::logical_gte(lcm_sym261__, (lcm_sym259__ + 1))) { current_statement__ = 96; lp_accum__.add( stan::math::bernoulli_lpmf(1, stan::model::rvalue(phi, "phi", stan::model::index_uni(1), - stan::model::index_uni(((lcm_sym257__ + 1) - 1))))); - lcm_sym231__ = ((lcm_sym257__ + 1) + 1); + stan::model::index_uni(((lcm_sym259__ + 1) - 1))))); + lcm_sym233__ = ((lcm_sym259__ + 1) + 1); lp_accum__.add( stan::math::bernoulli_lpmf( stan::model::rvalue(y, "y", stan::model::index_uni(1), - stan::model::index_uni((lcm_sym257__ + 1))), - stan::model::rvalue(lcm_sym253__, "lcm_sym253__", + stan::model::index_uni((lcm_sym259__ + 1))), + stan::model::rvalue(lcm_sym255__, "lcm_sym255__", stan::model::index_uni(1), - stan::model::index_uni((lcm_sym257__ + 1))))); - for (int inline_sym37__ = lcm_sym231__; - inline_sym37__ <= lcm_sym259__; ++inline_sym37__) { + stan::model::index_uni((lcm_sym259__ + 1))))); + for (int inline_sym37__ = lcm_sym233__; + inline_sym37__ <= lcm_sym261__; ++inline_sym37__) { current_statement__ = 96; lp_accum__.add( stan::math::bernoulli_lpmf(1, @@ -19357,7 +19356,7 @@ class inlining_fail2_model final : public model_base_crtp stan::model::rvalue(y, "y", stan::model::index_uni(1), stan::model::index_uni(inline_sym37__)), - stan::model::rvalue(lcm_sym253__, "lcm_sym253__", + stan::model::rvalue(lcm_sym255__, "lcm_sym255__", stan::model::index_uni(1), stan::model::index_uni(inline_sym37__)))); } @@ -19367,59 +19366,59 @@ class inlining_fail2_model final : public model_base_crtp stan::math::bernoulli_lpmf(1, stan::model::rvalue(inline_sym22__, "inline_sym22__", stan::model::index_uni(1), - stan::model::index_uni(lcm_sym259__)))); + stan::model::index_uni(lcm_sym261__)))); } else { - lcm_sym232__ = (lcm_sym261__ + 1); + lcm_sym234__ = (lcm_sym263__ + 1); stan::math::validate_non_negative_index("lp", "n_occasions + 1", - lcm_sym232__); + lcm_sym234__); Eigen::Matrix inline_sym36__ = Eigen::Matrix::Constant( - lcm_sym232__, DUMMY_VAR__); + lcm_sym234__, DUMMY_VAR__); current_statement__ = 82; stan::model::assign(inline_sym36__, ((stan::math::bernoulli_lpmf(1, stan::model::rvalue(gamma, "gamma", stan::model::index_uni(1))) + stan::math::bernoulli_lpmf(0, - stan::model::rvalue(lcm_sym253__, "lcm_sym253__", + stan::model::rvalue(lcm_sym255__, "lcm_sym255__", stan::model::index_uni(1), stan::model::index_uni(1)))) + stan::math::bernoulli_lpmf(1, stan::model::rvalue(inline_sym22__, "inline_sym22__", stan::model::index_uni(1), stan::model::index_uni(1)))), "assigning variable inline_sym36__", stan::model::index_uni(1)); - if (stan::math::logical_gte(lcm_sym261__, 2)) { + if (stan::math::logical_gte(lcm_sym263__, 2)) { current_statement__ = 83; stan::model::assign(inline_sym36__, (((stan::math::bernoulli_lpmf(1, stan::math::prod( - stan::model::rvalue(lcm_sym207__, "lcm_sym207__", + stan::model::rvalue(lcm_sym209__, "lcm_sym209__", stan::model::index_min_max(1, 1)))) + stan::math::bernoulli_lpmf(1, stan::model::rvalue(gamma, "gamma", stan::model::index_uni(2)))) + stan::math::bernoulli_lpmf(0, - stan::model::rvalue(lcm_sym253__, "lcm_sym253__", + stan::model::rvalue(lcm_sym255__, "lcm_sym255__", stan::model::index_uni(1), stan::model::index_uni(2)))) + stan::math::bernoulli_lpmf(1, stan::model::rvalue(inline_sym22__, "inline_sym22__", stan::model::index_uni(1), stan::model::index_uni(2)))), "assigning variable inline_sym36__", stan::model::index_uni(2)); - for (int inline_sym37__ = 3; inline_sym37__ <= lcm_sym261__; + for (int inline_sym37__ = 3; inline_sym37__ <= lcm_sym263__; ++inline_sym37__) { current_statement__ = 83; stan::model::assign(inline_sym36__, (((stan::math::bernoulli_lpmf(1, stan::math::prod( - stan::model::rvalue(lcm_sym207__, "lcm_sym207__", + stan::model::rvalue(lcm_sym209__, "lcm_sym209__", stan::model::index_min_max(1, (inline_sym37__ - 1))))) + stan::math::bernoulli_lpmf(1, gamma[(inline_sym37__ - 1)])) + stan::math::bernoulli_lpmf(0, - stan::model::rvalue(lcm_sym253__, "lcm_sym253__", + stan::model::rvalue(lcm_sym255__, "lcm_sym255__", stan::model::index_uni(1), stan::model::index_uni(inline_sym37__)))) + stan::math::bernoulli_lpmf(1, @@ -19432,121 +19431,121 @@ class inlining_fail2_model final : public model_base_crtp current_statement__ = 84; stan::model::assign(inline_sym36__, stan::math::bernoulli_lpmf(1, - stan::math::prod(lcm_sym207__)), - "assigning variable inline_sym36__", stan::model::index_uni(lcm_sym232__)); + stan::math::prod(lcm_sym209__)), + "assigning variable inline_sym36__", stan::model::index_uni(lcm_sym234__)); current_statement__ = 85; lp_accum__.add(stan::math::log_sum_exp(inline_sym36__)); } - for (int inline_sym38__ = 2; inline_sym38__ <= lcm_sym260__; + for (int inline_sym38__ = 2; inline_sym38__ <= lcm_sym262__; ++inline_sym38__) { current_statement__ = 79; stan::math::validate_non_negative_index("qp", "n_occasions", - lcm_sym261__); + lcm_sym263__); Eigen::Matrix inline_sym35__ = - Eigen::Matrix::Constant(lcm_sym261__, + Eigen::Matrix::Constant(lcm_sym263__, std::numeric_limits::quiet_NaN()); - stan::model::assign(lcm_sym208__, + stan::model::assign(lcm_sym210__, stan::math::subtract(1.0, stan::math::transpose( - stan::model::rvalue(lcm_sym253__, "lcm_sym253__", + stan::model::rvalue(lcm_sym255__, "lcm_sym255__", stan::model::index_uni(inline_sym38__)))), - "assigning variable lcm_sym208__"); - lcm_sym256__ = first[(inline_sym38__ - 1)]; - if (lcm_sym256__) { + "assigning variable lcm_sym210__"); + lcm_sym258__ = first[(inline_sym38__ - 1)]; + if (lcm_sym258__) { current_statement__ = 95; - if (stan::math::logical_eq(lcm_sym256__, 1)) { + if (stan::math::logical_eq(lcm_sym258__, 1)) { current_statement__ = 93; lp_accum__.add( stan::math::bernoulli_lpmf(1, (stan::model::rvalue(gamma, "gamma", stan::model::index_uni(1)) * - stan::model::rvalue(lcm_sym253__, "lcm_sym253__", + stan::model::rvalue(lcm_sym255__, "lcm_sym255__", stan::model::index_uni(inline_sym38__), stan::model::index_uni(1))))); } else { current_statement__ = 87; stan::math::validate_non_negative_index("lp", "first[i]", - lcm_sym256__); + lcm_sym258__); Eigen::Matrix inline_sym36__ = Eigen::Matrix::Constant( - lcm_sym256__, DUMMY_VAR__); - lcm_sym212__ = (lcm_sym256__ - 1); + lcm_sym258__, DUMMY_VAR__); + lcm_sym214__ = (lcm_sym258__ - 1); stan::model::assign(inline_sym36__, (((stan::math::bernoulli_lpmf(1, stan::model::rvalue(gamma, "gamma", stan::model::index_uni(1))) + stan::math::bernoulli_lpmf(1, stan::math::prod( - stan::model::rvalue(lcm_sym208__, "lcm_sym208__", - stan::model::index_min_max(1, lcm_sym212__))))) + stan::model::rvalue(lcm_sym210__, "lcm_sym210__", + stan::model::index_min_max(1, lcm_sym214__))))) + stan::math::bernoulli_lpmf(1, stan::math::prod( stan::model::rvalue(phi, "phi", stan::model::index_uni(inline_sym38__), - stan::model::index_min_max(1, lcm_sym212__))))) + stan::model::index_min_max(1, lcm_sym214__))))) + stan::math::bernoulli_lpmf(1, - stan::model::rvalue(lcm_sym253__, "lcm_sym253__", + stan::model::rvalue(lcm_sym255__, "lcm_sym255__", stan::model::index_uni(inline_sym38__), - stan::model::index_uni(lcm_sym256__)))), + stan::model::index_uni(lcm_sym258__)))), "assigning variable inline_sym36__", stan::model::index_uni(1)); - if (stan::math::logical_gte(lcm_sym212__, 2)) { + if (stan::math::logical_gte(lcm_sym214__, 2)) { current_statement__ = 89; stan::model::assign(inline_sym36__, ((((stan::math::bernoulli_lpmf(1, stan::math::prod( - stan::model::rvalue(lcm_sym207__, - "lcm_sym207__", + stan::model::rvalue(lcm_sym209__, + "lcm_sym209__", stan::model::index_min_max(1, 1)))) + stan::math::bernoulli_lpmf(1, stan::model::rvalue(gamma, "gamma", stan::model::index_uni(2)))) + stan::math::bernoulli_lpmf(1, stan::math::prod( - stan::model::rvalue(lcm_sym208__, - "lcm_sym208__", - stan::model::index_min_max(2, lcm_sym212__))))) + stan::model::rvalue(lcm_sym210__, + "lcm_sym210__", + stan::model::index_min_max(2, lcm_sym214__))))) + stan::math::bernoulli_lpmf(1, stan::math::prod( stan::model::rvalue(phi, "phi", stan::model::index_uni(inline_sym38__), - stan::model::index_min_max(2, lcm_sym212__))))) + stan::model::index_min_max(2, lcm_sym214__))))) + stan::math::bernoulli_lpmf(1, - stan::model::rvalue(lcm_sym253__, "lcm_sym253__", + stan::model::rvalue(lcm_sym255__, "lcm_sym255__", stan::model::index_uni(inline_sym38__), - stan::model::index_uni(lcm_sym256__)))), + stan::model::index_uni(lcm_sym258__)))), "assigning variable inline_sym36__", stan::model::index_uni(2)); for (int inline_sym37__ = 3; - inline_sym37__ <= lcm_sym212__; ++inline_sym37__) { + inline_sym37__ <= lcm_sym214__; ++inline_sym37__) { current_statement__ = 89; stan::model::assign(inline_sym36__, ((((stan::math::bernoulli_lpmf(1, stan::math::prod( - stan::model::rvalue(lcm_sym207__, - "lcm_sym207__", + stan::model::rvalue(lcm_sym209__, + "lcm_sym209__", stan::model::index_min_max(1, (inline_sym37__ - 1))))) + stan::math::bernoulli_lpmf(1, gamma[(inline_sym37__ - 1)])) + stan::math::bernoulli_lpmf(1, stan::math::prod( - stan::model::rvalue(lcm_sym208__, - "lcm_sym208__", - stan::model::index_min_max(inline_sym37__, lcm_sym212__))))) + stan::model::rvalue(lcm_sym210__, + "lcm_sym210__", + stan::model::index_min_max(inline_sym37__, lcm_sym214__))))) + stan::math::bernoulli_lpmf(1, stan::math::prod( stan::model::rvalue(phi, "phi", stan::model::index_uni(inline_sym38__), - stan::model::index_min_max(inline_sym37__, lcm_sym212__))))) + stan::model::index_min_max(inline_sym37__, lcm_sym214__))))) + stan::math::bernoulli_lpmf(1, - stan::model::rvalue(lcm_sym253__, "lcm_sym253__", + stan::model::rvalue(lcm_sym255__, "lcm_sym255__", stan::model::index_uni(inline_sym38__), - stan::model::index_uni(lcm_sym256__)))), + stan::model::index_uni(lcm_sym258__)))), "assigning variable inline_sym36__", stan::model::index_uni(inline_sym37__)); } } @@ -19554,37 +19553,37 @@ class inlining_fail2_model final : public model_base_crtp stan::model::assign(inline_sym36__, ((stan::math::bernoulli_lpmf(1, stan::math::prod( - stan::model::rvalue(lcm_sym207__, "lcm_sym207__", - stan::model::index_min_max(1, lcm_sym212__)))) + + stan::model::rvalue(lcm_sym209__, "lcm_sym209__", + stan::model::index_min_max(1, lcm_sym214__)))) + stan::math::bernoulli_lpmf(1, - gamma[(lcm_sym256__ - 1)])) + + gamma[(lcm_sym258__ - 1)])) + stan::math::bernoulli_lpmf(1, - stan::model::rvalue(lcm_sym253__, "lcm_sym253__", + stan::model::rvalue(lcm_sym255__, "lcm_sym255__", stan::model::index_uni(inline_sym38__), - stan::model::index_uni(lcm_sym256__)))), - "assigning variable inline_sym36__", stan::model::index_uni(lcm_sym256__)); + stan::model::index_uni(lcm_sym258__)))), + "assigning variable inline_sym36__", stan::model::index_uni(lcm_sym258__)); current_statement__ = 91; lp_accum__.add(stan::math::log_sum_exp(inline_sym36__)); } - lcm_sym258__ = last[(inline_sym38__ - 1)]; - if (stan::math::logical_gte(lcm_sym258__, (lcm_sym256__ + 1))) { + lcm_sym260__ = last[(inline_sym38__ - 1)]; + if (stan::math::logical_gte(lcm_sym260__, (lcm_sym258__ + 1))) { current_statement__ = 96; lp_accum__.add( stan::math::bernoulli_lpmf(1, stan::model::rvalue(phi, "phi", stan::model::index_uni(inline_sym38__), - stan::model::index_uni(((lcm_sym256__ + 1) - 1))))); - lcm_sym230__ = ((lcm_sym256__ + 1) + 1); + stan::model::index_uni(((lcm_sym258__ + 1) - 1))))); + lcm_sym232__ = ((lcm_sym258__ + 1) + 1); lp_accum__.add( stan::math::bernoulli_lpmf( stan::model::rvalue(y, "y", stan::model::index_uni(inline_sym38__), - stan::model::index_uni((lcm_sym256__ + 1))), - stan::model::rvalue(lcm_sym253__, "lcm_sym253__", + stan::model::index_uni((lcm_sym258__ + 1))), + stan::model::rvalue(lcm_sym255__, "lcm_sym255__", stan::model::index_uni(inline_sym38__), - stan::model::index_uni((lcm_sym256__ + 1))))); - for (int inline_sym37__ = lcm_sym230__; - inline_sym37__ <= lcm_sym258__; ++inline_sym37__) { + stan::model::index_uni((lcm_sym258__ + 1))))); + for (int inline_sym37__ = lcm_sym232__; + inline_sym37__ <= lcm_sym260__; ++inline_sym37__) { current_statement__ = 96; lp_accum__.add( stan::math::bernoulli_lpmf(1, @@ -19595,7 +19594,7 @@ class inlining_fail2_model final : public model_base_crtp lp_accum__.add( stan::math::bernoulli_lpmf( y[(inline_sym38__ - 1)][(inline_sym37__ - 1)], - stan::model::rvalue(lcm_sym253__, "lcm_sym253__", + stan::model::rvalue(lcm_sym255__, "lcm_sym255__", stan::model::index_uni(inline_sym38__), stan::model::index_uni(inline_sym37__)))); } @@ -19605,22 +19604,22 @@ class inlining_fail2_model final : public model_base_crtp stan::math::bernoulli_lpmf(1, stan::model::rvalue(inline_sym22__, "inline_sym22__", stan::model::index_uni(inline_sym38__), - stan::model::index_uni(lcm_sym258__)))); + stan::model::index_uni(lcm_sym260__)))); } else { - lcm_sym232__ = (lcm_sym261__ + 1); + lcm_sym234__ = (lcm_sym263__ + 1); stan::math::validate_non_negative_index("lp", "n_occasions + 1", - lcm_sym232__); + lcm_sym234__); Eigen::Matrix inline_sym36__ = Eigen::Matrix::Constant( - lcm_sym232__, DUMMY_VAR__); + lcm_sym234__, DUMMY_VAR__); current_statement__ = 82; stan::model::assign(inline_sym36__, ((stan::math::bernoulli_lpmf(1, stan::model::rvalue(gamma, "gamma", stan::model::index_uni(1))) + stan::math::bernoulli_lpmf(0, - stan::model::rvalue(lcm_sym253__, "lcm_sym253__", + stan::model::rvalue(lcm_sym255__, "lcm_sym255__", stan::model::index_uni(inline_sym38__), stan::model::index_uni(1)))) + stan::math::bernoulli_lpmf(1, @@ -19628,18 +19627,18 @@ class inlining_fail2_model final : public model_base_crtp stan::model::index_uni(inline_sym38__), stan::model::index_uni(1)))), "assigning variable inline_sym36__", stan::model::index_uni(1)); - if (stan::math::logical_gte(lcm_sym261__, 2)) { + if (stan::math::logical_gte(lcm_sym263__, 2)) { current_statement__ = 83; stan::model::assign(inline_sym36__, (((stan::math::bernoulli_lpmf(1, stan::math::prod( - stan::model::rvalue(lcm_sym207__, "lcm_sym207__", + stan::model::rvalue(lcm_sym209__, "lcm_sym209__", stan::model::index_min_max(1, 1)))) + stan::math::bernoulli_lpmf(1, stan::model::rvalue(gamma, "gamma", stan::model::index_uni(2)))) + stan::math::bernoulli_lpmf(0, - stan::model::rvalue(lcm_sym253__, "lcm_sym253__", + stan::model::rvalue(lcm_sym255__, "lcm_sym255__", stan::model::index_uni(inline_sym38__), stan::model::index_uni(2)))) + stan::math::bernoulli_lpmf(1, @@ -19648,19 +19647,19 @@ class inlining_fail2_model final : public model_base_crtp stan::model::index_uni(2)))), "assigning variable inline_sym36__", stan::model::index_uni(2)); for (int inline_sym37__ = 3; - inline_sym37__ <= lcm_sym261__; ++inline_sym37__) { + inline_sym37__ <= lcm_sym263__; ++inline_sym37__) { current_statement__ = 83; stan::model::assign(inline_sym36__, (((stan::math::bernoulli_lpmf(1, stan::math::prod( - stan::model::rvalue(lcm_sym207__, - "lcm_sym207__", + stan::model::rvalue(lcm_sym209__, + "lcm_sym209__", stan::model::index_min_max(1, (inline_sym37__ - 1))))) + stan::math::bernoulli_lpmf(1, gamma[(inline_sym37__ - 1)])) + stan::math::bernoulli_lpmf(0, - stan::model::rvalue(lcm_sym253__, "lcm_sym253__", + stan::model::rvalue(lcm_sym255__, "lcm_sym255__", stan::model::index_uni(inline_sym38__), stan::model::index_uni(inline_sym37__)))) + stan::math::bernoulli_lpmf(1, @@ -19674,8 +19673,8 @@ class inlining_fail2_model final : public model_base_crtp current_statement__ = 84; stan::model::assign(inline_sym36__, stan::math::bernoulli_lpmf(1, - stan::math::prod(lcm_sym207__)), - "assigning variable inline_sym36__", stan::model::index_uni(lcm_sym232__)); + stan::math::prod(lcm_sym209__)), + "assigning variable inline_sym36__", stan::model::index_uni(lcm_sym234__)); current_statement__ = 85; lp_accum__.add(stan::math::log_sum_exp(inline_sym36__)); } @@ -19715,63 +19714,64 @@ class inlining_fail2_model final : public model_base_crtp (void) function__; // suppress unused var warning try { + double lcm_sym196__; + int lcm_sym195__; int lcm_sym194__; int lcm_sym193__; int lcm_sym192__; int lcm_sym191__; int lcm_sym190__; - int lcm_sym189__; - double lcm_sym162__; + double lcm_sym163__; + int lcm_sym188__; int lcm_sym187__; int lcm_sym186__; int lcm_sym185__; int lcm_sym184__; int lcm_sym183__; - int lcm_sym182__; - double lcm_sym181__; - int lcm_sym180__; - double lcm_sym179__; + double lcm_sym182__; + int lcm_sym181__; + double lcm_sym180__; + int lcm_sym179__; int lcm_sym178__; int lcm_sym177__; int lcm_sym176__; - int lcm_sym175__; - Eigen::Matrix lcm_sym174__; - std::vector> lcm_sym173__; + Eigen::Matrix lcm_sym175__; + std::vector> lcm_sym174__; + local_scalar_t__ lcm_sym173__; local_scalar_t__ lcm_sym172__; - local_scalar_t__ lcm_sym171__; + double lcm_sym171__; double lcm_sym170__; double lcm_sym169__; double lcm_sym168__; double lcm_sym167__; double lcm_sym166__; - double lcm_sym165__; - Eigen::Matrix lcm_sym164__; - int lcm_sym163__; + Eigen::Matrix lcm_sym165__; + int lcm_sym164__; + int lcm_sym158__; int lcm_sym157__; int lcm_sym156__; int lcm_sym155__; - int lcm_sym154__; + double lcm_sym154__; double lcm_sym153__; double lcm_sym152__; int lcm_sym151__; int lcm_sym150__; double lcm_sym149__; - double lcm_sym148__; + int lcm_sym148__; int lcm_sym147__; int lcm_sym146__; int lcm_sym145__; int lcm_sym144__; int lcm_sym143__; - int lcm_sym142__; - int lcm_sym188__; + int lcm_sym189__; + int lcm_sym141__; int lcm_sym140__; int lcm_sym139__; int lcm_sym138__; int lcm_sym137__; int lcm_sym136__; int lcm_sym135__; - int lcm_sym134__; - Eigen::Matrix lcm_sym133__; + Eigen::Matrix lcm_sym134__; double mean_phi; current_statement__ = 1; mean_phi = in__.template read_constrain_lub Eigen::Matrix epsilon = Eigen::Matrix::Constant((n_occasions - 1), std::numeric_limits::quiet_NaN()); - lcm_sym188__ = (n_occasions - 1); + lcm_sym189__ = (n_occasions - 1); epsilon = in__.template read>( - lcm_sym188__); + lcm_sym189__); double sigma; current_statement__ = 5; sigma = in__.template read_constrain_lub( 0, 5, lp__); Eigen::Matrix phi = - Eigen::Matrix::Constant(M, lcm_sym188__, + Eigen::Matrix::Constant(M, lcm_sym189__, std::numeric_limits::quiet_NaN()); Eigen::Matrix p = Eigen::Matrix::Constant(M, n_occasions, @@ -19815,37 +19815,37 @@ class inlining_fail2_model final : public model_base_crtp return ; } current_statement__ = 11; - if (stan::math::logical_gte(lcm_sym188__, 1)) { + if (stan::math::logical_gte(lcm_sym189__, 1)) { { - lcm_sym134__ = stan::math::logical_gte(M, 1); - if (lcm_sym134__) { - lcm_sym172__ = stan::math::inv_logit( + lcm_sym135__ = stan::math::logical_gte(M, 1); + if (lcm_sym135__) { + lcm_sym173__ = stan::math::inv_logit( (stan::math::logit(mean_phi) + stan::model::rvalue(epsilon, "epsilon", stan::model::index_uni(1)))); - stan::model::assign(phi, lcm_sym172__, + stan::model::assign(phi, lcm_sym173__, "assigning variable phi", stan::model::index_uni(1), stan::model::index_uni(1)); for (int i = 2; i <= M; ++i) { current_statement__ = 9; - stan::model::assign(phi, lcm_sym172__, + stan::model::assign(phi, lcm_sym173__, "assigning variable phi", stan::model::index_uni(i), stan::model::index_uni(1)); } } - for (int t = 2; t <= lcm_sym188__; ++t) { + for (int t = 2; t <= lcm_sym189__; ++t) { current_statement__ = 10; - if (lcm_sym134__) { - lcm_sym171__ = stan::math::inv_logit( + if (lcm_sym135__) { + lcm_sym172__ = stan::math::inv_logit( (stan::math::logit(mean_phi) + stan::model::rvalue(epsilon, "epsilon", stan::model::index_uni(t)))); - stan::model::assign(phi, lcm_sym171__, + stan::model::assign(phi, lcm_sym172__, "assigning variable phi", stan::model::index_uni(1), stan::model::index_uni(t)); for (int i = 2; i <= M; ++i) { current_statement__ = 9; - stan::model::assign(phi, lcm_sym171__, + stan::model::assign(phi, lcm_sym172__, "assigning variable phi", stan::model::index_uni(i), stan::model::index_uni(t)); } @@ -19853,47 +19853,47 @@ class inlining_fail2_model final : public model_base_crtp } } } else { - lcm_sym134__ = stan::math::logical_gte(M, 1); + lcm_sym135__ = stan::math::logical_gte(M, 1); } - stan::model::assign(lcm_sym174__, + stan::model::assign(lcm_sym175__, stan::math::rep_matrix(mean_p, M, n_occasions), - "assigning variable lcm_sym174__"); - stan::model::assign(p, lcm_sym174__, "assigning variable p"); + "assigning variable lcm_sym175__"); + stan::model::assign(p, lcm_sym175__, "assigning variable p"); Eigen::Matrix inline_sym1__; int inline_sym9__; inline_sym9__ = 0; for (int inline_sym10__ = 1; inline_sym10__ <= 1; ++inline_sym10__) { int inline_sym2__ = std::numeric_limits::min(); - lcm_sym176__ = stan::math::rows(lcm_sym174__); + lcm_sym177__ = stan::math::rows(lcm_sym175__); int inline_sym3__ = std::numeric_limits::min(); - lcm_sym163__ = stan::math::cols(lcm_sym174__); + lcm_sym164__ = stan::math::cols(lcm_sym175__); current_statement__ = 14; - stan::math::validate_non_negative_index("chi", "n_ind", lcm_sym176__); + stan::math::validate_non_negative_index("chi", "n_ind", lcm_sym177__); current_statement__ = 15; stan::math::validate_non_negative_index("chi", "n_occasions", - lcm_sym163__); + lcm_sym164__); Eigen::Matrix inline_sym4__ = - Eigen::Matrix::Constant(lcm_sym176__, - lcm_sym163__, DUMMY_VAR__); - for (int inline_sym8__ = 1; inline_sym8__ <= lcm_sym176__; + Eigen::Matrix::Constant(lcm_sym177__, + lcm_sym164__, DUMMY_VAR__); + for (int inline_sym8__ = 1; inline_sym8__ <= lcm_sym177__; ++inline_sym8__) { current_statement__ = 17; stan::model::assign(inline_sym4__, 1.0, "assigning variable inline_sym4__", stan::model::index_uni(inline_sym8__), - stan::model::index_uni(lcm_sym163__)); - lcm_sym145__ = (lcm_sym163__ - 1); - if (stan::math::logical_gte(lcm_sym145__, 1)) { + stan::model::index_uni(lcm_sym164__)); + lcm_sym146__ = (lcm_sym164__ - 1); + if (stan::math::logical_gte(lcm_sym146__, 1)) { int inline_sym5__ = std::numeric_limits::min(); int inline_sym6__ = std::numeric_limits::min(); - lcm_sym151__ = (lcm_sym145__ + 1); + lcm_sym151__ = (lcm_sym146__ + 1); current_statement__ = 20; stan::model::assign(inline_sym4__, stan::math::fma( (stan::model::rvalue(phi, "phi", stan::model::index_uni(inline_sym8__), - stan::model::index_uni(lcm_sym145__)) * + stan::model::index_uni(lcm_sym146__)) * (1 - - stan::model::rvalue(lcm_sym174__, "lcm_sym174__", + stan::model::rvalue(lcm_sym175__, "lcm_sym175__", stan::model::index_uni(inline_sym8__), stan::model::index_uni(lcm_sym151__)))), stan::model::rvalue(inline_sym4__, "inline_sym4__", @@ -19902,23 +19902,23 @@ class inlining_fail2_model final : public model_base_crtp (1 - stan::model::rvalue(phi, "phi", stan::model::index_uni(inline_sym8__), - stan::model::index_uni(lcm_sym145__)))), + stan::model::index_uni(lcm_sym146__)))), "assigning variable inline_sym4__", stan::model::index_uni(inline_sym8__), - stan::model::index_uni(lcm_sym145__)); - for (int inline_sym7__ = 2; inline_sym7__ <= lcm_sym145__; + stan::model::index_uni(lcm_sym146__)); + for (int inline_sym7__ = 2; inline_sym7__ <= lcm_sym146__; ++inline_sym7__) { int inline_sym5__ = std::numeric_limits::min(); - lcm_sym144__ = (lcm_sym163__ - inline_sym7__); + lcm_sym145__ = (lcm_sym164__ - inline_sym7__); int inline_sym6__ = std::numeric_limits::min(); - lcm_sym150__ = (lcm_sym144__ + 1); + lcm_sym150__ = (lcm_sym145__ + 1); current_statement__ = 20; stan::model::assign(inline_sym4__, stan::math::fma( (stan::model::rvalue(phi, "phi", stan::model::index_uni(inline_sym8__), - stan::model::index_uni(lcm_sym144__)) * + stan::model::index_uni(lcm_sym145__)) * (1 - - stan::model::rvalue(lcm_sym174__, "lcm_sym174__", + stan::model::rvalue(lcm_sym175__, "lcm_sym175__", stan::model::index_uni(inline_sym8__), stan::model::index_uni(lcm_sym150__)))), stan::model::rvalue(inline_sym4__, "inline_sym4__", @@ -19927,9 +19927,9 @@ class inlining_fail2_model final : public model_base_crtp (1 - stan::model::rvalue(phi, "phi", stan::model::index_uni(inline_sym8__), - stan::model::index_uni(lcm_sym144__)))), + stan::model::index_uni(lcm_sym145__)))), "assigning variable inline_sym4__", stan::model::index_uni(inline_sym8__), - stan::model::index_uni(lcm_sym144__)); + stan::model::index_uni(lcm_sym145__)); } } if (inline_sym9__) { @@ -19950,16 +19950,16 @@ class inlining_fail2_model final : public model_base_crtp current_statement__ = 6; stan::math::check_less_or_equal(function__, "phi", phi, 1); current_statement__ = 7; - stan::math::check_greater_or_equal(function__, "p", lcm_sym174__, 0); + stan::math::check_greater_or_equal(function__, "p", lcm_sym175__, 0); current_statement__ = 7; - stan::math::check_less_or_equal(function__, "p", lcm_sym174__, 1); + stan::math::check_less_or_equal(function__, "p", lcm_sym175__, 1); current_statement__ = 8; stan::math::check_greater_or_equal(function__, "chi", inline_sym1__, 0); current_statement__ = 8; stan::math::check_less_or_equal(function__, "chi", inline_sym1__, 1); if (emit_transformed_parameters__) { out__.write(phi); - out__.write(lcm_sym174__); + out__.write(lcm_sym175__); out__.write(inline_sym1__); } if (stan::math::logical_negation(emit_generated_quantities__)) { @@ -19979,31 +19979,31 @@ class inlining_fail2_model final : public model_base_crtp std::vector>(M, std::vector(n_occasions, std::numeric_limits::min())); current_statement__ = 39; - if (lcm_sym134__) { + if (lcm_sym135__) { int q = std::numeric_limits::min(); double mu2 = std::numeric_limits::quiet_NaN(); - lcm_sym162__ = stan::model::rvalue(gamma, "gamma", + lcm_sym163__ = stan::model::rvalue(gamma, "gamma", stan::model::index_uni(1)); stan::model::assign(z, - stan::math::bernoulli_rng(lcm_sym162__, base_rng__), + stan::math::bernoulli_rng(lcm_sym163__, base_rng__), "assigning variable z", stan::model::index_uni(1), stan::model::index_uni(1)); - lcm_sym136__ = stan::math::logical_gte(n_occasions, 2); - if (lcm_sym136__) { - lcm_sym192__ = stan::model::rvalue(z, "z", + lcm_sym137__ = stan::math::logical_gte(n_occasions, 2); + if (lcm_sym137__) { + lcm_sym193__ = stan::model::rvalue(z, "z", stan::model::index_uni(1), stan::model::index_uni(1)); - lcm_sym157__ = (1 * (1 - lcm_sym192__)); - q = lcm_sym157__; - lcm_sym169__ = stan::math::fma( + lcm_sym158__ = (1 * (1 - lcm_sym193__)); + q = lcm_sym158__; + lcm_sym170__ = stan::math::fma( stan::model::rvalue(phi, "phi", stan::model::index_uni(1), - stan::model::index_uni(1)), lcm_sym192__, + stan::model::index_uni(1)), lcm_sym193__, (stan::model::rvalue(gamma, "gamma", - stan::model::index_uni(2)) * lcm_sym157__)); + stan::model::index_uni(2)) * lcm_sym158__)); current_statement__ = 33; stan::model::assign(z, - stan::math::bernoulli_rng(lcm_sym169__, base_rng__), + stan::math::bernoulli_rng(lcm_sym170__, base_rng__), "assigning variable z", stan::model::index_uni(1), stan::model::index_uni(2)); for (int t = 3; t <= n_occasions; ++t) { @@ -20013,7 +20013,7 @@ class inlining_fail2_model final : public model_base_crtp stan::model::rvalue(z, "z", stan::model::index_uni(1), stan::model::index_uni((t - 1))))); - lcm_sym170__ = stan::math::fma( + lcm_sym171__ = stan::math::fma( stan::model::rvalue(phi, "phi", stan::model::index_uni(1), stan::model::index_uni((t - 1))), @@ -20024,7 +20024,7 @@ class inlining_fail2_model final : public model_base_crtp stan::model::index_uni(t)) * q)); current_statement__ = 33; stan::model::assign(z, - stan::math::bernoulli_rng(lcm_sym170__, base_rng__), + stan::math::bernoulli_rng(lcm_sym171__, base_rng__), "assigning variable z", stan::model::index_uni(1), stan::model::index_uni(t)); } @@ -20034,18 +20034,18 @@ class inlining_fail2_model final : public model_base_crtp double mu2 = std::numeric_limits::quiet_NaN(); current_statement__ = 36; stan::model::assign(z, - stan::math::bernoulli_rng(lcm_sym162__, base_rng__), + stan::math::bernoulli_rng(lcm_sym163__, base_rng__), "assigning variable z", stan::model::index_uni(i), stan::model::index_uni(1)); current_statement__ = 37; - if (lcm_sym136__) { - lcm_sym156__ = (1 * + if (lcm_sym137__) { + lcm_sym157__ = (1 * (1 - stan::model::rvalue(z, "z", stan::model::index_uni(i), stan::model::index_uni(1)))); - q = lcm_sym156__; - lcm_sym167__ = stan::math::fma( + q = lcm_sym157__; + lcm_sym168__ = stan::math::fma( stan::model::rvalue(phi, "phi", stan::model::index_uni(i), stan::model::index_uni(1)), @@ -20053,10 +20053,10 @@ class inlining_fail2_model final : public model_base_crtp stan::model::index_uni(i), stan::model::index_uni(1)), (stan::model::rvalue(gamma, "gamma", - stan::model::index_uni(2)) * lcm_sym156__)); + stan::model::index_uni(2)) * lcm_sym157__)); current_statement__ = 33; stan::model::assign(z, - stan::math::bernoulli_rng(lcm_sym167__, base_rng__), + stan::math::bernoulli_rng(lcm_sym168__, base_rng__), "assigning variable z", stan::model::index_uni(i), stan::model::index_uni(2)); for (int t = 3; t <= n_occasions; ++t) { @@ -20066,7 +20066,7 @@ class inlining_fail2_model final : public model_base_crtp stan::model::rvalue(z, "z", stan::model::index_uni(i), stan::model::index_uni((t - 1))))); - lcm_sym168__ = stan::math::fma( + lcm_sym169__ = stan::math::fma( stan::model::rvalue(phi, "phi", stan::model::index_uni(i), stan::model::index_uni((t - 1))), @@ -20077,7 +20077,7 @@ class inlining_fail2_model final : public model_base_crtp stan::model::index_uni(t)) * q)); current_statement__ = 33; stan::model::assign(z, - stan::math::bernoulli_rng(lcm_sym168__, base_rng__), + stan::math::bernoulli_rng(lcm_sym169__, base_rng__), "assigning variable z", stan::model::index_uni(i), stan::model::index_uni(t)); } @@ -20096,23 +20096,23 @@ class inlining_fail2_model final : public model_base_crtp inline_sym16__ = 0; for (int inline_sym17__ = 1; inline_sym17__ <= 1; ++inline_sym17__) { int inline_sym12__ = std::numeric_limits::min(); - lcm_sym175__ = stan::math::rows(gamma); + lcm_sym176__ = stan::math::rows(gamma); current_statement__ = 43; stan::math::validate_non_negative_index("log_cprob", "N", - lcm_sym175__); + lcm_sym176__); Eigen::Matrix inline_sym13__ = - Eigen::Matrix::Constant(lcm_sym175__, + Eigen::Matrix::Constant(lcm_sym176__, DUMMY_VAR__); local_scalar_t__ inline_sym14__ = DUMMY_VAR__; - if (stan::math::logical_gte(lcm_sym175__, 1)) { - lcm_sym162__ = stan::model::rvalue(gamma, "gamma", + if (stan::math::logical_gte(lcm_sym176__, 1)) { + lcm_sym163__ = stan::model::rvalue(gamma, "gamma", stan::model::index_uni(1)); stan::model::assign(inline_sym13__, - (stan::math::log(lcm_sym162__) + 0), + (stan::math::log(lcm_sym163__) + 0), "assigning variable inline_sym13__", stan::model::index_uni(1)); current_statement__ = 46; - inline_sym14__ = (0 + stan::math::log1m(lcm_sym162__)); - for (int inline_sym15__ = 2; inline_sym15__ <= lcm_sym175__; + inline_sym14__ = (0 + stan::math::log1m(lcm_sym163__)); + for (int inline_sym15__ = 2; inline_sym15__ <= lcm_sym176__; ++inline_sym15__) { current_statement__ = 47; stan::model::assign(inline_sym13__, @@ -20152,25 +20152,25 @@ class inlining_fail2_model final : public model_base_crtp stan::math::validate_non_negative_index("Nalive", "M", M); std::vector Nalive = std::vector(M, std::numeric_limits::min()); - lcm_sym179__ = stan::math::square(sigma); - sigma2 = lcm_sym179__; - lcm_sym181__ = stan::math::sum(inline_sym11__); - psi = lcm_sym181__; - stan::model::assign(lcm_sym133__, - stan::math::divide(inline_sym11__, lcm_sym181__), - "assigning variable lcm_sym133__"); - stan::model::assign(b, lcm_sym133__, "assigning variable b"); + lcm_sym180__ = stan::math::square(sigma); + sigma2 = lcm_sym180__; + lcm_sym182__ = stan::math::sum(inline_sym11__); + psi = lcm_sym182__; + stan::model::assign(lcm_sym134__, + stan::math::divide(inline_sym11__, lcm_sym182__), + "assigning variable lcm_sym134__"); + stan::model::assign(b, lcm_sym134__, "assigning variable b"); current_statement__ = 64; - if (lcm_sym134__) { + if (lcm_sym135__) { int f = std::numeric_limits::min(); int inline_sym18__; int inline_sym20__; inline_sym20__ = 0; for (int inline_sym21__ = 1; inline_sym21__ <= 1; ++inline_sym21__) { - lcm_sym178__ = stan::math::size( + lcm_sym179__ = stan::math::size( stan::model::rvalue(z, "z", stan::model::index_uni(1))); - for (int inline_sym19__ = 1; inline_sym19__ <= lcm_sym178__; + for (int inline_sym19__ = 1; inline_sym19__ <= lcm_sym179__; ++inline_sym19__) { current_statement__ = 59; if (stan::model::rvalue(z, "z", @@ -20202,10 +20202,10 @@ class inlining_fail2_model final : public model_base_crtp inline_sym20__ = 0; for (int inline_sym21__ = 1; inline_sym21__ <= 1; ++inline_sym21__) { - lcm_sym177__ = stan::math::size( + lcm_sym178__ = stan::math::size( stan::model::rvalue(z, "z", stan::model::index_uni(i))); - for (int inline_sym19__ = 1; inline_sym19__ <= lcm_sym177__; + for (int inline_sym19__ = 1; inline_sym19__ <= lcm_sym178__; ++inline_sym19__) { current_statement__ = 59; if (stan::model::rvalue(z, "z", @@ -20232,8 +20232,8 @@ class inlining_fail2_model final : public model_base_crtp } } } - lcm_sym135__ = stan::math::logical_gte(n_occasions, 1); - if (lcm_sym135__) { + lcm_sym136__ = stan::math::logical_gte(n_occasions, 1); + if (lcm_sym136__) { current_statement__ = 65; stan::model::assign(N, stan::math::sum( @@ -20262,7 +20262,7 @@ class inlining_fail2_model final : public model_base_crtp } } current_statement__ = 71; - if (lcm_sym134__) { + if (lcm_sym135__) { current_statement__ = 68; stan::model::assign(Nind, stan::math::sum( @@ -20292,14 +20292,14 @@ class inlining_fail2_model final : public model_base_crtp current_statement__ = 72; Nsuper = stan::math::sum(Nalive); } - out__.write(lcm_sym179__); - out__.write(lcm_sym181__); - out__.write(lcm_sym133__); + out__.write(lcm_sym180__); + out__.write(lcm_sym182__); + out__.write(lcm_sym134__); out__.write(Nsuper); out__.write(N); out__.write(B); - if (lcm_sym135__) { - if (lcm_sym134__) { + if (lcm_sym136__) { + if (lcm_sym135__) { out__.write( stan::model::rvalue(z, "z", stan::model::index_uni(1), stan::model::index_uni(1))); @@ -20310,7 +20310,7 @@ class inlining_fail2_model final : public model_base_crtp } } for (int sym1__ = 2; sym1__ <= n_occasions; ++sym1__) { - if (lcm_sym134__) { + if (lcm_sym135__) { out__.write( stan::model::rvalue(z, "z", stan::model::index_uni(1), stan::model::index_uni(sym1__))); @@ -20338,9 +20338,9 @@ class inlining_fail2_model final : public model_base_crtp local_scalar_t__ DUMMY_VAR__(std::numeric_limits::quiet_NaN()); try { - int lcm_sym132__; + int lcm_sym133__; + int lcm_sym131__; int lcm_sym130__; - int lcm_sym129__; int pos__; pos__ = 1; local_scalar_t__ mean_phi; @@ -20364,11 +20364,11 @@ class inlining_fail2_model final : public model_base_crtp Eigen::Matrix epsilon = Eigen::Matrix::Constant((n_occasions - 1), DUMMY_VAR__); - lcm_sym132__ = (n_occasions - 1); - if (stan::math::logical_gte(lcm_sym132__, 1)) { + lcm_sym133__ = (n_occasions - 1); + if (stan::math::logical_gte(lcm_sym133__, 1)) { stan::model::assign(epsilon, in__.read(), "assigning variable epsilon", stan::model::index_uni(1)); - for (int sym1__ = 2; sym1__ <= lcm_sym132__; ++sym1__) { + for (int sym1__ = 2; sym1__ <= lcm_sym133__; ++sym1__) { stan::model::assign(epsilon, in__.read(), "assigning variable epsilon", stan::model::index_uni(sym1__)); } @@ -20421,41 +20421,41 @@ class inlining_fail2_model final : public model_base_crtp param_names__.emplace_back(std::string() + "mean_phi"); param_names__.emplace_back(std::string() + "mean_p"); - for (int sym278__ = 1; sym278__ <= n_occasions; ++sym278__) { + for (int sym280__ = 1; sym280__ <= n_occasions; ++sym280__) { { - param_names__.emplace_back(std::string() + "gamma" + '.' + std::to_string(sym278__)); + param_names__.emplace_back(std::string() + "gamma" + '.' + std::to_string(sym280__)); } } - for (int sym278__ = 1; sym278__ <= epsilon_1dim__; ++sym278__) { + for (int sym280__ = 1; sym280__ <= epsilon_1dim__; ++sym280__) { { - param_names__.emplace_back(std::string() + "epsilon" + '.' + std::to_string(sym278__)); + param_names__.emplace_back(std::string() + "epsilon" + '.' + std::to_string(sym280__)); } } param_names__.emplace_back(std::string() + "sigma"); if (emit_transformed_parameters__) { - for (int sym278__ = 1; sym278__ <= phi_2dim__; ++sym278__) { + for (int sym280__ = 1; sym280__ <= phi_2dim__; ++sym280__) { { - for (int sym279__ = 1; sym279__ <= M; ++sym279__) { + for (int sym281__ = 1; sym281__ <= M; ++sym281__) { { - param_names__.emplace_back(std::string() + "phi" + '.' + std::to_string(sym279__) + '.' + std::to_string(sym278__)); + param_names__.emplace_back(std::string() + "phi" + '.' + std::to_string(sym281__) + '.' + std::to_string(sym280__)); } } } } - for (int sym278__ = 1; sym278__ <= n_occasions; ++sym278__) { + for (int sym280__ = 1; sym280__ <= n_occasions; ++sym280__) { { - for (int sym279__ = 1; sym279__ <= M; ++sym279__) { + for (int sym281__ = 1; sym281__ <= M; ++sym281__) { { - param_names__.emplace_back(std::string() + "p" + '.' + std::to_string(sym279__) + '.' + std::to_string(sym278__)); + param_names__.emplace_back(std::string() + "p" + '.' + std::to_string(sym281__) + '.' + std::to_string(sym280__)); } } } } - for (int sym278__ = 1; sym278__ <= n_occasions; ++sym278__) { + for (int sym280__ = 1; sym280__ <= n_occasions; ++sym280__) { { - for (int sym279__ = 1; sym279__ <= M; ++sym279__) { + for (int sym281__ = 1; sym281__ <= M; ++sym281__) { { - param_names__.emplace_back(std::string() + "chi" + '.' + std::to_string(sym279__) + '.' + std::to_string(sym278__)); + param_names__.emplace_back(std::string() + "chi" + '.' + std::to_string(sym281__) + '.' + std::to_string(sym280__)); } } } @@ -20465,27 +20465,27 @@ class inlining_fail2_model final : public model_base_crtp if (emit_generated_quantities__) { param_names__.emplace_back(std::string() + "sigma2"); param_names__.emplace_back(std::string() + "psi"); - for (int sym278__ = 1; sym278__ <= n_occasions; ++sym278__) { + for (int sym280__ = 1; sym280__ <= n_occasions; ++sym280__) { { - param_names__.emplace_back(std::string() + "b" + '.' + std::to_string(sym278__)); + param_names__.emplace_back(std::string() + "b" + '.' + std::to_string(sym280__)); } } param_names__.emplace_back(std::string() + "Nsuper"); - for (int sym278__ = 1; sym278__ <= n_occasions; ++sym278__) { + for (int sym280__ = 1; sym280__ <= n_occasions; ++sym280__) { { - param_names__.emplace_back(std::string() + "N" + '.' + std::to_string(sym278__)); + param_names__.emplace_back(std::string() + "N" + '.' + std::to_string(sym280__)); } } - for (int sym278__ = 1; sym278__ <= n_occasions; ++sym278__) { + for (int sym280__ = 1; sym280__ <= n_occasions; ++sym280__) { { - param_names__.emplace_back(std::string() + "B" + '.' + std::to_string(sym278__)); + param_names__.emplace_back(std::string() + "B" + '.' + std::to_string(sym280__)); } } - for (int sym278__ = 1; sym278__ <= n_occasions; ++sym278__) { + for (int sym280__ = 1; sym280__ <= n_occasions; ++sym280__) { { - for (int sym279__ = 1; sym279__ <= M; ++sym279__) { + for (int sym281__ = 1; sym281__ <= M; ++sym281__) { { - param_names__.emplace_back(std::string() + "z" + '.' + std::to_string(sym279__) + '.' + std::to_string(sym278__)); + param_names__.emplace_back(std::string() + "z" + '.' + std::to_string(sym281__) + '.' + std::to_string(sym280__)); } } } @@ -20502,41 +20502,41 @@ class inlining_fail2_model final : public model_base_crtp param_names__.emplace_back(std::string() + "mean_phi"); param_names__.emplace_back(std::string() + "mean_p"); - for (int sym278__ = 1; sym278__ <= n_occasions; ++sym278__) { + for (int sym280__ = 1; sym280__ <= n_occasions; ++sym280__) { { - param_names__.emplace_back(std::string() + "gamma" + '.' + std::to_string(sym278__)); + param_names__.emplace_back(std::string() + "gamma" + '.' + std::to_string(sym280__)); } } - for (int sym278__ = 1; sym278__ <= epsilon_1dim__; ++sym278__) { + for (int sym280__ = 1; sym280__ <= epsilon_1dim__; ++sym280__) { { - param_names__.emplace_back(std::string() + "epsilon" + '.' + std::to_string(sym278__)); + param_names__.emplace_back(std::string() + "epsilon" + '.' + std::to_string(sym280__)); } } param_names__.emplace_back(std::string() + "sigma"); if (emit_transformed_parameters__) { - for (int sym278__ = 1; sym278__ <= phi_2dim__; ++sym278__) { + for (int sym280__ = 1; sym280__ <= phi_2dim__; ++sym280__) { { - for (int sym279__ = 1; sym279__ <= M; ++sym279__) { + for (int sym281__ = 1; sym281__ <= M; ++sym281__) { { - param_names__.emplace_back(std::string() + "phi" + '.' + std::to_string(sym279__) + '.' + std::to_string(sym278__)); + param_names__.emplace_back(std::string() + "phi" + '.' + std::to_string(sym281__) + '.' + std::to_string(sym280__)); } } } } - for (int sym278__ = 1; sym278__ <= n_occasions; ++sym278__) { + for (int sym280__ = 1; sym280__ <= n_occasions; ++sym280__) { { - for (int sym279__ = 1; sym279__ <= M; ++sym279__) { + for (int sym281__ = 1; sym281__ <= M; ++sym281__) { { - param_names__.emplace_back(std::string() + "p" + '.' + std::to_string(sym279__) + '.' + std::to_string(sym278__)); + param_names__.emplace_back(std::string() + "p" + '.' + std::to_string(sym281__) + '.' + std::to_string(sym280__)); } } } } - for (int sym278__ = 1; sym278__ <= n_occasions; ++sym278__) { + for (int sym280__ = 1; sym280__ <= n_occasions; ++sym280__) { { - for (int sym279__ = 1; sym279__ <= M; ++sym279__) { + for (int sym281__ = 1; sym281__ <= M; ++sym281__) { { - param_names__.emplace_back(std::string() + "chi" + '.' + std::to_string(sym279__) + '.' + std::to_string(sym278__)); + param_names__.emplace_back(std::string() + "chi" + '.' + std::to_string(sym281__) + '.' + std::to_string(sym280__)); } } } @@ -20546,27 +20546,27 @@ class inlining_fail2_model final : public model_base_crtp if (emit_generated_quantities__) { param_names__.emplace_back(std::string() + "sigma2"); param_names__.emplace_back(std::string() + "psi"); - for (int sym278__ = 1; sym278__ <= n_occasions; ++sym278__) { + for (int sym280__ = 1; sym280__ <= n_occasions; ++sym280__) { { - param_names__.emplace_back(std::string() + "b" + '.' + std::to_string(sym278__)); + param_names__.emplace_back(std::string() + "b" + '.' + std::to_string(sym280__)); } } param_names__.emplace_back(std::string() + "Nsuper"); - for (int sym278__ = 1; sym278__ <= n_occasions; ++sym278__) { + for (int sym280__ = 1; sym280__ <= n_occasions; ++sym280__) { { - param_names__.emplace_back(std::string() + "N" + '.' + std::to_string(sym278__)); + param_names__.emplace_back(std::string() + "N" + '.' + std::to_string(sym280__)); } } - for (int sym278__ = 1; sym278__ <= n_occasions; ++sym278__) { + for (int sym280__ = 1; sym280__ <= n_occasions; ++sym280__) { { - param_names__.emplace_back(std::string() + "B" + '.' + std::to_string(sym278__)); + param_names__.emplace_back(std::string() + "B" + '.' + std::to_string(sym280__)); } } - for (int sym278__ = 1; sym278__ <= n_occasions; ++sym278__) { + for (int sym280__ = 1; sym280__ <= n_occasions; ++sym280__) { { - for (int sym279__ = 1; sym279__ <= M; ++sym279__) { + for (int sym281__ = 1; sym281__ <= M; ++sym281__) { { - param_names__.emplace_back(std::string() + "z" + '.' + std::to_string(sym279__) + '.' + std::to_string(sym278__)); + param_names__.emplace_back(std::string() + "z" + '.' + std::to_string(sym281__) + '.' + std::to_string(sym280__)); } } } @@ -20731,6 +20731,7 @@ static constexpr std::array locations_array__ = class lcm_experiment_model final : public model_base_crtp { private: + double lcm_sym4__; double lcm_sym3__; int j; double z; @@ -20762,6 +20763,7 @@ class lcm_experiment_model final : public model_base_crtp (void) DUMMY_VAR__; // suppress unused var warning try { + int pos__; pos__ = 1; current_statement__ = 1; @@ -21784,8 +21786,8 @@ static constexpr std::array locations_array__ = " (in 'lcm-fails2.stan', line 70, column 2 to column 52)", " (in 'lcm-fails2.stan', line 71, column 2 to column 50)", " (in 'lcm-fails2.stan', line 72, column 2 to column 50)", - " (in 'lcm-fails2.stan', line 77, column 6 to column 20)", " (in 'lcm-fails2.stan', line 78, column 6 to column 18)", + " (in 'lcm-fails2.stan', line 77, column 6 to column 20)", " (in 'lcm-fails2.stan', line 76, column 34 to line 79, column 5)", " (in 'lcm-fails2.stan', line 81, column 6 to column 27)", " (in 'lcm-fails2.stan', line 82, column 6 to column 23)", @@ -22124,6 +22126,8 @@ last_capture_functor__::operator()(const std::vector& y_i, class lcm_fails2_model final : public model_base_crtp { private: + int lcm_sym119__; + int lcm_sym118__; int lcm_sym117__; int lcm_sym116__; int lcm_sym115__; @@ -22138,8 +22142,6 @@ last_capture_functor__::operator()(const std::vector& y_i, int lcm_sym106__; int lcm_sym105__; int lcm_sym104__; - int lcm_sym103__; - int lcm_sym102__; int nind; int n_occasions; std::vector> y; @@ -22232,8 +22234,8 @@ last_capture_functor__::operator()(const std::vector& y_i, current_statement__ = 36; if (stan::math::logical_gte(n_occasions, 1)) { { - lcm_sym103__ = stan::math::logical_gte(nind, 1); - if (lcm_sym103__) { + lcm_sym105__ = stan::math::logical_gte(nind, 1); + if (lcm_sym105__) { current_statement__ = 36; stan::model::assign(y, stan::model::rvalue(y_flat__, "y_flat__", @@ -22253,7 +22255,7 @@ last_capture_functor__::operator()(const std::vector& y_i, } for (int sym1__ = 2; sym1__ <= n_occasions; ++sym1__) { current_statement__ = 36; - if (lcm_sym103__) { + if (lcm_sym105__) { current_statement__ = 36; stan::model::assign(y, y_flat__[(pos__ - 1)], "assigning variable y", stan::model::index_uni(1), @@ -22272,7 +22274,7 @@ last_capture_functor__::operator()(const std::vector& y_i, } } } else { - lcm_sym103__ = stan::math::logical_gte(nind, 1); + lcm_sym105__ = stan::math::logical_gte(nind, 1); } } current_statement__ = 36; @@ -22283,8 +22285,8 @@ last_capture_functor__::operator()(const std::vector& y_i, n_occ_minus_1 = std::numeric_limits::min(); - lcm_sym104__ = (n_occasions - 1); - n_occ_minus_1 = lcm_sym104__; + lcm_sym106__ = (n_occasions - 1); + n_occ_minus_1 = lcm_sym106__; current_statement__ = 38; stan::math::validate_non_negative_index("first", "nind", nind); current_statement__ = 39; @@ -22298,15 +22300,15 @@ last_capture_functor__::operator()(const std::vector& y_i, current_statement__ = 46; - if (lcm_sym103__) { + if (lcm_sym105__) { int inline_sym17__; int inline_sym19__; inline_sym19__ = 0; for (int inline_sym20__ = 1; inline_sym20__ <= 1; ++inline_sym20__) { - lcm_sym111__ = stan::math::size( + lcm_sym113__ = stan::math::size( stan::model::rvalue(y, "y", stan::model::index_uni(1))); - for (int inline_sym18__ = 1; inline_sym18__ <= lcm_sym111__; + for (int inline_sym18__ = 1; inline_sym18__ <= lcm_sym113__; ++inline_sym18__) { current_statement__ = 43; if (stan::model::rvalue(y, "y", stan::model::index_uni(1))[ @@ -22330,10 +22332,10 @@ last_capture_functor__::operator()(const std::vector& y_i, int inline_sym19__; inline_sym19__ = 0; for (int inline_sym20__ = 1; inline_sym20__ <= 1; ++inline_sym20__) { - lcm_sym110__ = stan::math::size( + lcm_sym112__ = stan::math::size( stan::model::rvalue(y, "y", stan::model::index_uni(i))); - for (int inline_sym18__ = 1; inline_sym18__ <= lcm_sym110__; + for (int inline_sym18__ = 1; inline_sym18__ <= lcm_sym112__; ++inline_sym18__) { current_statement__ = 43; if (stan::model::rvalue(y, "y", stan::model::index_uni(i))[ @@ -22355,25 +22357,25 @@ last_capture_functor__::operator()(const std::vector& y_i, } } current_statement__ = 53; - if (lcm_sym103__) { + if (lcm_sym105__) { int inline_sym21__; int inline_sym24__; inline_sym24__ = 0; for (int inline_sym25__ = 1; inline_sym25__ <= 1; ++inline_sym25__) { - lcm_sym111__ = stan::math::size( + lcm_sym113__ = stan::math::size( stan::model::rvalue(y, "y", stan::model::index_uni(1))); - lcm_sym108__ = (lcm_sym111__ - 1); - for (int inline_sym23__ = 0; inline_sym23__ <= lcm_sym108__; + lcm_sym110__ = (lcm_sym113__ - 1); + for (int inline_sym23__ = 0; inline_sym23__ <= lcm_sym110__; ++inline_sym23__) { int inline_sym22__ = std::numeric_limits::min(); - lcm_sym107__ = (lcm_sym111__ - inline_sym23__); - inline_sym22__ = lcm_sym107__; + lcm_sym109__ = (lcm_sym113__ - inline_sym23__); + inline_sym22__ = lcm_sym109__; current_statement__ = 49; if (stan::model::rvalue(y, "y", stan::model::index_uni(1))[ - (lcm_sym107__ - 1)]) { + (lcm_sym109__ - 1)]) { inline_sym24__ = 1; - inline_sym21__ = lcm_sym107__; + inline_sym21__ = lcm_sym109__; break; } } @@ -22391,20 +22393,20 @@ last_capture_functor__::operator()(const std::vector& y_i, int inline_sym24__; inline_sym24__ = 0; for (int inline_sym25__ = 1; inline_sym25__ <= 1; ++inline_sym25__) { - lcm_sym110__ = stan::math::size( + lcm_sym112__ = stan::math::size( stan::model::rvalue(y, "y", stan::model::index_uni(i))); - lcm_sym106__ = (lcm_sym110__ - 1); - for (int inline_sym23__ = 0; inline_sym23__ <= lcm_sym106__; + lcm_sym108__ = (lcm_sym112__ - 1); + for (int inline_sym23__ = 0; inline_sym23__ <= lcm_sym108__; ++inline_sym23__) { int inline_sym22__ = std::numeric_limits::min(); - lcm_sym105__ = (lcm_sym110__ - inline_sym23__); - inline_sym22__ = lcm_sym105__; + lcm_sym107__ = (lcm_sym112__ - inline_sym23__); + inline_sym22__ = lcm_sym107__; current_statement__ = 49; if (stan::model::rvalue(y, "y", stan::model::index_uni(i))[ - (lcm_sym105__ - 1)]) { + (lcm_sym107__ - 1)]) { inline_sym24__ = 1; - inline_sym21__ = lcm_sym105__; + inline_sym21__ = lcm_sym107__; break; } } @@ -22431,12 +22433,12 @@ last_capture_functor__::operator()(const std::vector& y_i, stan::math::validate_non_negative_index("phi", "nind", nind); current_statement__ = 55; stan::math::validate_non_negative_index("phi", "n_occ_minus_1", - lcm_sym104__); + lcm_sym106__); current_statement__ = 56; stan::math::validate_non_negative_index("p", "nind", nind); current_statement__ = 57; stan::math::validate_non_negative_index("p", "n_occ_minus_1", - lcm_sym104__); + lcm_sym106__); current_statement__ = 58; stan::math::validate_non_negative_index("chi", "nind", nind); current_statement__ = 59; @@ -22467,10 +22469,12 @@ last_capture_functor__::operator()(const std::vector& y_i, (void) function__; // suppress unused var warning try { + double lcm_sym103__; + int lcm_sym102__; int lcm_sym101__; int lcm_sym100__; int lcm_sym99__; - int lcm_sym98__; + double lcm_sym98__; double lcm_sym97__; double lcm_sym96__; double lcm_sym95__; @@ -22482,7 +22486,7 @@ last_capture_functor__::operator()(const std::vector& y_i, double lcm_sym89__; double lcm_sym88__; double lcm_sym87__; - double lcm_sym86__; + int lcm_sym86__; int lcm_sym85__; int lcm_sym84__; int lcm_sym83__; @@ -22502,7 +22506,6 @@ last_capture_functor__::operator()(const std::vector& y_i, int lcm_sym69__; int lcm_sym68__; int lcm_sym67__; - int lcm_sym66__; local_scalar_t__ mean_phi; current_statement__ = 1; mean_phi = in__.template read_constrain_lub& y_i, Eigen::Matrix chi = Eigen::Matrix::Constant(nind, n_occasions, DUMMY_VAR__); - lcm_sym66__ = stan::math::logical_gte(nind, 1); - if (lcm_sym66__) { - lcm_sym99__ = stan::model::rvalue(first, "first", - stan::model::index_uni(1)); - lcm_sym79__ = (lcm_sym99__ - 1); - if (stan::math::logical_gte(lcm_sym79__, 1)) { - current_statement__ = 6; + lcm_sym67__ = stan::math::logical_gte(nind, 1); + if (lcm_sym67__) { + lcm_sym100__ = stan::model::rvalue(first, "first", + stan::model::index_uni(1)); + lcm_sym80__ = (lcm_sym100__ - 1); + if (stan::math::logical_gte(lcm_sym80__, 1)) { stan::model::assign(phi, 0, "assigning variable phi", stan::model::index_uni(1), stan::model::index_uni(1)); - current_statement__ = 7; + current_statement__ = 6; stan::model::assign(p, 0, "assigning variable p", stan::model::index_uni(1), stan::model::index_uni(1)); - for (int t = 2; t <= lcm_sym79__; ++t) { - current_statement__ = 6; + for (int t = 2; t <= lcm_sym80__; ++t) { + current_statement__ = 7; stan::model::assign(phi, 0, "assigning variable phi", stan::model::index_uni(1), stan::model::index_uni(t)); - current_statement__ = 7; + current_statement__ = 6; stan::model::assign(p, 0, "assigning variable p", stan::model::index_uni(1), stan::model::index_uni(t)); } } - lcm_sym77__ = (n_occasions - 1); - if (stan::math::logical_gte(lcm_sym77__, lcm_sym99__)) { + lcm_sym78__ = (n_occasions - 1); + if (stan::math::logical_gte(lcm_sym78__, lcm_sym100__)) { current_statement__ = 9; stan::model::assign(phi, mean_phi, "assigning variable phi", stan::model::index_uni(1), - stan::model::index_uni(lcm_sym99__)); - lcm_sym85__ = (lcm_sym99__ + 1); + stan::model::index_uni(lcm_sym100__)); + lcm_sym86__ = (lcm_sym100__ + 1); stan::model::assign(p, mean_p, "assigning variable p", stan::model::index_uni(1), - stan::model::index_uni(lcm_sym99__)); - for (int t = lcm_sym85__; t <= lcm_sym77__; ++t) { + stan::model::index_uni(lcm_sym100__)); + for (int t = lcm_sym86__; t <= lcm_sym78__; ++t) { current_statement__ = 9; stan::model::assign(phi, mean_phi, "assigning variable phi", stan::model::index_uni(1), @@ -22567,40 +22569,39 @@ last_capture_functor__::operator()(const std::vector& y_i, } } for (int i = 2; i <= nind; ++i) { - lcm_sym98__ = stan::model::rvalue(first, "first", + lcm_sym99__ = stan::model::rvalue(first, "first", stan::model::index_uni(i)); - lcm_sym78__ = (lcm_sym98__ - 1); - if (stan::math::logical_gte(lcm_sym78__, 1)) { - current_statement__ = 6; + lcm_sym79__ = (lcm_sym99__ - 1); + if (stan::math::logical_gte(lcm_sym79__, 1)) { stan::model::assign(phi, 0, "assigning variable phi", stan::model::index_uni(i), stan::model::index_uni(1)); - current_statement__ = 7; + current_statement__ = 6; stan::model::assign(p, 0, "assigning variable p", stan::model::index_uni(i), stan::model::index_uni(1)); - for (int t = 2; t <= lcm_sym78__; ++t) { - current_statement__ = 6; + for (int t = 2; t <= lcm_sym79__; ++t) { + current_statement__ = 7; stan::model::assign(phi, 0, "assigning variable phi", stan::model::index_uni(i), stan::model::index_uni(t)); - current_statement__ = 7; + current_statement__ = 6; stan::model::assign(p, 0, "assigning variable p", stan::model::index_uni(i), stan::model::index_uni(t)); } } current_statement__ = 12; - if (stan::math::logical_gte(lcm_sym77__, lcm_sym98__)) { + if (stan::math::logical_gte(lcm_sym78__, lcm_sym99__)) { current_statement__ = 9; stan::model::assign(phi, mean_phi, "assigning variable phi", stan::model::index_uni(i), - stan::model::index_uni(lcm_sym98__)); - lcm_sym84__ = (lcm_sym98__ + 1); + stan::model::index_uni(lcm_sym99__)); + lcm_sym85__ = (lcm_sym99__ + 1); stan::model::assign(p, mean_p, "assigning variable p", stan::model::index_uni(i), - stan::model::index_uni(lcm_sym98__)); - for (int t = lcm_sym84__; t <= lcm_sym77__; ++t) { + stan::model::index_uni(lcm_sym99__)); + for (int t = lcm_sym85__; t <= lcm_sym78__; ++t) { current_statement__ = 9; stan::model::assign(phi, mean_phi, "assigning variable phi", stan::model::index_uni(i), @@ -22630,55 +22631,55 @@ last_capture_functor__::operator()(const std::vector& y_i, stan::model::assign(inline_sym10__, 1.0, "assigning variable inline_sym10__", stan::model::index_uni(inline_sym14__), stan::model::index_uni(n_occasions)); - lcm_sym77__ = (n_occasions - 1); - if (stan::math::logical_gte(lcm_sym77__, 1)) { + lcm_sym78__ = (n_occasions - 1); + if (stan::math::logical_gte(lcm_sym78__, 1)) { int inline_sym11__ = std::numeric_limits::min(); int inline_sym12__ = std::numeric_limits::min(); - lcm_sym81__ = (lcm_sym77__ + 1); + lcm_sym82__ = (lcm_sym78__ + 1); current_statement__ = 21; stan::model::assign(inline_sym10__, stan::math::fma( (stan::model::rvalue(phi, "phi", stan::model::index_uni(inline_sym14__), - stan::model::index_uni(lcm_sym77__)) * + stan::model::index_uni(lcm_sym78__)) * (1 - stan::model::rvalue(p, "p", stan::model::index_uni(inline_sym14__), - stan::model::index_uni((lcm_sym81__ - 1))))), + stan::model::index_uni((lcm_sym82__ - 1))))), stan::model::rvalue(inline_sym10__, "inline_sym10__", stan::model::index_uni(inline_sym14__), - stan::model::index_uni(lcm_sym81__)), + stan::model::index_uni(lcm_sym82__)), (1 - stan::model::rvalue(phi, "phi", stan::model::index_uni(inline_sym14__), - stan::model::index_uni(lcm_sym77__)))), + stan::model::index_uni(lcm_sym78__)))), "assigning variable inline_sym10__", stan::model::index_uni(inline_sym14__), - stan::model::index_uni(lcm_sym77__)); - for (int inline_sym13__ = 2; inline_sym13__ <= lcm_sym77__; + stan::model::index_uni(lcm_sym78__)); + for (int inline_sym13__ = 2; inline_sym13__ <= lcm_sym78__; ++inline_sym13__) { int inline_sym11__ = std::numeric_limits::min(); - lcm_sym76__ = (n_occasions - inline_sym13__); + lcm_sym77__ = (n_occasions - inline_sym13__); int inline_sym12__ = std::numeric_limits::min(); - lcm_sym80__ = (lcm_sym76__ + 1); + lcm_sym81__ = (lcm_sym77__ + 1); current_statement__ = 21; stan::model::assign(inline_sym10__, stan::math::fma( (stan::model::rvalue(phi, "phi", stan::model::index_uni(inline_sym14__), - stan::model::index_uni(lcm_sym76__)) * + stan::model::index_uni(lcm_sym77__)) * (1 - stan::model::rvalue(p, "p", stan::model::index_uni(inline_sym14__), - stan::model::index_uni((lcm_sym80__ - 1))))), + stan::model::index_uni((lcm_sym81__ - 1))))), stan::model::rvalue(inline_sym10__, "inline_sym10__", stan::model::index_uni(inline_sym14__), - stan::model::index_uni(lcm_sym80__)), + stan::model::index_uni(lcm_sym81__)), (1 - stan::model::rvalue(phi, "phi", stan::model::index_uni(inline_sym14__), - stan::model::index_uni(lcm_sym76__)))), + stan::model::index_uni(lcm_sym77__)))), "assigning variable inline_sym10__", stan::model::index_uni(inline_sym14__), - stan::model::index_uni(lcm_sym76__)); + stan::model::index_uni(lcm_sym77__)); } } if (inline_sym15__) { @@ -22708,30 +22709,30 @@ last_capture_functor__::operator()(const std::vector& y_i, stan::math::check_less_or_equal(function__, "chi", inline_sym9__, 1); { current_statement__ = 31; - if (lcm_sym66__) { - lcm_sym99__ = stan::model::rvalue(first, "first", - stan::model::index_uni(1)); - if (stan::math::logical_gt(lcm_sym99__, 0)) { - lcm_sym101__ = stan::model::rvalue(last, "last", + if (lcm_sym67__) { + lcm_sym100__ = stan::model::rvalue(first, "first", + stan::model::index_uni(1)); + if (stan::math::logical_gt(lcm_sym100__, 0)) { + lcm_sym102__ = stan::model::rvalue(last, "last", stan::model::index_uni(1)); - lcm_sym85__ = (lcm_sym99__ + 1); - if (stan::math::logical_gte(lcm_sym101__, lcm_sym85__)) { + lcm_sym86__ = (lcm_sym100__ + 1); + if (stan::math::logical_gte(lcm_sym102__, lcm_sym86__)) { current_statement__ = 25; lp_accum__.add( stan::math::bernoulli_lpmf(1, stan::model::rvalue(phi, "phi", stan::model::index_uni(1), - stan::model::index_uni((lcm_sym85__ - 1))))); - lcm_sym83__ = (lcm_sym85__ + 1); + stan::model::index_uni((lcm_sym86__ - 1))))); + lcm_sym84__ = (lcm_sym86__ + 1); lp_accum__.add( stan::math::bernoulli_lpmf( stan::model::rvalue(y, "y", stan::model::index_uni(1), - stan::model::index_uni(lcm_sym85__)), + stan::model::index_uni(lcm_sym86__)), stan::model::rvalue(p, "p", stan::model::index_uni(1), - stan::model::index_uni((lcm_sym85__ - 1))))); - for (int t = lcm_sym83__; t <= lcm_sym101__; ++t) { + stan::model::index_uni((lcm_sym86__ - 1))))); + for (int t = lcm_sym84__; t <= lcm_sym102__; ++t) { current_statement__ = 25; lp_accum__.add( stan::math::bernoulli_lpmf(1, @@ -22753,32 +22754,32 @@ last_capture_functor__::operator()(const std::vector& y_i, stan::math::bernoulli_lpmf(1, stan::model::rvalue(inline_sym9__, "inline_sym9__", stan::model::index_uni(1), - stan::model::index_uni(lcm_sym101__)))); + stan::model::index_uni(lcm_sym102__)))); } for (int i = 2; i <= nind; ++i) { - lcm_sym98__ = stan::model::rvalue(first, "first", + lcm_sym99__ = stan::model::rvalue(first, "first", stan::model::index_uni(i)); - if (stan::math::logical_gt(lcm_sym98__, 0)) { - lcm_sym100__ = stan::model::rvalue(last, "last", + if (stan::math::logical_gt(lcm_sym99__, 0)) { + lcm_sym101__ = stan::model::rvalue(last, "last", stan::model::index_uni(i)); - lcm_sym84__ = (lcm_sym98__ + 1); - if (stan::math::logical_gte(lcm_sym100__, lcm_sym84__)) { + lcm_sym85__ = (lcm_sym99__ + 1); + if (stan::math::logical_gte(lcm_sym101__, lcm_sym85__)) { current_statement__ = 25; lp_accum__.add( stan::math::bernoulli_lpmf(1, stan::model::rvalue(phi, "phi", stan::model::index_uni(i), - stan::model::index_uni((lcm_sym84__ - 1))))); - lcm_sym82__ = (lcm_sym84__ + 1); + stan::model::index_uni((lcm_sym85__ - 1))))); + lcm_sym83__ = (lcm_sym85__ + 1); lp_accum__.add( stan::math::bernoulli_lpmf( stan::model::rvalue(y, "y", stan::model::index_uni(i), - stan::model::index_uni(lcm_sym84__)), + stan::model::index_uni(lcm_sym85__)), stan::model::rvalue(p, "p", stan::model::index_uni(i), - stan::model::index_uni((lcm_sym84__ - 1))))); - for (int t = lcm_sym82__; t <= lcm_sym100__; ++t) { + stan::model::index_uni((lcm_sym85__ - 1))))); + for (int t = lcm_sym83__; t <= lcm_sym101__; ++t) { current_statement__ = 25; lp_accum__.add( stan::math::bernoulli_lpmf(1, @@ -22800,7 +22801,7 @@ last_capture_functor__::operator()(const std::vector& y_i, stan::math::bernoulli_lpmf(1, stan::model::rvalue(inline_sym9__, "inline_sym9__", stan::model::index_uni(i), - stan::model::index_uni(lcm_sym100__)))); + stan::model::index_uni(lcm_sym101__)))); } } } @@ -22837,6 +22838,7 @@ last_capture_functor__::operator()(const std::vector& y_i, (void) function__; // suppress unused var warning try { + double lcm_sym66__; int lcm_sym65__; int lcm_sym64__; double lcm_sym63__; @@ -22887,20 +22889,19 @@ last_capture_functor__::operator()(const std::vector& y_i, stan::model::index_uni(1)); lcm_sym55__ = (lcm_sym65__ - 1); if (stan::math::logical_gte(lcm_sym55__, 1)) { - current_statement__ = 6; stan::model::assign(phi, 0, "assigning variable phi", stan::model::index_uni(1), stan::model::index_uni(1)); - current_statement__ = 7; + current_statement__ = 6; stan::model::assign(p, 0, "assigning variable p", stan::model::index_uni(1), stan::model::index_uni(1)); for (int t = 2; t <= lcm_sym55__; ++t) { - current_statement__ = 6; + current_statement__ = 7; stan::model::assign(phi, 0, "assigning variable phi", stan::model::index_uni(1), stan::model::index_uni(t)); - current_statement__ = 7; + current_statement__ = 6; stan::model::assign(p, 0, "assigning variable p", stan::model::index_uni(1), stan::model::index_uni(t)); @@ -22932,20 +22933,19 @@ last_capture_functor__::operator()(const std::vector& y_i, stan::model::index_uni(i)); lcm_sym54__ = (lcm_sym64__ - 1); if (stan::math::logical_gte(lcm_sym54__, 1)) { - current_statement__ = 6; stan::model::assign(phi, 0, "assigning variable phi", stan::model::index_uni(i), stan::model::index_uni(1)); - current_statement__ = 7; + current_statement__ = 6; stan::model::assign(p, 0, "assigning variable p", stan::model::index_uni(i), stan::model::index_uni(1)); for (int t = 2; t <= lcm_sym54__; ++t) { - current_statement__ = 6; + current_statement__ = 7; stan::model::assign(phi, 0, "assigning variable phi", stan::model::index_uni(i), stan::model::index_uni(t)); - current_statement__ = 7; + current_statement__ = 6; stan::model::assign(p, 0, "assigning variable p", stan::model::index_uni(i), stan::model::index_uni(t)); @@ -23135,29 +23135,29 @@ last_capture_functor__::operator()(const std::vector& y_i, param_names__.emplace_back(std::string() + "mean_phi"); param_names__.emplace_back(std::string() + "mean_p"); if (emit_transformed_parameters__) { - for (int sym118__ = 1; sym118__ <= n_occ_minus_1; ++sym118__) { + for (int sym120__ = 1; sym120__ <= n_occ_minus_1; ++sym120__) { { - for (int sym119__ = 1; sym119__ <= nind; ++sym119__) { + for (int sym121__ = 1; sym121__ <= nind; ++sym121__) { { - param_names__.emplace_back(std::string() + "phi" + '.' + std::to_string(sym119__) + '.' + std::to_string(sym118__)); + param_names__.emplace_back(std::string() + "phi" + '.' + std::to_string(sym121__) + '.' + std::to_string(sym120__)); } } } } - for (int sym118__ = 1; sym118__ <= n_occ_minus_1; ++sym118__) { + for (int sym120__ = 1; sym120__ <= n_occ_minus_1; ++sym120__) { { - for (int sym119__ = 1; sym119__ <= nind; ++sym119__) { + for (int sym121__ = 1; sym121__ <= nind; ++sym121__) { { - param_names__.emplace_back(std::string() + "p" + '.' + std::to_string(sym119__) + '.' + std::to_string(sym118__)); + param_names__.emplace_back(std::string() + "p" + '.' + std::to_string(sym121__) + '.' + std::to_string(sym120__)); } } } } - for (int sym118__ = 1; sym118__ <= n_occasions; ++sym118__) { + for (int sym120__ = 1; sym120__ <= n_occasions; ++sym120__) { { - for (int sym119__ = 1; sym119__ <= nind; ++sym119__) { + for (int sym121__ = 1; sym121__ <= nind; ++sym121__) { { - param_names__.emplace_back(std::string() + "chi" + '.' + std::to_string(sym119__) + '.' + std::to_string(sym118__)); + param_names__.emplace_back(std::string() + "chi" + '.' + std::to_string(sym121__) + '.' + std::to_string(sym120__)); } } } @@ -23179,29 +23179,29 @@ last_capture_functor__::operator()(const std::vector& y_i, param_names__.emplace_back(std::string() + "mean_phi"); param_names__.emplace_back(std::string() + "mean_p"); if (emit_transformed_parameters__) { - for (int sym118__ = 1; sym118__ <= n_occ_minus_1; ++sym118__) { + for (int sym120__ = 1; sym120__ <= n_occ_minus_1; ++sym120__) { { - for (int sym119__ = 1; sym119__ <= nind; ++sym119__) { + for (int sym121__ = 1; sym121__ <= nind; ++sym121__) { { - param_names__.emplace_back(std::string() + "phi" + '.' + std::to_string(sym119__) + '.' + std::to_string(sym118__)); + param_names__.emplace_back(std::string() + "phi" + '.' + std::to_string(sym121__) + '.' + std::to_string(sym120__)); } } } } - for (int sym118__ = 1; sym118__ <= n_occ_minus_1; ++sym118__) { + for (int sym120__ = 1; sym120__ <= n_occ_minus_1; ++sym120__) { { - for (int sym119__ = 1; sym119__ <= nind; ++sym119__) { + for (int sym121__ = 1; sym121__ <= nind; ++sym121__) { { - param_names__.emplace_back(std::string() + "p" + '.' + std::to_string(sym119__) + '.' + std::to_string(sym118__)); + param_names__.emplace_back(std::string() + "p" + '.' + std::to_string(sym121__) + '.' + std::to_string(sym120__)); } } } } - for (int sym118__ = 1; sym118__ <= n_occasions; ++sym118__) { + for (int sym120__ = 1; sym120__ <= n_occasions; ++sym120__) { { - for (int sym119__ = 1; sym119__ <= nind; ++sym119__) { + for (int sym121__ = 1; sym121__ <= nind; ++sym121__) { { - param_names__.emplace_back(std::string() + "chi" + '.' + std::to_string(sym119__) + '.' + std::to_string(sym118__)); + param_names__.emplace_back(std::string() + "chi" + '.' + std::to_string(sym121__) + '.' + std::to_string(sym120__)); } } } @@ -23931,18 +23931,18 @@ static constexpr std::array locations_array__ = class off_dce_model final : public model_base_crtp { private: + int lcm_sym42__; int lcm_sym41__; int lcm_sym40__; int lcm_sym39__; - int lcm_sym38__; + double lcm_sym38__; double lcm_sym37__; - double lcm_sym36__; + int lcm_sym36__; int lcm_sym35__; int lcm_sym34__; int lcm_sym33__; int lcm_sym32__; int lcm_sym31__; - int lcm_sym30__; int R; int T; std::vector> y; @@ -24030,8 +24030,8 @@ class off_dce_model final : public model_base_crtp { current_statement__ = 35; if (stan::math::logical_gte(T, 1)) { { - lcm_sym30__ = stan::math::logical_gte(R, 1); - if (lcm_sym30__) { + lcm_sym31__ = stan::math::logical_gte(R, 1); + if (lcm_sym31__) { current_statement__ = 35; stan::model::assign(y, stan::model::rvalue(y_flat__, "y_flat__", @@ -24051,7 +24051,7 @@ class off_dce_model final : public model_base_crtp { } for (int sym1__ = 2; sym1__ <= T; ++sym1__) { current_statement__ = 35; - if (lcm_sym30__) { + if (lcm_sym31__) { current_statement__ = 35; stan::model::assign(y, y_flat__[(pos__ - 1)], "assigning variable y", stan::model::index_uni(1), @@ -24070,7 +24070,7 @@ class off_dce_model final : public model_base_crtp { } } } else { - lcm_sym30__ = stan::math::logical_gte(R, 1); + lcm_sym31__ = stan::math::logical_gte(R, 1); } } current_statement__ = 35; @@ -24094,7 +24094,7 @@ class off_dce_model final : public model_base_crtp { current_statement__ = 37; pos__ = 1; current_statement__ = 37; - if (lcm_sym30__) { + if (lcm_sym31__) { current_statement__ = 37; stan::model::assign(X, stan::model::rvalue(X_flat__, "X_flat__", @@ -24124,7 +24124,7 @@ class off_dce_model final : public model_base_crtp { current_statement__ = 41; occ_obs = 0; current_statement__ = 46; - if (lcm_sym30__) { + if (lcm_sym31__) { current_statement__ = 42; stan::model::assign(sum_y, stan::math::sum( @@ -24191,17 +24191,17 @@ class off_dce_model final : public model_base_crtp { (void) function__; // suppress unused var warning try { + int lcm_sym30__; int lcm_sym29__; - int lcm_sym28__; - Eigen::Matrix lcm_sym27__; + Eigen::Matrix lcm_sym28__; + double lcm_sym27__; double lcm_sym26__; - double lcm_sym25__; - Eigen::Matrix lcm_sym24__; + Eigen::Matrix lcm_sym25__; + double lcm_sym24__; double lcm_sym23__; double lcm_sym22__; double lcm_sym21__; - double lcm_sym20__; - int lcm_sym19__; + int lcm_sym20__; local_scalar_t__ alpha_occ; current_statement__ = 1; alpha_occ = in__.template read(); @@ -24218,15 +24218,15 @@ class off_dce_model final : public model_base_crtp { Eigen::Matrix::Constant(R, DUMMY_VAR__); Eigen::Matrix logit_p = Eigen::Matrix::Constant(R, T, DUMMY_VAR__); - stan::model::assign(lcm_sym24__, + stan::model::assign(lcm_sym25__, stan::math::fma(beta_occ, X, alpha_occ), - "assigning variable lcm_sym24__"); - stan::model::assign(logit_psi, lcm_sym24__, + "assigning variable lcm_sym25__"); + stan::model::assign(logit_psi, lcm_sym25__, "assigning variable logit_psi"); - stan::model::assign(lcm_sym27__, + stan::model::assign(lcm_sym28__, stan::math::rep_matrix(stan::math::fma(beta_p, X, alpha_p), T), - "assigning variable lcm_sym27__"); - stan::model::assign(logit_p, lcm_sym27__, "assigning variable logit_p"); + "assigning variable lcm_sym28__"); + stan::model::assign(logit_p, lcm_sym28__, "assigning variable logit_p"); { current_statement__ = 30; if (stan::math::logical_gte(R, 1)) { @@ -24235,26 +24235,26 @@ class off_dce_model final : public model_base_crtp { current_statement__ = 25; lp_accum__.add( stan::math::bernoulli_logit_lpmf(1, - stan::model::rvalue(lcm_sym24__, "lcm_sym24__", + stan::model::rvalue(lcm_sym25__, "lcm_sym25__", stan::model::index_uni(1)))); current_statement__ = 26; lp_accum__.add( stan::math::bernoulli_logit_lpmf( stan::model::rvalue(y, "y", stan::model::index_uni(1)), - stan::model::rvalue(lcm_sym27__, "lcm_sym27__", + stan::model::rvalue(lcm_sym28__, "lcm_sym28__", stan::model::index_uni(1)))); } else { current_statement__ = 23; lp_accum__.add( stan::math::log_sum_exp( (stan::math::bernoulli_logit_lpmf(1, - stan::model::rvalue(lcm_sym24__, "lcm_sym24__", + stan::model::rvalue(lcm_sym25__, "lcm_sym25__", stan::model::index_uni(1))) + stan::math::bernoulli_logit_lpmf(0, - stan::model::rvalue(lcm_sym27__, "lcm_sym27__", + stan::model::rvalue(lcm_sym28__, "lcm_sym28__", stan::model::index_uni(1)))), stan::math::bernoulli_logit_lpmf(0, - stan::model::rvalue(lcm_sym24__, "lcm_sym24__", + stan::model::rvalue(lcm_sym25__, "lcm_sym25__", stan::model::index_uni(1))))); } for (int i = 2; i <= R; ++i) { @@ -24264,26 +24264,26 @@ class off_dce_model final : public model_base_crtp { current_statement__ = 25; lp_accum__.add( stan::math::bernoulli_logit_lpmf(1, - stan::model::rvalue(lcm_sym24__, "lcm_sym24__", + stan::model::rvalue(lcm_sym25__, "lcm_sym25__", stan::model::index_uni(i)))); current_statement__ = 26; lp_accum__.add( stan::math::bernoulli_logit_lpmf( stan::model::rvalue(y, "y", stan::model::index_uni(i)), - stan::model::rvalue(lcm_sym27__, "lcm_sym27__", + stan::model::rvalue(lcm_sym28__, "lcm_sym28__", stan::model::index_uni(i)))); } else { current_statement__ = 23; lp_accum__.add( stan::math::log_sum_exp( (stan::math::bernoulli_logit_lpmf(1, - stan::model::rvalue(lcm_sym24__, "lcm_sym24__", + stan::model::rvalue(lcm_sym25__, "lcm_sym25__", stan::model::index_uni(i))) + stan::math::bernoulli_logit_lpmf(0, - stan::model::rvalue(lcm_sym27__, "lcm_sym27__", + stan::model::rvalue(lcm_sym28__, "lcm_sym28__", stan::model::index_uni(i)))), stan::math::bernoulli_logit_lpmf(0, - stan::model::rvalue(lcm_sym24__, "lcm_sym24__", + stan::model::rvalue(lcm_sym25__, "lcm_sym25__", stan::model::index_uni(i))))); } } @@ -24321,6 +24321,7 @@ class off_dce_model final : public model_base_crtp { (void) function__; // suppress unused var warning try { + double lcm_sym19__; double lcm_sym11__; double lcm_sym10__; int lcm_sym18__; @@ -24545,16 +24546,16 @@ class off_dce_model final : public model_base_crtp { param_names__.emplace_back(std::string() + "alpha_p"); param_names__.emplace_back(std::string() + "beta_p"); if (emit_transformed_parameters__) { - for (int sym42__ = 1; sym42__ <= R; ++sym42__) { + for (int sym43__ = 1; sym43__ <= R; ++sym43__) { { - param_names__.emplace_back(std::string() + "logit_psi" + '.' + std::to_string(sym42__)); + param_names__.emplace_back(std::string() + "logit_psi" + '.' + std::to_string(sym43__)); } } - for (int sym42__ = 1; sym42__ <= T; ++sym42__) { + for (int sym43__ = 1; sym43__ <= T; ++sym43__) { { - for (int sym43__ = 1; sym43__ <= R; ++sym43__) { + for (int sym44__ = 1; sym44__ <= R; ++sym44__) { { - param_names__.emplace_back(std::string() + "logit_p" + '.' + std::to_string(sym43__) + '.' + std::to_string(sym42__)); + param_names__.emplace_back(std::string() + "logit_p" + '.' + std::to_string(sym44__) + '.' + std::to_string(sym43__)); } } } @@ -24563,14 +24564,14 @@ class off_dce_model final : public model_base_crtp { if (emit_generated_quantities__) { param_names__.emplace_back(std::string() + "occ_fs"); - for (int sym42__ = 1; sym42__ <= R; ++sym42__) { + for (int sym43__ = 1; sym43__ <= R; ++sym43__) { { - param_names__.emplace_back(std::string() + "psi_con" + '.' + std::to_string(sym42__)); + param_names__.emplace_back(std::string() + "psi_con" + '.' + std::to_string(sym43__)); } } - for (int sym42__ = 1; sym42__ <= R; ++sym42__) { + for (int sym43__ = 1; sym43__ <= R; ++sym43__) { { - param_names__.emplace_back(std::string() + "z" + '.' + std::to_string(sym42__)); + param_names__.emplace_back(std::string() + "z" + '.' + std::to_string(sym43__)); } } } @@ -24588,16 +24589,16 @@ class off_dce_model final : public model_base_crtp { param_names__.emplace_back(std::string() + "alpha_p"); param_names__.emplace_back(std::string() + "beta_p"); if (emit_transformed_parameters__) { - for (int sym42__ = 1; sym42__ <= R; ++sym42__) { + for (int sym43__ = 1; sym43__ <= R; ++sym43__) { { - param_names__.emplace_back(std::string() + "logit_psi" + '.' + std::to_string(sym42__)); + param_names__.emplace_back(std::string() + "logit_psi" + '.' + std::to_string(sym43__)); } } - for (int sym42__ = 1; sym42__ <= T; ++sym42__) { + for (int sym43__ = 1; sym43__ <= T; ++sym43__) { { - for (int sym43__ = 1; sym43__ <= R; ++sym43__) { + for (int sym44__ = 1; sym44__ <= R; ++sym44__) { { - param_names__.emplace_back(std::string() + "logit_p" + '.' + std::to_string(sym43__) + '.' + std::to_string(sym42__)); + param_names__.emplace_back(std::string() + "logit_p" + '.' + std::to_string(sym44__) + '.' + std::to_string(sym43__)); } } } @@ -24606,14 +24607,14 @@ class off_dce_model final : public model_base_crtp { if (emit_generated_quantities__) { param_names__.emplace_back(std::string() + "occ_fs"); - for (int sym42__ = 1; sym42__ <= R; ++sym42__) { + for (int sym43__ = 1; sym43__ <= R; ++sym43__) { { - param_names__.emplace_back(std::string() + "psi_con" + '.' + std::to_string(sym42__)); + param_names__.emplace_back(std::string() + "psi_con" + '.' + std::to_string(sym43__)); } } - for (int sym42__ = 1; sym42__ <= R; ++sym42__) { + for (int sym43__ = 1; sym43__ <= R; ++sym43__) { { - param_names__.emplace_back(std::string() + "z" + '.' + std::to_string(sym42__)); + param_names__.emplace_back(std::string() + "z" + '.' + std::to_string(sym43__)); } } } @@ -25589,7 +25590,7 @@ using namespace stan::math; stan::math::profile_map profiles__; -static constexpr std::array locations_array__ = +static constexpr std::array locations_array__ = {" (found before start of program)", " (in 'optimizations.stan', line 20, column 4 to column 15)", " (in 'optimizations.stan', line 21, column 4 to column 13)", @@ -25626,13 +25627,11 @@ static constexpr std::array locations_array__ = " (in 'optimizations.stan', line 55, column 8 to column 20)", " (in 'optimizations.stan', line 52, column 21 to line 56, column 5)", " (in 'optimizations.stan', line 52, column 4 to line 56, column 5)", - " (in 'optimizations.stan', line 57, column 4 to column 10)", " (in 'optimizations.stan', line 58, column 4 to column 16)", " (in 'optimizations.stan', line 60, column 6 to column 12)", " (in 'optimizations.stan', line 59, column 4 to line 60, column 12)", " (in 'optimizations.stan', line 61, column 4 to column 16)", " (in 'optimizations.stan', line 64, column 4 to column 16)", - " (in 'optimizations.stan', line 65, column 4 to column 16)", " (in 'optimizations.stan', line 66, column 4 to column 16)", " (in 'optimizations.stan', line 68, column 6 to column 19)", " (in 'optimizations.stan', line 69, column 4 to column 16)", @@ -25740,10 +25739,10 @@ int rfun(const int& y, std::ostream* pstream__) { { current_statement__ = 11; if (stan::math::logical_gt(y, 2)) { - current_statement__ = 90; + current_statement__ = 88; return (y + 24); } - current_statement__ = 91; + current_statement__ = 89; return (y + 2); } } catch (const std::exception& e) { @@ -25758,9 +25757,9 @@ template int (void) DUMMY_VAR__; // suppress unused var warning try { { - current_statement__ = 61; + current_statement__ = 59; lp_accum__.add(2); - current_statement__ = 92; + current_statement__ = 90; return 24; } } catch (const std::exception& e) { @@ -25847,6 +25846,16 @@ class optimizations_model final : public model_base_crtp { (void) function__; // suppress unused var warning try { + double lcm_sym66__; + double lcm_sym65__; + double lcm_sym64__; + double lcm_sym63__; + double lcm_sym62__; + double lcm_sym61__; + double lcm_sym60__; + double lcm_sym59__; + double lcm_sym58__; + double lcm_sym57__; double lcm_sym56__; int lcm_sym55__; int lcm_sym54__; @@ -26221,73 +26230,71 @@ class optimizations_model final : public model_base_crtp { current_statement__ = 33; lp_accum__.add(2); } - current_statement__ = 36; x = 3; - current_statement__ = 37; + current_statement__ = 36; lp_accum__.add(3); - current_statement__ = 39; + current_statement__ = 38; if (stan::math::logical_gt(theta, 2)) { - current_statement__ = 38; + current_statement__ = 37; x = 2; } - current_statement__ = 40; + current_statement__ = 39; lp_accum__.add(x); - current_statement__ = 41; + current_statement__ = 40; lp_accum__.add(247); - current_statement__ = 42; x = 576; - current_statement__ = 43; + current_statement__ = 41; lp_accum__.add(576); lcm_sym47__ = stan::math::logical_gt(theta, 46); if (lcm_sym47__) { - current_statement__ = 44; + current_statement__ = 42; x = 5880; } - current_statement__ = 45; + current_statement__ = 43; lp_accum__.add(x); double z; - current_statement__ = 47; + current_statement__ = 45; z = x; - current_statement__ = 48; + current_statement__ = 46; lp_accum__.add(x); - current_statement__ = 50; + current_statement__ = 48; if (lcm_sym47__) { - current_statement__ = 49; + current_statement__ = 47; z = x; } - current_statement__ = 51; + current_statement__ = 49; lp_accum__.add(z); - current_statement__ = 52; + current_statement__ = 50; lp_accum__.add(2); { double y = std::numeric_limits::quiet_NaN(); - current_statement__ = 54; + current_statement__ = 52; lp_accum__.add(24); } { double y = std::numeric_limits::quiet_NaN(); - current_statement__ = 57; + current_statement__ = 55; lp_accum__.add(245); } { - current_statement__ = 59; + current_statement__ = 57; lp_accum__.add(2); } int inline_sym20__; int inline_sym21__ = std::numeric_limits::min(); for (int inline_sym22__ = 1; inline_sym22__ <= 1; ++inline_sym22__) { - current_statement__ = 61; + current_statement__ = 59; lp_accum__.add(2); break; } - current_statement__ = 63; + current_statement__ = 61; while (576) { break; } int inline_sym23__; int inline_sym24__ = std::numeric_limits::min(); for (int inline_sym25__ = 1; inline_sym25__ <= 1; ++inline_sym25__) { - current_statement__ = 61; + current_statement__ = 59; lp_accum__.add(2); inline_sym23__ = 24; break; @@ -26298,20 +26305,20 @@ class optimizations_model final : public model_base_crtp { } int inline_sym24__ = std::numeric_limits::min(); for (int inline_sym25__ = 1; inline_sym25__ <= 1; ++inline_sym25__) { - current_statement__ = 61; + current_statement__ = 59; lp_accum__.add(2); inline_sym23__ = 24; break; } } - current_statement__ = 66; + current_statement__ = 64; for (int i = 31; i <= 225; ++i) { continue;} - current_statement__ = 68; + current_statement__ = 66; for (int i = 31; i <= 225; ++i) { break;} int inline_sym26__; int inline_sym27__ = std::numeric_limits::min(); for (int inline_sym28__ = 1; inline_sym28__ <= 1; ++inline_sym28__) { - current_statement__ = 61; + current_statement__ = 59; lp_accum__.add(2); inline_sym26__ = 24; break; @@ -26320,7 +26327,7 @@ class optimizations_model final : public model_base_crtp { int inline_sym29__; int inline_sym30__ = std::numeric_limits::min(); for (int inline_sym31__ = 1; inline_sym31__ <= 1; ++inline_sym31__) { - current_statement__ = 61; + current_statement__ = 59; lp_accum__.add(2); inline_sym29__ = 24; break; @@ -26329,25 +26336,25 @@ class optimizations_model final : public model_base_crtp { int inline_sym32__; int inline_sym33__ = std::numeric_limits::min(); for (int inline_sym34__ = 1; inline_sym34__ <= 1; ++inline_sym34__) { - current_statement__ = 61; + current_statement__ = 59; lp_accum__.add(2); break; } { - current_statement__ = 71; + current_statement__ = 69; lp_accum__.add(1); - current_statement__ = 72; + current_statement__ = 70; lp_accum__.add(24); } { { - current_statement__ = 74; + current_statement__ = 72; lp_accum__.add(1); } } double temp = std::numeric_limits::quiet_NaN(); { - current_statement__ = 78; + current_statement__ = 76; if (pstream__) { stan::math::stan_print(pstream__, "hello"); stan::math::stan_print(pstream__, "\n"); @@ -26355,28 +26362,26 @@ class optimizations_model final : public model_base_crtp { } double temp2 = std::numeric_limits::quiet_NaN(); { - current_statement__ = 81; lp_accum__.add(4); - current_statement__ = 82; lp_accum__.add(6); { - current_statement__ = 81; + current_statement__ = 79; lp_accum__.add(4); - current_statement__ = 82; + current_statement__ = 80; lp_accum__.add(6); } } double dataonlyvar; - current_statement__ = 84; + current_statement__ = 82; dataonlyvar = 3; - current_statement__ = 85; + current_statement__ = 83; lp_accum__.add(dataonlyvar); local_scalar_t__ paramvar = DUMMY_VAR__; { - current_statement__ = 87; + current_statement__ = 85; paramvar = (theta * 34); } - current_statement__ = 89; + current_statement__ = 87; lp_accum__.add(paramvar); } } catch (const std::exception& e) { @@ -26575,25 +26580,25 @@ class optimizations_model final : public model_base_crtp { param_names__.emplace_back(std::string() + "theta"); param_names__.emplace_back(std::string() + "phi"); - for (int sym57__ = 1; sym57__ <= 2; ++sym57__) { + for (int sym67__ = 1; sym67__ <= 2; ++sym67__) { { - for (int sym58__ = 1; sym58__ <= 3; ++sym58__) { + for (int sym68__ = 1; sym68__ <= 3; ++sym68__) { { - param_names__.emplace_back(std::string() + "x_matrix" + '.' + std::to_string(sym58__) + '.' + std::to_string(sym57__)); + param_names__.emplace_back(std::string() + "x_matrix" + '.' + std::to_string(sym68__) + '.' + std::to_string(sym67__)); } } } } - for (int sym57__ = 1; sym57__ <= 2; ++sym57__) { + for (int sym67__ = 1; sym67__ <= 2; ++sym67__) { { - param_names__.emplace_back(std::string() + "x_vector" + '.' + std::to_string(sym57__)); + param_names__.emplace_back(std::string() + "x_vector" + '.' + std::to_string(sym67__)); } } - for (int sym57__ = 1; sym57__ <= 2; ++sym57__) { + for (int sym67__ = 1; sym67__ <= 2; ++sym67__) { { - for (int sym58__ = 1; sym58__ <= 2; ++sym58__) { + for (int sym68__ = 1; sym68__ <= 2; ++sym68__) { { - param_names__.emplace_back(std::string() + "x_cov" + '.' + std::to_string(sym58__) + '.' + std::to_string(sym57__)); + param_names__.emplace_back(std::string() + "x_cov" + '.' + std::to_string(sym68__) + '.' + std::to_string(sym67__)); } } } @@ -26616,23 +26621,23 @@ class optimizations_model final : public model_base_crtp { param_names__.emplace_back(std::string() + "theta"); param_names__.emplace_back(std::string() + "phi"); - for (int sym57__ = 1; sym57__ <= 2; ++sym57__) { + for (int sym67__ = 1; sym67__ <= 2; ++sym67__) { { - for (int sym58__ = 1; sym58__ <= 3; ++sym58__) { + for (int sym68__ = 1; sym68__ <= 3; ++sym68__) { { - param_names__.emplace_back(std::string() + "x_matrix" + '.' + std::to_string(sym58__) + '.' + std::to_string(sym57__)); + param_names__.emplace_back(std::string() + "x_matrix" + '.' + std::to_string(sym68__) + '.' + std::to_string(sym67__)); } } } } - for (int sym57__ = 1; sym57__ <= 2; ++sym57__) { + for (int sym67__ = 1; sym67__ <= 2; ++sym67__) { { - param_names__.emplace_back(std::string() + "x_vector" + '.' + std::to_string(sym57__)); + param_names__.emplace_back(std::string() + "x_vector" + '.' + std::to_string(sym67__)); } } - for (int sym57__ = 1; sym57__ <= 3; ++sym57__) { + for (int sym67__ = 1; sym67__ <= 3; ++sym67__) { { - param_names__.emplace_back(std::string() + "x_cov" + '.' + std::to_string(sym57__)); + param_names__.emplace_back(std::string() + "x_cov" + '.' + std::to_string(sym67__)); } } if (emit_transformed_parameters__) { @@ -31969,8 +31974,9 @@ class unenforce_initialize_model final : public model_base_crtp(); @@ -31991,7 +31997,6 @@ class unenforce_initialize_model final : public model_base_crtp::quiet_NaN(); { - current_statement__ = 10; for_loop_var = 1; { current_statement__ = 10; @@ -32062,6 +32067,7 @@ class unenforce_initialize_model final : public model_base_crtp theta = std::vector(5, DUMMY_VAR__); current_statement__ = 6; - stan::model::assign(theta, std::vector{beta, - stan::math::promote_scalar(kappa), gamma, xi, - delta}, "assigning variable theta"); + stan::model::assign(theta, std::vector{beta, kappa, + gamma, xi, delta}, "assigning variable theta"); current_statement__ = 7; stan::model::assign(y, stan::math::integrate_ode_rk45(simple_SIR_functor__(), y0, t0, t, @@ -1029,9 +1028,8 @@ class ad_level_failing_model final : public model_base_crtp theta = std::vector(5, std::numeric_limits::quiet_NaN()); current_statement__ = 6; - stan::model::assign(theta, std::vector{beta, - stan::math::promote_scalar(kappa), gamma, xi, - delta}, "assigning variable theta"); + stan::model::assign(theta, std::vector{beta, kappa, + gamma, xi, delta}, "assigning variable theta"); current_statement__ = 7; stan::model::assign(y, stan::math::integrate_ode_rk45(simple_SIR_functor__(), y0, t0, t, diff --git a/test/integration/good/compiler-optimizations/cppO1.expected b/test/integration/good/compiler-optimizations/cppO1.expected index 888e8e7dc4..ff936ee6b1 100644 --- a/test/integration/good/compiler-optimizations/cppO1.expected +++ b/test/integration/good/compiler-optimizations/cppO1.expected @@ -910,8 +910,7 @@ class ad_level_failing_model final : public model_base_crtp theta; current_statement__ = 6; stan::model::assign(theta, std::vector{beta, - stan::math::promote_scalar(1000000), gamma, xi, - delta}, "assigning variable theta"); + 1000000, gamma, xi, delta}, "assigning variable theta"); current_statement__ = 7; stan::model::assign(y, stan::math::integrate_ode_rk45(simple_SIR_functor__(), y0, 0, t, @@ -1018,9 +1017,8 @@ class ad_level_failing_model final : public model_base_crtp theta; current_statement__ = 6; - stan::model::assign(theta, std::vector{beta, - stan::math::promote_scalar(1000000), gamma, xi, delta}, - "assigning variable theta"); + stan::model::assign(theta, std::vector{beta, 1000000, gamma, + xi, delta}, "assigning variable theta"); current_statement__ = 7; stan::model::assign(y, stan::math::integrate_ode_rk45(simple_SIR_functor__(), y0, 0, t, diff --git a/test/integration/good/promotion/array_promotion.stan b/test/integration/good/promotion/array_promotion.stan index 76f14a78de..8a2a4f20f6 100644 --- a/test/integration/good/promotion/array_promotion.stan +++ b/test/integration/good/promotion/array_promotion.stan @@ -16,8 +16,16 @@ data { array[N] int xs; } +parameters { + real r; +} + transformed parameters { array[2,2] real zs = {{2,3},{7,0.5}}; + array[2] complex z1 = {1,3}; + array[2] complex z2 = {1,3.5}; + array[2] complex z3 = {1,3.5i}; + z3 = {3.5i, r}; } model { diff --git a/test/integration/good/promotion/pretty.expected b/test/integration/good/promotion/pretty.expected index b10d46aadd..f66ecd218e 100644 --- a/test/integration/good/promotion/pretty.expected +++ b/test/integration/good/promotion/pretty.expected @@ -30,8 +30,15 @@ data { int N; array[N] int xs; } +parameters { + real r; +} transformed parameters { array[2, 2] real zs = {{2, 3}, {7, 0.5}}; + array[2] complex z1 = {1, 3}; + array[2] complex z2 = {1, 3.5}; + array[2] complex z3 = {1, 3.5i}; + z3 = {3.5i, r}; } model { array[3] int d = {1, 2, 3}; diff --git a/test/unit/Optimize.ml b/test/unit/Optimize.ml index 356086ddcb..dd38de3ba0 100644 --- a/test/unit/Optimize.ml +++ b/test/unit/Optimize.ml @@ -142,7 +142,9 @@ let%expect_test "inline functions" = inline_sym1__ = 0; for(inline_sym2__ in 1:1) { FnPrint__(3); - FnPrint__(FnMakeRowVec__(FnMakeRowVec__(3, 2), FnMakeRowVec__(4, 6))); + FnPrint__(FnMakeRowVec__(FnMakeRowVec__(promote(3, real), + promote(2, real)), FnMakeRowVec__(promote(4, real), + promote(6, real)))); } real inline_sym3__; data int inline_sym4__; @@ -312,23 +314,51 @@ let%expect_test "list collapsing" = (FunApp (CompilerInternal FnMakeRowVec) (((pattern (FunApp (CompilerInternal FnMakeRowVec) - (((pattern (Lit Int 3)) + (((pattern + (Promotion + ((pattern (Lit Int 3)) + (meta + ((type_ UInt) (loc ) + (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))) - ((pattern (Lit Int 2)) + ((type_ UReal) (loc ) + (adlevel DataOnly)))) + ((pattern + (Promotion + ((pattern (Lit Int 2)) + (meta + ((type_ UInt) (loc ) + (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly))))))) + ((type_ UReal) (loc ) + (adlevel DataOnly))))))) (meta ((type_ URowVector) (loc ) (adlevel DataOnly)))) ((pattern (FunApp (CompilerInternal FnMakeRowVec) - (((pattern (Lit Int 4)) + (((pattern + (Promotion + ((pattern (Lit Int 4)) + (meta + ((type_ UInt) (loc ) + (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly)))) - ((pattern (Lit Int 6)) + ((type_ UReal) (loc ) + (adlevel DataOnly)))) + ((pattern + (Promotion + ((pattern (Lit Int 6)) + (meta + ((type_ UInt) (loc ) + (adlevel DataOnly)))) + UReal DataOnly)) (meta - ((type_ UInt) (loc ) (adlevel DataOnly))))))) + ((type_ UReal) (loc ) + (adlevel DataOnly))))))) (meta ((type_ URowVector) (loc ) (adlevel DataOnly))))))) @@ -2980,26 +3010,26 @@ let%expect_test "lazy code motion, 13" = [%expect {| log_prob { - data int lcm_sym7__; - data int lcm_sym6__; + data real lcm_sym7__; + data real lcm_sym6__; data int lcm_sym5__; data int lcm_sym4__; data int lcm_sym3__; { real temp; if((2 > 3)) { - lcm_sym6__ = (2 * 2); + lcm_sym6__ = promote((2 * 2), real); temp = lcm_sym6__; ; } else { FnPrint__("hello"); - lcm_sym6__ = (2 * 2); + lcm_sym6__ = promote((2 * 2), real); ; } temp = lcm_sym6__; real temp2; if((3 >= 2)) { - lcm_sym7__ = (2 * 3); + lcm_sym7__ = promote((2 * 3), real); temp2 = lcm_sym7__; target += temp; lcm_sym5__ = (2 + 1); @@ -3227,7 +3257,7 @@ let%expect_test "adlevel_optimization" = data real z_data; if((1 > 2)) y = (y + x); else y = (y + w); if((2 > 1)) z = y; - if((3 > 1)) z_data = x; + if((3 > 1)) z_data = promote(x, real); FnPrint__(z); FnPrint__(z_data); } @@ -3243,7 +3273,7 @@ let%expect_test "adlevel_optimization" = data real z_data; if((1 > 2)) y = (y + x); else y = (y + w); if((2 > 1)) z = y; - if((3 > 1)) z_data = x; + if((3 > 1)) z_data = promote(x, real); FnPrint__(z); FnPrint__(z_data); } @@ -3365,8 +3395,12 @@ let%expect_test "adlevel_optimization expressions" = (meta ((type_ UInt) (loc ) (adlevel DataOnly)))) ((pattern (Assignment (z_data UReal ()) - ((pattern (Var x)) - (meta ((type_ UInt) (loc ) (adlevel DataOnly)))))) + ((pattern + (Promotion + ((pattern (Var x)) + (meta ((type_ UInt) (loc ) (adlevel DataOnly)))) + UReal DataOnly)) + (meta ((type_ UReal) (loc ) (adlevel DataOnly)))))) (meta )) ())) (meta )) @@ -3417,7 +3451,7 @@ let%expect_test "adlevel_optimization 2" = log_prob { real w; data real w_trans; - w_trans = 1; + w_trans = promote(1, real); { data int x; array[real, 2] y; @@ -3425,7 +3459,7 @@ let%expect_test "adlevel_optimization 2" = data real z_data; if((1 > 2)) y[1] = (y[1] + x); else y[2] = (y[2] + w); if((2 > 1)) z = y[1]; - if((3 > 1)) z_data = x; + if((3 > 1)) z_data = promote(x, real); FnPrint__(z); FnPrint__(z_data); } @@ -3435,7 +3469,7 @@ let%expect_test "adlevel_optimization 2" = data real w; data real w_trans; if(PNot__(emit_transformed_parameters__ || emit_generated_quantities__)) return; - w_trans = 1; + w_trans = promote(1, real); { data int x; data array[real, 2] y; @@ -3443,7 +3477,7 @@ let%expect_test "adlevel_optimization 2" = data real z_data; if((1 > 2)) y[1] = (y[1] + x); else y[2] = (y[2] + w); if((2 > 1)) z = y[1]; - if((3 > 1)) z_data = x; + if((3 > 1)) z_data = promote(x, real); FnPrint__(z); FnPrint__(z_data); }