(matrix: Matrix, name: string, indices: [number, number?][])
| 11 | } |
| 12 | |
| 13 | export function assertMatrixElements(matrix: Matrix, name: string, indices: [number, number?][]): void { |
| 14 | for (const [row, col] of indices) { |
| 15 | assertNotNull(matrix[row], `Row ${name}[${row}][${col}]`); |
| 16 | if (col !== undefined) { |
| 17 | assertNotNull(matrix[row]![col], `Col ${name}[${row}][${col}]`); |
| 18 | } |
| 19 | } |
| 20 | } |
| 21 | |
| 22 | export function assertValidMatrix(a:Matrix,aName:string):void{ |
| 23 | if(!a[0] || !a.length){ |