Automatic Differentiation
 
Loading...
Searching...
No Matches
step.hpp
Go to the documentation of this file.
1#ifndef STAN_MATH_REV_FUN_STEP_HPP
2#define STAN_MATH_REV_FUN_STEP_HPP
3
7
8namespace stan {
9namespace math {
10
27inline var step(const var& a) {
28 return var(new vari(a.vi_->val_ < 0.0 ? 0.0 : 1.0));
29}
30
31} // namespace math
32} // namespace stan
33#endif
T step(const T &y)
The step, or Heaviside, function.
Definition step.hpp:31
vari_value< double > vari
Definition vari.hpp:197
var_value< double > var
Definition var.hpp:1187
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...