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
6
7namespace stan {
8namespace math {
9
26inline var step(const var& a) {
27 return var(new vari(a.vi_->val_ < 0.0 ? 0.0 : 1.0));
28}
29
30} // namespace math
31} // namespace stan
32#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 ...