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