UNPKG

linear-algebra

Version:

Efficient, high-performance linear algebra library

41 lines (25 loc) 615 B
Matrix.prototype.NAME = function(PARAM) { var thisData = this.data, rows = this.rows, cols = this.cols; var row, col, result = new Array(rows); for (row=0; row<rows; ++row) { result[row] = new Array(cols); for (col=0; col<cols; ++col) { result[row][col] = 'EXPR'; } } return new Matrix(result); }; Matrix.prototype.NAME_ = function(PARAM) { var thisData = this.data, rows = this.rows, cols = this.cols; var row, col; for (row=0; row<rows; ++row) { for (col=0; col<cols; ++col) { thisData[row][col] = 'EXPR'; } } return this; };