|
SuanShu, a Java numerical and statistical library | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.numericalmethod.suanshu.matrix.doubles.factorization.eigen.Eigen
public class Eigen
This class implements the eigenvalue decomposition of a matrix.
Given a square matrix A,
an eigenvalue λ and its associated eigenvector v are defined by
Av = λv
We first find the eigenvalue and then the eigenvector space by solving a system of homogeneous linear equations. That is,
(A - λ)v = 0
The eigen information is stored in the read-only structure Eigen.Property.
The keys are the eigenvalue.
TODO: Complex eigenvectors is not yet supported. Note that, for now, we compute eigenvectors only for real eigenvalue. Although we compute the complex eigenvalue, we do not compute the eigenvectors associated with them.
The R equivalent function is eigen.
| Nested Class Summary | |
|---|---|
static class |
Eigen.Method
the methods available to compute eigenvalue and eigenvectors |
static class |
Eigen.Property
Property contains the eigen information about a particular eigen value, such as its multiplicity and the associated eigen vectors. |
| Field Summary | |
|---|---|
double |
epsilon
a precision parameter: when a number |x| ≤ ε, it is considered 0 |
| Constructor Summary | |
|---|---|
Eigen(Matrix A)
Compute the eigenvalue and eigenvectors for a matrix. |
|
Eigen(Matrix A,
Eigen.Method method,
double epsilon)
Compute the eigenvalue and eigenvectors for a matrix. |
|
| Method Summary | |
|---|---|
DiagonalMatrix |
D()
Get a copy of the diagonal matrix D as in
Q %*% D %*% Q' = A
Note that we only support real eigenvalues for now. |
java.lang.Number |
eigenvalue(int i)
Get the i-th eigenvalue. |
NumberList |
eigenvalues()
Get all the eigenvalues. |
Eigen.Property |
getProperty(int i)
Get the i-th property. |
Eigen.Property |
property(java.lang.Number eigenvalue)
Get a Property object by its eigenvalue. |
Matrix |
Q()
Get a copy of Q as in
Q %*% D %*% Q' = A
Note that we only support real eigenvalues for now. |
Matrix |
Qt()
Get a copy of Q.t() as in
Q %*% D %*% Q' = A
Note that we only support real eigenvalues for now. |
double[] |
realEigenvalues()
Get the real eigenvalue. |
int |
size()
Get the number of distinct eigenvalue. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public final double epsilon
| Constructor Detail |
|---|
public Eigen(Matrix A,
Eigen.Method method,
double epsilon)
For each eigenvalue, we compute for its properties as in Eigen.Property.
There is no single eigenvector. There are infinitely many.
The set of eigenvectors forms a vector space.
Any linear combination of the eigen basis vectors qualifies as an eigenvector.
Note that, for now, this implementation computes the Eigen.Property only for real eigenvalue.
Although we compute the complex eigenvalue, we do not compute the eigenvectors associated with them.
A - a square matrixmethod - the eigen decomposition algorithm, c.f., Eigen.Methodepsilon - a precision parameter: when a number |x| ≤ ε, it is considered 0
java.lang.IllegalArgumentException - if A is not squarepublic Eigen(Matrix A)
A - a square matrix| Method Detail |
|---|
public DiagonalMatrix D()
EigenDecompositionD as in
Q %*% D %*% Q' = A
Note that we only support real eigenvalues for now.
D in interface EigenDecompositionDpublic Matrix Q()
EigenDecompositionQ as in
Q %*% D %*% Q' = A
Note that we only support real eigenvalues for now.
Q in interface EigenDecompositionQpublic Matrix Qt()
EigenDecompositionQ.t() as in
Q %*% D %*% Q' = A
Note that we only support real eigenvalues for now.
Qt in interface EigenDecompositionQ.t()public int size()
public java.lang.Number eigenvalue(int i)
The eigenvalues are sorted in ascending order.
i - the index, counting from 0
public NumberList eigenvalues()
public double[] realEigenvalues()
The eigenvalues are sorted in ascending order.
public Eigen.Property property(java.lang.Number eigenvalue)
Note that the number passed in must be exactly the same as the eigenvalue in binary representation. Passing in an approximate number (up to precision) will likely result in an unmatched error, i.e., a null object returned.
eigenvalue - an eigenvalue
public Eigen.Property getProperty(int i)
The properties are sorted in ascending order by their eigenvalues.
i - the index, counting from 0
|
SuanShu, a Java numerical and statistical library | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||