UNPKG

es-next-tools

Version:

A comprehensive utility library for JavaScript and TypeScript that provides a wide range of functions for common programming tasks, including mathematical operations, date manipulations, array and object handling, string utilities, and more.

33 lines (32 loc) 1.04 kB
/** * Represents a matrix data structure. * @template T The type of elements in the matrix. */ export declare class Matrix<T> { private data; constructor(rows: number, cols: number); /** * Sets a value at a specific position in the matrix. * @param {number} row - The row index. * @param {number} col - The column index. * @param {T} value - The value to set. */ setValue(row: number, col: number, value: T): void; /** * Gets a value from a specific position in the matrix. * @param {number} row - The row index. * @param {number} col - The column index. * @returns {T | null} The value at the specified position, or null if out of bounds. */ getValue(row: number, col: number): T | null; /** * Returns the number of rows in the matrix. * @returns {number} The number of rows. */ getRows(): number; /** * Returns the number of columns in the matrix. * @returns {number} The number of columns. */ getCols(): number; }