@CodeReview(reviewer="Jonathan McClain",date="2006-05-16",changesNeeded=true,comments={"Comments indicated by triple slashes","Some refactoring needed here.","Another review needed after refactoring."},response={@CodeReviewResponse(respondent="Kevin R. Dixon",date="2006-05-17",moreChangesNeeded=true,comments="Fixes from J.T.\'s code review"),@CodeReviewResponse(respondent="Jonathan McClain",date="2006-05-17",moreChangesNeeded=false,comments="Rechecking after changes were made. Looks good now.")}) public abstract class AbstractEigenDecomposition extends java.lang.Object implements EigenDecomposition
Modifier | Constructor and Description |
---|---|
protected |
AbstractEigenDecomposition(ComplexNumber[] eigenValues,
Matrix eigenVectorsRealPart,
Matrix eigenVectorsImaginaryPart)
Stores the given eigenvalues and eigenvectors internally, the eigenvalues
and eigenvectors will not be sorted.
|
protected |
AbstractEigenDecomposition(ComplexNumber[] eigenValues,
Matrix eigenVectorsRealPart,
Matrix eigenVectorsImaginaryPart,
boolean sort)
Creates a new eigendecomposition using the given eigenvalues and
eigenvectors...
|
Modifier and Type | Method and Description |
---|---|
ComplexNumber |
getEigenValue(int index)
gets the indexed eigenvalue
|
ComplexNumber[] |
getEigenValues()
Getter for eigenValues
|
Matrix |
getEigenVectorsImaginaryPart()
gets the imaginary part of the eienvector, where the ith eigenvector is the
ith column
|
Matrix |
getEigenVectorsRealPart()
getter for eigenvectorsrealPart
|
ComplexNumber |
getLogDeterminant()
Computes the natural logarithm determinant from the collection of
eigenvalues
|
protected void |
setEigenDecomposition(ComplexNumber[] eigenValues,
Matrix eigenVectorsRealPart,
Matrix eigenVectorsImaginaryPart,
boolean sort)
Sets the eigen decomposition for this
|
protected void |
setEigenValues(ComplexNumber[] eigenValues)
setter for eigenValues
|
void |
setEigenVectorsImaginaryPart(Matrix eigenVectorsImaginaryPart)
setter for the imaginary part of the eienvector, where the ith eigenvector is
the ith column
|
protected void |
setEigenVectorsRealPart(Matrix eigenVectorsRealPart)
setter for eigenVectorsRealPart, where the ith eigenvector is the ith column
|
protected void |
setUnsortedEigenDecomposition(ComplexNumber[] eigenValues,
Matrix eigenVectorsRealPart,
Matrix eigenVectorsImaginaryPart)
Creates a new eigendecomposition using the given eigenvalues and
eigenvectors...
|
protected void |
sortAndSetEigenDecomposition(ComplexNumber[] eigenValues,
Matrix eigenVectorsRealPart,
Matrix eigenVectorsImaginaryPart)
Sorts the eigendecomposition in descending order of the value of the
magnitudes of the eigenvalues
|
protected AbstractEigenDecomposition(ComplexNumber[] eigenValues, Matrix eigenVectorsRealPart, Matrix eigenVectorsImaginaryPart)
eigenValues
- array of complex-valued eigenvalueeigenVectorsRealPart
- matrix of the real parts of the eigenvectorseigenVectorsImaginaryPart
- matrix of the imaginary parts of the eigenvectorsprotected AbstractEigenDecomposition(ComplexNumber[] eigenValues, Matrix eigenVectorsRealPart, Matrix eigenVectorsImaginaryPart, boolean sort)
eigenValues
- array of complex-valued eigenvalues to storeeigenVectorsRealPart
- matrix where the ith column of the matrix
contains the real part of the ith eigenvector of the
underlying matrixeigenVectorsImaginaryPart
- matrix where the ith column of the
matrix contains the real part of the ith eigenvector of the
underlying matrixsort
- if true, then the constructor will sort the eigenvectors and
eigenvectors by descending magnitude of the eigenvalue. In
this case, eigenValues[0] will be the largest magnitude and
eigenVectors(:,0) is its corresponding eigenvector.protected void setEigenDecomposition(ComplexNumber[] eigenValues, Matrix eigenVectorsRealPart, Matrix eigenVectorsImaginaryPart, boolean sort)
eigenValues
- array of eigenvalues for the underlying matrixeigenVectorsRealPart
- real part of the eigenvectors for the underlying matrixeigenVectorsImaginaryPart
- imaginary part of the eigenvalues for the underlying matrixsort
- true to sort eigen values/vectors by descending order of magnitude of the
eigenvaluesprotected void sortAndSetEigenDecomposition(ComplexNumber[] eigenValues, Matrix eigenVectorsRealPart, Matrix eigenVectorsImaginaryPart)
eigenValues
- array of eigenvalues for the underlying matrixeigenVectorsRealPart
- real part of the eigenvectors for the underlying matrixeigenVectorsImaginaryPart
- imaginary part of the eigenvalues for the underlying matrixprotected void setUnsortedEigenDecomposition(ComplexNumber[] eigenValues, Matrix eigenVectorsRealPart, Matrix eigenVectorsImaginaryPart)
eigenValues
- array of eigenvalues for the underlying matrixeigenVectorsRealPart
- real part of the eigenvectors for the underlying matrixeigenVectorsImaginaryPart
- imaginary part of the eigenvalues for the underlying matrixpublic ComplexNumber[] getEigenValues()
getEigenValues
in interface EigenDecomposition
protected void setEigenValues(ComplexNumber[] eigenValues)
eigenValues
- eigenvalues to setpublic ComplexNumber getEigenValue(int index)
getEigenValue
in interface EigenDecomposition
index
- zero-based index into the eigenvalue arraypublic Matrix getEigenVectorsRealPart()
getEigenVectorsRealPart
in interface EigenDecomposition
protected void setEigenVectorsRealPart(Matrix eigenVectorsRealPart)
eigenVectorsRealPart
- real part of the eienvector, where the ith eigenvector is the ith columnpublic Matrix getEigenVectorsImaginaryPart()
getEigenVectorsImaginaryPart
in interface EigenDecomposition
public void setEigenVectorsImaginaryPart(Matrix eigenVectorsImaginaryPart)
eigenVectorsImaginaryPart
- imaginary part of the eienvector, where the ith eigenvector is the ith columnpublic ComplexNumber getLogDeterminant()
getLogDeterminant
in interface EigenDecomposition