Skip to content

Commit

Permalink
Adding eigs function (#1705)
Browse files Browse the repository at this point in the history
* eigs test file initialize

* file for function for diagonalization of a real symmetrix matrix

* eigs typed function written according to mathjs requirements

* some linting issues addressed

* more linting issues in eigs

* linting passed for eigs (blank template function)

* making eigs fail

* eigs added to factory any

* initial check of input in eigs

* linting issues fix in eigs

* added rotation and theta matrix

* diagonalization loop added

* diagonalization result return

* diagonalization returns eigenvalue and eigenvectors

* function for updating Sij

* function for updating matrix

* a small bug fix

* some linting fixed in eigs

* lint and bug fix at eigs

* linting passed in eigs

* tests for input in eigs

* tests for trivial eigenvalue problem (sanity check)

* 2x2 check for non-diagonal matrix

* sorting added to eigs

* sorting function lint fix in eigs

* example for eigs updated

* 3x3 diagonalization by eigs passed

* bug in eigenvector

* eigenvalues seem to work

* cloning array so that original matrix do not get transformed in eigs

* eigenvector check

* eigenvector deep check and eigs description modified

* embedding dos for eigs

* doc for eigs fix

* slight change in example

* adding checkInput type

* type error for bad matrix elements

* type error for every element

* name change for typecheck function

* check matrix type of array input

* type error message update in eigs

* type error message grammer in eigs

* eigs bug fix

* eigs bug fix in check function

* eigs typecheck test

* some lint fix in eigs and corresponding tests

* before adding bingNumber implementation in eigs

* support for fractions

* obtain angle for bigNumber type

* theta for bignumbers

* update overlap for bigNumber

* jacobi rotation of input matrix for BigNumbers

* largest element for bigNumbers

* diagonalization for bigNumbers

* adding dependedncies

* diagonization for bigNumber

* diag for bigNumber is tested

* linting fix for eig and eigs test

* problem for bigNumber fix

* error message modification for eigs

* more coverage for eigs function

* eigs test bug fix

* simplify test

* is Symmetric function

* use matrix instead in eigs

* slight cleanup

* is symmetric bug fix

* no need to return in isSymmetrix

* small bug fix for fractions

* using scalar function when possible

* small lint correction

* return object in eigs

* bug fix in array eigs

* test object implementation

* description update

Co-authored-by: Jos de Jong <wjosdejong@gmail.com>
  • Loading branch information
arkajitmandal and josdejong committed Jan 20, 2020
1 parent af42bb5 commit 0b188e3
Show file tree
Hide file tree
Showing 5 changed files with 488 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/expression/embeddedDocs/embeddedDocs.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ import { floorDocs } from './function/arithmetic/floor'
import { fixDocs } from './function/arithmetic/fix'
import { expm1Docs } from './function/arithmetic/expm1'
import { expmDocs } from './function/arithmetic/expm'
import { eigsDocs } from './function/matrix/eigs'
import { expDocs } from './function/arithmetic/exp'
import { dotMultiplyDocs } from './function/arithmetic/dotMultiply'
import { dotDivideDocs } from './function/arithmetic/dotDivide'
Expand Down Expand Up @@ -409,6 +410,7 @@ export const embeddedDocs = {
flatten: flattenDocs,
forEach: forEachDocs,
inv: invDocs,
eigs: eigsDocs,
kron: kronDocs,
map: mapDocs,
ones: onesDocs,
Expand Down
14 changes: 14 additions & 0 deletions src/expression/embeddedDocs/function/matrix/eigs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
export const eigsDocs = {
name: 'eigs',
category: 'Matrix',
syntax: [
'eigs(x)'
],
description: 'Calculate the eigenvalues and eigenvectors of a real symmetric matrix',
examples: [
'eigs([[5, 2.3], [2.3, 1]])'
],
seealso: [
'inv'
]
}
1 change: 1 addition & 0 deletions src/factoriesAny.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ export { createHelp } from './expression/function/help'
export { createChain } from './type/chain/function/chain'
export { createDet } from './function/matrix/det'
export { createInv } from './function/matrix/inv'
export { createEigs } from './function/matrix/eigs'
export { createExpm } from './function/matrix/expm'
export { createSqrtm } from './function/matrix/sqrtm'
export { createDivide } from './function/arithmetic/divide'
Expand Down
Loading

0 comments on commit 0b188e3

Please sign in to comment.