Skip to content

Commit

Permalink
General eigenproblem algorithm (josdejong#1743)
Browse files Browse the repository at this point in the history
* split the eigs function into multiple algorithms

* moved checks and coersions to eigs.js, made them more robust

* fix little bugs, make im and re more robust

* Implemented matrix balancing algorithm

* fix typos

* a draft of reduction to Hessenberg matrix

* finished implementation of reduction to Hessenberg

* fix Hessenberg elimination for complex numbers

* implemented non-shifted explicit QR algorithm for real matrices

* implemented vector computation, won't work untill usolve is fixed

* refactored to match yarn lint

* some minor changes

* solve merge conflicts

* refactored and re-fixed josdejong#1789

* some old uncommited changes

* fix small problems introduced by merging

* done some polishing

* improved jsdoc description of eigs

* little changes in jsdoc

Co-authored-by: Jos de Jong <[email protected]>
  • Loading branch information
2 people authored and joshhansen committed Sep 16, 2021
1 parent 2591c83 commit 6d6b89a
Show file tree
Hide file tree
Showing 8 changed files with 1,004 additions and 314 deletions.
2 changes: 1 addition & 1 deletion src/function/arithmetic/norm.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ export const createNorm = /* #__PURE__ */ factory(
const tx = ctranspose(x)
const squaredX = multiply(tx, x)
const eigenVals = eigs(squaredX).values
const rho = eigenVals.get([eigenVals.size()[0] - 1])
const rho = eigenVals[eigenVals.length - 1]
return abs(sqrt(rho))
}

Expand Down
4 changes: 4 additions & 0 deletions src/function/complex/im.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ export const createIm = /* #__PURE__ */ factory(name, dependencies, ({ typed })
return x.mul(0)
},

Fraction: function (x) {
return x.mul(0)
},

Complex: function (x) {
return x.im
},
Expand Down
4 changes: 4 additions & 0 deletions src/function/complex/re.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ export const createRe = /* #__PURE__ */ factory(name, dependencies, ({ typed })
return x
},

Fraction: function (x) {
return x
},

Complex: function (x) {
return x.re
},
Expand Down
Loading

0 comments on commit 6d6b89a

Please sign in to comment.