Automatic Differentiation
 
Loading...
Searching...
No Matches
step.hpp
Go to the documentation of this file.
1#ifndef STAN_MATH_PRIM_FUN_STEP_HPP
2#define STAN_MATH_PRIM_FUN_STEP_HPP
3
6
7namespace stan {
8namespace math {
9
30template <typename T, require_stan_scalar_t<T>* = nullptr>
31inline T step(const T& y) {
32 return y < 0.0 ? 0 : 1;
33}
34
38struct step_fun {
46 template <typename T>
47 static inline auto fun(const T& y) {
48 return step(y);
49 }
50};
51
60template <typename T, require_container_t<T>* = nullptr>
61inline auto step(const T& x) {
63}
64
65} // namespace math
66} // namespace stan
67#endif
T step(const T &y)
The step, or Heaviside, function.
Definition step.hpp:31
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...
Definition fvar.hpp:9
Base template class for vectorization of unary scalar functions defined by a template class F to a sc...
static auto fun(const T &y)
Return zero if the value is less than zero and one otherwise.
Definition step.hpp:47
Structure to wrap step() so it can be vectorized.
Definition step.hpp:38