Stan  1.3
probability, sampling & optimization
 All Classes Namespaces Files Functions Variables Typedefs Enumerator Friends Macros Pages
floor.hpp
Go to the documentation of this file.
1 #ifndef __STAN__AGRAD__REV__FLOOR_HPP__
2 #define __STAN__AGRAD__REV__FLOOR_HPP__
3 
4 #include <cmath>
5 #include <stan/agrad/rev/var.hpp>
7 
8 namespace stan {
9  namespace agrad {
10 
11  namespace {
12  class floor_vari : public vari {
13  public:
14  floor_vari(vari* avi) :
15  vari(std::floor(avi->val_)) {
16  }
17  };
18  }
19 
38  inline var floor(const var& a) {
39  return var(new floor_vari(a.vi_));
40  }
41 
42  }
43 }
44 #endif

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