Stan Math Library  2.12.0
reverse mode automatic differentiation
get_lp.hpp
Go to the documentation of this file.
1 #ifndef STAN_MATH_PRIM_MAT_FUN_GET_LP_HPP
2 #define STAN_MATH_PRIM_MAT_FUN_GET_LP_HPP
3 
4 #include <boost/math/tools/promotion.hpp>
6 
7 namespace stan {
8  namespace math {
9 
10  template <typename T_lp, typename T_lp_accum>
11  inline
12  typename boost::math::tools::promote_args<T_lp, T_lp_accum>::type
13  get_lp(const T_lp& lp,
14  const accumulator<T_lp_accum>& lp_accum) {
15  return lp + lp_accum.sum();
16  }
17 
18  }
19 }
20 #endif
T sum() const
Return the sum of the accumulated values.
boost::math::tools::promote_args< T_lp, T_lp_accum >::type get_lp(const T_lp &lp, const accumulator< T_lp_accum > &lp_accum)
Definition: get_lp.hpp:13
Class to accumulate values and eventually return their sum.
Definition: accumulator.hpp:25

     [ Stan Home Page ] © 2011–2016, Stan Development Team.