public class ComplexLU extends Object implements Serializable, Cloneable
Complex
.
ComplexLU
performs an LU factorization
of a complex general coefficient matrix. ComplexLU
's method
condition
estimates the reciprocal of the \(L_1\)
condition number of the matrix. The LU factorization is done using
scaled partial pivoting. Scaled partial pivoting differs from partial
pivoting in that the pivoting strategy is the same as if each row were
scaled to have the same infinity norm.
The \(L_1\) condition number of the matrix A is defined to be \(\kappa \left( A \right) = \left\| A \right\|_1 \left\| {A ^{-1}} \right\|_1\). Since it is expensive to compute \(\left\| {A^{-1}} \right\|_1\), the condition number is only estimated. The estimation algorithm is the same as used by LINPACK and is described by Cline et al. (1979).
Note that A is not retained for use by other methods of this
class, only the factorization of A is retained. Thus, A
is a required parameter to the condition
method.
An estimated condition number greater than \(1/\epsilon\)
(where \(\epsilon\) is machine precision) indicates that
very small changes in A can cause very large changes
in the solution x. Iterative refinement can sometimes
find the solution to such a system. If there is conern about the input
matrix being ill-conditioned, the user of this class should check the
condition number of the input matrix using the condition
method
before using one of the other class methods.
ComplexLU
fails if U, the upper
triangular part of the factorization, has a zero diagonal element. This can
occur only if A either is singular or is very close to
a singular matrix.
The solve
method can be used to solve systems of equations.
The method determinant
can be called to compute the determinant of the
coefficient matrix.
ComplexLU is based on the LINPACK routine CGECO
; see Dongarra et al. (1979).
CGECO
uses unscaled partial pivoting.
Modifier and Type | Field and Description |
---|---|
protected Complex[][] |
factor
This is an n by n
Complex matrix containing
the LU factorization of the matrix A. |
protected int[] |
ipvt
Vector of length n containing the pivot sequence for the factorization.
|
Constructor and Description |
---|
ComplexLU(Complex[][] a)
Creates the LU factorization of a square matrix of type
Complex . |
Modifier and Type | Method and Description |
---|---|
double |
condition(Complex[][] a)
Return an estimate of the reciprocal of the \(L_1\) condition number.
|
Complex |
determinant()
Return the determinant of the matrix used to construct this instance.
|
Complex[][] |
getL()
Returns the lower triangular portion of the LU
factorization of A.
|
Complex[][] |
getPermutationMatrix()
Returns the permutation matrix which results from the
LU factorization of A.
|
Complex[][] |
getU()
Returns the unit upper triangular portion of the LU
factorization of A.
|
Complex[][] |
inverse()
Returns the inverse of the matrix used to construct this instance.
|
Complex[] |
solve(Complex[] b)
Return the solution x of the linear system Ax = b using the LU
factorization of A.
|
static Complex[] |
solve(Complex[][] a,
Complex[] b)
Solve Ax = b for x using the LU factorization of A.
|
Complex[] |
solveTranspose(Complex[] b)
Return the solution x of the linear system \(A^T x = b\).
|
protected Complex[][] factor
Complex
matrix containing
the LU factorization of the matrix A.protected int[] ipvt
public ComplexLU(Complex[][] a) throws SingularMatrixException
Complex
.a
- Complex
square matrix to be factoredIllegalArgumentException
- is thrown when
the row lengths of input matrix are not equal
(for example, the matrix edges are "jagged".)SingularMatrixException
- is thrown when
the input matrix is singular.public Complex[][] getL()
Scaled partial pivoting is used to achieve the LU
factorization. The resulting factorization is such that
\(AP = LU\), where A is the input matrix
a
, P is the permutation matrix returned by
getPermutationMatrix
, L is the lower triangular
matrix returned by getL
, and U is the unit upper
triangular matrix returned by getU
.
Complex
matrix containing L,
the lower triangular portion of the LU
factorization of A.public Complex[][] getU()
Scaled partial pivoting is used to achieve the LU
factorization. The resulting factorization is such that
\(AP = LU\), where A is the input matrix
a
, P is the permutation matrix returned by
getPermutationMatrix
, L is the lower triangular
matrix returned by getL
, and U is the unit upper
triangular matrix returned by getU
.
Complex
matrix containing U,
the unit upper triangular portion of the LU
factorization of A.public Complex[][] getPermutationMatrix()
Scaled partial pivoting is used to achieve the LU
factorization. The resulting factorization is such that
\(AP = LU\), where A is the input matrix
a
, P is the permutation matrix returned
by getPermutationMatrix
, L is the lower triangular
matrix returned by getL
, and U is the unit upper
triangular matrix returned by getU
.
Complex
matrix containing the permuted
identity matrix as a result of the LU factorization
of A.public Complex[] solve(Complex[] b)
b
- Complex
array containing the right-hand side of the linear systemComplex
array containing the solution to the linear system of
equationspublic Complex[] solveTranspose(Complex[] b)
b
- Complex
array containing the right-hand side of the linear systemComplex
array containing the solution to the linear system of
equationspublic Complex determinant()
Complex
scalar containing the determinant of the
matrix used to construct this instancepublic static Complex[] solve(Complex[][] a, Complex[] b) throws SingularMatrixException
a
- a Complex
square matrixb
- a Complex
column vectorComplex
column vector containing the solution to the linear
system of equations.IllegalArgumentException
- This exception is thrown when (1) the lengths of the
rows of the input matrix are not uniform, and (2) the
number of rows in the input matrix is not equal to the
number of elements in x.SingularMatrixException
- is thrown when the matrix is singular.public Complex[][] inverse()
Complex
matrix containing the inverse of the matrix used
to construct this object.public double condition(Complex[][] a)
a
- a Complex
matrixdouble
scalar value representing the estimate of the
reciprocal of the \(L_1\) condition number of the
matrix A, where A is the parameter a
Copyright © 2020 Rogue Wave Software. All rights reserved.