Stan Math Library  2.20.0
reverse mode automatic differentiation
log.hpp
Go to the documentation of this file.
1 #ifndef STAN_MATH_PRIM_MAT_FUN_LOG_HPP
2 #define STAN_MATH_PRIM_MAT_FUN_LOG_HPP
3 
6 #include <cmath>
7 
8 namespace stan {
9 namespace math {
10 
14 struct log_fun {
22  template <typename T>
23  static inline T fun(const T& x) {
24  using std::log;
25  return log(x);
26  }
27 };
28 
38 template <typename T>
39 inline typename apply_scalar_unary<log_fun, T>::return_t log(const T& x) {
41 }
42 
43 } // namespace math
44 } // namespace stan
45 #endif
fvar< T > log(const fvar< T > &x)
Definition: log.hpp:12
static T fun(const T &x)
Return natural log of specified argument.
Definition: log.hpp:23
Structure to wrap log() so that it can be vectorized.
Definition: log.hpp:14
Eigen::Matrix< scalar_t, T::RowsAtCompileTime, T::ColsAtCompileTime > return_t
Return type for applying the function elementwise to a matrix expression template of type T...
var log(const var &a)
Return the natural log of the specified variable (cmath).
Definition: log.hpp:47
static return_t apply(const T &x)
Return the result of applying the function defined by the template parameter F to the specified matri...

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