| Stan Math Library 2.12.0 reverse mode automatic differentiation

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

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
4 #include <stan/math/prim/mat/vectorize/apply_scalar_unary.hpp>
5 #include <stan/math/prim/scal/fun/log.hpp>
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
40 log(const T& x) {
41 return apply_scalar_unary<log_fun, T>::apply(x);
42 }
43
44 }
45 }
46 #endif
log.hpp
stan
Definition: log_sum_exp.hpp:8
stan::math::log
fvar< T > log(const fvar< T > &x)
Definition: log.hpp:14
stan::math::log_fun::fun
static T fun(const T &x)
Return natural log of specified argument.
Definition: log.hpp:23
stan::math::log_fun
Structure to wrap log() so that it can be vectorized.
Definition: log.hpp:14
stan::math::log
var log(const var &a)
Return the natural log of the specified variable (cmath).
Definition: log.hpp:50
stan::math::apply_scalar_unary::apply
static return_t apply(const T &x)
Return the result of applying the function defined by the template parameter F to the specified matri...
Definition: apply_scalar_unary.hpp:57
apply_scalar_unary.hpp

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