The maths package contains the following sub-packages:
This interface defines some commonly used numbers. It is desirable to use these where possible as it removes the need to compute them, reducing numerical errors and processor time.
Complex functions are implemented as static methods.
This was done to improve code readability,
e.g. Complex.sin(z) rather than z.sin().
Tip: where possible use the constants defined in the Complex class. These numbers are already instantiated and will reduce memory usage.
The matrix and vector classes support three different numeric types. These are integer (for speed), double (for accuracy) and complex.
The square matrix classes introduce the following methods:
luDecompose)
Decomposes a matrix (M) into lower (L) and upper (U) triangular matrices, such that LU=M.
choleskyDecompose)
Similar to LU decomposition but with the addition property that U=LT. The matrix must be symmetric and positive definite for this to work correctly.
inverse)
Computes the inverse of a matrix using LU decomposition (M-1=U-1L-1).
The ExtraMath class contains methods that are not and should be available in java.lang.Math. These consist of the hyperbolic trigonometric functions.
This class contains methods for solving common linear algebra problems.
leastSquaresFit)
The method of least squares is used to fit an nth degree polynomial to some specified data. A vector is returned containing the polynomial's coefficients. These are in ascending degree order, i.e. c0 + c1 x + c2 x2 + ...
solve)
Solves a specified linear system for the unknown vector x. Requires the matrix to have first been decomposed into lower and upper triangular matrices. Either LU decomposition or Cholesky decomposition may be used.
eigen[value]SolveSymmetric)
Returns the eigenvalues and eigenvectors of a specified matrix.
The FourierMath class contains methods for performing the FFT and the inverse FFT of an array of data. Most uses will need to wrap the sort method around the FFT method to return the output in the correct ascending order.
MathVector
|
...Vector
|
------------------
| |
...3Vector ...SparseVector
Matrix
|
...Matrix
|
------------------------
| |
...SquareMatrix ...SparseMatrix
|
...TridiagonalMatrix
|
...DiagonalMatrix
This package contains classes that model several statistical distributions.
Contains some chaotic maps.
The discrete group classes represent elements using a,b,c,e notation (e=identity). The Lie group parent class uses complex square matrices to represent its elements. All Lie group sub-classes override the LieGroup class methods in such a way as to maintain the matrix representation, even though they themselves may use a different representation.
This package contains classes that encapsulate some common Lie algebras.
Return to the Developer's Guide contents.