Skip to content

Commit

Permalink
Adds types for eigs function (#2216)
Browse files Browse the repository at this point in the history
* Adds types for eigs. fixes #2100

* adds space

* BigNumber[] fix
  • Loading branch information
andrebianchessi authored May 19, 2021
1 parent 593f998 commit abdd258
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1159,6 +1159,21 @@ declare namespace math {
*/
dot(x: MathArray | Matrix, y: MathArray | Matrix): number;

/**
* Compute eigenvalues and eigenvectors of a matrix.
* The eigenvalues are sorted by their absolute value, ascending.
* An eigenvalue with multiplicity k will be listed k times.
* The eigenvectors are returned as columns of a matrix – the eigenvector
* that belongs to the j-th eigenvalue in the list (eg. values[j]) is the
* j-th column (eg. column(vectors, j)). If the algorithm fails to converge,
* it will throw an error – in that case, however, you may still find useful
* information in err.values and err.vectors
* @param x Matrix to be diagonalized
* @param prec Precision, default value: 1e-15
* @returns Object containing an array of eigenvalues and a matrix with eigenvectors as columns.
*/
eigs(x: MathArray | Matrix, prec?:number|BigNumber): {values: MathArray | Matrix, vectors: MathArray | Matrix}

/**
* Compute the matrix exponential, expm(A) = e^A. The matrix must be
* square. Not to be confused with exp(a), which performs element-wise
Expand Down

0 comments on commit abdd258

Please sign in to comment.