import type { array, matrix } from "../types"; /** * Addition X + Y. * * Adds two numbers, arrays, or matrices element-wise. Handles mixed inputs of scalars, arrays, and matrices. * * @param x The first operand, can be a number, array, or matrix. * @param y The second operand, can be a number, array, or matrix. * @returns The result of adding `x` and `y`. * @throws If the input dimensions do not agree or if no arguments are provided. * * @example Add two numbers * ```ts * import { assertEquals } from "jsr:@std/assert"; * * assertEquals(plus(5, 6), 11); * * ``` * * @example Add two arrays element-wise * ```ts * import { assertEquals } from "jsr:@std/assert"; * * assertEquals(plus([5, 6, 4], [3, -1, 0]), [8, 5, 4]); * * ``` * * @example Add a number to each element of an array * ```ts * import { assertEquals } from "jsr:@std/assert"; * * assertEquals(plus([5, 6, 4], 10), [15, 16, 14]); * * ``` * * @example Add a number to each element of a matrix * ```ts * import { assertEquals } from "jsr:@std/assert"; * * assertEquals(plus(10, [[5, 6], [3, 4]]), [[15, 16], [13, 14]]); * * ``` * * @example Add two matrices element-wise * ```ts * import { assertEquals } from "jsr:@std/assert"; * * assertEquals(plus([[5, 6], [3, 4]], [[2, 3], [1, 2]]), [[7, 9], [4, 6]]); * ``` */ export default function plus(x: number, y: number): number; /** * Addition X + Y. * * Adds two numbers, arrays, or matrices element-wise. Handles mixed inputs of scalars, arrays, and matrices. * * @param x The first operand, can be a number, array, or matrix. * @param y The second operand, can be a number, array, or matrix. * @returns The result of adding `x` and `y`. * @throws If the input dimensions do not agree or if no arguments are provided. * * @example Add two numbers * ```ts * import { assertEquals } from "jsr:@std/assert"; * * assertEquals(plus(5, 6), 11); * * ``` * * @example Add two arrays element-wise * ```ts * import { assertEquals } from "jsr:@std/assert"; * * assertEquals(plus([5, 6, 4], [3, -1, 0]), [8, 5, 4]); * * ``` * * @example Add a number to each element of an array * ```ts * import { assertEquals } from "jsr:@std/assert"; * * assertEquals(plus([5, 6, 4], 10), [15, 16, 14]); * * ``` * * @example Add a number to each element of a matrix * ```ts * import { assertEquals } from "jsr:@std/assert"; * * assertEquals(plus(10, [[5, 6], [3, 4]]), [[15, 16], [13, 14]]); * * ``` * * @example Add two matrices element-wise * ```ts * import { assertEquals } from "jsr:@std/assert"; * * assertEquals(plus([[5, 6], [3, 4]], [[2, 3], [1, 2]]), [[7, 9], [4, 6]]); * ``` */ export default function plus(x: number, y: array): array; /** * Addition X + Y. * * Adds two numbers, arrays, or matrices element-wise. Handles mixed inputs of scalars, arrays, and matrices. * * @param x The first operand, can be a number, array, or matrix. * @param y The second operand, can be a number, array, or matrix. * @returns The result of adding `x` and `y`. * @throws If the input dimensions do not agree or if no arguments are provided. * * @example Add two numbers * ```ts * import { assertEquals } from "jsr:@std/assert"; * * assertEquals(plus(5, 6), 11); * * ``` * * @example Add two arrays element-wise * ```ts * import { assertEquals } from "jsr:@std/assert"; * * assertEquals(plus([5, 6, 4], [3, -1, 0]), [8, 5, 4]); * * ``` * * @example Add a number to each element of an array * ```ts * import { assertEquals } from "jsr:@std/assert"; * * assertEquals(plus([5, 6, 4], 10), [15, 16, 14]); * * ``` * * @example Add a number to each element of a matrix * ```ts * import { assertEquals } from "jsr:@std/assert"; * * assertEquals(plus(10, [[5, 6], [3, 4]]), [[15, 16], [13, 14]]); * * ``` * * @example Add two matrices element-wise * ```ts * import { assertEquals } from "jsr:@std/assert"; * * assertEquals(plus([[5, 6], [3, 4]], [[2, 3], [1, 2]]), [[7, 9], [4, 6]]); * ``` */ export default function plus(x: array, y: number): array; /** * Addition X + Y. * * Adds two numbers, arrays, or matrices element-wise. Handles mixed inputs of scalars, arrays, and matrices. * * @param x The first operand, can be a number, array, or matrix. * @param y The second operand, can be a number, array, or matrix. * @returns The result of adding `x` and `y`. * @throws If the input dimensions do not agree or if no arguments are provided. * * @example Add two numbers * ```ts * import { assertEquals } from "jsr:@std/assert"; * * assertEquals(plus(5, 6), 11); * * ``` * * @example Add two arrays element-wise * ```ts * import { assertEquals } from "jsr:@std/assert"; * * assertEquals(plus([5, 6, 4], [3, -1, 0]), [8, 5, 4]); * * ``` * * @example Add a number to each element of an array * ```ts * import { assertEquals } from "jsr:@std/assert"; * * assertEquals(plus([5, 6, 4], 10), [15, 16, 14]); * * ``` * * @example Add a number to each element of a matrix * ```ts * import { assertEquals } from "jsr:@std/assert"; * * assertEquals(plus(10, [[5, 6], [3, 4]]), [[15, 16], [13, 14]]); * * ``` * * @example Add two matrices element-wise * ```ts * import { assertEquals } from "jsr:@std/assert"; * * assertEquals(plus([[5, 6], [3, 4]], [[2, 3], [1, 2]]), [[7, 9], [4, 6]]); * ``` */ export default function plus(x: array, y: array): array; /** * Addition X + Y. * * Adds two numbers, arrays, or matrices element-wise. Handles mixed inputs of scalars, arrays, and matrices. * * @param x The first operand, can be a number, array, or matrix. * @param y The second operand, can be a number, array, or matrix. * @returns The result of adding `x` and `y`. * @throws If the input dimensions do not agree or if no arguments are provided. * * @example Add two numbers * ```ts * import { assertEquals } from "jsr:@std/assert"; * * assertEquals(plus(5, 6), 11); * * ``` * * @example Add two arrays element-wise * ```ts * import { assertEquals } from "jsr:@std/assert"; * * assertEquals(plus([5, 6, 4], [3, -1, 0]), [8, 5, 4]); * * ``` * * @example Add a number to each element of an array * ```ts * import { assertEquals } from "jsr:@std/assert"; * * assertEquals(plus([5, 6, 4], 10), [15, 16, 14]); * * ``` * * @example Add a number to each element of a matrix * ```ts * import { assertEquals } from "jsr:@std/assert"; * * assertEquals(plus(10, [[5, 6], [3, 4]]), [[15, 16], [13, 14]]); * * ``` * * @example Add two matrices element-wise * ```ts * import { assertEquals } from "jsr:@std/assert"; * * assertEquals(plus([[5, 6], [3, 4]], [[2, 3], [1, 2]]), [[7, 9], [4, 6]]); * ``` */ export default function plus(x: number, y: matrix): matrix; /** * Addition X + Y. * * Adds two numbers, arrays, or matrices element-wise. Handles mixed inputs of scalars, arrays, and matrices. * * @param x The first operand, can be a number, array, or matrix. * @param y The second operand, can be a number, array, or matrix. * @returns The result of adding `x` and `y`. * @throws If the input dimensions do not agree or if no arguments are provided. * * @example Add two numbers * ```ts * import { assertEquals } from "jsr:@std/assert"; * * assertEquals(plus(5, 6), 11); * * ``` * * @example Add two arrays element-wise * ```ts * import { assertEquals } from "jsr:@std/assert"; * * assertEquals(plus([5, 6, 4], [3, -1, 0]), [8, 5, 4]); * * ``` * * @example Add a number to each element of an array * ```ts * import { assertEquals } from "jsr:@std/assert"; * * assertEquals(plus([5, 6, 4], 10), [15, 16, 14]); * * ``` * * @example Add a number to each element of a matrix * ```ts * import { assertEquals } from "jsr:@std/assert"; * * assertEquals(plus(10, [[5, 6], [3, 4]]), [[15, 16], [13, 14]]); * * ``` * * @example Add two matrices element-wise * ```ts * import { assertEquals } from "jsr:@std/assert"; * * assertEquals(plus([[5, 6], [3, 4]], [[2, 3], [1, 2]]), [[7, 9], [4, 6]]); * ``` */ export default function plus(x: matrix, y: number): matrix; /** * Addition X + Y. * * Adds two numbers, arrays, or matrices element-wise. Handles mixed inputs of scalars, arrays, and matrices. * * @param x The first operand, can be a number, array, or matrix. * @param y The second operand, can be a number, array, or matrix. * @returns The result of adding `x` and `y`. * @throws If the input dimensions do not agree or if no arguments are provided. * * @example Add two numbers * ```ts * import { assertEquals } from "jsr:@std/assert"; * * assertEquals(plus(5, 6), 11); * * ``` * * @example Add two arrays element-wise * ```ts * import { assertEquals } from "jsr:@std/assert"; * * assertEquals(plus([5, 6, 4], [3, -1, 0]), [8, 5, 4]); * * ``` * * @example Add a number to each element of an array * ```ts * import { assertEquals } from "jsr:@std/assert"; * * assertEquals(plus([5, 6, 4], 10), [15, 16, 14]); * * ``` * * @example Add a number to each element of a matrix * ```ts * import { assertEquals } from "jsr:@std/assert"; * * assertEquals(plus(10, [[5, 6], [3, 4]]), [[15, 16], [13, 14]]); * * ``` * * @example Add two matrices element-wise * ```ts * import { assertEquals } from "jsr:@std/assert"; * * assertEquals(plus([[5, 6], [3, 4]], [[2, 3], [1, 2]]), [[7, 9], [4, 6]]); * ``` */ export default function plus(x: matrix, y: matrix): matrix; //# sourceMappingURL=plus.d.ts.map