import type { array, matrix } from "../types"; /** * Concatenates arrays and matrices along the specified dimension. * * Concatenates arrays and matrices along the specified dimension. Supports vertical (0) and horizontal (1) concatenation. * * @param dim The dimension along which to concatenate (0: rows, 1: columns) * @param args Variable arguments to concatenate * @returns The concatenated array or matrix * @throws If not enough input arguments are provided or if dimensions do not match for concatenation * * @example Vertical Concatenation (dim = 0) with numbers * ```ts * import { assertEquals } from "jsr:@std/assert"; * * assertEquals(cat(0, 1, 2, 3, 4), [[1], [2], [3], [4]]); * * ``` * * @example Vertical Concatenation (dim = 0) with arrays * ```ts * import { assertEquals } from "jsr:@std/assert"; * * assertEquals(cat(0, [5, 6, 3], [0.5, -3, 2.3]), [[5, 6, 3], [0.5, -3, 2.3]]); * * ``` * * @example Vertical Concatenation (dim = 0) with matrix and array * ```ts * import { assertEquals } from "jsr:@std/assert"; * * const result3 = cat(0, [[5, 6, 5], [7, 8, -1]], [5, 6, 3]); * assertEquals(result3, [[5, 6, 5], [7, 8, -1], [5, 6, 3]]); * * ``` * * @example Horizontal Concatenation (dim = 1) with numbers * ```ts * import { assertEquals } from "jsr:@std/assert"; * * assertEquals(cat(1, 1, 2, 3, 4), [[1, 2, 3, 4]]); * * ``` * * @example Horizontal Concatenation (dim = 1) with arrays * ```ts * import { assertEquals } from "jsr:@std/assert"; * * assertEquals(cat(1, [5, 6, 3], [0.5, -3, 2.3]), [[5, 6, 3, 0.5, -3, 2.3]]); * * ``` * * @example Horizontal Concatenation (dim = 1) with matrix and arrays * ```ts * import { assertEquals } from "jsr:@std/assert"; * * const result6 = cat(1, [[2, 3, 4]], [5, 6, 3], [0.5, -3, 2.3]); * assertEquals(result6, [[2, 3, 4, 5, 6, 3, 0.5, -3, 2.3]]); * ``` */ export default function cat(dim: number, ...args: (number | array | matrix)[]): array | matrix; //# sourceMappingURL=cat.d.ts.map