JMSLTM Numerical Library 4.0

com.imsl.math
Class ComplexLU

java.lang.Object
  extended bycom.imsl.math.ComplexLU
All Implemented Interfaces:
Cloneable, Serializable

public class ComplexLU
extends Object
implements Serializable, Cloneable

LU factorization of a matrix of type Complex.

ComplexLU performs an LU factorization of a complex general coefficient matrix. ComplexLU's method condition estimates the 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).

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.

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.

See Also:
Example, Serialized Form

Field Summary
protected  Complex[][] factor
          LU factorization of A with partial pivoting
protected  int[] ipvt
          Pivot sequence for the factorization
 
Constructor Summary
ComplexLU(Complex[][] a)
          Creates the LU factorization of a square matrix of type Complex.
 
Method Summary
 double condition(Complex[][] a)
          Return an estimate of the reciprocal of the L1 condition number.
 Complex determinant()
          Return the determinant of the matrix used to construct this instance.
 Complex[][] inverse()
          Compute the inverse of a matrix of type Complex.
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

factor

protected Complex[][] factor
LU factorization of A with partial pivoting


ipvt

protected int[] ipvt
Pivot sequence for the factorization

Constructor Detail

ComplexLU

public ComplexLU(Complex[][] a)
          throws SingularMatrixException
Creates the LU factorization of a square matrix of type Complex.

Parameters:
a - Complex square matrix to be factored
Throws:
IllegalArgumentException - 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.
Method Detail

condition

public double condition(Complex[][] a)
Return an estimate of the reciprocal of the L1 condition number.

Parameters:
a - a Complex matrix
Returns:
a double scalar value representing the estimate of the reciprocal of the L1 condition number of the matrix a

determinant

public Complex determinant()
Return the determinant of the matrix used to construct this instance.

Returns:
a Complex scalar containing the determinant of the matrix used to construct this instance

inverse

public Complex[][] inverse()
Compute the inverse of a matrix of type Complex.

Returns:
a Complex matrix containing the inverse of the matrix used to construct this object.

solve

public Complex[] solve(Complex[] b)
Return the solution x of the linear system Ax = b using the LU factorization of A.

Parameters:
b - Complex array containing the right-hand side of the linear system
Returns:
Complex array containing the solution to the linear system of equations

solve

public static Complex[] solve(Complex[][] a,
                              Complex[] b)
                       throws SingularMatrixException
Solve ax=b for x using the LU factorization of a.

Parameters:
a - a Complex square matrix
b - a Complex column vector
Returns:
a Complex column vector containing the solution to the linear system of equations.
Throws:
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.

solveTranspose

public Complex[] solveTranspose(Complex[] b)
Return the solution x of the linear system A^T x = b.

Parameters:
b - Complex array containing the right-hand side of the linear system
Returns:
Complex array containing the solution to the linear system of equations

JMSLTM Numerical Library 4.0

Copyright 1970-2006 Visual Numerics, Inc.
Built June 1 2006.