ml-matrix
Version:
Matrix manipulation and computation library
21 lines (16 loc) • 451 B
JavaScript
import { checkRowIndex } from '../util';
import BaseView from './base';
export default class MatrixRowView extends BaseView {
constructor(matrix, row) {
checkRowIndex(matrix, row);
super(matrix, 1, matrix.columns);
this.row = row;
}
set(rowIndex, columnIndex, value) {
this.matrix.set(this.row, columnIndex, value);
return this;
}
get(rowIndex, columnIndex) {
return this.matrix.get(this.row, columnIndex);
}
}