public class OGMatrixAlgebra extends MatrixAlgebra
This includes only some of the multiplications.
For more advanced operations, such as calculating the inverse, use CommonsMatrixAlgebra.
| Constructor and Description |
|---|
OGMatrixAlgebra() |
| Modifier and Type | Method and Description |
|---|---|
double |
getCondition(Matrix m)
Returns the condition number of the matrix.
|
double |
getDeterminant(Matrix m)
Returns the determinant of the matrix.
|
double |
getInnerProduct(Matrix m1,
Matrix m2)
Returns the inner (or dot) product.
|
DoubleMatrix |
getInverse(Matrix m)
Returns the inverse (or pseudo-inverse) of the matrix.
|
double |
getNorm1(Matrix m)
For a vector, returns the $L_1$ norm
(also known as the Taxicab norm or Manhattan norm), i.e.
|
double |
getNorm2(Matrix m)
For a vector, returns $L_2$ norm (also known as the
Euclidean norm).
|
double |
getNormInfinity(Matrix m)
For a vector, returns the $L_\infty$ norm.
|
DoubleMatrix |
getOuterProduct(Matrix m1,
Matrix m2)
Returns the outer product.
|
DoubleMatrix |
getPower(Matrix m,
double p)
Returns a matrix raised to a power, $\mathbf{A}^3 = \mathbf{A}\mathbf{A}\mathbf{A}$.
|
DoubleMatrix |
getPower(Matrix m,
int p)
Returns a matrix raised to an integer power, e.g.
|
double |
getTrace(Matrix m)
Returns the trace (i.e.
|
DoubleMatrix |
getTranspose(Matrix m)
Returns the transpose of a matrix.
|
Matrix |
multiply(Matrix m1,
Matrix m2)
Multiplies two matrices.
|
add, divide, kroneckerProduct, matrixTransposeMultiplyMatrix, scale, subtractpublic double getCondition(Matrix m)
getCondition in class MatrixAlgebram - A matrix, not nullUnsupportedOperationException - alwayspublic double getDeterminant(Matrix m)
getDeterminant in class MatrixAlgebram - A matrix, not nullUnsupportedOperationException - alwayspublic double getInnerProduct(Matrix m1, Matrix m2)
getInnerProduct in class MatrixAlgebram1 - A vector, not nullm2 - A vector, not nullpublic DoubleMatrix getInverse(Matrix m)
getInverse in class MatrixAlgebram - A matrix, not nullUnsupportedOperationException - alwayspublic double getNorm1(Matrix m)
For a matrix, returns the maximum absolute column sum norm of the matrix.
getNorm1 in class MatrixAlgebram - A vector or matrix, not nullUnsupportedOperationException - alwayspublic double getNorm2(Matrix m)
For a matrix, returns the spectral norm This is only implemented for DoubleArray.
getNorm2 in class MatrixAlgebram - A vector or matrix, not nullIllegalArgumentException - If the matrix is not a DoubleArraypublic double getNormInfinity(Matrix m)
For a matrix, returns the maximum absolute row sum norm
getNormInfinity in class MatrixAlgebram - a vector or a matrix, not nullUnsupportedOperationException - alwayspublic DoubleMatrix getOuterProduct(Matrix m1, Matrix m2)
getOuterProduct in class MatrixAlgebram1 - A vector, not nullm2 - A vector, not nullpublic DoubleMatrix getPower(Matrix m, int p)
getPower in class MatrixAlgebram - A square matrix, not nullp - An integer powerUnsupportedOperationException - alwayspublic double getTrace(Matrix m)
getTrace in class MatrixAlgebram - A matrix, not null. The matrix must be square.public DoubleMatrix getTranspose(Matrix m)
getTranspose in class MatrixAlgebram - A matrix, not nullpublic Matrix multiply(Matrix m1, Matrix m2)
multiply in class MatrixAlgebram1 - The first matrix, not null.m2 - The second matrix, not null.public DoubleMatrix getPower(Matrix m, double p)
getPower in class MatrixAlgebram - A square matrix, not nullp - The powerUnsupportedOperationException - alwaysCopyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.