Stan
1.3
probability, sampling & optimization
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerator
Friends
Macros
Pages
src
stan
agrad
rev
matrix
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>
5
#include <
stan/math/matrix/Eigen.hpp
>
6
#include <
stan/math/matrix/typedefs.hpp
>
7
#include <
stan/math/matrix/validate_multiplicable.hpp
>
8
#include <
stan/math/matrix/validate_square.hpp
>
9
#include <
stan/agrad/rev/var.hpp
>
10
#include <
stan/agrad/rev/operator_division.hpp
>
11
#include <
stan/agrad/rev/matrix/to_var.hpp
>
12
#include <
stan/agrad/rev/matrix/typedefs.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.