Skip to content

Commit

Permalink
fix: update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
lpatiny committed Mar 7, 2024
1 parent e3e36fe commit 92f780a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,18 @@
},
"homepage": "https://github.com/mljs/direct#readme",
"devDependencies": {
"@babel/plugin-transform-modules-commonjs": "^7.21.2",
"@babel/plugin-transform-modules-commonjs": "^7.23.3",
"cheminfo-build": "^1.2.0",
"eslint": "^8.36.0",
"eslint-config-cheminfo": "^8.2.0",
"eslint": "^8.57.0",
"eslint-config-cheminfo": "^9.2.0",
"esm": "^3.2.25",
"jest": "^29.5.0",
"jest": "^29.7.0",
"jest-matcher-deep-close-to": "^3.0.2",
"prettier": "^2.8.7",
"rollup": "^3.20.2"
"prettier": "^3.2.5",
"rollup": "^4.12.1"
},
"dependencies": {
"ml-matrix": "^6.10.4",
"ml-spectra-processing": "^12.0.0"
"ml-matrix": "^6.11.0",
"ml-spectra-processing": "^14.2.0"
}
}
2 changes: 1 addition & 1 deletion src/__tests__/initialState.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function griewank(x) {
let s = 0;
let p = 1;
for (let i = 0; i < d; i++) {
s += Math.pow(x[i], 2) / Math.sqrt(4000);
s += x[i] ** 2 / Math.sqrt(4000);
p *= Math.cos(x[i] / Math.sqrt(i + 1));
}
let result = s - p + 1;
Expand Down
4 changes: 2 additions & 2 deletions src/__tests__/optimization.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ function griewank(x) {
let s = 0;
let p = 1;
for (let i = 0; i < d; i++) {
s += Math.pow(x[i], 2) / Math.sqrt(4000);
s += x[i] ** 2 / Math.sqrt(4000);
p *= Math.cos(x[i] / Math.sqrt(i + 1));
}
let result = s - p + 1;
Expand All @@ -77,7 +77,7 @@ function rastrigin(x) {
let d = x.length;
let s = 0;
for (let i = 0; i < d; i++) {
s += Math.pow(x[i], 2) - 10 * Math.cos(2 * Math.PI * x[i]);
s += x[i] ** 2 - 10 * Math.cos(2 * Math.PI * x[i]);
}
let result = 10 * d + s;
return result;
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export default function direct(
fCalls = 1,
smallerDistance = 0,
edgeSizes = [new Float64Array(n).fill(0.5)],
diagonalDistances = [Math.sqrt(n * Math.pow(0.5, 2))],
diagonalDistances = [Math.sqrt(n * 0.5 ** 2)],
functionValues = [bestCurrentValue],
differentDistances = diagonalDistances,
smallerValuesByDistance = [bestCurrentValue],
Expand Down

0 comments on commit 92f780a

Please sign in to comment.