Automatic Differentiation
 
Loading...
Searching...
No Matches

◆ zip_index() [1/2]

template<typename EigMat , typename IdxRows , typename IdxCols , require_eigen_matrix_dynamic_t< EigMat > * = nullptr, require_all_vector_t< IdxRows, IdxCols > * = nullptr>
auto stan::math::zip_index ( EigMat &&  x,
IdxRows &&  idx_row,
IdxCols &&  idx_col 
)
inline

Return the column vector of elements of x selected by paired (zipped) 1-based row and column indices.

Template Parameters
EigMattype of the matrix
Parameters
xinput matrix
idx_rowrow index vector
idx_colcolumn index vector
Returns
column vector with element i equal to x(idx_row[i]-1, idx_col[i]-1)
Exceptions
std::invalid_argumentif the index vectors are of different lengths
std::out_of_rangeif any index is out of the valid range of the matrix

Definition at line 27 of file zip_index.hpp.