1#ifndef STAN_MATH_REV_FUN_ZIP_INDEX_HPP
2#define STAN_MATH_REV_FUN_ZIP_INDEX_HPP
29template <
typename EigMat,
typename IdxRows,
typename IdxCols,
30 require_eigen_matrix_dynamic_t<EigMat>* =
nullptr,
31 require_all_std_vector_t<IdxRows, IdxCols>* =
nullptr>
36 "size of idx_col", idx_col.size());
37 if (idx_row.empty()) {
44 zip_index(x.adj(), rows, cols) += vi.adj();
int64_t cols(const T_x &x)
Returns the number of columns in the specified kernel generator expression.
int64_t rows(const T_x &x)
Returns the number of rows in the specified kernel generator expression.
var_value< plain_type_t< T > > make_callback_var(T &&value, F &&functor)
Creates a new var initialized with a callback_vari with a given value and reverse-pass callback funct...
arena_t< T > to_arena(const T &a)
Converts given argument into a type that either has any dynamic allocation on AD stack or schedules i...
void check_size_match(const char *function, const char *name_i, T_size1 i, const char *name_j, T_size2 j)
Check if the provided sizes match.
auto zip_index(EigMat &&x, IdxRows &&idx_row, IdxCols &&idx_col)
Return the column vector of elements of x selected by paired (zipped) 1-based row and column indices.
Matrices and templated mathematical functions.