Skip to content

Commit 8725ecd

Browse files
committed
chore: add documentation to matrixCheckRanges
1 parent 1f464d7 commit 8725ecd

File tree

1 file changed

+27
-7
lines changed

1 file changed

+27
-7
lines changed

src/matrix/matrixCheckRanges.ts

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,33 @@
1-
import { DoubleMatrix } from '../types';
1+
import type { DoubleMatrix } from '../types';
22

3+
export interface SubmatrixBoundaries {
4+
/**
5+
* The starting row index of the submatrix.
6+
*/
7+
startRow: number;
8+
/**
9+
* The ending row index of the submatrix.
10+
*/
11+
endRow: number;
12+
/**
13+
* The starting column index of the submatrix.
14+
*/
15+
startColumn: number;
16+
/**
17+
* The ending column index of the submatrix.
18+
*/
19+
endColumn: number;
20+
}
21+
22+
/**
23+
* Checks if the specified submatrix boundaries are within the valid range of the given matrix.
24+
* @param matrix - The matrix to check the boundaries against.
25+
* @param boundaries - The boundaries of the submatrix.
26+
* @throws {RangeError} If any of the specified boundaries are out of the matrix's range.
27+
*/
328
export function matrixCheckRanges(
429
matrix: DoubleMatrix,
5-
boundaries: {
6-
startRow: number;
7-
endRow: number;
8-
startColumn: number;
9-
endColumn: number;
10-
},
30+
boundaries: SubmatrixBoundaries,
1131
) {
1232
const { startRow, endRow, startColumn, endColumn } = boundaries;
1333
if (

0 commit comments

Comments
 (0)