Skip to content

Commit 56b7a61

Browse files
committed
update header include order
1 parent cf84f77 commit 56b7a61

5 files changed

Lines changed: 38 additions & 21 deletions

File tree

stan/math/mix.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@
55
#include <stan/math/rev/core/Eigen_NumTraits.hpp>
66
#include <stan/math/prim/fun/Eigen.hpp>
77

8-
#include <stan/math/mix/meta.hpp>
9-
#include <stan/math/mix/fun.hpp>
10-
#include <stan/math/mix/functor.hpp>
118

129
#include <stan/math/rev/constraint.hpp>
1310
#include <stan/math/rev/core.hpp>
@@ -30,6 +27,9 @@
3027

3128
#include <stan/math/prim.hpp>
3229

30+
#include <stan/math/mix/meta.hpp>
31+
#include <stan/math/mix/fun.hpp>
32+
#include <stan/math/mix/functor.hpp>
3333
#include <stan/math/mix/prob.hpp>
3434

3535
#endif

stan/math/mix/functor/laplace_likelihood.hpp

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
11
#ifndef STAN_MATH_MIX_FUNCTOR_LAPLACE_LIKELIHOOD_HPP
22
#define STAN_MATH_MIX_FUNCTOR_LAPLACE_LIKELIHOOD_HPP
33

4-
#include <stan/math/mix/functor/hessian_block_diag.hpp>
5-
#include <stan/math/mix/functor/conditional_copy_and_promote.hpp>
4+
#include <stan/math/prim/fun/Eigen.hpp>
5+
#include <stan/math/rev/core.hpp>
6+
#include <stan/math/rev/meta.hpp>
7+
#include <stan/math/rev/fun/grad.hpp>
8+
#include <stan/math/prim/functor/conditional_copy_and_promote.hpp>
69
#include <stan/math/prim/functor/apply.hpp>
7-
#include <stan/math/prim/fun.hpp>
10+
#include <stan/math/mix/functor/hessian_block_diag.hpp>
11+
#include <stan/math/mix/functor/hessian_times_vector.hpp>
12+
13+
#include <tuple>
14+
#include <utility>
815

916
namespace stan {
1017
namespace math {
@@ -367,7 +374,7 @@ template <typename F, typename Theta, typename TupleArgs, typename Stream,
367374
require_tuple_t<TupleArgs>* = nullptr>
368375
inline auto theta_grad(F&& f, Theta&& theta, TupleArgs&& ll_tup,
369376
Stream* msgs = nullptr) {
370-
return apply(
377+
return stan::math::apply(
371378
[](auto&& f, auto&& theta, auto&& msgs, auto&&... args) {
372379
return internal::theta_grad(std::forward<decltype(f)>(f),
373380
std::forward<decltype(theta)>(theta), msgs,
@@ -382,7 +389,7 @@ template <typename F, typename Theta, typename TupleArgs, typename Stream,
382389
require_tuple_t<TupleArgs>* = nullptr>
383390
inline auto ll_arg_grad(F&& f, Theta&& theta, TupleArgs&& ll_tup,
384391
Stream* msgs = nullptr) {
385-
return apply(
392+
return stan::math::apply(
386393
[](auto&& f, auto&& theta, auto&& msgs, auto&&... args) {
387394
return internal::ll_arg_grad(std::forward<decltype(f)>(f),
388395
std::forward<decltype(theta)>(theta), msgs,
@@ -397,7 +404,7 @@ template <typename F, typename Theta, typename TupleArgs, typename Stream,
397404
require_tuple_t<TupleArgs>* = nullptr>
398405
inline auto diagonal_hessian(F&& f, Theta&& theta, TupleArgs&& ll_tuple,
399406
Stream* msgs) {
400-
return apply(
407+
return stan::math::apply(
401408
[](auto&& f, auto&& theta, auto* msgs, auto&&... args) {
402409
return internal::diagonal_hessian(
403410
std::forward<decltype(f)>(f), std::forward<decltype(theta)>(theta),
@@ -413,7 +420,7 @@ template <typename F, typename Theta, typename TupleArgs, typename Stream,
413420
inline auto block_hessian(F&& f, Theta&& theta,
414421
const Eigen::Index hessian_block_size,
415422
TupleArgs&& ll_tuple, Stream* msgs) {
416-
return apply(
423+
return stan::math::apply(
417424
[](auto&& f, auto&& theta, auto hessian_block_size, auto* msgs,
418425
auto&&... args) {
419426
return internal::block_hessian(
@@ -440,7 +447,7 @@ template <typename F, typename Theta, typename TupleArgs, typename Stream,
440447
require_tuple_t<TupleArgs>* = nullptr>
441448
inline auto log_likelihood(F&& f, Theta&& theta, TupleArgs&& ll_tup,
442449
Stream* msgs) {
443-
return apply(
450+
return stan::math::apply(
444451
[](auto&& f, auto&& theta, auto&& msgs, auto&&... args) {
445452
return internal::log_likelihood(
446453
std::forward<decltype(f)>(f), std::forward<decltype(theta)>(theta),
@@ -468,7 +475,7 @@ template <typename F, typename Theta, typename TupleArgs, typename Stream,
468475
require_tuple_t<TupleArgs>* = nullptr>
469476
inline auto diff(F&& f, Theta&& theta, const Eigen::Index hessian_block_size,
470477
TupleArgs&& ll_tuple, Stream* msgs) {
471-
return apply(
478+
return stan::math::apply(
472479
[](auto&& f, auto&& theta, auto hessian_block_size, auto* msgs,
473480
auto&&... args) {
474481
return internal::diff(
@@ -495,7 +502,7 @@ template <typename F, typename Theta, typename TupleArgs, typename Stream,
495502
require_tuple_t<TupleArgs>* = nullptr>
496503
inline Eigen::VectorXd third_diff(F&& f, Theta&& theta, TupleArgs&& ll_args,
497504
Stream* msgs) {
498-
return apply(
505+
return stan::math::apply(
499506
[](auto&& f, auto&& theta, auto&& msgs, auto&&... args) {
500507
return internal::third_diff(std::forward<decltype(f)>(f),
501508
std::forward<decltype(theta)>(theta), msgs,
@@ -525,7 +532,7 @@ template <typename F, typename Theta, typename AMat, typename TupleArgs,
525532
require_tuple_t<TupleArgs>* = nullptr>
526533
inline auto compute_s2(F&& f, Theta&& theta, AMat&& A, int hessian_block_size,
527534
TupleArgs&& ll_args, Stream* msgs) {
528-
return apply(
535+
return stan::math::apply(
529536
[](auto&& f, auto&& theta, auto&& A, auto hessian_block_size, auto* msgs,
530537
auto&&... args) {
531538
return internal::compute_s2(
@@ -556,7 +563,7 @@ template <typename F, typename V_t, typename Theta, typename TupleArgs,
556563
require_eigen_vector_t<Theta>* = nullptr>
557564
inline auto diff_eta_implicit(F&& f, V_t&& v, Theta&& theta,
558565
TupleArgs&& ll_args, Stream* msgs) {
559-
return apply(
566+
return stan::math::apply(
560567
[](auto&& f, auto&& v, auto&& theta, auto&& msgs, auto&&... args) {
561568
return internal::diff_eta_implicit(
562569
std::forward<decltype(f)>(f), std::forward<decltype(v)>(v),

stan/math/mix/functor/laplace_marginal_density.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#include <stan/math/prim/fun/Eigen.hpp>
44
#include <stan/math/mix/functor/laplace_likelihood.hpp>
55
#include <stan/math/mix/functor/laplace_marginal_density_estimator.hpp>
6-
#include <stan/math/mix/functor/conditional_copy_and_promote.hpp>
6+
#include <stan/math/prim/functor/conditional_copy_and_promote.hpp>
77
#include <stan/math/rev/meta.hpp>
88
#include <stan/math/rev/core.hpp>
99
#include <stan/math/rev/fun.hpp>

stan/math/prim/functor.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include <stan/math/prim/functor/apply_scalar_ternary.hpp>
88
#include <stan/math/prim/functor/apply_vector_unary.hpp>
99
#include <stan/math/prim/functor/coupled_ode_system.hpp>
10+
#include <stan/math/prim/functor/conditional_copy_and_promote.hpp>
1011
#include <stan/math/prim/functor/filter_map.hpp>
1112
#include <stan/math/prim/functor/finite_diff_gradient.hpp>
1213
#include <stan/math/prim/functor/finite_diff_gradient_auto.hpp>

stan/math/mix/functor/conditional_copy_and_promote.hpp renamed to stan/math/prim/functor/conditional_copy_and_promote.hpp

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,18 @@
1-
#ifndef STAN_MATH_MIX_FUNCTOR_CONDITIONAL_COPY_AND_PROMOTE_HPP
2-
#define STAN_MATH_MIX_FUNCTOR_CONDITIONAL_COPY_AND_PROMOTE_HPP
1+
#ifndef STAN_MATH_PRIM_FUNCTOR_CONDITIONAL_COPY_AND_PROMOTE_HPP
2+
#define STAN_MATH_PRIM_FUNCTOR_CONDITIONAL_COPY_AND_PROMOTE_HPP
33

4-
#include <stan/math/mix/functor/hessian_block_diag.hpp>
4+
#include <stan/math/prim/functor/apply.hpp>
55
#include <stan/math/prim/functor/map_if.hpp>
6-
#include <stan/math/prim/fun.hpp>
6+
#include <stan/math/prim/functor/make_holder_tuple.hpp>
7+
#include <stan/math/prim/fun/eval.hpp>
8+
#include <stan/math/prim/fun/promote_scalar.hpp>
9+
#include <stan/math/prim/fun/value_of_rec.hpp>
10+
#include <stan/math/prim/meta/is_tuple.hpp>
11+
#include <stan/math/prim/meta/is_var.hpp>
12+
#include <stan/math/prim/meta/is_vector.hpp>
13+
#include <stan/math/prim/meta/scalar_type.hpp>
14+
#include <utility>
15+
#include <vector>
716

817
namespace stan::math::internal {
918

@@ -26,7 +35,7 @@ enum class COPY_TYPE : uint8_t { SHALLOW = 0, DEEP = 1 };
2635
* argument or a promoted copy of the argument.
2736
*/
2837
template <template <typename...> class Filter,
29-
typename PromotedType = stan::math::var,
38+
typename PromotedType = double,
3039
COPY_TYPE CopyType = COPY_TYPE::DEEP, typename... Args>
3140
inline auto conditional_copy_and_promote(Args&&... args) {
3241
return map_if<Filter>(

0 commit comments

Comments
 (0)