UNPKG

ml-matrix

Version:

Matrix manipulation and computation library

20 lines (16 loc) 421 B
import { AbstractMatrix } from '../matrix'; export default class WrapperMatrix2D extends AbstractMatrix { constructor(data) { super(); this.data = data; this.rows = data.length; this.columns = data[0].length; } set(rowIndex, columnIndex, value) { this.data[rowIndex][columnIndex] = value; return this; } get(rowIndex, columnIndex) { return this.data[rowIndex][columnIndex]; } }