public class LinearAlgebra extends Object
Constructor and Description 

LinearAlgebra() 
Modifier and Type  Method and Description 

static double[][] 
diag(double[] vector)
Generates a diagonal matrix with the input vector on its diagonal

double[][] 
exp(double[][] matrix)
Calculate the "matrix exponential" (expm).

org.apache.commons.math3.linear.RealMatrix 
exp(org.apache.commons.math3.linear.RealMatrix matrix)
Calculate the "matrix exponential" (expm).

static double[][] 
factorReduction(double[][] correlationMatrix,
int numberOfFactors)
Returns a correlation matrix which has rank < n and for which the first n factors agree with the factors of correlationMatrix.

static double[][] 
factorReductionUsingCommonsMath(double[][] correlationMatrix,
int numberOfFactors)
Returns a correlation matrix which has rank < n and for which the first n factors agree with the factors of correlationMatrix.

static double[][] 
getFactorMatrix(double[][] correlationMatrix,
int numberOfFactors)
Returns the matrix of the n Eigenvectors corresponding to the first n largest Eigenvalues of a correlation matrix.

static double[][] 
invert(double[][] matrix)
Returns the inverse of a given matrix.

static double[][] 
multMatrices(double[][] left,
double[][] right)
Multiplication of two matrices.

static double[][] 
pseudoInverse(double[][] matrix)
PseudoInverse of a matrix calculated in the least square sense.

static double[] 
solveLinearEquation(double[][] matrixA,
double[] b)
Find a solution of the linear equation A x = b where
A is an n x m  matrix given as double[n][m]
b is an m  vector given as double[m],
x is an n  vector given as double[n],

static double[] 
solveLinearEquationLeastSquare(double[][] matrix,
double[] vector)
Find a solution of the linear equation A x = b in the least square sense where
A is an n x m  matrix given as double[n][m]
b is an m  vector given as double[m],
x is an n  vector given as double[n],

static double[][] 
solveLinearEquationLeastSquare(double[][] matrix,
double[][] rhs)
Find a solution of the linear equation A X = B in the least square sense where
A is an n x m  matrix given as double[n][m]
B is an m x k  matrix given as double[m][k],
X is an n x k  matrix given as double[n][k],

static double[] 
solveLinearEquationSymmetric(double[][] matrix,
double[] vector)
Find a solution of the linear equation A x = b where
A is an symmetric n x n  matrix given as double[n][n]
b is an n  vector given as double[n],
x is an n  vector given as double[n],

static double[][] 
transpose(double[][] matrix)
Transpose a matrix

public static double[] solveLinearEquation(double[][] matrixA, double[] b)
matrixA
 The matrix A (left hand side of the linear equation).b
 The vector (right hand of the linear equation).public static double[][] invert(double[][] matrix)
matrix
 A matrix given as double[n][n].public static double[] solveLinearEquationSymmetric(double[][] matrix, double[] vector)
matrix
 The matrix A (left hand side of the linear equation).vector
 The vector b (right hand of the linear equation).public static double[] solveLinearEquationLeastSquare(double[][] matrix, double[] vector)
matrix
 The matrix A (left hand side of the linear equation).vector
 The vector b (right hand of the linear equation).public static double[][] solveLinearEquationLeastSquare(double[][] matrix, double[][] rhs)
matrix
 The matrix A (left hand side of the linear equation).rhs
 The matrix B (right hand of the linear equation).public static double[][] getFactorMatrix(double[][] correlationMatrix, int numberOfFactors)
correlationMatrix
 The given correlation matrix.numberOfFactors
 The requested number of factors (eigenvectors).public static double[][] factorReduction(double[][] correlationMatrix, int numberOfFactors)
correlationMatrix
 The given correlation matrix.numberOfFactors
 The requested number of factors (Eigenvectors).public static double[][] factorReductionUsingCommonsMath(double[][] correlationMatrix, int numberOfFactors)
correlationMatrix
 The given correlation matrix.numberOfFactors
 The requested number of factors (Eigenvectors).public double[][] exp(double[][] matrix)
matrix
 The given matrix.public org.apache.commons.math3.linear.RealMatrix exp(org.apache.commons.math3.linear.RealMatrix matrix)
matrix
 The given matrix.public static double[][] transpose(double[][] matrix)
matrix
 The given matrix.public static double[][] pseudoInverse(double[][] matrix)
matrix
 The given matrix A.public static double[][] diag(double[] vector)
vector
 The given matrix A.public static double[][] multMatrices(double[][] left, double[][] right)
left
 The matrix A.right
 The matrix BCopyright © 2019. All rights reserved.