Stan Math Library  2.20.0
reverse mode automatic differentiation
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/rev/meta.hpp>
6 #include <stan/math/rev/core.hpp>
8 
9 namespace stan {
10 namespace math {
11 
19 template <typename T1, typename T2, int R, int C>
20 inline Eigen::Matrix<var, R, C> divide(const Eigen::Matrix<T1, R, C>& v,
21  const T2& c) {
22  return to_var(v) / to_var(c);
23 }
24 
25 } // namespace math
26 } // namespace stan
27 #endif
Eigen::Matrix< fvar< T >, R, C > divide(const Eigen::Matrix< fvar< T >, R, C > &v, const fvar< T > &c)
Definition: divide.hpp:11
std::vector< var > to_var(const std::vector< double > &v)
Converts argument to an automatic differentiation variable.
Definition: to_var.hpp:19

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