Package linalg
Class Solvers
java.lang.Object
linalg.Solvers
This class contains methods for solving systems of linear equations.
-
Method Summary
Modifier and TypeMethodDescriptionstatic Vector
Performs back substitution for an upper triangular matrix R and a vector b.static Vector
forwardSolve(Matrix L, Vector b)
Performs forward substitution for a unit lower triangular matrix L and a vector b.static Vector
Solves a real or complex linear System of equations of from Ax=b for the vector x in an exact sense.static Vector
Solves a real or complex linear System of equations of from Ax=b for the vector x in an exact sense.static Vector[]
Solves multiple real or complex systems of equations with the same coefficient matrix.static Vector
Solves a real or complex linear System of equations of from Ax=b for the vector x in an exact sense.static Vector
Solves a real or complex linear System of equations of from Ax=b for the vector x in an exact sense.
-
Method Details
-
solve
Solves multiple real or complex systems of equations with the same coefficient matrix. That is, solves for the vector x in Ax=b for many different b vectors.- Parameters:
A
- - Coefficient matrix for system.b
- - List of constant vectors. If a row vector is passed, it will be implicitly converted to a column vector.- Returns:
-
solve
Solves a real or complex linear System of equations of from Ax=b for the vector x in an exact sense. Here A is the coefficient matrix and b is a vector of constants. This is done using the LUPQ factorization of A.- Parameters:
A
- - Coefficient Matrix for system.b
- - Vector of constants. If a row vector is passed, it will be implicitly converted to a column vector.- Returns:
- a column vector x that is the result of solving Ax=b.
-
solve
Solves a real or complex linear System of equations of from Ax=b for the vector x in an exact sense. Here A is the coefficient matrix and b is a vector of constants. This is done using the LUPQ factorization of A.- Parameters:
A
- - Coefficient Matrix for system.b
- - Vector of constants. If a row vector is passed, it will be implicitly converted to a column vector.- Returns:
- a column vector x that is the result of solving Ax=b.
-
solveQR
Solves a real or complex linear System of equations of from Ax=b for the vector x in an exact sense. Here A is the coefficient matrix and b is a vector of constants. This is done using the QR factorization of A.- Parameters:
A
- - coefficient Matrix for system.b
- - Vector of constants. If a row vector is passed, it will be implicitly converted to a column vector.- Returns:
- a column vector x that is the result of solving Ax=b.
-
solveQR
Solves a real or complex linear System of equations of from Ax=b for the vector x in an exact sense. Here A is the coefficient matrix and b is a vector of constants. This is done using the QR factorization of A.- Parameters:
A
- - Coefficient Matrix for system.b
- - Vector of constants. If a row vector is passed, it will be implicitly converted to a column vector.- Returns:
- a column vector x that is the result of solving Ax=b.
-
backSolve
Performs back substitution for an upper triangular matrix R and a vector b. That is, this method solves the system Rx=b where R is an upper triangular matrix.- Parameters:
b
- - Vector of constants.- Returns:
- Returns the result of back substitution on the linear System.
-
forwardSolve
Performs forward substitution for a unit lower triangular matrix L and a vector b. That is, this method solves the system Lx=b where L is unit lower triangular.- Parameters:
L
- - Unit Lower triangular matrixb
- - Vector of constants- Returns:
- Returns the result of forward substitution on the linear System.
-