1#ifndef STAN_MATH_PRIM_FUNCTOR_MAP_RECT_COMBINE_HPP
2#define STAN_MATH_PRIM_FUNCTOR_MAP_RECT_COMBINE_HPP
38template <
typename F,
typename T_shared_param,
typename T_job_param,
39 require_eigen_col_vector_t<T_shared_param>* =
nullptr>
43 Eigen::Matrix<T_job_param, Eigen::Dynamic, 1>>;
50 using result_t = Eigen::Matrix<return_type_t<T_shared_param, T_job_param>,
56 const T_shared_param& shared_params,
57 const std::vector<Eigen::Matrix<T_job_param, Eigen::Dynamic, 1>>&
63 for (
const auto& job_param : job_params) {
69 const std::vector<int>& world_f_out) {
70 const std::size_t num_jobs = world_f_out.size();
71 const std::size_t offset_job_params
73 const std::size_t size_world_f_out =
sum(world_f_out);
77 for (std::size_t i = 0, ij = 0; i != num_jobs; ++i) {
78 for (
int j = 0; j != world_f_out[i]; ++j, ++ij) {
std::vector< ops_partials_t > ops_partials_
map_rect_combine(const T_shared_param &shared_params, const std::vector< Eigen::Matrix< T_job_param, Eigen::Dynamic, 1 > > &job_params)
const std::size_t num_job_operands_
Eigen::Matrix< return_type_t< T_shared_param, T_job_param >, Eigen::Dynamic, 1 > result_t
result_t operator()(const matrix_d &world_result, const std::vector< int > &world_f_out)
const std::size_t num_shared_operands_
int64_t rows(const T_x &x)
Returns the number of rows in the specified kernel generator expression.
void dims(const T_x &x, std::vector< int > &result)
matrix_cl overload of the dims helper function in prim/fun/dims.hpp.
typename return_type< Ts... >::type return_type_t
Convenience type for the return type of the specified template parameters.
auto sum(const std::vector< T > &m)
Return the sum of the entries of the specified standard vector.
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > matrix_d
Type for matrix of double values.
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...
Extends std::true_type when instantiated with zero or more template parameters, all of which extend t...