| Stan Math Library 2.6.3 probability, sampling & optimization

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerator Friends Macros
divide.hpp
Go to the documentation of this file.
1 #ifndef STAN_MATH_REV_MAT_FUN_DIVIDE_HPP
2 #define STAN_MATH_REV_MAT_FUN_DIVIDE_HPP
3
4 #include <stan/math/prim/mat/fun/Eigen.hpp>
5 #include <stan/math/prim/mat/fun/typedefs.hpp>
6 #include <stan/math/rev/core.hpp>
7 #include <stan/math/rev/mat/fun/to_var.hpp>
8 #include <stan/math/rev/mat/fun/typedefs.hpp>
9 #include <vector>
10
11 namespace stan {
12 namespace math {
13
21 inline double
22 divide(double x, double y) {
23 return x / y;
24 }
25 template <typename T1, typename T2>
26 inline var
27 divide(const T1& v, const T2& c) {
28 return to_var(v) / to_var(c);
29 }
37 template <typename T1, typename T2, int R, int C>
38 inline Eigen::Matrix<var, R, C>
39 divide(const Eigen::Matrix<T1, R, C>& v, const T2& c) {
40 return to_var(v) / to_var(c);
41 }
42
43 }
44 }
45 #endif
core.hpp
stan::math::divide
stan::return_type< T1, T2 >::type divide(const T1 &v, const T2 &c)
Definition: divide.hpp:17
stan::math::to_var
var to_var(const double &x)
Converts argument to an automatic differentiation variable.
Definition: to_var.hpp:21
to_var.hpp
typedefs.hpp
Eigen.hpp
typedefs.hpp

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