Stan  1.3
probability, sampling & optimization
 All Classes Namespaces Files Functions Variables Typedefs Enumerator Friends Macros Pages
divide.hpp
Go to the documentation of this file.
1 #ifndef __STAN__AGRAD__REV__MATRIX__DIVIDE_HPP__
2 #define __STAN__AGRAD__REV__MATRIX__DIVIDE_HPP__
3 
4 #include <vector>
9 #include <stan/agrad/rev/var.hpp>
13 
14 namespace stan {
15  namespace agrad {
16 
24  inline double
25  divide(double x, double y) {
26  return x / y;
27  }
28  template <typename T1, typename T2>
29  inline var
30  divide(const T1& v, const T2& c) {
31  return to_var(v) / to_var(c);
32  }
40  template <typename T1, typename T2, int R, int C>
41  inline Eigen::Matrix<var,R,C>
42  divide(const Eigen::Matrix<T1, R,C>& v, const T2& c) {
43  return to_var(v) / to_var(c);
44  }
45 
46  }
47 }
48 #endif

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