Package org.drip.numerical.linearsolver
Class LinearSystem
java.lang.Object
org.drip.numerical.linearsolver.LinearSystem
public class LinearSystem
extends java.lang.Object
LinearSystem implements the solver for a system of linear equations given by
A * x = B
where A is the matrix, x the set of variables, and B is the result to be solved for. It exports the
following functions:
- Row Regularization and Diagonal Pivoting
- Check for Diagonal Dominance
- Solving the linear system using any one of the following: Gaussian Elimination, Gauss Seidel reduction, or matrix inversion.
- Module = Computational Core Module
- Library = Numerical Analysis Library
- Project = Numerical Quadrature, Differentiation, Eigenization, Linear Algebra, and Utilities
- Package = Solvers of Linear Systems of Equations
- Author:
- Lakshmi Krishnamurthy
-
Constructor Summary
Constructors Constructor Description LinearSystem() -
Method Summary
Modifier and Type Method Description static booleanIsDiagonallyDominant(double[][] aadblA, boolean bCheckForStrongDominance)Check to see if the matrix is diagonally dominant.static double[]Pivot(double[][] aadblA, double[] adblB)Pivots the matrix A (Refer to wikipedia to find out what "pivot a matrix" means ;))static booleanRegulariseRow(double[][] aadblA, double[] adblSolution, int iInnerRow, int iOuter)Regularize (i.e., convert the diagonal entries of the given cell to non-zero using suitable linear transformations)static LinearizationOutputSolveUsingGaussianElimination(double[][] aadblAIn, double[] adblB)Solve the Linear System using Gaussian Elimination from the Set of Values in the Arraystatic LinearizationOutputSolveUsingGaussSeidel(double[][] aadblAIn, double[] adblB)Solve the Linear System using the Gauss-Seidel algorithm from the Set of Values in the Arraystatic LinearizationOutputSolveUsingMatrixInversion(double[][] aadblAIn, double[] adblB)Solve the Linear System using Matrix Inversion from the Set of Values in the ArrayMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
LinearSystem
public LinearSystem()
-
-
Method Details
-
RegulariseRow
public static final boolean RegulariseRow(double[][] aadblA, double[] adblSolution, int iInnerRow, int iOuter)Regularize (i.e., convert the diagonal entries of the given cell to non-zero using suitable linear transformations)- Parameters:
aadblA- In/Out Matrix to be regularizedadblSolution- In/out RHSiInnerRow- Matrix Cell Row that needs to be regularizediOuter- Matrix Cell Column that needs to be regularized- Returns:
- TRUE - Matrix has been successfully regularized
-
IsDiagonallyDominant
public static final boolean IsDiagonallyDominant(double[][] aadblA, boolean bCheckForStrongDominance)Check to see if the matrix is diagonally dominant.- Parameters:
aadblA- Input MatrixbCheckForStrongDominance- TRUE - Fail if the matrix is not strongly diagonally dominant.- Returns:
- TRUE - Strongly or weakly Diagonally Dominant
-
Pivot
public static final double[] Pivot(double[][] aadblA, double[] adblB)Pivots the matrix A (Refer to wikipedia to find out what "pivot a matrix" means ;))- Parameters:
aadblA- Input MatrixadblB- Input RHS- Returns:
- The pivoted input matrix and the re-jigged input RHS
-
SolveUsingMatrixInversion
public static final LinearizationOutput SolveUsingMatrixInversion(double[][] aadblAIn, double[] adblB)Solve the Linear System using Matrix Inversion from the Set of Values in the Array- Parameters:
aadblAIn- Input MatrixadblB- The Array of Values to be calibrated to- Returns:
- The Linear System Solution for the Coefficients
-
SolveUsingGaussianElimination
public static final LinearizationOutput SolveUsingGaussianElimination(double[][] aadblAIn, double[] adblB)Solve the Linear System using Gaussian Elimination from the Set of Values in the Array- Parameters:
aadblAIn- Input MatrixadblB- The Array of Values to be calibrated to- Returns:
- The Linear System Solution for the Coefficients
-
SolveUsingGaussSeidel
Solve the Linear System using the Gauss-Seidel algorithm from the Set of Values in the Array- Parameters:
aadblAIn- Input MatrixadblB- The Array of Values to be calibrated to- Returns:
- The Linear System Solution for the Coefficients
-