Comparing version 2.4.0-0 to 2.4.0-1
{ | ||
"name": "ml-matrix", | ||
"version": "2.4.0-0", | ||
"version": "2.4.0-1", | ||
"description": "Matrix manipulation and computation library", | ||
@@ -5,0 +5,0 @@ "main": "matrix.js", |
@@ -1575,15 +1575,2 @@ import LuDecomposition from './dc/lu'; | ||
/** | ||
* @private | ||
* Check that two matrices have the same dimensions | ||
* @param {Matrix} matrix | ||
* @param {Matrix} otherMatrix | ||
*/ | ||
function checkDimensions(matrix, otherMatrix) { // eslint-disable-line no-unused-vars | ||
if (matrix.rows !== otherMatrix.rows || | ||
matrix.columns !== otherMatrix.columns) { | ||
throw new RangeError('Matrices dimensions must be equal'); | ||
} | ||
} | ||
function compareNumbers(a, b) { | ||
@@ -1630,3 +1617,6 @@ return a - b; | ||
matrix = this.constructor.checkMatrix(matrix); | ||
checkDimensions(this, matrix); | ||
if (this.rows !== matrix.rows || | ||
this.columns !== matrix.columns) { | ||
throw new RangeError('Matrices dimensions must be equal'); | ||
} | ||
for (var i = 0; i < this.rows; i++) { | ||
@@ -1698,3 +1688,6 @@ for (var j = 0; j < this.columns; j++) { | ||
matrix = this.constructor.checkMatrix(matrix); | ||
checkDimensions(this, matrix); | ||
if (this.rows !== matrix.rows || | ||
this.columns !== matrix.columns) { | ||
throw new RangeError('Matrices dimensions must be equal'); | ||
} | ||
for (var i = 0; i < this.rows; i++) { | ||
@@ -1735,8 +1728,8 @@ for (var j = 0; j < this.columns; j++) { | ||
var i; | ||
var eval2 = eval; | ||
for (var operator of operators) { | ||
var inplaceOp = eval(fillTemplateFunction(inplaceOperator, {name: operator[1], op: operator[0]})); | ||
var inplaceOpS = eval(fillTemplateFunction(inplaceOperatorScalar, {name: operator[1] + 'S', op: operator[0]})); | ||
var inplaceOpM = eval(fillTemplateFunction(inplaceOperatorMatrix, {name: operator[1] + 'M', op: operator[0]})); | ||
var staticOp = eval(fillTemplateFunction(staticOperator, {name: operator[1]})); | ||
var inplaceOp = eval2(fillTemplateFunction(inplaceOperator, {name: operator[1], op: operator[0]})); | ||
var inplaceOpS = eval2(fillTemplateFunction(inplaceOperatorScalar, {name: operator[1] + 'S', op: operator[0]})); | ||
var inplaceOpM = eval2(fillTemplateFunction(inplaceOperatorMatrix, {name: operator[1] + 'M', op: operator[0]})); | ||
var staticOp = eval2(fillTemplateFunction(staticOperator, {name: operator[1]})); | ||
for (i = 1; i < operator.length; i++) { | ||
@@ -1763,4 +1756,4 @@ Matrix.prototype[operator[i]] = inplaceOp; | ||
for (var method of methods) { | ||
var inplaceMeth = eval(fillTemplateFunction(inplaceMethod, {name: method[1], method: method[0]})); | ||
var staticMeth = eval(fillTemplateFunction(staticMethod, {name: method[1]})); | ||
var inplaceMeth = eval2(fillTemplateFunction(inplaceMethod, {name: method[1], method: method[0]})); | ||
var staticMeth = eval2(fillTemplateFunction(staticMethod, {name: method[1]})); | ||
for (i = 1; i < method.length; i++) { | ||
@@ -1782,3 +1775,3 @@ Matrix.prototype[method[i]] = inplaceMeth; | ||
if (methodWithArg[1] !== 1) { | ||
var inplaceMethWithArgs = eval(fillTemplateFunction(inplaceMethodWithArgs, { | ||
var inplaceMethWithArgs = eval2(fillTemplateFunction(inplaceMethodWithArgs, { | ||
name: methodWithArg[2], | ||
@@ -1788,3 +1781,3 @@ method: methodWithArg[0], | ||
})); | ||
var staticMethWithArgs = eval(fillTemplateFunction(staticMethodWithArgs, {name: methodWithArg[2], args: args})); | ||
var staticMethWithArgs = eval2(fillTemplateFunction(staticMethodWithArgs, {name: methodWithArg[2], args: args})); | ||
for (i = 2; i < methodWithArg.length; i++) { | ||
@@ -1800,6 +1793,6 @@ Matrix.prototype[methodWithArg[i]] = inplaceMethWithArgs; | ||
}; | ||
var inplaceMethod2 = eval(fillTemplateFunction(inplaceMethodWithOneArg, tmplVar)); | ||
var inplaceMethodS = eval(fillTemplateFunction(inplaceMethodWithOneArgScalar, tmplVar)); | ||
var inplaceMethodM = eval(fillTemplateFunction(inplaceMethodWithOneArgMatrix, tmplVar)); | ||
var staticMethod2 = eval(fillTemplateFunction(staticMethodWithOneArg, tmplVar)); | ||
var inplaceMethod2 = eval2(fillTemplateFunction(inplaceMethodWithOneArg, tmplVar)); | ||
var inplaceMethodS = eval2(fillTemplateFunction(inplaceMethodWithOneArgScalar, tmplVar)); | ||
var inplaceMethodM = eval2(fillTemplateFunction(inplaceMethodWithOneArgMatrix, tmplVar)); | ||
var staticMethod2 = eval2(fillTemplateFunction(staticMethodWithOneArg, tmplVar)); | ||
for (i = 2; i < methodWithArg.length; i++) { | ||
@@ -1806,0 +1799,0 @@ Matrix.prototype[methodWithArg[i]] = inplaceMethod2; |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2
258142
7189