Public Types | Public Member Functions | Private Types | Private Attributes | List of all members
stan::math::internal::map_rect_combine< F, T_shared_param, T_job_param > Class Template Reference

#include "stan/math/prim/mat/functor/map_rect_combine.hpp"

Public Types

typedef Eigen::Matrix< typename stan::return_type< T_shared_param, T_job_param >::type, Eigen::Dynamic, 1 > result_t
 

Public Member Functions

 map_rect_combine ()
 
 map_rect_combine (const Eigen::Matrix< T_shared_param, Eigen::Dynamic, 1 > &shared_params, const std::vector< Eigen::Matrix< T_job_param, Eigen::Dynamic, 1 >> &job_params)
 
result_t operator() (const matrix_d &world_result, const std::vector< int > &world_f_out)
 

Private Types

typedef operands_and_partials< Eigen::Matrix< T_shared_param, Eigen::Dynamic, 1 >, Eigen::Matrix< T_job_param, Eigen::Dynamic, 1 > > ops_partials_t
 

Private Attributes

std::vector< ops_partials_tops_partials_
 
const std::size_t num_shared_operands_
 
const std::size_t num_job_operands_
 

Detailed Description

template<typename F, typename T_shared_param, typename T_job_param>
class stan::math::internal::map_rect_combine< F, T_shared_param, T_job_param >

Definition at line 38 of file map_rect_combine.hpp.

Member Typedef Documentation

template<typename F , typename T_shared_param , typename T_job_param >
typedef operands_and_partials< Eigen::Matrix<T_shared_param, Eigen::Dynamic, 1>, Eigen::Matrix<T_job_param, Eigen::Dynamic, 1> > stan::math::internal::map_rect_combine< F, T_shared_param, T_job_param >::ops_partials_t
private

Definition at line 42 of file map_rect_combine.hpp.

template<typename F , typename T_shared_param , typename T_job_param >
typedef Eigen::Matrix< typename stan::return_type<T_shared_param, T_job_param>::type, Eigen::Dynamic, 1> stan::math::internal::map_rect_combine< F, T_shared_param, T_job_param >::result_t

Definition at line 52 of file map_rect_combine.hpp.

Constructor & Destructor Documentation

template<typename F , typename T_shared_param , typename T_job_param >
stan::math::internal::map_rect_combine< F, T_shared_param, T_job_param >::map_rect_combine ( )
inline

Definition at line 54 of file map_rect_combine.hpp.

template<typename F , typename T_shared_param , typename T_job_param >
stan::math::internal::map_rect_combine< F, T_shared_param, T_job_param >::map_rect_combine ( const Eigen::Matrix< T_shared_param, Eigen::Dynamic, 1 > &  shared_params,
const std::vector< Eigen::Matrix< T_job_param, Eigen::Dynamic, 1 >> &  job_params 
)
inline

Definition at line 56 of file map_rect_combine.hpp.

60  : ops_partials_(),
61  num_shared_operands_(shared_params.rows()),
62  num_job_operands_(dims(job_params)[1]) {
63  ops_partials_.reserve(job_params.size());
64  for (const auto& job_param : job_params)
65  ops_partials_.emplace_back(shared_params, job_param);
66  }
std::vector< ops_partials_t > ops_partials_
void dims(const T &x, std::vector< int > &result)
Definition: dims.hpp:11

Member Function Documentation

template<typename F , typename T_shared_param , typename T_job_param >
result_t stan::math::internal::map_rect_combine< F, T_shared_param, T_job_param >::operator() ( const matrix_d world_result,
const std::vector< int > &  world_f_out 
)
inline

Definition at line 68 of file map_rect_combine.hpp.

References MECModelEnuComparisons::i, calib::j, stan::math::internal::map_rect_combine< F, T_shared_param, T_job_param >::num_shared_operands_, confusionMatrixTree::out, and stan::math::sum().

69  {
70  const std::size_t num_jobs = world_f_out.size();
71  const std::size_t offset_job_params
74  const std::size_t size_world_f_out = sum(world_f_out);
75 
76  result_t out(size_world_f_out);
77 
78  for (std::size_t i = 0, ij = 0; i != num_jobs; ++i) {
79  for (int j = 0; j != world_f_out[i]; ++j, ++ij) {
81  ops_partials_[i].edge1_.partials_
82  = world_result.block(1, ij, num_shared_operands_, 1);
83 
85  ops_partials_[i].edge2_.partials_
86  = world_result.block(offset_job_params, ij, num_job_operands_, 1);
87 
88  out(ij) = ops_partials_[i].build(world_result(0, ij));
89  }
90  }
91 
92  return out;
93  }
fvar< T > sum(const std::vector< fvar< T > > &m)
Definition: sum.hpp:20
std::vector< ops_partials_t > ops_partials_
const double j
Definition: BetheBloch.cxx:29
Eigen::Matrix< typename stan::return_type< T_shared_param, T_job_param >::type, Eigen::Dynamic, 1 > result_t

Member Data Documentation

template<typename F , typename T_shared_param , typename T_job_param >
const std::size_t stan::math::internal::map_rect_combine< F, T_shared_param, T_job_param >::num_job_operands_
private

Definition at line 46 of file map_rect_combine.hpp.

template<typename F , typename T_shared_param , typename T_job_param >
const std::size_t stan::math::internal::map_rect_combine< F, T_shared_param, T_job_param >::num_shared_operands_
private
template<typename F , typename T_shared_param , typename T_job_param >
std::vector<ops_partials_t> stan::math::internal::map_rect_combine< F, T_shared_param, T_job_param >::ops_partials_
private

Definition at line 43 of file map_rect_combine.hpp.


The documentation for this class was generated from the following file: