Maths Package

The matrix and vector classes support three different variable types. These are integer (for speed), double (for accuracy) and complex. There is a hierarchy of matrix classes that encapsulate the four common kinds of matrices; diagonal, tridiagonal, NxN square and the general NxM matrix. Using the appropriate matrix class is important as some matrix operations are defined only for a particular class. Also the diagonal and tridiagonal matrices have reduced memory usage and speed optimised matrix operations.

The VectorMath and MatrixMath classes house all the vector and matrix operations. Using methods on mixed matrices is made possible by inheritance. For example, if you want to add a diagonal matrix to a square matrix, then you need to cast the diagonal matrix up to a square matrix.

DoubleDiagonalMatrix diag;
DoubleSquareMatrix sqr,ans;
.
.
.
ans=MatrixMath.add((DoubleSquareMatrix)diag,sqr);

Release Notes

MatrixMath.LUDecomposition
This method does not use any pivoting so may be unstable with some matrices.

Return to the Developer's Guide contents.