LFCCT

   more...

   more...
Estimates the condition number of a complex triangular matrix.
Required Arguments
A — Complex N by N matrix containing the triangular matrix. (Input)
For a lower triangular system, only the lower triangle of A is referenced. For an upper triangular system, only the upper triangle of A is referenced.
RCOND — Scalar containing an estimate of the reciprocal of the L1 condition number of A. (Output)
Optional Arguments
N — Number of equations. (Input)
Default: N = size (A,2).
LDA — Leading dimension of A exactly as specified in the dimension statement of the calling program. (Input)
Default: LDA = size (A,1).
IPATH — Path indicator. (Input)
IPATH = 1 means A is lower triangular.
IPATH = 2 means A is upper triangular.
Default: IPATH =1.
FORTRAN 90 Interface
Generic: CALL LFCCT (A, RCOND [,])
Specific: The specific interface names are S_LFCCT and D_LFCCT.
FORTRAN 77 Interface
Single: CALL LFCCT (N, A, LDA, IPATH, RCOND)
Double: The double precision name is DLFCCT.
ScaLAPACK Interface
Generic: CALL LFCCT (A0, RCOND [,])
Specific: The specific interface names are S_LFCCT and D_LFCCT.
See the ScaLAPACK Usage Notes below for a description of the arguments for distributed computing.
Description
Routine LFCCT estimates the condition number of a complex triangular matrix. The L1condition number of the matrix A is defined to be κ(A) = A1A-11. Since it is expensive to compute A-11, the condition number is only estimated. The estimation algorithm is the same as used by LINPACK and is described by Cline et al. (1979). If the estimated condition number is greater than 1/ɛ (where ɛ is machine precision), a warning error is issued. This indicates that very small changes in A can cause very large changes in the solution x. The underlying code is based on either LINPACK , LAPACK, or ScaLAPACK code depending upon which supporting libraries are used during linking. For a detailed explanation see Using ScaLAPACK, LAPACK, LINPACK, and EISPACK in the Introduction section of this manual.
Comments
1. Workspace may be explicitly provided, if desired, by use of L2CCT/DL2CCT. The reference is:
CALL L2CCT (N, A, LDA, IPATH, RCOND, CWK)
The additional argument is:
CWK — Complex work vector of length N.
2. Informational error
Type
Code
Description
3
1
The input triangular matrix is algorithmically singular.
ScaLAPACK Usage Notes
The arguments which differ from the standard version of this routine are:
A0MXLDA by MXCOL complex local matrix containing the local portions of the distributed matrix A. A contains the coefficient matrix of the triangular linear system. (Input)
For a lower triangular system, only the lower triangular part and diagonal of A are referenced. For an upper triangular system, only the upper triangular part and diagonal of A are referenced.
All other arguments are global and are the same as described for the standard version of the routine. In the argument descriptions above, MXLDA and MXCOL can be obtained through a call to SCALAPACK_GETDIM (see Utilities) after a call to SCALAPACK_SETUP (see Utilities) has been made. See the ScaLAPACK Example below.
Examples
Example
An estimate of the reciprocal condition number is computed for a 3 × 3 lower triangular coefficient matrix.
 
USE LFCCT_INT
USE UMACH_INT
! Declare variables
INTEGER LDA, N
PARAMETER (LDA=3)
INTEGER NOUT
REAL RCOND
COMPLEX A(LDA,LDA)
! Set values for A
!
! A = ( -3.0+2.0i )
! ( -2.0-1.0i 0.0+6.0i )
! ( -1.0+3.0i 1.0-5.0i -4.0+0.0i )
!
DATA A/(-3.0,2.0), (-2.0,-1.0), (-1.0, 3.0), (0.0,0.0), (0.0,6.0),&
(1.0,-5.0), (0.0,0.0), (0.0,0.0), (-4.0,0.0)/
!
! Compute the reciprocal condition
! number
CALL LFCCT (A, RCOND)
! Print results
CALL UMACH (2, NOUT)
WRITE (NOUT,99999) RCOND, 1.0E0/RCOND
99999 FORMAT (’ RCOND = ’,F5.3,/,’ L1 Condition number = ’,F6.3)
END
Output
 
RCOND < 0.2
L1 Condition number < 10.0
ScaLAPACK Example
The same lower triangular matrix as in the example above is used in this distributed computing example. An estimate of the reciprocal condition number is computed for a 3 × 3 lower triangular coefficient matrix. SCALAPACK_MAP and SCALAPACK_UNMAP are IMSL utility routines (see Chapter 11, “Utilities”) used to map and unmap arrays to and from the processor grid. They are used here for brevity. DESCINIT is a ScaLAPACK tools routine which initializes the descriptors for the local arrays.
 
USE MPI_SETUP_INT
USE LFCCT_INT
USE UMACH_INT
USE SCALAPACK_SUPPORT
IMPLICIT NONE
INCLUDE ‘mpif.h’
! Declare variables
INTEGER LDA, N, NOUT, DESCA(9)
INTEGER INFO, MXCOL, MXLDA
REAL RCOND
COMPLEX, ALLOCATABLE :: A(:,:)
COMPLEX, ALLOCATABLE :: A0(:,:)
PARAMETER (LDA=3, N=3)
! Set up for MPI
MP_NPROCS = MP_SETUP()
IF(MP_RANK .EQ. 0) THEN
ALLOCATE (A(LDA,N))
! Set values for A
A(1,:) = (/ (-3.0, 2.0), (0.0, 0.0), ( 0.0, 0.0)/)
A(2,:) = (/ (-2.0, -1.0), (0.0, 6.0), ( 0.0, 0.0)/)
A(3,:) = (/ (-1.0, 3.0), (1.0, -5.0), (-4.0, 0.0)/)
ENDIF
! Set up a 1D processor grid and define
! its context ID, MP_ICTXT
CALL SCALAPACK_SETUP(N, N, .TRUE., .TRUE.)
! Get the array descriptor entities MXLDA,
! and MXCOL
CALL SCALAPACK_GETDIM(N, N, MP_MB, MP_NB, MXLDA, MXCOL)
! Set up the array descriptor
CALL DESCINIT(DESCA, N, N, MP_MB, MP_NB, 0, 0, MP_ICTXT, MXLDA, INFO)
! Allocate space for the local arrays
ALLOCATE (A0(MXLDA,MXCOL))
! Map input arrays to the processor grid
CALL SCALAPACK_MAP(A, DESCA, A0)
! Compute the reciprocal condition
! number
CALL LFCCT (A0, RCOND)
! Print results.
! Only Rank=0 has the solution, RCOND.
IF (MP_RANK .EQ. 0) THEN
CALL UMACH (2, NOUT)
WRITE (NOUT,99999) RCOND, 1.0E0/RCOND
ENDIF
IF (MP_RANK .EQ. 0) DEALLOCATE(A)
DEALLOCATE(A0)
! Exit ScaLAPACK usage
CALL SCALAPACK_EXIT(MP_ICTXT)
! Shut down MPI
MP_NPROCS = MP_SETUP(‘FINAL’)
99999 FORMAT (’ RCOND = ’,F5.3,/,’ L1 Condition number = ’,F6.3)
END
Output
 
RCOND < 0.2
L1 Condition number < 10.0
Published date: 03/19/2020
Last modified date: 03/19/2020