Class ComplexBackSolver

java.lang.Object
org.flag4j.linalg.solvers.exact.triangular.BackSolver<CMatrix,CVector,Complex128[]>
org.flag4j.linalg.solvers.exact.triangular.ComplexBackSolver
All Implemented Interfaces:
LinearMatrixSolver<CMatrix,CVector>, LinearSolver<CMatrix>

public class ComplexBackSolver extends BackSolver<CMatrix,CVector,Complex128[]>
This solver solves linear systems of equations where the coefficient matrix in an upper triangular complex dense matrix and the constant vector is a complex dense vector.
  • Field Details

    • det

      protected Complex128 det
      For computing determinant of coefficient matrix during solve.
  • Constructor Details

    • ComplexBackSolver

      public ComplexBackSolver()
      Creates a solver for solving linear systems for upper triangular coefficient matrices. Note, by default no check will be made to ensure the coefficient matrix is upper triangular. If you would like to enforce this, see ComplexBackSolver(boolean).
    • ComplexBackSolver

      public ComplexBackSolver(boolean enforceTriU)
      Creates a solver for solving linear systems for upper triangular coefficient matrices.
      Parameters:
      enforceTriU - Flag indicating if an explicit check should be made that the coefficient matrix is upper triangular.
  • Method Details

    • getDet

      public Complex128 getDet()
      Gets the determinant computed during the last solve.
    • solve

      public CVector solve(CMatrix U, CVector b)
      Solves the linear system of equations given by U*x=b where the coefficient matrix U is an upper triangular matrix.
      Parameters:
      U - Upper triangular coefficient matrix in the linear system. If U is not actually upper triangular, it will be treated as if it were.
      b - Vector of constants in the linear system.
      Returns:
      The solution to x in the linear system A*x=b.
      Throws:
      SingularMatrixException - If the matrix U is singular (i.e. if it has a zero along the principle diagonal).
    • solve

      public CMatrix solve(CMatrix U, CMatrix B)
      Solves the linear system of equations given by U*X=B where the coefficient matrix U is an upper triangular matrix.
      Parameters:
      U - Upper triangular coefficient matrix in the linear system. If U is not actually upper triangular, it will be treated as if it were.
      B - Matrix of constants in the linear system.
      Returns:
      The solution to X in the linear system A*X=B.
      Throws:
      SingularMatrixException - If the matrix U is singular (i.e. has a zero on the principle diagonal).
    • solveIdentity

      public CMatrix solveIdentity(CMatrix U)
      Solves the linear system of equations given by U*X=I where the coefficient matrix U is an upper triangular matrix and I is the identity matrix of appropriate size.
      Parameters:
      U - Upper triangular coefficient matrix in the linear system. If U is not actually upper triangular, it will be treated as if it were.
      Returns:
      The solution to X in the linear system U*X=B.
      Throws:
      SingularMatrixException - If the matrix U is singular (i.e. has a zero on the principle diagonal).
    • solveLower

      public CMatrix solveLower(CMatrix U, CMatrix L)
      Solves a special case of the linear system U*X=L for X where the coefficient matrix U is an upper triangular matrix and the constant matrix L is lower triangular.
      Parameters:
      U - Upper triangular coefficient matrix
      L - Lower triangular constant matrix.
      Returns:
      The result of solving the linear system U*X=L for the matrix X.