to_var.hpp
Go to the documentation of this file.
#ifndef STAN_MATH_REV_ARR_FUN_TO_VAR_HPP
#define STAN_MATH_REV_ARR_FUN_TO_VAR_HPP
#include <stan/math/rev/core.hpp>
#include <stan/math/rev/scal/fun/to_var.hpp>
#include <vector>
namespace stan {
namespace math {
inline std::vector<var>
to_var(const std::vector<double>& v) {
std::vector<var> var_vector(v.size());
for (size_t n = 0; n < v.size(); n++)
var_vector[n] = v[n];
return var_vector;
}
inline std::vector<var>
to_var(const std::vector<var>& v) {
return v;
}
}
}
#endif
core.hpp
stan
Definition: log_sum_exp.hpp:8
to_var.hpp
stan::math::to_var
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.