|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object JSci.maths.AbstractMath JSci.maths.LinearMath
public final class LinearMath
The linear math library. This class cannot be subclassed or instantiated because all methods are static.
Method Summary | |
---|---|
static void |
diagonalizeSymmetric(AbstractDoubleSquareMatrix matrix)
Diagonalizes a symmetric matrix in-place. |
static double[] |
eigenSolveHermitian(AbstractComplexSquareMatrix matrix,
AbstractComplexVector[] eigenvector)
This method finds the eigenvalues and eigenvectors of a Hermitian matrix. |
static double[] |
eigenSolveSymmetric(AbstractDoubleSquareMatrix matrix,
AbstractDoubleVector[] eigenvector)
This method finds the eigenvalues and eigenvectors of a symmetric square matrix. |
static double[] |
eigenSolveSymmetric(DoubleTridiagonalMatrix matrix,
AbstractDoubleVector[] eigenvector)
This method finds the eigenvalues and eigenvectors of a symmetric tridiagonal matrix by the QL method. |
static double[] |
eigenvalueSolveHermitian(AbstractComplexSquareMatrix matrix)
This method finds the eigenvalues of a Hermitian matrix. |
static double[] |
eigenvalueSolveSymmetric(AbstractDoubleSquareMatrix matrix)
This method finds the eigenvalues of a symmetric square matrix. |
static double[] |
eigenvalueSolveSymmetric(AbstractDoubleSquareMatrix matrix,
AbstractDoubleVector initial,
int iters)
Finds the eigenvalues of a symmetric square matrix using the Lanczos method (with full reorthogonalization). |
static double[] |
eigenvalueSolveSymmetric(DoubleTridiagonalMatrix matrix)
This method finds the eigenvalues of a symmetric tridiagonal matrix by the QL method. |
static RealPolynomial |
leastSquaresFit(int n,
double[][] data)
Fits an nth degree polynomial to data using the method of least squares. |
static AbstractDoubleVector |
linearRegression(double[][] data)
Fits a line to multi-dimensional data using the method of least squares. |
static AbstractDoubleVector[] |
orthonormalize(AbstractDoubleVector[] vecs)
The Gram-Schmidt orthonormalization method. |
static AbstractDoubleVector |
solve(AbstractDoubleSquareMatrix M,
AbstractDoubleVector v)
Solves the linear system Mx=v. |
static AbstractDoubleVector |
solveGMRes(AbstractDoubleMatrix A,
AbstractDoubleVector b,
int max_iter,
double tol)
Solves the unsymmetric linear system Ax=b using the Generalized Minimum Residual method (doesn't require A to be nonsingular). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static AbstractDoubleVector solve(AbstractDoubleSquareMatrix M, AbstractDoubleVector v)
M
- a double square matrix.v
- a double vector.
public static AbstractDoubleVector solveGMRes(AbstractDoubleMatrix A, AbstractDoubleVector b, int max_iter, double tol) throws MaximumIterationsExceededException
max_iter
- maximum number of iterations.tol
- tolerance.
java.lang.IllegalArgumentException
- If either the tolerance
or the number of iterations is not positive.
Also, if an unexpected error occurs.
MaximumIterationsExceededException
- If it cannot
converge according to the given parameters.public static RealPolynomial leastSquaresFit(int n, double[][] data)
n
- the degree of the polynomial (>= 0).data
- [0][] contains the x-series,
[1][] contains the y-series.public static AbstractDoubleVector linearRegression(double[][] data)
data
- [0...n-1][] contains the x-series' (they must be linearly uncorrelated),
[n][] contains the y-series.
public static AbstractDoubleVector[] orthonormalize(AbstractDoubleVector[] vecs)
vecs
- a set of linearly independent vectors.
public static double[] eigenvalueSolveHermitian(AbstractComplexSquareMatrix matrix) throws MaximumIterationsExceededException
matrix
- a Hermitian matrix.
MaximumIterationsExceededException
- If it takes too many iterations to determine an eigenvalue.public static double[] eigenSolveHermitian(AbstractComplexSquareMatrix matrix, AbstractComplexVector[] eigenvector) throws MaximumIterationsExceededException
matrix
- a Hermitian matrix.eigenvector
- an empty array of complex vectors to hold the eigenvectors.
All eigenvectors will be orthogonal.
MaximumIterationsExceededException
- If it takes too many iterations to determine an eigenvalue.public static double[] eigenvalueSolveSymmetric(DoubleTridiagonalMatrix matrix) throws MaximumIterationsExceededException
matrix
- a double symmetric tridiagonal matrix.
MaximumIterationsExceededException
- If it takes too many iterations to determine an eigenvalue.public static double[] eigenSolveSymmetric(DoubleTridiagonalMatrix matrix, AbstractDoubleVector[] eigenvector) throws MaximumIterationsExceededException
matrix
- a double symmetric tridiagonal matrix.eigenvector
- an empty array of double vectors to hold the eigenvectors.
All eigenvectors will be orthogonal.
MaximumIterationsExceededException
- If it takes too many iterations to determine an eigenvalue.public static double[] eigenvalueSolveSymmetric(AbstractDoubleSquareMatrix matrix) throws MaximumIterationsExceededException
matrix
- a double symmetric square matrix.
MaximumIterationsExceededException
- If it takes too many iterations to determine an eigenvalue.public static double[] eigenSolveSymmetric(AbstractDoubleSquareMatrix matrix, AbstractDoubleVector[] eigenvector) throws MaximumIterationsExceededException
matrix
- a double symmetric square matrix.eigenvector
- an empty array of double vectors to hold the eigenvectors.
All eigenvectors will be orthogonal.
MaximumIterationsExceededException
- If it takes too many iterations to determine an eigenvalue.public static void diagonalizeSymmetric(AbstractDoubleSquareMatrix matrix) throws MaximumIterationsExceededException
matrix
- a double symmetric square matrix.
MaximumIterationsExceededException
public static double[] eigenvalueSolveSymmetric(AbstractDoubleSquareMatrix matrix, AbstractDoubleVector initial, int iters) throws MaximumIterationsExceededException
matrix
- a symmetric square matrixinitial
- initial starting vector. Must be normalized.iters
- number of iterations.
MaximumIterationsExceededException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |