SB04PX

Solving a discrete-time Sylvester equation for an m-by-n matrix X, 1 <= m,n <= 2

[Specification] [Arguments] [Method] [References] [Comments] [Example]

Purpose

  To solve for the N1-by-N2 matrix X, 1 <= N1,N2 <= 2, in

         op(TL)*X*op(TR) + ISGN*X = SCALE*B,

  where TL is N1-by-N1, TR is N2-by-N2, B is N1-by-N2, and ISGN = 1
  or -1.  op(T) = T or T', where T' denotes the transpose of T.

Specification
      SUBROUTINE SB04PX( LTRANL, LTRANR, ISGN, N1, N2, TL, LDTL, TR,
     $                   LDTR, B, LDB, SCALE, X, LDX, XNORM, INFO )
C     .. Scalar Arguments ..
      LOGICAL            LTRANL, LTRANR
      INTEGER            INFO, ISGN, LDB, LDTL, LDTR, LDX, N1, N2
      DOUBLE PRECISION   SCALE, XNORM
C     .. Array Arguments ..
      DOUBLE PRECISION   B( LDB, * ), TL( LDTL, * ), TR( LDTR, * ),
     $                   X( LDX, * )

Arguments

Mode Parameters

  LTRANL  LOGICAL
          Specifies the form of op(TL) to be used, as follows:
          = .FALSE.:  op(TL) = TL,
          = .TRUE. :  op(TL) = TL'.

  LTRANR  LOGICAL
          Specifies the form of op(TR) to be used, as follows:
          = .FALSE.:  op(TR) = TR,
          = .TRUE. :  op(TR) = TR'.

  ISGN    INTEGER
          Specifies the sign of the equation as described before.
          ISGN may only be 1 or -1.

Input/Output Parameters
  N1      (input) INTEGER
          The order of matrix TL.  N1 may only be 0, 1 or 2.

  N2      (input) INTEGER
          The order of matrix TR.  N2 may only be 0, 1 or 2.

  TL      (input) DOUBLE PRECISION array, dimension (LDTL,N1)
          The leading N1-by-N1 part of this array must contain the
          matrix TL.

  LDTL    INTEGER
          The leading dimension of array TL.  LDTL >= MAX(1,N1).

  TR      (input) DOUBLE PRECISION array, dimension (LDTR,N2)
          The leading N2-by-N2 part of this array must contain the
          matrix TR.

  LDTR    INTEGER
          The leading dimension of array TR.  LDTR >= MAX(1,N2).

  B       (input) DOUBLE PRECISION array, dimension (LDB,N2)
          The leading N1-by-N2 part of this array must contain the
          right-hand side of the equation.

  LDB     INTEGER
          The leading dimension of array B.  LDB >= MAX(1,N1).

  SCALE   (output) DOUBLE PRECISION
          The scale factor. SCALE is chosen less than or equal to 1
          to prevent the solution overflowing.

  X       (output) DOUBLE PRECISION array, dimension (LDX,N2)
          The leading N1-by-N2 part of this array contains the
          solution of the equation.
          Note that X may be identified with B in the calling
          statement.

  LDX     INTEGER
          The leading dimension of array X.  LDX >= MAX(1,N1).

  XNORM   (output) DOUBLE PRECISION
          The infinity-norm of the solution.

Error Indicator
  INFO    INTEGER
          = 0:  successful exit;
          = 1:  if TL and -ISGN*TR have almost reciprocal
                eigenvalues, so TL or TR is perturbed to get a
                nonsingular equation.

          NOTE: In the interests of speed, this routine does not
                check the inputs for errors.

Method
  The equivalent linear algebraic system of equations is formed and
  solved using Gaussian elimination with complete pivoting.

References
  [1] Anderson, E., Bai, Z., Bischof, C., Demmel, J., Dongarra, J.,
      Du Croz, J., Greenbaum, A., Hammarling, S., McKenney, A.,
      Ostrouchov, S., and Sorensen, D.
      LAPACK Users' Guide: Second Edition.
      SIAM, Philadelphia, 1995.

Numerical Aspects
  The algorithm is stable and reliable, since Gaussian elimination
  with complete pivoting is used.

Further Comments
  None
Example

Program Text

  None
Program Data
  None
Program Results
  None

Return to Supporting Routines index