Class LUDecomposition

java.lang.Object
me.autobot.lib.math.linalg.LUDecomposition

public class LUDecomposition extends Object
A LU Decomposition is a way of decomposing a matrix into the product of a lower triangular matrix and an upper triangular matrix.
  • Constructor Details

    • LUDecomposition

      public LUDecomposition(Matrix L, Matrix U)
      Creates a new LU Decomposition with the given lower triangular matrix and upper triangular matrix.
      Parameters:
      L - The lower triangular matrix.
      U - The upper triangular matrix.
    • LUDecomposition

      public LUDecomposition(Matrix a)
      Creates a new LU Decomposition with the given matrix.
      Parameters:
      a - The matrix to decompose.
  • Method Details

    • getL

      public Matrix getL()
      Gets the lower triangular matrix.
      Returns:
      The lower triangular matrix.
    • getU

      public Matrix getU()
      Gets the upper triangular matrix.
      Returns:
      The upper triangular matrix.
    • getP

      public Vector getP()
      Gets the permutation vector.
      Returns:
      The permutation vector.
    • invert

      public Matrix invert()
      Inverts the matrix.
      Returns:
      The inverted matrix.
    • solve

      public double[] solve(double[] b)
      Solves the system of linear equations Ax = b
      Parameters:
      b - The right-hand side of the equation.
      Returns:
      The solution to the system of linear equations.