1 #ifndef STAN_MATH_PRIM_MAT_FUN_GET_BASE1_LHS_HPP 2 #define STAN_MATH_PRIM_MAT_FUN_GET_BASE1_LHS_HPP 30 const char* error_msg,
32 check_range(
"[]",
"x", x.size(), i, idx, error_msg);
57 const char* error_msg,
59 check_range(
"[]",
"x", x.size(), i1, idx, error_msg);
86 const char* error_msg,
88 check_range(
"[]",
"x", x.size(), i1, idx, error_msg);
110 template <
typename T>
113 <std::vector<T> > > >& x,
118 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);
143 template <
typename T>
146 <std::vector<T> > > > >& x,
152 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);
178 template <
typename T>
181 <std::vector<std::vector<T> > > > > >& x,
188 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,
229 check_range(
"[]",
"x", x.size(), i1, idx, error_msg);
230 return get_base1_lhs(x[i1 - 1], i2, i3, i4, i5, i6, i7, error_msg, idx+1);
255 template <
typename T>
258 <std::vector<std::vector<std::vector
259 <std::vector<T> > > > > > > >& x,
268 const char* error_msg,
270 check_range(
"[]",
"x", x.size(), i1, idx, error_msg);
295 template <
typename T>
297 Eigen::Block<Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic> >
300 const char* error_msg,
302 check_range(
"[]",
"rows of x", x.rows(), m, idx, error_msg);
303 return x.block(m-1, 0, 1, x.cols());
323 template <
typename T>
328 const char* error_msg,
330 check_range(
"[]",
"rows of x", x.rows(), m, idx, error_msg);
331 check_range(
"[]",
"cols of x", x.cols(), n, idx + 1, error_msg);
332 return x(m - 1, n - 1);
350 template <
typename T>
354 const char* error_msg,
356 check_range(
"[]",
"x", x.size(), m, idx, error_msg);
375 template <
typename T>
379 const char* error_msg,
381 check_range(
"[]",
"x", x.size(), n, idx, error_msg);
void check_range(const char *function, const char *name, int max, int index, int nested_level, const char *error_msg)
Check 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...