Stan  2.5.0
probability, sampling & optimization
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
multiply_log.hpp
Go to the documentation of this file.
1 #ifndef STAN__MATH__FUNCTIONS__MULTIPLY_LOG_HPP
2 #define STAN__MATH__FUNCTIONS__MULTIPLY_LOG_HPP
3 
4 #include <boost/math/tools/promotion.hpp>
5 
6 namespace stan {
7  namespace math {
8 
49  template <typename T_a, typename T_b>
50  inline typename boost::math::tools::promote_args<T_a,T_b>::type
51  multiply_log(const T_a a, const T_b b) {
52  using std::log;
53  if (b == 0.0 && a == 0.0)
54  return 0.0;
55  return a * log(b);
56  }
57 
58  }
59 }
60 
61 #endif
boost::math::tools::promote_args< T_a, T_b >::type multiply_log(const T_a a, const T_b b)
Calculated the value of the first argument times log of the second argument while behaving properly w...
Eigen::Matrix< T, Rows, Cols > log(const Eigen::Matrix< T, Rows, Cols > &m)
Return the element-wise logarithm of the matrix or vector.
Definition: log.hpp:16
fvar< T > log(const fvar< T > &x)
Definition: log.hpp:15

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