From e649349ec31912cda3c0558ec278ae52f8bb8be7 Mon Sep 17 00:00:00 2001 From: Sean Pinkney Date: Sun, 24 Mar 2024 18:01:31 -0400 Subject: [PATCH 01/10] move stuff --- stan/math/fwd.hpp | 2 + stan/math/fwd/constraint.hpp | 9 ++ .../unit_vector_constrain.hpp | 6 +- stan/math/fwd/fun.hpp | 2 +- stan/math/mix.hpp | 2 + .../prim/{ => constraint}/lb_constrain.hpp | 4 +- .../prim/{ => constraint}/lub_constrain.hpp | 4 +- .../offset_multiplier_constrain.hpp | 4 +- .../prim/{ => constraint}/ub_constrain.hpp | 4 +- .../unit_vector_constrain.hpp | 4 +- stan/math/opencl/prim_constraint.cpp | 111 ++++++++++++++++++ .../rev/{ => constraint}/lb_constrain.hpp | 4 +- .../rev/{ => constraint}/lub_constrain.hpp | 4 +- .../offset_multiplier_constrain.hpp | 4 +- .../rev/{ => constraint}/ub_constrain.hpp | 4 +- .../unit_vector_constrain.hpp | 4 +- stan/math/opencl/rev_constraint.cpp | 111 ++++++++++++++++++ stan/math/prim.hpp | 2 + stan/math/prim/constraint.hpp | 42 +++++++ .../cholesky_corr_constrain.hpp | 6 +- .../cholesky_corr_free.hpp | 6 +- .../cholesky_factor_constrain.hpp | 4 +- .../cholesky_factor_free.hpp | 4 +- .../{fun => constraint}/corr_constrain.hpp | 4 +- .../prim/{fun => constraint}/corr_free.hpp | 4 +- .../corr_matrix_constrain.hpp | 6 +- .../{fun => constraint}/corr_matrix_free.hpp | 4 +- .../cov_matrix_constrain.hpp | 4 +- .../cov_matrix_constrain_lkj.hpp | 8 +- .../{fun => constraint}/cov_matrix_free.hpp | 4 +- .../cov_matrix_free_lkj.hpp | 4 +- .../identity_constrain.hpp | 4 +- .../{fun => constraint}/identity_free.hpp | 4 +- .../prim/{fun => constraint}/lb_constrain.hpp | 8 +- .../math/prim/{fun => constraint}/lb_free.hpp | 6 +- .../{fun => constraint}/lub_constrain.hpp | 10 +- .../prim/{fun => constraint}/lub_free.hpp | 8 +- .../offset_multiplier_constrain.hpp | 6 +- .../offset_multiplier_free.hpp | 6 +- .../{fun => constraint}/ordered_constrain.hpp | 4 +- .../prim/{fun => constraint}/ordered_free.hpp | 4 +- .../positive_constrain.hpp | 4 +- .../{fun => constraint}/positive_free.hpp | 4 +- .../positive_ordered_constrain.hpp | 4 +- .../positive_ordered_free.hpp | 4 +- .../{fun => constraint}/prob_constrain.hpp | 4 +- .../prim/{fun => constraint}/prob_free.hpp | 4 +- .../{fun => constraint}/simplex_constrain.hpp | 4 +- .../prim/{fun => constraint}/simplex_free.hpp | 4 +- .../stochastic_column_constrain.hpp | 6 +- .../stochastic_column_free.hpp | 6 +- .../stochastic_row_constrain.hpp | 6 +- .../stochastic_row_free.hpp | 6 +- .../prim/{fun => constraint}/ub_constrain.hpp | 8 +- .../math/prim/{fun => constraint}/ub_free.hpp | 6 +- .../unit_vector_constrain.hpp | 4 +- .../{fun => constraint}/unit_vector_free.hpp | 4 +- stan/math/prim/fun.hpp | 38 ------ stan/math/rev.hpp | 2 + stan/math/rev/constraint.hpp | 26 ++++ .../cholesky_corr_constrain.hpp | 6 +- .../cholesky_factor_constrain.hpp | 4 +- .../corr_matrix_constrain.hpp | 6 +- .../cov_matrix_constrain.hpp | 4 +- .../cov_matrix_constrain_lkj.hpp | 8 +- .../identity_constrain.hpp | 6 +- .../rev/{fun => constraint}/identity_free.hpp | 6 +- .../rev/{fun => constraint}/lb_constrain.hpp | 10 +- .../rev/{fun => constraint}/lub_constrain.hpp | 10 +- .../{fun => constraint}/ordered_constrain.hpp | 4 +- .../positive_ordered_constrain.hpp | 4 +- .../{fun => constraint}/simplex_constrain.hpp | 4 +- .../stochastic_column_constrain.hpp | 4 +- .../stochastic_row_constrain.hpp | 4 +- .../rev/{fun => constraint}/ub_constrain.hpp | 6 +- .../unit_vector_constrain.hpp | 4 +- stan/math/rev/fun.hpp | 17 +-- .../cholesky_corr_constrain_test.cpp | 0 .../cholesky_factor_constrain_test.cpp | 0 .../corr_constrain_test.cpp | 0 .../corr_matrix_constrain_test.cpp | 0 .../cov_matrix_constrain_lkj_test.cpp | 0 .../cov_matrix_constrain_test.cpp | 0 .../identity_constrain_test.cpp | 0 .../lb_constrain_matvar_test.cpp | 0 .../{fun => constraint}/lb_constrain_test.cpp | 0 .../lub_constrain_1_test.cpp | 2 +- .../lub_constrain_2_test.cpp | 2 +- .../lub_constrain_3_test.cpp | 2 +- .../lub_constrain_4_test.cpp | 2 +- .../lub_constrain_5_test.cpp | 2 +- .../lub_constrain_6_test.cpp | 2 +- .../lub_constrain_7_test.cpp | 2 +- .../lub_constrain_8_test.cpp | 2 +- .../lub_constrain_helpers.hpp | 0 .../lub_constrain_matvar_test.cpp | 0 ...set_multiplier_constrain_1_matvar_test.cpp | 2 +- .../offset_multiplier_constrain_1_test.cpp | 2 +- ...set_multiplier_constrain_2_matvar_test.cpp | 2 +- .../offset_multiplier_constrain_2_test.cpp | 2 +- ...set_multiplier_constrain_3_matvar_test.cpp | 2 +- .../offset_multiplier_constrain_3_test.cpp | 2 +- ...set_multiplier_constrain_4_matvar_test.cpp | 2 +- .../offset_multiplier_constrain_4_test.cpp | 2 +- ...set_multiplier_constrain_5_matvar_test.cpp | 2 +- .../offset_multiplier_constrain_5_test.cpp | 2 +- ...set_multiplier_constrain_6_matvar_test.cpp | 2 +- .../offset_multiplier_constrain_6_test.cpp | 2 +- .../offset_multiplier_constrain_7_test.cpp | 0 .../offset_multiplier_constrain_helpers.hpp | 0 ...et_multiplier_constrain_matvar_helpers.hpp | 0 .../ordered_constrain_test.cpp | 0 .../positive_ordered_constrain_test.cpp | 0 .../simplex_constrain_test.cpp | 0 .../stochastic_column_constrain_test.cpp | 0 .../stochastic_row_constrain_test.cpp | 0 .../unit_vector_constrain_test.cpp | 0 .../{ => constraint}/lb_constrain_test.cpp | 0 .../{ => constraint}/lub_constrain_test.cpp | 0 .../offset_multiplier_constrain_test.cpp | 0 .../{ => constraint}/ub_constrain_test.cpp | 0 .../unit_vector_constrain_test.cpp | 0 .../cholesky_corr_transform_test.cpp | 0 .../cholesky_factor_transform_test.cpp | 0 .../corr_transform_test.cpp | 0 .../cov_matrix_transform_test.cpp | 0 .../identity_transform_test.cpp | 0 .../{fun => constraint}/lb_transform_test.cpp | 0 .../lub_transform_test.cpp | 0 ...ffset_multiplier_matrix_transform_test.cpp | 0 .../offset_multiplier_transform_test.cpp | 0 .../ordered_transform_test.cpp | 0 .../prob_transform_test.cpp | 0 .../simplex_transform_test.cpp | 0 .../stochastic_column_constrain_test.cpp | 0 .../stochastic_row_constrain_test.cpp | 0 .../{fun => constraint}/ub_transform_test.cpp | 0 .../unit_vector_transform_test.cpp | 0 138 files changed, 495 insertions(+), 241 deletions(-) create mode 100644 stan/math/fwd/constraint.hpp rename stan/math/fwd/{fun => constraint}/unit_vector_constrain.hpp (90%) rename stan/math/opencl/prim/{ => constraint}/lb_constrain.hpp (94%) rename stan/math/opencl/prim/{ => constraint}/lub_constrain.hpp (96%) rename stan/math/opencl/prim/{ => constraint}/offset_multiplier_constrain.hpp (96%) rename stan/math/opencl/prim/{ => constraint}/ub_constrain.hpp (94%) rename stan/math/opencl/prim/{ => constraint}/unit_vector_constrain.hpp (92%) create mode 100644 stan/math/opencl/prim_constraint.cpp rename stan/math/opencl/rev/{ => constraint}/lb_constrain.hpp (96%) rename stan/math/opencl/rev/{ => constraint}/lub_constrain.hpp (97%) rename stan/math/opencl/rev/{ => constraint}/offset_multiplier_constrain.hpp (96%) rename stan/math/opencl/rev/{ => constraint}/ub_constrain.hpp (96%) rename stan/math/opencl/rev/{ => constraint}/unit_vector_constrain.hpp (93%) create mode 100644 stan/math/opencl/rev_constraint.cpp create mode 100644 stan/math/prim/constraint.hpp rename stan/math/prim/{fun => constraint}/cholesky_corr_constrain.hpp (96%) rename stan/math/prim/{fun => constraint}/cholesky_corr_free.hpp (89%) rename stan/math/prim/{fun => constraint}/cholesky_factor_constrain.hpp (97%) rename stan/math/prim/{fun => constraint}/cholesky_factor_free.hpp (94%) rename stan/math/prim/{fun => constraint}/corr_constrain.hpp (95%) rename stan/math/prim/{fun => constraint}/corr_free.hpp (89%) rename stan/math/prim/{fun => constraint}/corr_matrix_constrain.hpp (97%) rename stan/math/prim/{fun => constraint}/corr_matrix_free.hpp (95%) rename stan/math/prim/{fun => constraint}/cov_matrix_constrain.hpp (98%) rename stan/math/prim/{fun => constraint}/cov_matrix_constrain_lkj.hpp (95%) rename stan/math/prim/{fun => constraint}/cov_matrix_free.hpp (95%) rename stan/math/prim/{fun => constraint}/cov_matrix_free_lkj.hpp (95%) rename stan/math/prim/{fun => constraint}/identity_constrain.hpp (87%) rename stan/math/prim/{fun => constraint}/identity_free.hpp (86%) rename stan/math/prim/{fun => constraint}/lb_constrain.hpp (97%) rename stan/math/prim/{fun => constraint}/lb_free.hpp (96%) rename stan/math/prim/{fun => constraint}/lub_constrain.hpp (98%) rename stan/math/prim/{fun => constraint}/lub_free.hpp (96%) rename stan/math/prim/{fun => constraint}/offset_multiplier_constrain.hpp (98%) rename stan/math/prim/{fun => constraint}/offset_multiplier_free.hpp (96%) rename stan/math/prim/{fun => constraint}/ordered_constrain.hpp (97%) rename stan/math/prim/{fun => constraint}/ordered_free.hpp (94%) rename stan/math/prim/{fun => constraint}/positive_constrain.hpp (96%) rename stan/math/prim/{fun => constraint}/positive_free.hpp (89%) rename stan/math/prim/{fun => constraint}/positive_ordered_constrain.hpp (96%) rename stan/math/prim/{fun => constraint}/positive_ordered_free.hpp (93%) rename stan/math/prim/{fun => constraint}/prob_constrain.hpp (95%) rename stan/math/prim/{fun => constraint}/prob_free.hpp (89%) rename stan/math/prim/{fun => constraint}/simplex_constrain.hpp (97%) rename stan/math/prim/{fun => constraint}/simplex_free.hpp (95%) rename stan/math/prim/{fun => constraint}/stochastic_column_constrain.hpp (95%) rename stan/math/prim/{fun => constraint}/stochastic_column_free.hpp (88%) rename stan/math/prim/{fun => constraint}/stochastic_row_constrain.hpp (96%) rename stan/math/prim/{fun => constraint}/stochastic_row_free.hpp (89%) rename stan/math/prim/{fun => constraint}/ub_constrain.hpp (97%) rename stan/math/prim/{fun => constraint}/ub_free.hpp (96%) rename stan/math/prim/{fun => constraint}/unit_vector_constrain.hpp (97%) rename stan/math/prim/{fun => constraint}/unit_vector_free.hpp (92%) create mode 100644 stan/math/rev/constraint.hpp rename stan/math/rev/{fun => constraint}/cholesky_corr_constrain.hpp (96%) rename stan/math/rev/{fun => constraint}/cholesky_factor_constrain.hpp (96%) rename stan/math/rev/{fun => constraint}/corr_matrix_constrain.hpp (94%) rename stan/math/rev/{fun => constraint}/cov_matrix_constrain.hpp (97%) rename stan/math/rev/{fun => constraint}/cov_matrix_constrain_lkj.hpp (92%) rename stan/math/rev/{fun => constraint}/identity_constrain.hpp (87%) rename stan/math/rev/{fun => constraint}/identity_free.hpp (80%) rename stan/math/rev/{fun => constraint}/lb_constrain.hpp (98%) rename stan/math/rev/{fun => constraint}/lub_constrain.hpp (99%) rename stan/math/rev/{fun => constraint}/ordered_constrain.hpp (95%) rename stan/math/rev/{fun => constraint}/positive_ordered_constrain.hpp (92%) rename stan/math/rev/{fun => constraint}/simplex_constrain.hpp (97%) rename stan/math/rev/{fun => constraint}/stochastic_column_constrain.hpp (97%) rename stan/math/rev/{fun => constraint}/stochastic_row_constrain.hpp (97%) rename stan/math/rev/{fun => constraint}/ub_constrain.hpp (98%) rename stan/math/rev/{fun => constraint}/unit_vector_constrain.hpp (95%) rename test/unit/math/mix/{fun => constraint}/cholesky_corr_constrain_test.cpp (100%) rename test/unit/math/mix/{fun => constraint}/cholesky_factor_constrain_test.cpp (100%) rename test/unit/math/mix/{fun => constraint}/corr_constrain_test.cpp (100%) rename test/unit/math/mix/{fun => constraint}/corr_matrix_constrain_test.cpp (100%) rename test/unit/math/mix/{fun => constraint}/cov_matrix_constrain_lkj_test.cpp (100%) rename test/unit/math/mix/{fun => constraint}/cov_matrix_constrain_test.cpp (100%) rename test/unit/math/mix/{fun => constraint}/identity_constrain_test.cpp (100%) rename test/unit/math/mix/{fun => constraint}/lb_constrain_matvar_test.cpp (100%) rename test/unit/math/mix/{fun => constraint}/lb_constrain_test.cpp (100%) rename test/unit/math/mix/{fun => constraint}/lub_constrain_1_test.cpp (91%) rename test/unit/math/mix/{fun => constraint}/lub_constrain_2_test.cpp (95%) rename test/unit/math/mix/{fun => constraint}/lub_constrain_3_test.cpp (96%) rename test/unit/math/mix/{fun => constraint}/lub_constrain_4_test.cpp (94%) rename test/unit/math/mix/{fun => constraint}/lub_constrain_5_test.cpp (96%) rename test/unit/math/mix/{fun => constraint}/lub_constrain_6_test.cpp (96%) rename test/unit/math/mix/{fun => constraint}/lub_constrain_7_test.cpp (96%) rename test/unit/math/mix/{fun => constraint}/lub_constrain_8_test.cpp (96%) rename test/unit/math/mix/{fun => constraint}/lub_constrain_helpers.hpp (100%) rename test/unit/math/mix/{fun => constraint}/lub_constrain_matvar_test.cpp (100%) rename test/unit/math/mix/{fun => constraint}/offset_multiplier_constrain_1_matvar_test.cpp (92%) rename test/unit/math/mix/{fun => constraint}/offset_multiplier_constrain_1_test.cpp (92%) rename test/unit/math/mix/{fun => constraint}/offset_multiplier_constrain_2_matvar_test.cpp (91%) rename test/unit/math/mix/{fun => constraint}/offset_multiplier_constrain_2_test.cpp (91%) rename test/unit/math/mix/{fun => constraint}/offset_multiplier_constrain_3_matvar_test.cpp (94%) rename test/unit/math/mix/{fun => constraint}/offset_multiplier_constrain_3_test.cpp (94%) rename test/unit/math/mix/{fun => constraint}/offset_multiplier_constrain_4_matvar_test.cpp (88%) rename test/unit/math/mix/{fun => constraint}/offset_multiplier_constrain_4_test.cpp (88%) rename test/unit/math/mix/{fun => constraint}/offset_multiplier_constrain_5_matvar_test.cpp (90%) rename test/unit/math/mix/{fun => constraint}/offset_multiplier_constrain_5_test.cpp (90%) rename test/unit/math/mix/{fun => constraint}/offset_multiplier_constrain_6_matvar_test.cpp (91%) rename test/unit/math/mix/{fun => constraint}/offset_multiplier_constrain_6_test.cpp (91%) rename test/unit/math/mix/{fun => constraint}/offset_multiplier_constrain_7_test.cpp (100%) rename test/unit/math/mix/{fun => constraint}/offset_multiplier_constrain_helpers.hpp (100%) rename test/unit/math/mix/{fun => constraint}/offset_multiplier_constrain_matvar_helpers.hpp (100%) rename test/unit/math/mix/{fun => constraint}/ordered_constrain_test.cpp (100%) rename test/unit/math/mix/{fun => constraint}/positive_ordered_constrain_test.cpp (100%) rename test/unit/math/mix/{fun => constraint}/simplex_constrain_test.cpp (100%) rename test/unit/math/mix/{fun => constraint}/stochastic_column_constrain_test.cpp (100%) rename test/unit/math/mix/{fun => constraint}/stochastic_row_constrain_test.cpp (100%) rename test/unit/math/mix/{fun => constraint}/unit_vector_constrain_test.cpp (100%) rename test/unit/math/opencl/rev/{ => constraint}/lb_constrain_test.cpp (100%) rename test/unit/math/opencl/rev/{ => constraint}/lub_constrain_test.cpp (100%) rename test/unit/math/opencl/rev/{ => constraint}/offset_multiplier_constrain_test.cpp (100%) rename test/unit/math/opencl/rev/{ => constraint}/ub_constrain_test.cpp (100%) rename test/unit/math/opencl/rev/{ => constraint}/unit_vector_constrain_test.cpp (100%) rename test/unit/math/prim/{fun => constraint}/cholesky_corr_transform_test.cpp (100%) rename test/unit/math/prim/{fun => constraint}/cholesky_factor_transform_test.cpp (100%) rename test/unit/math/prim/{fun => constraint}/corr_transform_test.cpp (100%) rename test/unit/math/prim/{fun => constraint}/cov_matrix_transform_test.cpp (100%) rename test/unit/math/prim/{fun => constraint}/identity_transform_test.cpp (100%) rename test/unit/math/prim/{fun => constraint}/lb_transform_test.cpp (100%) rename test/unit/math/prim/{fun => constraint}/lub_transform_test.cpp (100%) rename test/unit/math/prim/{fun => constraint}/offset_multiplier_matrix_transform_test.cpp (100%) rename test/unit/math/prim/{fun => constraint}/offset_multiplier_transform_test.cpp (100%) rename test/unit/math/prim/{fun => constraint}/ordered_transform_test.cpp (100%) rename test/unit/math/prim/{fun => constraint}/prob_transform_test.cpp (100%) rename test/unit/math/prim/{fun => constraint}/simplex_transform_test.cpp (100%) rename test/unit/math/prim/{fun => constraint}/stochastic_column_constrain_test.cpp (100%) rename test/unit/math/prim/{fun => constraint}/stochastic_row_constrain_test.cpp (100%) rename test/unit/math/prim/{fun => constraint}/ub_transform_test.cpp (100%) rename test/unit/math/prim/{fun => constraint}/unit_vector_transform_test.cpp (100%) diff --git a/stan/math/fwd.hpp b/stan/math/fwd.hpp index 3bab5be267f..2ff806f5d34 100644 --- a/stan/math/fwd.hpp +++ b/stan/math/fwd.hpp @@ -5,8 +5,10 @@ #ifdef STAN_OPENCL #include +#include #endif +#include #include #include #include diff --git a/stan/math/fwd/constraint.hpp b/stan/math/fwd/constraint.hpp new file mode 100644 index 00000000000..87a396055b4 --- /dev/null +++ b/stan/math/fwd/constraint.hpp @@ -0,0 +1,9 @@ +#ifndef STAN_MATH_FWD_CONSTRAINT_HPP +#define STAN_MATH_FWD_CONSTRAINT_HPP + +#include +#include + +#include + +#endif \ No newline at end of file diff --git a/stan/math/fwd/fun/unit_vector_constrain.hpp b/stan/math/fwd/constraint/unit_vector_constrain.hpp similarity index 90% rename from stan/math/fwd/fun/unit_vector_constrain.hpp rename to stan/math/fwd/constraint/unit_vector_constrain.hpp index 1cd708174cb..1b1b258e5a8 100644 --- a/stan/math/fwd/fun/unit_vector_constrain.hpp +++ b/stan/math/fwd/constraint/unit_vector_constrain.hpp @@ -1,5 +1,5 @@ -#ifndef STAN_MATH_FWD_FUN_UNIT_VECTOR_CONSTRAIN_HPP -#define STAN_MATH_FWD_FUN_UNIT_VECTOR_CONSTRAIN_HPP +#ifndef STAN_MATH_FWD_CONSTRAINT_UNIT_VECTOR_CONSTRAIN_HPP +#define STAN_MATH_FWD_CONSTRAINT_UNIT_VECTOR_CONSTRAIN_HPP #include #include @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include #include diff --git a/stan/math/fwd/fun.hpp b/stan/math/fwd/fun.hpp index cd4f25d8e11..6457ea3b6cf 100644 --- a/stan/math/fwd/fun.hpp +++ b/stan/math/fwd/fun.hpp @@ -120,7 +120,7 @@ #include #include #include -#include +#include #include #include diff --git a/stan/math/mix.hpp b/stan/math/mix.hpp index deb3cbba522..d65900c6cd3 100644 --- a/stan/math/mix.hpp +++ b/stan/math/mix.hpp @@ -13,8 +13,10 @@ #ifdef STAN_OPENCL #include +#include #endif +#include #include #include #include diff --git a/stan/math/opencl/prim/lb_constrain.hpp b/stan/math/opencl/prim/constraint/lb_constrain.hpp similarity index 94% rename from stan/math/opencl/prim/lb_constrain.hpp rename to stan/math/opencl/prim/constraint/lb_constrain.hpp index 0ef7e77b16d..e94f6ead13f 100644 --- a/stan/math/opencl/prim/lb_constrain.hpp +++ b/stan/math/opencl/prim/constraint/lb_constrain.hpp @@ -1,5 +1,5 @@ -#ifndef STAN_MATH_OPENCL_PRIM_LB_CONSTRAIN_HPP -#define STAN_MATH_OPENCL_PRIM_LB_CONSTRAIN_HPP +#ifndef STAN_MATH_OPENCL_PRIM_CONSTRAINT_LB_CONSTRAIN_HPP +#define STAN_MATH_OPENCL_PRIM_CONSTRAINT_LB_CONSTRAIN_HPP #ifdef STAN_OPENCL #include diff --git a/stan/math/opencl/prim/lub_constrain.hpp b/stan/math/opencl/prim/constraint/lub_constrain.hpp similarity index 96% rename from stan/math/opencl/prim/lub_constrain.hpp rename to stan/math/opencl/prim/constraint/lub_constrain.hpp index 212e89537fe..a5fa4c6e2ea 100644 --- a/stan/math/opencl/prim/lub_constrain.hpp +++ b/stan/math/opencl/prim/constraint/lub_constrain.hpp @@ -1,5 +1,5 @@ -#ifndef STAN_MATH_OPENCL_PRIM_LUB_CONSTRAIN_HPP -#define STAN_MATH_OPENCL_PRIM_LUB_CONSTRAIN_HPP +#ifndef STAN_MATH_OPENCL_PRIM_CONSTRAINT_LUB_CONSTRAIN_HPP +#define STAN_MATH_OPENCL_PRIM_CONSTRAINT_LUB_CONSTRAIN_HPP #ifdef STAN_OPENCL #include diff --git a/stan/math/opencl/prim/offset_multiplier_constrain.hpp b/stan/math/opencl/prim/constraint/offset_multiplier_constrain.hpp similarity index 96% rename from stan/math/opencl/prim/offset_multiplier_constrain.hpp rename to stan/math/opencl/prim/constraint/offset_multiplier_constrain.hpp index 67c4b6457bc..481287f6457 100644 --- a/stan/math/opencl/prim/offset_multiplier_constrain.hpp +++ b/stan/math/opencl/prim/constraint/offset_multiplier_constrain.hpp @@ -1,5 +1,5 @@ -#ifndef STAN_MATH_OPENCL_PRIM_OFFSET_MULTIPLIER_CONSTRAIN_HPP -#define STAN_MATH_OPENCL_PRIM_OFFSET_MULTIPLIER_CONSTRAIN_HPP +#ifndef STAN_MATH_OPENCL_PRIM_CONSTRAINT_OFFSET_MULTIPLIER_CONSTRAIN_HPP +#define STAN_MATH_OPENCL_PRIM_CONSTRAINT_OFFSET_MULTIPLIER_CONSTRAIN_HPP #ifdef STAN_OPENCL #include diff --git a/stan/math/opencl/prim/ub_constrain.hpp b/stan/math/opencl/prim/constraint/ub_constrain.hpp similarity index 94% rename from stan/math/opencl/prim/ub_constrain.hpp rename to stan/math/opencl/prim/constraint/ub_constrain.hpp index eebb3e927c2..fd158ee93c8 100644 --- a/stan/math/opencl/prim/ub_constrain.hpp +++ b/stan/math/opencl/prim/constraint/ub_constrain.hpp @@ -1,5 +1,5 @@ -#ifndef STAN_MATH_OPENCL_PRIM_UB_CONSTRAIN_HPP -#define STAN_MATH_OPENCL_PRIM_UB_CONSTRAIN_HPP +#ifndef STAN_MATH_OPENCL_PRIM_CONSTRAINT_UB_CONSTRAIN_HPP +#define STAN_MATH_OPENCL_PRIM_CONSTRAINT_UB_CONSTRAIN_HPP #ifdef STAN_OPENCL #include diff --git a/stan/math/opencl/prim/unit_vector_constrain.hpp b/stan/math/opencl/prim/constraint/unit_vector_constrain.hpp similarity index 92% rename from stan/math/opencl/prim/unit_vector_constrain.hpp rename to stan/math/opencl/prim/constraint/unit_vector_constrain.hpp index e1f0b283061..a5a4c8c10bc 100644 --- a/stan/math/opencl/prim/unit_vector_constrain.hpp +++ b/stan/math/opencl/prim/constraint/unit_vector_constrain.hpp @@ -1,5 +1,5 @@ -#ifndef STAN_MATH_OPENCL_UNIT_VECTOR_CONSTRAIN_BLOCK_HPP -#define STAN_MATH_OPENCL_UNIT_VECTOR_CONSTRAIN_BLOCK_HPP +#ifndef STAN_MATH_OPENCL_PRIM_CONSTRAINT_UNIT_VECTOR_CONSTRAIN_BLOCK_HPP +#define STAN_MATH_OPENCL_PRIM_CONSTRAINT_UNIT_VECTOR_CONSTRAIN_BLOCK_HPP #ifdef STAN_OPENCL #include diff --git a/stan/math/opencl/prim_constraint.cpp b/stan/math/opencl/prim_constraint.cpp new file mode 100644 index 00000000000..9c38de83393 --- /dev/null +++ b/stan/math/opencl/prim_constraint.cpp @@ -0,0 +1,111 @@ +#ifndef STAN_MATH_OPENCL_PRIM_CONSTRAINT_HPP +#define STAN_MATH_OPENCL_PRIM_CONSTRAINT_HPP +#ifdef STAN_OPENCL + +/** + * \defgroup opencl OpenCL + * Stan's OpenCL backend allows for computation to be executed in parallel + * on a GPU or in multithreaded CPUs. It is meant to easily conform with Eigen + * such that you can create and read from a `matrix_cl` by doing + * + *```cpp + * Eigen::MatrixXd A_eig = Eigen::MatrixXd::Random(10, 10); + * matrix_cl A(A_eig); + * matrix_cl B = to_matrix_cl(A_eig); + * matrix_cl C = cholesky_decompose(A * B); + * // Read back to eigen matrix. + * Eigen::MatrixXd C_eig = from_matrix_cl(C); + * + * // Also for vectors and raw pointers of pointers + * std::vector A_vec(10, 0); + * matrix_cl B_var(A_vec, 10, 1); + * + * vari** A_vari= // fill + * matrix_cl B_vari(A_vari, 10, 1); + * + *``` + * + * Execution is performed in async and Kernel operations are compounded and + * compiled Just In Time. This allows for a low amount of overhead when passing + * data to and from the device and executing computations. + * + * For more details see the paper on Arvix. + * https://arxiv.org/pdf/1907.01063.pdf + */ + +/** + * \ingroup opencl + * \defgroup error_checks_opencl Error Checks + */ + +/** + * \ingroup opencl + * \defgroup kernel_executor_opencl Kernel Executor + * The kernel executor allows OpenCL kernels to be executed in async. GPUs + * have the capability to perform reads, writes, and computation at the same + * time. In order to maximize the throughput to the device the Kernel + * Executor assigns matrices read and write events. Write events are blocking + * in that no further operations can be completed until the write event + * is finished. However, read events can happen in async together. + * Take the following for example + * + *```cpp + * matrix_cl A = from_eigen_cl(A_eig); + * matrix_cl B = from_eigen_cl(B_eig); + * matrix_cl C = A * B; + * matrix_cl D = A + B; + * matrix_cl E = C + D; + *``` + * In the above, When `A` and `B` are created from the Eigen matrices `A_eig` + *and `B_eig`. they are both assigned write events to their write event stack. + * `C` and `D` depend on `A` and `B` while `E` depends on + * `C` and `D`. When executing `C`'s operation, `A` and `B` are assigned + * events to their read event stack while `C` is assigned an event to it's write + *event stack. Once `A` and `B` have finished their write event the kernel to + *compute `C` can begin. The excution to create `D` also waits for the write + *events of `A` and `B`, but does not have to wait for the execution of `C` to + *finish. Executing `E` requires waiting for for the write events of both `C` + *and `D`. + * + */ + +/** + * \ingroup opencl + * \defgroup opencl_kernels Custom OpenCL kernels + */ + +/** + * \ingroup opencl + * \defgroup prim_fun_opencl OpenCL overloads of stan/math/prim functions + */ +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include + +#endif +#endif diff --git a/stan/math/opencl/rev/lb_constrain.hpp b/stan/math/opencl/rev/constraint/lb_constrain.hpp similarity index 96% rename from stan/math/opencl/rev/lb_constrain.hpp rename to stan/math/opencl/rev/constraint/lb_constrain.hpp index e796073586c..012d81a8bde 100644 --- a/stan/math/opencl/rev/lb_constrain.hpp +++ b/stan/math/opencl/rev/constraint/lb_constrain.hpp @@ -1,5 +1,5 @@ -#ifndef STAN_MATH_OPENCL_REV_LB_CONSTRAIN_HPP -#define STAN_MATH_OPENCL_REV_LB_CONSTRAIN_HPP +#ifndef STAN_MATH_OPENCL_REV_CONSTRAINT_LB_CONSTRAIN_HPP +#define STAN_MATH_OPENCL_REV_CONSTRAINT_LB_CONSTRAIN_HPP #ifdef STAN_OPENCL #include diff --git a/stan/math/opencl/rev/lub_constrain.hpp b/stan/math/opencl/rev/constraint/lub_constrain.hpp similarity index 97% rename from stan/math/opencl/rev/lub_constrain.hpp rename to stan/math/opencl/rev/constraint/lub_constrain.hpp index 21ded0b24e2..9fae858693d 100644 --- a/stan/math/opencl/rev/lub_constrain.hpp +++ b/stan/math/opencl/rev/constraint/lub_constrain.hpp @@ -1,5 +1,5 @@ -#ifndef STAN_MATH_OPENCL_REV_LUB_CONSTRAIN_HPP -#define STAN_MATH_OPENCL_REV_LUB_CONSTRAIN_HPP +#ifndef STAN_MATH_OPENCL_REV_CONSTRAINT_LUB_CONSTRAIN_HPP +#define STAN_MATH_OPENCL_REV_CONSTRAINT_LUB_CONSTRAIN_HPP #ifdef STAN_OPENCL #include diff --git a/stan/math/opencl/rev/offset_multiplier_constrain.hpp b/stan/math/opencl/rev/constraint/offset_multiplier_constrain.hpp similarity index 96% rename from stan/math/opencl/rev/offset_multiplier_constrain.hpp rename to stan/math/opencl/rev/constraint/offset_multiplier_constrain.hpp index ca6f6fe3ecc..c75eecc0571 100644 --- a/stan/math/opencl/rev/offset_multiplier_constrain.hpp +++ b/stan/math/opencl/rev/constraint/offset_multiplier_constrain.hpp @@ -1,5 +1,5 @@ -#ifndef STAN_MATH_OPENCL_REV_OFFSET_MULTIPLIER_CONSTRAIN_HPP -#define STAN_MATH_OPENCL_REV_OFFSET_MULTIPLIER_CONSTRAIN_HPP +#ifndef STAN_MATH_OPENCL_REV_CONSTRAINT_OFFSET_MULTIPLIER_CONSTRAIN_HPP +#define STAN_MATH_OPENCL_REV_CONSTRAINT_OFFSET_MULTIPLIER_CONSTRAIN_HPP #ifdef STAN_OPENCL #include diff --git a/stan/math/opencl/rev/ub_constrain.hpp b/stan/math/opencl/rev/constraint/ub_constrain.hpp similarity index 96% rename from stan/math/opencl/rev/ub_constrain.hpp rename to stan/math/opencl/rev/constraint/ub_constrain.hpp index ef87c2ba07e..c8748447593 100644 --- a/stan/math/opencl/rev/ub_constrain.hpp +++ b/stan/math/opencl/rev/constraint/ub_constrain.hpp @@ -1,5 +1,5 @@ -#ifndef STAN_MATH_OPENCL_REV_UB_CONSTRAIN_HPP -#define STAN_MATH_OPENCL_REV_UB_CONSTRAIN_HPP +#ifndef STAN_MATH_OPENCL_REV_CONSTRAINT_UB_CONSTRAIN_HPP +#define STAN_MATH_OPENCL_REV_CONSTRAINT_UB_CONSTRAIN_HPP #ifdef STAN_OPENCL #include diff --git a/stan/math/opencl/rev/unit_vector_constrain.hpp b/stan/math/opencl/rev/constraint/unit_vector_constrain.hpp similarity index 93% rename from stan/math/opencl/rev/unit_vector_constrain.hpp rename to stan/math/opencl/rev/constraint/unit_vector_constrain.hpp index e2fa6a63462..968005880fa 100644 --- a/stan/math/opencl/rev/unit_vector_constrain.hpp +++ b/stan/math/opencl/rev/constraint/unit_vector_constrain.hpp @@ -1,5 +1,5 @@ -#ifndef STAN_MATH_OPENCL_REV_UNIT_VECTOR_CONSTRAIN_HPP -#define STAN_MATH_OPENCL_REV_UNIT_VECTOR_CONSTRAIN_HPP +#ifndef STAN_MATH_OPENCL_REV_CONSTRAINT_UNIT_VECTOR_CONSTRAIN_HPP +#define STAN_MATH_OPENCL_REV_CONSTRAINT_UNIT_VECTOR_CONSTRAIN_HPP #ifdef STAN_OPENCL #include diff --git a/stan/math/opencl/rev_constraint.cpp b/stan/math/opencl/rev_constraint.cpp new file mode 100644 index 00000000000..20a9660322c --- /dev/null +++ b/stan/math/opencl/rev_constraint.cpp @@ -0,0 +1,111 @@ +#ifndef STAN_MATH_OPENCL_PRIM_CONSTRAINT_HPP +#define STAN_MATH_OPENCL_PRIM_CONSTRAINT_HPP +#ifdef STAN_OPENCL + +/** + * \defgroup opencl OpenCL + * Stan's OpenCL backend allows for computation to be executed in parallel + * on a GPU or in multithreaded CPUs. It is meant to easily conform with Eigen + * such that you can create and read from a `matrix_cl` by doing + * + *```cpp + * Eigen::MatrixXd A_eig = Eigen::MatrixXd::Random(10, 10); + * matrix_cl A(A_eig); + * matrix_cl B = to_matrix_cl(A_eig); + * matrix_cl C = cholesky_decompose(A * B); + * // Read back to eigen matrix. + * Eigen::MatrixXd C_eig = from_matrix_cl(C); + * + * // Also for vectors and raw pointers of pointers + * std::vector A_vec(10, 0); + * matrix_cl B_var(A_vec, 10, 1); + * + * vari** A_vari= // fill + * matrix_cl B_vari(A_vari, 10, 1); + * + *``` + * + * Execution is performed in async and Kernel operations are compounded and + * compiled Just In Time. This allows for a low amount of overhead when passing + * data to and from the device and executing computations. + * + * For more details see the paper on Arvix. + * https://arxiv.org/pdf/1907.01063.pdf + */ + +/** + * \ingroup opencl + * \defgroup error_checks_opencl Error Checks + */ + +/** + * \ingroup opencl + * \defgroup kernel_executor_opencl Kernel Executor + * The kernel executor allows OpenCL kernels to be executed in async. GPUs + * have the capability to perform reads, writes, and computation at the same + * time. In order to maximize the throughput to the device the Kernel + * Executor assigns matrices read and write events. Write events are blocking + * in that no further operations can be completed until the write event + * is finished. However, read events can happen in async together. + * Take the following for example + * + *```cpp + * matrix_cl A = from_eigen_cl(A_eig); + * matrix_cl B = from_eigen_cl(B_eig); + * matrix_cl C = A * B; + * matrix_cl D = A + B; + * matrix_cl E = C + D; + *``` + * In the above, When `A` and `B` are created from the Eigen matrices `A_eig` + *and `B_eig`. they are both assigned write events to their write event stack. + * `C` and `D` depend on `A` and `B` while `E` depends on + * `C` and `D`. When executing `C`'s operation, `A` and `B` are assigned + * events to their read event stack while `C` is assigned an event to it's write + *event stack. Once `A` and `B` have finished their write event the kernel to + *compute `C` can begin. The excution to create `D` also waits for the write + *events of `A` and `B`, but does not have to wait for the execution of `C` to + *finish. Executing `E` requires waiting for for the write events of both `C` + *and `D`. + * + */ + +/** + * \ingroup opencl + * \defgroup opencl_kernels Custom OpenCL kernels + */ + +/** + * \ingroup opencl + * \defgroup prim_fun_opencl OpenCL overloads of stan/math/prim functions + */ +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include + +#endif +#endif diff --git a/stan/math/prim.hpp b/stan/math/prim.hpp index 30b66815356..208818ae116 100644 --- a/stan/math/prim.hpp +++ b/stan/math/prim.hpp @@ -5,8 +5,10 @@ #ifdef STAN_OPENCL #include +#include #endif +#include #include #include #include diff --git a/stan/math/prim/constraint.hpp b/stan/math/prim/constraint.hpp new file mode 100644 index 00000000000..9a252202811 --- /dev/null +++ b/stan/math/prim/constraint.hpp @@ -0,0 +1,42 @@ +#ifndef STAN_MATH_PRIM_CONSTRAINT_HPP +#define STAN_MATH_PRIM_CONSTRAINT_HPP +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#endif \ No newline at end of file diff --git a/stan/math/prim/fun/cholesky_corr_constrain.hpp b/stan/math/prim/constraint/cholesky_corr_constrain.hpp similarity index 96% rename from stan/math/prim/fun/cholesky_corr_constrain.hpp rename to stan/math/prim/constraint/cholesky_corr_constrain.hpp index c949b85554d..b7909de4d0f 100644 --- a/stan/math/prim/fun/cholesky_corr_constrain.hpp +++ b/stan/math/prim/constraint/cholesky_corr_constrain.hpp @@ -1,12 +1,12 @@ -#ifndef STAN_MATH_PRIM_FUN_CHOLESKY_CORR_CONSTRAIN_HPP -#define STAN_MATH_PRIM_FUN_CHOLESKY_CORR_CONSTRAIN_HPP +#ifndef STAN_MATH_PRIM_CONSTRAINT_CHOLESKY_CORR_CONSTRAIN_HPP +#define STAN_MATH_PRIM_CONSTRAINT_CHOLESKY_CORR_CONSTRAIN_HPP #include #include #include #include #include -#include +#include #include namespace stan { diff --git a/stan/math/prim/fun/cholesky_corr_free.hpp b/stan/math/prim/constraint/cholesky_corr_free.hpp similarity index 89% rename from stan/math/prim/fun/cholesky_corr_free.hpp rename to stan/math/prim/constraint/cholesky_corr_free.hpp index f5746eaceeb..4245e495bdc 100644 --- a/stan/math/prim/fun/cholesky_corr_free.hpp +++ b/stan/math/prim/constraint/cholesky_corr_free.hpp @@ -1,9 +1,9 @@ -#ifndef STAN_MATH_PRIM_FUN_CHOLESKY_CORR_FREE_HPP -#define STAN_MATH_PRIM_FUN_CHOLESKY_CORR_FREE_HPP +#ifndef STAN_MATH_PRIM_CONSTRAINT_CHOLESKY_CORR_FREE_HPP +#define STAN_MATH_PRIM_CONSTRAINT_CHOLESKY_CORR_FREE_HPP #include #include -#include +#include #include #include diff --git a/stan/math/prim/fun/cholesky_factor_constrain.hpp b/stan/math/prim/constraint/cholesky_factor_constrain.hpp similarity index 97% rename from stan/math/prim/fun/cholesky_factor_constrain.hpp rename to stan/math/prim/constraint/cholesky_factor_constrain.hpp index ef8addb9ae1..31ef9731079 100644 --- a/stan/math/prim/fun/cholesky_factor_constrain.hpp +++ b/stan/math/prim/constraint/cholesky_factor_constrain.hpp @@ -1,5 +1,5 @@ -#ifndef STAN_MATH_PRIM_FUN_CHOLESKY_FACTOR_CONSTRAIN_HPP -#define STAN_MATH_PRIM_FUN_CHOLESKY_FACTOR_CONSTRAIN_HPP +#ifndef STAN_MATH_PRIM_CONSTRAINT_CHOLESKY_FACTOR_CONSTRAIN_HPP +#define STAN_MATH_PRIM_CONSTRAINT_CHOLESKY_FACTOR_CONSTRAIN_HPP #include #include diff --git a/stan/math/prim/fun/cholesky_factor_free.hpp b/stan/math/prim/constraint/cholesky_factor_free.hpp similarity index 94% rename from stan/math/prim/fun/cholesky_factor_free.hpp rename to stan/math/prim/constraint/cholesky_factor_free.hpp index 0cc4185a3fc..9077f7b8829 100644 --- a/stan/math/prim/fun/cholesky_factor_free.hpp +++ b/stan/math/prim/constraint/cholesky_factor_free.hpp @@ -1,5 +1,5 @@ -#ifndef STAN_MATH_PRIM_FUN_CHOLESKY_FACTOR_FREE_HPP -#define STAN_MATH_PRIM_FUN_CHOLESKY_FACTOR_FREE_HPP +#ifndef STAN_MATH_PRIM_CONSTRAINT_CHOLESKY_FACTOR_FREE_HPP +#define STAN_MATH_PRIM_CONSTRAINT_CHOLESKY_FACTOR_FREE_HPP #include #include diff --git a/stan/math/prim/fun/corr_constrain.hpp b/stan/math/prim/constraint/corr_constrain.hpp similarity index 95% rename from stan/math/prim/fun/corr_constrain.hpp rename to stan/math/prim/constraint/corr_constrain.hpp index 277846b6ffc..fcbad5125ce 100644 --- a/stan/math/prim/fun/corr_constrain.hpp +++ b/stan/math/prim/constraint/corr_constrain.hpp @@ -1,5 +1,5 @@ -#ifndef STAN_MATH_PRIM_FUN_CORR_CONSTRAIN_HPP -#define STAN_MATH_PRIM_FUN_CORR_CONSTRAIN_HPP +#ifndef STAN_MATH_PRIM_CONSTRAINT_CORR_CONSTRAIN_HPP +#define STAN_MATH_PRIM_CONSTRAINT_CORR_CONSTRAIN_HPP #include #include diff --git a/stan/math/prim/fun/corr_free.hpp b/stan/math/prim/constraint/corr_free.hpp similarity index 89% rename from stan/math/prim/fun/corr_free.hpp rename to stan/math/prim/constraint/corr_free.hpp index a5b4065d0e3..b76d7f96a2b 100644 --- a/stan/math/prim/fun/corr_free.hpp +++ b/stan/math/prim/constraint/corr_free.hpp @@ -1,5 +1,5 @@ -#ifndef STAN_MATH_PRIM_FUN_CORR_FREE_HPP -#define STAN_MATH_PRIM_FUN_CORR_FREE_HPP +#ifndef STAN_MATH_PRIM_CONSTRAINT_CORR_FREE_HPP +#define STAN_MATH_PRIM_CONSTRAINT_CORR_FREE_HPP #include #include diff --git a/stan/math/prim/fun/corr_matrix_constrain.hpp b/stan/math/prim/constraint/corr_matrix_constrain.hpp similarity index 97% rename from stan/math/prim/fun/corr_matrix_constrain.hpp rename to stan/math/prim/constraint/corr_matrix_constrain.hpp index cbe8fc6cc25..b556adcb988 100644 --- a/stan/math/prim/fun/corr_matrix_constrain.hpp +++ b/stan/math/prim/constraint/corr_matrix_constrain.hpp @@ -1,10 +1,10 @@ -#ifndef STAN_MATH_PRIM_FUN_CORR_MATRIX_CONSTRAIN_HPP -#define STAN_MATH_PRIM_FUN_CORR_MATRIX_CONSTRAIN_HPP +#ifndef STAN_MATH_PRIM_CONSTRAINT_CORR_MATRIX_CONSTRAIN_HPP +#define STAN_MATH_PRIM_CONSTRAINT_CORR_MATRIX_CONSTRAIN_HPP #include #include #include -#include +#include #include #include diff --git a/stan/math/prim/fun/corr_matrix_free.hpp b/stan/math/prim/constraint/corr_matrix_free.hpp similarity index 95% rename from stan/math/prim/fun/corr_matrix_free.hpp rename to stan/math/prim/constraint/corr_matrix_free.hpp index 3a0242ab257..81c0630dd50 100644 --- a/stan/math/prim/fun/corr_matrix_free.hpp +++ b/stan/math/prim/constraint/corr_matrix_free.hpp @@ -1,5 +1,5 @@ -#ifndef STAN_MATH_PRIM_FUN_CORR_MATRIX_FREE_HPP -#define STAN_MATH_PRIM_FUN_CORR_MATRIX_FREE_HPP +#ifndef STAN_MATH_PRIM_CONSTRAINT_CORR_MATRIX_FREE_HPP +#define STAN_MATH_PRIM_CONSTRAINT_CORR_MATRIX_FREE_HPP #include #include diff --git a/stan/math/prim/fun/cov_matrix_constrain.hpp b/stan/math/prim/constraint/cov_matrix_constrain.hpp similarity index 98% rename from stan/math/prim/fun/cov_matrix_constrain.hpp rename to stan/math/prim/constraint/cov_matrix_constrain.hpp index 6b761b10000..46083c3aeb2 100644 --- a/stan/math/prim/fun/cov_matrix_constrain.hpp +++ b/stan/math/prim/constraint/cov_matrix_constrain.hpp @@ -1,5 +1,5 @@ -#ifndef STAN_MATH_PRIM_FUN_COV_MATRIX_CONSTRAIN_HPP -#define STAN_MATH_PRIM_FUN_COV_MATRIX_CONSTRAIN_HPP +#ifndef STAN_MATH_PRIM_CONSTRAINT_COV_MATRIX_CONSTRAIN_HPP +#define STAN_MATH_PRIM_CONSTRAINT_COV_MATRIX_CONSTRAIN_HPP #include #include diff --git a/stan/math/prim/fun/cov_matrix_constrain_lkj.hpp b/stan/math/prim/constraint/cov_matrix_constrain_lkj.hpp similarity index 95% rename from stan/math/prim/fun/cov_matrix_constrain_lkj.hpp rename to stan/math/prim/constraint/cov_matrix_constrain_lkj.hpp index a74bbc0844d..c5605cdd43d 100644 --- a/stan/math/prim/fun/cov_matrix_constrain_lkj.hpp +++ b/stan/math/prim/constraint/cov_matrix_constrain_lkj.hpp @@ -1,9 +1,9 @@ -#ifndef STAN_MATH_PRIM_FUN_COV_MATRIX_CONSTRAIN_LKJ_HPP -#define STAN_MATH_PRIM_FUN_COV_MATRIX_CONSTRAIN_LKJ_HPP +#ifndef STAN_MATH_PRIM_CONSTRAINT_COV_MATRIX_CONSTRAIN_LKJ_HPP +#define STAN_MATH_PRIM_CONSTRAINT_COV_MATRIX_CONSTRAIN_LKJ_HPP #include -#include -#include +#include +#include #include #include diff --git a/stan/math/prim/fun/cov_matrix_free.hpp b/stan/math/prim/constraint/cov_matrix_free.hpp similarity index 95% rename from stan/math/prim/fun/cov_matrix_free.hpp rename to stan/math/prim/constraint/cov_matrix_free.hpp index a507655bf28..1a5ad30c4e5 100644 --- a/stan/math/prim/fun/cov_matrix_free.hpp +++ b/stan/math/prim/constraint/cov_matrix_free.hpp @@ -1,5 +1,5 @@ -#ifndef STAN_MATH_PRIM_FUN_COV_MATRIX_FREE_HPP -#define STAN_MATH_PRIM_FUN_COV_MATRIX_FREE_HPP +#ifndef STAN_MATH_PRIM_CONSTRAINT_COV_MATRIX_FREE_HPP +#define STAN_MATH_PRIM_CONSTRAINT_COV_MATRIX_FREE_HPP #include #include diff --git a/stan/math/prim/fun/cov_matrix_free_lkj.hpp b/stan/math/prim/constraint/cov_matrix_free_lkj.hpp similarity index 95% rename from stan/math/prim/fun/cov_matrix_free_lkj.hpp rename to stan/math/prim/constraint/cov_matrix_free_lkj.hpp index 81c16068813..b0d6c94f7a8 100644 --- a/stan/math/prim/fun/cov_matrix_free_lkj.hpp +++ b/stan/math/prim/constraint/cov_matrix_free_lkj.hpp @@ -1,5 +1,5 @@ -#ifndef STAN_MATH_PRIM_FUN_COV_MATRIX_FREE_LKJ_HPP -#define STAN_MATH_PRIM_FUN_COV_MATRIX_FREE_LKJ_HPP +#ifndef STAN_MATH_PRIM_CONSTRAINT_COV_MATRIX_FREE_LKJ_HPP +#define STAN_MATH_PRIM_CONSTRAINT_COV_MATRIX_FREE_LKJ_HPP #include #include diff --git a/stan/math/prim/fun/identity_constrain.hpp b/stan/math/prim/constraint/identity_constrain.hpp similarity index 87% rename from stan/math/prim/fun/identity_constrain.hpp rename to stan/math/prim/constraint/identity_constrain.hpp index 86b1e294388..00590438700 100644 --- a/stan/math/prim/fun/identity_constrain.hpp +++ b/stan/math/prim/constraint/identity_constrain.hpp @@ -1,5 +1,5 @@ -#ifndef STAN_MATH_PRIM_FUN_IDENTITY_CONSTRAIN_HPP -#define STAN_MATH_PRIM_FUN_IDENTITY_CONSTRAIN_HPP +#ifndef STAN_MATH_PRIM_CONSTRAINT_IDENTITY_CONSTRAIN_HPP +#define STAN_MATH_PRIM_CONSTRAINT_IDENTITY_CONSTRAIN_HPP #include diff --git a/stan/math/prim/fun/identity_free.hpp b/stan/math/prim/constraint/identity_free.hpp similarity index 86% rename from stan/math/prim/fun/identity_free.hpp rename to stan/math/prim/constraint/identity_free.hpp index 0652ac11e24..ef5925c2355 100644 --- a/stan/math/prim/fun/identity_free.hpp +++ b/stan/math/prim/constraint/identity_free.hpp @@ -1,5 +1,5 @@ -#ifndef STAN_MATH_PRIM_FUN_IDENTITY_FREE_HPP -#define STAN_MATH_PRIM_FUN_IDENTITY_FREE_HPP +#ifndef STAN_MATH_PRIM_CONSTRAINT_IDENTITY_FREE_HPP +#define STAN_MATH_PRIM_CONSTRAINT_IDENTITY_FREE_HPP #include diff --git a/stan/math/prim/fun/lb_constrain.hpp b/stan/math/prim/constraint/lb_constrain.hpp similarity index 97% rename from stan/math/prim/fun/lb_constrain.hpp rename to stan/math/prim/constraint/lb_constrain.hpp index f31da80cfbf..3df5ce62107 100644 --- a/stan/math/prim/fun/lb_constrain.hpp +++ b/stan/math/prim/constraint/lb_constrain.hpp @@ -1,11 +1,11 @@ -#ifndef STAN_MATH_PRIM_FUN_LB_CONSTRAIN_HPP -#define STAN_MATH_PRIM_FUN_LB_CONSTRAIN_HPP +#ifndef STAN_MATH_PRIM_CONSTRAINT_LB_CONSTRAIN_HPP +#define STAN_MATH_PRIM_CONSTRAINT_LB_CONSTRAIN_HPP #include #include #include -#include -#include +#include +#include #include #include #include diff --git a/stan/math/prim/fun/lb_free.hpp b/stan/math/prim/constraint/lb_free.hpp similarity index 96% rename from stan/math/prim/fun/lb_free.hpp rename to stan/math/prim/constraint/lb_free.hpp index 9e1ee605ebf..f5e80d700e6 100644 --- a/stan/math/prim/fun/lb_free.hpp +++ b/stan/math/prim/constraint/lb_free.hpp @@ -1,10 +1,10 @@ -#ifndef STAN_MATH_PRIM_FUN_LB_FREE_HPP -#define STAN_MATH_PRIM_FUN_LB_FREE_HPP +#ifndef STAN_MATH_PRIM_CONSTRAINT_LB_FREE_HPP +#define STAN_MATH_PRIM_CONSTRAINT_LB_FREE_HPP #include #include #include -#include +#include #include #include #include diff --git a/stan/math/prim/fun/lub_constrain.hpp b/stan/math/prim/constraint/lub_constrain.hpp similarity index 98% rename from stan/math/prim/fun/lub_constrain.hpp rename to stan/math/prim/constraint/lub_constrain.hpp index a3e91883f51..ea186fa240f 100644 --- a/stan/math/prim/fun/lub_constrain.hpp +++ b/stan/math/prim/constraint/lub_constrain.hpp @@ -1,21 +1,21 @@ -#ifndef STAN_MATH_PRIM_FUN_LUB_CONSTRAIN_HPP -#define STAN_MATH_PRIM_FUN_LUB_CONSTRAIN_HPP +#ifndef STAN_MATH_PRIM_CONSTRAINT_LUB_CONSTRAIN_HPP +#define STAN_MATH_PRIM_CONSTRAINT_LUB_CONSTRAIN_HPP +#include +#include +#include #include #include #include #include #include #include -#include #include #include #include -#include #include #include #include -#include #include namespace stan { diff --git a/stan/math/prim/fun/lub_free.hpp b/stan/math/prim/constraint/lub_free.hpp similarity index 96% rename from stan/math/prim/fun/lub_free.hpp rename to stan/math/prim/constraint/lub_free.hpp index c4876cbcd6d..23afee1c60d 100644 --- a/stan/math/prim/fun/lub_free.hpp +++ b/stan/math/prim/constraint/lub_free.hpp @@ -1,13 +1,13 @@ -#ifndef STAN_MATH_PRIM_FUN_LUB_FREE_HPP -#define STAN_MATH_PRIM_FUN_LUB_FREE_HPP +#ifndef STAN_MATH_PRIM_CONSTRAINT_LUB_FREE_HPP +#define STAN_MATH_PRIM_CONSTRAINT_LUB_FREE_HPP #include #include #include #include #include -#include -#include +#include +#include #include namespace stan { diff --git a/stan/math/prim/fun/offset_multiplier_constrain.hpp b/stan/math/prim/constraint/offset_multiplier_constrain.hpp similarity index 98% rename from stan/math/prim/fun/offset_multiplier_constrain.hpp rename to stan/math/prim/constraint/offset_multiplier_constrain.hpp index 85a58ce4771..a226ae2e15f 100644 --- a/stan/math/prim/fun/offset_multiplier_constrain.hpp +++ b/stan/math/prim/constraint/offset_multiplier_constrain.hpp @@ -1,10 +1,10 @@ -#ifndef STAN_MATH_PRIM_FUN_OFFSET_MULTIPLIER_CONSTRAIN_HPP -#define STAN_MATH_PRIM_FUN_OFFSET_MULTIPLIER_CONSTRAIN_HPP +#ifndef STAN_MATH_PRIM_CONSTRAINT_OFFSET_MULTIPLIER_CONSTRAIN_HPP +#define STAN_MATH_PRIM_CONSTRAINT_OFFSET_MULTIPLIER_CONSTRAIN_HPP #include #include #include -#include +#include #include #include #include diff --git a/stan/math/prim/fun/offset_multiplier_free.hpp b/stan/math/prim/constraint/offset_multiplier_free.hpp similarity index 96% rename from stan/math/prim/fun/offset_multiplier_free.hpp rename to stan/math/prim/constraint/offset_multiplier_free.hpp index e0fe927330e..becf0e0d6b5 100644 --- a/stan/math/prim/fun/offset_multiplier_free.hpp +++ b/stan/math/prim/constraint/offset_multiplier_free.hpp @@ -1,9 +1,9 @@ -#ifndef STAN_MATH_PRIM_FUN_OFFSET_MULTIPLIER_FREE_HPP -#define STAN_MATH_PRIM_FUN_OFFSET_MULTIPLIER_FREE_HPP +#ifndef STAN_MATH_PRIM_CONSTRAINT_OFFSET_MULTIPLIER_FREE_HPP +#define STAN_MATH_PRIM_CONSTRAINT_OFFSET_MULTIPLIER_FREE_HPP #include #include -#include +#include #include #include #include diff --git a/stan/math/prim/fun/ordered_constrain.hpp b/stan/math/prim/constraint/ordered_constrain.hpp similarity index 97% rename from stan/math/prim/fun/ordered_constrain.hpp rename to stan/math/prim/constraint/ordered_constrain.hpp index ac0c18ca74d..91a75c2f1fd 100644 --- a/stan/math/prim/fun/ordered_constrain.hpp +++ b/stan/math/prim/constraint/ordered_constrain.hpp @@ -1,5 +1,5 @@ -#ifndef STAN_MATH_PRIM_FUN_ORDERED_CONSTRAIN_HPP -#define STAN_MATH_PRIM_FUN_ORDERED_CONSTRAIN_HPP +#ifndef STAN_MATH_PRIM_CONSTRAINT_ORDERED_CONSTRAIN_HPP +#define STAN_MATH_PRIM_CONSTRAINT_ORDERED_CONSTRAIN_HPP #include #include diff --git a/stan/math/prim/fun/ordered_free.hpp b/stan/math/prim/constraint/ordered_free.hpp similarity index 94% rename from stan/math/prim/fun/ordered_free.hpp rename to stan/math/prim/constraint/ordered_free.hpp index 4764bceb6a8..b8fbc46624c 100644 --- a/stan/math/prim/fun/ordered_free.hpp +++ b/stan/math/prim/constraint/ordered_free.hpp @@ -1,5 +1,5 @@ -#ifndef STAN_MATH_PRIM_FUN_ORDERED_FREE_HPP -#define STAN_MATH_PRIM_FUN_ORDERED_FREE_HPP +#ifndef STAN_MATH_PRIM_CONSTRAINT_ORDERED_FREE_HPP +#define STAN_MATH_PRIM_CONSTRAINT_ORDERED_FREE_HPP #include #include diff --git a/stan/math/prim/fun/positive_constrain.hpp b/stan/math/prim/constraint/positive_constrain.hpp similarity index 96% rename from stan/math/prim/fun/positive_constrain.hpp rename to stan/math/prim/constraint/positive_constrain.hpp index b6d46129c42..dc52cfb57f0 100644 --- a/stan/math/prim/fun/positive_constrain.hpp +++ b/stan/math/prim/constraint/positive_constrain.hpp @@ -1,5 +1,5 @@ -#ifndef STAN_MATH_PRIM_FUN_POSITIVE_CONSTRAIN_HPP -#define STAN_MATH_PRIM_FUN_POSITIVE_CONSTRAIN_HPP +#ifndef STAN_MATH_PRIM_CONSTRAINT_POSITIVE_CONSTRAIN_HPP +#define STAN_MATH_PRIM_CONSTRAINT_POSITIVE_CONSTRAIN_HPP #include #include diff --git a/stan/math/prim/fun/positive_free.hpp b/stan/math/prim/constraint/positive_free.hpp similarity index 89% rename from stan/math/prim/fun/positive_free.hpp rename to stan/math/prim/constraint/positive_free.hpp index af18b5e0119..4317fdfa70c 100644 --- a/stan/math/prim/fun/positive_free.hpp +++ b/stan/math/prim/constraint/positive_free.hpp @@ -1,5 +1,5 @@ -#ifndef STAN_MATH_PRIM_FUN_POSITIVE_FREE_HPP -#define STAN_MATH_PRIM_FUN_POSITIVE_FREE_HPP +#ifndef STAN_MATH_PRIM_CONSTRAINT_POSITIVE_FREE_HPP +#define STAN_MATH_PRIM_CONSTRAINT_POSITIVE_FREE_HPP #include #include diff --git a/stan/math/prim/fun/positive_ordered_constrain.hpp b/stan/math/prim/constraint/positive_ordered_constrain.hpp similarity index 96% rename from stan/math/prim/fun/positive_ordered_constrain.hpp rename to stan/math/prim/constraint/positive_ordered_constrain.hpp index f3f0adf1fcf..30ab958209f 100644 --- a/stan/math/prim/fun/positive_ordered_constrain.hpp +++ b/stan/math/prim/constraint/positive_ordered_constrain.hpp @@ -1,5 +1,5 @@ -#ifndef STAN_MATH_PRIM_FUN_POSITIVE_ORDERED_CONSTRAIN_HPP -#define STAN_MATH_PRIM_FUN_POSITIVE_ORDERED_CONSTRAIN_HPP +#ifndef STAN_MATH_PRIM_CONSTRAINT_POSITIVE_ORDERED_CONSTRAIN_HPP +#define STAN_MATH_PRIM_CONSTRAINT_POSITIVE_ORDERED_CONSTRAIN_HPP #include #include diff --git a/stan/math/prim/fun/positive_ordered_free.hpp b/stan/math/prim/constraint/positive_ordered_free.hpp similarity index 93% rename from stan/math/prim/fun/positive_ordered_free.hpp rename to stan/math/prim/constraint/positive_ordered_free.hpp index c627f03ec5c..408b0922650 100644 --- a/stan/math/prim/fun/positive_ordered_free.hpp +++ b/stan/math/prim/constraint/positive_ordered_free.hpp @@ -1,5 +1,5 @@ -#ifndef STAN_MATH_PRIM_FUN_POSITIVE_ORDERED_FREE_HPP -#define STAN_MATH_PRIM_FUN_POSITIVE_ORDERED_FREE_HPP +#ifndef STAN_MATH_PRIM_CONSTRAINT_POSITIVE_ORDERED_FREE_HPP +#define STAN_MATH_PRIM_CONSTRAINT_POSITIVE_ORDERED_FREE_HPP #include #include diff --git a/stan/math/prim/fun/prob_constrain.hpp b/stan/math/prim/constraint/prob_constrain.hpp similarity index 95% rename from stan/math/prim/fun/prob_constrain.hpp rename to stan/math/prim/constraint/prob_constrain.hpp index 0ed4ee605aa..d05193c8648 100644 --- a/stan/math/prim/fun/prob_constrain.hpp +++ b/stan/math/prim/constraint/prob_constrain.hpp @@ -1,5 +1,5 @@ -#ifndef STAN_MATH_PRIM_FUN_PROB_CONSTRAIN_HPP -#define STAN_MATH_PRIM_FUN_PROB_CONSTRAIN_HPP +#ifndef STAN_MATH_PRIM_CONSTRAINT_PROB_CONSTRAIN_HPP +#define STAN_MATH_PRIM_CONSTRAINT_PROB_CONSTRAIN_HPP #include #include diff --git a/stan/math/prim/fun/prob_free.hpp b/stan/math/prim/constraint/prob_free.hpp similarity index 89% rename from stan/math/prim/fun/prob_free.hpp rename to stan/math/prim/constraint/prob_free.hpp index debefb5efb5..0f980ab87cd 100644 --- a/stan/math/prim/fun/prob_free.hpp +++ b/stan/math/prim/constraint/prob_free.hpp @@ -1,5 +1,5 @@ -#ifndef STAN_MATH_PRIM_FUN_PROB_FREE_HPP -#define STAN_MATH_PRIM_FUN_PROB_FREE_HPP +#ifndef STAN_MATH_PRIM_CONSTRAINT_PROB_FREE_HPP +#define STAN_MATH_PRIM_CONSTRAINT_PROB_FREE_HPP #include #include diff --git a/stan/math/prim/fun/simplex_constrain.hpp b/stan/math/prim/constraint/simplex_constrain.hpp similarity index 97% rename from stan/math/prim/fun/simplex_constrain.hpp rename to stan/math/prim/constraint/simplex_constrain.hpp index cd10e93d587..b92c65779ee 100644 --- a/stan/math/prim/fun/simplex_constrain.hpp +++ b/stan/math/prim/constraint/simplex_constrain.hpp @@ -1,5 +1,5 @@ -#ifndef STAN_MATH_PRIM_FUN_SIMPLEX_CONSTRAIN_HPP -#define STAN_MATH_PRIM_FUN_SIMPLEX_CONSTRAIN_HPP +#ifndef STAN_MATH_PRIM_CONSTRAINT_SIMPLEX_CONSTRAIN_HPP +#define STAN_MATH_PRIM_CONSTRAINT_SIMPLEX_CONSTRAIN_HPP #include #include diff --git a/stan/math/prim/fun/simplex_free.hpp b/stan/math/prim/constraint/simplex_free.hpp similarity index 95% rename from stan/math/prim/fun/simplex_free.hpp rename to stan/math/prim/constraint/simplex_free.hpp index 39487a0cae0..f3bb6195b7c 100644 --- a/stan/math/prim/fun/simplex_free.hpp +++ b/stan/math/prim/constraint/simplex_free.hpp @@ -1,5 +1,5 @@ -#ifndef STAN_MATH_PRIM_FUN_SIMPLEX_FREE_HPP -#define STAN_MATH_PRIM_FUN_SIMPLEX_FREE_HPP +#ifndef STAN_MATH_PRIM_CONSTRAINT_SIMPLEX_FREE_HPP +#define STAN_MATH_PRIM_CONSTRAINT_SIMPLEX_FREE_HPP #include #include diff --git a/stan/math/prim/fun/stochastic_column_constrain.hpp b/stan/math/prim/constraint/stochastic_column_constrain.hpp similarity index 95% rename from stan/math/prim/fun/stochastic_column_constrain.hpp rename to stan/math/prim/constraint/stochastic_column_constrain.hpp index 8ed66883579..42c4f87d3b8 100644 --- a/stan/math/prim/fun/stochastic_column_constrain.hpp +++ b/stan/math/prim/constraint/stochastic_column_constrain.hpp @@ -1,5 +1,5 @@ -#ifndef STAN_MATH_PRIM_FUN_SIMPLEX_COLUMN_CONSTRAIN_HPP -#define STAN_MATH_PRIM_FUN_SIMPLEX_COLUMN_CONSTRAIN_HPP +#ifndef STAN_MATH_PRIM_CONSTRAINT_SIMPLEX_COLUMN_CONSTRAIN_HPP +#define STAN_MATH_PRIM_CONSTRAINT_SIMPLEX_COLUMN_CONSTRAIN_HPP #include #include @@ -7,7 +7,7 @@ #include #include #include -#include +#include #include namespace stan { diff --git a/stan/math/prim/fun/stochastic_column_free.hpp b/stan/math/prim/constraint/stochastic_column_free.hpp similarity index 88% rename from stan/math/prim/fun/stochastic_column_free.hpp rename to stan/math/prim/constraint/stochastic_column_free.hpp index b7a69fced25..fa4d2a43449 100644 --- a/stan/math/prim/fun/stochastic_column_free.hpp +++ b/stan/math/prim/constraint/stochastic_column_free.hpp @@ -1,9 +1,9 @@ -#ifndef STAN_MATH_PRIM_FUN_STOCHASTIC_COLUMN_FREE_HPP -#define STAN_MATH_PRIM_FUN_STOCHASTIC_COLUMN_FREE_HPP +#ifndef STAN_MATH_PRIM_CONSTRAINT_STOCHASTIC_COLUMN_FREE_HPP +#define STAN_MATH_PRIM_CONSTRAINT_STOCHASTIC_COLUMN_FREE_HPP #include #include -#include +#include namespace stan { namespace math { diff --git a/stan/math/prim/fun/stochastic_row_constrain.hpp b/stan/math/prim/constraint/stochastic_row_constrain.hpp similarity index 96% rename from stan/math/prim/fun/stochastic_row_constrain.hpp rename to stan/math/prim/constraint/stochastic_row_constrain.hpp index 7ea9306a933..d0f183f273a 100644 --- a/stan/math/prim/fun/stochastic_row_constrain.hpp +++ b/stan/math/prim/constraint/stochastic_row_constrain.hpp @@ -1,5 +1,5 @@ -#ifndef STAN_MATH_PRIM_FUN_STOCHASTIC_ROW_CONSTRAIN_HPP -#define STAN_MATH_PRIM_FUN_STOCHASTIC_ROW_CONSTRAIN_HPP +#ifndef STAN_MATH_PRIM_CONSTRAINT_STOCHASTIC_ROW_CONSTRAIN_HPP +#define STAN_MATH_PRIM_CONSTRAINT_STOCHASTIC_ROW_CONSTRAIN_HPP #include #include @@ -7,7 +7,7 @@ #include #include #include -#include +#include #include namespace stan { diff --git a/stan/math/prim/fun/stochastic_row_free.hpp b/stan/math/prim/constraint/stochastic_row_free.hpp similarity index 89% rename from stan/math/prim/fun/stochastic_row_free.hpp rename to stan/math/prim/constraint/stochastic_row_free.hpp index 7fa255b9949..82ad3e3ea92 100644 --- a/stan/math/prim/fun/stochastic_row_free.hpp +++ b/stan/math/prim/constraint/stochastic_row_free.hpp @@ -1,9 +1,9 @@ -#ifndef STAN_MATH_PRIM_FUN_STOCHASTIC_ROW_FREE_HPP -#define STAN_MATH_PRIM_FUN_STOCHASTIC_ROW_FREE_HPP +#ifndef STAN_MATH_PRIM_CONSTRAINT_STOCHASTIC_ROW_FREE_HPP +#define STAN_MATH_PRIM_CONSTRAINT_STOCHASTIC_ROW_FREE_HPP #include #include -#include +#include namespace stan { namespace math { diff --git a/stan/math/prim/fun/ub_constrain.hpp b/stan/math/prim/constraint/ub_constrain.hpp similarity index 97% rename from stan/math/prim/fun/ub_constrain.hpp rename to stan/math/prim/constraint/ub_constrain.hpp index f753f744b52..2c523e9ff47 100644 --- a/stan/math/prim/fun/ub_constrain.hpp +++ b/stan/math/prim/constraint/ub_constrain.hpp @@ -1,12 +1,12 @@ -#ifndef STAN_MATH_PRIM_FUN_UB_CONSTRAIN_HPP -#define STAN_MATH_PRIM_FUN_UB_CONSTRAIN_HPP +#ifndef STAN_MATH_PRIM_CONSTRAINT_UB_CONSTRAIN_HPP +#define STAN_MATH_PRIM_CONSTRAINT_UB_CONSTRAIN_HPP #include #include #include #include -#include -#include +#include +#include #include #include #include diff --git a/stan/math/prim/fun/ub_free.hpp b/stan/math/prim/constraint/ub_free.hpp similarity index 96% rename from stan/math/prim/fun/ub_free.hpp rename to stan/math/prim/constraint/ub_free.hpp index 4c58f475a7d..05a3acce775 100644 --- a/stan/math/prim/fun/ub_free.hpp +++ b/stan/math/prim/constraint/ub_free.hpp @@ -1,10 +1,10 @@ -#ifndef STAN_MATH_PRIM_FUN_UB_FREE_HPP -#define STAN_MATH_PRIM_FUN_UB_FREE_HPP +#ifndef STAN_MATH_PRIM_CONSTRAINT_UB_FREE_HPP +#define STAN_MATH_PRIM_CONSTRAINT_UB_FREE_HPP #include #include #include -#include +#include #include #include diff --git a/stan/math/prim/fun/unit_vector_constrain.hpp b/stan/math/prim/constraint/unit_vector_constrain.hpp similarity index 97% rename from stan/math/prim/fun/unit_vector_constrain.hpp rename to stan/math/prim/constraint/unit_vector_constrain.hpp index 7239c765f56..19ccfae39a3 100644 --- a/stan/math/prim/fun/unit_vector_constrain.hpp +++ b/stan/math/prim/constraint/unit_vector_constrain.hpp @@ -1,5 +1,5 @@ -#ifndef STAN_MATH_PRIM_FUN_UNIT_VECTOR_CONSTRAIN_HPP -#define STAN_MATH_PRIM_FUN_UNIT_VECTOR_CONSTRAIN_HPP +#ifndef STAN_MATH_PRIM_CONSTRAINT_UNIT_VECTOR_CONSTRAIN_HPP +#define STAN_MATH_PRIM_CONSTRAINT_UNIT_VECTOR_CONSTRAIN_HPP #include #include diff --git a/stan/math/prim/fun/unit_vector_free.hpp b/stan/math/prim/constraint/unit_vector_free.hpp similarity index 92% rename from stan/math/prim/fun/unit_vector_free.hpp rename to stan/math/prim/constraint/unit_vector_free.hpp index 870e30e6b35..9f7d39e61ac 100644 --- a/stan/math/prim/fun/unit_vector_free.hpp +++ b/stan/math/prim/constraint/unit_vector_free.hpp @@ -1,5 +1,5 @@ -#ifndef STAN_MATH_PRIM_FUN_UNIT_VECTOR_FREE_HPP -#define STAN_MATH_PRIM_FUN_UNIT_VECTOR_FREE_HPP +#ifndef STAN_MATH_PRIM_CONSTRAINT_UNIT_VECTOR_FREE_HPP +#define STAN_MATH_PRIM_CONSTRAINT_UNIT_VECTOR_FREE_HPP #include #include diff --git a/stan/math/prim/fun.hpp b/stan/math/prim/fun.hpp index 80ee52d4fe7..8a82bb97925 100644 --- a/stan/math/prim/fun.hpp +++ b/stan/math/prim/fun.hpp @@ -38,11 +38,7 @@ #include #include #include -#include -#include #include -#include -#include #include #include #include @@ -52,17 +48,9 @@ #include #include #include -#include -#include -#include -#include #include #include #include -#include -#include -#include -#include #include #include #include @@ -139,8 +127,6 @@ #include #include #include -#include -#include #include #include #include @@ -169,8 +155,6 @@ #include #include #include -#include -#include #include #include #include @@ -213,8 +197,6 @@ #include #include #include -#include -#include #include #include #include @@ -245,8 +227,6 @@ #include #include #include -#include -#include #include #include #include @@ -255,22 +235,14 @@ #include #include #include -#include -#include #include #include #include #include #include #include -#include -#include -#include -#include #include #include -#include -#include #include #include #include @@ -315,8 +287,6 @@ #include #include #include -#include -#include #include #include #include @@ -334,10 +304,6 @@ #include #include #include -#include -#include -#include -#include #include #include #include @@ -369,12 +335,8 @@ #include #include #include -#include -#include #include #include -#include -#include #include #include #include diff --git a/stan/math/rev.hpp b/stan/math/rev.hpp index 91d374eb12d..e89df411728 100644 --- a/stan/math/rev.hpp +++ b/stan/math/rev.hpp @@ -5,8 +5,10 @@ #ifdef STAN_OPENCL #include +#include #endif +#include #include #include #include diff --git a/stan/math/rev/constraint.hpp b/stan/math/rev/constraint.hpp new file mode 100644 index 00000000000..9bebfdf9553 --- /dev/null +++ b/stan/math/rev/constraint.hpp @@ -0,0 +1,26 @@ +#ifndef STAN_MATH_REV_CONSTRAINT_HPP +#define STAN_MATH_REV_CONSTRAINT_HPP + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#endif diff --git a/stan/math/rev/fun/cholesky_corr_constrain.hpp b/stan/math/rev/constraint/cholesky_corr_constrain.hpp similarity index 96% rename from stan/math/rev/fun/cholesky_corr_constrain.hpp rename to stan/math/rev/constraint/cholesky_corr_constrain.hpp index f65c32c4770..e61fcbc5cbd 100644 --- a/stan/math/rev/fun/cholesky_corr_constrain.hpp +++ b/stan/math/rev/constraint/cholesky_corr_constrain.hpp @@ -1,5 +1,5 @@ -#ifndef STAN_MATH_REV_FUN_CHOLESKY_CORR_CONSTRAIN_HPP -#define STAN_MATH_REV_FUN_CHOLESKY_CORR_CONSTRAIN_HPP +#ifndef STAN_MATH_REV_CONSTRAINT_CHOLESKY_CORR_CONSTRAIN_HPP +#define STAN_MATH_REV_CONSTRAINT_CHOLESKY_CORR_CONSTRAIN_HPP #include #include @@ -7,7 +7,7 @@ #include #include #include -#include +#include #include namespace stan { diff --git a/stan/math/rev/fun/cholesky_factor_constrain.hpp b/stan/math/rev/constraint/cholesky_factor_constrain.hpp similarity index 96% rename from stan/math/rev/fun/cholesky_factor_constrain.hpp rename to stan/math/rev/constraint/cholesky_factor_constrain.hpp index 3cc96382180..17d18d7ee0e 100644 --- a/stan/math/rev/fun/cholesky_factor_constrain.hpp +++ b/stan/math/rev/constraint/cholesky_factor_constrain.hpp @@ -1,5 +1,5 @@ -#ifndef STAN_MATH_REV_FUN_CHOLESKY_FACTOR_CONSTRAIN_HPP -#define STAN_MATH_REV_FUN_CHOLESKY_FACTOR_CONSTRAIN_HPP +#ifndef STAN_MATH_REV_CONSTRAINT_CHOLESKY_FACTOR_CONSTRAIN_HPP +#define STAN_MATH_REV_CONSTRAINT_CHOLESKY_FACTOR_CONSTRAIN_HPP #include #include diff --git a/stan/math/rev/fun/corr_matrix_constrain.hpp b/stan/math/rev/constraint/corr_matrix_constrain.hpp similarity index 94% rename from stan/math/rev/fun/corr_matrix_constrain.hpp rename to stan/math/rev/constraint/corr_matrix_constrain.hpp index f28d7ed5e01..c3d1b8d2f7d 100644 --- a/stan/math/rev/fun/corr_matrix_constrain.hpp +++ b/stan/math/rev/constraint/corr_matrix_constrain.hpp @@ -1,11 +1,11 @@ -#ifndef STAN_MATH_REV_FUN_CORR_MATRIX_CONSTRAIN_HPP -#define STAN_MATH_REV_FUN_CORR_MATRIX_CONSTRAIN_HPP +#ifndef STAN_MATH_REV_CONSTRAINT_CORR_MATRIX_CONSTRAIN_HPP +#define STAN_MATH_REV_CONSTRAINT_CORR_MATRIX_CONSTRAIN_HPP #include #include #include #include -#include +#include #include #include diff --git a/stan/math/rev/fun/cov_matrix_constrain.hpp b/stan/math/rev/constraint/cov_matrix_constrain.hpp similarity index 97% rename from stan/math/rev/fun/cov_matrix_constrain.hpp rename to stan/math/rev/constraint/cov_matrix_constrain.hpp index f0e6eca08f5..ccf4ac496ba 100644 --- a/stan/math/rev/fun/cov_matrix_constrain.hpp +++ b/stan/math/rev/constraint/cov_matrix_constrain.hpp @@ -1,5 +1,5 @@ -#ifndef STAN_MATH_REV_FUN_COV_MATRIX_CONSTRAIN_HPP -#define STAN_MATH_REV_FUN_COV_MATRIX_CONSTRAIN_HPP +#ifndef STAN_MATH_REV_CONSTRAINT_COV_MATRIX_CONSTRAIN_HPP +#define STAN_MATH_REV_CONSTRAINT_COV_MATRIX_CONSTRAIN_HPP #include #include diff --git a/stan/math/rev/fun/cov_matrix_constrain_lkj.hpp b/stan/math/rev/constraint/cov_matrix_constrain_lkj.hpp similarity index 92% rename from stan/math/rev/fun/cov_matrix_constrain_lkj.hpp rename to stan/math/rev/constraint/cov_matrix_constrain_lkj.hpp index 29ef3a2b0fe..1e8d8ea3e8c 100644 --- a/stan/math/rev/fun/cov_matrix_constrain_lkj.hpp +++ b/stan/math/rev/constraint/cov_matrix_constrain_lkj.hpp @@ -1,10 +1,10 @@ -#ifndef STAN_MATH_REV_FUN_COV_MATRIX_CONSTRAIN_LKJ_HPP -#define STAN_MATH_REV_FUN_COV_MATRIX_CONSTRAIN_LKJ_HPP +#ifndef STAN_MATH_REV_CONSTRAINT_COV_MATRIX_CONSTRAIN_LKJ_HPP +#define STAN_MATH_REV_CONSTRAINT_COV_MATRIX_CONSTRAIN_LKJ_HPP #include #include -#include -#include +#include +#include #include #include diff --git a/stan/math/rev/fun/identity_constrain.hpp b/stan/math/rev/constraint/identity_constrain.hpp similarity index 87% rename from stan/math/rev/fun/identity_constrain.hpp rename to stan/math/rev/constraint/identity_constrain.hpp index 821aa441996..6d6bbff205c 100644 --- a/stan/math/rev/fun/identity_constrain.hpp +++ b/stan/math/rev/constraint/identity_constrain.hpp @@ -1,9 +1,9 @@ -#ifndef STAN_MATH_REV_FUN_IDENTITY_CONSTRAIN_HPP -#define STAN_MATH_REV_FUN_IDENTITY_CONSTRAIN_HPP +#ifndef STAN_MATH_REV_CONSTRAINT_IDENTITY_CONSTRAIN_HPP +#define STAN_MATH_REV_CONSTRAINT_IDENTITY_CONSTRAIN_HPP #include #include -#include +#include #include namespace stan { namespace math { diff --git a/stan/math/rev/fun/identity_free.hpp b/stan/math/rev/constraint/identity_free.hpp similarity index 80% rename from stan/math/rev/fun/identity_free.hpp rename to stan/math/rev/constraint/identity_free.hpp index 09fa323466c..596d52e6cdf 100644 --- a/stan/math/rev/fun/identity_free.hpp +++ b/stan/math/rev/constraint/identity_free.hpp @@ -1,8 +1,8 @@ -#ifndef STAN_MATH_REV_FUN_IDENTITY_CONSTRAIN_HPP -#define STAN_MATH_REV_FUN_IDENTITY_CONSTRAIN_HPP +#ifndef STAN_MATH_REV_CONSTRAINT_IDENTITY_CONSTRAIN_HPP +#define STAN_MATH_REV_CONSTRAINT_IDENTITY_CONSTRAIN_HPP #include -#include +#include #include namespace stan { diff --git a/stan/math/rev/fun/lb_constrain.hpp b/stan/math/rev/constraint/lb_constrain.hpp similarity index 98% rename from stan/math/rev/fun/lb_constrain.hpp rename to stan/math/rev/constraint/lb_constrain.hpp index 0bdad75a716..8f8da96afce 100644 --- a/stan/math/rev/fun/lb_constrain.hpp +++ b/stan/math/rev/constraint/lb_constrain.hpp @@ -1,15 +1,15 @@ -#ifndef STAN_MATH_REV_FUN_LB_CONSTRAIN_HPP -#define STAN_MATH_REV_FUN_LB_CONSTRAIN_HPP +#ifndef STAN_MATH_REV_CONSTRAINT_LB_CONSTRAIN_HPP +#define STAN_MATH_REV_CONSTRAINT_LB_CONSTRAIN_HPP #include #include #include #include -#include +#include #include #include -#include -#include +#include +#include #include #include #include diff --git a/stan/math/rev/fun/lub_constrain.hpp b/stan/math/rev/constraint/lub_constrain.hpp similarity index 99% rename from stan/math/rev/fun/lub_constrain.hpp rename to stan/math/rev/constraint/lub_constrain.hpp index ac54a675b8b..36715e4de95 100644 --- a/stan/math/rev/fun/lub_constrain.hpp +++ b/stan/math/rev/constraint/lub_constrain.hpp @@ -1,11 +1,11 @@ -#ifndef STAN_MATH_REV_FUN_LUB_CONSTRAIN_HPP -#define STAN_MATH_REV_FUN_LUB_CONSTRAIN_HPP +#ifndef STAN_MATH_REV_CONSTRAINT_LUB_CONSTRAIN_HPP +#define STAN_MATH_REV_CONSTRAINT_LUB_CONSTRAIN_HPP #include #include -#include -#include -#include +#include +#include +#include #include namespace stan { diff --git a/stan/math/rev/fun/ordered_constrain.hpp b/stan/math/rev/constraint/ordered_constrain.hpp similarity index 95% rename from stan/math/rev/fun/ordered_constrain.hpp rename to stan/math/rev/constraint/ordered_constrain.hpp index 3f10ab70e75..98b10919875 100644 --- a/stan/math/rev/fun/ordered_constrain.hpp +++ b/stan/math/rev/constraint/ordered_constrain.hpp @@ -1,5 +1,5 @@ -#ifndef STAN_MATH_REV_FUN_ORDERED_CONSTRAIN_HPP -#define STAN_MATH_REV_FUN_ORDERED_CONSTRAIN_HPP +#ifndef STAN_MATH_REV_CONSTRAINT_ORDERED_CONSTRAIN_HPP +#define STAN_MATH_REV_CONSTRAINT_ORDERED_CONSTRAIN_HPP #include #include diff --git a/stan/math/rev/fun/positive_ordered_constrain.hpp b/stan/math/rev/constraint/positive_ordered_constrain.hpp similarity index 92% rename from stan/math/rev/fun/positive_ordered_constrain.hpp rename to stan/math/rev/constraint/positive_ordered_constrain.hpp index 7c39d83a667..d5c6b02f9e9 100644 --- a/stan/math/rev/fun/positive_ordered_constrain.hpp +++ b/stan/math/rev/constraint/positive_ordered_constrain.hpp @@ -1,5 +1,5 @@ -#ifndef STAN_MATH_REV_FUN_POSITIVE_ORDERED_CONSTRAIN_HPP -#define STAN_MATH_REV_FUN_POSITIVE_ORDERED_CONSTRAIN_HPP +#ifndef STAN_MATH_REV_CONSTRAINT_POSITIVE_ORDERED_CONSTRAIN_HPP +#define STAN_MATH_REV_CONSTRAINT_POSITIVE_ORDERED_CONSTRAIN_HPP #include #include diff --git a/stan/math/rev/fun/simplex_constrain.hpp b/stan/math/rev/constraint/simplex_constrain.hpp similarity index 97% rename from stan/math/rev/fun/simplex_constrain.hpp rename to stan/math/rev/constraint/simplex_constrain.hpp index c7dd57788b8..e81cc53557d 100644 --- a/stan/math/rev/fun/simplex_constrain.hpp +++ b/stan/math/rev/constraint/simplex_constrain.hpp @@ -1,5 +1,5 @@ -#ifndef STAN_MATH_REV_FUN_SIMPLEX_CONSTRAIN_HPP -#define STAN_MATH_REV_FUN_SIMPLEX_CONSTRAIN_HPP +#ifndef STAN_MATH_REV_CONSTRAINT_SIMPLEX_CONSTRAIN_HPP +#define STAN_MATH_REV_CONSTRAINT_SIMPLEX_CONSTRAIN_HPP #include #include diff --git a/stan/math/rev/fun/stochastic_column_constrain.hpp b/stan/math/rev/constraint/stochastic_column_constrain.hpp similarity index 97% rename from stan/math/rev/fun/stochastic_column_constrain.hpp rename to stan/math/rev/constraint/stochastic_column_constrain.hpp index 3838e0d0f77..02970513ff2 100644 --- a/stan/math/rev/fun/stochastic_column_constrain.hpp +++ b/stan/math/rev/constraint/stochastic_column_constrain.hpp @@ -1,5 +1,5 @@ -#ifndef STAN_MATH_REV_FUN_STOCHASTIC_COLUMN_CONSTRAIN_HPP -#define STAN_MATH_REV_FUN_STOCHASTIC_COLUMN_CONSTRAIN_HPP +#ifndef STAN_MATH_REV_CONSTRAINT_STOCHASTIC_COLUMN_CONSTRAIN_HPP +#define STAN_MATH_REV_CONSTRAINT_STOCHASTIC_COLUMN_CONSTRAIN_HPP #include #include diff --git a/stan/math/rev/fun/stochastic_row_constrain.hpp b/stan/math/rev/constraint/stochastic_row_constrain.hpp similarity index 97% rename from stan/math/rev/fun/stochastic_row_constrain.hpp rename to stan/math/rev/constraint/stochastic_row_constrain.hpp index 98f6781a1c3..654681107a7 100644 --- a/stan/math/rev/fun/stochastic_row_constrain.hpp +++ b/stan/math/rev/constraint/stochastic_row_constrain.hpp @@ -1,5 +1,5 @@ -#ifndef STAN_MATH_REV_FUN_STOCHASTIC_ROW_CONSTRAIN_HPP -#define STAN_MATH_REV_FUN_STOCHASTIC_ROW_CONSTRAIN_HPP +#ifndef STAN_MATH_REV_CONSTRAINT_STOCHASTIC_ROW_CONSTRAIN_HPP +#define STAN_MATH_REV_CONSTRAINT_STOCHASTIC_ROW_CONSTRAIN_HPP #include #include diff --git a/stan/math/rev/fun/ub_constrain.hpp b/stan/math/rev/constraint/ub_constrain.hpp similarity index 98% rename from stan/math/rev/fun/ub_constrain.hpp rename to stan/math/rev/constraint/ub_constrain.hpp index 9057330c691..f31f9bc21f3 100644 --- a/stan/math/rev/fun/ub_constrain.hpp +++ b/stan/math/rev/constraint/ub_constrain.hpp @@ -1,10 +1,10 @@ -#ifndef STAN_MATH_REV_FUN_UB_CONSTRAIN_HPP -#define STAN_MATH_REV_FUN_UB_CONSTRAIN_HPP +#ifndef STAN_MATH_REV_CONSTRAINT_UB_CONSTRAIN_HPP +#define STAN_MATH_REV_CONSTRAINT_UB_CONSTRAIN_HPP #include #include #include -#include +#include #include namespace stan { diff --git a/stan/math/rev/fun/unit_vector_constrain.hpp b/stan/math/rev/constraint/unit_vector_constrain.hpp similarity index 95% rename from stan/math/rev/fun/unit_vector_constrain.hpp rename to stan/math/rev/constraint/unit_vector_constrain.hpp index 6bc7536d326..86193c28e7e 100644 --- a/stan/math/rev/fun/unit_vector_constrain.hpp +++ b/stan/math/rev/constraint/unit_vector_constrain.hpp @@ -1,5 +1,5 @@ -#ifndef STAN_MATH_REV_FUN_UNIT_VECTOR_CONSTRAIN_HPP -#define STAN_MATH_REV_FUN_UNIT_VECTOR_CONSTRAIN_HPP +#ifndef STAN_MATH_REV_CONSTRAINT_UNIT_VECTOR_CONSTRAIN_HPP +#define STAN_MATH_REV_CONSTRAINT_UNIT_VECTOR_CONSTRAIN_HPP #include #include diff --git a/stan/math/rev/fun.hpp b/stan/math/rev/fun.hpp index 08f0f044a6d..28b9e1d35cb 100644 --- a/stan/math/rev/fun.hpp +++ b/stan/math/rev/fun.hpp @@ -28,18 +28,13 @@ #include #include #include -#include -#include #include #include #include #include #include #include -#include -#include #include -#include #include #include #include @@ -79,8 +74,6 @@ #include #include #include -#include -#include #include #include #include @@ -98,7 +91,6 @@ #include #include #include -#include #include #include #include @@ -124,7 +116,6 @@ #include #include #include -#include #include #include #include @@ -139,10 +130,8 @@ #include #include #include -#include #include #include -#include #include #include #include @@ -160,11 +149,8 @@ #include #include #include -#include #include #include -#include -#include #include #include #include @@ -191,12 +177,11 @@ #include #include #include -#include -#include #include #include #include +#include #include #include #include diff --git a/test/unit/math/mix/fun/cholesky_corr_constrain_test.cpp b/test/unit/math/mix/constraint/cholesky_corr_constrain_test.cpp similarity index 100% rename from test/unit/math/mix/fun/cholesky_corr_constrain_test.cpp rename to test/unit/math/mix/constraint/cholesky_corr_constrain_test.cpp diff --git a/test/unit/math/mix/fun/cholesky_factor_constrain_test.cpp b/test/unit/math/mix/constraint/cholesky_factor_constrain_test.cpp similarity index 100% rename from test/unit/math/mix/fun/cholesky_factor_constrain_test.cpp rename to test/unit/math/mix/constraint/cholesky_factor_constrain_test.cpp diff --git a/test/unit/math/mix/fun/corr_constrain_test.cpp b/test/unit/math/mix/constraint/corr_constrain_test.cpp similarity index 100% rename from test/unit/math/mix/fun/corr_constrain_test.cpp rename to test/unit/math/mix/constraint/corr_constrain_test.cpp diff --git a/test/unit/math/mix/fun/corr_matrix_constrain_test.cpp b/test/unit/math/mix/constraint/corr_matrix_constrain_test.cpp similarity index 100% rename from test/unit/math/mix/fun/corr_matrix_constrain_test.cpp rename to test/unit/math/mix/constraint/corr_matrix_constrain_test.cpp diff --git a/test/unit/math/mix/fun/cov_matrix_constrain_lkj_test.cpp b/test/unit/math/mix/constraint/cov_matrix_constrain_lkj_test.cpp similarity index 100% rename from test/unit/math/mix/fun/cov_matrix_constrain_lkj_test.cpp rename to test/unit/math/mix/constraint/cov_matrix_constrain_lkj_test.cpp diff --git a/test/unit/math/mix/fun/cov_matrix_constrain_test.cpp b/test/unit/math/mix/constraint/cov_matrix_constrain_test.cpp similarity index 100% rename from test/unit/math/mix/fun/cov_matrix_constrain_test.cpp rename to test/unit/math/mix/constraint/cov_matrix_constrain_test.cpp diff --git a/test/unit/math/mix/fun/identity_constrain_test.cpp b/test/unit/math/mix/constraint/identity_constrain_test.cpp similarity index 100% rename from test/unit/math/mix/fun/identity_constrain_test.cpp rename to test/unit/math/mix/constraint/identity_constrain_test.cpp diff --git a/test/unit/math/mix/fun/lb_constrain_matvar_test.cpp b/test/unit/math/mix/constraint/lb_constrain_matvar_test.cpp similarity index 100% rename from test/unit/math/mix/fun/lb_constrain_matvar_test.cpp rename to test/unit/math/mix/constraint/lb_constrain_matvar_test.cpp diff --git a/test/unit/math/mix/fun/lb_constrain_test.cpp b/test/unit/math/mix/constraint/lb_constrain_test.cpp similarity index 100% rename from test/unit/math/mix/fun/lb_constrain_test.cpp rename to test/unit/math/mix/constraint/lb_constrain_test.cpp diff --git a/test/unit/math/mix/fun/lub_constrain_1_test.cpp b/test/unit/math/mix/constraint/lub_constrain_1_test.cpp similarity index 91% rename from test/unit/math/mix/fun/lub_constrain_1_test.cpp rename to test/unit/math/mix/constraint/lub_constrain_1_test.cpp index 04c7466dd87..d76175a441c 100644 --- a/test/unit/math/mix/fun/lub_constrain_1_test.cpp +++ b/test/unit/math/mix/constraint/lub_constrain_1_test.cpp @@ -1,5 +1,5 @@ #include -#include +#include TEST(mathMixMatFun, lub_constrain_scalars) { double x1 = 0.7; diff --git a/test/unit/math/mix/fun/lub_constrain_2_test.cpp b/test/unit/math/mix/constraint/lub_constrain_2_test.cpp similarity index 95% rename from test/unit/math/mix/fun/lub_constrain_2_test.cpp rename to test/unit/math/mix/constraint/lub_constrain_2_test.cpp index 22fa33e28d1..bdd88ef0a6c 100644 --- a/test/unit/math/mix/fun/lub_constrain_2_test.cpp +++ b/test/unit/math/mix/constraint/lub_constrain_2_test.cpp @@ -1,5 +1,5 @@ #include -#include +#include TEST(mathMixMatFun, lub_constrain_vector_scalar_scalar) { Eigen::MatrixXd x1(1, 1); diff --git a/test/unit/math/mix/fun/lub_constrain_3_test.cpp b/test/unit/math/mix/constraint/lub_constrain_3_test.cpp similarity index 96% rename from test/unit/math/mix/fun/lub_constrain_3_test.cpp rename to test/unit/math/mix/constraint/lub_constrain_3_test.cpp index e2fca238fde..d3dd04ed10f 100644 --- a/test/unit/math/mix/fun/lub_constrain_3_test.cpp +++ b/test/unit/math/mix/constraint/lub_constrain_3_test.cpp @@ -1,5 +1,5 @@ #include -#include +#include TEST(mathMixMatFun, lub_constrain_vector_scalar_vector) { Eigen::MatrixXd x1(2, 2); diff --git a/test/unit/math/mix/fun/lub_constrain_4_test.cpp b/test/unit/math/mix/constraint/lub_constrain_4_test.cpp similarity index 94% rename from test/unit/math/mix/fun/lub_constrain_4_test.cpp rename to test/unit/math/mix/constraint/lub_constrain_4_test.cpp index 077e6bfda98..30b9322aab7 100644 --- a/test/unit/math/mix/fun/lub_constrain_4_test.cpp +++ b/test/unit/math/mix/constraint/lub_constrain_4_test.cpp @@ -1,5 +1,5 @@ #include -#include +#include // real[], real[], real[] // real[], real, real[] diff --git a/test/unit/math/mix/fun/lub_constrain_5_test.cpp b/test/unit/math/mix/constraint/lub_constrain_5_test.cpp similarity index 96% rename from test/unit/math/mix/fun/lub_constrain_5_test.cpp rename to test/unit/math/mix/constraint/lub_constrain_5_test.cpp index b1934ddbf04..f8fcf301904 100644 --- a/test/unit/math/mix/fun/lub_constrain_5_test.cpp +++ b/test/unit/math/mix/constraint/lub_constrain_5_test.cpp @@ -1,5 +1,5 @@ #include -#include +#include // array matrix[], array matrix[], array matrix[] // array matrix[], array matrix[], matrix[] diff --git a/test/unit/math/mix/fun/lub_constrain_6_test.cpp b/test/unit/math/mix/constraint/lub_constrain_6_test.cpp similarity index 96% rename from test/unit/math/mix/fun/lub_constrain_6_test.cpp rename to test/unit/math/mix/constraint/lub_constrain_6_test.cpp index 504bb67095b..00d91f7bceb 100644 --- a/test/unit/math/mix/fun/lub_constrain_6_test.cpp +++ b/test/unit/math/mix/constraint/lub_constrain_6_test.cpp @@ -1,5 +1,5 @@ #include -#include +#include // array matrix[], array matrix[], array matrix[] // array matrix[], array matrix[], matrix[] diff --git a/test/unit/math/mix/fun/lub_constrain_7_test.cpp b/test/unit/math/mix/constraint/lub_constrain_7_test.cpp similarity index 96% rename from test/unit/math/mix/fun/lub_constrain_7_test.cpp rename to test/unit/math/mix/constraint/lub_constrain_7_test.cpp index 8c097445b3d..e75009d2dee 100644 --- a/test/unit/math/mix/fun/lub_constrain_7_test.cpp +++ b/test/unit/math/mix/constraint/lub_constrain_7_test.cpp @@ -1,5 +1,5 @@ #include -#include +#include // array matrix[], array matrix[], array matrix[] // array matrix[], array matrix[], matrix[] diff --git a/test/unit/math/mix/fun/lub_constrain_8_test.cpp b/test/unit/math/mix/constraint/lub_constrain_8_test.cpp similarity index 96% rename from test/unit/math/mix/fun/lub_constrain_8_test.cpp rename to test/unit/math/mix/constraint/lub_constrain_8_test.cpp index 3e18bfa2602..4811f56d4a0 100644 --- a/test/unit/math/mix/fun/lub_constrain_8_test.cpp +++ b/test/unit/math/mix/constraint/lub_constrain_8_test.cpp @@ -1,5 +1,5 @@ #include -#include +#include // array matrix[], array matrix[], array matrix[] // array matrix[], array matrix[], matrix[] diff --git a/test/unit/math/mix/fun/lub_constrain_helpers.hpp b/test/unit/math/mix/constraint/lub_constrain_helpers.hpp similarity index 100% rename from test/unit/math/mix/fun/lub_constrain_helpers.hpp rename to test/unit/math/mix/constraint/lub_constrain_helpers.hpp diff --git a/test/unit/math/mix/fun/lub_constrain_matvar_test.cpp b/test/unit/math/mix/constraint/lub_constrain_matvar_test.cpp similarity index 100% rename from test/unit/math/mix/fun/lub_constrain_matvar_test.cpp rename to test/unit/math/mix/constraint/lub_constrain_matvar_test.cpp diff --git a/test/unit/math/mix/fun/offset_multiplier_constrain_1_matvar_test.cpp b/test/unit/math/mix/constraint/offset_multiplier_constrain_1_matvar_test.cpp similarity index 92% rename from test/unit/math/mix/fun/offset_multiplier_constrain_1_matvar_test.cpp rename to test/unit/math/mix/constraint/offset_multiplier_constrain_1_matvar_test.cpp index c3e123c5de5..ebb66b4e3b1 100644 --- a/test/unit/math/mix/fun/offset_multiplier_constrain_1_matvar_test.cpp +++ b/test/unit/math/mix/constraint/offset_multiplier_constrain_1_matvar_test.cpp @@ -1,5 +1,5 @@ #include -#include +#include TEST(mathMixMatFun, offset_multiplier_constrain_matvar_scalars) { double x1 = 0.7; diff --git a/test/unit/math/mix/fun/offset_multiplier_constrain_1_test.cpp b/test/unit/math/mix/constraint/offset_multiplier_constrain_1_test.cpp similarity index 92% rename from test/unit/math/mix/fun/offset_multiplier_constrain_1_test.cpp rename to test/unit/math/mix/constraint/offset_multiplier_constrain_1_test.cpp index 5a22a26ca6f..c0aca029305 100644 --- a/test/unit/math/mix/fun/offset_multiplier_constrain_1_test.cpp +++ b/test/unit/math/mix/constraint/offset_multiplier_constrain_1_test.cpp @@ -1,5 +1,5 @@ #include -#include +#include TEST(mathMixMatFun, offset_multiplier_constrain_scalars) { double x1 = 0.7; diff --git a/test/unit/math/mix/fun/offset_multiplier_constrain_2_matvar_test.cpp b/test/unit/math/mix/constraint/offset_multiplier_constrain_2_matvar_test.cpp similarity index 91% rename from test/unit/math/mix/fun/offset_multiplier_constrain_2_matvar_test.cpp rename to test/unit/math/mix/constraint/offset_multiplier_constrain_2_matvar_test.cpp index 7f0232eef66..38d0712c69c 100644 --- a/test/unit/math/mix/fun/offset_multiplier_constrain_2_matvar_test.cpp +++ b/test/unit/math/mix/constraint/offset_multiplier_constrain_2_matvar_test.cpp @@ -1,5 +1,5 @@ #include -#include +#include TEST(mathMixMatFun, offset_multiplier_constrain_matvar_vector_scalar_vector) { Eigen::MatrixXd x1(2, 2); diff --git a/test/unit/math/mix/fun/offset_multiplier_constrain_2_test.cpp b/test/unit/math/mix/constraint/offset_multiplier_constrain_2_test.cpp similarity index 91% rename from test/unit/math/mix/fun/offset_multiplier_constrain_2_test.cpp rename to test/unit/math/mix/constraint/offset_multiplier_constrain_2_test.cpp index c62a0747501..5a47fa2b6d0 100644 --- a/test/unit/math/mix/fun/offset_multiplier_constrain_2_test.cpp +++ b/test/unit/math/mix/constraint/offset_multiplier_constrain_2_test.cpp @@ -1,5 +1,5 @@ #include -#include +#include TEST(mathMixMatFun, offset_multiplier_constrain_vector_scalar_vector) { Eigen::MatrixXd x1(2, 2); diff --git a/test/unit/math/mix/fun/offset_multiplier_constrain_3_matvar_test.cpp b/test/unit/math/mix/constraint/offset_multiplier_constrain_3_matvar_test.cpp similarity index 94% rename from test/unit/math/mix/fun/offset_multiplier_constrain_3_matvar_test.cpp rename to test/unit/math/mix/constraint/offset_multiplier_constrain_3_matvar_test.cpp index 764c84c0a1b..a48cc636521 100644 --- a/test/unit/math/mix/fun/offset_multiplier_constrain_3_matvar_test.cpp +++ b/test/unit/math/mix/constraint/offset_multiplier_constrain_3_matvar_test.cpp @@ -1,5 +1,5 @@ #include -#include +#include // array[] matrix, matrix, array[] matrix // array[] matrix, matrix, matrix diff --git a/test/unit/math/mix/fun/offset_multiplier_constrain_3_test.cpp b/test/unit/math/mix/constraint/offset_multiplier_constrain_3_test.cpp similarity index 94% rename from test/unit/math/mix/fun/offset_multiplier_constrain_3_test.cpp rename to test/unit/math/mix/constraint/offset_multiplier_constrain_3_test.cpp index 28089aacc8a..0bbb27ebee9 100644 --- a/test/unit/math/mix/fun/offset_multiplier_constrain_3_test.cpp +++ b/test/unit/math/mix/constraint/offset_multiplier_constrain_3_test.cpp @@ -1,5 +1,5 @@ #include -#include +#include // array[] matrix, matrix, array[] matrix // array[] matrix, matrix, matrix diff --git a/test/unit/math/mix/fun/offset_multiplier_constrain_4_matvar_test.cpp b/test/unit/math/mix/constraint/offset_multiplier_constrain_4_matvar_test.cpp similarity index 88% rename from test/unit/math/mix/fun/offset_multiplier_constrain_4_matvar_test.cpp rename to test/unit/math/mix/constraint/offset_multiplier_constrain_4_matvar_test.cpp index 79c0c36867e..0b2d6506959 100644 --- a/test/unit/math/mix/fun/offset_multiplier_constrain_4_matvar_test.cpp +++ b/test/unit/math/mix/constraint/offset_multiplier_constrain_4_matvar_test.cpp @@ -1,5 +1,5 @@ #include -#include +#include // real[], real[], real[] // real[], real, real[] diff --git a/test/unit/math/mix/fun/offset_multiplier_constrain_4_test.cpp b/test/unit/math/mix/constraint/offset_multiplier_constrain_4_test.cpp similarity index 88% rename from test/unit/math/mix/fun/offset_multiplier_constrain_4_test.cpp rename to test/unit/math/mix/constraint/offset_multiplier_constrain_4_test.cpp index fb37442f6f0..ec20c584407 100644 --- a/test/unit/math/mix/fun/offset_multiplier_constrain_4_test.cpp +++ b/test/unit/math/mix/constraint/offset_multiplier_constrain_4_test.cpp @@ -1,5 +1,5 @@ #include -#include +#include // real[], real[], real[] // real[], real, real[] diff --git a/test/unit/math/mix/fun/offset_multiplier_constrain_5_matvar_test.cpp b/test/unit/math/mix/constraint/offset_multiplier_constrain_5_matvar_test.cpp similarity index 90% rename from test/unit/math/mix/fun/offset_multiplier_constrain_5_matvar_test.cpp rename to test/unit/math/mix/constraint/offset_multiplier_constrain_5_matvar_test.cpp index e47b579f2ed..f9191a79757 100644 --- a/test/unit/math/mix/fun/offset_multiplier_constrain_5_matvar_test.cpp +++ b/test/unit/math/mix/constraint/offset_multiplier_constrain_5_matvar_test.cpp @@ -1,5 +1,5 @@ #include -#include +#include // array[] matrix, array[] matrix, real // array[] matrix, real, array[] matrix diff --git a/test/unit/math/mix/fun/offset_multiplier_constrain_5_test.cpp b/test/unit/math/mix/constraint/offset_multiplier_constrain_5_test.cpp similarity index 90% rename from test/unit/math/mix/fun/offset_multiplier_constrain_5_test.cpp rename to test/unit/math/mix/constraint/offset_multiplier_constrain_5_test.cpp index 610a2f9de11..6663ec2e3cf 100644 --- a/test/unit/math/mix/fun/offset_multiplier_constrain_5_test.cpp +++ b/test/unit/math/mix/constraint/offset_multiplier_constrain_5_test.cpp @@ -1,5 +1,5 @@ #include -#include +#include // array[] matrix, array[] matrix, real // array[] matrix, real, array[] matrix diff --git a/test/unit/math/mix/fun/offset_multiplier_constrain_6_matvar_test.cpp b/test/unit/math/mix/constraint/offset_multiplier_constrain_6_matvar_test.cpp similarity index 91% rename from test/unit/math/mix/fun/offset_multiplier_constrain_6_matvar_test.cpp rename to test/unit/math/mix/constraint/offset_multiplier_constrain_6_matvar_test.cpp index b65f76bb0c7..a4d86a774dd 100644 --- a/test/unit/math/mix/fun/offset_multiplier_constrain_6_matvar_test.cpp +++ b/test/unit/math/mix/constraint/offset_multiplier_constrain_6_matvar_test.cpp @@ -1,5 +1,5 @@ #include -#include +#include // array[] matrix, matrix, real // array[] matrix, real, matrix diff --git a/test/unit/math/mix/fun/offset_multiplier_constrain_6_test.cpp b/test/unit/math/mix/constraint/offset_multiplier_constrain_6_test.cpp similarity index 91% rename from test/unit/math/mix/fun/offset_multiplier_constrain_6_test.cpp rename to test/unit/math/mix/constraint/offset_multiplier_constrain_6_test.cpp index 190d01f0c81..3dd21630ce9 100644 --- a/test/unit/math/mix/fun/offset_multiplier_constrain_6_test.cpp +++ b/test/unit/math/mix/constraint/offset_multiplier_constrain_6_test.cpp @@ -1,5 +1,5 @@ #include -#include +#include // array[] matrix, matrix, real // array[] matrix, real, matrix diff --git a/test/unit/math/mix/fun/offset_multiplier_constrain_7_test.cpp b/test/unit/math/mix/constraint/offset_multiplier_constrain_7_test.cpp similarity index 100% rename from test/unit/math/mix/fun/offset_multiplier_constrain_7_test.cpp rename to test/unit/math/mix/constraint/offset_multiplier_constrain_7_test.cpp diff --git a/test/unit/math/mix/fun/offset_multiplier_constrain_helpers.hpp b/test/unit/math/mix/constraint/offset_multiplier_constrain_helpers.hpp similarity index 100% rename from test/unit/math/mix/fun/offset_multiplier_constrain_helpers.hpp rename to test/unit/math/mix/constraint/offset_multiplier_constrain_helpers.hpp diff --git a/test/unit/math/mix/fun/offset_multiplier_constrain_matvar_helpers.hpp b/test/unit/math/mix/constraint/offset_multiplier_constrain_matvar_helpers.hpp similarity index 100% rename from test/unit/math/mix/fun/offset_multiplier_constrain_matvar_helpers.hpp rename to test/unit/math/mix/constraint/offset_multiplier_constrain_matvar_helpers.hpp diff --git a/test/unit/math/mix/fun/ordered_constrain_test.cpp b/test/unit/math/mix/constraint/ordered_constrain_test.cpp similarity index 100% rename from test/unit/math/mix/fun/ordered_constrain_test.cpp rename to test/unit/math/mix/constraint/ordered_constrain_test.cpp diff --git a/test/unit/math/mix/fun/positive_ordered_constrain_test.cpp b/test/unit/math/mix/constraint/positive_ordered_constrain_test.cpp similarity index 100% rename from test/unit/math/mix/fun/positive_ordered_constrain_test.cpp rename to test/unit/math/mix/constraint/positive_ordered_constrain_test.cpp diff --git a/test/unit/math/mix/fun/simplex_constrain_test.cpp b/test/unit/math/mix/constraint/simplex_constrain_test.cpp similarity index 100% rename from test/unit/math/mix/fun/simplex_constrain_test.cpp rename to test/unit/math/mix/constraint/simplex_constrain_test.cpp diff --git a/test/unit/math/mix/fun/stochastic_column_constrain_test.cpp b/test/unit/math/mix/constraint/stochastic_column_constrain_test.cpp similarity index 100% rename from test/unit/math/mix/fun/stochastic_column_constrain_test.cpp rename to test/unit/math/mix/constraint/stochastic_column_constrain_test.cpp diff --git a/test/unit/math/mix/fun/stochastic_row_constrain_test.cpp b/test/unit/math/mix/constraint/stochastic_row_constrain_test.cpp similarity index 100% rename from test/unit/math/mix/fun/stochastic_row_constrain_test.cpp rename to test/unit/math/mix/constraint/stochastic_row_constrain_test.cpp diff --git a/test/unit/math/mix/fun/unit_vector_constrain_test.cpp b/test/unit/math/mix/constraint/unit_vector_constrain_test.cpp similarity index 100% rename from test/unit/math/mix/fun/unit_vector_constrain_test.cpp rename to test/unit/math/mix/constraint/unit_vector_constrain_test.cpp diff --git a/test/unit/math/opencl/rev/lb_constrain_test.cpp b/test/unit/math/opencl/rev/constraint/lb_constrain_test.cpp similarity index 100% rename from test/unit/math/opencl/rev/lb_constrain_test.cpp rename to test/unit/math/opencl/rev/constraint/lb_constrain_test.cpp diff --git a/test/unit/math/opencl/rev/lub_constrain_test.cpp b/test/unit/math/opencl/rev/constraint/lub_constrain_test.cpp similarity index 100% rename from test/unit/math/opencl/rev/lub_constrain_test.cpp rename to test/unit/math/opencl/rev/constraint/lub_constrain_test.cpp diff --git a/test/unit/math/opencl/rev/offset_multiplier_constrain_test.cpp b/test/unit/math/opencl/rev/constraint/offset_multiplier_constrain_test.cpp similarity index 100% rename from test/unit/math/opencl/rev/offset_multiplier_constrain_test.cpp rename to test/unit/math/opencl/rev/constraint/offset_multiplier_constrain_test.cpp diff --git a/test/unit/math/opencl/rev/ub_constrain_test.cpp b/test/unit/math/opencl/rev/constraint/ub_constrain_test.cpp similarity index 100% rename from test/unit/math/opencl/rev/ub_constrain_test.cpp rename to test/unit/math/opencl/rev/constraint/ub_constrain_test.cpp diff --git a/test/unit/math/opencl/rev/unit_vector_constrain_test.cpp b/test/unit/math/opencl/rev/constraint/unit_vector_constrain_test.cpp similarity index 100% rename from test/unit/math/opencl/rev/unit_vector_constrain_test.cpp rename to test/unit/math/opencl/rev/constraint/unit_vector_constrain_test.cpp diff --git a/test/unit/math/prim/fun/cholesky_corr_transform_test.cpp b/test/unit/math/prim/constraint/cholesky_corr_transform_test.cpp similarity index 100% rename from test/unit/math/prim/fun/cholesky_corr_transform_test.cpp rename to test/unit/math/prim/constraint/cholesky_corr_transform_test.cpp diff --git a/test/unit/math/prim/fun/cholesky_factor_transform_test.cpp b/test/unit/math/prim/constraint/cholesky_factor_transform_test.cpp similarity index 100% rename from test/unit/math/prim/fun/cholesky_factor_transform_test.cpp rename to test/unit/math/prim/constraint/cholesky_factor_transform_test.cpp diff --git a/test/unit/math/prim/fun/corr_transform_test.cpp b/test/unit/math/prim/constraint/corr_transform_test.cpp similarity index 100% rename from test/unit/math/prim/fun/corr_transform_test.cpp rename to test/unit/math/prim/constraint/corr_transform_test.cpp diff --git a/test/unit/math/prim/fun/cov_matrix_transform_test.cpp b/test/unit/math/prim/constraint/cov_matrix_transform_test.cpp similarity index 100% rename from test/unit/math/prim/fun/cov_matrix_transform_test.cpp rename to test/unit/math/prim/constraint/cov_matrix_transform_test.cpp diff --git a/test/unit/math/prim/fun/identity_transform_test.cpp b/test/unit/math/prim/constraint/identity_transform_test.cpp similarity index 100% rename from test/unit/math/prim/fun/identity_transform_test.cpp rename to test/unit/math/prim/constraint/identity_transform_test.cpp diff --git a/test/unit/math/prim/fun/lb_transform_test.cpp b/test/unit/math/prim/constraint/lb_transform_test.cpp similarity index 100% rename from test/unit/math/prim/fun/lb_transform_test.cpp rename to test/unit/math/prim/constraint/lb_transform_test.cpp diff --git a/test/unit/math/prim/fun/lub_transform_test.cpp b/test/unit/math/prim/constraint/lub_transform_test.cpp similarity index 100% rename from test/unit/math/prim/fun/lub_transform_test.cpp rename to test/unit/math/prim/constraint/lub_transform_test.cpp diff --git a/test/unit/math/prim/fun/offset_multiplier_matrix_transform_test.cpp b/test/unit/math/prim/constraint/offset_multiplier_matrix_transform_test.cpp similarity index 100% rename from test/unit/math/prim/fun/offset_multiplier_matrix_transform_test.cpp rename to test/unit/math/prim/constraint/offset_multiplier_matrix_transform_test.cpp diff --git a/test/unit/math/prim/fun/offset_multiplier_transform_test.cpp b/test/unit/math/prim/constraint/offset_multiplier_transform_test.cpp similarity index 100% rename from test/unit/math/prim/fun/offset_multiplier_transform_test.cpp rename to test/unit/math/prim/constraint/offset_multiplier_transform_test.cpp diff --git a/test/unit/math/prim/fun/ordered_transform_test.cpp b/test/unit/math/prim/constraint/ordered_transform_test.cpp similarity index 100% rename from test/unit/math/prim/fun/ordered_transform_test.cpp rename to test/unit/math/prim/constraint/ordered_transform_test.cpp diff --git a/test/unit/math/prim/fun/prob_transform_test.cpp b/test/unit/math/prim/constraint/prob_transform_test.cpp similarity index 100% rename from test/unit/math/prim/fun/prob_transform_test.cpp rename to test/unit/math/prim/constraint/prob_transform_test.cpp diff --git a/test/unit/math/prim/fun/simplex_transform_test.cpp b/test/unit/math/prim/constraint/simplex_transform_test.cpp similarity index 100% rename from test/unit/math/prim/fun/simplex_transform_test.cpp rename to test/unit/math/prim/constraint/simplex_transform_test.cpp diff --git a/test/unit/math/prim/fun/stochastic_column_constrain_test.cpp b/test/unit/math/prim/constraint/stochastic_column_constrain_test.cpp similarity index 100% rename from test/unit/math/prim/fun/stochastic_column_constrain_test.cpp rename to test/unit/math/prim/constraint/stochastic_column_constrain_test.cpp diff --git a/test/unit/math/prim/fun/stochastic_row_constrain_test.cpp b/test/unit/math/prim/constraint/stochastic_row_constrain_test.cpp similarity index 100% rename from test/unit/math/prim/fun/stochastic_row_constrain_test.cpp rename to test/unit/math/prim/constraint/stochastic_row_constrain_test.cpp diff --git a/test/unit/math/prim/fun/ub_transform_test.cpp b/test/unit/math/prim/constraint/ub_transform_test.cpp similarity index 100% rename from test/unit/math/prim/fun/ub_transform_test.cpp rename to test/unit/math/prim/constraint/ub_transform_test.cpp diff --git a/test/unit/math/prim/fun/unit_vector_transform_test.cpp b/test/unit/math/prim/constraint/unit_vector_transform_test.cpp similarity index 100% rename from test/unit/math/prim/fun/unit_vector_transform_test.cpp rename to test/unit/math/prim/constraint/unit_vector_transform_test.cpp From c9c98378c1691288c9c4ed0bdacaf01d8f98a3bc Mon Sep 17 00:00:00 2001 From: Sean Pinkney Date: Sun, 24 Mar 2024 18:21:23 -0400 Subject: [PATCH 02/10] fix forward --- stan/math/mix.hpp | 1 + stan/math/opencl/{prim_constraint.cpp => prim_constraint.hpp} | 0 stan/math/opencl/{rev_constraint.cpp => rev_constraint.hpp} | 0 3 files changed, 1 insertion(+) rename stan/math/opencl/{prim_constraint.cpp => prim_constraint.hpp} (100%) rename stan/math/opencl/{rev_constraint.cpp => rev_constraint.hpp} (100%) diff --git a/stan/math/mix.hpp b/stan/math/mix.hpp index d65900c6cd3..bb7ff7c0b1f 100644 --- a/stan/math/mix.hpp +++ b/stan/math/mix.hpp @@ -5,6 +5,7 @@ #include #include +#include #include #include #include diff --git a/stan/math/opencl/prim_constraint.cpp b/stan/math/opencl/prim_constraint.hpp similarity index 100% rename from stan/math/opencl/prim_constraint.cpp rename to stan/math/opencl/prim_constraint.hpp diff --git a/stan/math/opencl/rev_constraint.cpp b/stan/math/opencl/rev_constraint.hpp similarity index 100% rename from stan/math/opencl/rev_constraint.cpp rename to stan/math/opencl/rev_constraint.hpp From 2f1c952b7235ad44f2d1ff7c22e2f919d3dc1f71 Mon Sep 17 00:00:00 2001 From: Sean Pinkney Date: Sun, 24 Mar 2024 18:26:35 -0400 Subject: [PATCH 03/10] fix opencl headers --- stan/math/opencl/prim.hpp | 5 ----- stan/math/opencl/rev.hpp | 5 ----- 2 files changed, 10 deletions(-) diff --git a/stan/math/opencl/prim.hpp b/stan/math/opencl/prim.hpp index f0875a4268c..8e8730f537f 100644 --- a/stan/math/opencl/prim.hpp +++ b/stan/math/opencl/prim.hpp @@ -172,7 +172,6 @@ #include #include #include -#include #include #include #include @@ -184,7 +183,6 @@ #include #include #include -#include #include #include #include @@ -201,7 +199,6 @@ #include #include #include -#include #include #include #include @@ -266,12 +263,10 @@ #include #include #include -#include #include #include #include #include -#include #include #include #include diff --git a/stan/math/opencl/rev.hpp b/stan/math/opencl/rev.hpp index f48de0b806f..4dddb45691b 100644 --- a/stan/math/opencl/rev.hpp +++ b/stan/math/opencl/rev.hpp @@ -58,7 +58,6 @@ #include #include #include -#include #include #include #include @@ -77,14 +76,12 @@ #include #include #include -#include #include #include #include #include #include #include -#include #include #include #include @@ -117,8 +114,6 @@ #include #include #include -#include -#include #include #include From ae5d6403557f10a22cbcb2ffab1345cae46d3eaf Mon Sep 17 00:00:00 2001 From: Sean Pinkney Date: Sun, 24 Mar 2024 18:36:51 -0400 Subject: [PATCH 04/10] add new line --- stan/math/fwd/constraint.hpp | 2 +- stan/math/prim/constraint.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/stan/math/fwd/constraint.hpp b/stan/math/fwd/constraint.hpp index 87a396055b4..c0d7912cc83 100644 --- a/stan/math/fwd/constraint.hpp +++ b/stan/math/fwd/constraint.hpp @@ -6,4 +6,4 @@ #include -#endif \ No newline at end of file +#endif diff --git a/stan/math/prim/constraint.hpp b/stan/math/prim/constraint.hpp index 9a252202811..9193ea3ddad 100644 --- a/stan/math/prim/constraint.hpp +++ b/stan/math/prim/constraint.hpp @@ -39,4 +39,4 @@ #include #include -#endif \ No newline at end of file +#endif From b445511a7ca0a14ff4a195553d0eda159f7531b9 Mon Sep 17 00:00:00 2001 From: Sean Pinkney Date: Mon, 25 Mar 2024 05:09:32 -0400 Subject: [PATCH 05/10] update opencl headers --- stan/math/opencl/prim.hpp | 2 + stan/math/opencl/prim_constraint.hpp | 99 ------------------------- stan/math/opencl/rev.hpp | 2 + stan/math/opencl/rev_constraint.hpp | 103 +-------------------------- 4 files changed, 6 insertions(+), 200 deletions(-) diff --git a/stan/math/opencl/prim.hpp b/stan/math/opencl/prim.hpp index 8e8730f537f..4c5b193a7da 100644 --- a/stan/math/opencl/prim.hpp +++ b/stan/math/opencl/prim.hpp @@ -99,6 +99,8 @@ #include #include +#include + #include #include #include diff --git a/stan/math/opencl/prim_constraint.hpp b/stan/math/opencl/prim_constraint.hpp index 9c38de83393..b092eafc275 100644 --- a/stan/math/opencl/prim_constraint.hpp +++ b/stan/math/opencl/prim_constraint.hpp @@ -2,110 +2,11 @@ #define STAN_MATH_OPENCL_PRIM_CONSTRAINT_HPP #ifdef STAN_OPENCL -/** - * \defgroup opencl OpenCL - * Stan's OpenCL backend allows for computation to be executed in parallel - * on a GPU or in multithreaded CPUs. It is meant to easily conform with Eigen - * such that you can create and read from a `matrix_cl` by doing - * - *```cpp - * Eigen::MatrixXd A_eig = Eigen::MatrixXd::Random(10, 10); - * matrix_cl A(A_eig); - * matrix_cl B = to_matrix_cl(A_eig); - * matrix_cl C = cholesky_decompose(A * B); - * // Read back to eigen matrix. - * Eigen::MatrixXd C_eig = from_matrix_cl(C); - * - * // Also for vectors and raw pointers of pointers - * std::vector A_vec(10, 0); - * matrix_cl B_var(A_vec, 10, 1); - * - * vari** A_vari= // fill - * matrix_cl B_vari(A_vari, 10, 1); - * - *``` - * - * Execution is performed in async and Kernel operations are compounded and - * compiled Just In Time. This allows for a low amount of overhead when passing - * data to and from the device and executing computations. - * - * For more details see the paper on Arvix. - * https://arxiv.org/pdf/1907.01063.pdf - */ - -/** - * \ingroup opencl - * \defgroup error_checks_opencl Error Checks - */ - -/** - * \ingroup opencl - * \defgroup kernel_executor_opencl Kernel Executor - * The kernel executor allows OpenCL kernels to be executed in async. GPUs - * have the capability to perform reads, writes, and computation at the same - * time. In order to maximize the throughput to the device the Kernel - * Executor assigns matrices read and write events. Write events are blocking - * in that no further operations can be completed until the write event - * is finished. However, read events can happen in async together. - * Take the following for example - * - *```cpp - * matrix_cl A = from_eigen_cl(A_eig); - * matrix_cl B = from_eigen_cl(B_eig); - * matrix_cl C = A * B; - * matrix_cl D = A + B; - * matrix_cl E = C + D; - *``` - * In the above, When `A` and `B` are created from the Eigen matrices `A_eig` - *and `B_eig`. they are both assigned write events to their write event stack. - * `C` and `D` depend on `A` and `B` while `E` depends on - * `C` and `D`. When executing `C`'s operation, `A` and `B` are assigned - * events to their read event stack while `C` is assigned an event to it's write - *event stack. Once `A` and `B` have finished their write event the kernel to - *compute `C` can begin. The excution to create `D` also waits for the write - *events of `A` and `B`, but does not have to wait for the execution of `C` to - *finish. Executing `E` requires waiting for for the write events of both `C` - *and `D`. - * - */ - -/** - * \ingroup opencl - * \defgroup opencl_kernels Custom OpenCL kernels - */ - -/** - * \ingroup opencl - * \defgroup prim_fun_opencl OpenCL overloads of stan/math/prim functions - */ -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - #include #include #include #include #include -#include - #endif #endif diff --git a/stan/math/opencl/rev.hpp b/stan/math/opencl/rev.hpp index 4dddb45691b..37c5b716230 100644 --- a/stan/math/opencl/rev.hpp +++ b/stan/math/opencl/rev.hpp @@ -3,6 +3,8 @@ #ifdef STAN_OPENCL #include +#include + #include #include #include diff --git a/stan/math/opencl/rev_constraint.hpp b/stan/math/opencl/rev_constraint.hpp index 20a9660322c..2b42eee74cb 100644 --- a/stan/math/opencl/rev_constraint.hpp +++ b/stan/math/opencl/rev_constraint.hpp @@ -1,111 +1,12 @@ -#ifndef STAN_MATH_OPENCL_PRIM_CONSTRAINT_HPP -#define STAN_MATH_OPENCL_PRIM_CONSTRAINT_HPP +#ifndef STAN_MATH_OPENCL_REV_CONSTRAINT_HPP +#define STAN_MATH_OPENCL_REV_CONSTRAINT_HPP #ifdef STAN_OPENCL -/** - * \defgroup opencl OpenCL - * Stan's OpenCL backend allows for computation to be executed in parallel - * on a GPU or in multithreaded CPUs. It is meant to easily conform with Eigen - * such that you can create and read from a `matrix_cl` by doing - * - *```cpp - * Eigen::MatrixXd A_eig = Eigen::MatrixXd::Random(10, 10); - * matrix_cl A(A_eig); - * matrix_cl B = to_matrix_cl(A_eig); - * matrix_cl C = cholesky_decompose(A * B); - * // Read back to eigen matrix. - * Eigen::MatrixXd C_eig = from_matrix_cl(C); - * - * // Also for vectors and raw pointers of pointers - * std::vector A_vec(10, 0); - * matrix_cl B_var(A_vec, 10, 1); - * - * vari** A_vari= // fill - * matrix_cl B_vari(A_vari, 10, 1); - * - *``` - * - * Execution is performed in async and Kernel operations are compounded and - * compiled Just In Time. This allows for a low amount of overhead when passing - * data to and from the device and executing computations. - * - * For more details see the paper on Arvix. - * https://arxiv.org/pdf/1907.01063.pdf - */ - -/** - * \ingroup opencl - * \defgroup error_checks_opencl Error Checks - */ - -/** - * \ingroup opencl - * \defgroup kernel_executor_opencl Kernel Executor - * The kernel executor allows OpenCL kernels to be executed in async. GPUs - * have the capability to perform reads, writes, and computation at the same - * time. In order to maximize the throughput to the device the Kernel - * Executor assigns matrices read and write events. Write events are blocking - * in that no further operations can be completed until the write event - * is finished. However, read events can happen in async together. - * Take the following for example - * - *```cpp - * matrix_cl A = from_eigen_cl(A_eig); - * matrix_cl B = from_eigen_cl(B_eig); - * matrix_cl C = A * B; - * matrix_cl D = A + B; - * matrix_cl E = C + D; - *``` - * In the above, When `A` and `B` are created from the Eigen matrices `A_eig` - *and `B_eig`. they are both assigned write events to their write event stack. - * `C` and `D` depend on `A` and `B` while `E` depends on - * `C` and `D`. When executing `C`'s operation, `A` and `B` are assigned - * events to their read event stack while `C` is assigned an event to it's write - *event stack. Once `A` and `B` have finished their write event the kernel to - *compute `C` can begin. The excution to create `D` also waits for the write - *events of `A` and `B`, but does not have to wait for the execution of `C` to - *finish. Executing `E` requires waiting for for the write events of both `C` - *and `D`. - * - */ - -/** - * \ingroup opencl - * \defgroup opencl_kernels Custom OpenCL kernels - */ - -/** - * \ingroup opencl - * \defgroup prim_fun_opencl OpenCL overloads of stan/math/prim functions - */ -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - #include #include #include #include #include -#include - #endif #endif From d2bf89c798a8dba86ea834c17ab3093ba386e27b Mon Sep 17 00:00:00 2001 From: Sean Pinkney Date: Mon, 25 Mar 2024 05:56:25 -0400 Subject: [PATCH 06/10] include apply functor in wiener_5_lpdf --- stan/math/prim/prob/wiener5_lpdf.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/stan/math/prim/prob/wiener5_lpdf.hpp b/stan/math/prim/prob/wiener5_lpdf.hpp index 0414b59f60c..9a1081006c7 100644 --- a/stan/math/prim/prob/wiener5_lpdf.hpp +++ b/stan/math/prim/prob/wiener5_lpdf.hpp @@ -2,6 +2,7 @@ #define STAN_MATH_PRIM_PROB_WIENER5_LPDF_HPP #include +#include namespace stan { namespace math { From 38b69a520e62b355844f50765fd11f8149001dc9 Mon Sep 17 00:00:00 2001 From: Sean Pinkney Date: Mon, 25 Mar 2024 09:13:28 -0400 Subject: [PATCH 07/10] update runTests.py --- runTests.py | 8 ++++++++ test/unit/math/mix/constraint/lub_constrain_helpers.hpp | 4 ++-- .../constraint/offset_multiplier_constrain_helpers.hpp | 4 ++-- .../offset_multiplier_constrain_matvar_helpers.hpp | 4 ++-- 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/runTests.py b/runTests.py index 4bce225109b..e6adc86b84f 100755 --- a/runTests.py +++ b/runTests.py @@ -23,9 +23,12 @@ allowed_paths_with_jumbo = [ "test/unit/math/prim/", + "test/unit/math/prim/constraint", "test/unit/math/", "test/unit/math/rev/", + "test/unit/math/rev/constraint", "test/unit/math/fwd/", + "test/unit/math/fwd/constraint", "test/unit/math/mix/", "test/unit/math/mix/fun/", "test/unit/math/opencl/", @@ -33,18 +36,21 @@ ] jumbo_folders = [ + "test/unit/math/prim/constraint", "test/unit/math/prim/core", "test/unit/math/prim/err", "test/unit/math/prim/fun", "test/unit/math/prim/functor", "test/unit/math/prim/meta", "test/unit/math/prim/prob", + "test/unit/math/rev/constraint", "test/unit/math/rev/core", "test/unit/math/rev/err", "test/unit/math/rev/fun", "test/unit/math/rev/functor", "test/unit/math/rev/meta", "test/unit/math/rev/prob", + "test/unit/math/fwd/constraint", "test/unit/math/fwd/core", "test/unit/math/fwd/fun", "test/unit/math/fwd/functor", @@ -58,7 +64,9 @@ "test/unit/math/opencl/device_functions", "test/unit/math/opencl/kernel_generator", "test/unit/math/opencl/prim", + "test/unit/math/opencl/prim/constraint", "test/unit/math/opencl/rev", + "test/unit/math/opencl/rev/constraint", ] diff --git a/test/unit/math/mix/constraint/lub_constrain_helpers.hpp b/test/unit/math/mix/constraint/lub_constrain_helpers.hpp index c12c99fcc9e..52c2c7a85dc 100644 --- a/test/unit/math/mix/constraint/lub_constrain_helpers.hpp +++ b/test/unit/math/mix/constraint/lub_constrain_helpers.hpp @@ -1,5 +1,5 @@ -#ifndef STAN_TEST_UNIT_MATH_MIX_FUN_LUB_CONSTRAIN_HELPERS_HPP -#define STAN_TEST_UNIT_MATH_MIX_FUN_LUB_CONSTRAIN_HELPERS_HPP +#ifndef STAN_TEST_UNIT_MATH_MIX_CONSTRAINT_LUB_CONSTRAIN_HELPERS_HPP +#define STAN_TEST_UNIT_MATH_MIX_CONSTRAINT_LUB_CONSTRAIN_HELPERS_HPP namespace lub_constrain_tests { template diff --git a/test/unit/math/mix/constraint/offset_multiplier_constrain_helpers.hpp b/test/unit/math/mix/constraint/offset_multiplier_constrain_helpers.hpp index 7d28a595dda..1bce7e2a985 100644 --- a/test/unit/math/mix/constraint/offset_multiplier_constrain_helpers.hpp +++ b/test/unit/math/mix/constraint/offset_multiplier_constrain_helpers.hpp @@ -1,5 +1,5 @@ -#ifndef STAN_TEST_UNIT_MATH_MIX_FUN_offset_multiplier_CONSTRAIN_HELPERS_HPP -#define STAN_TEST_UNIT_MATH_MIX_FUN_offset_multiplier_CONSTRAIN_HELPERS_HPP +#ifndef STAN_TEST_UNIT_MATH_MIX_CONSTRAINT_OFFSET_MULTIPLIER_CONSTRAIN_HELPERS_HPP +#define STAN_TEST_UNIT_MATH_MIX_CONSTRAINT_OFFSET_MULTIPLIER_CONSTRAIN_HELPERS_HPP namespace offset_multiplier_constrain_tests { template diff --git a/test/unit/math/mix/constraint/offset_multiplier_constrain_matvar_helpers.hpp b/test/unit/math/mix/constraint/offset_multiplier_constrain_matvar_helpers.hpp index ecb5a50da82..f9c48bc7907 100644 --- a/test/unit/math/mix/constraint/offset_multiplier_constrain_matvar_helpers.hpp +++ b/test/unit/math/mix/constraint/offset_multiplier_constrain_matvar_helpers.hpp @@ -1,5 +1,5 @@ -#ifndef STAN_TEST_UNIT_MATH_MIX_FUN_OFFSET_MULTIPLIER_MAT_CONSTRAIN_HELPERS_HPP -#define STAN_TEST_UNIT_MATH_MIX_FUN_OFFSET_MULTIPLIER_MAT_CONSTRAIN_HELPERS_HPP +#ifndef STAN_TEST_UNIT_MATH_MIX_CONSTRAINT_OFFSET_MULTIPLIER_MAT_CONSTRAIN_HELPERS_HPP +#define STAN_TEST_UNIT_MATH_MIX_CONSTRAINT_OFFSET_MULTIPLIER_MAT_CONSTRAIN_HELPERS_HPP namespace offset_multiplier_constrain_tests { template From a7dfdb384cf8f5bc682898e2e558ee95618276bb Mon Sep 17 00:00:00 2001 From: Sean Pinkney Date: Mon, 25 Mar 2024 09:36:36 -0400 Subject: [PATCH 08/10] fix lint error --- .../mix/constraint/offset_multiplier_constrain_helpers.hpp | 4 ++-- .../constraint/offset_multiplier_constrain_matvar_helpers.hpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/unit/math/mix/constraint/offset_multiplier_constrain_helpers.hpp b/test/unit/math/mix/constraint/offset_multiplier_constrain_helpers.hpp index 1bce7e2a985..92f063e207c 100644 --- a/test/unit/math/mix/constraint/offset_multiplier_constrain_helpers.hpp +++ b/test/unit/math/mix/constraint/offset_multiplier_constrain_helpers.hpp @@ -1,5 +1,5 @@ -#ifndef STAN_TEST_UNIT_MATH_MIX_CONSTRAINT_OFFSET_MULTIPLIER_CONSTRAIN_HELPERS_HPP -#define STAN_TEST_UNIT_MATH_MIX_CONSTRAINT_OFFSET_MULTIPLIER_CONSTRAIN_HELPERS_HPP +#ifndef STAN_TEST_UNIT_MATH_MIX_OFFSET_MULTIPLIER_CONSTRAIN_HELPERS_HPP +#define STAN_TEST_UNIT_MATH_MIX_OFFSET_MULTIPLIER_CONSTRAIN_HELPERS_HPP namespace offset_multiplier_constrain_tests { template diff --git a/test/unit/math/mix/constraint/offset_multiplier_constrain_matvar_helpers.hpp b/test/unit/math/mix/constraint/offset_multiplier_constrain_matvar_helpers.hpp index f9c48bc7907..fc299d5dfb5 100644 --- a/test/unit/math/mix/constraint/offset_multiplier_constrain_matvar_helpers.hpp +++ b/test/unit/math/mix/constraint/offset_multiplier_constrain_matvar_helpers.hpp @@ -1,5 +1,5 @@ -#ifndef STAN_TEST_UNIT_MATH_MIX_CONSTRAINT_OFFSET_MULTIPLIER_MAT_CONSTRAIN_HELPERS_HPP -#define STAN_TEST_UNIT_MATH_MIX_CONSTRAINT_OFFSET_MULTIPLIER_MAT_CONSTRAIN_HELPERS_HPP +#ifndef STAN_TEST_UNIT_MATH_MIX_OFFSET_MULTIPLIER_MAT_CONSTRAIN_HELPERS_HPP +#define STAN_TEST_UNIT_MATH_MIX_OFFSET_MULTIPLIER_MAT_CONSTRAIN_HELPERS_HPP namespace offset_multiplier_constrain_tests { template From 7551da01468b51f51570a45ae8826fe6e00df777 Mon Sep 17 00:00:00 2001 From: Sean Pinkney Date: Mon, 25 Mar 2024 18:22:21 -0400 Subject: [PATCH 09/10] update --- stan/math/prim/constraint.hpp | 3 +++ stan/math/rev/constraint.hpp | 2 ++ 2 files changed, 5 insertions(+) diff --git a/stan/math/prim/constraint.hpp b/stan/math/prim/constraint.hpp index 9193ea3ddad..169fd8f2e31 100644 --- a/stan/math/prim/constraint.hpp +++ b/stan/math/prim/constraint.hpp @@ -1,5 +1,8 @@ #ifndef STAN_MATH_PRIM_CONSTRAINT_HPP #define STAN_MATH_PRIM_CONSTRAINT_HPP + +#include + #include #include #include diff --git a/stan/math/rev/constraint.hpp b/stan/math/rev/constraint.hpp index 9bebfdf9553..3ab4a6f72c7 100644 --- a/stan/math/rev/constraint.hpp +++ b/stan/math/rev/constraint.hpp @@ -1,6 +1,8 @@ #ifndef STAN_MATH_REV_CONSTRAINT_HPP #define STAN_MATH_REV_CONSTRAINT_HPP +#include + #include #include #include From e64496297cf25716b34a4b208fc4a61b1bb78378 Mon Sep 17 00:00:00 2001 From: Sean Pinkney Date: Tue, 26 Mar 2024 09:05:40 -0400 Subject: [PATCH 10/10] include log1p_exp in prim lub_constrain --- stan/math/prim/constraint/lub_constrain.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/stan/math/prim/constraint/lub_constrain.hpp b/stan/math/prim/constraint/lub_constrain.hpp index ea186fa240f..23b3369a5e7 100644 --- a/stan/math/prim/constraint/lub_constrain.hpp +++ b/stan/math/prim/constraint/lub_constrain.hpp @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include