cratepy.tensor.matrixoperations.get_condensed_matrix¶
- get_condensed_matrix(matrix, rows, cols, is_check_indexes=False)[source]¶
Perform condensation of matrix given a set of rows and columns.
- Parameters:
matrix (numpy.ndarray (2d)) – Matrix to be condensed.
rows (numpy.ndarray (1d)) – Indexes of rows to keep in condensed matrix.
cols (numpy.ndarray (1d)) – Indexes of columns to keep in condensed matrix.
is_check_indexes (bool, default=False) – If True, then check validity of condensed rows and columns indexes before performing matrix condensation. May yield non-negligible overhead cost when condensing large matrix.
- Returns:
matrix_condensed – Condensed matrix.
- Return type:
numpy.ndarray (2d)