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.




Author:
Lakshmi Krishnamurthy
  • Constructor Summary

    Constructors
    Constructor Description
    LinearSystem()  
  • Method Summary

    Modifier and Type Method Description
    static boolean IsDiagonallyDominant​(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 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)
    static LinearizationOutput SolveUsingGaussianElimination​(double[][] aadblAIn, double[] adblB)
    Solve the Linear System using Gaussian Elimination from the Set of Values in the Array
    static LinearizationOutput SolveUsingGaussSeidel​(double[][] aadblAIn, double[] adblB)
    Solve the Linear System using the Gauss-Seidel algorithm from the Set of Values in the Array
    static LinearizationOutput SolveUsingMatrixInversion​(double[][] aadblAIn, double[] adblB)
    Solve the Linear System using Matrix Inversion from the Set of Values in the Array

    Methods 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 regularized
      adblSolution - In/out RHS
      iInnerRow - Matrix Cell Row that needs to be regularized
      iOuter - 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 Matrix
      bCheckForStrongDominance - 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 Matrix
      adblB - 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 Matrix
      adblB - 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 Matrix
      adblB - The Array of Values to be calibrated to
      Returns:
      The Linear System Solution for the Coefficients
    • SolveUsingGaussSeidel

      public static final LinearizationOutput SolveUsingGaussSeidel​(double[][] aadblAIn, double[] adblB)
      Solve the Linear System using the Gauss-Seidel algorithm from the Set of Values in the Array
      Parameters:
      aadblAIn - Input Matrix
      adblB - The Array of Values to be calibrated to
      Returns:
      The Linear System Solution for the Coefficients