All Classes Namespaces Files Functions Variables Typedefs Enumerator Friends Macros
initialize_variable.hpp
Go to the documentation of this file.
#ifndef STAN_MATH_REV_MAT_FUN_INITIALIZE_VARIABLE_HPP
#define STAN_MATH_REV_MAT_FUN_INITIALIZE_VARIABLE_HPP
#include <stan/math/prim/mat/fun/Eigen.hpp>
#include <stan/math/rev/core.hpp>
#include <vector>
namespace stan {
namespace math {
inline void initialize_variable(var& variable, const var& value) {
variable = value;
}
template <int R, int C>
inline void initialize_variable(Eigen::Matrix<var, R, C>& matrix,
const var& value) {
for (int i = 0; i < matrix.size(); ++i)
matrix(i) = value;
}
template <typename T>
inline void initialize_variable(std::vector<T>& variables,
const var& value) {
for (size_t i = 0; i < variables.size(); ++i)
initialize_variable(variables[i], value);
}
}
}
#endif
core.hpp
stan::math::var
Independent (input) and dependent (output) variables for gradients.
Definition: var.hpp:32
stan::math::initialize_variable
void initialize_variable(var &variable, const var &value)
Initialize variable to value.
Definition: initialize_variable.hpp:15
Eigen.hpp

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