Stan Math Library  2.15.0
reverse mode automatic differentiation
to_var.hpp
Go to the documentation of this file.
1 #ifndef STAN_MATH_REV_SCAL_FUN_TO_VAR_HPP
2 #define STAN_MATH_REV_SCAL_FUN_TO_VAR_HPP
3 
4 #include <stan/math/rev/core.hpp>
5 
6 namespace stan {
7  namespace math {
8 
17  inline var to_var(double x) {
18  return var(x);
19  }
20 
29  inline var to_var(const var& x) {
30  return x;
31  }
32 
33  }
34 }
35 #endif
Independent (input) and dependent (output) variables for gradients.
Definition: var.hpp:30
std::vector< var > to_var(const std::vector< double > &v)
Converts argument to an automatic differentiation variable.
Definition: to_var.hpp:20

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