public class CommonsMatrixAlgebra extends MatrixAlgebra
| Constructor and Description |
|---|
CommonsMatrixAlgebra() |
| 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 real matrix raised to some real power
Currently this method is limited to symmetric matrices only as Commons Math does not
support the diagonalization of asymmetric matrices.
|
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)
MatrixAlgebragetCondition in class MatrixAlgebram - A matrix, not nullpublic double getDeterminant(Matrix m)
MatrixAlgebragetDeterminant in class MatrixAlgebram - A matrix, not nullpublic double getInnerProduct(Matrix m1, Matrix m2)
MatrixAlgebragetInnerProduct in class MatrixAlgebram1 - A vector, not nullm2 - A vector, not nullpublic DoubleMatrix getInverse(Matrix m)
MatrixAlgebragetInverse in class MatrixAlgebram - A matrix, not nullpublic double getNorm1(Matrix m)
MatrixAlgebraFor a matrix, returns the maximum absolute column sum norm of the matrix.
getNorm1 in class MatrixAlgebram - A vector or matrix, not nullpublic double getNorm2(Matrix m)
MatrixAlgebraFor a matrix, returns the spectral norm
getNorm2 in class MatrixAlgebram - A vector or matrix, not nullpublic double getNormInfinity(Matrix m)
MatrixAlgebraFor a matrix, returns the maximum absolute row sum norm
getNormInfinity in class MatrixAlgebram - a vector or a matrix, not nullpublic DoubleMatrix getOuterProduct(Matrix m1, Matrix m2)
MatrixAlgebragetOuterProduct in class MatrixAlgebram1 - A vector, not nullm2 - A vector, not nullpublic DoubleMatrix getPower(Matrix m, int p)
MatrixAlgebragetPower in class MatrixAlgebram - A square matrix, not nullp - An integer powerpublic DoubleMatrix getPower(Matrix m, double p)
getPower in class MatrixAlgebram - The symmetric matrix to take the power of.p - The power to raise to matrix topublic double getTrace(Matrix m)
MatrixAlgebragetTrace in class MatrixAlgebram - A matrix, not null. The matrix must be square.public DoubleMatrix getTranspose(Matrix m)
MatrixAlgebragetTranspose 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.Copyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.