1 #ifndef STAN_MATH_PRIM_MAT_FUN_GET_BASE1_LHS_HPP
2 #define STAN_MATH_PRIM_MAT_FUN_GET_BASE1_LHS_HPP
29 const char* error_msg,
32 check_range(
"[]",
"x", x.size(), i, idx, error_msg);
56 const char* error_msg,
59 check_range(
"[]",
"x", x.size(), i1, idx, error_msg);
85 const char* error_msg,
88 check_range(
"[]",
"x", x.size(), i1, idx, error_msg);
109 template <
typename T>
112 <std::vector<T> > > >& x,
117 const char* error_msg,
120 check_range(
"[]",
"x", x.size(), i1, idx, error_msg);
121 return get_base1_lhs(x[i1 - 1], i2, i3, i4, error_msg, idx+1);
142 template <
typename T>
145 <std::vector<T> > > > >& x,
151 const char* error_msg,
154 check_range(
"[]",
"x", x.size(), i1, idx, error_msg);
155 return get_base1_lhs(x[i1 - 1], i2, i3, i4, i5, error_msg, idx+1);
177 template <
typename T>
180 <std::vector<std::vector<T> > > > > >& x,
187 const char* error_msg,
190 check_range(
"[]",
"x", x.size(), i1, idx, error_msg);
191 return get_base1_lhs(x[i1 - 1], i2, i3, i4, i5, i6, error_msg, idx+1);
215 template <
typename T>
218 <std::vector<std::vector
219 <std::vector<T> > > > > > >& x,
227 const char* error_msg,
230 check_range(
"[]",
"x", x.size(), i1, idx, error_msg);
231 return get_base1_lhs(x[i1 - 1], i2, i3, i4, i5, i6, i7, error_msg, idx+1);
256 template <
typename T>
259 <std::vector<std::vector<std::vector
260 <std::vector<T> > > > > > > >& x,
269 const char* error_msg,
272 check_range(
"[]",
"x", x.size(), i1, idx, error_msg);
298 template <
typename T>
300 Eigen::Block<Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic> >
303 const char* error_msg,
306 check_range(
"[]",
"rows of x", x.rows(), m, idx, error_msg);
307 return x.block(m-1, 0, 1, x.cols());
326 template <
typename T>
331 const char* error_msg,
334 check_range(
"[]",
"rows of x", x.rows(), m, idx, error_msg);
335 check_range(
"[]",
"cols of x", x.cols(), n, idx + 1, error_msg);
336 return x(m - 1, n - 1);
353 template <
typename T>
357 const char* error_msg,
360 check_range(
"[]",
"x", x.size(), m, idx, error_msg);
378 template <
typename T>
382 const char* error_msg,
385 check_range(
"[]",
"x", x.size(), n, idx, error_msg);
bool check_range(const char *function, const char *name, const int max, const int index, const int nested_level, const char *error_msg)
Return true if specified index is within range.
T & get_base1_lhs(std::vector< T > &x, size_t i, const char *error_msg, size_t idx)
Return a reference to the value of the specified vector at the specified base-one index...