├── .Rbuildignore ├── .github ├── .gitignore └── workflows │ └── R-CMD-check.yaml ├── .gitignore ├── DESCRIPTION ├── LICENSE ├── LICENSE.md ├── NAMESPACE ├── R ├── StanEstimators-package.R ├── aaa.R ├── cpp_exports.R ├── diagnose.R ├── laplace.R ├── model_methods.R ├── optimize.R ├── pathfinder.R ├── sample.R ├── util.R └── variational.R ├── README.Rmd ├── README.md ├── StanEstimators.Rproj ├── inst ├── include │ ├── cmdstan │ │ ├── arguments │ │ │ ├── arg_adapt.hpp │ │ │ ├── arg_bfgs.hpp │ │ │ ├── arg_data.hpp │ │ │ ├── arg_data_file.hpp │ │ │ ├── arg_dense_e.hpp │ │ │ ├── arg_diag_e.hpp │ │ │ ├── arg_diagnose.hpp │ │ │ ├── arg_diagnostic_file.hpp │ │ │ ├── arg_engine.hpp │ │ │ ├── arg_fail.hpp │ │ │ ├── arg_fixed_param.hpp │ │ │ ├── arg_generate_quantities.hpp │ │ │ ├── arg_generate_quantities_fitted_params.hpp │ │ │ ├── arg_history_size.hpp │ │ │ ├── arg_hmc.hpp │ │ │ ├── arg_id.hpp │ │ │ ├── arg_init.hpp │ │ │ ├── arg_laplace.hpp │ │ │ ├── arg_lbfgs.hpp │ │ │ ├── arg_log_prob.hpp │ │ │ ├── arg_log_prob_constrained_params.hpp │ │ │ ├── arg_log_prob_unconstrained_params.hpp │ │ │ ├── arg_method.hpp │ │ │ ├── arg_metric.hpp │ │ │ ├── arg_newton.hpp │ │ │ ├── arg_num_samples.hpp │ │ │ ├── arg_num_threads.hpp │ │ │ ├── arg_num_warmup.hpp │ │ │ ├── arg_nuts.hpp │ │ │ ├── arg_opencl.hpp │ │ │ ├── arg_opencl_device.hpp │ │ │ ├── arg_opencl_platform.hpp │ │ │ ├── arg_optimize.hpp │ │ │ ├── arg_optimize_algo.hpp │ │ │ ├── arg_output.hpp │ │ │ ├── arg_output_file.hpp │ │ │ ├── arg_output_sig_figs.hpp │ │ │ ├── arg_pathfinder.hpp │ │ │ ├── arg_profile_file.hpp │ │ │ ├── arg_random.hpp │ │ │ ├── arg_refresh.hpp │ │ │ ├── arg_rwm.hpp │ │ │ ├── arg_sample.hpp │ │ │ ├── arg_sample_algo.hpp │ │ │ ├── arg_seed.hpp │ │ │ ├── arg_single_bool.hpp │ │ │ ├── arg_single_int_nonneg.hpp │ │ │ ├── arg_single_int_pos.hpp │ │ │ ├── arg_single_real_bounded.hpp │ │ │ ├── arg_single_real_pos.hpp │ │ │ ├── arg_single_string.hpp │ │ │ ├── arg_single_u_int.hpp │ │ │ ├── arg_softabs.hpp │ │ │ ├── arg_softabs_alpha.hpp │ │ │ ├── arg_static.hpp │ │ │ ├── arg_test.hpp │ │ │ ├── arg_test_grad_eps.hpp │ │ │ ├── arg_test_grad_err.hpp │ │ │ ├── arg_test_gradient.hpp │ │ │ ├── arg_thin.hpp │ │ │ ├── arg_unit_e.hpp │ │ │ ├── arg_variational.hpp │ │ │ ├── arg_variational_adapt.hpp │ │ │ ├── arg_variational_algo.hpp │ │ │ ├── arg_variational_fullrank.hpp │ │ │ ├── arg_variational_meanfield.hpp │ │ │ ├── arg_x_delta.hpp │ │ │ ├── argument.hpp │ │ │ ├── argument_parser.hpp │ │ │ ├── categorical_argument.hpp │ │ │ ├── list_argument.hpp │ │ │ ├── singleton_argument.hpp │ │ │ ├── unvalued_argument.hpp │ │ │ └── valued_argument.hpp │ │ ├── command.hpp │ │ ├── command_helper.hpp │ │ ├── diagnose.cpp │ │ ├── file.hpp │ │ ├── main.cpp │ │ ├── print.cpp │ │ ├── print_helper.hpp │ │ ├── return_codes.hpp │ │ ├── stansummary.cpp │ │ ├── stansummary_helper.hpp │ │ ├── version.hpp │ │ ├── write_config.hpp │ │ ├── write_datetime.hpp │ │ ├── write_model.hpp │ │ ├── write_model_compile_info.hpp │ │ ├── write_opencl_device.hpp │ │ ├── write_parallel_info.hpp │ │ ├── write_profiling.hpp │ │ ├── write_stan.hpp │ │ └── write_stan_flags.hpp │ ├── cvodes │ │ ├── cvodes.h │ │ ├── cvodes_bandpre.h │ │ ├── cvodes_bbdpre.h │ │ ├── cvodes_diag.h │ │ ├── cvodes_direct.h │ │ ├── cvodes_ls.h │ │ └── cvodes_spils.h │ ├── estimator │ │ ├── estimator.hpp │ │ ├── estimator.stan │ │ └── estimator_ext_header.hpp │ ├── idas │ │ ├── idas.h │ │ ├── idas_bbdpre.h │ │ ├── idas_direct.h │ │ ├── idas_ls.h │ │ └── idas_spils.h │ ├── kinsol │ │ ├── kinsol.h │ │ ├── kinsol_bbdpre.h │ │ ├── kinsol_direct.h │ │ ├── kinsol_ls.h │ │ └── kinsol_spils.h │ ├── nvector │ │ ├── nvector_cuda.h │ │ ├── nvector_hip.h │ │ ├── nvector_manyvector.h │ │ ├── nvector_mpimanyvector.h │ │ ├── nvector_mpiplusx.h │ │ ├── nvector_openmp.h │ │ ├── nvector_openmpdev.h │ │ ├── nvector_parallel.h │ │ ├── nvector_parhyp.h │ │ ├── nvector_petsc.h │ │ ├── nvector_pthreads.h │ │ ├── nvector_raja.h │ │ ├── nvector_serial.h │ │ ├── nvector_sycl.h │ │ ├── nvector_trilinos.h │ │ └── trilinos │ │ │ ├── SundialsTpetraVectorInterface.hpp │ │ │ └── SundialsTpetraVectorKernels.hpp │ ├── stan │ │ ├── analyze │ │ │ └── mcmc │ │ │ │ ├── autocovariance.hpp │ │ │ │ ├── compute_effective_sample_size.hpp │ │ │ │ ├── compute_potential_scale_reduction.hpp │ │ │ │ └── split_chains.hpp │ │ ├── callbacks │ │ │ ├── interrupt.hpp │ │ │ ├── json_writer.hpp │ │ │ ├── logger.hpp │ │ │ ├── stream_logger.hpp │ │ │ ├── stream_writer.hpp │ │ │ ├── structured_writer.hpp │ │ │ ├── tee_writer.hpp │ │ │ ├── unique_stream_writer.hpp │ │ │ └── writer.hpp │ │ ├── io │ │ │ ├── array_var_context.hpp │ │ │ ├── chained_var_context.hpp │ │ │ ├── deserializer.hpp │ │ │ ├── dump.hpp │ │ │ ├── empty_var_context.hpp │ │ │ ├── ends_with.hpp │ │ │ ├── json │ │ │ │ ├── json_data.hpp │ │ │ │ ├── json_data_handler.hpp │ │ │ │ ├── json_error.hpp │ │ │ │ ├── json_handler.hpp │ │ │ │ └── rapidjson_parser.hpp │ │ │ ├── random_var_context.hpp │ │ │ ├── serializer.hpp │ │ │ ├── stan_csv_reader.hpp │ │ │ ├── validate_dims.hpp │ │ │ ├── validate_zero_buf.hpp │ │ │ └── var_context.hpp │ │ ├── lang │ │ │ └── rethrow_located.hpp │ │ ├── math.hpp │ │ ├── math │ │ │ ├── fwd.hpp │ │ │ ├── fwd │ │ │ │ ├── core.hpp │ │ │ │ ├── core │ │ │ │ │ ├── fvar.hpp │ │ │ │ │ ├── operator_addition.hpp │ │ │ │ │ ├── operator_division.hpp │ │ │ │ │ ├── operator_equal.hpp │ │ │ │ │ ├── operator_greater_than.hpp │ │ │ │ │ ├── operator_greater_than_or_equal.hpp │ │ │ │ │ ├── operator_less_than.hpp │ │ │ │ │ ├── operator_less_than_or_equal.hpp │ │ │ │ │ ├── operator_logical_and.hpp │ │ │ │ │ ├── operator_logical_or.hpp │ │ │ │ │ ├── operator_multiplication.hpp │ │ │ │ │ ├── operator_not_equal.hpp │ │ │ │ │ ├── operator_subtraction.hpp │ │ │ │ │ ├── operator_unary_minus.hpp │ │ │ │ │ ├── operator_unary_not.hpp │ │ │ │ │ ├── operator_unary_plus.hpp │ │ │ │ │ ├── std_complex.hpp │ │ │ │ │ ├── std_iterator_traits.hpp │ │ │ │ │ └── std_numeric_limits.hpp │ │ │ │ ├── fun.hpp │ │ │ │ ├── fun │ │ │ │ │ ├── Eigen_NumTraits.hpp │ │ │ │ │ ├── Phi.hpp │ │ │ │ │ ├── Phi_approx.hpp │ │ │ │ │ ├── abs.hpp │ │ │ │ │ ├── accumulator.hpp │ │ │ │ │ ├── acos.hpp │ │ │ │ │ ├── acosh.hpp │ │ │ │ │ ├── arg.hpp │ │ │ │ │ ├── asin.hpp │ │ │ │ │ ├── asinh.hpp │ │ │ │ │ ├── atan.hpp │ │ │ │ │ ├── atan2.hpp │ │ │ │ │ ├── atanh.hpp │ │ │ │ │ ├── bessel_first_kind.hpp │ │ │ │ │ ├── bessel_second_kind.hpp │ │ │ │ │ ├── beta.hpp │ │ │ │ │ ├── binary_log_loss.hpp │ │ │ │ │ ├── cbrt.hpp │ │ │ │ │ ├── ceil.hpp │ │ │ │ │ ├── conj.hpp │ │ │ │ │ ├── cos.hpp │ │ │ │ │ ├── cosh.hpp │ │ │ │ │ ├── determinant.hpp │ │ │ │ │ ├── digamma.hpp │ │ │ │ │ ├── erf.hpp │ │ │ │ │ ├── erfc.hpp │ │ │ │ │ ├── exp.hpp │ │ │ │ │ ├── exp2.hpp │ │ │ │ │ ├── expm1.hpp │ │ │ │ │ ├── fabs.hpp │ │ │ │ │ ├── falling_factorial.hpp │ │ │ │ │ ├── fdim.hpp │ │ │ │ │ ├── floor.hpp │ │ │ │ │ ├── fma.hpp │ │ │ │ │ ├── fmax.hpp │ │ │ │ │ ├── fmin.hpp │ │ │ │ │ ├── fmod.hpp │ │ │ │ │ ├── gamma_p.hpp │ │ │ │ │ ├── gamma_q.hpp │ │ │ │ │ ├── grad_inc_beta.hpp │ │ │ │ │ ├── hypergeometric_1F0.hpp │ │ │ │ │ ├── hypergeometric_2F1.hpp │ │ │ │ │ ├── hypergeometric_pFq.hpp │ │ │ │ │ ├── hypot.hpp │ │ │ │ │ ├── inc_beta.hpp │ │ │ │ │ ├── inv.hpp │ │ │ │ │ ├── inv_Phi.hpp │ │ │ │ │ ├── inv_cloglog.hpp │ │ │ │ │ ├── inv_erfc.hpp │ │ │ │ │ ├── inv_inc_beta.hpp │ │ │ │ │ ├── inv_logit.hpp │ │ │ │ │ ├── inv_sqrt.hpp │ │ │ │ │ ├── inv_square.hpp │ │ │ │ │ ├── inverse.hpp │ │ │ │ │ ├── is_inf.hpp │ │ │ │ │ ├── is_nan.hpp │ │ │ │ │ ├── lambert_w.hpp │ │ │ │ │ ├── lbeta.hpp │ │ │ │ │ ├── ldexp.hpp │ │ │ │ │ ├── lgamma.hpp │ │ │ │ │ ├── lmgamma.hpp │ │ │ │ │ ├── lmultiply.hpp │ │ │ │ │ ├── log.hpp │ │ │ │ │ ├── log10.hpp │ │ │ │ │ ├── log1m.hpp │ │ │ │ │ ├── log1m_exp.hpp │ │ │ │ │ ├── log1m_inv_logit.hpp │ │ │ │ │ ├── log1p.hpp │ │ │ │ │ ├── log1p_exp.hpp │ │ │ │ │ ├── log2.hpp │ │ │ │ │ ├── log_determinant.hpp │ │ │ │ │ ├── log_diff_exp.hpp │ │ │ │ │ ├── log_falling_factorial.hpp │ │ │ │ │ ├── log_inv_logit.hpp │ │ │ │ │ ├── log_inv_logit_diff.hpp │ │ │ │ │ ├── log_mix.hpp │ │ │ │ │ ├── log_rising_factorial.hpp │ │ │ │ │ ├── log_softmax.hpp │ │ │ │ │ ├── log_sum_exp.hpp │ │ │ │ │ ├── logit.hpp │ │ │ │ │ ├── mdivide_left.hpp │ │ │ │ │ ├── mdivide_left_ldlt.hpp │ │ │ │ │ ├── mdivide_left_tri_low.hpp │ │ │ │ │ ├── mdivide_right.hpp │ │ │ │ │ ├── mdivide_right_tri_low.hpp │ │ │ │ │ ├── modified_bessel_first_kind.hpp │ │ │ │ │ ├── modified_bessel_second_kind.hpp │ │ │ │ │ ├── multiply.hpp │ │ │ │ │ ├── multiply_log.hpp │ │ │ │ │ ├── multiply_lower_tri_self_transpose.hpp │ │ │ │ │ ├── norm.hpp │ │ │ │ │ ├── norm1.hpp │ │ │ │ │ ├── norm2.hpp │ │ │ │ │ ├── owens_t.hpp │ │ │ │ │ ├── polar.hpp │ │ │ │ │ ├── pow.hpp │ │ │ │ │ ├── primitive_value.hpp │ │ │ │ │ ├── proj.hpp │ │ │ │ │ ├── quad_form.hpp │ │ │ │ │ ├── quad_form_sym.hpp │ │ │ │ │ ├── read_fvar.hpp │ │ │ │ │ ├── rising_factorial.hpp │ │ │ │ │ ├── round.hpp │ │ │ │ │ ├── sin.hpp │ │ │ │ │ ├── sinh.hpp │ │ │ │ │ ├── softmax.hpp │ │ │ │ │ ├── sqrt.hpp │ │ │ │ │ ├── square.hpp │ │ │ │ │ ├── sum.hpp │ │ │ │ │ ├── tan.hpp │ │ │ │ │ ├── tanh.hpp │ │ │ │ │ ├── tcrossprod.hpp │ │ │ │ │ ├── tgamma.hpp │ │ │ │ │ ├── to_fvar.hpp │ │ │ │ │ ├── trace_quad_form.hpp │ │ │ │ │ ├── trigamma.hpp │ │ │ │ │ ├── trunc.hpp │ │ │ │ │ ├── typedefs.hpp │ │ │ │ │ ├── unit_vector_constrain.hpp │ │ │ │ │ ├── value_of.hpp │ │ │ │ │ └── value_of_rec.hpp │ │ │ │ ├── functor.hpp │ │ │ │ ├── functor │ │ │ │ │ ├── apply_scalar_unary.hpp │ │ │ │ │ ├── finite_diff.hpp │ │ │ │ │ ├── gradient.hpp │ │ │ │ │ ├── hessian.hpp │ │ │ │ │ ├── integrate_1d.hpp │ │ │ │ │ ├── jacobian.hpp │ │ │ │ │ ├── operands_and_partials.hpp │ │ │ │ │ ├── partials_propagator.hpp │ │ │ │ │ └── reduce_sum.hpp │ │ │ │ ├── meta.hpp │ │ │ │ ├── meta │ │ │ │ │ ├── is_fvar.hpp │ │ │ │ │ └── partials_type.hpp │ │ │ │ ├── prob.hpp │ │ │ │ └── prob │ │ │ │ │ └── std_normal_log_qf.hpp │ │ │ ├── memory │ │ │ │ └── stack_alloc.hpp │ │ │ ├── mix.hpp │ │ │ ├── mix │ │ │ │ ├── fun.hpp │ │ │ │ ├── fun │ │ │ │ │ └── typedefs.hpp │ │ │ │ ├── functor.hpp │ │ │ │ ├── functor │ │ │ │ │ ├── derivative.hpp │ │ │ │ │ ├── finite_diff_grad_hessian.hpp │ │ │ │ │ ├── finite_diff_grad_hessian_auto.hpp │ │ │ │ │ ├── grad_hessian.hpp │ │ │ │ │ ├── grad_tr_mat_times_hessian.hpp │ │ │ │ │ ├── gradient_dot_vector.hpp │ │ │ │ │ ├── hessian.hpp │ │ │ │ │ ├── hessian_times_vector.hpp │ │ │ │ │ └── partial_derivative.hpp │ │ │ │ └── meta.hpp │ │ │ ├── opencl │ │ │ │ ├── buffer_types.hpp │ │ │ │ ├── cholesky_decompose.hpp │ │ │ │ ├── copy.hpp │ │ │ │ ├── double_d.hpp │ │ │ │ ├── err.hpp │ │ │ │ ├── err │ │ │ │ │ ├── check_mat_size_one.hpp │ │ │ │ │ ├── check_opencl.hpp │ │ │ │ │ ├── check_symmetric.hpp │ │ │ │ │ └── check_triangular.hpp │ │ │ │ ├── indexing_rev.hpp │ │ │ │ ├── is_constant.hpp │ │ │ │ ├── kernel_cl.hpp │ │ │ │ ├── kernel_generator.hpp │ │ │ │ ├── kernel_generator │ │ │ │ │ ├── append.hpp │ │ │ │ │ ├── as_column_vector_or_scalar.hpp │ │ │ │ │ ├── as_operation_cl.hpp │ │ │ │ │ ├── assignment_ops.hpp │ │ │ │ │ ├── binary_operation.hpp │ │ │ │ │ ├── block_zero_based.hpp │ │ │ │ │ ├── broadcast.hpp │ │ │ │ │ ├── calc_if.hpp │ │ │ │ │ ├── cast.hpp │ │ │ │ │ ├── check_cl.hpp │ │ │ │ │ ├── colwise_reduction.hpp │ │ │ │ │ ├── common_return_scalar.hpp │ │ │ │ │ ├── compound_assignments.hpp │ │ │ │ │ ├── constant.hpp │ │ │ │ │ ├── diagonal.hpp │ │ │ │ │ ├── elt_function_cl.hpp │ │ │ │ │ ├── evaluate_into.hpp │ │ │ │ │ ├── get_kernel_source_for_evaluating.hpp │ │ │ │ │ ├── holder_cl.hpp │ │ │ │ │ ├── index.hpp │ │ │ │ │ ├── indexing.hpp │ │ │ │ │ ├── load.hpp │ │ │ │ │ ├── matrix_cl_conversion.hpp │ │ │ │ │ ├── matrix_vector_multiply.hpp │ │ │ │ │ ├── multi_result_kernel.hpp │ │ │ │ │ ├── name_generator.hpp │ │ │ │ │ ├── opencl_code.hpp │ │ │ │ │ ├── operation_cl.hpp │ │ │ │ │ ├── operation_cl_lhs.hpp │ │ │ │ │ ├── optional_broadcast.hpp │ │ │ │ │ ├── reduction_2d.hpp │ │ │ │ │ ├── rowwise_reduction.hpp │ │ │ │ │ ├── scalar.hpp │ │ │ │ │ ├── select.hpp │ │ │ │ │ ├── transpose.hpp │ │ │ │ │ ├── type_str.hpp │ │ │ │ │ └── unary_operation_cl.hpp │ │ │ │ ├── kernels │ │ │ │ │ ├── add.hpp │ │ │ │ │ ├── batch_identity.hpp │ │ │ │ │ ├── categorical_logit_glm_lpmf.hpp │ │ │ │ │ ├── check_symmetric.hpp │ │ │ │ │ ├── cholesky_decompose.hpp │ │ │ │ │ ├── cumulative_sum.hpp │ │ │ │ │ ├── device_functions │ │ │ │ │ │ ├── Phi.hpp │ │ │ │ │ │ ├── Phi_approx.hpp │ │ │ │ │ │ ├── atomic_add_double.hpp │ │ │ │ │ │ ├── beta.hpp │ │ │ │ │ │ ├── binomial_coefficient_log.hpp │ │ │ │ │ │ ├── digamma.hpp │ │ │ │ │ │ ├── inv_Phi.hpp │ │ │ │ │ │ ├── inv_logit.hpp │ │ │ │ │ │ ├── inv_square.hpp │ │ │ │ │ │ ├── lbeta.hpp │ │ │ │ │ │ ├── lgamma_stirling.hpp │ │ │ │ │ │ ├── lgamma_stirling_diff.hpp │ │ │ │ │ │ ├── lmultiply.hpp │ │ │ │ │ │ ├── log1m.hpp │ │ │ │ │ │ ├── log1m_exp.hpp │ │ │ │ │ │ ├── log1m_inv_logit.hpp │ │ │ │ │ │ ├── log1p_exp.hpp │ │ │ │ │ │ ├── log_diff_exp.hpp │ │ │ │ │ │ ├── log_inv_logit.hpp │ │ │ │ │ │ ├── log_inv_logit_diff.hpp │ │ │ │ │ │ ├── logit.hpp │ │ │ │ │ │ ├── multiply_log.hpp │ │ │ │ │ │ └── trigamma.hpp │ │ │ │ │ ├── diag_inv.hpp │ │ │ │ │ ├── divide_columns.hpp │ │ │ │ │ ├── fill_strict_tri.hpp │ │ │ │ │ ├── gp_exp_quad_cov.hpp │ │ │ │ │ ├── gp_exponential_cov.hpp │ │ │ │ │ ├── gp_matern32_cov.hpp │ │ │ │ │ ├── gp_matern52_cov.hpp │ │ │ │ │ ├── helpers.hpp │ │ │ │ │ ├── indexing_rev.hpp │ │ │ │ │ ├── inv_lower_tri_multiply.hpp │ │ │ │ │ ├── matrix_multiply.hpp │ │ │ │ │ ├── mergesort.hpp │ │ │ │ │ ├── mrrr.hpp │ │ │ │ │ ├── multiply_transpose.hpp │ │ │ │ │ ├── neg_binomial_2_log_glm_lpmf.hpp │ │ │ │ │ ├── neg_rect_lower_tri_multiply.hpp │ │ │ │ │ ├── ordered_logistic_glm_lpmf.hpp │ │ │ │ │ ├── ordered_logistic_lpmf.hpp │ │ │ │ │ ├── pack.hpp │ │ │ │ │ ├── rep_matrix.hpp │ │ │ │ │ ├── tridiagonalization.hpp │ │ │ │ │ └── unpack.hpp │ │ │ │ ├── matrix_cl.hpp │ │ │ │ ├── matrix_cl_view.hpp │ │ │ │ ├── mrrr.hpp │ │ │ │ ├── multiply_transpose.hpp │ │ │ │ ├── opencl_context.hpp │ │ │ │ ├── pinned_matrix.hpp │ │ │ │ ├── plain_type.hpp │ │ │ │ ├── prim.hpp │ │ │ │ ├── prim │ │ │ │ │ ├── add_diag.hpp │ │ │ │ │ ├── append_array.hpp │ │ │ │ │ ├── bernoulli_cdf.hpp │ │ │ │ │ ├── bernoulli_lccdf.hpp │ │ │ │ │ ├── bernoulli_lcdf.hpp │ │ │ │ │ ├── bernoulli_logit_glm_lpmf.hpp │ │ │ │ │ ├── bernoulli_logit_lpmf.hpp │ │ │ │ │ ├── bernoulli_lpmf.hpp │ │ │ │ │ ├── beta_binomial_lpmf.hpp │ │ │ │ │ ├── beta_lpdf.hpp │ │ │ │ │ ├── beta_proportion_lpdf.hpp │ │ │ │ │ ├── binomial_logit_glm_lpmf.hpp │ │ │ │ │ ├── binomial_logit_lpmf.hpp │ │ │ │ │ ├── binomial_lpmf.hpp │ │ │ │ │ ├── block.hpp │ │ │ │ │ ├── categorical_logit_glm_lpmf.hpp │ │ │ │ │ ├── cauchy_cdf.hpp │ │ │ │ │ ├── cauchy_lccdf.hpp │ │ │ │ │ ├── cauchy_lcdf.hpp │ │ │ │ │ ├── cauchy_lpdf.hpp │ │ │ │ │ ├── chi_square_lpdf.hpp │ │ │ │ │ ├── cholesky_decompose.hpp │ │ │ │ │ ├── col.hpp │ │ │ │ │ ├── cols.hpp │ │ │ │ │ ├── columns_dot_product.hpp │ │ │ │ │ ├── columns_dot_self.hpp │ │ │ │ │ ├── crossprod.hpp │ │ │ │ │ ├── cumulative_sum.hpp │ │ │ │ │ ├── diag_matrix.hpp │ │ │ │ │ ├── diag_post_multiply.hpp │ │ │ │ │ ├── diag_pre_multiply.hpp │ │ │ │ │ ├── dims.hpp │ │ │ │ │ ├── dirichlet_lpdf.hpp │ │ │ │ │ ├── distance.hpp │ │ │ │ │ ├── divide.hpp │ │ │ │ │ ├── divide_columns.hpp │ │ │ │ │ ├── dot_product.hpp │ │ │ │ │ ├── dot_self.hpp │ │ │ │ │ ├── double_exponential_cdf.hpp │ │ │ │ │ ├── double_exponential_lccdf.hpp │ │ │ │ │ ├── double_exponential_lcdf.hpp │ │ │ │ │ ├── double_exponential_lpdf.hpp │ │ │ │ │ ├── eigenvalues_sym.hpp │ │ │ │ │ ├── eigenvectors_sym.hpp │ │ │ │ │ ├── exp_mod_normal_cdf.hpp │ │ │ │ │ ├── exp_mod_normal_lccdf.hpp │ │ │ │ │ ├── exp_mod_normal_lcdf.hpp │ │ │ │ │ ├── exp_mod_normal_lpdf.hpp │ │ │ │ │ ├── exponential_cdf.hpp │ │ │ │ │ ├── exponential_lccdf.hpp │ │ │ │ │ ├── exponential_lcdf.hpp │ │ │ │ │ ├── exponential_lpdf.hpp │ │ │ │ │ ├── frechet_cdf.hpp │ │ │ │ │ ├── frechet_lccdf.hpp │ │ │ │ │ ├── frechet_lcdf.hpp │ │ │ │ │ ├── frechet_lpdf.hpp │ │ │ │ │ ├── gamma_lpdf.hpp │ │ │ │ │ ├── gp_dot_prod_cov.hpp │ │ │ │ │ ├── gp_exp_quad_cov.hpp │ │ │ │ │ ├── gp_exponential_cov.hpp │ │ │ │ │ ├── gp_matern32_cov.hpp │ │ │ │ │ ├── gp_matern52_cov.hpp │ │ │ │ │ ├── gumbel_cdf.hpp │ │ │ │ │ ├── gumbel_lccdf.hpp │ │ │ │ │ ├── gumbel_lcdf.hpp │ │ │ │ │ ├── gumbel_lpdf.hpp │ │ │ │ │ ├── head.hpp │ │ │ │ │ ├── identity_matrix.hpp │ │ │ │ │ ├── inv.hpp │ │ │ │ │ ├── inv_chi_square_lpdf.hpp │ │ │ │ │ ├── inv_cloglog.hpp │ │ │ │ │ ├── inv_gamma_lpdf.hpp │ │ │ │ │ ├── inv_sqrt.hpp │ │ │ │ │ ├── lb_constrain.hpp │ │ │ │ │ ├── log_mix.hpp │ │ │ │ │ ├── log_softmax.hpp │ │ │ │ │ ├── log_sum_exp.hpp │ │ │ │ │ ├── logistic_cdf.hpp │ │ │ │ │ ├── logistic_lccdf.hpp │ │ │ │ │ ├── logistic_lcdf.hpp │ │ │ │ │ ├── logistic_lpdf.hpp │ │ │ │ │ ├── lognormal_cdf.hpp │ │ │ │ │ ├── lognormal_lccdf.hpp │ │ │ │ │ ├── lognormal_lcdf.hpp │ │ │ │ │ ├── lognormal_lpdf.hpp │ │ │ │ │ ├── lub_constrain.hpp │ │ │ │ │ ├── matrix_power.hpp │ │ │ │ │ ├── mdivide_left_tri_low.hpp │ │ │ │ │ ├── mdivide_right_tri_low.hpp │ │ │ │ │ ├── mean.hpp │ │ │ │ │ ├── multi_normal_cholesky_lpdf.hpp │ │ │ │ │ ├── multiply.hpp │ │ │ │ │ ├── multiply_lower_tri_self_transpose.hpp │ │ │ │ │ ├── neg_binomial_2_log_glm_lpmf.hpp │ │ │ │ │ ├── neg_binomial_2_log_lpmf.hpp │ │ │ │ │ ├── neg_binomial_2_lpmf.hpp │ │ │ │ │ ├── neg_binomial_lpmf.hpp │ │ │ │ │ ├── normal_cdf.hpp │ │ │ │ │ ├── normal_id_glm_lpdf.hpp │ │ │ │ │ ├── normal_lccdf.hpp │ │ │ │ │ ├── normal_lcdf.hpp │ │ │ │ │ ├── normal_lpdf.hpp │ │ │ │ │ ├── num_elements.hpp │ │ │ │ │ ├── offset_multiplier_constrain.hpp │ │ │ │ │ ├── ordered_logistic_glm_lpmf.hpp │ │ │ │ │ ├── ordered_logistic_lpmf.hpp │ │ │ │ │ ├── pareto_cdf.hpp │ │ │ │ │ ├── pareto_lccdf.hpp │ │ │ │ │ ├── pareto_lcdf.hpp │ │ │ │ │ ├── pareto_lpdf.hpp │ │ │ │ │ ├── pareto_type_2_cdf.hpp │ │ │ │ │ ├── pareto_type_2_lccdf.hpp │ │ │ │ │ ├── pareto_type_2_lcdf.hpp │ │ │ │ │ ├── pareto_type_2_lpdf.hpp │ │ │ │ │ ├── poisson_log_glm_lpmf.hpp │ │ │ │ │ ├── poisson_log_lpmf.hpp │ │ │ │ │ ├── poisson_lpmf.hpp │ │ │ │ │ ├── prod.hpp │ │ │ │ │ ├── qr_Q.hpp │ │ │ │ │ ├── qr_R.hpp │ │ │ │ │ ├── qr_thin_Q.hpp │ │ │ │ │ ├── qr_thin_R.hpp │ │ │ │ │ ├── rank.hpp │ │ │ │ │ ├── rayleigh_cdf.hpp │ │ │ │ │ ├── rayleigh_lccdf.hpp │ │ │ │ │ ├── rayleigh_lcdf.hpp │ │ │ │ │ ├── rayleigh_lpdf.hpp │ │ │ │ │ ├── rep_array.hpp │ │ │ │ │ ├── rep_matrix.hpp │ │ │ │ │ ├── rep_row_vector.hpp │ │ │ │ │ ├── rep_vector.hpp │ │ │ │ │ ├── reverse.hpp │ │ │ │ │ ├── row.hpp │ │ │ │ │ ├── rows.hpp │ │ │ │ │ ├── rows_dot_product.hpp │ │ │ │ │ ├── rows_dot_self.hpp │ │ │ │ │ ├── scaled_inv_chi_square_lpdf.hpp │ │ │ │ │ ├── sd.hpp │ │ │ │ │ ├── segment.hpp │ │ │ │ │ ├── sign.hpp │ │ │ │ │ ├── size.hpp │ │ │ │ │ ├── skew_double_exponential_cdf.hpp │ │ │ │ │ ├── skew_double_exponential_lccdf.hpp │ │ │ │ │ ├── skew_double_exponential_lcdf.hpp │ │ │ │ │ ├── skew_double_exponential_lpdf.hpp │ │ │ │ │ ├── skew_normal_lpdf.hpp │ │ │ │ │ ├── softmax.hpp │ │ │ │ │ ├── sort_asc.hpp │ │ │ │ │ ├── sort_desc.hpp │ │ │ │ │ ├── squared_distance.hpp │ │ │ │ │ ├── std_normal_cdf.hpp │ │ │ │ │ ├── std_normal_lccdf.hpp │ │ │ │ │ ├── std_normal_lcdf.hpp │ │ │ │ │ ├── std_normal_lpdf.hpp │ │ │ │ │ ├── student_t_lpdf.hpp │ │ │ │ │ ├── sub_col.hpp │ │ │ │ │ ├── sub_row.hpp │ │ │ │ │ ├── sum.hpp │ │ │ │ │ ├── symmetrize_from_lower_tri.hpp │ │ │ │ │ ├── symmetrize_from_upper_tri.hpp │ │ │ │ │ ├── tail.hpp │ │ │ │ │ ├── tcrossprod.hpp │ │ │ │ │ ├── to_array_1d.hpp │ │ │ │ │ ├── to_array_2d.hpp │ │ │ │ │ ├── to_matrix.hpp │ │ │ │ │ ├── to_row_vector.hpp │ │ │ │ │ ├── to_vector.hpp │ │ │ │ │ ├── trace.hpp │ │ │ │ │ ├── ub_constrain.hpp │ │ │ │ │ ├── uniform_cdf.hpp │ │ │ │ │ ├── uniform_lccdf.hpp │ │ │ │ │ ├── uniform_lcdf.hpp │ │ │ │ │ ├── uniform_lpdf.hpp │ │ │ │ │ ├── unit_vector_constrain.hpp │ │ │ │ │ ├── variance.hpp │ │ │ │ │ ├── weibull_cdf.hpp │ │ │ │ │ ├── weibull_lccdf.hpp │ │ │ │ │ ├── weibull_lcdf.hpp │ │ │ │ │ └── weibull_lpdf.hpp │ │ │ │ ├── qr_decomposition.hpp │ │ │ │ ├── ref_type.hpp │ │ │ │ ├── ref_type_for_opencl.hpp │ │ │ │ ├── rev.hpp │ │ │ │ ├── rev │ │ │ │ │ ├── Phi.hpp │ │ │ │ │ ├── Phi_approx.hpp │ │ │ │ │ ├── acos.hpp │ │ │ │ │ ├── acosh.hpp │ │ │ │ │ ├── add.hpp │ │ │ │ │ ├── add_diag.hpp │ │ │ │ │ ├── adjoint_results.hpp │ │ │ │ │ ├── append_col.hpp │ │ │ │ │ ├── append_row.hpp │ │ │ │ │ ├── arena_matrix_cl.hpp │ │ │ │ │ ├── arena_type.hpp │ │ │ │ │ ├── as_column_vector_or_scalar.hpp │ │ │ │ │ ├── asin.hpp │ │ │ │ │ ├── asinh.hpp │ │ │ │ │ ├── atan.hpp │ │ │ │ │ ├── atanh.hpp │ │ │ │ │ ├── beta.hpp │ │ │ │ │ ├── block.hpp │ │ │ │ │ ├── cbrt.hpp │ │ │ │ │ ├── ceil.hpp │ │ │ │ │ ├── cholesky_decompose.hpp │ │ │ │ │ ├── columns_dot_product.hpp │ │ │ │ │ ├── columns_dot_self.hpp │ │ │ │ │ ├── copy.hpp │ │ │ │ │ ├── cos.hpp │ │ │ │ │ ├── cosh.hpp │ │ │ │ │ ├── crossprod.hpp │ │ │ │ │ ├── cumulative_sum.hpp │ │ │ │ │ ├── diag_matrix.hpp │ │ │ │ │ ├── diag_post_multiply.hpp │ │ │ │ │ ├── diag_pre_multiply.hpp │ │ │ │ │ ├── diagonal.hpp │ │ │ │ │ ├── digamma.hpp │ │ │ │ │ ├── divide.hpp │ │ │ │ │ ├── dot_product.hpp │ │ │ │ │ ├── dot_self.hpp │ │ │ │ │ ├── elt_divide.hpp │ │ │ │ │ ├── elt_multiply.hpp │ │ │ │ │ ├── erf.hpp │ │ │ │ │ ├── erfc.hpp │ │ │ │ │ ├── exp.hpp │ │ │ │ │ ├── exp2.hpp │ │ │ │ │ ├── expm1.hpp │ │ │ │ │ ├── fabs.hpp │ │ │ │ │ ├── fdim.hpp │ │ │ │ │ ├── floor.hpp │ │ │ │ │ ├── fmax.hpp │ │ │ │ │ ├── fmin.hpp │ │ │ │ │ ├── fmod.hpp │ │ │ │ │ ├── grad.hpp │ │ │ │ │ ├── hypot.hpp │ │ │ │ │ ├── inv.hpp │ │ │ │ │ ├── inv_Phi.hpp │ │ │ │ │ ├── inv_cloglog.hpp │ │ │ │ │ ├── inv_logit.hpp │ │ │ │ │ ├── inv_sqrt.hpp │ │ │ │ │ ├── inv_square.hpp │ │ │ │ │ ├── lb_constrain.hpp │ │ │ │ │ ├── lbeta.hpp │ │ │ │ │ ├── ldexp.hpp │ │ │ │ │ ├── lgamma.hpp │ │ │ │ │ ├── lmultiply.hpp │ │ │ │ │ ├── log.hpp │ │ │ │ │ ├── log10.hpp │ │ │ │ │ ├── log1m.hpp │ │ │ │ │ ├── log1m_exp.hpp │ │ │ │ │ ├── log1m_inv_logit.hpp │ │ │ │ │ ├── log1p.hpp │ │ │ │ │ ├── log1p_exp.hpp │ │ │ │ │ ├── log2.hpp │ │ │ │ │ ├── log_diff_exp.hpp │ │ │ │ │ ├── log_inv_logit.hpp │ │ │ │ │ ├── log_inv_logit_diff.hpp │ │ │ │ │ ├── log_softmax.hpp │ │ │ │ │ ├── log_sum_exp.hpp │ │ │ │ │ ├── logit.hpp │ │ │ │ │ ├── lub_constrain.hpp │ │ │ │ │ ├── matrix_power.hpp │ │ │ │ │ ├── mdivide_left_tri_low.hpp │ │ │ │ │ ├── mdivide_right_tri_low.hpp │ │ │ │ │ ├── multiply.hpp │ │ │ │ │ ├── multiply_log.hpp │ │ │ │ │ ├── multiply_lower_tri_self_transpose.hpp │ │ │ │ │ ├── offset_multiplier_constrain.hpp │ │ │ │ │ ├── operands_and_partials.hpp │ │ │ │ │ ├── operator_unary_minus.hpp │ │ │ │ │ ├── operator_unary_plus.hpp │ │ │ │ │ ├── pow.hpp │ │ │ │ │ ├── prod.hpp │ │ │ │ │ ├── rep_matrix.hpp │ │ │ │ │ ├── reverse.hpp │ │ │ │ │ ├── round.hpp │ │ │ │ │ ├── rows_dot_product.hpp │ │ │ │ │ ├── rows_dot_self.hpp │ │ │ │ │ ├── sd.hpp │ │ │ │ │ ├── sin.hpp │ │ │ │ │ ├── sinh.hpp │ │ │ │ │ ├── softmax.hpp │ │ │ │ │ ├── sqrt.hpp │ │ │ │ │ ├── square.hpp │ │ │ │ │ ├── squared_distance.hpp │ │ │ │ │ ├── subtract.hpp │ │ │ │ │ ├── sum.hpp │ │ │ │ │ ├── symmetrize_from_lower_tri.hpp │ │ │ │ │ ├── symmetrize_from_upper_tri.hpp │ │ │ │ │ ├── tan.hpp │ │ │ │ │ ├── tanh.hpp │ │ │ │ │ ├── tcrossprod.hpp │ │ │ │ │ ├── tgamma.hpp │ │ │ │ │ ├── to_arena.hpp │ │ │ │ │ ├── to_matrix.hpp │ │ │ │ │ ├── trace.hpp │ │ │ │ │ ├── transpose.hpp │ │ │ │ │ ├── trunc.hpp │ │ │ │ │ ├── ub_constrain.hpp │ │ │ │ │ ├── unit_vector_constrain.hpp │ │ │ │ │ ├── vari.hpp │ │ │ │ │ └── variance.hpp │ │ │ │ ├── scalar_type.hpp │ │ │ │ ├── stringify.hpp │ │ │ │ ├── symmetric_eigensolver.hpp │ │ │ │ ├── to_ref_for_opencl.hpp │ │ │ │ ├── tri_inverse.hpp │ │ │ │ ├── tridiagonalization.hpp │ │ │ │ ├── value_type.hpp │ │ │ │ └── zeros_strict_tri.hpp │ │ │ ├── prim.hpp │ │ │ ├── prim │ │ │ │ ├── core.hpp │ │ │ │ ├── core │ │ │ │ │ ├── complex_base.hpp │ │ │ │ │ ├── init_threadpool_tbb.hpp │ │ │ │ │ ├── operator_addition.hpp │ │ │ │ │ ├── operator_division.hpp │ │ │ │ │ ├── operator_equal_equal.hpp │ │ │ │ │ ├── operator_minus.hpp │ │ │ │ │ ├── operator_multiplication.hpp │ │ │ │ │ ├── operator_not_equal.hpp │ │ │ │ │ ├── operator_plus.hpp │ │ │ │ │ └── operator_subtraction.hpp │ │ │ │ ├── eigen_plugins.h │ │ │ │ ├── err.hpp │ │ │ │ ├── err │ │ │ │ │ ├── check_2F1_converges.hpp │ │ │ │ │ ├── check_3F2_converges.hpp │ │ │ │ │ ├── check_bounded.hpp │ │ │ │ │ ├── check_cholesky_factor.hpp │ │ │ │ │ ├── check_cholesky_factor_corr.hpp │ │ │ │ │ ├── check_column_index.hpp │ │ │ │ │ ├── check_consistent_size.hpp │ │ │ │ │ ├── check_consistent_sizes.hpp │ │ │ │ │ ├── check_consistent_sizes_mvt.hpp │ │ │ │ │ ├── check_corr_matrix.hpp │ │ │ │ │ ├── check_cov_matrix.hpp │ │ │ │ │ ├── check_finite.hpp │ │ │ │ │ ├── check_flag_sundials.hpp │ │ │ │ │ ├── check_greater.hpp │ │ │ │ │ ├── check_greater_or_equal.hpp │ │ │ │ │ ├── check_ldlt_factor.hpp │ │ │ │ │ ├── check_less.hpp │ │ │ │ │ ├── check_less_or_equal.hpp │ │ │ │ │ ├── check_lower_triangular.hpp │ │ │ │ │ ├── check_matching_dims.hpp │ │ │ │ │ ├── check_matching_sizes.hpp │ │ │ │ │ ├── check_multiplicable.hpp │ │ │ │ │ ├── check_nonnegative.hpp │ │ │ │ │ ├── check_nonzero_size.hpp │ │ │ │ │ ├── check_not_nan.hpp │ │ │ │ │ ├── check_ordered.hpp │ │ │ │ │ ├── check_pos_definite.hpp │ │ │ │ │ ├── check_pos_semidefinite.hpp │ │ │ │ │ ├── check_positive.hpp │ │ │ │ │ ├── check_positive_finite.hpp │ │ │ │ │ ├── check_positive_ordered.hpp │ │ │ │ │ ├── check_range.hpp │ │ │ │ │ ├── check_row_index.hpp │ │ │ │ │ ├── check_simplex.hpp │ │ │ │ │ ├── check_size_match.hpp │ │ │ │ │ ├── check_sorted.hpp │ │ │ │ │ ├── check_square.hpp │ │ │ │ │ ├── check_std_vector_index.hpp │ │ │ │ │ ├── check_symmetric.hpp │ │ │ │ │ ├── check_unit_vector.hpp │ │ │ │ │ ├── check_vector.hpp │ │ │ │ │ ├── check_vector_index.hpp │ │ │ │ │ ├── constraint_tolerance.hpp │ │ │ │ │ ├── domain_error.hpp │ │ │ │ │ ├── domain_error_vec.hpp │ │ │ │ │ ├── elementwise_check.hpp │ │ │ │ │ ├── hmm_check.hpp │ │ │ │ │ ├── invalid_argument.hpp │ │ │ │ │ ├── invalid_argument_vec.hpp │ │ │ │ │ ├── is_cholesky_factor.hpp │ │ │ │ │ ├── is_cholesky_factor_corr.hpp │ │ │ │ │ ├── is_column_index.hpp │ │ │ │ │ ├── is_corr_matrix.hpp │ │ │ │ │ ├── is_ldlt_factor.hpp │ │ │ │ │ ├── is_less_or_equal.hpp │ │ │ │ │ ├── is_lower_triangular.hpp │ │ │ │ │ ├── is_mat_finite.hpp │ │ │ │ │ ├── is_matching_dims.hpp │ │ │ │ │ ├── is_matching_size.hpp │ │ │ │ │ ├── is_nonzero_size.hpp │ │ │ │ │ ├── is_not_nan.hpp │ │ │ │ │ ├── is_ordered.hpp │ │ │ │ │ ├── is_pos_definite.hpp │ │ │ │ │ ├── is_positive.hpp │ │ │ │ │ ├── is_scal_finite.hpp │ │ │ │ │ ├── is_size_match.hpp │ │ │ │ │ ├── is_square.hpp │ │ │ │ │ ├── is_symmetric.hpp │ │ │ │ │ ├── is_unit_vector.hpp │ │ │ │ │ ├── make_iter_name.hpp │ │ │ │ │ ├── out_of_range.hpp │ │ │ │ │ ├── system_error.hpp │ │ │ │ │ ├── throw_domain_error.hpp │ │ │ │ │ ├── throw_domain_error_mat.hpp │ │ │ │ │ ├── throw_domain_error_vec.hpp │ │ │ │ │ ├── validate_non_negative_index.hpp │ │ │ │ │ ├── validate_positive_index.hpp │ │ │ │ │ └── validate_unit_vector_index.hpp │ │ │ │ ├── fun.hpp │ │ │ │ ├── fun │ │ │ │ │ ├── Eigen.hpp │ │ │ │ │ ├── LDLT_factor.hpp │ │ │ │ │ ├── MatrixExponential.h │ │ │ │ │ ├── Phi.hpp │ │ │ │ │ ├── Phi_approx.hpp │ │ │ │ │ ├── abs.hpp │ │ │ │ │ ├── accumulator.hpp │ │ │ │ │ ├── acos.hpp │ │ │ │ │ ├── acosh.hpp │ │ │ │ │ ├── add.hpp │ │ │ │ │ ├── add_diag.hpp │ │ │ │ │ ├── all.hpp │ │ │ │ │ ├── any.hpp │ │ │ │ │ ├── append_array.hpp │ │ │ │ │ ├── append_col.hpp │ │ │ │ │ ├── append_row.hpp │ │ │ │ │ ├── arg.hpp │ │ │ │ │ ├── array_builder.hpp │ │ │ │ │ ├── as_array_or_scalar.hpp │ │ │ │ │ ├── as_bool.hpp │ │ │ │ │ ├── as_column_vector_or_scalar.hpp │ │ │ │ │ ├── as_value_array_or_scalar.hpp │ │ │ │ │ ├── as_value_column_array_or_scalar.hpp │ │ │ │ │ ├── as_value_column_vector_or_scalar.hpp │ │ │ │ │ ├── asin.hpp │ │ │ │ │ ├── asinh.hpp │ │ │ │ │ ├── assign.hpp │ │ │ │ │ ├── atan.hpp │ │ │ │ │ ├── atan2.hpp │ │ │ │ │ ├── atanh.hpp │ │ │ │ │ ├── autocorrelation.hpp │ │ │ │ │ ├── autocovariance.hpp │ │ │ │ │ ├── bessel_first_kind.hpp │ │ │ │ │ ├── bessel_second_kind.hpp │ │ │ │ │ ├── beta.hpp │ │ │ │ │ ├── binary_log_loss.hpp │ │ │ │ │ ├── binomial_coefficient_log.hpp │ │ │ │ │ ├── block.hpp │ │ │ │ │ ├── boost_policy.hpp │ │ │ │ │ ├── cbrt.hpp │ │ │ │ │ ├── ceil.hpp │ │ │ │ │ ├── chol2inv.hpp │ │ │ │ │ ├── cholesky_corr_constrain.hpp │ │ │ │ │ ├── cholesky_corr_free.hpp │ │ │ │ │ ├── cholesky_decompose.hpp │ │ │ │ │ ├── cholesky_factor_constrain.hpp │ │ │ │ │ ├── cholesky_factor_free.hpp │ │ │ │ │ ├── choose.hpp │ │ │ │ │ ├── col.hpp │ │ │ │ │ ├── cols.hpp │ │ │ │ │ ├── columns_dot_product.hpp │ │ │ │ │ ├── columns_dot_self.hpp │ │ │ │ │ ├── complex_schur_decompose.hpp │ │ │ │ │ ├── conj.hpp │ │ │ │ │ ├── constants.hpp │ │ │ │ │ ├── copysign.hpp │ │ │ │ │ ├── corr_constrain.hpp │ │ │ │ │ ├── corr_free.hpp │ │ │ │ │ ├── corr_matrix_constrain.hpp │ │ │ │ │ ├── corr_matrix_free.hpp │ │ │ │ │ ├── cos.hpp │ │ │ │ │ ├── cosh.hpp │ │ │ │ │ ├── cov_exp_quad.hpp │ │ │ │ │ ├── cov_matrix_constrain.hpp │ │ │ │ │ ├── cov_matrix_constrain_lkj.hpp │ │ │ │ │ ├── cov_matrix_free.hpp │ │ │ │ │ ├── cov_matrix_free_lkj.hpp │ │ │ │ │ ├── crossprod.hpp │ │ │ │ │ ├── csr_extract.hpp │ │ │ │ │ ├── csr_extract_u.hpp │ │ │ │ │ ├── csr_extract_v.hpp │ │ │ │ │ ├── csr_extract_w.hpp │ │ │ │ │ ├── csr_matrix_times_vector.hpp │ │ │ │ │ ├── csr_to_dense_matrix.hpp │ │ │ │ │ ├── csr_u_to_z.hpp │ │ │ │ │ ├── cumulative_sum.hpp │ │ │ │ │ ├── determinant.hpp │ │ │ │ │ ├── diag_matrix.hpp │ │ │ │ │ ├── diag_post_multiply.hpp │ │ │ │ │ ├── diag_pre_multiply.hpp │ │ │ │ │ ├── diagonal.hpp │ │ │ │ │ ├── digamma.hpp │ │ │ │ │ ├── dims.hpp │ │ │ │ │ ├── distance.hpp │ │ │ │ │ ├── divide.hpp │ │ │ │ │ ├── divide_columns.hpp │ │ │ │ │ ├── dot.hpp │ │ │ │ │ ├── dot_product.hpp │ │ │ │ │ ├── dot_self.hpp │ │ │ │ │ ├── eigen_comparisons.hpp │ │ │ │ │ ├── eigendecompose.hpp │ │ │ │ │ ├── eigendecompose_sym.hpp │ │ │ │ │ ├── eigenvalues.hpp │ │ │ │ │ ├── eigenvalues_sym.hpp │ │ │ │ │ ├── eigenvectors.hpp │ │ │ │ │ ├── eigenvectors_sym.hpp │ │ │ │ │ ├── elt_divide.hpp │ │ │ │ │ ├── elt_multiply.hpp │ │ │ │ │ ├── erf.hpp │ │ │ │ │ ├── erfc.hpp │ │ │ │ │ ├── eval.hpp │ │ │ │ │ ├── exp.hpp │ │ │ │ │ ├── exp2.hpp │ │ │ │ │ ├── expm1.hpp │ │ │ │ │ ├── fabs.hpp │ │ │ │ │ ├── factor_U.hpp │ │ │ │ │ ├── factor_cov_matrix.hpp │ │ │ │ │ ├── falling_factorial.hpp │ │ │ │ │ ├── fdim.hpp │ │ │ │ │ ├── fft.hpp │ │ │ │ │ ├── fill.hpp │ │ │ │ │ ├── finite_diff_stepsize.hpp │ │ │ │ │ ├── floor.hpp │ │ │ │ │ ├── fma.hpp │ │ │ │ │ ├── fmax.hpp │ │ │ │ │ ├── fmin.hpp │ │ │ │ │ ├── fmod.hpp │ │ │ │ │ ├── gamma_p.hpp │ │ │ │ │ ├── gamma_q.hpp │ │ │ │ │ ├── generalized_inverse.hpp │ │ │ │ │ ├── get.hpp │ │ │ │ │ ├── get_base1.hpp │ │ │ │ │ ├── get_base1_lhs.hpp │ │ │ │ │ ├── get_imag.hpp │ │ │ │ │ ├── get_lp.hpp │ │ │ │ │ ├── get_real.hpp │ │ │ │ │ ├── gp_dot_prod_cov.hpp │ │ │ │ │ ├── gp_exp_quad_cov.hpp │ │ │ │ │ ├── gp_exponential_cov.hpp │ │ │ │ │ ├── gp_matern32_cov.hpp │ │ │ │ │ ├── gp_matern52_cov.hpp │ │ │ │ │ ├── gp_periodic_cov.hpp │ │ │ │ │ ├── grad_2F1.hpp │ │ │ │ │ ├── grad_F32.hpp │ │ │ │ │ ├── grad_inc_beta.hpp │ │ │ │ │ ├── grad_pFq.hpp │ │ │ │ │ ├── grad_reg_inc_beta.hpp │ │ │ │ │ ├── grad_reg_inc_gamma.hpp │ │ │ │ │ ├── grad_reg_lower_inc_gamma.hpp │ │ │ │ │ ├── head.hpp │ │ │ │ │ ├── hypergeometric_1F0.hpp │ │ │ │ │ ├── hypergeometric_2F1.hpp │ │ │ │ │ ├── hypergeometric_2F2.hpp │ │ │ │ │ ├── hypergeometric_3F2.hpp │ │ │ │ │ ├── hypergeometric_pFq.hpp │ │ │ │ │ ├── hypot.hpp │ │ │ │ │ ├── i_times.hpp │ │ │ │ │ ├── identity_constrain.hpp │ │ │ │ │ ├── identity_free.hpp │ │ │ │ │ ├── identity_matrix.hpp │ │ │ │ │ ├── if_else.hpp │ │ │ │ │ ├── imag.hpp │ │ │ │ │ ├── inc_beta.hpp │ │ │ │ │ ├── inc_beta_dda.hpp │ │ │ │ │ ├── inc_beta_ddb.hpp │ │ │ │ │ ├── inc_beta_ddz.hpp │ │ │ │ │ ├── initialize.hpp │ │ │ │ │ ├── initialize_fill.hpp │ │ │ │ │ ├── int_step.hpp │ │ │ │ │ ├── inv.hpp │ │ │ │ │ ├── inv_Phi.hpp │ │ │ │ │ ├── inv_cloglog.hpp │ │ │ │ │ ├── inv_erfc.hpp │ │ │ │ │ ├── inv_inc_beta.hpp │ │ │ │ │ ├── inv_logit.hpp │ │ │ │ │ ├── inv_sqrt.hpp │ │ │ │ │ ├── inv_square.hpp │ │ │ │ │ ├── inverse.hpp │ │ │ │ │ ├── inverse_softmax.hpp │ │ │ │ │ ├── inverse_spd.hpp │ │ │ │ │ ├── is_any_nan.hpp │ │ │ │ │ ├── is_inf.hpp │ │ │ │ │ ├── is_integer.hpp │ │ │ │ │ ├── is_nan.hpp │ │ │ │ │ ├── is_nonpositive_integer.hpp │ │ │ │ │ ├── is_uninitialized.hpp │ │ │ │ │ ├── isfinite.hpp │ │ │ │ │ ├── isinf.hpp │ │ │ │ │ ├── isnan.hpp │ │ │ │ │ ├── isnormal.hpp │ │ │ │ │ ├── lambert_w.hpp │ │ │ │ │ ├── lb_constrain.hpp │ │ │ │ │ ├── lb_free.hpp │ │ │ │ │ ├── lbeta.hpp │ │ │ │ │ ├── ldexp.hpp │ │ │ │ │ ├── lgamma.hpp │ │ │ │ │ ├── lgamma_stirling.hpp │ │ │ │ │ ├── lgamma_stirling_diff.hpp │ │ │ │ │ ├── linspaced_array.hpp │ │ │ │ │ ├── linspaced_int_array.hpp │ │ │ │ │ ├── linspaced_row_vector.hpp │ │ │ │ │ ├── linspaced_vector.hpp │ │ │ │ │ ├── lmgamma.hpp │ │ │ │ │ ├── lmultiply.hpp │ │ │ │ │ ├── log.hpp │ │ │ │ │ ├── log10.hpp │ │ │ │ │ ├── log1m.hpp │ │ │ │ │ ├── log1m_exp.hpp │ │ │ │ │ ├── log1m_inv_logit.hpp │ │ │ │ │ ├── log1p.hpp │ │ │ │ │ ├── log1p_exp.hpp │ │ │ │ │ ├── log2.hpp │ │ │ │ │ ├── log_determinant.hpp │ │ │ │ │ ├── log_determinant_ldlt.hpp │ │ │ │ │ ├── log_determinant_spd.hpp │ │ │ │ │ ├── log_diff_exp.hpp │ │ │ │ │ ├── log_falling_factorial.hpp │ │ │ │ │ ├── log_inv_logit.hpp │ │ │ │ │ ├── log_inv_logit_diff.hpp │ │ │ │ │ ├── log_mix.hpp │ │ │ │ │ ├── log_modified_bessel_first_kind.hpp │ │ │ │ │ ├── log_rising_factorial.hpp │ │ │ │ │ ├── log_softmax.hpp │ │ │ │ │ ├── log_sum_exp.hpp │ │ │ │ │ ├── log_sum_exp_signed.hpp │ │ │ │ │ ├── logb.hpp │ │ │ │ │ ├── logical_and.hpp │ │ │ │ │ ├── logical_eq.hpp │ │ │ │ │ ├── logical_gt.hpp │ │ │ │ │ ├── logical_gte.hpp │ │ │ │ │ ├── logical_lt.hpp │ │ │ │ │ ├── logical_lte.hpp │ │ │ │ │ ├── logical_negation.hpp │ │ │ │ │ ├── logical_neq.hpp │ │ │ │ │ ├── logical_or.hpp │ │ │ │ │ ├── logit.hpp │ │ │ │ │ ├── lub_constrain.hpp │ │ │ │ │ ├── lub_free.hpp │ │ │ │ │ ├── make_nu.hpp │ │ │ │ │ ├── matrix_exp.hpp │ │ │ │ │ ├── matrix_exp_2x2.hpp │ │ │ │ │ ├── matrix_exp_action_handler.hpp │ │ │ │ │ ├── matrix_exp_multiply.hpp │ │ │ │ │ ├── matrix_exp_pade.hpp │ │ │ │ │ ├── matrix_power.hpp │ │ │ │ │ ├── max.hpp │ │ │ │ │ ├── max_size.hpp │ │ │ │ │ ├── max_size_mvt.hpp │ │ │ │ │ ├── mdivide_left.hpp │ │ │ │ │ ├── mdivide_left_ldlt.hpp │ │ │ │ │ ├── mdivide_left_spd.hpp │ │ │ │ │ ├── mdivide_left_tri.hpp │ │ │ │ │ ├── mdivide_left_tri_low.hpp │ │ │ │ │ ├── mdivide_right.hpp │ │ │ │ │ ├── mdivide_right_ldlt.hpp │ │ │ │ │ ├── mdivide_right_spd.hpp │ │ │ │ │ ├── mdivide_right_tri.hpp │ │ │ │ │ ├── mdivide_right_tri_low.hpp │ │ │ │ │ ├── mean.hpp │ │ │ │ │ ├── min.hpp │ │ │ │ │ ├── minus.hpp │ │ │ │ │ ├── modified_bessel_first_kind.hpp │ │ │ │ │ ├── modified_bessel_second_kind.hpp │ │ │ │ │ ├── modulus.hpp │ │ │ │ │ ├── multiply.hpp │ │ │ │ │ ├── multiply_log.hpp │ │ │ │ │ ├── multiply_lower_tri_self_transpose.hpp │ │ │ │ │ ├── norm.hpp │ │ │ │ │ ├── norm1.hpp │ │ │ │ │ ├── norm2.hpp │ │ │ │ │ ├── num_elements.hpp │ │ │ │ │ ├── offset_multiplier_constrain.hpp │ │ │ │ │ ├── offset_multiplier_free.hpp │ │ │ │ │ ├── one_hot_array.hpp │ │ │ │ │ ├── one_hot_int_array.hpp │ │ │ │ │ ├── one_hot_row_vector.hpp │ │ │ │ │ ├── one_hot_vector.hpp │ │ │ │ │ ├── ones_array.hpp │ │ │ │ │ ├── ones_int_array.hpp │ │ │ │ │ ├── ones_row_vector.hpp │ │ │ │ │ ├── ones_vector.hpp │ │ │ │ │ ├── ordered_constrain.hpp │ │ │ │ │ ├── ordered_free.hpp │ │ │ │ │ ├── owens_t.hpp │ │ │ │ │ ├── plus.hpp │ │ │ │ │ ├── poisson_binomial_log_probs.hpp │ │ │ │ │ ├── polar.hpp │ │ │ │ │ ├── positive_constrain.hpp │ │ │ │ │ ├── positive_free.hpp │ │ │ │ │ ├── positive_ordered_constrain.hpp │ │ │ │ │ ├── positive_ordered_free.hpp │ │ │ │ │ ├── pow.hpp │ │ │ │ │ ├── primitive_value.hpp │ │ │ │ │ ├── prob_constrain.hpp │ │ │ │ │ ├── prob_free.hpp │ │ │ │ │ ├── prod.hpp │ │ │ │ │ ├── proj.hpp │ │ │ │ │ ├── promote_elements.hpp │ │ │ │ │ ├── promote_scalar.hpp │ │ │ │ │ ├── pseudo_eigenvalues.hpp │ │ │ │ │ ├── pseudo_eigenvectors.hpp │ │ │ │ │ ├── qr.hpp │ │ │ │ │ ├── qr_Q.hpp │ │ │ │ │ ├── qr_R.hpp │ │ │ │ │ ├── qr_thin.hpp │ │ │ │ │ ├── qr_thin_Q.hpp │ │ │ │ │ ├── qr_thin_R.hpp │ │ │ │ │ ├── quad_form.hpp │ │ │ │ │ ├── quad_form_diag.hpp │ │ │ │ │ ├── quad_form_sym.hpp │ │ │ │ │ ├── quantile.hpp │ │ │ │ │ ├── rank.hpp │ │ │ │ │ ├── read_corr_L.hpp │ │ │ │ │ ├── read_corr_matrix.hpp │ │ │ │ │ ├── read_cov_L.hpp │ │ │ │ │ ├── read_cov_matrix.hpp │ │ │ │ │ ├── real.hpp │ │ │ │ │ ├── rep_array.hpp │ │ │ │ │ ├── rep_matrix.hpp │ │ │ │ │ ├── rep_row_vector.hpp │ │ │ │ │ ├── rep_vector.hpp │ │ │ │ │ ├── resize.hpp │ │ │ │ │ ├── reverse.hpp │ │ │ │ │ ├── rising_factorial.hpp │ │ │ │ │ ├── round.hpp │ │ │ │ │ ├── row.hpp │ │ │ │ │ ├── rows.hpp │ │ │ │ │ ├── rows_dot_product.hpp │ │ │ │ │ ├── rows_dot_self.hpp │ │ │ │ │ ├── scalar_seq_view.hpp │ │ │ │ │ ├── scalbn.hpp │ │ │ │ │ ├── scale_matrix_exp_multiply.hpp │ │ │ │ │ ├── scaled_add.hpp │ │ │ │ │ ├── sd.hpp │ │ │ │ │ ├── segment.hpp │ │ │ │ │ ├── select.hpp │ │ │ │ │ ├── serializer.hpp │ │ │ │ │ ├── sign.hpp │ │ │ │ │ ├── signbit.hpp │ │ │ │ │ ├── simplex_constrain.hpp │ │ │ │ │ ├── simplex_free.hpp │ │ │ │ │ ├── sin.hpp │ │ │ │ │ ├── singular_values.hpp │ │ │ │ │ ├── sinh.hpp │ │ │ │ │ ├── size.hpp │ │ │ │ │ ├── size_mvt.hpp │ │ │ │ │ ├── size_zero.hpp │ │ │ │ │ ├── softmax.hpp │ │ │ │ │ ├── sort_asc.hpp │ │ │ │ │ ├── sort_desc.hpp │ │ │ │ │ ├── sort_indices.hpp │ │ │ │ │ ├── sort_indices_asc.hpp │ │ │ │ │ ├── sort_indices_desc.hpp │ │ │ │ │ ├── sqrt.hpp │ │ │ │ │ ├── square.hpp │ │ │ │ │ ├── squared_distance.hpp │ │ │ │ │ ├── stan_print.hpp │ │ │ │ │ ├── step.hpp │ │ │ │ │ ├── stochastic_column_constrain.hpp │ │ │ │ │ ├── stochastic_column_free.hpp │ │ │ │ │ ├── stochastic_row_constrain.hpp │ │ │ │ │ ├── stochastic_row_free.hpp │ │ │ │ │ ├── sub_col.hpp │ │ │ │ │ ├── sub_row.hpp │ │ │ │ │ ├── subtract.hpp │ │ │ │ │ ├── sum.hpp │ │ │ │ │ ├── svd.hpp │ │ │ │ │ ├── svd_U.hpp │ │ │ │ │ ├── svd_V.hpp │ │ │ │ │ ├── symmetrize_from_lower_tri.hpp │ │ │ │ │ ├── symmetrize_from_upper_tri.hpp │ │ │ │ │ ├── tail.hpp │ │ │ │ │ ├── tan.hpp │ │ │ │ │ ├── tanh.hpp │ │ │ │ │ ├── tcrossprod.hpp │ │ │ │ │ ├── tgamma.hpp │ │ │ │ │ ├── to_array_1d.hpp │ │ │ │ │ ├── to_array_2d.hpp │ │ │ │ │ ├── to_complex.hpp │ │ │ │ │ ├── to_int.hpp │ │ │ │ │ ├── to_matrix.hpp │ │ │ │ │ ├── to_ref.hpp │ │ │ │ │ ├── to_row_vector.hpp │ │ │ │ │ ├── to_vector.hpp │ │ │ │ │ ├── trace.hpp │ │ │ │ │ ├── trace_gen_inv_quad_form_ldlt.hpp │ │ │ │ │ ├── trace_gen_quad_form.hpp │ │ │ │ │ ├── trace_inv_quad_form_ldlt.hpp │ │ │ │ │ ├── trace_quad_form.hpp │ │ │ │ │ ├── transpose.hpp │ │ │ │ │ ├── trigamma.hpp │ │ │ │ │ ├── trunc.hpp │ │ │ │ │ ├── typedefs.hpp │ │ │ │ │ ├── ub_constrain.hpp │ │ │ │ │ ├── ub_free.hpp │ │ │ │ │ ├── uniform_simplex.hpp │ │ │ │ │ ├── unit_vector_constrain.hpp │ │ │ │ │ ├── unit_vector_free.hpp │ │ │ │ │ ├── unitspaced_array.hpp │ │ │ │ │ ├── value_of.hpp │ │ │ │ │ ├── value_of_rec.hpp │ │ │ │ │ ├── variance.hpp │ │ │ │ │ ├── vec_concat.hpp │ │ │ │ │ ├── vector_seq_view.hpp │ │ │ │ │ ├── welford_covar_estimator.hpp │ │ │ │ │ ├── welford_var_estimator.hpp │ │ │ │ │ ├── zeros_array.hpp │ │ │ │ │ ├── zeros_int_array.hpp │ │ │ │ │ ├── zeros_row_vector.hpp │ │ │ │ │ └── zeros_vector.hpp │ │ │ │ ├── functor.hpp │ │ │ │ ├── functor │ │ │ │ │ ├── algebra_solver_adapter.hpp │ │ │ │ │ ├── apply.hpp │ │ │ │ │ ├── apply_scalar_binary.hpp │ │ │ │ │ ├── apply_scalar_ternary.hpp │ │ │ │ │ ├── apply_scalar_unary.hpp │ │ │ │ │ ├── apply_vector_unary.hpp │ │ │ │ │ ├── broadcast_array.hpp │ │ │ │ │ ├── coupled_ode_system.hpp │ │ │ │ │ ├── finite_diff_gradient.hpp │ │ │ │ │ ├── finite_diff_gradient_auto.hpp │ │ │ │ │ ├── for_each.hpp │ │ │ │ │ ├── hcubature.hpp │ │ │ │ │ ├── integrate_1d.hpp │ │ │ │ │ ├── integrate_1d_adapter.hpp │ │ │ │ │ ├── integrate_ode_rk45.hpp │ │ │ │ │ ├── integrate_ode_std_vector_interface_adapter.hpp │ │ │ │ │ ├── map_rect.hpp │ │ │ │ │ ├── map_rect_combine.hpp │ │ │ │ │ ├── map_rect_concurrent.hpp │ │ │ │ │ ├── map_rect_mpi.hpp │ │ │ │ │ ├── map_rect_reduce.hpp │ │ │ │ │ ├── mpi_cluster.hpp │ │ │ │ │ ├── mpi_cluster_inst.cpp │ │ │ │ │ ├── mpi_command.hpp │ │ │ │ │ ├── mpi_distributed_apply.hpp │ │ │ │ │ ├── mpi_parallel_call.hpp │ │ │ │ │ ├── ode_ckrk.hpp │ │ │ │ │ ├── ode_rk45.hpp │ │ │ │ │ ├── ode_store_sensitivities.hpp │ │ │ │ │ ├── operands_and_partials.hpp │ │ │ │ │ ├── partials_propagator.hpp │ │ │ │ │ ├── reduce_sum.hpp │ │ │ │ │ └── reduce_sum_static.hpp │ │ │ │ ├── meta.hpp │ │ │ │ ├── meta │ │ │ │ │ ├── StdVectorBuilder.hpp │ │ │ │ │ ├── VectorBuilder.hpp │ │ │ │ │ ├── VectorBuilderHelper.hpp │ │ │ │ │ ├── ad_promotable.hpp │ │ │ │ │ ├── append_return_type.hpp │ │ │ │ │ ├── base_type.hpp │ │ │ │ │ ├── bool_constant.hpp │ │ │ │ │ ├── compiler_attributes.hpp │ │ │ │ │ ├── conjunction.hpp │ │ │ │ │ ├── contains_std_vector.hpp │ │ │ │ │ ├── disjunction.hpp │ │ │ │ │ ├── error_index.hpp │ │ │ │ │ ├── forward_as.hpp │ │ │ │ │ ├── holder.hpp │ │ │ │ │ ├── include_summand.hpp │ │ │ │ │ ├── index_apply.hpp │ │ │ │ │ ├── index_type.hpp │ │ │ │ │ ├── is_arena_matrix.hpp │ │ │ │ │ ├── is_autodiff.hpp │ │ │ │ │ ├── is_base_pointer_convertible.hpp │ │ │ │ │ ├── is_complex.hpp │ │ │ │ │ ├── is_constant.hpp │ │ │ │ │ ├── is_container.hpp │ │ │ │ │ ├── is_container_or_var_matrix.hpp │ │ │ │ │ ├── is_dense_dynamic.hpp │ │ │ │ │ ├── is_detected.hpp │ │ │ │ │ ├── is_double_or_int.hpp │ │ │ │ │ ├── is_eigen.hpp │ │ │ │ │ ├── is_eigen_dense_base.hpp │ │ │ │ │ ├── is_eigen_dense_dynamic.hpp │ │ │ │ │ ├── is_eigen_matrix.hpp │ │ │ │ │ ├── is_eigen_matrix_base.hpp │ │ │ │ │ ├── is_eigen_sparse_base.hpp │ │ │ │ │ ├── is_fvar.hpp │ │ │ │ │ ├── is_kernel_expression.hpp │ │ │ │ │ ├── is_matrix.hpp │ │ │ │ │ ├── is_matrix_cl.hpp │ │ │ │ │ ├── is_plain_type.hpp │ │ │ │ │ ├── is_rev_matrix.hpp │ │ │ │ │ ├── is_stan_scalar.hpp │ │ │ │ │ ├── is_stan_scalar_or_eigen.hpp │ │ │ │ │ ├── is_string_convertible.hpp │ │ │ │ │ ├── is_tuple.hpp │ │ │ │ │ ├── is_var.hpp │ │ │ │ │ ├── is_var_and_matrix_types.hpp │ │ │ │ │ ├── is_var_dense_dynamic.hpp │ │ │ │ │ ├── is_var_eigen.hpp │ │ │ │ │ ├── is_var_matrix.hpp │ │ │ │ │ ├── is_var_or_arithmetic.hpp │ │ │ │ │ ├── is_vari.hpp │ │ │ │ │ ├── is_vector.hpp │ │ │ │ │ ├── is_vector_like.hpp │ │ │ │ │ ├── modify_eigen_options.hpp │ │ │ │ │ ├── partials_return_type.hpp │ │ │ │ │ ├── partials_type.hpp │ │ │ │ │ ├── plain_type.hpp │ │ │ │ │ ├── possibly_sum.hpp │ │ │ │ │ ├── promote_args.hpp │ │ │ │ │ ├── promote_scalar_type.hpp │ │ │ │ │ ├── ref_type.hpp │ │ │ │ │ ├── require_generics.hpp │ │ │ │ │ ├── require_helpers.hpp │ │ │ │ │ ├── return_type.hpp │ │ │ │ │ ├── scalar_type.hpp │ │ │ │ │ ├── seq_view.hpp │ │ │ │ │ ├── static_select.hpp │ │ │ │ │ ├── value_type.hpp │ │ │ │ │ └── void_t.hpp │ │ │ │ ├── prob.hpp │ │ │ │ └── prob │ │ │ │ │ ├── bernoulli_ccdf_log.hpp │ │ │ │ │ ├── bernoulli_cdf.hpp │ │ │ │ │ ├── bernoulli_cdf_log.hpp │ │ │ │ │ ├── bernoulli_lccdf.hpp │ │ │ │ │ ├── bernoulli_lcdf.hpp │ │ │ │ │ ├── bernoulli_log.hpp │ │ │ │ │ ├── bernoulli_logit_glm_log.hpp │ │ │ │ │ ├── bernoulli_logit_glm_lpmf.hpp │ │ │ │ │ ├── bernoulli_logit_glm_rng.hpp │ │ │ │ │ ├── bernoulli_logit_log.hpp │ │ │ │ │ ├── bernoulli_logit_lpmf.hpp │ │ │ │ │ ├── bernoulli_logit_rng.hpp │ │ │ │ │ ├── bernoulli_lpmf.hpp │ │ │ │ │ ├── bernoulli_rng.hpp │ │ │ │ │ ├── beta_binomial_ccdf_log.hpp │ │ │ │ │ ├── beta_binomial_cdf.hpp │ │ │ │ │ ├── beta_binomial_cdf_log.hpp │ │ │ │ │ ├── beta_binomial_lccdf.hpp │ │ │ │ │ ├── beta_binomial_lcdf.hpp │ │ │ │ │ ├── beta_binomial_log.hpp │ │ │ │ │ ├── beta_binomial_lpmf.hpp │ │ │ │ │ ├── beta_binomial_rng.hpp │ │ │ │ │ ├── beta_ccdf_log.hpp │ │ │ │ │ ├── beta_cdf.hpp │ │ │ │ │ ├── beta_cdf_log.hpp │ │ │ │ │ ├── beta_lccdf.hpp │ │ │ │ │ ├── beta_lcdf.hpp │ │ │ │ │ ├── beta_log.hpp │ │ │ │ │ ├── beta_lpdf.hpp │ │ │ │ │ ├── beta_proportion_ccdf_log.hpp │ │ │ │ │ ├── beta_proportion_cdf_log.hpp │ │ │ │ │ ├── beta_proportion_lccdf.hpp │ │ │ │ │ ├── beta_proportion_lcdf.hpp │ │ │ │ │ ├── beta_proportion_log.hpp │ │ │ │ │ ├── beta_proportion_lpdf.hpp │ │ │ │ │ ├── beta_proportion_rng.hpp │ │ │ │ │ ├── beta_rng.hpp │ │ │ │ │ ├── binomial_ccdf_log.hpp │ │ │ │ │ ├── binomial_cdf.hpp │ │ │ │ │ ├── binomial_cdf_log.hpp │ │ │ │ │ ├── binomial_lccdf.hpp │ │ │ │ │ ├── binomial_lcdf.hpp │ │ │ │ │ ├── binomial_log.hpp │ │ │ │ │ ├── binomial_logit_glm_lpmf.hpp │ │ │ │ │ ├── binomial_logit_log.hpp │ │ │ │ │ ├── binomial_logit_lpmf.hpp │ │ │ │ │ ├── binomial_lpmf.hpp │ │ │ │ │ ├── binomial_rng.hpp │ │ │ │ │ ├── categorical_log.hpp │ │ │ │ │ ├── categorical_logit_glm_lpmf.hpp │ │ │ │ │ ├── categorical_logit_log.hpp │ │ │ │ │ ├── categorical_logit_lpmf.hpp │ │ │ │ │ ├── categorical_logit_rng.hpp │ │ │ │ │ ├── categorical_lpmf.hpp │ │ │ │ │ ├── categorical_rng.hpp │ │ │ │ │ ├── cauchy_ccdf_log.hpp │ │ │ │ │ ├── cauchy_cdf.hpp │ │ │ │ │ ├── cauchy_cdf_log.hpp │ │ │ │ │ ├── cauchy_lccdf.hpp │ │ │ │ │ ├── cauchy_lcdf.hpp │ │ │ │ │ ├── cauchy_log.hpp │ │ │ │ │ ├── cauchy_lpdf.hpp │ │ │ │ │ ├── cauchy_rng.hpp │ │ │ │ │ ├── chi_square_ccdf_log.hpp │ │ │ │ │ ├── chi_square_cdf.hpp │ │ │ │ │ ├── chi_square_cdf_log.hpp │ │ │ │ │ ├── chi_square_lccdf.hpp │ │ │ │ │ ├── chi_square_lcdf.hpp │ │ │ │ │ ├── chi_square_log.hpp │ │ │ │ │ ├── chi_square_lpdf.hpp │ │ │ │ │ ├── chi_square_rng.hpp │ │ │ │ │ ├── dirichlet_log.hpp │ │ │ │ │ ├── dirichlet_lpdf.hpp │ │ │ │ │ ├── dirichlet_lpmf.hpp │ │ │ │ │ ├── dirichlet_multinomial_lpmf.hpp │ │ │ │ │ ├── dirichlet_multinomial_rng.hpp │ │ │ │ │ ├── dirichlet_rng.hpp │ │ │ │ │ ├── discrete_range_ccdf_log.hpp │ │ │ │ │ ├── discrete_range_cdf.hpp │ │ │ │ │ ├── discrete_range_cdf_log.hpp │ │ │ │ │ ├── discrete_range_lccdf.hpp │ │ │ │ │ ├── discrete_range_lcdf.hpp │ │ │ │ │ ├── discrete_range_log.hpp │ │ │ │ │ ├── discrete_range_lpmf.hpp │ │ │ │ │ ├── discrete_range_rng.hpp │ │ │ │ │ ├── double_exponential_ccdf_log.hpp │ │ │ │ │ ├── double_exponential_cdf.hpp │ │ │ │ │ ├── double_exponential_cdf_log.hpp │ │ │ │ │ ├── double_exponential_lccdf.hpp │ │ │ │ │ ├── double_exponential_lcdf.hpp │ │ │ │ │ ├── double_exponential_log.hpp │ │ │ │ │ ├── double_exponential_lpdf.hpp │ │ │ │ │ ├── double_exponential_rng.hpp │ │ │ │ │ ├── exp_mod_normal_ccdf_log.hpp │ │ │ │ │ ├── exp_mod_normal_cdf.hpp │ │ │ │ │ ├── exp_mod_normal_cdf_log.hpp │ │ │ │ │ ├── exp_mod_normal_lccdf.hpp │ │ │ │ │ ├── exp_mod_normal_lcdf.hpp │ │ │ │ │ ├── exp_mod_normal_log.hpp │ │ │ │ │ ├── exp_mod_normal_lpdf.hpp │ │ │ │ │ ├── exp_mod_normal_rng.hpp │ │ │ │ │ ├── exponential_ccdf_log.hpp │ │ │ │ │ ├── exponential_cdf.hpp │ │ │ │ │ ├── exponential_cdf_log.hpp │ │ │ │ │ ├── exponential_lccdf.hpp │ │ │ │ │ ├── exponential_lcdf.hpp │ │ │ │ │ ├── exponential_log.hpp │ │ │ │ │ ├── exponential_lpdf.hpp │ │ │ │ │ ├── exponential_rng.hpp │ │ │ │ │ ├── frechet_ccdf_log.hpp │ │ │ │ │ ├── frechet_cdf.hpp │ │ │ │ │ ├── frechet_cdf_log.hpp │ │ │ │ │ ├── frechet_lccdf.hpp │ │ │ │ │ ├── frechet_lcdf.hpp │ │ │ │ │ ├── frechet_log.hpp │ │ │ │ │ ├── frechet_lpdf.hpp │ │ │ │ │ ├── frechet_rng.hpp │ │ │ │ │ ├── gamma_ccdf_log.hpp │ │ │ │ │ ├── gamma_cdf.hpp │ │ │ │ │ ├── gamma_cdf_log.hpp │ │ │ │ │ ├── gamma_lccdf.hpp │ │ │ │ │ ├── gamma_lcdf.hpp │ │ │ │ │ ├── gamma_log.hpp │ │ │ │ │ ├── gamma_lpdf.hpp │ │ │ │ │ ├── gamma_rng.hpp │ │ │ │ │ ├── gaussian_dlm_obs_log.hpp │ │ │ │ │ ├── gaussian_dlm_obs_lpdf.hpp │ │ │ │ │ ├── gaussian_dlm_obs_rng.hpp │ │ │ │ │ ├── gumbel_ccdf_log.hpp │ │ │ │ │ ├── gumbel_cdf.hpp │ │ │ │ │ ├── gumbel_cdf_log.hpp │ │ │ │ │ ├── gumbel_lccdf.hpp │ │ │ │ │ ├── gumbel_lcdf.hpp │ │ │ │ │ ├── gumbel_log.hpp │ │ │ │ │ ├── gumbel_lpdf.hpp │ │ │ │ │ ├── gumbel_rng.hpp │ │ │ │ │ ├── hmm_hidden_state_prob.hpp │ │ │ │ │ ├── hmm_latent_rng.hpp │ │ │ │ │ ├── hmm_marginal.hpp │ │ │ │ │ ├── hypergeometric_log.hpp │ │ │ │ │ ├── hypergeometric_lpmf.hpp │ │ │ │ │ ├── hypergeometric_rng.hpp │ │ │ │ │ ├── inv_chi_square_ccdf_log.hpp │ │ │ │ │ ├── inv_chi_square_cdf.hpp │ │ │ │ │ ├── inv_chi_square_cdf_log.hpp │ │ │ │ │ ├── inv_chi_square_lccdf.hpp │ │ │ │ │ ├── inv_chi_square_lcdf.hpp │ │ │ │ │ ├── inv_chi_square_log.hpp │ │ │ │ │ ├── inv_chi_square_lpdf.hpp │ │ │ │ │ ├── inv_chi_square_rng.hpp │ │ │ │ │ ├── inv_gamma_ccdf_log.hpp │ │ │ │ │ ├── inv_gamma_cdf.hpp │ │ │ │ │ ├── inv_gamma_cdf_log.hpp │ │ │ │ │ ├── inv_gamma_lccdf.hpp │ │ │ │ │ ├── inv_gamma_lcdf.hpp │ │ │ │ │ ├── inv_gamma_log.hpp │ │ │ │ │ ├── inv_gamma_lpdf.hpp │ │ │ │ │ ├── inv_gamma_rng.hpp │ │ │ │ │ ├── inv_wishart_cholesky_lpdf.hpp │ │ │ │ │ ├── inv_wishart_cholesky_rng.hpp │ │ │ │ │ ├── inv_wishart_log.hpp │ │ │ │ │ ├── inv_wishart_lpdf.hpp │ │ │ │ │ ├── inv_wishart_rng.hpp │ │ │ │ │ ├── lkj_corr_cholesky_log.hpp │ │ │ │ │ ├── lkj_corr_cholesky_lpdf.hpp │ │ │ │ │ ├── lkj_corr_cholesky_rng.hpp │ │ │ │ │ ├── lkj_corr_log.hpp │ │ │ │ │ ├── lkj_corr_lpdf.hpp │ │ │ │ │ ├── lkj_corr_rng.hpp │ │ │ │ │ ├── lkj_cov_log.hpp │ │ │ │ │ ├── lkj_cov_lpdf.hpp │ │ │ │ │ ├── logistic_ccdf_log.hpp │ │ │ │ │ ├── logistic_cdf.hpp │ │ │ │ │ ├── logistic_cdf_log.hpp │ │ │ │ │ ├── logistic_lccdf.hpp │ │ │ │ │ ├── logistic_lcdf.hpp │ │ │ │ │ ├── logistic_log.hpp │ │ │ │ │ ├── logistic_lpdf.hpp │ │ │ │ │ ├── logistic_rng.hpp │ │ │ │ │ ├── loglogistic_cdf.hpp │ │ │ │ │ ├── loglogistic_log.hpp │ │ │ │ │ ├── loglogistic_lpdf.hpp │ │ │ │ │ ├── loglogistic_rng.hpp │ │ │ │ │ ├── lognormal_ccdf_log.hpp │ │ │ │ │ ├── lognormal_cdf.hpp │ │ │ │ │ ├── lognormal_cdf_log.hpp │ │ │ │ │ ├── lognormal_lccdf.hpp │ │ │ │ │ ├── lognormal_lcdf.hpp │ │ │ │ │ ├── lognormal_log.hpp │ │ │ │ │ ├── lognormal_lpdf.hpp │ │ │ │ │ ├── lognormal_rng.hpp │ │ │ │ │ ├── matrix_normal_prec_log.hpp │ │ │ │ │ ├── matrix_normal_prec_lpdf.hpp │ │ │ │ │ ├── matrix_normal_prec_rng.hpp │ │ │ │ │ ├── multi_gp_cholesky_log.hpp │ │ │ │ │ ├── multi_gp_cholesky_lpdf.hpp │ │ │ │ │ ├── multi_gp_log.hpp │ │ │ │ │ ├── multi_gp_lpdf.hpp │ │ │ │ │ ├── multi_normal_cholesky_log.hpp │ │ │ │ │ ├── multi_normal_cholesky_lpdf.hpp │ │ │ │ │ ├── multi_normal_cholesky_rng.hpp │ │ │ │ │ ├── multi_normal_log.hpp │ │ │ │ │ ├── multi_normal_lpdf.hpp │ │ │ │ │ ├── multi_normal_prec_log.hpp │ │ │ │ │ ├── multi_normal_prec_lpdf.hpp │ │ │ │ │ ├── multi_normal_prec_rng.hpp │ │ │ │ │ ├── multi_normal_rng.hpp │ │ │ │ │ ├── multi_student_t_cholesky_lpdf.hpp │ │ │ │ │ ├── multi_student_t_cholesky_rng.hpp │ │ │ │ │ ├── multi_student_t_log.hpp │ │ │ │ │ ├── multi_student_t_lpdf.hpp │ │ │ │ │ ├── multi_student_t_rng.hpp │ │ │ │ │ ├── multinomial_log.hpp │ │ │ │ │ ├── multinomial_logit_log.hpp │ │ │ │ │ ├── multinomial_logit_lpmf.hpp │ │ │ │ │ ├── multinomial_logit_rng.hpp │ │ │ │ │ ├── multinomial_lpmf.hpp │ │ │ │ │ ├── multinomial_rng.hpp │ │ │ │ │ ├── neg_binomial_2_ccdf_log.hpp │ │ │ │ │ ├── neg_binomial_2_cdf.hpp │ │ │ │ │ ├── neg_binomial_2_cdf_log.hpp │ │ │ │ │ ├── neg_binomial_2_lccdf.hpp │ │ │ │ │ ├── neg_binomial_2_lcdf.hpp │ │ │ │ │ ├── neg_binomial_2_log.hpp │ │ │ │ │ ├── neg_binomial_2_log_glm_log.hpp │ │ │ │ │ ├── neg_binomial_2_log_glm_lpmf.hpp │ │ │ │ │ ├── neg_binomial_2_log_log.hpp │ │ │ │ │ ├── neg_binomial_2_log_lpmf.hpp │ │ │ │ │ ├── neg_binomial_2_log_rng.hpp │ │ │ │ │ ├── neg_binomial_2_lpmf.hpp │ │ │ │ │ ├── neg_binomial_2_rng.hpp │ │ │ │ │ ├── neg_binomial_ccdf_log.hpp │ │ │ │ │ ├── neg_binomial_cdf.hpp │ │ │ │ │ ├── neg_binomial_cdf_log.hpp │ │ │ │ │ ├── neg_binomial_lccdf.hpp │ │ │ │ │ ├── neg_binomial_lcdf.hpp │ │ │ │ │ ├── neg_binomial_log.hpp │ │ │ │ │ ├── neg_binomial_lpmf.hpp │ │ │ │ │ ├── neg_binomial_rng.hpp │ │ │ │ │ ├── normal_ccdf_log.hpp │ │ │ │ │ ├── normal_cdf.hpp │ │ │ │ │ ├── normal_cdf_log.hpp │ │ │ │ │ ├── normal_id_glm_log.hpp │ │ │ │ │ ├── normal_id_glm_lpdf.hpp │ │ │ │ │ ├── normal_lccdf.hpp │ │ │ │ │ ├── normal_lcdf.hpp │ │ │ │ │ ├── normal_log.hpp │ │ │ │ │ ├── normal_lpdf.hpp │ │ │ │ │ ├── normal_rng.hpp │ │ │ │ │ ├── normal_sufficient_log.hpp │ │ │ │ │ ├── normal_sufficient_lpdf.hpp │ │ │ │ │ ├── ordered_logistic_glm_lpmf.hpp │ │ │ │ │ ├── ordered_logistic_log.hpp │ │ │ │ │ ├── ordered_logistic_lpmf.hpp │ │ │ │ │ ├── ordered_logistic_rng.hpp │ │ │ │ │ ├── ordered_probit_log.hpp │ │ │ │ │ ├── ordered_probit_lpmf.hpp │ │ │ │ │ ├── ordered_probit_rng.hpp │ │ │ │ │ ├── pareto_ccdf_log.hpp │ │ │ │ │ ├── pareto_cdf.hpp │ │ │ │ │ ├── pareto_cdf_log.hpp │ │ │ │ │ ├── pareto_lccdf.hpp │ │ │ │ │ ├── pareto_lcdf.hpp │ │ │ │ │ ├── pareto_log.hpp │ │ │ │ │ ├── pareto_lpdf.hpp │ │ │ │ │ ├── pareto_rng.hpp │ │ │ │ │ ├── pareto_type_2_ccdf_log.hpp │ │ │ │ │ ├── pareto_type_2_cdf.hpp │ │ │ │ │ ├── pareto_type_2_cdf_log.hpp │ │ │ │ │ ├── pareto_type_2_lccdf.hpp │ │ │ │ │ ├── pareto_type_2_lcdf.hpp │ │ │ │ │ ├── pareto_type_2_log.hpp │ │ │ │ │ ├── pareto_type_2_lpdf.hpp │ │ │ │ │ ├── pareto_type_2_rng.hpp │ │ │ │ │ ├── poisson_binomial_ccdf_log.hpp │ │ │ │ │ ├── poisson_binomial_cdf.hpp │ │ │ │ │ ├── poisson_binomial_cdf_log.hpp │ │ │ │ │ ├── poisson_binomial_lccdf.hpp │ │ │ │ │ ├── poisson_binomial_lcdf.hpp │ │ │ │ │ ├── poisson_binomial_log.hpp │ │ │ │ │ ├── poisson_binomial_lpmf.hpp │ │ │ │ │ ├── poisson_binomial_rng.hpp │ │ │ │ │ ├── poisson_ccdf_log.hpp │ │ │ │ │ ├── poisson_cdf.hpp │ │ │ │ │ ├── poisson_cdf_log.hpp │ │ │ │ │ ├── poisson_lccdf.hpp │ │ │ │ │ ├── poisson_lcdf.hpp │ │ │ │ │ ├── poisson_log.hpp │ │ │ │ │ ├── poisson_log_glm_log.hpp │ │ │ │ │ ├── poisson_log_glm_lpmf.hpp │ │ │ │ │ ├── poisson_log_log.hpp │ │ │ │ │ ├── poisson_log_lpmf.hpp │ │ │ │ │ ├── poisson_log_rng.hpp │ │ │ │ │ ├── poisson_lpmf.hpp │ │ │ │ │ ├── poisson_rng.hpp │ │ │ │ │ ├── rayleigh_ccdf_log.hpp │ │ │ │ │ ├── rayleigh_cdf.hpp │ │ │ │ │ ├── rayleigh_cdf_log.hpp │ │ │ │ │ ├── rayleigh_lccdf.hpp │ │ │ │ │ ├── rayleigh_lcdf.hpp │ │ │ │ │ ├── rayleigh_log.hpp │ │ │ │ │ ├── rayleigh_lpdf.hpp │ │ │ │ │ ├── rayleigh_rng.hpp │ │ │ │ │ ├── scaled_inv_chi_square_ccdf_log.hpp │ │ │ │ │ ├── scaled_inv_chi_square_cdf.hpp │ │ │ │ │ ├── scaled_inv_chi_square_cdf_log.hpp │ │ │ │ │ ├── scaled_inv_chi_square_lccdf.hpp │ │ │ │ │ ├── scaled_inv_chi_square_lcdf.hpp │ │ │ │ │ ├── scaled_inv_chi_square_log.hpp │ │ │ │ │ ├── scaled_inv_chi_square_lpdf.hpp │ │ │ │ │ ├── scaled_inv_chi_square_rng.hpp │ │ │ │ │ ├── skew_double_exponential_ccdf_log.hpp │ │ │ │ │ ├── skew_double_exponential_cdf.hpp │ │ │ │ │ ├── skew_double_exponential_cdf_log.hpp │ │ │ │ │ ├── skew_double_exponential_lccdf.hpp │ │ │ │ │ ├── skew_double_exponential_lcdf.hpp │ │ │ │ │ ├── skew_double_exponential_log.hpp │ │ │ │ │ ├── skew_double_exponential_lpdf.hpp │ │ │ │ │ ├── skew_double_exponential_rng.hpp │ │ │ │ │ ├── skew_normal_ccdf_log.hpp │ │ │ │ │ ├── skew_normal_cdf.hpp │ │ │ │ │ ├── skew_normal_cdf_log.hpp │ │ │ │ │ ├── skew_normal_lccdf.hpp │ │ │ │ │ ├── skew_normal_lcdf.hpp │ │ │ │ │ ├── skew_normal_log.hpp │ │ │ │ │ ├── skew_normal_lpdf.hpp │ │ │ │ │ ├── skew_normal_rng.hpp │ │ │ │ │ ├── std_normal_ccdf_log.hpp │ │ │ │ │ ├── std_normal_cdf.hpp │ │ │ │ │ ├── std_normal_cdf_log.hpp │ │ │ │ │ ├── std_normal_lccdf.hpp │ │ │ │ │ ├── std_normal_lcdf.hpp │ │ │ │ │ ├── std_normal_log.hpp │ │ │ │ │ ├── std_normal_log_qf.hpp │ │ │ │ │ ├── std_normal_lpdf.hpp │ │ │ │ │ ├── std_normal_rng.hpp │ │ │ │ │ ├── student_t_ccdf_log.hpp │ │ │ │ │ ├── student_t_cdf.hpp │ │ │ │ │ ├── student_t_cdf_log.hpp │ │ │ │ │ ├── student_t_lccdf.hpp │ │ │ │ │ ├── student_t_lcdf.hpp │ │ │ │ │ ├── student_t_log.hpp │ │ │ │ │ ├── student_t_lpdf.hpp │ │ │ │ │ ├── student_t_rng.hpp │ │ │ │ │ ├── uniform_ccdf_log.hpp │ │ │ │ │ ├── uniform_cdf.hpp │ │ │ │ │ ├── uniform_cdf_log.hpp │ │ │ │ │ ├── uniform_lccdf.hpp │ │ │ │ │ ├── uniform_lcdf.hpp │ │ │ │ │ ├── uniform_log.hpp │ │ │ │ │ ├── uniform_lpdf.hpp │ │ │ │ │ ├── uniform_rng.hpp │ │ │ │ │ ├── von_mises_ccdf_log.hpp │ │ │ │ │ ├── von_mises_cdf.hpp │ │ │ │ │ ├── von_mises_cdf_log.hpp │ │ │ │ │ ├── von_mises_lccdf.hpp │ │ │ │ │ ├── von_mises_lcdf.hpp │ │ │ │ │ ├── von_mises_log.hpp │ │ │ │ │ ├── von_mises_lpdf.hpp │ │ │ │ │ ├── von_mises_rng.hpp │ │ │ │ │ ├── weibull_ccdf_log.hpp │ │ │ │ │ ├── weibull_cdf.hpp │ │ │ │ │ ├── weibull_cdf_log.hpp │ │ │ │ │ ├── weibull_lccdf.hpp │ │ │ │ │ ├── weibull_lcdf.hpp │ │ │ │ │ ├── weibull_log.hpp │ │ │ │ │ ├── weibull_lpdf.hpp │ │ │ │ │ ├── weibull_rng.hpp │ │ │ │ │ ├── wiener5_lpdf.hpp │ │ │ │ │ ├── wiener_full_lpdf.hpp │ │ │ │ │ ├── wiener_log.hpp │ │ │ │ │ ├── wiener_lpdf.hpp │ │ │ │ │ ├── wishart_cholesky_lpdf.hpp │ │ │ │ │ ├── wishart_cholesky_rng.hpp │ │ │ │ │ ├── wishart_log.hpp │ │ │ │ │ ├── wishart_lpdf.hpp │ │ │ │ │ └── wishart_rng.hpp │ │ │ ├── rev.hpp │ │ │ ├── rev │ │ │ │ ├── core.hpp │ │ │ │ ├── core │ │ │ │ │ ├── Eigen_NumTraits.hpp │ │ │ │ │ ├── accumulate_adjoints.hpp │ │ │ │ │ ├── arena_allocator.hpp │ │ │ │ │ ├── arena_matrix.hpp │ │ │ │ │ ├── autodiffstackstorage.hpp │ │ │ │ │ ├── build_vari_array.hpp │ │ │ │ │ ├── callback_vari.hpp │ │ │ │ │ ├── chainable_alloc.hpp │ │ │ │ │ ├── chainable_object.hpp │ │ │ │ │ ├── chainablestack.hpp │ │ │ │ │ ├── count_vars.hpp │ │ │ │ │ ├── ddv_vari.hpp │ │ │ │ │ ├── deep_copy_vars.hpp │ │ │ │ │ ├── dv_vari.hpp │ │ │ │ │ ├── dvd_vari.hpp │ │ │ │ │ ├── dvv_vari.hpp │ │ │ │ │ ├── empty_nested.hpp │ │ │ │ │ ├── gevv_vvv_vari.hpp │ │ │ │ │ ├── grad.hpp │ │ │ │ │ ├── init_chainablestack.hpp │ │ │ │ │ ├── matrix_vari.hpp │ │ │ │ │ ├── nested_rev_autodiff.hpp │ │ │ │ │ ├── nested_size.hpp │ │ │ │ │ ├── operator_addition.hpp │ │ │ │ │ ├── operator_divide_equal.hpp │ │ │ │ │ ├── operator_division.hpp │ │ │ │ │ ├── operator_equal.hpp │ │ │ │ │ ├── operator_greater_than.hpp │ │ │ │ │ ├── operator_greater_than_or_equal.hpp │ │ │ │ │ ├── operator_less_than.hpp │ │ │ │ │ ├── operator_less_than_or_equal.hpp │ │ │ │ │ ├── operator_logical_and.hpp │ │ │ │ │ ├── operator_logical_or.hpp │ │ │ │ │ ├── operator_minus_equal.hpp │ │ │ │ │ ├── operator_multiplication.hpp │ │ │ │ │ ├── operator_multiply_equal.hpp │ │ │ │ │ ├── operator_not_equal.hpp │ │ │ │ │ ├── operator_plus_equal.hpp │ │ │ │ │ ├── operator_subtraction.hpp │ │ │ │ │ ├── operator_unary_decrement.hpp │ │ │ │ │ ├── operator_unary_increment.hpp │ │ │ │ │ ├── operator_unary_negative.hpp │ │ │ │ │ ├── operator_unary_not.hpp │ │ │ │ │ ├── operator_unary_plus.hpp │ │ │ │ │ ├── precomp_vv_vari.hpp │ │ │ │ │ ├── precomp_vvv_vari.hpp │ │ │ │ │ ├── precomputed_gradients.hpp │ │ │ │ │ ├── print_stack.hpp │ │ │ │ │ ├── profiling.hpp │ │ │ │ │ ├── read_var.hpp │ │ │ │ │ ├── recover_memory.hpp │ │ │ │ │ ├── recover_memory_nested.hpp │ │ │ │ │ ├── reverse_pass_callback.hpp │ │ │ │ │ ├── save_varis.hpp │ │ │ │ │ ├── scoped_chainablestack.hpp │ │ │ │ │ ├── set_zero_all_adjoints.hpp │ │ │ │ │ ├── set_zero_all_adjoints_nested.hpp │ │ │ │ │ ├── start_nested.hpp │ │ │ │ │ ├── std_complex.hpp │ │ │ │ │ ├── std_isinf.hpp │ │ │ │ │ ├── std_isnan.hpp │ │ │ │ │ ├── std_iterator_traits.hpp │ │ │ │ │ ├── std_numeric_limits.hpp │ │ │ │ │ ├── stored_gradient_vari.hpp │ │ │ │ │ ├── typedefs.hpp │ │ │ │ │ ├── v_vari.hpp │ │ │ │ │ ├── var.hpp │ │ │ │ │ ├── var_value_fwd_declare.hpp │ │ │ │ │ ├── vari.hpp │ │ │ │ │ ├── vd_vari.hpp │ │ │ │ │ ├── vdd_vari.hpp │ │ │ │ │ ├── vdv_vari.hpp │ │ │ │ │ ├── vector_vari.hpp │ │ │ │ │ ├── vv_vari.hpp │ │ │ │ │ ├── vvd_vari.hpp │ │ │ │ │ ├── vvv_vari.hpp │ │ │ │ │ └── zero_adjoints.hpp │ │ │ │ ├── fun.hpp │ │ │ │ ├── fun │ │ │ │ │ ├── LDLT_factor.hpp │ │ │ │ │ ├── Phi.hpp │ │ │ │ │ ├── Phi_approx.hpp │ │ │ │ │ ├── abs.hpp │ │ │ │ │ ├── accumulator.hpp │ │ │ │ │ ├── acos.hpp │ │ │ │ │ ├── acosh.hpp │ │ │ │ │ ├── adjoint_of.hpp │ │ │ │ │ ├── append_col.hpp │ │ │ │ │ ├── append_row.hpp │ │ │ │ │ ├── arg.hpp │ │ │ │ │ ├── as_array_or_scalar.hpp │ │ │ │ │ ├── as_bool.hpp │ │ │ │ │ ├── as_column_vector_or_scalar.hpp │ │ │ │ │ ├── asin.hpp │ │ │ │ │ ├── asinh.hpp │ │ │ │ │ ├── atan.hpp │ │ │ │ │ ├── atan2.hpp │ │ │ │ │ ├── atanh.hpp │ │ │ │ │ ├── bessel_first_kind.hpp │ │ │ │ │ ├── bessel_second_kind.hpp │ │ │ │ │ ├── beta.hpp │ │ │ │ │ ├── binary_log_loss.hpp │ │ │ │ │ ├── cbrt.hpp │ │ │ │ │ ├── ceil.hpp │ │ │ │ │ ├── cholesky_corr_constrain.hpp │ │ │ │ │ ├── cholesky_decompose.hpp │ │ │ │ │ ├── cholesky_factor_constrain.hpp │ │ │ │ │ ├── columns_dot_product.hpp │ │ │ │ │ ├── columns_dot_self.hpp │ │ │ │ │ ├── conj.hpp │ │ │ │ │ ├── corr_matrix_constrain.hpp │ │ │ │ │ ├── cos.hpp │ │ │ │ │ ├── cosh.hpp │ │ │ │ │ ├── cov_exp_quad.hpp │ │ │ │ │ ├── cov_matrix_constrain.hpp │ │ │ │ │ ├── cov_matrix_constrain_lkj.hpp │ │ │ │ │ ├── csr_matrix_times_vector.hpp │ │ │ │ │ ├── cumulative_sum.hpp │ │ │ │ │ ├── determinant.hpp │ │ │ │ │ ├── diag_post_multiply.hpp │ │ │ │ │ ├── diag_pre_multiply.hpp │ │ │ │ │ ├── digamma.hpp │ │ │ │ │ ├── dims.hpp │ │ │ │ │ ├── divide.hpp │ │ │ │ │ ├── dot_product.hpp │ │ │ │ │ ├── dot_self.hpp │ │ │ │ │ ├── eigendecompose_sym.hpp │ │ │ │ │ ├── eigenvalues_sym.hpp │ │ │ │ │ ├── eigenvectors_sym.hpp │ │ │ │ │ ├── elt_divide.hpp │ │ │ │ │ ├── elt_multiply.hpp │ │ │ │ │ ├── erf.hpp │ │ │ │ │ ├── erfc.hpp │ │ │ │ │ ├── exp.hpp │ │ │ │ │ ├── exp2.hpp │ │ │ │ │ ├── expm1.hpp │ │ │ │ │ ├── fabs.hpp │ │ │ │ │ ├── falling_factorial.hpp │ │ │ │ │ ├── fdim.hpp │ │ │ │ │ ├── fft.hpp │ │ │ │ │ ├── fill.hpp │ │ │ │ │ ├── floor.hpp │ │ │ │ │ ├── fma.hpp │ │ │ │ │ ├── fmax.hpp │ │ │ │ │ ├── fmin.hpp │ │ │ │ │ ├── fmod.hpp │ │ │ │ │ ├── from_var_value.hpp │ │ │ │ │ ├── gamma_p.hpp │ │ │ │ │ ├── gamma_q.hpp │ │ │ │ │ ├── generalized_inverse.hpp │ │ │ │ │ ├── gp_exp_quad_cov.hpp │ │ │ │ │ ├── gp_periodic_cov.hpp │ │ │ │ │ ├── grad.hpp │ │ │ │ │ ├── grad_inc_beta.hpp │ │ │ │ │ ├── hypergeometric_1F0.hpp │ │ │ │ │ ├── hypergeometric_2F1.hpp │ │ │ │ │ ├── hypergeometric_pFq.hpp │ │ │ │ │ ├── hypot.hpp │ │ │ │ │ ├── identity_constrain.hpp │ │ │ │ │ ├── identity_free.hpp │ │ │ │ │ ├── if_else.hpp │ │ │ │ │ ├── inc_beta.hpp │ │ │ │ │ ├── initialize_fill.hpp │ │ │ │ │ ├── initialize_variable.hpp │ │ │ │ │ ├── inv.hpp │ │ │ │ │ ├── inv_Phi.hpp │ │ │ │ │ ├── inv_cloglog.hpp │ │ │ │ │ ├── inv_erfc.hpp │ │ │ │ │ ├── inv_inc_beta.hpp │ │ │ │ │ ├── inv_logit.hpp │ │ │ │ │ ├── inv_sqrt.hpp │ │ │ │ │ ├── inv_square.hpp │ │ │ │ │ ├── inverse.hpp │ │ │ │ │ ├── is_inf.hpp │ │ │ │ │ ├── is_nan.hpp │ │ │ │ │ ├── is_uninitialized.hpp │ │ │ │ │ ├── lambert_w.hpp │ │ │ │ │ ├── lb_constrain.hpp │ │ │ │ │ ├── lbeta.hpp │ │ │ │ │ ├── ldexp.hpp │ │ │ │ │ ├── lgamma.hpp │ │ │ │ │ ├── lmgamma.hpp │ │ │ │ │ ├── lmultiply.hpp │ │ │ │ │ ├── log.hpp │ │ │ │ │ ├── log10.hpp │ │ │ │ │ ├── log1m.hpp │ │ │ │ │ ├── log1m_exp.hpp │ │ │ │ │ ├── log1m_inv_logit.hpp │ │ │ │ │ ├── log1p.hpp │ │ │ │ │ ├── log1p_exp.hpp │ │ │ │ │ ├── log2.hpp │ │ │ │ │ ├── log_determinant.hpp │ │ │ │ │ ├── log_determinant_ldlt.hpp │ │ │ │ │ ├── log_determinant_spd.hpp │ │ │ │ │ ├── log_diff_exp.hpp │ │ │ │ │ ├── log_falling_factorial.hpp │ │ │ │ │ ├── log_inv_logit.hpp │ │ │ │ │ ├── log_inv_logit_diff.hpp │ │ │ │ │ ├── log_mix.hpp │ │ │ │ │ ├── log_rising_factorial.hpp │ │ │ │ │ ├── log_softmax.hpp │ │ │ │ │ ├── log_sum_exp.hpp │ │ │ │ │ ├── logit.hpp │ │ │ │ │ ├── lub_constrain.hpp │ │ │ │ │ ├── matrix_exp_multiply.hpp │ │ │ │ │ ├── matrix_power.hpp │ │ │ │ │ ├── mdivide_left.hpp │ │ │ │ │ ├── mdivide_left_ldlt.hpp │ │ │ │ │ ├── mdivide_left_spd.hpp │ │ │ │ │ ├── mdivide_left_tri.hpp │ │ │ │ │ ├── modified_bessel_first_kind.hpp │ │ │ │ │ ├── modified_bessel_second_kind.hpp │ │ │ │ │ ├── multiply.hpp │ │ │ │ │ ├── multiply_log.hpp │ │ │ │ │ ├── multiply_lower_tri_self_transpose.hpp │ │ │ │ │ ├── norm.hpp │ │ │ │ │ ├── norm1.hpp │ │ │ │ │ ├── norm2.hpp │ │ │ │ │ ├── ordered_constrain.hpp │ │ │ │ │ ├── owens_t.hpp │ │ │ │ │ ├── polar.hpp │ │ │ │ │ ├── positive_ordered_constrain.hpp │ │ │ │ │ ├── pow.hpp │ │ │ │ │ ├── primitive_value.hpp │ │ │ │ │ ├── proj.hpp │ │ │ │ │ ├── quad_form.hpp │ │ │ │ │ ├── quad_form_sym.hpp │ │ │ │ │ ├── read_corr_L.hpp │ │ │ │ │ ├── read_corr_matrix.hpp │ │ │ │ │ ├── read_cov_L.hpp │ │ │ │ │ ├── read_cov_matrix.hpp │ │ │ │ │ ├── rep_matrix.hpp │ │ │ │ │ ├── rep_row_vector.hpp │ │ │ │ │ ├── rep_vector.hpp │ │ │ │ │ ├── rising_factorial.hpp │ │ │ │ │ ├── round.hpp │ │ │ │ │ ├── rows_dot_product.hpp │ │ │ │ │ ├── rows_dot_self.hpp │ │ │ │ │ ├── sd.hpp │ │ │ │ │ ├── simplex_constrain.hpp │ │ │ │ │ ├── sin.hpp │ │ │ │ │ ├── singular_values.hpp │ │ │ │ │ ├── sinh.hpp │ │ │ │ │ ├── softmax.hpp │ │ │ │ │ ├── sqrt.hpp │ │ │ │ │ ├── square.hpp │ │ │ │ │ ├── squared_distance.hpp │ │ │ │ │ ├── stan_print.hpp │ │ │ │ │ ├── step.hpp │ │ │ │ │ ├── stochastic_column_constrain.hpp │ │ │ │ │ ├── stochastic_row_constrain.hpp │ │ │ │ │ ├── sum.hpp │ │ │ │ │ ├── svd.hpp │ │ │ │ │ ├── svd_U.hpp │ │ │ │ │ ├── svd_V.hpp │ │ │ │ │ ├── tan.hpp │ │ │ │ │ ├── tanh.hpp │ │ │ │ │ ├── tcrossprod.hpp │ │ │ │ │ ├── tgamma.hpp │ │ │ │ │ ├── to_arena.hpp │ │ │ │ │ ├── to_soa_sparse_matrix.hpp │ │ │ │ │ ├── to_var.hpp │ │ │ │ │ ├── to_var_value.hpp │ │ │ │ │ ├── to_vector.hpp │ │ │ │ │ ├── trace.hpp │ │ │ │ │ ├── trace_gen_inv_quad_form_ldlt.hpp │ │ │ │ │ ├── trace_gen_quad_form.hpp │ │ │ │ │ ├── trace_inv_quad_form_ldlt.hpp │ │ │ │ │ ├── trace_quad_form.hpp │ │ │ │ │ ├── trigamma.hpp │ │ │ │ │ ├── trunc.hpp │ │ │ │ │ ├── ub_constrain.hpp │ │ │ │ │ ├── unit_vector_constrain.hpp │ │ │ │ │ ├── value_of.hpp │ │ │ │ │ ├── value_of_rec.hpp │ │ │ │ │ └── variance.hpp │ │ │ │ ├── functor.hpp │ │ │ │ ├── functor │ │ │ │ │ ├── algebra_solver_fp.hpp │ │ │ │ │ ├── algebra_system.hpp │ │ │ │ │ ├── apply_scalar_binary.hpp │ │ │ │ │ ├── apply_scalar_unary.hpp │ │ │ │ │ ├── apply_vector_unary.hpp │ │ │ │ │ ├── coupled_ode_system.hpp │ │ │ │ │ ├── cvodes_integrator.hpp │ │ │ │ │ ├── cvodes_integrator_adjoint.hpp │ │ │ │ │ ├── cvodes_utils.hpp │ │ │ │ │ ├── dae.hpp │ │ │ │ │ ├── dae_system.hpp │ │ │ │ │ ├── finite_diff_hessian_auto.hpp │ │ │ │ │ ├── finite_diff_hessian_times_vector_auto.hpp │ │ │ │ │ ├── gradient.hpp │ │ │ │ │ ├── idas_integrator.hpp │ │ │ │ │ ├── idas_service.hpp │ │ │ │ │ ├── integrate_1d.hpp │ │ │ │ │ ├── integrate_ode_adams.hpp │ │ │ │ │ ├── integrate_ode_bdf.hpp │ │ │ │ │ ├── jacobian.hpp │ │ │ │ │ ├── kinsol_data.hpp │ │ │ │ │ ├── kinsol_solve.hpp │ │ │ │ │ ├── map_rect_concurrent.hpp │ │ │ │ │ ├── map_rect_reduce.hpp │ │ │ │ │ ├── ode_adams.hpp │ │ │ │ │ ├── ode_adjoint.hpp │ │ │ │ │ ├── ode_bdf.hpp │ │ │ │ │ ├── ode_store_sensitivities.hpp │ │ │ │ │ ├── operands_and_partials.hpp │ │ │ │ │ ├── partials_propagator.hpp │ │ │ │ │ ├── reduce_sum.hpp │ │ │ │ │ ├── solve_newton.hpp │ │ │ │ │ └── solve_powell.hpp │ │ │ │ ├── meta.hpp │ │ │ │ ├── meta │ │ │ │ │ ├── arena_type.hpp │ │ │ │ │ ├── conditional_var_value.hpp │ │ │ │ │ ├── is_arena_matrix.hpp │ │ │ │ │ ├── is_rev_matrix.hpp │ │ │ │ │ ├── is_var.hpp │ │ │ │ │ ├── is_vari.hpp │ │ │ │ │ ├── modify_eigen_options.hpp │ │ │ │ │ ├── partials_type.hpp │ │ │ │ │ ├── plain_type.hpp │ │ │ │ │ ├── promote_var_matrix.hpp │ │ │ │ │ ├── return_var_matrix.hpp │ │ │ │ │ └── rev_matrix_type.hpp │ │ │ │ ├── prob.hpp │ │ │ │ └── prob │ │ │ │ │ └── std_normal_log_qf.hpp │ │ │ └── version.hpp │ │ ├── mcmc │ │ │ ├── base_adaptation.hpp │ │ │ ├── base_adapter.hpp │ │ │ ├── base_mcmc.hpp │ │ │ ├── chains.hpp │ │ │ ├── covar_adaptation.hpp │ │ │ ├── fixed_param_sampler.hpp │ │ │ ├── hmc │ │ │ │ ├── base_hmc.hpp │ │ │ │ ├── hamiltonians │ │ │ │ │ ├── base_hamiltonian.hpp │ │ │ │ │ ├── dense_e_metric.hpp │ │ │ │ │ ├── dense_e_point.hpp │ │ │ │ │ ├── diag_e_metric.hpp │ │ │ │ │ ├── diag_e_point.hpp │ │ │ │ │ ├── ps_point.hpp │ │ │ │ │ ├── softabs_metric.hpp │ │ │ │ │ ├── softabs_point.hpp │ │ │ │ │ ├── unit_e_metric.hpp │ │ │ │ │ └── unit_e_point.hpp │ │ │ │ ├── integrators │ │ │ │ │ ├── base_integrator.hpp │ │ │ │ │ ├── base_leapfrog.hpp │ │ │ │ │ ├── expl_leapfrog.hpp │ │ │ │ │ └── impl_leapfrog.hpp │ │ │ │ ├── nuts │ │ │ │ │ ├── adapt_dense_e_nuts.hpp │ │ │ │ │ ├── adapt_diag_e_nuts.hpp │ │ │ │ │ ├── adapt_softabs_nuts.hpp │ │ │ │ │ ├── adapt_unit_e_nuts.hpp │ │ │ │ │ ├── base_nuts.hpp │ │ │ │ │ ├── dense_e_nuts.hpp │ │ │ │ │ ├── diag_e_nuts.hpp │ │ │ │ │ ├── softabs_nuts.hpp │ │ │ │ │ └── unit_e_nuts.hpp │ │ │ │ ├── nuts_classic │ │ │ │ │ ├── adapt_dense_e_nuts_classic.hpp │ │ │ │ │ ├── adapt_diag_e_nuts_classic.hpp │ │ │ │ │ ├── adapt_unit_e_nuts_classic.hpp │ │ │ │ │ ├── base_nuts_classic.hpp │ │ │ │ │ ├── dense_e_nuts_classic.hpp │ │ │ │ │ ├── diag_e_nuts_classic.hpp │ │ │ │ │ └── unit_e_nuts_classic.hpp │ │ │ │ ├── static │ │ │ │ │ ├── adapt_dense_e_static_hmc.hpp │ │ │ │ │ ├── adapt_diag_e_static_hmc.hpp │ │ │ │ │ ├── adapt_softabs_static_hmc.hpp │ │ │ │ │ ├── adapt_unit_e_static_hmc.hpp │ │ │ │ │ ├── base_static_hmc.hpp │ │ │ │ │ ├── dense_e_static_hmc.hpp │ │ │ │ │ ├── diag_e_static_hmc.hpp │ │ │ │ │ ├── softabs_static_hmc.hpp │ │ │ │ │ └── unit_e_static_hmc.hpp │ │ │ │ ├── static_uniform │ │ │ │ │ ├── adapt_dense_e_static_uniform.hpp │ │ │ │ │ ├── adapt_diag_e_static_uniform.hpp │ │ │ │ │ ├── adapt_softabs_static_uniform.hpp │ │ │ │ │ ├── adapt_unit_e_static_uniform.hpp │ │ │ │ │ ├── base_static_uniform.hpp │ │ │ │ │ ├── dense_e_static_uniform.hpp │ │ │ │ │ ├── diag_e_static_uniform.hpp │ │ │ │ │ ├── softabs_static_uniform.hpp │ │ │ │ │ └── unit_e_static_uniform.hpp │ │ │ │ └── xhmc │ │ │ │ │ ├── adapt_dense_e_xhmc.hpp │ │ │ │ │ ├── adapt_diag_e_xhmc.hpp │ │ │ │ │ ├── adapt_softabs_xhmc.hpp │ │ │ │ │ ├── adapt_unit_e_xhmc.hpp │ │ │ │ │ ├── base_xhmc.hpp │ │ │ │ │ ├── dense_e_xhmc.hpp │ │ │ │ │ ├── diag_e_xhmc.hpp │ │ │ │ │ ├── softabs_xhmc.hpp │ │ │ │ │ └── unit_e_xhmc.hpp │ │ │ ├── sample.hpp │ │ │ ├── stepsize_adaptation.hpp │ │ │ ├── stepsize_adapter.hpp │ │ │ ├── stepsize_covar_adapter.hpp │ │ │ ├── stepsize_var_adapter.hpp │ │ │ ├── var_adaptation.hpp │ │ │ └── windowed_adaptation.hpp │ │ ├── model │ │ │ ├── finite_diff_grad.hpp │ │ │ ├── grad_hess_log_prob.hpp │ │ │ ├── grad_tr_mat_times_hessian.hpp │ │ │ ├── gradient.hpp │ │ │ ├── gradient_dot_vector.hpp │ │ │ ├── hessian.hpp │ │ │ ├── hessian_times_vector.hpp │ │ │ ├── indexing.hpp │ │ │ ├── indexing │ │ │ │ ├── access_helpers.hpp │ │ │ │ ├── assign.hpp │ │ │ │ ├── assign_cl.hpp │ │ │ │ ├── assign_varmat.hpp │ │ │ │ ├── deep_copy.hpp │ │ │ │ ├── index.hpp │ │ │ │ ├── rvalue.hpp │ │ │ │ ├── rvalue_at.hpp │ │ │ │ ├── rvalue_cl.hpp │ │ │ │ ├── rvalue_index_size.hpp │ │ │ │ └── rvalue_varmat.hpp │ │ │ ├── log_prob_grad.hpp │ │ │ ├── log_prob_propto.hpp │ │ │ ├── model_base.hpp │ │ │ ├── model_base_crtp.hpp │ │ │ ├── model_functional.hpp │ │ │ ├── model_header.hpp │ │ │ ├── prob_grad.hpp │ │ │ ├── rethrow_located.hpp │ │ │ └── test_gradients.hpp │ │ ├── optimization │ │ │ ├── bfgs.hpp │ │ │ ├── bfgs_linesearch.hpp │ │ │ ├── bfgs_update.hpp │ │ │ ├── lbfgs_update.hpp │ │ │ └── newton.hpp │ │ ├── services │ │ │ ├── diagnose │ │ │ │ ├── defaults.hpp │ │ │ │ └── diagnose.hpp │ │ │ ├── error_codes.hpp │ │ │ ├── experimental │ │ │ │ └── advi │ │ │ │ │ ├── defaults.hpp │ │ │ │ │ ├── fullrank.hpp │ │ │ │ │ └── meanfield.hpp │ │ │ ├── optimize │ │ │ │ ├── bfgs.hpp │ │ │ │ ├── defaults.hpp │ │ │ │ ├── laplace_sample.hpp │ │ │ │ ├── lbfgs.hpp │ │ │ │ └── newton.hpp │ │ │ ├── pathfinder │ │ │ │ ├── multi.hpp │ │ │ │ ├── psis.hpp │ │ │ │ └── single.hpp │ │ │ ├── sample │ │ │ │ ├── defaults.hpp │ │ │ │ ├── fixed_param.hpp │ │ │ │ ├── hmc_nuts_dense_e.hpp │ │ │ │ ├── hmc_nuts_dense_e_adapt.hpp │ │ │ │ ├── hmc_nuts_diag_e.hpp │ │ │ │ ├── hmc_nuts_diag_e_adapt.hpp │ │ │ │ ├── hmc_nuts_unit_e.hpp │ │ │ │ ├── hmc_nuts_unit_e_adapt.hpp │ │ │ │ ├── hmc_static_dense_e.hpp │ │ │ │ ├── hmc_static_dense_e_adapt.hpp │ │ │ │ ├── hmc_static_diag_e.hpp │ │ │ │ ├── hmc_static_diag_e_adapt.hpp │ │ │ │ ├── hmc_static_unit_e.hpp │ │ │ │ ├── hmc_static_unit_e_adapt.hpp │ │ │ │ └── standalone_gqs.hpp │ │ │ └── util │ │ │ │ ├── create_rng.hpp │ │ │ │ ├── create_unit_e_dense_inv_metric.hpp │ │ │ │ ├── create_unit_e_diag_inv_metric.hpp │ │ │ │ ├── duration_diff.hpp │ │ │ │ ├── experimental_message.hpp │ │ │ │ ├── generate_transitions.hpp │ │ │ │ ├── gq_writer.hpp │ │ │ │ ├── initialize.hpp │ │ │ │ ├── inv_metric.hpp │ │ │ │ ├── mcmc_writer.hpp │ │ │ │ ├── read_dense_inv_metric.hpp │ │ │ │ ├── read_diag_inv_metric.hpp │ │ │ │ ├── run_adaptive_sampler.hpp │ │ │ │ ├── run_sampler.hpp │ │ │ │ ├── validate_dense_inv_metric.hpp │ │ │ │ └── validate_diag_inv_metric.hpp │ │ ├── variational │ │ │ ├── advi.hpp │ │ │ ├── base_family.hpp │ │ │ ├── families │ │ │ │ ├── normal_fullrank.hpp │ │ │ │ └── normal_meanfield.hpp │ │ │ └── print_progress.hpp │ │ └── version.hpp │ ├── stan_sundials_printf_override.hpp │ ├── sundials │ │ ├── sundials_band.h │ │ ├── sundials_config.h │ │ ├── sundials_config.in │ │ ├── sundials_context.h │ │ ├── sundials_cuda_policies.hpp │ │ ├── sundials_dense.h │ │ ├── sundials_direct.h │ │ ├── sundials_export.h │ │ ├── sundials_futils.h │ │ ├── sundials_hip_policies.hpp │ │ ├── sundials_iterative.h │ │ ├── sundials_lapack.h │ │ ├── sundials_linearsolver.h │ │ ├── sundials_math.h │ │ ├── sundials_matrix.h │ │ ├── sundials_memory.h │ │ ├── sundials_mpi_types.h │ │ ├── sundials_nonlinearsolver.h │ │ ├── sundials_nvector.h │ │ ├── sundials_nvector_senswrapper.h │ │ ├── sundials_profiler.h │ │ ├── sundials_sycl_policies.hpp │ │ ├── sundials_types.h │ │ ├── sundials_version.h │ │ └── sundials_xbraid.h │ ├── sundials_debug.h │ ├── sunlinsol │ │ ├── sunlinsol_band.h │ │ ├── sunlinsol_cusolversp_batchqr.h │ │ ├── sunlinsol_dense.h │ │ ├── sunlinsol_klu.h │ │ ├── sunlinsol_lapackband.h │ │ ├── sunlinsol_lapackdense.h │ │ ├── sunlinsol_magmadense.h │ │ ├── sunlinsol_onemkldense.h │ │ ├── sunlinsol_pcg.h │ │ ├── sunlinsol_spbcgs.h │ │ ├── sunlinsol_spfgmr.h │ │ ├── sunlinsol_spgmr.h │ │ ├── sunlinsol_sptfqmr.h │ │ ├── sunlinsol_superludist.h │ │ └── sunlinsol_superlumt.h │ ├── sunmatrix │ │ ├── sunmatrix_band.h │ │ ├── sunmatrix_cusparse.h │ │ ├── sunmatrix_dense.h │ │ ├── sunmatrix_magmadense.h │ │ ├── sunmatrix_onemkldense.h │ │ ├── sunmatrix_slunrloc.h │ │ └── sunmatrix_sparse.h │ ├── sunmemory │ │ ├── sunmemory_cuda.h │ │ ├── sunmemory_hip.h │ │ ├── sunmemory_sycl.h │ │ └── sunmemory_system.h │ └── sunnonlinsol │ │ ├── sunnonlinsol_fixedpoint.h │ │ ├── sunnonlinsol_newton.h │ │ └── sunnonlinsol_petscsnes.h └── upgrade_headers.sh ├── man ├── StanBase-class.Rd ├── StanEstimators-package.Rd ├── constrain_variables-methods.Rd ├── grad_log_prob-methods.Rd ├── hessian-methods.Rd ├── log_prob-methods.Rd ├── loo.StanBase.Rd ├── stan_diagnose.Rd ├── stan_laplace.Rd ├── stan_optimize.Rd ├── stan_pathfinder.Rd ├── stan_sample.Rd ├── stan_variational.Rd ├── stan_versions.Rd ├── summary-StanLaplace.Rd ├── summary-StanMCMC.Rd ├── summary-StanOptimize.Rd ├── summary-StanPathfinder.Rd ├── summary-StanVariational.Rd ├── unconstrain_draws-methods.Rd └── unconstrain_variables-methods.Rd ├── src ├── Makevars ├── StanEstimators.cpp └── init.cpp ├── tests ├── testthat.R └── testthat │ ├── test-basic.R │ ├── test-captures.R │ └── test-model-methods.R └── vignettes ├── .gitignore └── Getting-Started.Rmd /.Rbuildignore: -------------------------------------------------------------------------------- 1 | ^StanEstimators\.Rproj$ 2 | ^\.Rproj\.user$ 3 | ^LICENSE\.md$ 4 | ^README\.Rmd$ 5 | .vscode 6 | ^\.github$ 7 | -------------------------------------------------------------------------------- /.github/.gitignore: -------------------------------------------------------------------------------- 1 | *.html 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .Rproj.user 2 | **.o 3 | **.so 4 | inst/lib 5 | inst/doc 6 | .vscode -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | YEAR: 2023 2 | COPYRIGHT HOLDER: StanEstimators authors 3 | -------------------------------------------------------------------------------- /R/StanEstimators-package.R: -------------------------------------------------------------------------------- 1 | #' The StanEstimators package. 2 | #' 3 | #' @description ToDO 4 | #' 5 | #' @docType package 6 | #' @name StanEstimators-package 7 | #' @aliases StanEstimators 8 | #' @useDynLib StanEstimators, .registration = TRUE 9 | #' 10 | #' @importFrom RcppParallel RcppParallelLibs 11 | #' @importFrom Rcpp RcppLdFlags 12 | #' @importFrom posterior as_draws_df subset_draws 13 | #' @importFrom stats setNames runif 14 | #' @importFrom methods new 15 | #' 16 | "_PACKAGE" 17 | -------------------------------------------------------------------------------- /StanEstimators.Rproj: -------------------------------------------------------------------------------- 1 | Version: 1.0 2 | 3 | RestoreWorkspace: No 4 | SaveWorkspace: No 5 | AlwaysSaveHistory: Default 6 | 7 | EnableCodeIndexing: Yes 8 | UseSpacesForTab: Yes 9 | NumSpacesForTab: 2 10 | Encoding: UTF-8 11 | 12 | RnwWeave: Sweave 13 | LaTeX: pdfLaTeX 14 | 15 | AutoAppendNewline: Yes 16 | StripTrailingWhitespace: Yes 17 | LineEndingConversion: Posix 18 | 19 | BuildType: Package 20 | PackageUseDevtools: Yes 21 | PackageInstallArgs: --no-multiarch --with-keep.source 22 | PackageRoxygenize: rd,collate,namespace 23 | -------------------------------------------------------------------------------- /inst/include/cmdstan/arguments/arg_data.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CMDSTAN_ARGUMENTS_ARG_DATA_HPP 2 | #define CMDSTAN_ARGUMENTS_ARG_DATA_HPP 3 | 4 | #include 5 | 6 | #include 7 | 8 | namespace cmdstan { 9 | 10 | class arg_data : public categorical_argument { 11 | public: 12 | arg_data() : categorical_argument() { 13 | _name = "data"; 14 | _description = "Input data options"; 15 | 16 | _subarguments.push_back(new arg_data_file()); 17 | } 18 | }; 19 | 20 | } // namespace cmdstan 21 | #endif 22 | -------------------------------------------------------------------------------- /inst/include/cmdstan/arguments/arg_data_file.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CMDSTAN_ARGUMENTS_ARG_DATA_FILE_HPP 2 | #define CMDSTAN_ARGUMENTS_ARG_DATA_FILE_HPP 3 | 4 | #include 5 | 6 | namespace cmdstan { 7 | 8 | class arg_data_file : public string_argument { 9 | public: 10 | arg_data_file() : string_argument() { 11 | _name = "file"; 12 | _description = "Input data file"; 13 | _validity = "Path to existing file"; 14 | _default = "\"\""; 15 | _default_value = ""; 16 | _value = _default_value; 17 | } 18 | }; 19 | 20 | } // namespace cmdstan 21 | #endif 22 | -------------------------------------------------------------------------------- /inst/include/cmdstan/arguments/arg_dense_e.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CMDSTAN_ARGUMENTS_ARG_DENSE_E_HPP 2 | #define CMDSTAN_ARGUMENTS_ARG_DENSE_E_HPP 3 | 4 | #include 5 | 6 | namespace cmdstan { 7 | 8 | class arg_dense_e : public unvalued_argument { 9 | public: 10 | arg_dense_e() { 11 | _name = "dense_e"; 12 | _description = "Euclidean manifold with dense metric"; 13 | } 14 | }; 15 | 16 | } // namespace cmdstan 17 | #endif 18 | -------------------------------------------------------------------------------- /inst/include/cmdstan/arguments/arg_diag_e.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CMDSTAN_ARGUMENTS_ARG_DIAG_E_HPP 2 | #define CMDSTAN_ARGUMENTS_ARG_DIAG_E_HPP 3 | 4 | #include 5 | 6 | namespace cmdstan { 7 | 8 | class arg_diag_e : public unvalued_argument { 9 | public: 10 | arg_diag_e() { 11 | _name = "diag_e"; 12 | _description = "Euclidean manifold with diag metric"; 13 | } 14 | }; 15 | 16 | } // namespace cmdstan 17 | #endif 18 | -------------------------------------------------------------------------------- /inst/include/cmdstan/arguments/arg_diagnose.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CMDSTAN_ARGUMENTS_ARG_DIAGNOSE_HPP 2 | #define CMDSTAN_ARGUMENTS_ARG_DIAGNOSE_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace cmdstan { 8 | 9 | class arg_diagnose : public categorical_argument { 10 | public: 11 | arg_diagnose() { 12 | _name = "diagnose"; 13 | _description = "Model diagnostics"; 14 | 15 | _subarguments.push_back(new arg_test()); 16 | } 17 | }; 18 | 19 | } // namespace cmdstan 20 | #endif 21 | -------------------------------------------------------------------------------- /inst/include/cmdstan/arguments/arg_diagnostic_file.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CMDSTAN_ARGUMENTS_ARG_DIAGNOSTIC_FILE_HPP 2 | #define CMDSTAN_ARGUMENTS_ARG_DIAGNOSTIC_FILE_HPP 3 | 4 | #include 5 | 6 | namespace cmdstan { 7 | 8 | class arg_diagnostic_file : public string_argument { 9 | public: 10 | arg_diagnostic_file() : string_argument() { 11 | _name = "diagnostic_file"; 12 | _description = "Auxiliary output file for diagnostic information"; 13 | _validity = "Path to existing file"; 14 | _default = "\"\""; 15 | _default_value = ""; 16 | _value = _default_value; 17 | } 18 | }; 19 | 20 | } // namespace cmdstan 21 | #endif 22 | -------------------------------------------------------------------------------- /inst/include/cmdstan/arguments/arg_engine.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CMDSTAN_ARGUMENTS_ARG_ENGINE_HPP 2 | #define CMDSTAN_ARGUMENTS_ARG_ENGINE_HPP 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | namespace cmdstan { 9 | 10 | class arg_engine : public list_argument { 11 | public: 12 | arg_engine() { 13 | _name = "engine"; 14 | _description = "Engine for Hamiltonian Monte Carlo"; 15 | 16 | _values.push_back(new arg_static()); 17 | _values.push_back(new arg_nuts()); 18 | 19 | _default_cursor = 1; 20 | _cursor = _default_cursor; 21 | } 22 | }; 23 | 24 | } // namespace cmdstan 25 | #endif 26 | -------------------------------------------------------------------------------- /inst/include/cmdstan/arguments/arg_fail.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CMDSTAN_ARGUMENTS_ARG_FAIL_HPP 2 | #define CMDSTAN_ARGUMENTS_ARG_FAIL_HPP 3 | 4 | #include 5 | 6 | namespace cmdstan { 7 | 8 | class arg_fail : public unvalued_argument { 9 | public: 10 | arg_fail() { 11 | _name = "fail"; 12 | _description = "Dummy argument to induce failures for testing"; 13 | } 14 | }; 15 | 16 | } // namespace cmdstan 17 | #endif 18 | -------------------------------------------------------------------------------- /inst/include/cmdstan/arguments/arg_fixed_param.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CMDSTAN_ARGUMENTS_ARG_FIXED_PARAM_HPP 2 | #define CMDSTAN_ARGUMENTS_ARG_FIXED_PARAM_HPP 3 | 4 | #include 5 | 6 | namespace cmdstan { 7 | 8 | class arg_fixed_param : public unvalued_argument { 9 | public: 10 | arg_fixed_param() { 11 | _name = "fixed_param"; 12 | _description = "Fixed Parameter Sampler"; 13 | } 14 | }; 15 | 16 | } // namespace cmdstan 17 | #endif 18 | -------------------------------------------------------------------------------- /inst/include/cmdstan/arguments/arg_history_size.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CMDSTAN_ARGUMENTS_ARG_HISTORY_SIZE_HPP 2 | #define CMDSTAN_ARGUMENTS_ARG_HISTORY_SIZE_HPP 3 | 4 | #include 5 | 6 | namespace cmdstan { 7 | 8 | class arg_history_size : public int_argument { 9 | public: 10 | arg_history_size() : int_argument() { 11 | _name = "history_size"; 12 | _description = "Amount of history to keep for L-BFGS"; 13 | _validity = "0 < history_size"; 14 | _default = "5"; 15 | _default_value = 5; 16 | _value = _default_value; 17 | } 18 | 19 | bool is_valid(int value) { return value > 0; } 20 | }; 21 | 22 | } // namespace cmdstan 23 | #endif 24 | -------------------------------------------------------------------------------- /inst/include/cmdstan/arguments/arg_id.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CMDSTAN_ARGUMENTS_ARG_ID_HPP 2 | #define CMDSTAN_ARGUMENTS_ARG_ID_HPP 3 | 4 | #include 5 | 6 | namespace cmdstan { 7 | 8 | class arg_id : public int_argument { 9 | public: 10 | arg_id() : int_argument() { 11 | _name = "id"; 12 | _description = "Unique process identifier"; 13 | _validity = "id >= 0"; 14 | _default = "1"; 15 | _default_value = 1; 16 | _value = _default_value; 17 | } 18 | 19 | bool is_valid(int value) { return value >= 0; } 20 | }; 21 | 22 | } // namespace cmdstan 23 | #endif 24 | -------------------------------------------------------------------------------- /inst/include/cmdstan/arguments/arg_init.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CMDSTAN_ARGUMENTS_ARG_INIT_HPP 2 | #define CMDSTAN_ARGUMENTS_ARG_INIT_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace cmdstan { 8 | 9 | class arg_init : public string_argument { 10 | public: 11 | arg_init() : string_argument() { 12 | _name = "init"; 13 | _description = std::string("Initialization method: ") 14 | + std::string("\"x\" initializes randomly between [-x, x], ") 15 | + std::string("\"0\" initializes to 0, ") 16 | + std::string("anything else identifies a file of values"); 17 | _default = "\"2\""; 18 | _default_value = "2"; 19 | _value = _default_value; 20 | } 21 | }; 22 | 23 | } // namespace cmdstan 24 | #endif 25 | -------------------------------------------------------------------------------- /inst/include/cmdstan/arguments/arg_lbfgs.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CMDSTAN_ARGUMENTS_ARG_LBFGS_HPP 2 | #define CMDSTAN_ARGUMENTS_ARG_LBFGS_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace cmdstan { 8 | 9 | class arg_lbfgs : public arg_bfgs { 10 | public: 11 | arg_lbfgs() { 12 | _name = "lbfgs"; 13 | _description = "LBFGS with linesearch"; 14 | 15 | _subarguments.push_back(new arg_history_size()); 16 | } 17 | }; 18 | 19 | } // namespace cmdstan 20 | #endif 21 | -------------------------------------------------------------------------------- /inst/include/cmdstan/arguments/arg_metric.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CMDSTAN_ARGUMENTS_ARG_METRIC_HPP 2 | #define CMDSTAN_ARGUMENTS_ARG_METRIC_HPP 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | namespace cmdstan { 10 | 11 | class arg_metric : public list_argument { 12 | public: 13 | arg_metric() { 14 | _name = "metric"; 15 | _description = "Geometry of base manifold"; 16 | 17 | _values.push_back(new arg_unit_e()); 18 | _values.push_back(new arg_diag_e()); 19 | _values.push_back(new arg_dense_e()); 20 | 21 | _default_cursor = 1; 22 | _cursor = _default_cursor; 23 | } 24 | }; 25 | 26 | } // namespace cmdstan 27 | #endif 28 | -------------------------------------------------------------------------------- /inst/include/cmdstan/arguments/arg_newton.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CMDSTAN_ARGUMENTS_ARG_NEWTON_HPP 2 | #define CMDSTAN_ARGUMENTS_ARG_NEWTON_HPP 3 | 4 | #include 5 | 6 | namespace cmdstan { 7 | 8 | class arg_newton : public categorical_argument { 9 | public: 10 | arg_newton() { 11 | _name = "newton"; 12 | _description = "Newton's method"; 13 | } 14 | }; 15 | 16 | } // namespace cmdstan 17 | #endif 18 | -------------------------------------------------------------------------------- /inst/include/cmdstan/arguments/arg_num_samples.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CMDSTAN_ARGUMENTS_ARG_NUM_SAMPLES_HPP 2 | #define CMDSTAN_ARGUMENTS_ARG_NUM_SAMPLES_HPP 3 | 4 | #include 5 | 6 | namespace cmdstan { 7 | 8 | class arg_num_samples : public int_argument { 9 | public: 10 | arg_num_samples() : int_argument() { 11 | _name = "num_samples"; 12 | _description = "Number of sampling iterations"; 13 | _validity = "0 <= num_samples"; 14 | _default = "1000"; 15 | _default_value = 1000; 16 | _value = _default_value; 17 | } 18 | 19 | bool is_valid(int value) { return value >= 0; } 20 | }; 21 | 22 | } // namespace cmdstan 23 | #endif 24 | -------------------------------------------------------------------------------- /inst/include/cmdstan/arguments/arg_num_warmup.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CMDSTAN_ARGUMENTS_ARG_NUM_WARMUP_HPP 2 | #define CMDSTAN_ARGUMENTS_ARG_NUM_WARMUP_HPP 3 | 4 | #include 5 | 6 | namespace cmdstan { 7 | 8 | class arg_num_warmup : public int_argument { 9 | public: 10 | arg_num_warmup() : int_argument() { 11 | _name = "num_warmup"; 12 | _description = "Number of warmup iterations"; 13 | _validity = "0 <= warmup"; 14 | _default = "1000"; 15 | _default_value = 1000; 16 | _value = _default_value; 17 | } 18 | 19 | bool is_valid(int value) { return value >= 0; } 20 | }; 21 | 22 | } // namespace cmdstan 23 | #endif 24 | -------------------------------------------------------------------------------- /inst/include/cmdstan/arguments/arg_nuts.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CMDSTAN_ARGUMENTS_ARG_NUTS_HPP 2 | #define CMDSTAN_ARGUMENTS_ARG_NUTS_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace cmdstan { 8 | 9 | class arg_nuts : public categorical_argument { 10 | public: 11 | arg_nuts() { 12 | _name = "nuts"; 13 | _description = "The No-U-Turn Sampler"; 14 | 15 | _subarguments.push_back( 16 | new arg_single_int_pos("max_depth", "Maximum tree depth", 10)); 17 | } 18 | }; 19 | 20 | } // namespace cmdstan 21 | #endif 22 | -------------------------------------------------------------------------------- /inst/include/cmdstan/arguments/arg_opencl.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CMDSTAN_ARGUMENTS_ARG_OPENCL_HPP 2 | #define CMDSTAN_ARGUMENTS_ARG_OPENCL_HPP 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | namespace cmdstan { 9 | 10 | class arg_opencl : public categorical_argument { 11 | public: 12 | arg_opencl() { 13 | _name = "opencl"; 14 | _description = "OpenCL options"; 15 | 16 | _subarguments.push_back(new arg_opencl_device()); 17 | _subarguments.push_back(new arg_opencl_platform()); 18 | } 19 | }; 20 | 21 | } // namespace cmdstan 22 | #endif 23 | -------------------------------------------------------------------------------- /inst/include/cmdstan/arguments/arg_opencl_device.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CMDSTAN_ARGUMENTS_ARG_OPENCL_DEVICE_HPP 2 | #define CMDSTAN_ARGUMENTS_ARG_OPENCL_DEVICE_HPP 3 | 4 | #include 5 | 6 | namespace cmdstan { 7 | 8 | class arg_opencl_device : public int_argument { 9 | public: 10 | arg_opencl_device() : int_argument() { 11 | _name = "device"; 12 | _description = "ID of the OpenCL device to use"; 13 | _validity = "device >= 0 or -1 to use the compile-time device ID"; 14 | _default = "-1"; 15 | _default_value = -1; 16 | _value = _default_value; 17 | } 18 | 19 | bool is_valid(int value) { return value >= 0 || value == _default_value; } 20 | }; 21 | 22 | } // namespace cmdstan 23 | #endif 24 | -------------------------------------------------------------------------------- /inst/include/cmdstan/arguments/arg_opencl_platform.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CMDSTAN_ARGUMENTS_ARG_OPENCL_PLATFORM_HPP 2 | #define CMDSTAN_ARGUMENTS_ARG_OPENCL_PLATFORM_HPP 3 | 4 | #include 5 | 6 | namespace cmdstan { 7 | 8 | class arg_opencl_platform : public int_argument { 9 | public: 10 | arg_opencl_platform() : int_argument() { 11 | _name = "platform"; 12 | _description = "ID of the OpenCL platform to use"; 13 | _validity = "platform >= 0 or -1 to use the compile-time platform ID"; 14 | _default = "-1"; 15 | _default_value = -1; 16 | _value = _default_value; 17 | } 18 | 19 | bool is_valid(int value) { return value >= 0 || value == _default_value; } 20 | }; 21 | 22 | } // namespace cmdstan 23 | #endif 24 | -------------------------------------------------------------------------------- /inst/include/cmdstan/arguments/arg_output_file.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CMDSTAN_ARGUMENTS_ARG_OUTPUT_FILE_HPP 2 | #define CMDSTAN_ARGUMENTS_ARG_OUTPUT_FILE_HPP 3 | 4 | #include 5 | 6 | namespace cmdstan { 7 | 8 | class arg_output_file : public string_argument { 9 | public: 10 | arg_output_file() : string_argument() { 11 | _name = "file"; 12 | _description = "Output file"; 13 | _validity = "Path to existing file"; 14 | _default = "output.csv"; 15 | _default_value = "output.csv"; 16 | _value = _default_value; 17 | } 18 | }; 19 | 20 | } // namespace cmdstan 21 | #endif 22 | -------------------------------------------------------------------------------- /inst/include/cmdstan/arguments/arg_profile_file.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CMDSTAN_ARGUMENTS_ARG_PROFILE_FILE_HPP 2 | #define CMDSTAN_ARGUMENTS_ARG_PROFILE_FILE_HPP 3 | 4 | #include 5 | 6 | namespace cmdstan { 7 | 8 | class arg_profile_file : public string_argument { 9 | public: 10 | arg_profile_file() : string_argument() { 11 | _name = "profile_file"; 12 | _description = "File to store profiling information"; 13 | _validity = "Valid path and write access to the folder"; 14 | _default = "\"\""; 15 | _default_value = "profile.csv"; 16 | _value = _default_value; 17 | } 18 | }; 19 | 20 | } // namespace cmdstan 21 | #endif 22 | -------------------------------------------------------------------------------- /inst/include/cmdstan/arguments/arg_random.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CMDSTAN_ARGUMENTS_ARG_RANDOM_HPP 2 | #define CMDSTAN_ARGUMENTS_ARG_RANDOM_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace cmdstan { 8 | 9 | class arg_random : public categorical_argument { 10 | public: 11 | arg_random() { 12 | _name = "random"; 13 | _description = "Random number configuration"; 14 | 15 | _subarguments.push_back(new arg_seed()); 16 | } 17 | }; 18 | 19 | } // namespace cmdstan 20 | #endif 21 | -------------------------------------------------------------------------------- /inst/include/cmdstan/arguments/arg_refresh.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CMDSTAN_ARGUMENTS_ARG_REFRESH_HPP 2 | #define CMDSTAN_ARGUMENTS_ARG_REFRESH_HPP 3 | 4 | #include 5 | 6 | namespace cmdstan { 7 | 8 | class arg_refresh : public int_argument { 9 | public: 10 | arg_refresh() : int_argument() { 11 | _name = "refresh"; 12 | _description = "Number of iterations between screen updates"; 13 | _validity = "0 <= refresh"; 14 | _default = "100"; 15 | _default_value = 100; 16 | _value = _default_value; 17 | } 18 | 19 | bool is_valid(int value) { return value >= 0; } 20 | }; 21 | 22 | } // namespace cmdstan 23 | #endif 24 | -------------------------------------------------------------------------------- /inst/include/cmdstan/arguments/arg_rwm.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CMDSTAN_ARGUMENTS_ARG_RWM_HPP 2 | #define CMDSTAN_ARGUMENTS_ARG_RWM_HPP 3 | 4 | #include 5 | 6 | namespace cmdstan { 7 | 8 | class arg_rwm : public categorical_argument { 9 | public: 10 | arg_rwm() { 11 | _name = "rwm"; 12 | _description = "Random Walk Metropolis Monte Carlo"; 13 | } 14 | }; 15 | 16 | } // namespace cmdstan 17 | #endif 18 | -------------------------------------------------------------------------------- /inst/include/cmdstan/arguments/arg_sample_algo.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CMDSTAN_ARGUMENTS_ARG_SAMPLE_ALGO_HPP 2 | #define CMDSTAN_ARGUMENTS_ARG_SAMPLE_ALGO_HPP 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | namespace cmdstan { 9 | 10 | class arg_sample_algo : public list_argument { 11 | public: 12 | arg_sample_algo() { 13 | _name = "algorithm"; 14 | _description = "Sampling algorithm"; 15 | 16 | _values.push_back(new arg_hmc()); 17 | _values.push_back(new arg_fixed_param()); 18 | 19 | _default_cursor = 0; 20 | _cursor = _default_cursor; 21 | } 22 | }; 23 | 24 | } // namespace cmdstan 25 | #endif 26 | -------------------------------------------------------------------------------- /inst/include/cmdstan/arguments/arg_single_bool.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CMDSTAN_ARGUMENTS_ARG_SINGLE_BOOL_HPP 2 | #define CMDSTAN_ARGUMENTS_ARG_SINGLE_BOOL_HPP 3 | 4 | #include 5 | #include 6 | 7 | /** Generic positive int value argument */ 8 | 9 | namespace cmdstan { 10 | 11 | class arg_single_bool : public bool_argument { 12 | public: 13 | arg_single_bool(const char* name, const char* desc, bool def) 14 | : bool_argument() { 15 | _name = name; 16 | _description = desc; 17 | _validity = "[0, 1, false, true]"; 18 | _default = internal::to_string(def); 19 | _default_value = def; 20 | _value = _default_value; 21 | } 22 | }; 23 | 24 | } // namespace cmdstan 25 | #endif 26 | -------------------------------------------------------------------------------- /inst/include/cmdstan/arguments/arg_single_string.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CMDSTAN_ARGUMENTS_ARG_SINGLE_STRING_HPP 2 | #define CMDSTAN_ARGUMENTS_ARG_SINGLE_STRING_HPP 3 | 4 | #include 5 | #include 6 | 7 | /** Generic string value argument */ 8 | 9 | namespace cmdstan { 10 | 11 | class arg_single_string : public string_argument { 12 | public: 13 | arg_single_string(const char* name, const char* desc, const char* def) 14 | : string_argument() { 15 | _name = name; 16 | _description = desc; 17 | _default = def; 18 | _default_value = def; 19 | _value = _default_value; 20 | } 21 | }; 22 | 23 | } // namespace cmdstan 24 | #endif 25 | -------------------------------------------------------------------------------- /inst/include/cmdstan/arguments/arg_softabs.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CMDSTAN_ARGUMENTS_ARG_SOFTABS_HPP 2 | #define CMDSTAN_ARGUMENTS_ARG_SOFTABS_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace cmdstan { 8 | 9 | class arg_softabs : public categorical_argument { 10 | public: 11 | arg_softabs() { 12 | _name = "softabs"; 13 | _description = "Riemannian manifold with SoftAbs metric"; 14 | 15 | _subarguments.push_back(new arg_softabs_alpha()); 16 | } 17 | }; 18 | 19 | } // namespace cmdstan 20 | #endif 21 | -------------------------------------------------------------------------------- /inst/include/cmdstan/arguments/arg_softabs_alpha.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CMDSTAN_ARGUMENTS_ARG_SOFTABS_ALPHA_HPP 2 | #define CMDSTAN_ARGUMENTS_ARG_SOFTABS_ALPHA_HPP 3 | 4 | #include 5 | 6 | namespace cmdstan { 7 | 8 | class arg_softabs_alpha : public real_argument { 9 | public: 10 | arg_softabs_alpha() : real_argument() { 11 | _name = "alpha"; 12 | _description = "Softabs regularization parameter"; 13 | _validity = "0 < alpha"; 14 | _default = "1.0"; 15 | _default_value = 1.0; 16 | _value = _default_value; 17 | } 18 | 19 | bool is_valid(double value) { return 0 < value; } 20 | }; 21 | 22 | } // namespace cmdstan 23 | #endif 24 | -------------------------------------------------------------------------------- /inst/include/cmdstan/arguments/arg_static.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CMDSTAN_ARGUMENTS_ARG_STATIC_HPP 2 | #define CMDSTAN_ARGUMENTS_ARG_STATIC_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace cmdstan { 8 | 9 | class arg_static : public categorical_argument { 10 | public: 11 | arg_static() { 12 | _name = "static"; 13 | _description = "Static integration time"; 14 | _subarguments.push_back(new arg_single_real_pos( 15 | "int_time", 16 | "Total integration time for Hamiltonian evolution, default is 2 * pi", 17 | 6.28318530717959)); 18 | } 19 | }; 20 | 21 | } // namespace cmdstan 22 | #endif 23 | -------------------------------------------------------------------------------- /inst/include/cmdstan/arguments/arg_test.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CMDSTAN_ARGUMENTS_ARG_TEST_HPP 2 | #define CMDSTAN_ARGUMENTS_ARG_TEST_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace cmdstan { 8 | 9 | class arg_test : public list_argument { 10 | public: 11 | arg_test() { 12 | _name = "test"; 13 | _description = "Diagnostic test"; 14 | 15 | _values.push_back(new arg_test_gradient()); 16 | 17 | _default_cursor = 0; 18 | _cursor = _default_cursor; 19 | } 20 | }; 21 | 22 | } // namespace cmdstan 23 | #endif 24 | -------------------------------------------------------------------------------- /inst/include/cmdstan/arguments/arg_test_grad_eps.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CMDSTAN_ARGUMENTS_ARG_TEST_GRAD_EPS_HPP 2 | #define CMDSTAN_ARGUMENTS_ARG_TEST_GRAD_EPS_HPP 3 | 4 | #include 5 | 6 | namespace cmdstan { 7 | 8 | class arg_test_grad_eps : public real_argument { 9 | public: 10 | arg_test_grad_eps() : real_argument() { 11 | _name = "epsilon"; 12 | _description = "Finite difference step size"; 13 | _validity = "0 < epsilon"; 14 | _default = "1e-6"; 15 | _default_value = 1e-6; 16 | _value = _default_value; 17 | } 18 | 19 | bool is_valid(double value) { return value > 0; } 20 | }; 21 | 22 | } // namespace cmdstan 23 | #endif 24 | -------------------------------------------------------------------------------- /inst/include/cmdstan/arguments/arg_test_grad_err.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CMDSTAN_ARGUMENTS_ARG_TEST_GRAD_ERR_HPP 2 | #define CMDSTAN_ARGUMENTS_ARG_TEST_GRAD_ERR_HPP 3 | 4 | #include 5 | 6 | namespace cmdstan { 7 | 8 | class arg_test_grad_err : public real_argument { 9 | public: 10 | arg_test_grad_err() : real_argument() { 11 | _name = "error"; 12 | _description = "Error threshold"; 13 | _validity = "0 < error"; 14 | _default = "1e-6"; 15 | _default_value = 1e-6; 16 | _value = _default_value; 17 | } 18 | 19 | bool is_valid(double value) { return value > 0; } 20 | }; 21 | 22 | } // namespace cmdstan 23 | #endif 24 | -------------------------------------------------------------------------------- /inst/include/cmdstan/arguments/arg_test_gradient.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CMDSTAN_ARGUMENTS_ARG_TEST_GRADIENT_HPP 2 | #define CMDSTAN_ARGUMENTS_ARG_TEST_GRADIENT_HPP 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | namespace cmdstan { 9 | 10 | class arg_test_gradient : public categorical_argument { 11 | public: 12 | arg_test_gradient() { 13 | _name = "gradient"; 14 | _description = "Check model gradient against finite differences"; 15 | 16 | _subarguments.push_back(new arg_test_grad_eps()); 17 | _subarguments.push_back(new arg_test_grad_err()); 18 | } 19 | }; 20 | 21 | } // namespace cmdstan 22 | #endif 23 | -------------------------------------------------------------------------------- /inst/include/cmdstan/arguments/arg_thin.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CMDSTAN_ARGUMENTS_ARG_THIN_HPP 2 | #define CMDSTAN_ARGUMENTS_ARG_THIN_HPP 3 | 4 | #include 5 | 6 | namespace cmdstan { 7 | 8 | class arg_thin : public int_argument { 9 | public: 10 | arg_thin() : int_argument() { 11 | _name = "thin"; 12 | _description = "Period between saved samples"; 13 | _validity = "0 < thin"; 14 | _default = "1"; 15 | _default_value = 1; 16 | _value = _default_value; 17 | } 18 | 19 | bool is_valid(int value) { return value > 0; } 20 | }; 21 | 22 | } // namespace cmdstan 23 | #endif 24 | -------------------------------------------------------------------------------- /inst/include/cmdstan/arguments/arg_unit_e.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CMDSTAN_ARGUMENTS_ARG_UNIT_E_HPP 2 | #define CMDSTAN_ARGUMENTS_ARG_UNIT_E_HPP 3 | 4 | #include 5 | 6 | namespace cmdstan { 7 | 8 | class arg_unit_e : public unvalued_argument { 9 | public: 10 | arg_unit_e() { 11 | _name = "unit_e"; 12 | _description = "Euclidean manifold with unit metric"; 13 | } 14 | }; 15 | 16 | } // namespace cmdstan 17 | #endif 18 | -------------------------------------------------------------------------------- /inst/include/cmdstan/arguments/arg_variational_algo.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CMDSTAN_ARGUMENTS_VARIATIONAL_ALGO_HPP 2 | #define CMDSTAN_ARGUMENTS_VARIATIONAL_ALGO_HPP 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | namespace cmdstan { 9 | 10 | class arg_variational_algo : public list_argument { 11 | public: 12 | arg_variational_algo() { 13 | _name = "algorithm"; 14 | _description = "Variational inference algorithm"; 15 | 16 | _values.push_back(new arg_variational_meanfield()); 17 | _values.push_back(new arg_variational_fullrank()); 18 | 19 | _default_cursor = 0; 20 | _cursor = _default_cursor; 21 | } 22 | }; 23 | } // namespace cmdstan 24 | #endif 25 | -------------------------------------------------------------------------------- /inst/include/cmdstan/arguments/arg_variational_fullrank.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CMDSTAN_ARGUMENTS_VARIATIONAL_FULLRANK_HPP 2 | #define CMDSTAN_ARGUMENTS_VARIATIONAL_FULLRANK_HPP 3 | 4 | #include 5 | 6 | namespace cmdstan { 7 | 8 | class arg_variational_fullrank : public categorical_argument { 9 | public: 10 | arg_variational_fullrank() { 11 | _name = "fullrank"; 12 | _description = "full-rank covariance"; 13 | } 14 | }; 15 | } // namespace cmdstan 16 | #endif 17 | -------------------------------------------------------------------------------- /inst/include/cmdstan/arguments/arg_variational_meanfield.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CMDSTAN_ARGUMENTS_VARIATIONAL_MEANFIELD_HPP 2 | #define CMDSTAN_ARGUMENTS_VARIATIONAL_MEANFIELD_HPP 3 | 4 | #include 5 | 6 | namespace cmdstan { 7 | 8 | class arg_variational_meanfield : public categorical_argument { 9 | public: 10 | arg_variational_meanfield() { 11 | _name = "meanfield"; 12 | _description = "mean-field approximation"; 13 | } 14 | }; 15 | } // namespace cmdstan 16 | #endif 17 | -------------------------------------------------------------------------------- /inst/include/cmdstan/arguments/arg_x_delta.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CMDSTAN_ARGUMENTS_ARG_X_DELTA_HPP 2 | #define CMDSTAN_ARGUMENTS_ARG_X_DELTA_HPP 3 | 4 | #include 5 | 6 | namespace cmdstan { 7 | 8 | class arg_x_delta : public real_argument { 9 | public: 10 | arg_x_delta() : real_argument() { 11 | _name = "x_delta"; 12 | _description = "Exhaustion tolerance"; 13 | _validity = "0 < x_delta"; 14 | _default = "0.1"; 15 | _default_value = 0.1; 16 | _value = _default_value; 17 | } 18 | 19 | bool is_valid(double value) { return value > 0; } 20 | }; 21 | 22 | } // namespace cmdstan 23 | #endif 24 | -------------------------------------------------------------------------------- /inst/include/cmdstan/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main(int argc, const char *argv[]) { 5 | try { 6 | int err_code = cmdstan::command(argc, argv); 7 | if (err_code == 0) 8 | return cmdstan::return_codes::OK; 9 | else 10 | return cmdstan::return_codes::NOT_OK; 11 | } catch (const std::exception &e) { 12 | std::cerr << e.what() << std::endl; 13 | return cmdstan::return_codes::NOT_OK; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /inst/include/cmdstan/return_codes.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CMDSTAN_RETURN_CODES_HPP 2 | #define CMDSTAN_RETURN_CODES_HPP 3 | 4 | namespace cmdstan { 5 | 6 | struct return_codes { 7 | enum { OK = 0, NOT_OK = 1 }; 8 | }; 9 | 10 | } // namespace cmdstan 11 | #endif 12 | -------------------------------------------------------------------------------- /inst/include/cmdstan/write_model.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CMDSTAN_WRITE_MODEL_HPP 2 | #define CMDSTAN_WRITE_MODEL_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace cmdstan { 8 | void write_model(stan::callbacks::writer& writer, 9 | const std::string& model_name) { 10 | writer("model = " + model_name); 11 | } 12 | } // namespace cmdstan 13 | #endif 14 | -------------------------------------------------------------------------------- /inst/include/cmdstan/write_parallel_info.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CMDSTAN_WRITE_PARALLEL_INFO_HPP 2 | #define CMDSTAN_WRITE_PARALLEL_INFO_HPP 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | namespace cmdstan { 9 | 10 | void write_parallel_info(stan::callbacks::writer &writer) { 11 | #ifdef STAN_MPI 12 | writer("mpi_enabled = 1"); 13 | #endif 14 | } 15 | 16 | } // namespace cmdstan 17 | #endif 18 | -------------------------------------------------------------------------------- /inst/include/estimator/estimator.stan: -------------------------------------------------------------------------------- 1 | functions { 2 | real r_function(vector x, int finite_diff, int no_bounds, array[] int bounds_types, vector lower_bounds, vector upper_bounds); 3 | } 4 | 5 | data { 6 | int Npars; 7 | int finite_diff; 8 | int no_bounds; 9 | array[Npars] int bounds_types; 10 | vector[Npars] lower_bounds; 11 | vector[Npars] upper_bounds; 12 | } 13 | 14 | parameters { 15 | vector[Npars] pars; 16 | } 17 | 18 | model { 19 | target += r_function(pars, finite_diff, no_bounds, bounds_types, lower_bounds, upper_bounds); 20 | } 21 | -------------------------------------------------------------------------------- /inst/include/stan/io/ends_with.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_IO_ENDS_WITH_HPP 2 | #define STAN_IO_ENDS_WITH_HPP 3 | 4 | #include 5 | 6 | namespace stan { 7 | namespace io { 8 | 9 | /** 10 | * Return true if the specified string ends with the specified 11 | * suffix. 12 | * 13 | * @param p suffix 14 | * @param s string to test 15 | * @return true if s has p as a suffix 16 | */ 17 | inline bool ends_with(const std::string& p, const std::string& s) { 18 | return s.size() >= p.size() && s.substr(s.size() - p.size()) == p; 19 | } 20 | 21 | } // namespace io 22 | } // namespace stan 23 | #endif 24 | -------------------------------------------------------------------------------- /inst/include/stan/io/json/json_error.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_IO_JSON_JSON_ERROR_HPP 2 | #define STAN_IO_JSON_JSON_ERROR_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace stan { 8 | 9 | namespace json { 10 | 11 | /** 12 | * Exception type for JSON errors. 13 | */ 14 | struct json_error : public std::logic_error { 15 | /** 16 | * Construct a JSON error with the specified message 17 | * @param what Message to attach to error 18 | */ 19 | explicit json_error(const std::string &what) : logic_error(what) {} 20 | }; 21 | 22 | } // namespace json 23 | } // namespace stan 24 | #endif 25 | -------------------------------------------------------------------------------- /inst/include/stan/lang/rethrow_located.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_LANG_RETHROW_LOCATED_HPP 2 | #define STAN_LANG_RETHROW_LOCATED_HPP 3 | 4 | #include 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /inst/include/stan/math.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_HPP 2 | #define STAN_MATH_HPP 3 | 4 | /** 5 | * \defgroup prob_dists Probability Distributions 6 | */ 7 | 8 | /** 9 | * \ingroup prob_dists 10 | * \defgroup multivar_dists Multivariate Distributions 11 | * Distributions with Matrix inputs 12 | */ 13 | /** 14 | * \ingroup prob_dists 15 | * \defgroup univar_dists Univariate Distributions 16 | * Distributions with scalar, vector, or array input. 17 | */ 18 | 19 | #include 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /inst/include/stan/math/fwd.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_FWD_HPP 2 | #define STAN_MATH_FWD_HPP 3 | 4 | #include 5 | 6 | #ifdef STAN_OPENCL 7 | #include 8 | #endif 9 | 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | 16 | #include 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /inst/include/stan/math/fwd/core/operator_unary_minus.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_FWD_CORE_OPERATOR_UNARY_MINUS_HPP 2 | #define STAN_MATH_FWD_CORE_OPERATOR_UNARY_MINUS_HPP 3 | 4 | #include 5 | 6 | namespace stan { 7 | namespace math { 8 | 9 | /** 10 | * Return the negation of the specified argument. 11 | * 12 | * @tparam value and tangent type of the argument 13 | * @param[in] x argument 14 | * @return negation of argument 15 | */ 16 | template 17 | inline fvar operator-(const fvar& x) { 18 | return fvar(-x.val_, -x.d_); 19 | } 20 | } // namespace math 21 | } // namespace stan 22 | #endif 23 | -------------------------------------------------------------------------------- /inst/include/stan/math/fwd/core/operator_unary_not.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_FWD_CORE_OPERATOR_UNARY_NOT_HPP 2 | #define STAN_MATH_FWD_CORE_OPERATOR_UNARY_NOT_HPP 3 | 4 | #include 5 | 6 | namespace stan { 7 | namespace math { 8 | 9 | /** 10 | * Return the negation of the value of the argument as defined by 11 | * !. 12 | * 13 | * @tparam value and tangent type for variables 14 | * @param[in] x argument 15 | * @return negation of argument value 16 | */ 17 | template 18 | inline bool operator!(const fvar& x) { 19 | return !x.val_; 20 | } 21 | 22 | } // namespace math 23 | } // namespace stan 24 | #endif 25 | -------------------------------------------------------------------------------- /inst/include/stan/math/fwd/core/operator_unary_plus.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_FWD_CORE_OPERATOR_UNARY_PLUS_HPP 2 | #define STAN_MATH_FWD_CORE_OPERATOR_UNARY_PLUS_HPP 3 | 4 | #include 5 | 6 | namespace stan { 7 | namespace math { 8 | 9 | /** 10 | * Returns the argument. It is included for completeness. The 11 | * primitive unary operator+ exists to promote 12 | * integer to floating point values. 13 | * 14 | * @tparam T value and tangent type of the argument 15 | * @param x argument 16 | * @return the argument 17 | */ 18 | template 19 | inline fvar operator+(const fvar& x) { 20 | return x; 21 | } 22 | 23 | } // namespace math 24 | } // namespace stan 25 | #endif 26 | -------------------------------------------------------------------------------- /inst/include/stan/math/fwd/fun/Phi.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_FWD_FUN_PHI_HPP 2 | #define STAN_MATH_FWD_FUN_PHI_HPP 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | namespace stan { 11 | namespace math { 12 | 13 | template 14 | inline fvar Phi(const fvar& x) { 15 | using std::exp; 16 | using std::sqrt; 17 | T xv = x.val_; 18 | return fvar(Phi(xv), x.d_ * exp(xv * xv / -2.0) * INV_SQRT_TWO_PI); 19 | } 20 | 21 | } // namespace math 22 | } // namespace stan 23 | #endif 24 | -------------------------------------------------------------------------------- /inst/include/stan/math/fwd/fun/accumulator.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_FWD_FUN_ACCUMULATOR_HPP 2 | #define STAN_MATH_FWD_FUN_ACCUMULATOR_HPP 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /inst/include/stan/math/fwd/fun/arg.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_FWD_FUN_ARG_HPP 2 | #define STAN_MATH_FWD_FUN_ARG_HPP 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | namespace stan { 9 | namespace math { 10 | 11 | /** 12 | * Return the phase angle of the complex argument. 13 | * 14 | * @tparam T value type of autodiff variable 15 | * @param[in] z argument 16 | * @return phase angle of the argument 17 | */ 18 | template 19 | inline fvar arg(const std::complex>& z) { 20 | return internal::complex_arg(z); 21 | } 22 | 23 | } // namespace math 24 | } // namespace stan 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /inst/include/stan/math/fwd/fun/bessel_first_kind.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_FWD_FUN_BESSEL_FIRST_KIND_HPP 2 | #define STAN_MATH_FWD_FUN_BESSEL_FIRST_KIND_HPP 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | namespace stan { 9 | namespace math { 10 | 11 | template 12 | inline fvar bessel_first_kind(int v, const fvar& z) { 13 | T bessel_first_kind_z(bessel_first_kind(v, z.val_)); 14 | return fvar(bessel_first_kind_z, 15 | v * z.d_ * bessel_first_kind_z / z.val_ 16 | - z.d_ * bessel_first_kind(v + 1, z.val_)); 17 | } 18 | } // namespace math 19 | } // namespace stan 20 | #endif 21 | -------------------------------------------------------------------------------- /inst/include/stan/math/fwd/fun/bessel_second_kind.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_FWD_FUN_BESSEL_SECOND_KIND_HPP 2 | #define STAN_MATH_FWD_FUN_BESSEL_SECOND_KIND_HPP 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | namespace stan { 9 | namespace math { 10 | 11 | template 12 | inline fvar bessel_second_kind(int v, const fvar& z) { 13 | T bessel_second_kind_z(bessel_second_kind(v, z.val_)); 14 | return fvar(bessel_second_kind_z, 15 | v * z.d_ * bessel_second_kind_z / z.val_ 16 | - z.d_ * bessel_second_kind(v + 1, z.val_)); 17 | } 18 | } // namespace math 19 | } // namespace stan 20 | #endif 21 | -------------------------------------------------------------------------------- /inst/include/stan/math/fwd/fun/binary_log_loss.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_FWD_FUN_BINARY_LOG_LOSS_HPP 2 | #define STAN_MATH_FWD_FUN_BINARY_LOG_LOSS_HPP 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | namespace stan { 9 | namespace math { 10 | 11 | template 12 | inline fvar binary_log_loss(int y, const fvar& y_hat) { 13 | if (y) { 14 | return fvar(binary_log_loss(y, y_hat.val_), -y_hat.d_ / y_hat.val_); 15 | } else { 16 | return fvar(binary_log_loss(y, y_hat.val_), 17 | y_hat.d_ / (1.0 - y_hat.val_)); 18 | } 19 | } 20 | } // namespace math 21 | } // namespace stan 22 | #endif 23 | -------------------------------------------------------------------------------- /inst/include/stan/math/fwd/fun/cbrt.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_FWD_FUN_CBRT_HPP 2 | #define STAN_MATH_FWD_FUN_CBRT_HPP 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | namespace stan { 10 | namespace math { 11 | 12 | /** 13 | * Return cube root of specified argument. 14 | * 15 | * @tparam T inner type of the fvar 16 | * @param x Argument. 17 | * @return Cube root of argument. 18 | */ 19 | template 20 | inline fvar cbrt(const fvar& x) { 21 | return fvar(cbrt(x.val_), x.d_ / (3 * square(cbrt(x.val_)))); 22 | } 23 | 24 | } // namespace math 25 | } // namespace stan 26 | #endif 27 | -------------------------------------------------------------------------------- /inst/include/stan/math/fwd/fun/ceil.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_FWD_FUN_CEIL_HPP 2 | #define STAN_MATH_FWD_FUN_CEIL_HPP 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | namespace stan { 9 | namespace math { 10 | 11 | template 12 | inline fvar ceil(const fvar& x) { 13 | using std::ceil; 14 | return fvar(ceil(x.val_), 0); 15 | } 16 | 17 | } // namespace math 18 | } // namespace stan 19 | #endif 20 | -------------------------------------------------------------------------------- /inst/include/stan/math/fwd/fun/conj.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_FWD_FUN_CONJ_HPP 2 | #define STAN_MATH_FWD_FUN_CONJ_HPP 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | namespace stan { 9 | namespace math { 10 | 11 | /** 12 | * Return the phase angle of the complex argument. 13 | * 14 | * @tparam T value type of autodiff variable 15 | * @param[in] z argument 16 | * @return phase angle of the argument 17 | */ 18 | template 19 | inline std::complex> conj(const std::complex>& z) { 20 | return internal::complex_conj(z); 21 | } 22 | 23 | } // namespace math 24 | } // namespace stan 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /inst/include/stan/math/fwd/fun/erf.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_FWD_FUN_ERF_HPP 2 | #define STAN_MATH_FWD_FUN_ERF_HPP 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | namespace stan { 12 | namespace math { 13 | 14 | template 15 | inline fvar erf(const fvar& x) { 16 | using std::exp; 17 | return fvar(erf(x.val_), x.d_ * exp(-square(x.val_)) * TWO_OVER_SQRT_PI); 18 | } 19 | 20 | } // namespace math 21 | } // namespace stan 22 | #endif 23 | -------------------------------------------------------------------------------- /inst/include/stan/math/fwd/fun/erfc.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_FWD_FUN_ERFC_HPP 2 | #define STAN_MATH_FWD_FUN_ERFC_HPP 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | namespace stan { 12 | namespace math { 13 | 14 | template 15 | inline fvar erfc(const fvar& x) { 16 | using std::exp; 17 | return fvar(erfc(x.val_), -x.d_ * exp(-square(x.val_)) * TWO_OVER_SQRT_PI); 18 | } 19 | 20 | } // namespace math 21 | } // namespace stan 22 | #endif 23 | -------------------------------------------------------------------------------- /inst/include/stan/math/fwd/fun/exp2.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_FWD_FUN_EXP2_HPP 2 | #define STAN_MATH_FWD_FUN_EXP2_HPP 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | namespace stan { 11 | namespace math { 12 | 13 | template 14 | inline fvar exp2(const fvar& x) { 15 | return fvar(exp2(x.val_), x.d_ * exp2(x.val_) * LOG_TWO); 16 | } 17 | 18 | } // namespace math 19 | } // namespace stan 20 | #endif 21 | -------------------------------------------------------------------------------- /inst/include/stan/math/fwd/fun/expm1.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_FWD_FUN_EXPM1_HPP 2 | #define STAN_MATH_FWD_FUN_EXPM1_HPP 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | namespace stan { 10 | namespace math { 11 | 12 | template 13 | inline fvar expm1(const fvar& x) { 14 | using std::exp; 15 | return fvar(expm1(x.val_), x.d_ * exp(x.val_)); 16 | } 17 | 18 | } // namespace math 19 | } // namespace stan 20 | #endif 21 | -------------------------------------------------------------------------------- /inst/include/stan/math/fwd/fun/floor.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_FWD_FUN_FLOOR_HPP 2 | #define STAN_MATH_FWD_FUN_FLOOR_HPP 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | namespace stan { 9 | namespace math { 10 | 11 | template 12 | inline fvar floor(const fvar& x) { 13 | using std::floor; 14 | return fvar(floor(x.val_), 0); 15 | } 16 | 17 | } // namespace math 18 | } // namespace stan 19 | #endif 20 | -------------------------------------------------------------------------------- /inst/include/stan/math/fwd/fun/inv.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_FWD_FUN_INV_HPP 2 | #define STAN_MATH_FWD_FUN_INV_HPP 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | namespace stan { 9 | namespace math { 10 | 11 | template 12 | inline fvar inv(const fvar& x) { 13 | return fvar(1 / x.val_, -x.d_ / square(x.val_)); 14 | } 15 | } // namespace math 16 | } // namespace stan 17 | #endif 18 | -------------------------------------------------------------------------------- /inst/include/stan/math/fwd/fun/inv_Phi.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_FWD_FUN_INV_PHI_HPP 2 | #define STAN_MATH_FWD_FUN_INV_PHI_HPP 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | namespace stan { 12 | namespace math { 13 | 14 | template 15 | inline fvar inv_Phi(const fvar& p) { 16 | using std::exp; 17 | T xv = inv_Phi(p.val_); 18 | return fvar(xv, p.d_ / exp(-0.5 * square(xv)) * SQRT_TWO_PI); 19 | } 20 | 21 | } // namespace math 22 | } // namespace stan 23 | #endif 24 | -------------------------------------------------------------------------------- /inst/include/stan/math/fwd/fun/inv_cloglog.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_FWD_FUN_INV_CLOGLOG_HPP 2 | #define STAN_MATH_FWD_FUN_INV_CLOGLOG_HPP 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | namespace stan { 10 | namespace math { 11 | 12 | template 13 | inline fvar inv_cloglog(const fvar& x) { 14 | using std::exp; 15 | return fvar(inv_cloglog(x.val_), x.d_ * exp(x.val_ - exp(x.val_))); 16 | } 17 | } // namespace math 18 | } // namespace stan 19 | #endif 20 | -------------------------------------------------------------------------------- /inst/include/stan/math/fwd/fun/inv_erfc.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_FWD_FUN_INV_ERFC_HPP 2 | #define STAN_MATH_FWD_FUN_INV_ERFC_HPP 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | namespace stan { 13 | namespace math { 14 | 15 | template 16 | inline fvar inv_erfc(const fvar& x) { 17 | T precomp_inv_erfc = inv_erfc(x.val()); 18 | return fvar(precomp_inv_erfc, 19 | -x.d_ * exp(LOG_SQRT_PI - LOG_TWO + square(precomp_inv_erfc))); 20 | } 21 | 22 | } // namespace math 23 | } // namespace stan 24 | #endif 25 | -------------------------------------------------------------------------------- /inst/include/stan/math/fwd/fun/inv_sqrt.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_FWD_FUN_INV_SQRT_HPP 2 | #define STAN_MATH_FWD_FUN_INV_SQRT_HPP 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | namespace stan { 9 | namespace math { 10 | 11 | template 12 | inline fvar inv_sqrt(const fvar& x) { 13 | using std::sqrt; 14 | T sqrt_x(sqrt(x.val_)); 15 | return fvar(1 / sqrt_x, -0.5 * x.d_ / (x.val_ * sqrt_x)); 16 | } 17 | } // namespace math 18 | } // namespace stan 19 | #endif 20 | -------------------------------------------------------------------------------- /inst/include/stan/math/fwd/fun/inv_square.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_FWD_FUN_INV_SQUARE_HPP 2 | #define STAN_MATH_FWD_FUN_INV_SQUARE_HPP 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | namespace stan { 9 | namespace math { 10 | 11 | template 12 | inline fvar inv_square(const fvar& x) { 13 | T square_x(square(x.val_)); 14 | return fvar(1 / square_x, -2 * x.d_ / (square_x * x.val_)); 15 | } 16 | } // namespace math 17 | } // namespace stan 18 | #endif 19 | -------------------------------------------------------------------------------- /inst/include/stan/math/fwd/fun/is_inf.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_FWD_FUN_IS_INF_HPP 2 | #define STAN_MATH_FWD_FUN_IS_INF_HPP 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | namespace stan { 9 | namespace math { 10 | 11 | /** 12 | * Returns 1 if the input's value is infinite and 0 otherwise. 13 | * 14 | * Delegates to is_inf. 15 | * 16 | * @tparam T inner type of the fvar 17 | * @param x Value to test. 18 | * @return 1 if the value is infinite and 0 otherwise. 19 | */ 20 | template 21 | inline int is_inf(const fvar& x) { 22 | return is_inf(x.val()); 23 | } 24 | 25 | } // namespace math 26 | } // namespace stan 27 | #endif 28 | -------------------------------------------------------------------------------- /inst/include/stan/math/fwd/fun/ldexp.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_FWD_FUN_LDEXP_HPP 2 | #define STAN_MATH_FWD_FUN_LDEXP_HPP 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | namespace stan { 9 | namespace math { 10 | 11 | /** 12 | * Returns the product of a (the significand) times 13 | * 2 to power b (the exponent). 14 | * 15 | * @tparam T inner type of the fvar 16 | * @param[in] a the significand 17 | * @param[in] b an integer that is the exponent 18 | * @return product of a times 2 to the power b 19 | */ 20 | template 21 | inline fvar ldexp(const fvar& a, int b) { 22 | return fvar(ldexp(a.val_, b), ldexp(a.d_, b)); 23 | } 24 | 25 | } // namespace math 26 | } // namespace stan 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /inst/include/stan/math/fwd/fun/lgamma.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_FWD_FUN_LGAMMA_HPP 2 | #define STAN_MATH_FWD_FUN_LGAMMA_HPP 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | namespace stan { 10 | namespace math { 11 | 12 | /** 13 | * Return the natural logarithm of the gamma function applied to 14 | * the specified argument. 15 | * 16 | * @tparam T inner type of the fvar 17 | * @param x Argument. 18 | * @return natural logarithm of the gamma function of argument. 19 | */ 20 | template 21 | inline fvar lgamma(const fvar& x) { 22 | return fvar(lgamma(x.val_), x.d_ * digamma(x.val_)); 23 | } 24 | 25 | } // namespace math 26 | } // namespace stan 27 | #endif 28 | -------------------------------------------------------------------------------- /inst/include/stan/math/fwd/fun/lmgamma.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_FWD_FUN_LMGAMMA_HPP 2 | #define STAN_MATH_FWD_FUN_LMGAMMA_HPP 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | namespace stan { 11 | namespace math { 12 | 13 | template 14 | inline fvar> lmgamma(int x1, const fvar& x2) { 15 | using std::log; 16 | T deriv = 0; 17 | for (int count = 1; count < x1 + 1; count++) { 18 | deriv += x2.d_ * digamma(x2.val_ + (1.0 - count) / 2.0); 19 | } 20 | return fvar>(lmgamma(x1, x2.val_), deriv); 21 | } 22 | } // namespace math 23 | } // namespace stan 24 | #endif 25 | -------------------------------------------------------------------------------- /inst/include/stan/math/fwd/fun/log1m.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_FWD_FUN_LOG1M_HPP 2 | #define STAN_MATH_FWD_FUN_LOG1M_HPP 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | namespace stan { 9 | namespace math { 10 | 11 | template 12 | inline fvar log1m(const fvar& x) { 13 | return fvar(log1m(x.val_), -x.d_ / (1 - x.val_)); 14 | } 15 | } // namespace math 16 | } // namespace stan 17 | #endif 18 | -------------------------------------------------------------------------------- /inst/include/stan/math/fwd/fun/log1p.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_FWD_FUN_LOG1P_HPP 2 | #define STAN_MATH_FWD_FUN_LOG1P_HPP 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | namespace stan { 9 | namespace math { 10 | 11 | template 12 | inline fvar log1p(const fvar& x) { 13 | return fvar(log1p(x.val_), x.d_ / (1 + x.val_)); 14 | } 15 | 16 | } // namespace math 17 | } // namespace stan 18 | #endif 19 | -------------------------------------------------------------------------------- /inst/include/stan/math/fwd/fun/log1p_exp.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_FWD_FUN_LOG1P_EXP_HPP 2 | #define STAN_MATH_FWD_FUN_LOG1P_EXP_HPP 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | namespace stan { 10 | namespace math { 11 | 12 | template 13 | inline fvar log1p_exp(const fvar& x) { 14 | using std::exp; 15 | return fvar(log1p_exp(x.val_), x.d_ * inv_logit(x.val_)); 16 | } 17 | 18 | } // namespace math 19 | } // namespace stan 20 | #endif 21 | -------------------------------------------------------------------------------- /inst/include/stan/math/fwd/fun/log_determinant.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_FWD_FUN_LOG_DETERMINANT_HPP 2 | #define STAN_MATH_FWD_FUN_LOG_DETERMINANT_HPP 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | namespace stan { 13 | namespace math { 14 | 15 | template * = nullptr> 16 | inline value_type_t log_determinant(const EigMat& m) { 17 | check_square("log_determinant", "m", m); 18 | 19 | return log(fabs(determinant(m))); 20 | } 21 | 22 | } // namespace math 23 | } // namespace stan 24 | #endif 25 | -------------------------------------------------------------------------------- /inst/include/stan/math/fwd/fun/log_inv_logit.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_FWD_FUN_LOG_INV_LOGIT_HPP 2 | #define STAN_MATH_FWD_FUN_LOG_INV_LOGIT_HPP 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | namespace stan { 11 | namespace math { 12 | 13 | template 14 | inline fvar log_inv_logit(const fvar& x) { 15 | using std::exp; 16 | return fvar(log_inv_logit(x.val_), x.d_ * inv_logit(-x.val_)); 17 | } 18 | } // namespace math 19 | } // namespace stan 20 | #endif 21 | -------------------------------------------------------------------------------- /inst/include/stan/math/fwd/fun/logit.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_FWD_FUN_LOGIT_HPP 2 | #define STAN_MATH_FWD_FUN_LOGIT_HPP 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | namespace stan { 11 | namespace math { 12 | 13 | template 14 | inline fvar logit(const fvar& x) { 15 | if (x.val_ > 1 || x.val_ < 0) { 16 | return fvar(NOT_A_NUMBER, NOT_A_NUMBER); 17 | } else { 18 | return fvar(logit(x.val_), x.d_ / (x.val_ - square(x.val_))); 19 | } 20 | } 21 | } // namespace math 22 | } // namespace stan 23 | #endif 24 | -------------------------------------------------------------------------------- /inst/include/stan/math/fwd/fun/norm.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_FWD_FUN_NORM_HPP 2 | #define STAN_MATH_FWD_FUN_NORM_HPP 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | namespace stan { 9 | namespace math { 10 | 11 | /** 12 | * Return the squared magnitude of the complex argument. 13 | * 14 | * @tparam T value type of autodiff variable 15 | * @param[in] z argument 16 | * @return phase squared magnitude of the argument 17 | */ 18 | template 19 | inline fvar norm(const std::complex>& z) { 20 | return internal::complex_norm(z); 21 | } 22 | 23 | } // namespace math 24 | } // namespace stan 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /inst/include/stan/math/fwd/fun/proj.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_FWD_FUN_PROJ_HPP 2 | #define STAN_MATH_FWD_FUN_PROJ_HPP 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | namespace stan { 9 | namespace math { 10 | 11 | /** 12 | * Return the projection of the complex argument onto the Riemann 13 | * sphere. 14 | * 15 | * @tparam T value type of autodiff variable 16 | * @param[in] z argument 17 | * @return projection of the argument onto the Riemann sphere 18 | */ 19 | template 20 | inline std::complex> proj(const std::complex>& z) { 21 | return internal::complex_proj(z); 22 | } 23 | 24 | } // namespace math 25 | } // namespace stan 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /inst/include/stan/math/fwd/fun/square.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_FWD_FUN_SQUARE_HPP 2 | #define STAN_MATH_FWD_FUN_SQUARE_HPP 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | namespace stan { 9 | namespace math { 10 | 11 | template 12 | inline fvar square(const fvar& x) { 13 | return fvar(square(x.val_), x.d_ * 2 * x.val_); 14 | } 15 | } // namespace math 16 | } // namespace stan 17 | #endif 18 | -------------------------------------------------------------------------------- /inst/include/stan/math/fwd/fun/tgamma.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_FWD_FUN_TGAMMA_HPP 2 | #define STAN_MATH_FWD_FUN_TGAMMA_HPP 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | namespace stan { 10 | namespace math { 11 | 12 | /** 13 | * Return the result of applying the gamma function to the 14 | * specified argument. 15 | * 16 | * @tparam T inner type of the fvar 17 | * @param x Argument. 18 | * @return Gamma function applied to argument. 19 | */ 20 | template 21 | inline fvar tgamma(const fvar& x) { 22 | T u = tgamma(x.val_); 23 | return fvar(u, x.d_ * u * digamma(x.val_)); 24 | } 25 | 26 | } // namespace math 27 | } // namespace stan 28 | #endif 29 | -------------------------------------------------------------------------------- /inst/include/stan/math/fwd/fun/trigamma.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_FWD_FUN_TRIGAMMA_HPP 2 | #define STAN_MATH_FWD_FUN_TRIGAMMA_HPP 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | namespace stan { 9 | namespace math { 10 | 11 | /** 12 | * Return the value of the trigamma function at the specified 13 | * argument (i.e., the second derivative of the log Gamma function 14 | * at the specified argument). 15 | * 16 | * @tparam T inner type of the fvar 17 | * @param u argument 18 | * @return trigamma function at argument 19 | */ 20 | template 21 | inline fvar trigamma(const fvar& u) { 22 | return trigamma_impl(u); 23 | } 24 | 25 | } // namespace math 26 | } // namespace stan 27 | #endif 28 | -------------------------------------------------------------------------------- /inst/include/stan/math/fwd/fun/trunc.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_FWD_FUN_TRUNC_HPP 2 | #define STAN_MATH_FWD_FUN_TRUNC_HPP 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | namespace stan { 9 | namespace math { 10 | 11 | /** 12 | * Return the nearest integral value that is not larger in 13 | * magnitude than the specified argument. 14 | * 15 | * @tparam T inner type of the fvar 16 | * @param[in] x Argument. 17 | * @return The truncated argument. 18 | */ 19 | template 20 | inline fvar trunc(const fvar& x) { 21 | return fvar(trunc(x.val_), 0); 22 | } 23 | 24 | } // namespace math 25 | } // namespace stan 26 | #endif 27 | -------------------------------------------------------------------------------- /inst/include/stan/math/fwd/fun/value_of.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_FWD_FUN_VALUE_OF_HPP 2 | #define STAN_MATH_FWD_FUN_VALUE_OF_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace stan { 8 | namespace math { 9 | 10 | /** 11 | * Return the value of the specified variable. 12 | * 13 | * @tparam T inner type of the fvar 14 | * @param v Variable. 15 | * @return Value of variable. 16 | */ 17 | template 18 | inline T value_of(const fvar& v) { 19 | return v.val_; 20 | } 21 | 22 | } // namespace math 23 | } // namespace stan 24 | #endif 25 | -------------------------------------------------------------------------------- /inst/include/stan/math/fwd/fun/value_of_rec.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_FWD_FUN_VALUE_OF_REC_HPP 2 | #define STAN_MATH_FWD_FUN_VALUE_OF_REC_HPP 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | namespace stan { 9 | namespace math { 10 | 11 | /** 12 | * Return the value of the specified variable. 13 | * 14 | * @tparam T inner type of the fvar, must implement value_of_rec 15 | * @param v Variable. 16 | * @return Value of variable. 17 | */ 18 | 19 | template 20 | inline double value_of_rec(const fvar& v) { 21 | return value_of_rec(v.val_); 22 | } 23 | 24 | } // namespace math 25 | } // namespace stan 26 | #endif 27 | -------------------------------------------------------------------------------- /inst/include/stan/math/fwd/functor.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_FWD_FUNCTOR_HPP 2 | #define STAN_MATH_FWD_FUNCTOR_HPP 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /inst/include/stan/math/fwd/meta.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_FWD_META_HPP 2 | #define STAN_MATH_FWD_META_HPP 3 | 4 | #include 5 | #include 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /inst/include/stan/math/fwd/meta/is_fvar.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_FWD_META_IS_FVAR_HPP 2 | #define STAN_MATH_FWD_META_IS_FVAR_HPP 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | namespace stan { 9 | 10 | namespace internal { 11 | template 12 | struct is_fvar_impl : std::false_type {}; 13 | 14 | template 15 | struct is_fvar_impl> : std::true_type {}; 16 | 17 | } // namespace internal 18 | 19 | template 20 | struct is_fvar>::value>> 22 | : std::true_type {}; 23 | 24 | } // namespace stan 25 | #endif 26 | -------------------------------------------------------------------------------- /inst/include/stan/math/fwd/meta/partials_type.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_FWD_META_PARTIALS_TYPE_HPP 2 | #define STAN_MATH_FWD_META_PARTIALS_TYPE_HPP 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | namespace stan { 10 | 11 | template 12 | struct partials_type> { 13 | using type = typename std::decay_t::Scalar; 14 | }; 15 | 16 | } // namespace stan 17 | #endif 18 | -------------------------------------------------------------------------------- /inst/include/stan/math/fwd/prob.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_FWD_PROB_HPP 2 | #define STAN_MATH_FWD_PROB_HPP 3 | 4 | #include 5 | #include 6 | 7 | #include 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /inst/include/stan/math/mix.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_MIX_HPP 2 | #define STAN_MATH_MIX_HPP 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | #ifdef STAN_OPENCL 15 | #include 16 | #endif 17 | 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | 24 | #include 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /inst/include/stan/math/mix/fun.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_MIX_FUN_HPP 2 | #define STAN_MATH_MIX_FUN_HPP 3 | 4 | #include 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /inst/include/stan/math/mix/functor.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_MIX_FUNCTOR_HPP 2 | #define STAN_MATH_MIX_FUNCTOR_HPP 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /inst/include/stan/math/mix/meta.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_MIX_META_HPP 2 | #define STAN_MATH_MIX_META_HPP 3 | 4 | #include 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | #include 11 | #include 12 | #include 13 | 14 | #include 15 | #include 16 | #include 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /inst/include/stan/math/opencl/err.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_OPENCL_ERR_HPP 2 | #define STAN_MATH_OPENCL_ERR_HPP 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /inst/include/stan/math/opencl/is_constant.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_OPENCL_IS_CONSTANT_HPP 2 | #define STAN_MATH_OPENCL_IS_CONSTANT_HPP 3 | #ifdef STAN_OPENCL 4 | 5 | #include 6 | #include 7 | 8 | namespace stan { 9 | 10 | /** \ingroup type_trait 11 | * Defines a static member named value and sets it to true 12 | * if the type of the elements in the provided matrix_cl 13 | * is constant, false otherwise. This is used in 14 | * the is_constant_all metaprogram. 15 | * @tparam type of the elements in the matrix_cl 16 | */ 17 | template 18 | struct is_constant> 19 | : std::true_type {}; 20 | 21 | } // namespace stan 22 | 23 | #endif 24 | #endif 25 | -------------------------------------------------------------------------------- /inst/include/stan/math/opencl/kernel_generator/common_return_scalar.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_OPENCL_KERNEL_GENERATOR_COMMON_RETURN_SCALAR_HPP 2 | #define STAN_MATH_OPENCL_KERNEL_GENERATOR_COMMON_RETURN_SCALAR_HPP 3 | #include 4 | 5 | namespace stan { 6 | namespace math { 7 | /** 8 | * @ingroup type_traits 9 | * Wrapper for `std::common_type_t` 10 | */ 11 | template 12 | using common_scalar_t = typename std::common_type_t< 13 | typename std::remove_reference_t::Scalar...>; 14 | } // namespace math 15 | } // namespace stan 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /inst/include/stan/math/opencl/kernel_generator/name_generator.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_OPENCL_KERNEL_GENERATOR_NAME_GENERATOR_HPP 2 | #define STAN_MATH_OPENCL_KERNEL_GENERATOR_NAME_GENERATOR_HPP 3 | #ifdef STAN_OPENCL 4 | 5 | #include 6 | 7 | namespace stan { 8 | namespace math { 9 | 10 | /** \addtogroup opencl_kernel_generator 11 | * @{ 12 | */ 13 | /** 14 | * Unique name generator for variables used in generated kernels. 15 | */ 16 | class name_generator { 17 | public: 18 | /** 19 | * Generates a unique variable name. 20 | * @return variable name 21 | */ 22 | inline std::string generate() { return "var" + std::to_string(++i_); } 23 | 24 | private: 25 | int i_{0}; 26 | }; 27 | /** @}*/ 28 | } // namespace math 29 | } // namespace stan 30 | 31 | #endif 32 | #endif 33 | -------------------------------------------------------------------------------- /inst/include/stan/math/opencl/plain_type.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_OPENCL_PLAIN_TYPE_HPP 2 | #define STAN_MATH_OPENCL_PLAIN_TYPE_HPP 3 | #ifdef STAN_OPENCL 4 | 5 | #include 6 | #include 7 | #include 8 | 9 | namespace stan { 10 | 11 | /** 12 | * Determines plain (non expression) type associated with \c T. For kernel 13 | * generator expression it is a type the expression can be evaluated into. 14 | * @tparam T type to determine plain type of 15 | */ 16 | template 17 | struct plain_type> { 18 | using type = math::matrix_cl::Scalar>; 19 | }; 20 | 21 | } // namespace stan 22 | 23 | #endif 24 | #endif 25 | -------------------------------------------------------------------------------- /inst/include/stan/math/opencl/prim/cols.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_OPENCL_PRIM_COLS_HPP 2 | #define STAN_MATH_OPENCL_PRIM_COLS_HPP 3 | #ifdef STAN_OPENCL 4 | 5 | #include 6 | 7 | namespace stan { 8 | namespace math { 9 | /** \ingroup opencl 10 | * Returns the number of columns in the specified kernel generator 11 | * expression. 12 | * 13 | * @tparam T_x type of input kernel generator expression x 14 | * @param x input kernel generator expression. 15 | * 16 | * @return number of columns in x 17 | */ 18 | template * = nullptr> 20 | inline int cols(const T_x& x) { 21 | return x.cols(); 22 | } 23 | } // namespace math 24 | } // namespace stan 25 | 26 | #endif 27 | #endif 28 | -------------------------------------------------------------------------------- /inst/include/stan/math/opencl/prim/eigenvalues_sym.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_OPENCL_PRIM_EIGENVALUES_SYM_HPP 2 | #define STAN_MATH_OPENCL_PRIM_EIGENVALUES_SYM_HPP 3 | #ifdef STAN_OPENCL 4 | 5 | #include 6 | #include 7 | 8 | namespace stan { 9 | namespace math { 10 | 11 | inline matrix_cl eigenvalues_sym(const matrix_cl& m) { 12 | check_nonzero_size("eigenvalues_sym", "m", m); 13 | check_symmetric("eigenvalues_sym", "m", m); 14 | 15 | matrix_cl eigenvalues, eigenvectors; 16 | symmetric_eigensolver(m, eigenvalues, eigenvectors); 17 | return eigenvalues; 18 | } 19 | 20 | } // namespace math 21 | } // namespace stan 22 | #endif 23 | #endif 24 | -------------------------------------------------------------------------------- /inst/include/stan/math/opencl/prim/eigenvectors_sym.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_OPENCL_PRIM_EIGENVECTORS_SYM_HPP 2 | #define STAN_MATH_OPENCL_PRIM_EIGENVECTORS_SYM_HPP 3 | #ifdef STAN_OPENCL 4 | 5 | #include 6 | #include 7 | 8 | namespace stan { 9 | namespace math { 10 | 11 | inline matrix_cl eigenvectors_sym(const matrix_cl& m) { 12 | check_nonzero_size("eigenvectors_sym", "m", m); 13 | check_symmetric("eigenvalues_sym", "m", m); 14 | 15 | matrix_cl eigenvalues, eigenvectors; 16 | symmetric_eigensolver(m, eigenvalues, eigenvectors); 17 | return eigenvectors; 18 | } 19 | 20 | } // namespace math 21 | } // namespace stan 22 | #endif 23 | #endif 24 | -------------------------------------------------------------------------------- /inst/include/stan/math/opencl/prim/num_elements.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_OPENCL_PRIM_NUM_ELEMENTS_HPP 2 | #define STAN_MATH_OPENCL_PRIM_NUM_ELEMENTS_HPP 3 | #ifdef STAN_OPENCL 4 | 5 | #include 6 | #include 7 | 8 | namespace stan { 9 | namespace math { 10 | 11 | /** 12 | * Returns the number of the elements of a `matrix_cl` or 13 | * `var_value>`. 14 | * @param m input to determine size of 15 | * @return number of elements in m 16 | */ 17 | template * = nullptr> 19 | size_t num_elements(const T& m) { 20 | return math::size(m); 21 | } 22 | 23 | } // namespace math 24 | } // namespace stan 25 | 26 | #endif 27 | #endif 28 | -------------------------------------------------------------------------------- /inst/include/stan/math/opencl/prim/rows.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_OPENCL_PRIM_ROWS_HPP 2 | #define STAN_MATH_OPENCL_PRIM_ROWS_HPP 3 | #ifdef STAN_OPENCL 4 | 5 | #include 6 | 7 | namespace stan { 8 | namespace math { 9 | /** \ingroup opencl 10 | * Returns the number of rows in the specified kernel generator 11 | * expression. 12 | * 13 | * @tparam T_x type of input kernel generator expression x 14 | * @param x input kernel generator expression. 15 | * 16 | * @return number of rows in x 17 | */ 18 | 19 | template * = nullptr> 21 | inline int rows(const T_x& x) { 22 | return x.rows(); 23 | } 24 | 25 | } // namespace math 26 | } // namespace stan 27 | 28 | #endif 29 | #endif 30 | -------------------------------------------------------------------------------- /inst/include/stan/math/opencl/prim/sign.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_OPENCL_PRIM_SIGN_HPP 2 | #define STAN_MATH_OPENCL_PRIM_SIGN_HPP 3 | #ifdef STAN_OPENCL 4 | 5 | #include 6 | 7 | namespace stan { 8 | namespace math { 9 | 10 | /** 11 | * Returns signs of the arguments. 12 | * @tparam T type of the argument (`matrix_cl` or kernel generator expression) 13 | * @param x the argument 14 | * @return sign of `x` 15 | */ 16 | template * = nullptr> 18 | auto sign(const T& x) { 19 | return select(x == 0, 0, select(x < 0, -1, 1)); 20 | } 21 | 22 | } // namespace math 23 | } // namespace stan 24 | #endif 25 | #endif 26 | -------------------------------------------------------------------------------- /inst/include/stan/math/opencl/prim/size.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_OPENCL_PRIM_SIZE_HPP 2 | #define STAN_MATH_OPENCL_PRIM_SIZE_HPP 3 | #ifdef STAN_OPENCL 4 | 5 | #include 6 | 7 | namespace stan { 8 | namespace math { 9 | 10 | /** 11 | * Returns the size (number of the elements) of a `matrix_cl` or 12 | * `var_value>`. 13 | * @param m input to determine size of 14 | * @return number of elements in m 15 | */ 16 | template * = nullptr> 18 | size_t size(const T& m) { 19 | return m.rows() * m.cols(); 20 | } 21 | 22 | } // namespace math 23 | } // namespace stan 24 | 25 | #endif 26 | #endif 27 | -------------------------------------------------------------------------------- /inst/include/stan/math/opencl/prim/to_array_2d.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_OPENCL_PRIM_TO_ARRAY_2D_HPP 2 | #define STAN_MATH_OPENCL_PRIM_TO_ARRAY_2D_HPP 3 | #ifdef STAN_OPENCL 4 | 5 | #include 6 | 7 | namespace stan { 8 | namespace math { 9 | 10 | /** \ingroup opencl 11 | * Returns input matrix converted into a nested std vector. With matrix_cl that 12 | * is the same type. 13 | * 14 | * @tparam T_x type of the matrix 15 | * 16 | * @param x matrix 17 | * @return the vector representation of the input 18 | */ 19 | template * = nullptr> 21 | inline T_x to_array_2d(T_x&& x) { 22 | return std::forward(x); 23 | } 24 | 25 | } // namespace math 26 | } // namespace stan 27 | #endif 28 | #endif 29 | -------------------------------------------------------------------------------- /inst/include/stan/math/opencl/rev/operator_unary_plus.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_OPENCL_REV_OPERATOR_UNARY_PLUS_HPP 2 | #define STAN_MATH_OPENCL_REV_OPERATOR_UNARY_PLUS_HPP 3 | #ifdef STAN_OPENCL 4 | 5 | #include 6 | #include 7 | 8 | namespace stan { 9 | namespace math { 10 | 11 | /** 12 | * Returns the unary plus of the input. 13 | * 14 | * @param M input kernel expression 15 | * @return result of unary plus of the input. 16 | */ 17 | template * = nullptr> 19 | inline T operator+(T&& M) { 20 | return std::forward(M); 21 | } 22 | 23 | } // namespace math 24 | } // namespace stan 25 | 26 | #endif 27 | #endif 28 | -------------------------------------------------------------------------------- /inst/include/stan/math/opencl/rev/transpose.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_OPENCL_REV_TRANSPOSE_HPP 2 | #define STAN_MATH_OPENCL_REV_TRANSPOSE_HPP 3 | #ifdef STAN_OPENCL 4 | 5 | #include 6 | #include 7 | #include 8 | 9 | namespace stan { 10 | namespace math { 11 | 12 | /** 13 | * Transposes a matrix. 14 | * @param M input matrix 15 | * @return transposed matrix 16 | */ 17 | template * = nullptr> 19 | inline auto transpose(const var_value& M) { 20 | return M.transpose(); 21 | } 22 | 23 | } // namespace math 24 | } // namespace stan 25 | 26 | #endif 27 | #endif 28 | -------------------------------------------------------------------------------- /inst/include/stan/math/opencl/scalar_type.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_OPENCL_SCALAR_TYPE_HPP 2 | #define STAN_MATH_OPENCL_SCALAR_TYPE_HPP 3 | #ifdef STAN_OPENCL 4 | 5 | #include 6 | #include 7 | 8 | namespace stan { 9 | 10 | /** \ingroup type_traits 11 | * Return the scalar type of an OpenCL matrix. 12 | */ 13 | template 14 | struct scalar_type> { 15 | using type = typename scalar_type::Scalar>::type; 16 | }; 17 | } // namespace stan 18 | #endif 19 | #endif 20 | -------------------------------------------------------------------------------- /inst/include/stan/math/opencl/stringify.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_OPENCL_STRINGIFY_HPP 2 | #define STAN_MATH_OPENCL_STRINGIFY_HPP 3 | 4 | // Used for importing the OpenCL kernels at compile time. 5 | // There has been much discussion about the best ways to do this: 6 | // https://github.com/bstatcomp/math/pull/7 7 | // and https://github.com/stan-dev/math/pull/966 8 | #ifndef STRINGIFY 9 | #define STRINGIFY(...) #__VA_ARGS__ 10 | #endif 11 | 12 | #endif // STAN_MATH_OPENCL_STRINGIFY_HPP 13 | -------------------------------------------------------------------------------- /inst/include/stan/math/opencl/value_type.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_OPENCL_VALUE_TYPE_HPP 2 | #define STAN_MATH_OPENCL_VALUE_TYPE_HPP 3 | #ifdef STAN_OPENCL 4 | 5 | #include 6 | #include 7 | 8 | namespace stan { 9 | 10 | /** \ingroup type_traits 11 | * Return the value type of an OpenCL matrix. 12 | */ 13 | template 14 | struct value_type> { 15 | using type = typename std::decay_t::Scalar; 16 | }; 17 | } // namespace stan 18 | #endif 19 | #endif 20 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_HPP 2 | #define STAN_MATH_PRIM_HPP 3 | 4 | #include 5 | 6 | #ifdef STAN_OPENCL 7 | #include 8 | #endif 9 | 10 | #include 11 | #include 12 | #include 13 | 14 | #include 15 | #include 16 | #include 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/core.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_CORE_HPP 2 | #define STAN_MATH_PRIM_CORE_HPP 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/core/operator_minus.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_CORE_OPERATOR_MINUS_HPP 2 | #define STAN_MATH_PRIM_CORE_OPERATOR_MINUS_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace stan { 8 | namespace math { 9 | 10 | /** 11 | * Return the negation of the argument. 12 | * 13 | * @tparam U value type argument 14 | * @param x argument 15 | * @return negation of the argument 16 | */ 17 | template > 18 | inline std::complex operator-(const std::complex& x) { 19 | return {-x.real(), -x.imag()}; 20 | } 21 | 22 | } // namespace math 23 | } // namespace stan 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/core/operator_plus.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_CORE_OPERATOR_PLUS_HPP 2 | #define STAN_MATH_PRIM_CORE_OPERATOR_PLUS_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace stan { 8 | namespace math { 9 | 10 | /** 11 | * Return the argument. 12 | * 13 | * @tparam U value type argument 14 | * @param x argument 15 | * @return argument 16 | */ 17 | template > 18 | inline std::complex operator+(const std::complex& x) { 19 | return x; 20 | } 21 | 22 | } // namespace math 23 | } // namespace stan 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/err/constraint_tolerance.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_ERR_CONSTRAINT_TOLERANCE_HPP 2 | #define STAN_MATH_PRIM_ERR_CONSTRAINT_TOLERANCE_HPP 3 | 4 | #ifndef STAN_MATH_CONSTRAINT_TOLERANCE 5 | #define STAN_MATH_CONSTRAINT_TOLERANCE 1E-8 6 | #endif 7 | 8 | #include 9 | namespace stan { 10 | namespace math { 11 | 12 | /** 13 | * The tolerance for checking arithmetic bounds in rank and in 14 | * simplexes. The default value is 1E-8. 15 | * This can changed by defining STAN_MATH_CONSTRAINT_TOLERANCE 16 | * at compile time. 17 | */ 18 | const double CONSTRAINT_TOLERANCE = STAN_MATH_CONSTRAINT_TOLERANCE; 19 | 20 | } // namespace math 21 | } // namespace stan 22 | #endif 23 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/err/is_nonzero_size.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_ERR_IS_NONZERO_SIZE_HPP 2 | #define STAN_MATH_PRIM_ERR_IS_NONZERO_SIZE_HPP 3 | 4 | #include 5 | namespace stan { 6 | namespace math { 7 | 8 | /** 9 | * Returns true if the specified matrix/vector is size nonzero. 10 | * @tparam T_y Type of container, requires class method .size() 11 | * @param y Container to test -- matrix/vector 12 | * @return true if container has size zero 13 | */ 14 | template 15 | inline bool is_nonzero_size(const T_y& y) { 16 | return y.size() > 0; 17 | } 18 | 19 | } // namespace math 20 | } // namespace stan 21 | #endif 22 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/err/is_size_match.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_ERR_IS_SIZE_MATCH_HPP 2 | #define STAN_MATH_PRIM_ERR_IS_SIZE_MATCH_HPP 3 | 4 | #include 5 | namespace stan { 6 | namespace math { 7 | 8 | /** 9 | * Return true if the provided sizes match. 10 | * @tparam T_size1 Type of size 1 11 | * @tparam T_size2 Type of size 2 12 | * @param i Size of variable 1 13 | * @param j Size of variable 2 14 | * @return true if provided dimensions match 15 | */ 16 | template 17 | inline bool is_size_match(T_size1 i, T_size2 j) { 18 | return i == static_cast(j); 19 | } 20 | 21 | } // namespace math 22 | } // namespace stan 23 | #endif 24 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/err/is_square.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_ERR_IS_SQUARE_HPP 2 | #define STAN_MATH_PRIM_ERR_IS_SQUARE_HPP 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | namespace stan { 9 | namespace math { 10 | 11 | /** 12 | * Return true if the matrix is square. This check allows 0x0 13 | * matrices. 14 | * @tparam EigMat A type derived from `EigenBase` 15 | * @param y Matrix to test 16 | * @return true if matrix is square 17 | */ 18 | template * = nullptr> 19 | inline bool is_square(const EigMat& y) { 20 | return is_size_match(y.rows(), y.cols()); 21 | } 22 | 23 | } // namespace math 24 | } // namespace stan 25 | #endif 26 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/fun/as_bool.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_FUN_AS_BOOL_HPP 2 | #define STAN_MATH_PRIM_FUN_AS_BOOL_HPP 3 | 4 | #include 5 | namespace stan { 6 | namespace math { 7 | 8 | /** 9 | * Return true if the argument is not equal to zero (in the 10 | * != operator sense) and false otherwise. 11 | * 12 | * @tparam T type of scalar 13 | * @param x value 14 | * @return true if value is not equal to zero 15 | */ 16 | template 17 | inline bool as_bool(const T& x) { 18 | return x != 0; 19 | } 20 | 21 | } // namespace math 22 | } // namespace stan 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/fun/cols.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_FUN_COLS_HPP 2 | #define STAN_MATH_PRIM_FUN_COLS_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace stan { 8 | namespace math { 9 | 10 | /** 11 | * Return the number of columns in the specified 12 | * matrix, vector, or row vector. 13 | * 14 | * @tparam T type of the matrix 15 | * @param[in] m Input matrix, vector, or row vector. 16 | * @return Number of columns. 17 | */ 18 | template * = nullptr> 19 | inline Eigen::Index cols(const T& m) { 20 | return m.cols(); 21 | } 22 | 23 | } // namespace math 24 | } // namespace stan 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/fun/diagonal.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_FUN_DIAGONAL_HPP 2 | #define STAN_MATH_PRIM_FUN_DIAGONAL_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace stan { 8 | namespace math { 9 | 10 | /** 11 | * Return a column vector of the diagonal elements of the 12 | * specified matrix. The matrix is not required to be square. 13 | * 14 | * @tparam T type of the matrix 15 | * @param m Specified matrix. 16 | * @return Diagonal of the matrix. 17 | */ 18 | template * = nullptr> 19 | inline auto diagonal(const T& m) { 20 | return m.diagonal(); 21 | } 22 | 23 | } // namespace math 24 | } // namespace stan 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/fun/dot.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_FUN_DOT_HPP 2 | #define STAN_MATH_PRIM_FUN_DOT_HPP 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | namespace stan { 9 | namespace math { 10 | 11 | inline double dot(const std::vector& x, const std::vector& y) { 12 | double sum = 0.0; 13 | for (size_t i = 0; i < x.size(); ++i) { 14 | sum += x[i] * y[i]; 15 | } 16 | return sum; 17 | } 18 | 19 | } // namespace math 20 | } // namespace stan 21 | #endif 22 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/fun/get_lp.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_FUN_GET_LP_HPP 2 | #define STAN_MATH_PRIM_FUN_GET_LP_HPP 3 | 4 | #include 5 | 6 | namespace stan { 7 | namespace math { 8 | 9 | template 10 | inline return_type_t get_lp( 11 | const T_lp& lp, const accumulator& lp_accum) { 12 | return lp + lp_accum.sum(); 13 | } 14 | 15 | } // namespace math 16 | } // namespace stan 17 | #endif 18 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/fun/identity_matrix.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_FUN_IDENTITY_MATRIX_HPP 2 | #define STAN_MATH_PRIM_FUN_IDENTITY_MATRIX_HPP 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | namespace stan { 9 | namespace math { 10 | 11 | /** 12 | * Return a square identity matrix 13 | * 14 | * @param K size of the matrix 15 | * @return An identity matrix of size K. 16 | * @throw std::domain_error if K is negative. 17 | */ 18 | template * = nullptr> 19 | inline auto identity_matrix(int K) { 20 | check_nonnegative("identity_matrix", "size", K); 21 | return T::Identity(K, K); 22 | } 23 | 24 | } // namespace math 25 | } // namespace stan 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/fun/imag.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_FUN_IMAG_HPP 2 | #define STAN_MATH_PRIM_FUN_IMAG_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace stan { 8 | namespace math { 9 | 10 | /** 11 | * Return the imaginary component of the complex argument. 12 | * 13 | * @tparam T value type of complex argument 14 | * @param[in] z complex value whose imaginary component is extracted 15 | * @return imaginary component of argument 16 | */ 17 | template > 18 | T imag(const std::complex& z) { 19 | return z.imag(); 20 | } 21 | 22 | } // namespace math 23 | } // namespace stan 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/fun/is_inf.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_FUN_IS_INF_HPP 2 | #define STAN_MATH_PRIM_FUN_IS_INF_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace stan { 8 | namespace math { 9 | 10 | /** 11 | * Returns true if the input is infinite and false otherwise. 12 | * 13 | * Delegates to std::isinf. 14 | * 15 | * @param x Value to test. 16 | * @return true if the value is infinite. 17 | */ 18 | inline bool is_inf(double x) { return std::isinf(x); } 19 | 20 | } // namespace math 21 | } // namespace stan 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/fun/is_integer.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_FUN_IS_INTEGER_HPP 2 | #define STAN_MATH_PRIM_FUN_IS_INTEGER_HPP 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | namespace stan { 9 | namespace math { 10 | 11 | /** 12 | * Returns true if the input is an integer and false otherwise. 13 | * 14 | * @param x Value to test. 15 | * @return true if the value is an integer 16 | */ 17 | template 18 | inline bool is_integer(T x) { 19 | using std::floor; 20 | return floor(x) == x; 21 | } 22 | 23 | } // namespace math 24 | } // namespace stan 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/fun/is_nonpositive_integer.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_FUN_IS_NONPOSITIVE_INTEGER_HPP 2 | #define STAN_MATH_PRIM_FUN_IS_NONPOSITIVE_INTEGER_HPP 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | namespace stan { 9 | namespace math { 10 | 11 | /** 12 | * Returns true if the input is a nonpositive integer and false otherwise. 13 | * 14 | * @param x Value to test. 15 | * @return true if the value is an integer 16 | */ 17 | template 18 | inline bool is_nonpositive_integer(T x) { 19 | using std::floor; 20 | return x <= 0.0 && floor(x) == x; 21 | } 22 | 23 | } // namespace math 24 | } // namespace stan 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/fun/is_uninitialized.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_FUN_IS_UNINITIALIZED_HPP 2 | #define STAN_MATH_PRIM_FUN_IS_UNINITIALIZED_HPP 3 | 4 | #include 5 | namespace stan { 6 | namespace math { 7 | 8 | /** 9 | * Returns true if the specified variable is 10 | * uninitialized. Arithmetic types are always initialized 11 | * by definition (the value is not specified). 12 | * 13 | * @tparam T Type of object to test. 14 | * @param x Object to test. 15 | * @return true if the specified object is uninitialized. 16 | * @return false if input is NaN. 17 | */ 18 | template 19 | inline bool is_uninitialized(T x) { 20 | return false; 21 | } 22 | 23 | } // namespace math 24 | } // namespace stan 25 | #endif 26 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/fun/isfinite.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_SCAL_FUN_ISFINITE_HPP 2 | #define STAN_MATH_PRIM_SCAL_FUN_ISFINITE_HPP 3 | 4 | #include 5 | 6 | namespace stan { 7 | namespace math { 8 | 9 | /** 10 | * Return true if specified argument is finite (not infinite and not 11 | * not-a-number). 12 | * 13 | * Overloads `std::isfinite` from `` for argument-dependent 14 | * lookup. 15 | * 16 | * @tparam ADType type of argument 17 | * @param[in] v argument 18 | * @return true if argument is finite 19 | */ 20 | template * = nullptr> 21 | inline bool isfinite(ADType&& v) { 22 | using std::isfinite; 23 | return isfinite(v.val()); 24 | } 25 | 26 | } // namespace math 27 | } // namespace stan 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/fun/isinf.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_SCAL_FUN_ISINF_HPP 2 | #define STAN_MATH_PRIM_SCAL_FUN_ISINF_HPP 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | namespace stan { 9 | namespace math { 10 | 11 | /** 12 | * Return true if specified argument is infinite (positive or 13 | * negative). 14 | * 15 | * Overloads `std::isinf` from `` for argument-dependent 16 | * lookup. 17 | * 18 | * @tparam ADType type of argument 19 | * @param[in] v argument 20 | * @return true if argument is infinite 21 | */ 22 | template > 23 | inline bool isinf(const T& v) { 24 | return is_inf(v); 25 | } 26 | 27 | } // namespace math 28 | } // namespace stan 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/fun/isnan.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_SCAL_FUN_ISNAN_HPP 2 | #define STAN_MATH_PRIM_SCAL_FUN_ISNAN_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace stan { 8 | namespace math { 9 | 10 | /** 11 | * Return true if specified argument is not-a-number. 12 | * 13 | * Overloads `std::isnan` from `` for argument-dependent 14 | * lookup. 15 | * 16 | * @tparam ADType type of argument 17 | * @param[in] x argument 18 | * @return true if argument is not-a-number 19 | */ 20 | template > 21 | inline bool isnan(const T& x) { 22 | return is_nan(x); 23 | } 24 | 25 | } // namespace math 26 | } // namespace stan 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/fun/log_determinant_ldlt.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_FUN_LOG_DETERMINANT_LDLT_HPP 2 | #define STAN_MATH_PRIM_FUN_LOG_DETERMINANT_LDLT_HPP 3 | 4 | #include 5 | 6 | namespace stan { 7 | namespace math { 8 | 9 | /** 10 | * Returns log(abs(det(A))) given a LDLT_factor of A 11 | * 12 | * @tparam T type of elements in the LDLT_factor 13 | * @param A LDLT_factor 14 | * @return the log(abs(det(A)) 15 | */ 16 | template * = nullptr> 17 | inline value_type_t log_determinant_ldlt(LDLT_factor& A) { 18 | if (A.matrix().size() == 0) { 19 | return 0; 20 | } 21 | 22 | return sum(log(A.ldlt().vectorD().array())); 23 | } 24 | 25 | } // namespace math 26 | } // namespace stan 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/fun/logical_eq.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_FUN_LOGICAL_EQ_HPP 2 | #define STAN_MATH_PRIM_FUN_LOGICAL_EQ_HPP 3 | 4 | #include 5 | namespace stan { 6 | namespace math { 7 | 8 | /** 9 | * Return 1 if the first argument is equal to the second. 10 | * Equivalent to x1 == x2. 11 | * 12 | * @tparam T1 type of first argument 13 | * @tparam T2 type of second argument 14 | * @param x1 first argument 15 | * @param x2 second argument 16 | * @return true iff x1 == x2 17 | */ 18 | template 19 | inline int logical_eq(const T1 x1, const T2 x2) { 20 | return x1 == x2; 21 | } 22 | 23 | } // namespace math 24 | } // namespace stan 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/fun/logical_gt.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_FUN_LOGICAL_GT_HPP 2 | #define STAN_MATH_PRIM_FUN_LOGICAL_GT_HPP 3 | 4 | namespace stan { 5 | namespace math { 6 | 7 | /** 8 | * Return 1 if the first argument is strictly greater than the second. 9 | * Equivalent to x1 < x2. 10 | * 11 | * @tparam T1 type of first argument 12 | * @tparam T2 type of second argument 13 | * @param x1 first argument 14 | * @param x2 second argument 15 | * @return true if x1 > x2 16 | */ 17 | template 18 | inline bool logical_gt(const T1 x1, const T2 x2) { 19 | return x1 > x2; 20 | } 21 | 22 | } // namespace math 23 | } // namespace stan 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/fun/logical_gte.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_FUN_LOGICAL_GTE_HPP 2 | #define STAN_MATH_PRIM_FUN_LOGICAL_GTE_HPP 3 | 4 | namespace stan { 5 | namespace math { 6 | 7 | /** 8 | * Return 1 if the first argument is greater than or equal to the second. 9 | * Equivalent to x1 >= x2. 10 | * 11 | * @tparam T1 type of first argument 12 | * @tparam T2 type of second argument 13 | * @param x1 first argument 14 | * @param x2 second argument 15 | * @return true if x1 >= x2 16 | */ 17 | template 18 | inline bool logical_gte(const T1 x1, const T2 x2) { 19 | return x1 >= x2; 20 | } 21 | 22 | } // namespace math 23 | } // namespace stan 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/fun/logical_lt.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_FUN_LOGICAL_LT_HPP 2 | #define STAN_MATH_PRIM_FUN_LOGICAL_LT_HPP 3 | 4 | namespace stan { 5 | namespace math { 6 | 7 | /** 8 | * Return 1 if the first argument is strictly less than the second. 9 | * Equivalent to x1 < x2. 10 | * 11 | * @tparam T1 type of first argument 12 | * @tparam T2 type of second argument 13 | * @param x1 first argument 14 | * @param x2 second argument 15 | * @return true if x1 < x2 16 | */ 17 | template 18 | inline bool logical_lt(T1 x1, T2 x2) { 19 | return x1 < x2; 20 | } 21 | 22 | } // namespace math 23 | } // namespace stan 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/fun/logical_lte.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_FUN_LOGICAL_LTE_HPP 2 | #define STAN_MATH_PRIM_FUN_LOGICAL_LTE_HPP 3 | 4 | namespace stan { 5 | namespace math { 6 | 7 | /** 8 | * Return 1 if the first argument is less than or equal to the second. 9 | * Equivalent to x1 <= x2. 10 | * 11 | * @tparam T1 type of first argument 12 | * @tparam T2 type of second argument 13 | * @param x1 first argument 14 | * @param x2 second argument 15 | * @return true iff x1 <= x2 16 | */ 17 | template 18 | inline bool logical_lte(const T1 x1, const T2 x2) { 19 | return x1 <= x2; 20 | } 21 | 22 | } // namespace math 23 | } // namespace stan 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/fun/logical_negation.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_FUN_LOGICAL_NEGATION_HPP 2 | #define STAN_MATH_PRIM_FUN_LOGICAL_NEGATION_HPP 3 | 4 | #include 5 | namespace stan { 6 | namespace math { 7 | 8 | /** 9 | * The logical negation function which returns one if the input 10 | * is equal to zero and zero otherwise. 11 | * 12 | * @tparam T type of value 13 | * @param x value 14 | * @return 1 if value is zero and 0 otherwise 15 | */ 16 | template 17 | inline int logical_negation(const T& x) { 18 | return x == 0; 19 | } 20 | 21 | } // namespace math 22 | } // namespace stan 23 | #endif 24 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/fun/logical_neq.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_FUN_LOGICAL_NEQ_HPP 2 | #define STAN_MATH_PRIM_FUN_LOGICAL_NEQ_HPP 3 | 4 | #include 5 | namespace stan { 6 | namespace math { 7 | 8 | /** 9 | * Return 1 if the first argument is unequal to the second. 10 | * Equivalent to x1 != x2. 11 | * 12 | * @tparam T1 type of first argument 13 | * @tparam T2 type of second argument 14 | * @param x1 first argument 15 | * @param x2 second argument 16 | * @return true iff x1 != x2 17 | */ 18 | template 19 | inline int logical_neq(const T1 x1, const T2 x2) { 20 | return x1 != x2; 21 | } 22 | 23 | } // namespace math 24 | } // namespace stan 25 | #endif 26 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/fun/max_size.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_FUN_MAX_SIZE_HPP 2 | #define STAN_MATH_PRIM_FUN_MAX_SIZE_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace stan { 8 | namespace math { 9 | 10 | /** 11 | * Calculate the size of the largest input. 12 | * @tparam T1 type of the first input 13 | * @tparam Ts types of the other inputs 14 | * @param x1 first input 15 | * @param xs other inputs 16 | * @return the size of the largest input 17 | */ 18 | template 19 | inline size_t max_size(const T1& x1, const Ts&... xs) { 20 | return std::max({stan::math::size(x1), stan::math::size(xs)...}); 21 | } 22 | 23 | } // namespace math 24 | } // namespace stan 25 | #endif 26 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/fun/modulus.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_FUN_MODULUS_HPP 2 | #define STAN_MATH_PRIM_FUN_MODULUS_HPP 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | namespace stan { 10 | namespace math { 11 | 12 | inline int modulus(int x, int y) { 13 | if (unlikely(y == 0)) { 14 | throw_domain_error("modulus", "divisor is", 0, ""); 15 | } 16 | return x % y; 17 | } 18 | 19 | } // namespace math 20 | } // namespace stan 21 | #endif 22 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/fun/ones_array.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_FUN_ONES_ARRAY_HPP 2 | #define STAN_MATH_PRIM_FUN_ONES_ARRAY_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace stan { 8 | namespace math { 9 | 10 | /** 11 | * Return an array of ones. 12 | * 13 | * @param K size of the array 14 | * @return An array of size K with all elements initialized to 1. 15 | * @throw std::domain_error if K is negative. 16 | */ 17 | inline std::vector ones_array(int K) { 18 | check_nonnegative("ones_array", "size", K); 19 | return std::vector(K, 1); 20 | } 21 | 22 | } // namespace math 23 | } // namespace stan 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/fun/ones_int_array.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_FUN_ONES_INT_ARRAY_HPP 2 | #define STAN_MATH_PRIM_FUN_ONES_INT_ARRAY_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace stan { 8 | namespace math { 9 | 10 | /** 11 | * Return an integer array of ones. 12 | * 13 | * @param K size of the array 14 | * @return An integer array of size K with all elements initialized to 1. 15 | * @throw std::domain_error if K is negative. 16 | */ 17 | inline std::vector ones_int_array(int K) { 18 | check_nonnegative("ones_int_array", "size", K); 19 | return std::vector(K, 1); 20 | } 21 | 22 | } // namespace math 23 | } // namespace stan 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/fun/ones_row_vector.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_FUN_ONES_ROW_VECTOR_HPP 2 | #define STAN_MATH_PRIM_FUN_ONES_ROW_VECTOR_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace stan { 8 | namespace math { 9 | 10 | /** 11 | * Return a row vector of ones 12 | * 13 | * @param K size of the row vector 14 | * @return A row vector of size K with all elements initialized to 1. 15 | * @throw std::domain_error if K is negative. 16 | */ 17 | inline auto ones_row_vector(int K) { 18 | check_nonnegative("ones_row_vector", "size", K); 19 | return Eigen::RowVectorXd::Constant(K, 1); 20 | } 21 | 22 | } // namespace math 23 | } // namespace stan 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/fun/ones_vector.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_FUN_ONES_VECTOR_HPP 2 | #define STAN_MATH_PRIM_FUN_ONES_VECTOR_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace stan { 8 | namespace math { 9 | 10 | /** 11 | * Return a vector of ones 12 | * 13 | * @param K size of the vector 14 | * @return A vector of size K with all elements initialized to 1. 15 | * @throw std::domain_error if K is negative. 16 | */ 17 | inline auto ones_vector(int K) { 18 | check_nonnegative("ones_vector", "size", K); 19 | return Eigen::VectorXd::Constant(K, 1); 20 | } 21 | 22 | } // namespace math 23 | } // namespace stan 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/fun/plus.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_FUN_PLUS_HPP 2 | #define STAN_MATH_PRIM_FUN_PLUS_HPP 3 | 4 | #include 5 | 6 | namespace stan { 7 | namespace math { 8 | 9 | /** 10 | * Returns the unary plus of the input. 11 | * 12 | * @tparam T Type of input. 13 | * @param x input. 14 | * @return result of unary plus of the input. 15 | */ 16 | template 17 | inline T plus(T&& x) { 18 | return std::forward(x); 19 | } 20 | 21 | } // namespace math 22 | } // namespace stan 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/fun/pseudo_eigenvalues.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_FUN_PSEUDO_EIGENVALUES_HPP 2 | #define STAN_MATH_PRIM_FUN_PSEUDO_EIGENVALUES_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace stan { 8 | namespace math { 9 | 10 | template 11 | Eigen::Matrix pseudo_eigenvalues(const Eigen::Matrix& m) { 12 | check_nonzero_size("pseudo_eigenvalues", "m", m); 13 | check_square("pseudo_eigenvalues", "m", m); 14 | 15 | Eigen::EigenSolver> solver(m); 16 | return solver.pseudoEigenvalueMatrix(); 17 | } 18 | 19 | } // namespace math 20 | } // namespace stan 21 | #endif 22 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/fun/pseudo_eigenvectors.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_FUN_PSEUDO_EIGENVECTORS_HPP 2 | #define STAN_MATH_PRIM_FUN_PSEUDO_EIGENVECTORS_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace stan { 8 | namespace math { 9 | 10 | template 11 | Eigen::Matrix pseudo_eigenvectors( 12 | const Eigen::Matrix& m) { 13 | check_nonzero_size("pseudo_eigenvectors", "m", m); 14 | check_square("pseudo_eigenvectors", "m", m); 15 | 16 | Eigen::EigenSolver> solver(m); 17 | return solver.pseudoEigenvectors(); 18 | } 19 | 20 | } // namespace math 21 | } // namespace stan 22 | #endif 23 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/fun/real.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_FUN_REAL_HPP 2 | #define STAN_MATH_PRIM_FUN_REAL_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace stan { 8 | namespace math { 9 | 10 | /** 11 | * Return the real component of the complex argument. 12 | * 13 | * @tparam T value type of complex argument 14 | * @param[in] z complex value whose real component is extracted 15 | * @return real component of argument 16 | */ 17 | template > 18 | T real(const std::complex& z) { 19 | return z.real(); 20 | } 21 | 22 | } // namespace math 23 | } // namespace stan 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/fun/rows.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_FUN_ROWS_HPP 2 | #define STAN_MATH_PRIM_FUN_ROWS_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace stan { 8 | namespace math { 9 | 10 | /** 11 | * Return the number of rows in the specified 12 | * matrix, vector, or row vector. 13 | * 14 | * @tparam T type of the matrix 15 | * @param[in] m Input matrix, vector, or row vector. 16 | * @return Number of rows. 17 | */ 18 | template * = nullptr> 19 | inline int rows(const T& m) { 20 | return m.rows(); 21 | } 22 | 23 | } // namespace math 24 | } // namespace stan 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/fun/scalbn.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_FUN_SCALBN_HPP 2 | #define STAN_MATH_PRIM_FUN_SCALBN_HPP 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | namespace stan { 9 | namespace math { 10 | 11 | template > 12 | double scalbn(const T& x, int n) { 13 | return std::scalbn(value_of_rec(x), n); 14 | } 15 | 16 | } // namespace math 17 | } // namespace stan 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/fun/scaled_add.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_FUN_SCALED_ADD_HPP 2 | #define STAN_MATH_PRIM_FUN_SCALED_ADD_HPP 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | namespace stan { 9 | namespace math { 10 | 11 | inline void scaled_add(std::vector& x, const std::vector& y, 12 | double lambda) { 13 | for (size_t i = 0; i < x.size(); ++i) { 14 | x[i] += lambda * y[i]; 15 | } 16 | } 17 | 18 | } // namespace math 19 | } // namespace stan 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/fun/signbit.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_SCAL_FUN_SIGNBIT_HPP 2 | #define STAN_MATH_PRIM_SCAL_FUN_SIGNBIT_HPP 3 | 4 | #include 5 | 6 | namespace stan { 7 | namespace math { 8 | 9 | /** 10 | * Return `true` if the specified argument is negative and `false` 11 | * otherwise. 12 | * 13 | * Overloads `std::signbit` from `` for argument-dependent 14 | * lookup. 15 | * 16 | * @tparam ADType type of argument 17 | * @param[in] v argument 18 | * @return `true` if the argument is negative 19 | */ 20 | template * = nullptr> 21 | inline bool signbit(ADType&& v) { 22 | using std::signbit; 23 | return signbit(v.val()); 24 | } 25 | 26 | } // namespace math 27 | } // namespace stan 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/fun/sort_indices_asc.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_FUN_SORT_INDICES_ASC_HPP 2 | #define STAN_MATH_PRIM_FUN_SORT_INDICES_ASC_HPP 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | namespace stan { 11 | namespace math { 12 | 13 | /** 14 | * Return a sorted copy of the argument container in ascending order. 15 | * 16 | * @tparam C type of container 17 | * @param xs Container to sort 18 | * @return sorted version of container 19 | */ 20 | template 21 | std::vector sort_indices_asc(const C& xs) { 22 | return sort_indices(xs); 23 | } 24 | 25 | } // namespace math 26 | } // namespace stan 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/fun/sort_indices_desc.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_FUN_SORT_INDICES_DESC_HPP 2 | #define STAN_MATH_PRIM_FUN_SORT_INDICES_DESC_HPP 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | namespace stan { 11 | namespace math { 12 | 13 | /** 14 | * Return a sorted copy of the argument container in ascending order. 15 | * 16 | * @tparam C type of container 17 | * @param xs Container to sort 18 | * @return sorted version of container 19 | */ 20 | template 21 | std::vector sort_indices_desc(const C& xs) { 22 | return sort_indices(xs); 23 | } 24 | 25 | } // namespace math 26 | } // namespace stan 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/fun/transpose.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_FUN_TRANSPOSE_HPP 2 | #define STAN_MATH_PRIM_FUN_TRANSPOSE_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace stan { 8 | namespace math { 9 | 10 | /** 11 | * Transposes a matrix. 12 | * @tparam T type of the matrix or expression 13 | * @param m matrix or expression 14 | * @return transposed matrix 15 | */ 16 | template * = nullptr> 17 | auto inline transpose(const T& m) { 18 | return m.transpose(); 19 | } 20 | 21 | } // namespace math 22 | } // namespace stan 23 | #endif 24 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/fun/uniform_simplex.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_FUN_UNIFORM_SIMPLEX_HPP 2 | #define STAN_MATH_PRIM_FUN_UNIFORM_SIMPLEX_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace stan { 8 | namespace math { 9 | 10 | /** 11 | * Return a uniform simplex of size K 12 | * 13 | * @param K size of the simplex 14 | * @return A vector of size K with all elements initialized to 1 / K, 15 | * so that their sum is equal to 1. 16 | * @throw std::domain_error if K is not positive. 17 | */ 18 | inline auto uniform_simplex(int K) { 19 | check_positive("uniform_simplex", "size", K); 20 | return Eigen::VectorXd::Constant(K, 1.0 / K); 21 | } 22 | 23 | } // namespace math 24 | } // namespace stan 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/fun/zeros_array.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_FUN_ZEROS_ARRAY_HPP 2 | #define STAN_MATH_PRIM_FUN_ZEROS_ARRAY_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace stan { 8 | namespace math { 9 | 10 | /** 11 | * Return an array of zeros. 12 | * 13 | * @param K size of the array 14 | * @return an array of size K with all elements initialized to 0. 15 | * @throw std::domain_error if K is negative. 16 | */ 17 | inline std::vector zeros_array(int K) { 18 | check_nonnegative("zeros_array", "size", K); 19 | return std::vector(K, 0); 20 | } 21 | 22 | } // namespace math 23 | } // namespace stan 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/fun/zeros_int_array.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_FUN_ZEROS_INT_ARRAY_HPP 2 | #define STAN_MATH_PRIM_FUN_ZEROS_INT_ARRAY_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace stan { 8 | namespace math { 9 | 10 | /** 11 | * Return an integer array of zeros. 12 | * 13 | * @param K size of the array 14 | * @return an integer array of size K with all elements initialized to 0. 15 | * @throw std::domain_error if K is negative. 16 | */ 17 | inline std::vector zeros_int_array(int K) { 18 | check_nonnegative("zeros_int_array", "size", K); 19 | return std::vector(K, 0); 20 | } 21 | 22 | } // namespace math 23 | } // namespace stan 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/fun/zeros_row_vector.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_FUN_ZEROS_ROW_VECTOR_HPP 2 | #define STAN_MATH_PRIM_FUN_ZEROS_ROW_VECTOR_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace stan { 8 | namespace math { 9 | 10 | /** 11 | * Return a row vector of zeros 12 | * 13 | * @param K size of the row vector 14 | * @return A row vector of size K with all elements initialized to 0. 15 | * @throw std::domain_error if K is negative. 16 | */ 17 | inline auto zeros_row_vector(int K) { 18 | check_nonnegative("zeros_row_vector", "size", K); 19 | return Eigen::RowVectorXd::Zero(K); 20 | } 21 | 22 | } // namespace math 23 | } // namespace stan 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/fun/zeros_vector.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_FUN_ZEROS_VECTOR_HPP 2 | #define STAN_MATH_PRIM_FUN_ZEROS_VECTOR_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace stan { 8 | namespace math { 9 | 10 | /** 11 | * Return a vector of zeros. 12 | * 13 | * @param K size of the vector 14 | * @return A vector of size K with all elements initialized to 0. 15 | * @throw std::domain_error if K is negative. 16 | */ 17 | inline auto zeros_vector(int K) { 18 | check_nonnegative("zeros_vector", "size", K); 19 | return Eigen::VectorXd::Zero(K); 20 | } 21 | 22 | } // namespace math 23 | } // namespace stan 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/functor/mpi_cluster_inst.cpp: -------------------------------------------------------------------------------- 1 | #ifdef STAN_MPI 2 | 3 | #include 4 | 5 | // register stop worker command (instantiates boost serialization 6 | // templates) 7 | STAN_REGISTER_MPI_COMMAND(stan::math::mpi_stop_worker) 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/meta/bool_constant.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_META_BOOL_CONSTANT_HPP 2 | #define STAN_MATH_PRIM_META_BOOL_CONSTANT_HPP 3 | 4 | #include 5 | 6 | namespace stan { 7 | /** \ingroup type_trait 8 | * Alias for structs used for wraps a static constant of bool. 9 | * @tparam B On true, inherits std::true_type, false is std::false_type 10 | */ 11 | template 12 | using bool_constant = std::integral_constant; 13 | } // namespace stan 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/meta/conjunction.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_META_CONJUNCTION_HPP 2 | #define STAN_MATH_PRIM_META_CONJUNCTION_HPP 3 | 4 | #include 5 | 6 | namespace stan { 7 | namespace math { 8 | /** \ingroup type_trait 9 | * Extends std::true_type when instantiated with zero or more template 10 | * parameters, all of which extend the std::true_type. Extends std::false_type 11 | * if any of them extend the std::false_type. 12 | */ 13 | template 14 | struct conjunction : std::true_type {}; 15 | 16 | template 17 | struct conjunction 18 | : std::conditional_t, std::false_type> {}; 19 | 20 | } // namespace math 21 | } // namespace stan 22 | #endif 23 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/meta/contains_std_vector.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_META_CONTAINS_STD_VECTOR_HPP 2 | #define STAN_MATH_PRIM_META_CONTAINS_STD_VECTOR_HPP 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | namespace stan { 10 | /** \ingroup type_trait 11 | * Checks if any types are std vectors. 12 | */ 13 | template 14 | using contains_std_vector = math::disjunction...>; 15 | } // namespace stan 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/meta/disjunction.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_META_DISJUNCTION_HPP 2 | #define STAN_MATH_PRIM_META_DISJUNCTION_HPP 3 | 4 | #include 5 | 6 | namespace stan { 7 | namespace math { 8 | /** \ingroup type_trait 9 | * Extends std::false_type when instantiated with zero or more template 10 | * parameters, all of which extend the std::false_type. Extends std::true_type 11 | * if any of them extend the std::true_type. 12 | */ 13 | template 14 | struct disjunction : std::false_type {}; 15 | 16 | template 17 | struct disjunction 18 | : std::conditional_t> {}; 19 | 20 | } // namespace math 21 | } // namespace stan 22 | #endif 23 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/meta/error_index.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_META_ERROR_INDEX_HPP 2 | #define STAN_MATH_PRIM_META_ERROR_INDEX_HPP 3 | 4 | namespace stan { 5 | 6 | struct error_index { 7 | enum { 8 | value = 9 | #ifdef ERROR_INDEX 10 | ERROR_INDEX 11 | #else 12 | 1 13 | #endif 14 | }; 15 | }; 16 | 17 | } // namespace stan 18 | #endif 19 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/meta/is_detected.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_META_IS_DETECTED_HPP 2 | #define STAN_MATH_PRIM_META_IS_DETECTED_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace stan { 8 | 9 | template class, typename = void> 10 | struct is_detected : std::false_type {}; 11 | 12 | /** 13 | * Checks whether a valid type is detected. Most commonly used to detect 14 | * attributes of objects. 15 | * @tparam T The type to be checked. 16 | * @tparam Op a template template type which attempts to define a member 17 | * of an object. 18 | */ 19 | template class Op> 20 | struct is_detected>> : std::true_type {}; 21 | 22 | } // namespace stan 23 | #endif 24 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/meta/is_var_eigen.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_META_IS_VAR_EIGEN 2 | #define STAN_MATH_PRIM_META_IS_VAR_EIGEN 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | namespace stan { 10 | /** 11 | * Check if a type is a `var_value` whose `value_type` is derived from 12 | * `Eigen::EigenBase` 13 | * @tparam T type to check. 14 | * @ingroup type_trait 15 | */ 16 | template 17 | struct is_var_eigen 18 | : bool_constant< 19 | math::conjunction, is_eigen>>::value> {}; 20 | 21 | } // namespace stan 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/meta/is_vari.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_META_IS_VARI_HPP 2 | #define STAN_MATH_PRIM_META_IS_VARI_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace stan { 8 | /** \ingroup type_trait 9 | * Specialization for checking if value of T minus cv qualifier and pointer is a 10 | * vari. 11 | */ 12 | template 13 | struct is_vari : std::false_type {}; 14 | 15 | template 16 | struct value_type>> { 17 | using type = typename std::decay_t::value_type; 18 | }; 19 | 20 | } // namespace stan 21 | #endif 22 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/meta/partials_type.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_META_PARTIALS_TYPE_HPP 2 | #define STAN_MATH_PRIM_META_PARTIALS_TYPE_HPP 3 | 4 | namespace stan { 5 | 6 | /** \ingroup type_trait 7 | * This base implementation will contain a static member function named type 8 | * equal to the type passed into it. When this is specialized for vars the type 9 | * will be double and fvar will have a member type of value T. 10 | */ 11 | template 12 | struct partials_type { 13 | using type = T; 14 | }; 15 | 16 | /** \ingroup type_trait 17 | * Helper alias for accessing the partial type. 18 | */ 19 | template 20 | using partials_type_t = typename partials_type::type; 21 | 22 | } // namespace stan 23 | #endif 24 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/meta/promote_args.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_META_PROMOTE_ARGS_HPP 2 | #define STAN_MATH_PRIM_META_PROMOTE_ARGS_HPP 3 | 4 | #include 5 | 6 | namespace stan { 7 | 8 | /** \ingroup type_trait 9 | * Convenience alias for boost tools promote_args 10 | */ 11 | template 12 | using promote_args_t = typename boost::math::tools::promote_args::type; 13 | 14 | } // namespace stan 15 | #endif 16 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/meta/void_t.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_META_VOID_T_HPP 2 | #define STAN_MATH_PRIM_META_VOID_T_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace stan { 8 | 9 | // Dummy struct that has a type void 10 | template 11 | struct make_void { 12 | typedef void type; 13 | }; 14 | 15 | /** 16 | * Utility metafunction that maps a sequence of any types to the type void 17 | * This metafunction is used in template metaprogramming to detect ill-formed 18 | * types or the validity of an expression in an SFINAE context: 19 | */ 20 | template 21 | using void_t = typename make_void::type; 22 | 23 | } // namespace stan 24 | #endif 25 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/prob/bernoulli_ccdf_log.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_PROB_BERNOULLI_CCDF_LOG_HPP 2 | #define STAN_MATH_PRIM_PROB_BERNOULLI_CCDF_LOG_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace stan { 8 | namespace math { 9 | 10 | /** \ingroup prob_dists 11 | * @deprecated use bernoulli_lccdf 12 | */ 13 | template 14 | return_type_t bernoulli_ccdf_log(const T_n& n, const T_prob& theta) { 15 | return bernoulli_lccdf(n, theta); 16 | } 17 | } // namespace math 18 | } // namespace stan 19 | #endif 20 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/prob/bernoulli_cdf_log.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_PROB_BERNOULLI_CDF_LOG_HPP 2 | #define STAN_MATH_PRIM_PROB_BERNOULLI_CDF_LOG_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace stan { 8 | namespace math { 9 | 10 | /** \ingroup prob_dists 11 | * @deprecated use bernoulli_lcdf 12 | */ 13 | template 14 | return_type_t bernoulli_cdf_log(const T_n& n, const T_prob& theta) { 15 | return bernoulli_lcdf(n, theta); 16 | } 17 | 18 | } // namespace math 19 | } // namespace stan 20 | #endif 21 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/prob/beta_ccdf_log.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_PROB_BETA_CCDF_LOG_HPP 2 | #define STAN_MATH_PRIM_PROB_BETA_CCDF_LOG_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace stan { 8 | namespace math { 9 | 10 | /** \ingroup prob_dists 11 | * @deprecated use beta_lccdf 12 | */ 13 | template 14 | return_type_t beta_ccdf_log( 15 | const T_y& y, const T_scale_succ& alpha, const T_scale_fail& beta) { 16 | return beta_lccdf(y, alpha, beta); 17 | } 18 | 19 | } // namespace math 20 | } // namespace stan 21 | #endif 22 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/prob/beta_cdf_log.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_PROB_BETA_CDF_LOG_HPP 2 | #define STAN_MATH_PRIM_PROB_BETA_CDF_LOG_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace stan { 8 | namespace math { 9 | 10 | /** \ingroup prob_dists 11 | * @deprecated use beta_lcdf 12 | */ 13 | template 14 | return_type_t beta_cdf_log( 15 | const T_y& y, const T_scale_succ& alpha, const T_scale_fail& beta) { 16 | return beta_lcdf(y, alpha, beta); 17 | } 18 | 19 | } // namespace math 20 | } // namespace stan 21 | #endif 22 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/prob/beta_proportion_ccdf_log.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_PROB_BETA_PROPORTION_CCDF_LOG_HPP 2 | #define STAN_MATH_PRIM_PROB_BETA_PROPORTION_CCDF_LOG_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace stan { 8 | namespace math { 9 | 10 | /** \ingroup prob_dists 11 | * @deprecated use beta_proportion_lccdf 12 | */ 13 | template 14 | return_type_t beta_proportion_ccdf_log( 15 | const T_y& y, const T_loc& mu, const T_prec& kappa) { 16 | return beta_proportion_lccdf(y, mu, kappa); 17 | } 18 | 19 | } // namespace math 20 | } // namespace stan 21 | #endif 22 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/prob/binomial_ccdf_log.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_PROB_BINOMIAL_CCDF_LOG_HPP 2 | #define STAN_MATH_PRIM_PROB_BINOMIAL_CCDF_LOG_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace stan { 8 | namespace math { 9 | 10 | /** \ingroup prob_dists 11 | * @deprecated use binomial_lccdf 12 | */ 13 | template 14 | return_type_t binomial_ccdf_log(const T_n& n, const T_N& N, 15 | const T_prob& theta) { 16 | return binomial_lccdf(n, N, theta); 17 | } 18 | 19 | } // namespace math 20 | } // namespace stan 21 | #endif 22 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/prob/binomial_cdf_log.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_PROB_BINOMIAL_CDF_LOG_HPP 2 | #define STAN_MATH_PRIM_PROB_BINOMIAL_CDF_LOG_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace stan { 8 | namespace math { 9 | 10 | /** \ingroup prob_dists 11 | * @deprecated use binomial_lcdf 12 | */ 13 | template 14 | return_type_t binomial_cdf_log(const T_n& n, const T_N& N, 15 | const T_prob& theta) { 16 | return binomial_lcdf(n, N, theta); 17 | } 18 | 19 | } // namespace math 20 | } // namespace stan 21 | #endif 22 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/prob/cauchy_ccdf_log.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_PROB_CAUCHY_CCDF_LOG_HPP 2 | #define STAN_MATH_PRIM_PROB_CAUCHY_CCDF_LOG_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace stan { 8 | namespace math { 9 | 10 | /** \ingroup prob_dists 11 | * @deprecated use cauchy_lccdf 12 | */ 13 | template 14 | return_type_t cauchy_ccdf_log(const T_y& y, 15 | const T_loc& mu, 16 | const T_scale& sigma) { 17 | return cauchy_lccdf(y, mu, sigma); 18 | } 19 | 20 | } // namespace math 21 | } // namespace stan 22 | #endif 23 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/prob/cauchy_cdf_log.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_PROB_CAUCHY_CDF_LOG_HPP 2 | #define STAN_MATH_PRIM_PROB_CAUCHY_CDF_LOG_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace stan { 8 | namespace math { 9 | 10 | /** \ingroup prob_dists 11 | * @deprecated use cauchy_lcdf 12 | */ 13 | template 14 | return_type_t cauchy_cdf_log(const T_y& y, const T_loc& mu, 15 | const T_scale& sigma) { 16 | return cauchy_lcdf(y, mu, sigma); 17 | } 18 | 19 | } // namespace math 20 | } // namespace stan 21 | #endif 22 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/prob/chi_square_ccdf_log.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_PROB_CHI_SQUARE_CCDF_LOG_HPP 2 | #define STAN_MATH_PRIM_PROB_CHI_SQUARE_CCDF_LOG_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace stan { 8 | namespace math { 9 | 10 | /** \ingroup prob_dists 11 | * @deprecated use chi_square_lccdf 12 | */ 13 | template 14 | return_type_t chi_square_ccdf_log(const T_y& y, const T_dof& nu) { 15 | return chi_square_lccdf(y, nu); 16 | } 17 | 18 | } // namespace math 19 | } // namespace stan 20 | #endif 21 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/prob/chi_square_cdf_log.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_PROB_CHI_SQUARE_CDF_LOG_HPP 2 | #define STAN_MATH_PRIM_PROB_CHI_SQUARE_CDF_LOG_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace stan { 8 | namespace math { 9 | 10 | /** \ingroup prob_dists 11 | * @deprecated use chi_square_lcdf 12 | */ 13 | template 14 | return_type_t chi_square_cdf_log(const T_y& y, const T_dof& nu) { 15 | return chi_square_lcdf(y, nu); 16 | } 17 | 18 | } // namespace math 19 | } // namespace stan 20 | #endif 21 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/prob/discrete_range_ccdf_log.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_PROB_DISCRETE_RANGE_CCDF_LOG_HPP 2 | #define STAN_MATH_PRIM_PROB_DISCRETE_RANGE_CCDF_LOG_HPP 3 | 4 | #include 5 | 6 | namespace stan { 7 | namespace math { 8 | 9 | /** \ingroup prob_dists 10 | * @deprecated use discrete_range_lccdf 11 | */ 12 | template 13 | double discrete_range_ccdf_log(const T_y& y, const T_lower& lower, 14 | const T_upper& upper) { 15 | return discrete_range_lccdf(y, lower, upper); 16 | } 17 | 18 | } // namespace math 19 | } // namespace stan 20 | #endif 21 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/prob/discrete_range_cdf_log.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_PROB_DISCRETE_RANGE_CDF_LOG_HPP 2 | #define STAN_MATH_PRIM_PROB_DISCRETE_RANGE_CDF_LOG_HPP 3 | 4 | #include 5 | 6 | namespace stan { 7 | namespace math { 8 | 9 | /** \ingroup prob_dists 10 | * @deprecated use discrete_range_lcdf 11 | */ 12 | template 13 | double discrete_range_cdf_log(const T_y& y, const T_lower& lower, 14 | const T_upper& upper) { 15 | return discrete_range_lcdf(y, lower, upper); 16 | } 17 | 18 | } // namespace math 19 | } // namespace stan 20 | #endif 21 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/prob/double_exponential_ccdf_log.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_PROB_DOUBLE_EXPONENTIAL_CCDF_LOG_HPP 2 | #define STAN_MATH_PRIM_PROB_DOUBLE_EXPONENTIAL_CCDF_LOG_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace stan { 8 | namespace math { 9 | 10 | /** \ingroup prob_dists 11 | * @deprecated use double_exponential_lccdf 12 | */ 13 | template 14 | return_type_t double_exponential_ccdf_log( 15 | const T_y& y, const T_loc& mu, const T_scale& sigma) { 16 | return double_exponential_lccdf(y, mu, sigma); 17 | } 18 | 19 | } // namespace math 20 | } // namespace stan 21 | #endif 22 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/prob/double_exponential_cdf_log.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_PROB_DOUBLE_EXPONENTIAL_CDF_LOG_HPP 2 | #define STAN_MATH_PRIM_PROB_DOUBLE_EXPONENTIAL_CDF_LOG_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace stan { 8 | namespace math { 9 | 10 | /** \ingroup prob_dists 11 | * @deprecated use double_exponential_lcdf 12 | */ 13 | template 14 | return_type_t double_exponential_cdf_log( 15 | const T_y& y, const T_loc& mu, const T_scale& sigma) { 16 | return double_exponential_lcdf(y, mu, sigma); 17 | } 18 | } // namespace math 19 | } // namespace stan 20 | #endif 21 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/prob/exponential_ccdf_log.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_PROB_EXPONENTIAL_CCDF_LOG_HPP 2 | #define STAN_MATH_PRIM_PROB_EXPONENTIAL_CCDF_LOG_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace stan { 8 | namespace math { 9 | 10 | /** \ingroup prob_dists 11 | * @deprecated use exponential_lccdf 12 | */ 13 | template 14 | return_type_t exponential_ccdf_log(const T_y& y, 15 | const T_inv_scale& beta) { 16 | return exponential_lccdf(y, beta); 17 | } 18 | 19 | } // namespace math 20 | } // namespace stan 21 | #endif 22 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/prob/exponential_cdf_log.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_PROB_EXPONENTIAL_CDF_LOG_HPP 2 | #define STAN_MATH_PRIM_PROB_EXPONENTIAL_CDF_LOG_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace stan { 8 | namespace math { 9 | 10 | /** \ingroup prob_dists 11 | * @deprecated use exponential_lcdf 12 | */ 13 | template 14 | return_type_t exponential_cdf_log(const T_y& y, 15 | const T_inv_scale& beta) { 16 | return exponential_lcdf(y, beta); 17 | } 18 | 19 | } // namespace math 20 | } // namespace stan 21 | #endif 22 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/prob/gamma_ccdf_log.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_PROB_GAMMA_CCDF_LOG_HPP 2 | #define STAN_MATH_PRIM_PROB_GAMMA_CCDF_LOG_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace stan { 8 | namespace math { 9 | 10 | /** \ingroup prob_dists 11 | * @deprecated use gamma_lccdf 12 | */ 13 | template 14 | return_type_t gamma_ccdf_log( 15 | const T_y& y, const T_shape& alpha, const T_inv_scale& beta) { 16 | return gamma_lccdf(y, alpha, beta); 17 | } 18 | 19 | } // namespace math 20 | } // namespace stan 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/prob/gamma_cdf_log.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_PROB_GAMMA_CDF_LOG_HPP 2 | #define STAN_MATH_PRIM_PROB_GAMMA_CDF_LOG_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace stan { 8 | namespace math { 9 | 10 | /** \ingroup prob_dists 11 | * @deprecated use gamma_lcdf 12 | */ 13 | template 14 | return_type_t gamma_cdf_log( 15 | const T_y& y, const T_shape& alpha, const T_inv_scale& beta) { 16 | return gamma_lcdf(y, alpha, beta); 17 | } 18 | 19 | } // namespace math 20 | } // namespace stan 21 | #endif 22 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/prob/gumbel_ccdf_log.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_PROB_GUMBEL_CCDF_LOG_HPP 2 | #define STAN_MATH_PRIM_PROB_GUMBEL_CCDF_LOG_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace stan { 8 | namespace math { 9 | 10 | /** \ingroup prob_dists 11 | * @deprecated use gumbel_lccdf 12 | */ 13 | template 14 | return_type_t gumbel_ccdf_log(const T_y& y, 15 | const T_loc& mu, 16 | const T_scale& beta) { 17 | return gumbel_lccdf(y, mu, beta); 18 | } 19 | 20 | } // namespace math 21 | } // namespace stan 22 | #endif 23 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/prob/gumbel_cdf_log.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_PROB_GUMBEL_CDF_LOG_HPP 2 | #define STAN_MATH_PRIM_PROB_GUMBEL_CDF_LOG_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace stan { 8 | namespace math { 9 | 10 | /** \ingroup prob_dists 11 | * @deprecated use gumbel_lcdf 12 | */ 13 | template 14 | return_type_t gumbel_cdf_log(const T_y& y, const T_loc& mu, 15 | const T_scale& beta) { 16 | return gumbel_lcdf(y, mu, beta); 17 | } 18 | 19 | } // namespace math 20 | } // namespace stan 21 | #endif 22 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/prob/inv_chi_square_ccdf_log.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_PROB_INV_CHI_SQUARE_CCDF_LOG_HPP 2 | #define STAN_MATH_PRIM_PROB_INV_CHI_SQUARE_CCDF_LOG_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace stan { 8 | namespace math { 9 | 10 | /** \ingroup prob_dists 11 | * @deprecated use inv_chi_square_lccdf 12 | */ 13 | template 14 | return_type_t inv_chi_square_ccdf_log(const T_y& y, 15 | const T_dof& nu) { 16 | return inv_chi_square_lccdf(y, nu); 17 | } 18 | 19 | } // namespace math 20 | } // namespace stan 21 | #endif 22 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/prob/inv_chi_square_cdf_log.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_PROB_INV_CHI_SQUARE_CDF_LOG_HPP 2 | #define STAN_MATH_PRIM_PROB_INV_CHI_SQUARE_CDF_LOG_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace stan { 8 | namespace math { 9 | 10 | /** \ingroup prob_dists 11 | * @deprecated use inv_chi_square_lcdf 12 | */ 13 | template 14 | return_type_t inv_chi_square_cdf_log(const T_y& y, 15 | const T_dof& nu) { 16 | return inv_chi_square_lcdf(y, nu); 17 | } 18 | 19 | } // namespace math 20 | } // namespace stan 21 | #endif 22 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/prob/logistic_cdf_log.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_PROB_LOGISTIC_CDF_LOG_HPP 2 | #define STAN_MATH_PRIM_PROB_LOGISTIC_CDF_LOG_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace stan { 8 | namespace math { 9 | 10 | /** \ingroup prob_dists 11 | * @deprecated use logistic_lcdf 12 | */ 13 | template 14 | return_type_t logistic_cdf_log(const T_y& y, 15 | const T_loc& mu, 16 | const T_scale& sigma) { 17 | return logistic_lcdf(y, mu, sigma); 18 | } 19 | 20 | } // namespace math 21 | } // namespace stan 22 | #endif 23 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/prob/neg_binomial_2_ccdf_log.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_PROB_NEG_BINOMIAL_2_CCDF_LOG_HPP 2 | #define STAN_MATH_PRIM_PROB_NEG_BINOMIAL_2_CCDF_LOG_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace stan { 8 | namespace math { 9 | 10 | /** \ingroup prob_dists 11 | * @deprecated use neg_binomial_2_lccdf 12 | */ 13 | template 14 | return_type_t neg_binomial_2_ccdf_log( 15 | const T_n& n, const T_location& mu, const T_precision& phi) { 16 | return neg_binomial_2_lccdf(n, mu, phi); 17 | } 18 | 19 | } // namespace math 20 | } // namespace stan 21 | #endif 22 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/prob/neg_binomial_2_cdf_log.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_PROB_NEG_BINOMIAL_2_CDF_LOG_HPP 2 | #define STAN_MATH_PRIM_PROB_NEG_BINOMIAL_2_CDF_LOG_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace stan { 8 | namespace math { 9 | 10 | /** \ingroup prob_dists 11 | * @deprecated use neg_binomial_2_lcdf 12 | */ 13 | template 14 | return_type_t neg_binomial_2_cdf_log( 15 | const T_n& n, const T_location& mu, const T_precision& phi) { 16 | return neg_binomial_2_lcdf(n, mu, phi); 17 | } 18 | 19 | } // namespace math 20 | } // namespace stan 21 | #endif 22 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/prob/neg_binomial_ccdf_log.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_PROB_NEG_BINOMIAL_CCDF_LOG_HPP 2 | #define STAN_MATH_PRIM_PROB_NEG_BINOMIAL_CCDF_LOG_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace stan { 8 | namespace math { 9 | 10 | /** \ingroup prob_dists 11 | * @deprecated use neg_binomial_lccdf 12 | */ 13 | template 14 | return_type_t neg_binomial_ccdf_log( 15 | const T_n& n, const T_shape& alpha, const T_inv_scale& beta) { 16 | return neg_binomial_lccdf(n, alpha, beta); 17 | } 18 | 19 | } // namespace math 20 | } // namespace stan 21 | #endif 22 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/prob/neg_binomial_cdf_log.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_PROB_NEG_BINOMIAL_CDF_LOG_HPP 2 | #define STAN_MATH_PRIM_PROB_NEG_BINOMIAL_CDF_LOG_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace stan { 8 | namespace math { 9 | 10 | /** \ingroup prob_dists 11 | * @deprecated use neg_binomial_lcdf 12 | */ 13 | template 14 | return_type_t neg_binomial_cdf_log( 15 | const T_n& n, const T_shape& alpha, const T_inv_scale& beta) { 16 | return neg_binomial_lcdf(n, alpha, beta); 17 | } 18 | 19 | } // namespace math 20 | } // namespace stan 21 | #endif 22 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/prob/normal_ccdf_log.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_PROB_NORMAL_CCDF_LOG_HPP 2 | #define STAN_MATH_PRIM_PROB_NORMAL_CCDF_LOG_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace stan { 8 | namespace math { 9 | 10 | /** \ingroup prob_dists 11 | * @deprecated use normal_lccdf 12 | */ 13 | template 14 | inline return_type_t normal_ccdf_log( 15 | const T_y& y, const T_loc& mu, const T_scale& sigma) { 16 | return normal_lccdf(y, mu, sigma); 17 | } 18 | 19 | } // namespace math 20 | } // namespace stan 21 | #endif 22 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/prob/pareto_cdf_log.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_PROB_PARETO_CDF_LOG_HPP 2 | #define STAN_MATH_PRIM_PROB_PARETO_CDF_LOG_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace stan { 8 | namespace math { 9 | 10 | /** \ingroup prob_dists 11 | * @deprecated use pareto_lcdf 12 | */ 13 | template 14 | return_type_t pareto_cdf_log(const T_y& y, 15 | const T_scale& y_min, 16 | const T_shape& alpha) { 17 | return pareto_lcdf(y, y_min, alpha); 18 | } 19 | 20 | } // namespace math 21 | } // namespace stan 22 | #endif 23 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/prob/poisson_binomial_ccdf_log.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_PROB_POISSON_BINOMIAL_CCDF_LOG_HPP 2 | #define STAN_MATH_PRIM_PROB_POISSON_BINOMIAL_CCDF_LOG_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace stan { 8 | namespace math { 9 | 10 | /** \ingroup prob_dists 11 | * @deprecated use poisson_binomial_lccdf 12 | */ 13 | template 14 | return_type_t poisson_binomial_ccdf_log(const T_y& y, 15 | const T_theta& theta) { 16 | return poisson_binomial_lccdf(y, theta); 17 | } 18 | 19 | } // namespace math 20 | } // namespace stan 21 | #endif 22 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/prob/poisson_binomial_cdf_log.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_PROB_POISSON_BINOMIAL_CDF_LOG_HPP 2 | #define STAN_MATH_PRIM_PROB_POISSON_BINOMIAL_CDF_LOG_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace stan { 8 | namespace math { 9 | 10 | /** \ingroup prob_dists 11 | * @deprecated use poisson_binomial_lcdf 12 | */ 13 | template 14 | return_type_t poisson_binomial_cdf_log(const T_y& y, 15 | const T_theta& theta) { 16 | return poisson_binomial_lcdf(y, theta); 17 | } 18 | 19 | } // namespace math 20 | } // namespace stan 21 | #endif 22 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/prob/poisson_ccdf_log.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_PROB_POISSON_CCDF_LOG_HPP 2 | #define STAN_MATH_PRIM_PROB_POISSON_CCDF_LOG_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace stan { 8 | namespace math { 9 | 10 | /** \ingroup prob_dists 11 | * @deprecated use poisson_lccdf 12 | */ 13 | template 14 | return_type_t poisson_ccdf_log(const T_n& n, const T_rate& lambda) { 15 | return poisson_lccdf(n, lambda); 16 | } 17 | 18 | } // namespace math 19 | } // namespace stan 20 | #endif 21 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/prob/poisson_cdf_log.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_PROB_POISSON_CDF_LOG_HPP 2 | #define STAN_MATH_PRIM_PROB_POISSON_CDF_LOG_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace stan { 8 | namespace math { 9 | 10 | /** \ingroup prob_dists 11 | * @deprecated use poisson_lcdf 12 | */ 13 | template 14 | return_type_t poisson_cdf_log(const T_n& n, const T_rate& lambda) { 15 | return poisson_lcdf(n, lambda); 16 | } 17 | 18 | } // namespace math 19 | } // namespace stan 20 | #endif 21 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/prob/rayleigh_ccdf_log.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_PROB_RAYLEIGH_CCDF_LOG_HPP 2 | #define STAN_MATH_PRIM_PROB_RAYLEIGH_CCDF_LOG_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace stan { 8 | namespace math { 9 | 10 | /** \ingroup prob_dists 11 | * @deprecated use rayleigh_lccdf 12 | */ 13 | template 14 | return_type_t rayleigh_ccdf_log(const T_y& y, 15 | const T_scale& sigma) { 16 | return rayleigh_lccdf(y, sigma); 17 | } 18 | 19 | } // namespace math 20 | } // namespace stan 21 | #endif 22 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/prob/rayleigh_cdf_log.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_PROB_RAYLEIGH_CDF_LOG_HPP 2 | #define STAN_MATH_PRIM_PROB_RAYLEIGH_CDF_LOG_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace stan { 8 | namespace math { 9 | 10 | /** \ingroup prob_dists 11 | * @deprecated use rayleigh_lcdf 12 | */ 13 | template 14 | return_type_t rayleigh_cdf_log(const T_y& y, 15 | const T_scale& sigma) { 16 | return rayleigh_lcdf(y, sigma); 17 | } 18 | 19 | } // namespace math 20 | } // namespace stan 21 | #endif 22 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/prob/scaled_inv_chi_square_ccdf_log.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_PROB_SCALED_INV_CHI_SQUARE_CCDF_LOG_HPP 2 | #define STAN_MATH_PRIM_PROB_SCALED_INV_CHI_SQUARE_CCDF_LOG_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace stan { 8 | namespace math { 9 | 10 | /** \ingroup prob_dists 11 | * @deprecated use scaled_inv_chi_square_lccdf 12 | */ 13 | template 14 | return_type_t scaled_inv_chi_square_ccdf_log( 15 | const T_y& y, const T_dof& nu, const T_scale& s) { 16 | return scaled_inv_chi_square_lccdf(y, nu, s); 17 | } 18 | 19 | } // namespace math 20 | } // namespace stan 21 | #endif 22 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/prob/scaled_inv_chi_square_cdf_log.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_PROB_SCALED_INV_CHI_SQUARE_CDF_LOG_HPP 2 | #define STAN_MATH_PRIM_PROB_SCALED_INV_CHI_SQUARE_CDF_LOG_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace stan { 8 | namespace math { 9 | 10 | /** \ingroup prob_dists 11 | * @deprecated use scaled_inv_chi_square_lcdf 12 | */ 13 | template 14 | return_type_t scaled_inv_chi_square_cdf_log( 15 | const T_y& y, const T_dof& nu, const T_scale& s) { 16 | return scaled_inv_chi_square_lcdf(y, nu, s); 17 | } 18 | 19 | } // namespace math 20 | } // namespace stan 21 | #endif 22 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/prob/skew_normal_ccdf_log.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_PROB_SKEW_NORMAL_CCDF_LOG_HPP 2 | #define STAN_MATH_PRIM_PROB_SKEW_NORMAL_CCDF_LOG_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace stan { 8 | namespace math { 9 | 10 | /** \ingroup prob_dists 11 | * @deprecated use skew_normal_lccdf 12 | */ 13 | template 14 | return_type_t skew_normal_ccdf_log( 15 | const T_y& y, const T_loc& mu, const T_scale& sigma, const T_shape& alpha) { 16 | return skew_normal_lccdf(y, mu, sigma, alpha); 17 | } 18 | 19 | } // namespace math 20 | } // namespace stan 21 | #endif 22 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/prob/skew_normal_cdf_log.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_PROB_SKEW_NORMAL_CDF_LOG_HPP 2 | #define STAN_MATH_PRIM_PROB_SKEW_NORMAL_CDF_LOG_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace stan { 8 | namespace math { 9 | 10 | /** \ingroup prob_dists 11 | * @deprecated use skew_normal_lcdf 12 | */ 13 | template 14 | return_type_t skew_normal_cdf_log( 15 | const T_y& y, const T_loc& mu, const T_scale& sigma, const T_shape& alpha) { 16 | return skew_normal_lcdf(y, mu, sigma, alpha); 17 | } 18 | 19 | } // namespace math 20 | } // namespace stan 21 | #endif 22 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/prob/std_normal_ccdf_log.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_PROB_STD_NORMAL_CCDF_LOG_HPP 2 | #define STAN_MATH_PRIM_PROB_STD_NORMAL_CCDF_LOG_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace stan { 8 | namespace math { 9 | 10 | /** \ingroup prob_dists 11 | * @deprecated use std_normal_lccdf 12 | */ 13 | template 14 | inline return_type_t std_normal_ccdf_log(const T_y& y) { 15 | return std_normal_lccdf(y); 16 | } 17 | 18 | } // namespace math 19 | } // namespace stan 20 | #endif 21 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/prob/std_normal_cdf_log.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_PROB_STD_NORMAL_CDF_LOG_HPP 2 | #define STAN_MATH_PRIM_PROB_STD_NORMAL_CDF_LOG_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace stan { 8 | namespace math { 9 | 10 | /** \ingroup prob_dists 11 | * @deprecated use std_normal_lcdf 12 | */ 13 | template 14 | inline return_type_t std_normal_cdf_log(const T_y& y) { 15 | return std_normal_lcdf(y); 16 | } 17 | 18 | } // namespace math 19 | } // namespace stan 20 | #endif 21 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/prob/student_t_ccdf_log.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_PROB_STUDENT_T_CCDF_LOG_HPP 2 | #define STAN_MATH_PRIM_PROB_STUDENT_T_CCDF_LOG_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace stan { 8 | namespace math { 9 | 10 | /** \ingroup prob_dists 11 | * @deprecated use student_t_lccdf 12 | */ 13 | template 14 | return_type_t student_t_ccdf_log( 15 | const T_y& y, const T_dof& nu, const T_loc& mu, const T_scale& sigma) { 16 | return student_t_lccdf(y, nu, mu, sigma); 17 | } 18 | 19 | } // namespace math 20 | } // namespace stan 21 | #endif 22 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/prob/student_t_cdf_log.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_PROB_STUDENT_T_CDF_LOG_HPP 2 | #define STAN_MATH_PRIM_PROB_STUDENT_T_CDF_LOG_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace stan { 8 | namespace math { 9 | 10 | /** \ingroup prob_dists 11 | * @deprecated use student_t_lcdf 12 | */ 13 | template 14 | return_type_t student_t_cdf_log( 15 | const T_y& y, const T_dof& nu, const T_loc& mu, const T_scale& sigma) { 16 | return student_t_lcdf(y, nu, mu, sigma); 17 | } 18 | 19 | } // namespace math 20 | } // namespace stan 21 | #endif 22 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/prob/uniform_ccdf_log.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_PROB_UNIFORM_CCDF_LOG_HPP 2 | #define STAN_MATH_PRIM_PROB_UNIFORM_CCDF_LOG_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace stan { 8 | namespace math { 9 | 10 | /** \ingroup prob_dists 11 | * @deprecated use uniform_lccdf 12 | */ 13 | template 14 | return_type_t uniform_ccdf_log(const T_y& y, 15 | const T_low& alpha, 16 | const T_high& beta) { 17 | return uniform_lccdf(y, alpha, beta); 18 | } 19 | 20 | } // namespace math 21 | } // namespace stan 22 | #endif 23 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/prob/uniform_cdf_log.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_PROB_UNIFORM_CDF_LOG_HPP 2 | #define STAN_MATH_PRIM_PROB_UNIFORM_CDF_LOG_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace stan { 8 | namespace math { 9 | 10 | /** \ingroup prob_dists 11 | * @deprecated use uniform_lcdf 12 | */ 13 | template 14 | return_type_t uniform_cdf_log(const T_y& y, 15 | const T_low& alpha, 16 | const T_high& beta) { 17 | return uniform_lcdf(y, alpha, beta); 18 | } 19 | 20 | } // namespace math 21 | } // namespace stan 22 | #endif 23 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/prob/von_mises_ccdf_log.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_PROB_VON_MISES_CCDF_LOG_HPP 2 | #define STAN_MATH_PRIM_PROB_VON_MISES_CCDF_LOG_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace stan { 8 | namespace math { 9 | 10 | /** \ingroup prob_dists 11 | * @deprecated use von_mises_lccdf 12 | */ 13 | template 14 | inline return_type_t von_mises_ccdf_log(const T_x& x, 15 | const T_mu& mu, 16 | const T_k& k) { 17 | return von_mises_lccdf(x, mu, k); 18 | } 19 | 20 | } // namespace math 21 | } // namespace stan 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /inst/include/stan/math/prim/prob/von_mises_cdf_log.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_PRIM_PROB_VON_MISES_CDF_LOG_HPP 2 | #define STAN_MATH_PRIM_PROB_VON_MISES_CDF_LOG_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace stan { 8 | namespace math { 9 | 10 | /** \ingroup prob_dists 11 | * @deprecated use von_mises_lcdf 12 | */ 13 | template 14 | inline return_type_t von_mises_cdf_log(const T_x& x, 15 | const T_mu& mu, 16 | const T_k& k) { 17 | return von_mises_lcdf(x, mu, k); 18 | } 19 | 20 | } // namespace math 21 | } // namespace stan 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /inst/include/stan/math/rev.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_REV_HPP 2 | #define STAN_MATH_REV_HPP 3 | 4 | #include 5 | 6 | #ifdef STAN_OPENCL 7 | #include 8 | #endif 9 | 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | 16 | #include 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /inst/include/stan/math/rev/core/chainablestack.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_REV_CORE_CHAINABLESTACK_HPP 2 | #define STAN_MATH_REV_CORE_CHAINABLESTACK_HPP 3 | 4 | #include 5 | namespace stan { 6 | namespace math { 7 | class chainable_alloc; 8 | class vari_base; 9 | using ChainableStack = AutodiffStackSingleton; 10 | 11 | } // namespace math 12 | } // namespace stan 13 | #endif 14 | -------------------------------------------------------------------------------- /inst/include/stan/math/rev/core/ddv_vari.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_REV_CORE_DDV_VARI_HPP 2 | #define STAN_MATH_REV_CORE_DDV_VARI_HPP 3 | 4 | #include 5 | 6 | namespace stan { 7 | namespace math { 8 | 9 | class op_ddv_vari : public vari { 10 | protected: 11 | double ad_; 12 | double bd_; 13 | vari* cvi_; 14 | 15 | public: 16 | op_ddv_vari(double f, double a, double b, vari* cvi) 17 | : vari(f), ad_(a), bd_(b), cvi_(cvi) {} 18 | }; 19 | 20 | } // namespace math 21 | } // namespace stan 22 | #endif 23 | -------------------------------------------------------------------------------- /inst/include/stan/math/rev/core/dv_vari.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_REV_CORE_DV_VARI_HPP 2 | #define STAN_MATH_REV_CORE_DV_VARI_HPP 3 | 4 | #include 5 | 6 | namespace stan { 7 | namespace math { 8 | 9 | class op_dv_vari : public vari { 10 | protected: 11 | double ad_; 12 | vari* bvi_; 13 | 14 | public: 15 | op_dv_vari(double f, double a, vari* bvi) : vari(f), ad_(a), bvi_(bvi) {} 16 | }; 17 | 18 | } // namespace math 19 | } // namespace stan 20 | #endif 21 | -------------------------------------------------------------------------------- /inst/include/stan/math/rev/core/dvd_vari.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_REV_CORE_DVD_VARI_HPP 2 | #define STAN_MATH_REV_CORE_DVD_VARI_HPP 3 | 4 | #include 5 | 6 | namespace stan { 7 | namespace math { 8 | 9 | class op_dvd_vari : public vari { 10 | protected: 11 | double ad_; 12 | vari* bvi_; 13 | double cd_; 14 | 15 | public: 16 | op_dvd_vari(double f, double a, vari* bvi, double c) 17 | : vari(f), ad_(a), bvi_(bvi), cd_(c) {} 18 | }; 19 | 20 | } // namespace math 21 | } // namespace stan 22 | #endif 23 | -------------------------------------------------------------------------------- /inst/include/stan/math/rev/core/dvv_vari.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_REV_CORE_DVV_VARI_HPP 2 | #define STAN_MATH_REV_CORE_DVV_VARI_HPP 3 | 4 | #include 5 | 6 | namespace stan { 7 | namespace math { 8 | 9 | class op_dvv_vari : public vari { 10 | protected: 11 | double ad_; 12 | vari* bvi_; 13 | vari* cvi_; 14 | 15 | public: 16 | op_dvv_vari(double f, double a, vari* bvi, vari* cvi) 17 | : vari(f), ad_(a), bvi_(bvi), cvi_(cvi) {} 18 | }; 19 | 20 | } // namespace math 21 | } // namespace stan 22 | #endif 23 | -------------------------------------------------------------------------------- /inst/include/stan/math/rev/core/empty_nested.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_REV_CORE_EMPTY_NESTED_HPP 2 | #define STAN_MATH_REV_CORE_EMPTY_NESTED_HPP 3 | 4 | #include 5 | 6 | namespace stan { 7 | namespace math { 8 | 9 | /** 10 | * Return true if there is no nested autodiff being executed. 11 | */ 12 | static inline bool empty_nested() { 13 | return ChainableStack::instance_->nested_var_stack_sizes_.empty(); 14 | } 15 | 16 | } // namespace math 17 | } // namespace stan 18 | #endif 19 | -------------------------------------------------------------------------------- /inst/include/stan/math/rev/core/nested_size.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_REV_CORE_NESTED_SIZE_HPP 2 | #define STAN_MATH_REV_CORE_NESTED_SIZE_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace stan { 8 | namespace math { 9 | 10 | static inline size_t nested_size() { 11 | return ChainableStack::instance_->var_stack_.size() 12 | - ChainableStack::instance_->nested_var_stack_sizes_.back(); 13 | } 14 | 15 | } // namespace math 16 | } // namespace stan 17 | #endif 18 | -------------------------------------------------------------------------------- /inst/include/stan/math/rev/core/operator_unary_not.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_REV_CORE_OPERATOR_UNARY_NOT_HPP 2 | #define STAN_MATH_REV_CORE_OPERATOR_UNARY_NOT_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace stan { 8 | namespace math { 9 | 10 | /** 11 | * Return the negation of the value of the argument as defined by 12 | * !. 13 | * 14 | * @param[in] x argument 15 | * @return negation of argument value 16 | */ 17 | inline bool operator!(const var& x) { return !x.val(); } 18 | 19 | } // namespace math 20 | } // namespace stan 21 | #endif 22 | -------------------------------------------------------------------------------- /inst/include/stan/math/rev/core/precomp_vv_vari.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_REV_CORE_PRECOMP_VV_VARI_HPP 2 | #define STAN_MATH_REV_CORE_PRECOMP_VV_VARI_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace stan { 8 | namespace math { 9 | 10 | // use for single precomputed partials 11 | class precomp_vv_vari final : public op_vv_vari { 12 | protected: 13 | double da_; 14 | double db_; 15 | 16 | public: 17 | precomp_vv_vari(double val, vari* avi, vari* bvi, double da, double db) 18 | : op_vv_vari(val, avi, bvi), da_(da), db_(db) {} 19 | void chain() { 20 | avi_->adj_ += adj_ * da_; 21 | bvi_->adj_ += adj_ * db_; 22 | } 23 | }; 24 | 25 | } // namespace math 26 | } // namespace stan 27 | #endif 28 | -------------------------------------------------------------------------------- /inst/include/stan/math/rev/core/print_stack.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_REV_CORE_PRINT_STACK_HPP 2 | #define STAN_MATH_REV_CORE_PRINT_STACK_HPP 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | namespace stan { 9 | namespace math { 10 | 11 | /** 12 | * Prints the autodiff variable stack. This function 13 | * is used for debugging purposes. 14 | * 15 | * Only works if all members of stack are vari* as it 16 | * casts to vari*. 17 | * 18 | * @param o ostream to modify 19 | */ 20 | inline void print_stack(std::ostream& o) { 21 | o << "STACK, size=" << ChainableStack::instance_->var_stack_.size() 22 | << std::endl; 23 | } 24 | 25 | } // namespace math 26 | } // namespace stan 27 | #endif 28 | -------------------------------------------------------------------------------- /inst/include/stan/math/rev/core/set_zero_all_adjoints.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_REV_CORE_SET_ZERO_ALL_ADJOINTS_HPP 2 | #define STAN_MATH_REV_CORE_SET_ZERO_ALL_ADJOINTS_HPP 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | namespace stan { 9 | namespace math { 10 | 11 | /** 12 | * Reset all adjoint values in the stack to zero. 13 | */ 14 | static inline void set_zero_all_adjoints() { 15 | for (auto &x : ChainableStack::instance_->var_stack_) { 16 | x->set_zero_adjoint(); 17 | } 18 | for (auto &x : ChainableStack::instance_->var_nochain_stack_) { 19 | x->set_zero_adjoint(); 20 | } 21 | } 22 | 23 | } // namespace math 24 | } // namespace stan 25 | #endif 26 | -------------------------------------------------------------------------------- /inst/include/stan/math/rev/core/std_isinf.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_REV_CORE_STD_ISINF_HPP 2 | #define STAN_MATH_REV_CORE_STD_ISINF_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace std { 8 | 9 | /** 10 | * Return 1 if the specified argument is positive 11 | * infinity or negative infinity and 0 otherwise. 12 | * 13 | * @param a Argument. 14 | * @return 1 if argument is infinite and 0 otherwise. 15 | */ 16 | inline bool isinf(const stan::math::var& a) { 17 | return stan::math::is_inf(a.val()); 18 | } 19 | 20 | } // namespace std 21 | #endif 22 | -------------------------------------------------------------------------------- /inst/include/stan/math/rev/core/std_isnan.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_REV_CORE_STD_ISNAN_HPP 2 | #define STAN_MATH_REV_CORE_STD_ISNAN_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace std { 8 | 9 | /** 10 | * Checks if the given number is NaN. 11 | * 12 | * Return true if the value of the 13 | * specified variable is not a number. 14 | * 15 | * @param a Variable to test. 16 | * @return true if value is not a number. 17 | */ 18 | inline bool isnan(const stan::math::var& a) { return isnan(a.val()); } 19 | 20 | } // namespace std 21 | #endif 22 | -------------------------------------------------------------------------------- /inst/include/stan/math/rev/core/v_vari.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_REV_CORE_V_VARI_HPP 2 | #define STAN_MATH_REV_CORE_V_VARI_HPP 3 | 4 | #include 5 | 6 | namespace stan { 7 | namespace math { 8 | 9 | class op_v_vari : public vari { 10 | protected: 11 | vari* avi_; 12 | 13 | public: 14 | op_v_vari(double f, vari* avi) : vari(f), avi_(avi) {} 15 | }; 16 | 17 | } // namespace math 18 | } // namespace stan 19 | #endif 20 | -------------------------------------------------------------------------------- /inst/include/stan/math/rev/core/var_value_fwd_declare.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_REV_CORE_VAR_VALUE_FWD_DECLARE_HPP 2 | #define STAN_MATH_REV_CORE_VAR_VALUE_FWD_DECLARE_HPP 3 | 4 | namespace stan { 5 | namespace math { 6 | // forward declaration of var 7 | template 8 | class var_value; 9 | 10 | /** 11 | * Equivalent to `Eigen::Matrix`, except that the data is stored on AD stack. 12 | * That makes these objects trivially destructible and usable in `vari`s. 13 | * 14 | * @tparam MatrixType Eigen matrix type this works as (`MatrixXd`, `VectorXd`, 15 | * ...) 16 | */ 17 | template 18 | class arena_matrix; 19 | } // namespace math 20 | } // namespace stan 21 | #endif 22 | -------------------------------------------------------------------------------- /inst/include/stan/math/rev/core/vd_vari.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_REV_CORE_VD_VARI_HPP 2 | #define STAN_MATH_REV_CORE_VD_VARI_HPP 3 | 4 | #include 5 | 6 | namespace stan { 7 | namespace math { 8 | 9 | class op_vd_vari : public vari { 10 | protected: 11 | vari* avi_; 12 | double bd_; 13 | 14 | public: 15 | op_vd_vari(double f, vari* avi, double b) : vari(f), avi_(avi), bd_(b) {} 16 | }; 17 | 18 | } // namespace math 19 | } // namespace stan 20 | #endif 21 | -------------------------------------------------------------------------------- /inst/include/stan/math/rev/core/vdd_vari.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_REV_CORE_VDD_VARI_HPP 2 | #define STAN_MATH_REV_CORE_VDD_VARI_HPP 3 | 4 | #include 5 | 6 | namespace stan { 7 | namespace math { 8 | 9 | class op_vdd_vari : public vari { 10 | protected: 11 | vari* avi_; 12 | double bd_; 13 | double cd_; 14 | 15 | public: 16 | op_vdd_vari(double f, vari* avi, double b, double c) 17 | : vari(f), avi_(avi), bd_(b), cd_(c) {} 18 | }; 19 | 20 | } // namespace math 21 | } // namespace stan 22 | #endif 23 | -------------------------------------------------------------------------------- /inst/include/stan/math/rev/core/vdv_vari.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_REV_CORE_VDV_VARI_HPP 2 | #define STAN_MATH_REV_CORE_VDV_VARI_HPP 3 | 4 | #include 5 | 6 | namespace stan { 7 | namespace math { 8 | 9 | class op_vdv_vari : public vari { 10 | protected: 11 | vari* avi_; 12 | double bd_; 13 | vari* cvi_; 14 | 15 | public: 16 | op_vdv_vari(double f, vari* avi, double b, vari* cvi) 17 | : vari(f), avi_(avi), bd_(b), cvi_(cvi) {} 18 | }; 19 | 20 | } // namespace math 21 | } // namespace stan 22 | #endif 23 | -------------------------------------------------------------------------------- /inst/include/stan/math/rev/core/vv_vari.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_REV_CORE_VV_VARI_HPP 2 | #define STAN_MATH_REV_CORE_VV_VARI_HPP 3 | 4 | #include 5 | 6 | namespace stan { 7 | namespace math { 8 | 9 | class op_vv_vari : public vari { 10 | protected: 11 | vari* avi_; 12 | vari* bvi_; 13 | 14 | public: 15 | op_vv_vari(double f, vari* avi, vari* bvi) : vari(f), avi_(avi), bvi_(bvi) {} 16 | }; 17 | 18 | } // namespace math 19 | } // namespace stan 20 | #endif 21 | -------------------------------------------------------------------------------- /inst/include/stan/math/rev/core/vvd_vari.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_REV_CORE_VVD_VARI_HPP 2 | #define STAN_MATH_REV_CORE_VVD_VARI_HPP 3 | 4 | #include 5 | 6 | namespace stan { 7 | namespace math { 8 | 9 | class op_vvd_vari : public vari { 10 | protected: 11 | vari* avi_; 12 | vari* bvi_; 13 | double cd_; 14 | 15 | public: 16 | op_vvd_vari(double f, vari* avi, vari* bvi, double c) 17 | : vari(f), avi_(avi), bvi_(bvi), cd_(c) {} 18 | }; 19 | 20 | } // namespace math 21 | } // namespace stan 22 | #endif 23 | -------------------------------------------------------------------------------- /inst/include/stan/math/rev/core/vvv_vari.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_REV_CORE_VVV_VARI_HPP 2 | #define STAN_MATH_REV_CORE_VVV_VARI_HPP 3 | 4 | #include 5 | 6 | namespace stan { 7 | namespace math { 8 | 9 | class op_vvv_vari : public vari { 10 | protected: 11 | vari* avi_; 12 | vari* bvi_; 13 | vari* cvi_; 14 | 15 | public: 16 | op_vvv_vari(double f, vari* avi, vari* bvi, vari* cvi) 17 | : vari(f), avi_(avi), bvi_(bvi), cvi_(cvi) {} 18 | }; 19 | 20 | } // namespace math 21 | } // namespace stan 22 | #endif 23 | -------------------------------------------------------------------------------- /inst/include/stan/math/rev/fun/arg.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_REV_FUN_ARG_HPP 2 | #define STAN_MATH_REV_FUN_ARG_HPP 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | namespace stan { 10 | namespace math { 11 | 12 | /** 13 | * Return the phase angle of the complex argument. 14 | * 15 | * @param[in] z argument 16 | * @return phase angle of the argument 17 | */ 18 | inline var arg(const std::complex& z) { return internal::complex_arg(z); } 19 | 20 | } // namespace math 21 | } // namespace stan 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /inst/include/stan/math/rev/fun/as_bool.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_REV_FUN_AS_BOOL_HPP 2 | #define STAN_MATH_REV_FUN_AS_BOOL_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace stan { 8 | namespace math { 9 | 10 | /** 11 | * Return 1 if the argument is unequal to zero and 0 otherwise. 12 | * 13 | * @param v Value. 14 | * @return 1 if argument is equal to zero (or NaN) and 0 otherwise. 15 | */ 16 | inline int as_bool(const var& v) { return 0.0 != v.vi_->val_; } 17 | 18 | } // namespace math 19 | } // namespace stan 20 | #endif 21 | -------------------------------------------------------------------------------- /inst/include/stan/math/rev/fun/conj.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_REV_FUN_CONJ_HPP 2 | #define STAN_MATH_REV_FUN_CONJ_HPP 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | namespace stan { 9 | namespace math { 10 | 11 | /** 12 | * Return the complex conjugate of the complex argument. 13 | * 14 | * @param[in] z argument 15 | * @return complex conjugate of the argument 16 | */ 17 | inline std::complex conj(const std::complex& z) { 18 | return internal::complex_conj(z); 19 | } 20 | 21 | } // namespace math 22 | } // namespace stan 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /inst/include/stan/math/rev/fun/divide.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_REV_FUN_DIVIDE_HPP 2 | #define STAN_MATH_REV_FUN_DIVIDE_HPP 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /inst/include/stan/math/rev/fun/is_inf.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_REV_FUN_IS_INF_HPP 2 | #define STAN_MATH_REV_FUN_IS_INF_HPP 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | namespace stan { 9 | namespace math { 10 | 11 | /** 12 | * Returns 1 if the input's value is infinite and 0 otherwise. 13 | * 14 | * Delegates to is_inf. 15 | * 16 | * @param v Value to test. 17 | * 18 | * @return 1 if the value is infinite and 0 otherwise. 19 | */ 20 | inline int is_inf(const var& v) { return is_inf(v.val()); } 21 | 22 | } // namespace math 23 | } // namespace stan 24 | #endif 25 | -------------------------------------------------------------------------------- /inst/include/stan/math/rev/fun/is_nan.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_REV_FUN_IS_NAN_HPP 2 | #define STAN_MATH_REV_FUN_IS_NAN_HPP 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | namespace stan { 9 | namespace math { 10 | 11 | /** 12 | * Returns 1 if the input's value is NaN and 0 otherwise. 13 | * 14 | * Delegates to is_nan(double). 15 | * 16 | * @tparam T type of input 17 | * @param v value to test 18 | * @return 1 if the value is NaN and 0 otherwise. 19 | */ 20 | inline bool is_nan(const var& v) { return is_nan(v.val()); } 21 | 22 | } // namespace math 23 | } // namespace stan 24 | #endif 25 | -------------------------------------------------------------------------------- /inst/include/stan/math/rev/fun/ldexp.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_REV_FUN_LDEXP_HPP 2 | #define STAN_MATH_REV_FUN_LDEXP_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace stan { 8 | namespace math { 9 | 10 | namespace { 11 | class ldexp_vari : public op_vd_vari { 12 | public: 13 | explicit ldexp_vari(vari* avi, int b) 14 | : op_vd_vari(ldexp(avi->val_, b), avi, b) {} 15 | void chain() { avi_->adj_ += ldexp(adj_, bd_); } 16 | }; 17 | } // namespace 18 | 19 | inline var ldexp(const var& a, int b) { return var(new ldexp_vari(a.vi_, b)); } 20 | 21 | } // namespace math 22 | } // namespace stan 23 | #endif 24 | -------------------------------------------------------------------------------- /inst/include/stan/math/rev/fun/norm.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_REV_FUN_NORM_HPP 2 | #define STAN_MATH_REV_FUN_NORM_HPP 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | namespace stan { 10 | namespace math { 11 | 12 | /** 13 | * Return the squared magnitude of the complex argument. 14 | * 15 | * @param[in] z argument 16 | * @return squared magnitude of the argument 17 | */ 18 | inline var norm(const std::complex& z) { 19 | return internal::complex_norm(z); 20 | } 21 | 22 | } // namespace math 23 | } // namespace stan 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /inst/include/stan/math/rev/fun/primitive_value.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_REV_FUN_PRIMITIVE_VALUE_HPP 2 | #define STAN_MATH_REV_FUN_PRIMITIVE_VALUE_HPP 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | namespace stan { 9 | namespace math { 10 | 11 | /** 12 | * Return the primitive double value for the specified autodiff 13 | * variable. 14 | * 15 | * @param v input variable. 16 | * @return value of input. 17 | */ 18 | inline double primitive_value(const var& v) { return v.val(); } 19 | 20 | } // namespace math 21 | } // namespace stan 22 | #endif 23 | -------------------------------------------------------------------------------- /inst/include/stan/math/rev/fun/proj.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_REV_FUN_PROJ_HPP 2 | #define STAN_MATH_REV_FUN_PROJ_HPP 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | namespace stan { 11 | namespace math { 12 | 13 | /** 14 | * Return the projection of the complex argument onto the Riemann 15 | * sphere. 16 | * 17 | * @param[in] z argument 18 | * @return projection of the argument onto the Riemann sphere 19 | */ 20 | inline std::complex proj(const std::complex& z) { 21 | return internal::complex_proj(z); 22 | } 23 | 24 | } // namespace math 25 | } // namespace stan 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /inst/include/stan/math/rev/fun/stan_print.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_REV_FUN_STAN_PRINT_HPP 2 | #define STAN_MATH_REV_FUN_STAN_PRINT_HPP 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | namespace stan { 9 | namespace math { 10 | 11 | inline void stan_print(std::ostream* o, const var& x) { *o << x.val(); } 12 | 13 | } // namespace math 14 | } // namespace stan 15 | #endif 16 | -------------------------------------------------------------------------------- /inst/include/stan/math/rev/fun/value_of_rec.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_REV_FUN_VALUE_OF_REC_HPP 2 | #define STAN_MATH_REV_FUN_VALUE_OF_REC_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace stan { 8 | namespace math { 9 | 10 | /** 11 | * Return the value of the specified variable. 12 | * 13 | * @param v Variable. 14 | * @return Value of variable. 15 | */ 16 | template 17 | inline auto& value_of_rec(const var_value& v) { 18 | return v.vi_->val_; 19 | } 20 | 21 | } // namespace math 22 | } // namespace stan 23 | #endif 24 | -------------------------------------------------------------------------------- /inst/include/stan/math/rev/meta.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_REV_META_HPP 2 | #define STAN_MATH_REV_META_HPP 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /inst/include/stan/math/rev/meta/partials_type.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_REV_META_PARTIALS_TYPE_HPP 2 | #define STAN_MATH_REV_META_PARTIALS_TYPE_HPP 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | namespace stan { 9 | 10 | /** \ingroup type_trait 11 | * Specialization of partials type returns double if input type is a double. 12 | */ 13 | template 14 | struct partials_type> { 15 | using type = typename std::decay_t::value_type; 16 | }; 17 | 18 | } // namespace stan 19 | #endif 20 | -------------------------------------------------------------------------------- /inst/include/stan/math/rev/prob.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_REV_PROB_HPP 2 | #define STAN_MATH_REV_PROB_HPP 3 | 4 | #include 5 | 6 | #include 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /inst/include/stan/mcmc/base_adaptation.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MCMC_BASE_ADAPTATION_HPP 2 | #define STAN_MCMC_BASE_ADAPTATION_HPP 3 | 4 | namespace stan { 5 | 6 | namespace mcmc { 7 | 8 | class base_adaptation { 9 | public: 10 | virtual void restart() {} 11 | }; 12 | 13 | } // namespace mcmc 14 | 15 | } // namespace stan 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /inst/include/stan/mcmc/base_adapter.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MCMC_BASE_ADAPTER_HPP 2 | #define STAN_MCMC_BASE_ADAPTER_HPP 3 | 4 | namespace stan { 5 | namespace mcmc { 6 | 7 | class base_adapter { 8 | public: 9 | base_adapter() : adapt_flag_(false) {} 10 | 11 | virtual void engage_adaptation() { adapt_flag_ = true; } 12 | 13 | virtual void disengage_adaptation() { adapt_flag_ = false; } 14 | 15 | bool adapting() { return adapt_flag_; } 16 | 17 | protected: 18 | bool adapt_flag_; 19 | }; 20 | 21 | } // namespace mcmc 22 | } // namespace stan 23 | #endif 24 | -------------------------------------------------------------------------------- /inst/include/stan/mcmc/fixed_param_sampler.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MCMC_FIXED_PARAM_SAMPLER_HPP 2 | #define STAN_MCMC_FIXED_PARAM_SAMPLER_HPP 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | namespace stan { 9 | namespace mcmc { 10 | 11 | class fixed_param_sampler : public base_mcmc { 12 | public: 13 | fixed_param_sampler() {} 14 | 15 | sample transition(sample& init_sample, callbacks::logger& logger) { 16 | return init_sample; 17 | } 18 | }; 19 | 20 | } // namespace mcmc 21 | } // namespace stan 22 | #endif 23 | -------------------------------------------------------------------------------- /inst/include/stan/mcmc/hmc/integrators/base_integrator.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MCMC_HMC_INTEGRATORS_BASE_INTEGRATOR_HPP 2 | #define STAN_MCMC_HMC_INTEGRATORS_BASE_INTEGRATOR_HPP 3 | 4 | #include 5 | 6 | namespace stan { 7 | namespace mcmc { 8 | 9 | template 10 | class base_integrator { 11 | public: 12 | base_integrator() {} 13 | 14 | virtual void evolve(typename Hamiltonian::PointType& z, 15 | Hamiltonian& hamiltonian, const double epsilon, 16 | callbacks::logger& logger) 17 | = 0; 18 | }; 19 | 20 | } // namespace mcmc 21 | } // namespace stan 22 | #endif 23 | -------------------------------------------------------------------------------- /inst/include/stan/mcmc/stepsize_adapter.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MCMC_STEPSIZE_ADAPTER_HPP 2 | #define STAN_MCMC_STEPSIZE_ADAPTER_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace stan { 8 | 9 | namespace mcmc { 10 | 11 | class stepsize_adapter : public base_adapter { 12 | public: 13 | stepsize_adapter() {} 14 | 15 | stepsize_adaptation& get_stepsize_adaptation() { 16 | return stepsize_adaptation_; 17 | } 18 | 19 | const stepsize_adaptation& get_stepsize_adaptation() const noexcept { 20 | return stepsize_adaptation_; 21 | } 22 | 23 | protected: 24 | stepsize_adaptation stepsize_adaptation_; 25 | }; 26 | 27 | } // namespace mcmc 28 | 29 | } // namespace stan 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /inst/include/stan/model/hessian.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MODEL_HESSIAN_HPP 2 | #define STAN_MODEL_HESSIAN_HPP 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | namespace stan { 9 | namespace model { 10 | 11 | template 12 | void hessian(const M& model, const Eigen::Matrix& x, 13 | double& f, Eigen::Matrix& grad_f, 14 | Eigen::Matrix& hess_f, 15 | std::ostream* msgs = 0) { 16 | stan::math::hessian >(model_functional(model, msgs), x, 17 | f, grad_f, hess_f); 18 | } 19 | 20 | } // namespace model 21 | } // namespace stan 22 | #endif 23 | -------------------------------------------------------------------------------- /inst/include/stan/model/hessian_times_vector.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MODEL_HESSIAN_TIMES_VECTOR_HPP 2 | #define STAN_MODEL_HESSIAN_TIMES_VECTOR_HPP 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | namespace stan { 9 | namespace model { 10 | 11 | template 12 | void hessian_times_vector( 13 | const M& model, const Eigen::Matrix& x, 14 | const Eigen::Matrix& v, double& f, 15 | Eigen::Matrix& hess_f_dot_v, 16 | std::ostream* msgs = 0) { 17 | stan::math::hessian_times_vector(model_functional(model, msgs), x, v, f, 18 | hess_f_dot_v); 19 | } 20 | 21 | } // namespace model 22 | } // namespace stan 23 | #endif 24 | -------------------------------------------------------------------------------- /inst/include/stan/model/indexing.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MODEL_INDEXING_HPP 2 | #define STAN_MODEL_INDEXING_HPP 3 | 4 | #include 5 | #ifdef STAN_OPENCL 6 | #include 7 | #include 8 | #endif 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /inst/include/stan/model/model_header.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MODEL_MODEL_HEADER_HPP 2 | #define STAN_MODEL_MODEL_HEADER_HPP 3 | 4 | #include 5 | 6 | #include 7 | #include 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /inst/include/stan/services/error_codes.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_SERVICES_ERROR_CODES_HPP 2 | #define STAN_SERVICES_ERROR_CODES_HPP 3 | 4 | namespace stan { 5 | namespace services { 6 | 7 | struct error_codes { 8 | // defining error codes to follow FreeBSD sysexits conventions 9 | // http://www.gsp.com/cgi-bin/man.cgi?section=3&topic=sysexits 10 | enum { 11 | OK = 0, 12 | USAGE = 64, 13 | DATAERR = 65, 14 | NOINPUT = 66, 15 | SOFTWARE = 70, 16 | CONFIG = 78 17 | }; 18 | }; 19 | } // namespace services 20 | } // namespace stan 21 | #endif 22 | -------------------------------------------------------------------------------- /inst/include/stan/services/util/inv_metric.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | -------------------------------------------------------------------------------- /inst/include/stan/version.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_VERSION_HPP 2 | #define STAN_VERSION_HPP 3 | 4 | #include 5 | 6 | #ifndef STAN_STRING_EXPAND 7 | #define STAN_STRING_EXPAND(s) #s 8 | #endif 9 | 10 | #ifndef STAN_STRING 11 | #define STAN_STRING(s) STAN_STRING_EXPAND(s) 12 | #endif 13 | 14 | #define STAN_MAJOR 2 15 | #define STAN_MINOR 35 16 | #define STAN_PATCH 0 17 | 18 | namespace stan { 19 | 20 | /** Major version number for Stan package. */ 21 | const std::string MAJOR_VERSION = STAN_STRING(STAN_MAJOR); 22 | 23 | /** Minor version number for Stan package. */ 24 | const std::string MINOR_VERSION = STAN_STRING(STAN_MINOR); 25 | 26 | /** Patch version for Stan package. */ 27 | const std::string PATCH_VERSION = STAN_STRING(STAN_PATCH); 28 | 29 | } // namespace stan 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /inst/include/stan_sundials_printf_override.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STAN_MATH_SUNDIALS_PRINTF_OVERRIDE_HPP 2 | #define STAN_MATH_SUNDIALS_PRINTF_OVERRIDE_HPP 3 | 4 | #ifdef WITH_SUNDIAL_PRINTF 5 | #define STAN_SUNDIALS_PRINTF(...) printf(__VA_ARGS__) 6 | #define STAN_SUNDIALS_FPRINTF(...) fprintf(__VA_ARGS__) 7 | #else 8 | #define STAN_SUNDIALS_PRINTF(...) 9 | #define STAN_SUNDIALS_FPRINTF(...) 10 | #endif 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /man/StanBase-class.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/aaa.R 3 | \docType{class} 4 | \name{StanBase-class} 5 | \alias{StanBase-class} 6 | \alias{StanBase} 7 | \title{StanBase base class} 8 | \description{ 9 | StanBase base class 10 | } 11 | -------------------------------------------------------------------------------- /man/constrain_variables-methods.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/model_methods.R 3 | \docType{methods} 4 | \name{constrain_variables} 5 | \alias{constrain_variables} 6 | \alias{constrain_variables,StanBase-method} 7 | \alias{constrain_variables,StanBase,StanBase-method} 8 | \title{Constrain a vector of variables.} 9 | \usage{ 10 | constrain_variables(stan_object, unconstrained_variables) 11 | 12 | \S4method{constrain_variables}{StanBase}(stan_object, unconstrained_variables) 13 | } 14 | \arguments{ 15 | \item{stan_object}{A \code{StanBase} object.} 16 | 17 | \item{unconstrained_variables}{Vector of unconstrained variables.} 18 | } 19 | \description{ 20 | Constrain a vector of variables. 21 | } 22 | -------------------------------------------------------------------------------- /man/stan_versions.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/cpp_exports.R 3 | \name{stan_versions} 4 | \alias{stan_versions} 5 | \title{stan_versions} 6 | \usage{ 7 | stan_versions() 8 | } 9 | \value{ 10 | A named list with the Stan and Stan Math library versions 11 | } 12 | \description{ 13 | stan_versions 14 | } 15 | -------------------------------------------------------------------------------- /man/summary-StanLaplace.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/laplace.R 3 | \docType{methods} 4 | \name{summary-StanLaplace} 5 | \alias{summary-StanLaplace} 6 | \alias{summary,StanLaplace-method} 7 | \title{Summary method for objects of class \code{StanLaplace}.} 8 | \usage{ 9 | \S4method{summary}{StanLaplace}(object, ...) 10 | } 11 | \arguments{ 12 | \item{object}{A \code{StanLaplace} object.} 13 | 14 | \item{...}{Additional arguments, currently unused.} 15 | } 16 | \description{ 17 | Summary method for objects of class \code{StanLaplace}. 18 | } 19 | -------------------------------------------------------------------------------- /man/summary-StanMCMC.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/sample.R 3 | \docType{methods} 4 | \name{summary-StanMCMC} 5 | \alias{summary-StanMCMC} 6 | \alias{summary,StanMCMC-method} 7 | \title{Summary method for objects of class \code{StanMCMC}.} 8 | \usage{ 9 | \S4method{summary}{StanMCMC}(object, ...) 10 | } 11 | \arguments{ 12 | \item{object}{A \code{StanMCMC} object.} 13 | 14 | \item{...}{Additional arguments, currently unused.} 15 | } 16 | \description{ 17 | Summary method for objects of class \code{StanMCMC}. 18 | } 19 | -------------------------------------------------------------------------------- /man/summary-StanOptimize.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/optimize.R 3 | \docType{methods} 4 | \name{summary-StanOptimize} 5 | \alias{summary-StanOptimize} 6 | \alias{summary,StanOptimize-method} 7 | \title{Summary method for objects of class \code{StanOptimize}.} 8 | \usage{ 9 | \S4method{summary}{StanOptimize}(object, ...) 10 | } 11 | \arguments{ 12 | \item{object}{A \code{StanOptimize} object.} 13 | 14 | \item{...}{Additional arguments, currently unused.} 15 | } 16 | \description{ 17 | Summary method for objects of class \code{StanOptimize}. 18 | } 19 | -------------------------------------------------------------------------------- /man/summary-StanPathfinder.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/pathfinder.R 3 | \docType{methods} 4 | \name{summary-StanPathfinder} 5 | \alias{summary-StanPathfinder} 6 | \alias{summary,StanPathfinder-method} 7 | \title{Summary method for objects of class \code{StanPathfinder}.} 8 | \usage{ 9 | \S4method{summary}{StanPathfinder}(object, ...) 10 | } 11 | \arguments{ 12 | \item{object}{A \code{StanPathfinder} object.} 13 | 14 | \item{...}{Additional arguments, currently unused.} 15 | } 16 | \description{ 17 | Summary method for objects of class \code{StanPathfinder}. 18 | } 19 | -------------------------------------------------------------------------------- /man/summary-StanVariational.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/variational.R 3 | \docType{methods} 4 | \name{summary-StanVariational} 5 | \alias{summary-StanVariational} 6 | \alias{summary,StanVariational-method} 7 | \title{Summary method for objects of class \code{StanVariational}.} 8 | \usage{ 9 | \S4method{summary}{StanVariational}(object, ...) 10 | } 11 | \arguments{ 12 | \item{object}{A \code{StanVariational} object.} 13 | 14 | \item{...}{Additional arguments, currently unused.} 15 | } 16 | \description{ 17 | Summary method for objects of class \code{StanVariational}. 18 | } 19 | -------------------------------------------------------------------------------- /man/unconstrain_variables-methods.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/model_methods.R 3 | \docType{methods} 4 | \name{unconstrain_variables} 5 | \alias{unconstrain_variables} 6 | \alias{unconstrain_variables,StanBase-method} 7 | \alias{unconstrain_variables,StanBase,StanBase-method} 8 | \title{Unconstrain a vector of variables.} 9 | \usage{ 10 | unconstrain_variables(stan_object, variables) 11 | 12 | \S4method{unconstrain_variables}{StanBase}(stan_object, variables) 13 | } 14 | \arguments{ 15 | \item{stan_object}{A \code{StanBase} object.} 16 | 17 | \item{variables}{Vector of variables to be unconstrained.} 18 | } 19 | \description{ 20 | Unconstrain a vector of variables. 21 | } 22 | -------------------------------------------------------------------------------- /src/Makevars: -------------------------------------------------------------------------------- 1 | PKG_CPPFLAGS = -I"../inst/include" -D_REENTRANT -DSTAN_THREADS 2 | PKG_CPPFLAGS += -DSTRICT_R_HEADERS -D_HAS_AUTO_PTR_ETC=0 -DEIGEN_PERMANENTLY_DISABLE_STUPID_WARNINGS 3 | PKG_CXXFLAGS += $(shell "${R_HOME}/bin/Rscript" -e "RcppParallel::CxxFlags()" | tail -n 1) 4 | PKG_LIBS = $(shell "${R_HOME}/bin/Rscript" -e "RcppParallel::RcppParallelLibs()" | tail -n 1) 5 | -------------------------------------------------------------------------------- /tests/testthat.R: -------------------------------------------------------------------------------- 1 | library(testthat) 2 | library(StanEstimators) 3 | 4 | test_check("StanEstimators") 5 | -------------------------------------------------------------------------------- /vignettes/.gitignore: -------------------------------------------------------------------------------- 1 | *.html 2 | *.R 3 | --------------------------------------------------------------------------------