Stan
2.5.0
probability, sampling & optimization
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
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/agrad/rev/var.hpp
>
8
#include <
stan/agrad/rev/operators/operator_division.hpp
>
9
#include <
stan/agrad/rev/matrix/to_var.hpp
>
10
#include <
stan/agrad/rev/matrix/typedefs.hpp
>
11
12
namespace
stan {
13
namespace
agrad {
14
22
inline
double
23
divide
(
double
x,
double
y) {
24
return
x / y;
25
}
26
template
<
typename
T1,
typename
T2>
27
inline
var
28
divide
(
const
T1& v,
const
T2& c) {
29
return
to_var
(v) /
to_var
(c);
30
}
38
template
<
typename
T1,
typename
T2,
int
R,
int
C>
39
inline
Eigen::Matrix<var,R,C>
40
divide
(
const
Eigen::Matrix<T1, R,C>& v,
const
T2& c) {
41
return
to_var
(v) /
to_var
(c);
42
}
43
44
}
45
}
46
#endif
typedefs.hpp
stan::agrad::to_var
var to_var(const double &x)
Converts argument to an automatic differentiation variable.
Definition:
to_var.hpp:21
operator_division.hpp
typedefs.hpp
to_var.hpp
var.hpp
Eigen.hpp
stan::agrad::divide
stan::return_type< T1, T2 >::type divide(const T1 &v, const T2 &c)
Definition:
divide.hpp:17
[
Stan Home Page
]
© 2011–2014, Stan Development Team.