Class SymmetricQREigenHelper_FDRM
- java.lang.Object
-
- org.ejml.dense.row.decomposition.eig.symm.SymmetricQREigenHelper_FDRM
-
public class SymmetricQREigenHelper_FDRM extends java.lang.ObjectA helper class for the symmetric matrix implicit QR algorithm for eigenvalue decomposition. Performs most of the basic operations needed to extract eigenvalues and eigenvectors.
-
-
Field Summary
Fields Modifier and Type Field Description protected float[]diagprotected EigenvalueSmall_F32eigenSmallprotected intlastExceptionalprotected intNprotected intnumExceptionalprotected intnumSplitsprotected float[]offprotected org.ejml.data.FMatrixRMajQprotected java.util.Randomrandprotected int[]splitsprotected intstepsprotected intx1protected intx2
-
Constructor Summary
Constructors Constructor Description SymmetricQREigenHelper_FDRM()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description floatcomputeShift()floatcomputeWilkinsonShift()float[]copyDiag(float[] ret)float[]copyEigenvalues(float[] ret)float[]copyOff(float[] ret)protected voidcreateBulge(int x1, float p, boolean byAngle)Performs a similar transform on A-pIprotected voidcreateBulge2by2(int x1, float p, boolean byAngle)protected voideigenvalue2by2(int x1)Computes the eigenvalue of the 2 by 2 matrix.voidexceptionalShift()Perform a shift in a random direction that is of the same magnitude as the elements in the matrix.intgetMatrixSize()voidincrementSteps()voidinit(float[] diag, float[] off, int numCols)Sets up and declares internal data structures.protected booleanisZero(int index)Checks to see if the specified off diagonal element is zero using a relative metric.booleannextSplit()Tells it to process the submatrix at the next split.protected voidperformImplicitSingleStep(float lambda, boolean byAngle)voidprintMatrix()protected voidremoveBulge(int x1)protected voidremoveBulgeEnd(int x1)Rotator to remove the bulgevoidreset(int N)Sets the size of the matrix being decomposed, declares new memory if needed, and sets all helper functions to their initial value.voidresetSteps()voidsetQ(org.ejml.data.FMatrixRMaj q)voidsetSubmatrix(int x1, int x2)Sets which submatrix is being processed.float[]swapDiag(float[] diag)Exchanges the internal array of the diagonal elements for the provided one.float[]swapOff(float[] off)Exchanges the internal array of the off diagonal elements for the provided one.protected voidupdateQ(int m, int n, float c, float s)
-
-
-
Field Detail
-
rand
protected java.util.Random rand
-
steps
protected int steps
-
numExceptional
protected int numExceptional
-
lastExceptional
protected int lastExceptional
-
eigenSmall
protected EigenvalueSmall_F32 eigenSmall
-
Q
protected org.ejml.data.FMatrixRMaj Q
-
N
protected int N
-
diag
protected float[] diag
-
off
protected float[] off
-
x1
protected int x1
-
x2
protected int x2
-
splits
protected int[] splits
-
numSplits
protected int numSplits
-
-
Method Detail
-
printMatrix
public void printMatrix()
-
setQ
public void setQ(org.ejml.data.FMatrixRMaj q)
-
incrementSteps
public void incrementSteps()
-
init
public void init(float[] diag, float[] off, int numCols)Sets up and declares internal data structures.- Parameters:
diag- Diagonal elements from tridiagonal matrix. Modified.off- Off diagonal elements from tridiagonal matrix. Modified.numCols- number of columns (and rows) in the matrix.
-
swapDiag
public float[] swapDiag(float[] diag)
Exchanges the internal array of the diagonal elements for the provided one.
-
swapOff
public float[] swapOff(float[] off)
Exchanges the internal array of the off diagonal elements for the provided one.
-
reset
public void reset(int N)
Sets the size of the matrix being decomposed, declares new memory if needed, and sets all helper functions to their initial value.
-
copyDiag
public float[] copyDiag(float[] ret)
-
copyOff
public float[] copyOff(float[] ret)
-
copyEigenvalues
public float[] copyEigenvalues(float[] ret)
-
setSubmatrix
public void setSubmatrix(int x1, int x2)Sets which submatrix is being processed.- Parameters:
x1- Lower bound, inclusive.x2- Upper bound, inclusive.
-
isZero
protected boolean isZero(int index)
Checks to see if the specified off diagonal element is zero using a relative metric.
-
performImplicitSingleStep
protected void performImplicitSingleStep(float lambda, boolean byAngle)
-
updateQ
protected void updateQ(int m, int n, float c, float s)
-
createBulge
protected void createBulge(int x1, float p, boolean byAngle)Performs a similar transform on A-pI
-
createBulge2by2
protected void createBulge2by2(int x1, float p, boolean byAngle)
-
removeBulge
protected void removeBulge(int x1)
-
removeBulgeEnd
protected void removeBulgeEnd(int x1)
Rotator to remove the bulge
-
eigenvalue2by2
protected void eigenvalue2by2(int x1)
Computes the eigenvalue of the 2 by 2 matrix.
-
exceptionalShift
public void exceptionalShift()
Perform a shift in a random direction that is of the same magnitude as the elements in the matrix.
-
nextSplit
public boolean nextSplit()
Tells it to process the submatrix at the next split. Should be called after the current submatrix has been processed.
-
computeShift
public float computeShift()
-
computeWilkinsonShift
public float computeWilkinsonShift()
-
getMatrixSize
public int getMatrixSize()
-
resetSteps
public void resetSteps()
-
-