1#ifndef STAN_MATH_OPENCL_PRIM_SEGMENT_HPP
2#define STAN_MATH_OPENCL_PRIM_SEGMENT_HPP
22template <
typename T_x,
23 require_nonscalar_prim_or_rev_kernel_expression_t<T_x>* =
nullptr>
24inline auto segment(T_x&& x,
size_t i,
size_t n) {
27 return block(std::forward<T_x>(x), 1, i, 1, n);
29 return block(std::forward<T_x>(x), i, 1, n, 1);
void check_vector(const char *function, const char *name, const Mat &x)
Check the input is either a row vector or column vector or a matrix with a single row or column.
auto segment(T_x &&x, size_t i, size_t n)
Return the specified number of elements as a row/column vector starting from the specified element - ...
auto block(T_x &&x, size_t i, size_t j, size_t nrows, size_t ncols)
Return a nrows x ncols submatrix starting at (i-1, j-1).
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...