LSLCC

 


   more...

Solves a complex circulant linear system.

Required Arguments

A — Complex vector of length N containing the first row of the coefficient matrix. (Input)

B — Complex vector of length N containing the right-hand side of the linear system. (Input)

X — Complex vector of length N containing the solution of the linear system. (Output)

Optional Arguments

N — Order of the matrix represented by A. (Input)
Default: N = size (A,1).

IPATH — Integer flag. (Input)
IPATH = 1 means the system Ax = B is solved.
IPATH = 2 means the system ATx = B is solved.
Default: IPATH = 1.

FORTRAN 90 Interface

Generic: CALL LSLCC (A, B, X [])

Specific: The specific interface names are S_LSLCC and D_LSLCC.

FORTRAN 77 Interface

Single: CALL LSLCC (N, A, B, IPATH, X)

Double: The double precision name is DLSLCC.

Description

Circulant matrices have the property that each row is obtained by shifting the row above it one place to the right. Entries that are shifted off at the right re-enter at the left. For example,

 

If qk = p k and the subscripts on p and q are interpreted modulo N, then

 

where q * x is the convolution of q and x. By the convolution theorem, if q * x = b, then

 

is the discrete Fourier transform of q as computed by the IMSL routine FFTCF and denotes elementwise multiplication. By division,

 

where denotes elementwise division. The vector x is recovered from

 

through the use of IMSL routine FFTCB.

To solve AT x = b, use the vector p instead of q in the above algorithm.

Comments

1. Workspace may be explicitly provided, if desired, by use of L2LCC/DL2LCC. The reference is:

CALL L2LCC (N, A, B, IPATH, X, ACOPY, WK)

The additional arguments are as follows:

ACOPY — Complex work vector of length N. If A is not needed, then A and ACOPY may be the same.

WK — Work vector of length 6N + 15.

2. Informational error

 

Type

Code

Description

4

2

The input matrix is singular.

3. Because of the special structure of circulant matrices, the first row of a circulant matrix completely characterizes the matrix. Hence, only the elements A(1, 1), A(1, N) need to be stored.

Example

A system of four linear equations is solved. Note that only the first row of the matrix A is entered.

 

USE LSLCC_INT

USE WRCRN_INT

! Declare variables

INTEGER N

PARAMETER (N=4)

COMPLEX A(N), B(N), X(N)

! Set values for A, and B

!

! A = ( 2+2i -3+0i 1+4i 6-2i)

!

! B = (6+65i -41-10i -8-30i 63-3i)

!

DATA A/(2.0,2.0), (-3.0,0.0), (1.0,4.0), (6.0,-2.0)/

DATA B/(6.0,65.0), (-41.0,-10.0), (-8.0,-30.0), (63.0,-3.0)/

! Solve AX = B (IPATH = 1)

CALL LSLCC (A, B, X)

! Print results

CALL WRCRN (’X’, X, 1, N, 1)

END

Output

 

1 2 3 4

(-2.000, 0.000) (-1.000,-5.000) ( 7.000, 2.000) ( 0.000, 4.000)