For each row of a matrix, extracts elements at indices specified by the corresponding row of `windows`. Used for `ff()` terms with integration limits to reduce matrix size by keeping only the relevant integration region.
shift_and_shorten_matrix(X, windows)Matrix with same number of rows as `X` and same number of columns as columns in `windows`.
Matrix to extract windows from.
Integer matrix where each row specifies column indices to extract from the corresponding row of `X`.