1 #ifndef STAN__MATH__MATRIX__ASSIGN_HPP
2 #define STAN__MATH__MATRIX__ASSIGN_HPP
35 template <
typename LHS,
typename RHS>
61 template <
typename LHS,
typename RHS,
int R1,
int C1,
int R2,
int C2>
64 const Eigen::Matrix<RHS,R2,C2>& y) {
66 ss <<
"error in call to assign(Eigen::Matrix,Eigen::Matrix)"
67 <<
"; shapes must match, but found"
72 throw std::domain_error(ss.str());
92 template <
typename LHS,
typename RHS,
int R,
int C>
95 const Eigen::Matrix<RHS,R,C>& y) {
98 for (
int i = 0; i < x.size(); ++i)
120 template <
typename LHS,
typename RHS,
int R,
int C>
123 const Eigen::Matrix<RHS,R,C>& y) {
126 for (
int n = 0; n < y.cols(); ++n)
127 for (
int m = 0; m < y.rows(); ++m)
151 template <
typename LHS,
typename RHS>
153 assign(std::vector<LHS>& x,
const std::vector<RHS>& y) {
156 for (
size_t i = 0; i < x.size(); ++i)
bool check_matching_dims(const char *function, const Eigen::Matrix< T1, R1, C1 > &y1, const char *name1, const Eigen::Matrix< T2, R2, C2 > &y2, const char *name2, T_result *result)
void assign(LHS &lhs, const RHS &rhs)
Copy the right-hand side's value to the left-hand side variable.
bool check_matching_sizes(const char *function, const T_y1 &y1, const char *name1, const T_y2 &y2, const char *name2, T_result *result)