Comparing version 6.10.4 to 6.10.5
@@ -582,3 +582,3 @@ type MaybeMatrix = AbstractMatrix | ArrayLike<ArrayLike<number>>; | ||
*/ | ||
norm(type: 'frobenius' | 'max'): number; | ||
norm(type?: 'frobenius' | 'max'): number; | ||
@@ -585,0 +585,0 @@ /** |
{ | ||
"name": "ml-matrix", | ||
"version": "6.10.4", | ||
"version": "6.10.5", | ||
"description": "Matrix manipulation and computation library", | ||
@@ -25,3 +25,3 @@ "main": "matrix.js", | ||
"test": "npm run test-only && npm run eslint && npm run prettier", | ||
"test-only": "jest --coverage" | ||
"test-only": "vitest run --coverage" | ||
}, | ||
@@ -56,23 +56,24 @@ "repository": { | ||
"devDependencies": { | ||
"@babel/plugin-transform-modules-commonjs": "^7.17.9", | ||
"@rollup/plugin-commonjs": "^22.0.0", | ||
"@rollup/plugin-node-resolve": "^13.2.1", | ||
"@babel/plugin-transform-modules-commonjs": "^7.21.5", | ||
"@rollup/plugin-commonjs": "^24.1.0", | ||
"@rollup/plugin-node-resolve": "^15.0.2", | ||
"@rollup/plugin-terser": "^0.4.1", | ||
"@vitest/coverage-c8": "^0.31.0", | ||
"benchmark": "^2.1.4", | ||
"csv-parse": "^5.0.4", | ||
"eslint": "^8.14.0", | ||
"eslint-config-cheminfo": "^7.3.0", | ||
"jest": "^28.0.0", | ||
"csv-parse": "^5.3.10", | ||
"eslint": "^8.40.0", | ||
"eslint-config-cheminfo": "^8.2.0", | ||
"jest-matcher-deep-close-to": "^3.0.2", | ||
"mathjs": "^10.5.0", | ||
"mathjs": "^11.8.0", | ||
"ml-dataset-iris": "^1.2.1", | ||
"numeric": "^1.2.6", | ||
"prettier": "^2.6.2", | ||
"prettier": "^2.8.8", | ||
"pretty-hrtime": "^1.0.3", | ||
"rollup": "^2.70.2", | ||
"rollup-plugin-terser": "^7.0.2" | ||
"rollup": "^3.21.5", | ||
"vitest": "^0.31.0" | ||
}, | ||
"dependencies": { | ||
"is-any-array": "^2.0.0", | ||
"is-any-array": "^2.0.1", | ||
"ml-array-rescale": "^1.3.7" | ||
} | ||
} |
@@ -17,2 +17,3 @@ # ml-matrix | ||
[![build status][ci-image]][ci-url] | ||
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.5644534.svg)](https://doi.org/10.5281/zenodo.5644534) | ||
[![npm download][download-image]][download-url] | ||
@@ -19,0 +20,0 @@ |
@@ -501,2 +501,3 @@ import Matrix from '../matrix'; | ||
s = Math.abs(H.get(n, n - 1)) + Math.abs(H.get(n - 1, n - 2)); | ||
// eslint-disable-next-line no-multi-assign | ||
x = y = 0.75 * s; | ||
@@ -519,2 +520,3 @@ w = -0.4375 * s * s; | ||
exshift += s; | ||
// eslint-disable-next-line no-multi-assign | ||
x = y = w = 0.964; | ||
@@ -521,0 +523,0 @@ } |
@@ -806,14 +806,9 @@ import { isAnyArray } from 'is-any-array'; | ||
norm(type = 'frobenius') { | ||
let result = 0; | ||
if (type === 'max') { | ||
return this.max(); | ||
} else if (type === 'frobenius') { | ||
for (let i = 0; i < this.rows; i++) { | ||
for (let j = 0; j < this.columns; j++) { | ||
result = result + this.get(i, j) * this.get(i, j); | ||
} | ||
} | ||
return Math.sqrt(result); | ||
} else { | ||
throw new RangeError(`unknown norm type: ${type}`); | ||
switch (type) { | ||
case 'max': | ||
return this.max(); | ||
case 'frobenius': | ||
return Math.sqrt(this.dot(this)); | ||
default: | ||
throw new RangeError(`unknown norm type: ${type}`); | ||
} | ||
@@ -1083,8 +1078,8 @@ } | ||
// Crop output to the desired size (undo dynamic padding). | ||
let resultat = AbstractMatrix.zeros(2 * c11.rows, 2 * c11.columns); | ||
resultat = resultat.setSubMatrix(c11, 0, 0); | ||
resultat = resultat.setSubMatrix(c12, c11.rows, 0); | ||
resultat = resultat.setSubMatrix(c21, 0, c11.columns); | ||
resultat = resultat.setSubMatrix(c22, c11.rows, c11.columns); | ||
return resultat.subMatrix(0, rows - 1, 0, cols - 1); | ||
let result = AbstractMatrix.zeros(2 * c11.rows, 2 * c11.columns); | ||
result = result.setSubMatrix(c11, 0, 0); | ||
result = result.setSubMatrix(c12, c11.rows, 0); | ||
result = result.setSubMatrix(c21, 0, c11.columns); | ||
result = result.setSubMatrix(c22, c11.rows, c11.columns); | ||
return result.subMatrix(0, rows - 1, 0, cols - 1); | ||
} | ||
@@ -1127,4 +1122,4 @@ | ||
rescale(column, { | ||
min: min, | ||
max: max, | ||
min, | ||
max, | ||
output: column, | ||
@@ -1131,0 +1126,0 @@ }); |
Sorry, the diff of this file is too big to display
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
286
379188
17
10736
Updatedis-any-array@^2.0.1