Automatic Differentiation
 
Loading...
Searching...
No Matches
minus.hpp
Go to the documentation of this file.
1#ifndef STAN_MATH_PRIM_FUN_MINUS_HPP
2#define STAN_MATH_PRIM_FUN_MINUS_HPP
3
6
7namespace stan {
8namespace math {
9
17template <typename T, require_not_std_vector_t<T>* = nullptr>
18inline auto minus(const T& x) {
19 return -x;
20}
21
29template <typename T>
30inline auto minus(const std::vector<T>& x) {
32 x, [](const auto& v) { return -v; });
33}
34
35} // namespace math
36} // namespace stan
37
38#endif
auto minus(const T &x)
Returns the negation of the specified scalar or matrix.
Definition minus.hpp:18
constexpr decltype(auto) apply(F &&f, Tuple &&t, PreArgs &&... pre_args)
Definition apply.hpp:52
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...