Skip to content

Commit

Permalink
add necessary package
Browse files Browse the repository at this point in the history
  • Loading branch information
lidangzzz committed Aug 28, 2021
1 parent 0daa5e4 commit 3ea8487
Show file tree
Hide file tree
Showing 13 changed files with 6,822 additions and 183 deletions.
6,665 changes: 6,653 additions & 12 deletions packages/hedgehog-core/package-lock.json

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions packages/hedgehog-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
"esbuild-loader": "^2.9.1",
"gpu.js": "^2.9.5",
"mathjs": "^7.1.0",
"ml-hclust": "^3.0.0",
"ml-matrix": "^6.8.0",
"ml-pca": "^4.0.2",
"ml-regression-simple-linear": "^2.0.3",
"nerdamer": "^1.1.5",
"sync-fetch": "^0.3.0",
"webpack": "^5.21.2",
Expand Down
6 changes: 3 additions & 3 deletions packages/hedgehog-core/src/lib/algebra.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export class Chol {
const n = A.rows;

//matrix L
let L = new Mat().zeros(n, n);
const L = new Mat().zeros(n, n);

//iteration
for (let i = 0; i < n; i++) {
Expand Down Expand Up @@ -41,7 +41,7 @@ export class LU {
U: Mat;
P: Mat;
constructor(A: Mat) {
let result = lup(A.val);
const result = lup(A.val);
this.L = new Mat(result.L as any);
this.U = new Mat(result.U as any);
this.P = new Mat(result.P);
Expand All @@ -53,7 +53,7 @@ export class QR {
Q: Mat;
R: Mat;
constructor(A: Mat) {
let result = qr(A.val);
const result = qr(A.val);
this.Q = new Mat(result.Q as any);
this.R = new Mat(result.R as any);
}
Expand Down
4 changes: 2 additions & 2 deletions packages/hedgehog-core/src/lib/mathlib.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Mat } from './matrix';

function to_matrix(A: Mat | number[][] | number[] | number): Mat {
function to_matrix(A: Mat | number[][] | number[] | number): Mat {
if (A instanceof Mat) {
return A.clone();
}
Expand Down Expand Up @@ -110,5 +110,5 @@ export default {
tan,
tanh,
pow,
round,
round
};
Loading

0 comments on commit 3ea8487

Please sign in to comment.