Stan  2.5.0
probability, sampling & optimization
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
step.hpp
Go to the documentation of this file.
1 #ifndef STAN__AGRAD__REV__FUNCTIONS__STEP_HPP
2 #define STAN__AGRAD__REV__FUNCTIONS__STEP_HPP
3 
4 #include <stan/agrad/rev/var.hpp>
5 
6 namespace stan {
7  namespace agrad {
8 
25  inline var step(const stan::agrad::var& a) {
26  return var(new vari(a.vi_->val_ < 0.0 ? 0.0 : 1.0));
27  }
28 
29  }
30 }
31 #endif
const double val_
The value of this variable.
Definition: vari.hpp:37
vari * vi_
Pointer to the implementation of this variable.
Definition: var.hpp:40
The variable implementation base class.
Definition: vari.hpp:28
Independent (input) and dependent (output) variables for gradients.
Definition: var.hpp:27
var step(const stan::agrad::var &a)
Return the step, or heaviside, function applied to the specified variable (stan). ...
Definition: step.hpp:25

     [ Stan Home Page ] © 2011–2014, Stan Development Team.