Return a column vector of matrix entries selected by paired one-based row and column indices.
Repeated index pairs accumulate adjoints in the same input entry.
- Template Parameters
-
| EigMat | Eigen matrix type inside the input var_value |
| IdxRows | Row index std::vector type with integer elements |
| IdxCols | Column index std::vector type with integer elements |
- Parameters
-
| x | Input matrix |
| idx_row | Row indices |
| idx_col | Column indices |
- Returns
- A var_value column vector with element i equal to x(idx_row[i] - 1, idx_col[i] - 1), or an empty vector for empty indices
- Exceptions
-
| std::invalid_argument | if the index vectors have different lengths |
| std::out_of_range | if an index is outside the matrix bounds |
Definition at line 32 of file zip_index.hpp.