@@ -3009,7 +3009,7 @@ using namespace stan::math;
30093009
30103010
30113011stan::math::profile_map profiles__;
3012- static constexpr std::array<const char*, 119 > locations_array__ =
3012+ static constexpr std::array<const char*, 120 > locations_array__ =
30133013{" (found before start of program)",
30143014 " (in 'indexing.stan', line 16, column 2 to column 13)",
30153015 " (in 'indexing.stan', line 18, column 2 to column 24)",
@@ -3068,19 +3068,20 @@ static constexpr std::array<const char*, 119> locations_array__ =
30683068 " (in 'indexing.stan', line 97, column 4 to column 69)",
30693069 " (in 'indexing.stan', line 98, column 4 to column 88)",
30703070 " (in 'indexing.stan', line 99, column 4 to line 100, column 82)",
3071- " (in 'indexing.stan', line 91, column 18 to line 107, column 3)",
3072- " (in 'indexing.stan', line 91, column 2 to line 107, column 3)",
3073- " (in 'indexing.stan', line 110, column 9 to column 10)",
3074- " (in 'indexing.stan', line 110, column 2 to column 38)",
3075- " (in 'indexing.stan', line 111, column 9 to column 10)",
3076- " (in 'indexing.stan', line 111, column 2 to column 44)",
3077- " (in 'indexing.stan', line 114, column 4 to column 84)",
3078- " (in 'indexing.stan', line 115, column 4 to column 102)",
3079- " (in 'indexing.stan', line 117, column 4 to column 70)",
3080- " (in 'indexing.stan', line 118, column 4 to column 75)",
3081- " (in 'indexing.stan', line 119, column 4 to line 120, column 40)",
3082- " (in 'indexing.stan', line 112, column 17 to line 122, column 3)",
3083- " (in 'indexing.stan', line 112, column 2 to line 122, column 3)",
3071+ " (in 'indexing.stan', line 101, column 4 to line 102, column 46)",
3072+ " (in 'indexing.stan', line 91, column 18 to line 103, column 3)",
3073+ " (in 'indexing.stan', line 91, column 2 to line 103, column 3)",
3074+ " (in 'indexing.stan', line 106, column 9 to column 10)",
3075+ " (in 'indexing.stan', line 106, column 2 to column 38)",
3076+ " (in 'indexing.stan', line 107, column 9 to column 10)",
3077+ " (in 'indexing.stan', line 107, column 2 to column 44)",
3078+ " (in 'indexing.stan', line 110, column 4 to column 84)",
3079+ " (in 'indexing.stan', line 111, column 4 to column 102)",
3080+ " (in 'indexing.stan', line 113, column 4 to column 70)",
3081+ " (in 'indexing.stan', line 114, column 4 to column 75)",
3082+ " (in 'indexing.stan', line 115, column 4 to line 116, column 40)",
3083+ " (in 'indexing.stan', line 108, column 17 to line 118, column 3)",
3084+ " (in 'indexing.stan', line 108, column 2 to line 118, column 3)",
30843085 " (in 'indexing.stan', line 8, column 1 to column 7)",
30853086 " (in 'indexing.stan', line 9, column 1 to column 7)",
30863087 " (in 'indexing.stan', line 10, column 8 to column 9)",
@@ -3140,7 +3141,7 @@ mask_fun(const int& i, std::ostream* pstream__) {
31403141 local_scalar_t__ DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());
31413142 (void) DUMMY_VAR__; // suppress unused var warning
31423143 try {
3143- current_statement__ = 117 ;
3144+ current_statement__ = 118 ;
31443145 return i;
31453146 } catch (const std::exception& e) {
31463147 stan::lang::rethrow_located(e, locations_array__[current_statement__]);
@@ -3192,27 +3193,27 @@ class indexing_model final : public model_base_crtp<indexing_model> {
31923193 try {
31933194 int pos__ = std::numeric_limits<int>::min();
31943195 pos__ = 1;
3195- current_statement__ = 71 ;
3196+ current_statement__ = 72 ;
31963197 context__.validate_dims("data initialization","N","int",
31973198 std::vector<size_t>{});
31983199 N = std::numeric_limits<int>::min();
31993200
32003201
3201- current_statement__ = 71;
3202- N = context__.vals_i("N")[(1 - 1)];
32033202 current_statement__ = 72;
3203+ N = context__.vals_i("N")[(1 - 1)];
3204+ current_statement__ = 73;
32043205 context__.validate_dims("data initialization","M","int",
32053206 std::vector<size_t>{});
32063207 M = std::numeric_limits<int>::min();
32073208
32083209
3209- current_statement__ = 72;
3210- M = context__.vals_i("M")[(1 - 1)];
32113210 current_statement__ = 73;
3212- stan::math::validate_non_negative_index("dat_x", "N", N) ;
3211+ M = context__.vals_i("M")[(1 - 1)] ;
32133212 current_statement__ = 74;
3214- stan::math::validate_non_negative_index("dat_x", "M ", M );
3213+ stan::math::validate_non_negative_index("dat_x", "N ", N );
32153214 current_statement__ = 75;
3215+ stan::math::validate_non_negative_index("dat_x", "M", M);
3216+ current_statement__ = 76;
32163217 context__.validate_dims("data initialization","dat_x","double",
32173218 std::vector<size_t>{static_cast<size_t>(N),
32183219 static_cast<size_t>(M)});
@@ -3224,26 +3225,26 @@ class indexing_model final : public model_base_crtp<indexing_model> {
32243225
32253226 {
32263227 std::vector<local_scalar_t__> dat_x_flat__;
3227- current_statement__ = 75 ;
3228+ current_statement__ = 76 ;
32283229 dat_x_flat__ = context__.vals_r("dat_x");
3229- current_statement__ = 75 ;
3230+ current_statement__ = 76 ;
32303231 pos__ = 1;
3231- current_statement__ = 75 ;
3232+ current_statement__ = 76 ;
32323233 for (int sym1__ = 1; sym1__ <= M; ++sym1__) {
3233- current_statement__ = 75 ;
3234+ current_statement__ = 76 ;
32343235 for (int sym2__ = 1; sym2__ <= N; ++sym2__) {
3235- current_statement__ = 75 ;
3236+ current_statement__ = 76 ;
32363237 stan::model::assign(dat_x, dat_x_flat__[(pos__ - 1)],
32373238 "assigning variable dat_x", stan::model::index_uni(sym2__),
32383239 stan::model::index_uni(sym1__));
3239- current_statement__ = 75 ;
3240+ current_statement__ = 76 ;
32403241 pos__ = (pos__ + 1);
32413242 }
32423243 }
32433244 }
3244- current_statement__ = 76;
3245- stan::math::validate_non_negative_index("y", "N", N);
32463245 current_statement__ = 77;
3246+ stan::math::validate_non_negative_index("y", "N", N);
3247+ current_statement__ = 78;
32473248 context__.validate_dims("data initialization","y","double",
32483249 std::vector<size_t>{static_cast<size_t>(N)});
32493250 y__ =
@@ -3253,124 +3254,124 @@ class indexing_model final : public model_base_crtp<indexing_model> {
32533254
32543255 {
32553256 std::vector<local_scalar_t__> y_flat__;
3256- current_statement__ = 77 ;
3257+ current_statement__ = 78 ;
32573258 y_flat__ = context__.vals_r("y");
3258- current_statement__ = 77 ;
3259+ current_statement__ = 78 ;
32593260 pos__ = 1;
3260- current_statement__ = 77 ;
3261+ current_statement__ = 78 ;
32613262 for (int sym1__ = 1; sym1__ <= N; ++sym1__) {
3262- current_statement__ = 77 ;
3263+ current_statement__ = 78 ;
32633264 stan::model::assign(y, y_flat__[(pos__ - 1)],
32643265 "assigning variable y", stan::model::index_uni(sym1__));
3265- current_statement__ = 77 ;
3266+ current_statement__ = 78 ;
32663267 pos__ = (pos__ + 1);
32673268 }
32683269 }
3269- current_statement__ = 78;
3270- stan::math::validate_non_negative_index("idx_tester", "N", N);
32713270 current_statement__ = 79;
3271+ stan::math::validate_non_negative_index("idx_tester", "N", N);
3272+ current_statement__ = 80;
32723273 context__.validate_dims("data initialization","idx_tester","int",
32733274 std::vector<size_t>{static_cast<size_t>(N)});
32743275 idx_tester = std::vector<int>(N, std::numeric_limits<int>::min());
32753276
32763277
3277- current_statement__ = 79;
3278- idx_tester = context__.vals_i("idx_tester");
32793278 current_statement__ = 80;
3280- stan::math::validate_non_negative_index("p_soa_vec_v", "M", M );
3279+ idx_tester = context__.vals_i("idx_tester" );
32813280 current_statement__ = 81;
3282- stan::math::validate_non_negative_index("p_soa_mat ", "N ", N );
3281+ stan::math::validate_non_negative_index("p_soa_vec_v ", "M ", M );
32833282 current_statement__ = 82;
3284- stan::math::validate_non_negative_index("p_soa_mat", "M ", M );
3283+ stan::math::validate_non_negative_index("p_soa_mat", "N ", N );
32853284 current_statement__ = 83;
3286- stan::math::validate_non_negative_index("p_soa_arr_vec_v ", "N ", N );
3285+ stan::math::validate_non_negative_index("p_soa_mat ", "M ", M );
32873286 current_statement__ = 84;
3288- stan::math::validate_non_negative_index("p_soa_mat_uni_col_idx ", "N", N);
3287+ stan::math::validate_non_negative_index("p_soa_arr_vec_v ", "N", N);
32893288 current_statement__ = 85;
3290- stan::math::validate_non_negative_index("p_soa_mat_uni_col_idx", "M ", M );
3289+ stan::math::validate_non_negative_index("p_soa_mat_uni_col_idx", "N ", N );
32913290 current_statement__ = 86;
3292- stan::math::validate_non_negative_index("p_soa_vec_uni_idx ", "N ", N );
3291+ stan::math::validate_non_negative_index("p_soa_mat_uni_col_idx ", "M ", M );
32933292 current_statement__ = 87;
3293+ stan::math::validate_non_negative_index("p_soa_vec_uni_idx", "N", N);
3294+ current_statement__ = 88;
32943295 stan::math::validate_non_negative_index("p_soa_loop_mat_uni_col_idx",
32953296 "N", N);
3296- current_statement__ = 88 ;
3297+ current_statement__ = 89 ;
32973298 stan::math::validate_non_negative_index("p_soa_loop_mat_uni_col_idx",
32983299 "M", M);
3299- current_statement__ = 89;
3300- stan::math::validate_non_negative_index("p_soa_lhs_loop_mul", "N", N);
33013300 current_statement__ = 90;
3302- stan::math::validate_non_negative_index("p_soa_rhs_loop_mul ", "N", N);
3301+ stan::math::validate_non_negative_index("p_soa_lhs_loop_mul ", "N", N);
33033302 current_statement__ = 91;
3303+ stan::math::validate_non_negative_index("p_soa_rhs_loop_mul", "N", N);
3304+ current_statement__ = 92;
33043305 stan::math::validate_non_negative_index("p_soa_used_with_aos_in_excluded_fun",
33053306 "N", N);
3306- current_statement__ = 92;
3307- stan::math::validate_non_negative_index("p_soa_rep_matrix_vec", "N", N);
33083307 current_statement__ = 93;
3308+ stan::math::validate_non_negative_index("p_soa_rep_matrix_vec", "N", N);
3309+ current_statement__ = 94;
33093310 stan::math::validate_non_negative_index("p_soa_mat_pass_func_outer_single_indexed1",
33103311 "N", N);
3311- current_statement__ = 94 ;
3312+ current_statement__ = 95 ;
33123313 stan::math::validate_non_negative_index("p_soa_mat_pass_func_outer_single_indexed1",
33133314 "M", M);
3314- current_statement__ = 95 ;
3315+ current_statement__ = 96 ;
33153316 stan::math::validate_non_negative_index("p_soa_mat_pass_func_outer_single_indexed2",
33163317 "N", N);
3317- current_statement__ = 96 ;
3318+ current_statement__ = 97 ;
33183319 stan::math::validate_non_negative_index("p_soa_mat_pass_func_outer_single_indexed2",
33193320 "M", M);
3320- current_statement__ = 97 ;
3321+ current_statement__ = 98 ;
33213322 stan::math::validate_non_negative_index("p_aos_vec_v_assign_to_aos",
33223323 "M", M);
3323- current_statement__ = 98 ;
3324+ current_statement__ = 99 ;
33243325 stan::math::validate_non_negative_index("p_aos_vec_v_tp_fails_func",
33253326 "M", M);
3326- current_statement__ = 99 ;
3327+ current_statement__ = 100 ;
33273328 stan::math::validate_non_negative_index("p_aos_loop_vec_v_uni_idx",
33283329 "M", M);
3329- current_statement__ = 100 ;
3330+ current_statement__ = 101 ;
33303331 stan::math::validate_non_negative_index("p_aos_fail_assign_from_top_idx",
33313332 "M", M);
3332- current_statement__ = 101 ;
3333+ current_statement__ = 102 ;
33333334 stan::math::validate_non_negative_index("p_aos_loop_mat_uni_uni_idx",
33343335 "N", N);
3335- current_statement__ = 102 ;
3336+ current_statement__ = 103 ;
33363337 stan::math::validate_non_negative_index("p_aos_loop_mat_uni_uni_idx",
33373338 "M", M);
3338- current_statement__ = 103 ;
3339+ current_statement__ = 104 ;
33393340 stan::math::validate_non_negative_index("p_soa_loop_mat_multi_uni_uni_idx",
33403341 "N", N);
3341- current_statement__ = 104 ;
3342+ current_statement__ = 105 ;
33423343 stan::math::validate_non_negative_index("p_soa_loop_mat_multi_uni_uni_idx",
33433344 "M", M);
3344- current_statement__ = 105;
3345- stan::math::validate_non_negative_index("p_aos_mat", "N", N);
33463345 current_statement__ = 106;
3347- stan::math::validate_non_negative_index("p_aos_mat", "M ", M );
3346+ stan::math::validate_non_negative_index("p_aos_mat", "N ", N );
33483347 current_statement__ = 107;
3348+ stan::math::validate_non_negative_index("p_aos_mat", "M", M);
3349+ current_statement__ = 108;
33493350 stan::math::validate_non_negative_index("p_aos_mat_fail_uni_uni_idx1",
33503351 "N", N);
3351- current_statement__ = 108 ;
3352+ current_statement__ = 109 ;
33523353 stan::math::validate_non_negative_index("p_aos_mat_fail_uni_uni_idx1",
33533354 "M", M);
3354- current_statement__ = 109 ;
3355+ current_statement__ = 110 ;
33553356 stan::math::validate_non_negative_index("p_aos_mat_fail_uni_uni_idx2",
33563357 "N", N);
3357- current_statement__ = 110 ;
3358+ current_statement__ = 111 ;
33583359 stan::math::validate_non_negative_index("p_aos_mat_fail_uni_uni_idx2",
33593360 "M", M);
3360- current_statement__ = 111;
3361- stan::math::validate_non_negative_index("tp_aos_vec_v", "M", M);
33623361 current_statement__ = 112;
3362+ stan::math::validate_non_negative_index("tp_aos_vec_v", "M", M);
3363+ current_statement__ = 113;
33633364 stan::math::validate_non_negative_index("tp_soa_single_idx_uninit",
33643365 "M", M);
3365- current_statement__ = 113 ;
3366+ current_statement__ = 114 ;
33663367 stan::math::validate_non_negative_index("tp_aos_fail_func_vec_v", "M",
33673368 M);
3368- current_statement__ = 114 ;
3369+ current_statement__ = 115 ;
33693370 stan::math::validate_non_negative_index("tp_aos_fail_assign_from_top_idx",
33703371 "M", M);
3371- current_statement__ = 115;
3372- stan::math::validate_non_negative_index("tp_soa_rep_matrix_mat", "N", N);
33733372 current_statement__ = 116;
3373+ stan::math::validate_non_negative_index("tp_soa_rep_matrix_mat", "N", N);
3374+ current_statement__ = 117;
33743375 stan::math::validate_non_negative_index("tp_soa_rep_matrix_from_data_mat",
33753376 "N", N);
33763377 } catch (const std::exception& e) {
@@ -3768,7 +3769,7 @@ class indexing_model final : public model_base_crtp<indexing_model> {
37683769 stan::model::assign(tp_soa_single_assign_from_soa,
37693770 stan::math::multiply(p_soa_lhs_loop_mul, p_soa_rhs_loop_mul),
37703771 "assigning variable tp_soa_single_assign_from_soa", stan::model::index_uni(2));
3771- current_statement__ = 59 ;
3772+ current_statement__ = 60 ;
37723773 for (int i = 1; i <= 10; ++i) {
37733774 current_statement__ = 50;
37743775 lp_accum__.add(
@@ -3841,32 +3842,45 @@ class indexing_model final : public model_base_crtp<indexing_model> {
38413842 "transpose(multiply(p_soa_mat_pass_func_outer_single_indexed1,\np_soa_mat_pass_func_outer_single_indexed2))",
38423843 stan::model::index_uni(mask_fun(i, pstream__)),
38433844 stan::model::index_uni(mask_fun(i, pstream__)))), 1.0));
3845+ current_statement__ = 58;
3846+ lp_accum__.add(
3847+ stan::math::normal_lpdf<propto__>(y,
3848+ stan::math::multiply(
3849+ stan::model::rvalue(dat_x, "dat_x",
3850+ stan::model::index_omni(), stan::model::index_uni(i)),
3851+ (stan::model::rvalue(p_aos_mat_fail_uni_uni_idx1,
3852+ "p_aos_mat_fail_uni_uni_idx1",
3853+ stan::model::index_uni(i), stan::model::index_uni(i)) *
3854+ stan::model::rvalue(p_aos_mat_fail_uni_uni_idx2,
3855+ "p_aos_mat_fail_uni_uni_idx2",
3856+ stan::model::index_uni(i), stan::model::index_uni(i)))),
3857+ 1.0));
38443858 }
3845- current_statement__ = 60 ;
3859+ current_statement__ = 61 ;
38463860 stan::math::validate_non_negative_index("tp_aos_loop_vec_v_uni_idx",
38473861 "N", N);
38483862 Eigen::Matrix<local_scalar_t__, -1, 1> tp_aos_loop_vec_v_uni_idx =
38493863 Eigen::Matrix<local_scalar_t__, -1, 1>::Constant(N, DUMMY_VAR__);
3850- current_statement__ = 62 ;
3864+ current_statement__ = 63 ;
38513865 stan::math::validate_non_negative_index("tp_aos_loop_vec_v_multi_uni_idx",
38523866 "N", N);
38533867 Eigen::Matrix<local_scalar_t__, -1, 1> tp_aos_loop_vec_v_multi_uni_idx =
38543868 Eigen::Matrix<local_scalar_t__, -1, 1>::Constant(N, DUMMY_VAR__);
3855- current_statement__ = 70 ;
3869+ current_statement__ = 71 ;
38563870 for (int i = 1; i <= N; ++i) {
3857- current_statement__ = 64 ;
3871+ current_statement__ = 65 ;
38583872 stan::model::assign(tp_aos_loop_vec_v_uni_idx,
38593873 stan::math::multiply(p_soa_lhs_loop_mul, p_soa_rhs_loop_mul),
38603874 "assigning variable tp_aos_loop_vec_v_uni_idx", stan::model::index_uni(i));
3861- current_statement__ = 65 ;
3875+ current_statement__ = 66 ;
38623876 stan::model::assign(tp_aos_loop_vec_v_multi_uni_idx,
38633877 stan::math::multiply(p_soa_lhs_loop_mul, p_soa_rhs_loop_mul),
38643878 "assigning variable tp_aos_loop_vec_v_multi_uni_idx", stan::model::index_uni(
38653879 stan::model::rvalue(
38663880 idx_tester,
38673881 "idx_tester",
38683882 stan::model::index_uni(i))));
3869- current_statement__ = 66 ;
3883+ current_statement__ = 67 ;
38703884 lp_accum__.add(
38713885 stan::math::normal_lpdf<propto__>(y,
38723886 stan::math::multiply(
@@ -3875,7 +3889,7 @@ class indexing_model final : public model_base_crtp<indexing_model> {
38753889 stan::model::rvalue(p_aos_loop_vec_v_uni_idx,
38763890 "p_aos_loop_vec_v_uni_idx", stan::model::index_uni(i))),
38773891 1.0));
3878- current_statement__ = 67 ;
3892+ current_statement__ = 68 ;
38793893 lp_accum__.add(
38803894 stan::math::normal_lpdf<propto__>(y,
38813895 stan::math::multiply(
@@ -3885,7 +3899,7 @@ class indexing_model final : public model_base_crtp<indexing_model> {
38853899 "p_aos_loop_mat_uni_uni_idx",
38863900 stan::model::index_uni(i), stan::model::index_uni(i))),
38873901 1.0));
3888- current_statement__ = 68 ;
3902+ current_statement__ = 69 ;
38893903 lp_accum__.add(
38903904 stan::math::normal_lpdf<propto__>(y,
38913905 stan::model::rvalue(dat_x, "dat_x",
0 commit comments