66namespace stan {
77namespace math {
88
9+ namespace internal {
10+ // Placeholder RNG type: used whenever laplace_base_rng's
11+ // sampling branch is compiled out via `if constexpr`. In this case
12+ // no rng is needed as no sampling is performed.
13+ struct laplace_unused_rng {};
14+
15+ } // namespace internal
16+
917/* *
1018 * In a latent gaussian model,
1119 *
@@ -23,23 +31,24 @@ namespace math {
2331 * @param[in] hessian_block_size Block size for the Hessian approximation with
2432 * respect to the latent gaussian variable theta.
2533 * \laplace_options
26- * \rng_arg
2734 * \msg_arg
2835 */
2936template <typename LLFunc, typename LLArgs, typename CovarFun,
30- typename CovarArgs, typename RNG , typename OpsTuple>
37+ typename CovarArgs, typename OpsTuple>
3138inline auto laplace_latent_tol_solve (LLFunc&& ll_fun, LLArgs&& ll_args,
3239 int hessian_block_size,
3340 CovarFun&& covariance_function,
3441 CovarArgs&& covar_args, OpsTuple&& ops,
35- RNG & rng, std::ostream* msgs) {
42+ std::ostream* msgs) {
3643 auto options
3744 = internal::tuple_to_laplace_options (std::forward<OpsTuple>(ops));
3845 options.hessian_block_size = hessian_block_size;
39- return laplace_base_rng<true >(
40- std::forward<LLFunc>(ll_fun), std::forward<LLArgs>(ll_args),
41- std::forward<CovarFun>(covariance_function),
42- std::forward<CovarArgs>(covar_args), std::move (options), rng, msgs);
46+ internal::laplace_unused_rng unused_rng;
47+ return laplace_base_rng<true >(std::forward<LLFunc>(ll_fun),
48+ std::forward<LLArgs>(ll_args),
49+ std::forward<CovarFun>(covariance_function),
50+ std::forward<CovarArgs>(covar_args),
51+ std::move (options), unused_rng, msgs);
4352}
4453
4554/* *
@@ -59,21 +68,21 @@ inline auto laplace_latent_tol_solve(LLFunc&& ll_fun, LLArgs&& ll_args,
5968 * \laplace_common_args
6069 * @param[in] hessian_block_size Block size for the Hessian approximation with
6170 * respect to the latent gaussian variable theta.
62- * \rng_arg
6371 * \msg_arg
6472 */
6573template <typename LLFunc, typename LLArgs, typename CovarFun,
66- typename CovarArgs, typename RNG >
74+ typename CovarArgs>
6775inline auto laplace_latent_solve (LLFunc&& ll_fun, LLArgs&& ll_args,
6876 int hessian_block_size,
6977 CovarFun&& covariance_function,
70- CovarArgs&& covar_args, RNG & rng,
71- std::ostream* msgs) {
78+ CovarArgs&& covar_args, std::ostream* msgs) {
7279 auto options = laplace_options_default{hessian_block_size};
73- return laplace_base_rng<true >(
74- std::forward<LLFunc>(ll_fun), std::forward<LLArgs>(ll_args),
75- std::forward<CovarFun>(covariance_function),
76- std::forward<CovarArgs>(covar_args), std::move (options), rng, msgs);
80+ internal::laplace_unused_rng unused_rng;
81+ return laplace_base_rng<true >(std::forward<LLFunc>(ll_fun),
82+ std::forward<LLArgs>(ll_args),
83+ std::forward<CovarFun>(covariance_function),
84+ std::forward<CovarArgs>(covar_args),
85+ std::move (options), unused_rng, msgs);
7786}
7887
7988} // namespace math
0 commit comments