Automatic Differentiation
 
Loading...
Searching...
No Matches
log10.hpp
Go to the documentation of this file.
1#ifndef STAN_MATH_PRIM_FUN_LOG10_HPP
2#define STAN_MATH_PRIM_FUN_LOG10_HPP
3
9#include <cmath>
10#include <complex>
11
12namespace stan {
13namespace math {
14
22struct log10_fun {
23 template <typename T>
24 static inline auto fun(const T& x) {
25 using std::log10;
26 return log10(x);
27 }
28};
29
37template <
38 typename Container, require_not_var_matrix_t<Container>* = nullptr,
41inline auto log10(const Container& x) {
43}
44
53template <typename Container,
55inline auto log10(const Container& x) {
57 x, [](const auto& v) { return v.array().log10(); });
58}
59
60namespace internal {
68template <typename V>
69inline std::complex<V> complex_log10(const std::complex<V>& z) {
70 static constexpr double inv_log_10 = 1.0f / LOG_TEN;
71 return log(z) * inv_log_10;
72}
73} // namespace internal
74
75} // namespace math
76} // namespace stan
77
78#endif
require_not_t< container_type_check_base< is_container, scalar_type_t, TypeCheck, Check... > > require_not_container_st
Require type does not satisfy is_container.
require_t< container_type_check_base< is_container, scalar_type_t, TypeCheck, Check... > > require_container_st
Require type satisfies is_container.
require_not_t< is_nonscalar_prim_or_rev_kernel_expression< std::decay_t< T > > > require_not_nonscalar_prim_or_rev_kernel_expression_t
Require type does not satisfy is_nonscalar_prim_or_rev_kernel_expression.
require_not_t< is_var_matrix< std::decay_t< T > > > require_not_var_matrix_t
Require type does not satisfy is_var_matrix.
std::complex< V > complex_log10(const std::complex< V > &z)
Return the base 10 logarithm of the complex argument.
Definition log10.hpp:69
static constexpr double LOG_TEN
The natural logarithm of 10, .
fvar< T > log(const fvar< T > &x)
Definition log.hpp:15
static constexpr double log10()
Returns the natural logarithm of ten.
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...
Base template class for vectorization of unary scalar functions defined by a template class F to a sc...
static auto fun(const T &x)
Definition log10.hpp:24
Structure to wrap log10() so it can be vectorized.
Definition log10.hpp:22