Purpose
To compute P = H*X or P = X*H, where H is an upper Hessenberg matrix and X is a symmetric matrix.Specification
SUBROUTINE MB01OS( UPLO, TRANS, N, H, LDH, X, LDX, P, LDP, INFO ) C .. Scalar Arguments .. CHARACTER TRANS, UPLO INTEGER INFO, LDH, LDP, LDX, N C .. Array Arguments .. DOUBLE PRECISION H(LDH,*), P(LDP,*), X(LDX,*)Arguments
Mode Parameters
UPLO CHARACTER*1 Specifies which triangle of the symmetric matrix X is given as follows: = 'U': the upper triangular part is given; = 'L': the lower triangular part is given. TRANS CHARACTER*1 Specifies the operation to be performed as follows: = 'N': compute P = H*X; = 'T' or 'C': compute P = X*H.Input/Output Parameters
N (input) INTEGER The order of the matrices H, X, and P. N >= 0. H (input) DOUBLE PRECISION array, dimension (LDH,N) On entry, the leading N-by-N upper Hessenberg part of this array must contain the upper Hessenberg matrix H. The remaining part of this array is not referenced. LDH INTEGER The leading dimension of the array H. LDH >= MAX(1,N). X (input) DOUBLE PRECISION array, dimension (LDX,N) On entry, if UPLO = 'U', the leading N-by-N upper triangular part of this array must contain the upper triangular part of the symmetric matrix X and the strictly lower triangular part of the array is not referenced. On entry, if UPLO = 'L', the leading N-by-N lower triangular part of this array must contain the lower triangular part of the symmetric matrix X and the strictly upper triangular part of the array is not referenced. LDX INTEGER The leading dimension of the array X. LDX >= MAX(1,N). P (output) DOUBLE PRECISION array, dimension (LDP,N) On exit, the leading N-by-N part of this array contains the computed matrix P. LDP INTEGER The leading dimension of the array P. LDP >= MAX(1,N).Error Indicator
INFO INTEGER = 0: successful exit; < 0: if INFO = -k, the k-th argument had an illegal value.Method
The matrix expression is efficiently evaluated taking the structure into account, and using inline code and BLAS routines. Let X = U + sL, where U is upper triangular and sL is strictly lower triangular. Then, P = H*X = H*U + H*sL = H*U + H*sU', where sU is the strictly upper triangular part of X. Similarly, P = X*H = L'*H + sL*H, where L is lower triangular, and X = L + sL'. Note that H*U and L'*H are both upper Hessenberg. However, when UPLO = 'L' and TRANS = 'N', or when UPLO = 'U' and TRANS = 'T', then the matrix P is full. The computations are done similarly.Numerical Aspects
The algorithm requires approximately N**3/2 operations.Further Comments
NoneExample
Program Text
NoneProgram Data
NoneProgram Results
None