import type { array, matrix } from "../types"; /** * Get a column of a matrix. * * Retrieves a specific column from a 2D matrix. If the input is not a matrix or if the column index is invalid, an error is thrown. * * @param x The input matrix (2D array) from which to retrieve the column. * @param n The column index to retrieve (0-based index). * @returns An array representing the specified column of the matrix. * @throws Throws an error if the input is not a matrix or if the column index is out of bounds. * * @example Get the first column * ```ts * import { assertEquals, assertThrows } from "jsr:@std/assert"; * * assertEquals(getcol([[5, 6, 5], [7, 8, -1]], 0), [5, 7]); * * ``` * * @example Get the third column * ```ts * import { assertEquals, assertThrows } from "jsr:@std/assert"; * * assertEquals(getcol([[5, 6, 5], [7, 8, -1]], 2), [5, -1]); * * ``` * * @example Invalid column index (out of bounds) * ```ts * import { assertEquals, assertThrows } from "jsr:@std/assert"; * * assertThrows(() => { getcol([[5, 6, 5], [7, 8, -1]], 3); }, Error, 'Column index must be an integer between 0 and N - 1 columns'); * * ``` */ export default function getcol(x: matrix, n: number): array; //# sourceMappingURL=getcol.d.ts.map