F01CWF adds two complex matrices, each one optionally transposed and multiplied by a scalar.
SUBROUTINE F01CWF ( |
TRANSA, TRANSB, M, N, ALPHA, A, LDA, BETA, B, LDB, C, LDC, IFAIL) |
INTEGER |
M, N, LDA, LDB, LDC, IFAIL |
COMPLEX (KIND=nag_wp) |
ALPHA, A(LDA,*), BETA, B(LDB,*), C(LDC,*) |
CHARACTER(1) |
TRANSA, TRANSB |
|
F01CWF performs one of the operations
- C:=αA+βB,
- C:=αAT+βB,
- C:=αAH+βB,
- C:=αA+βBT,
- C:=αAT+βBT,
- C:=αAH+βBT,
- C:=αA+βBH,
- C:=αAT+βBH or
- C:=αAH+βBH,
where
A,
B and
C are matrices,
α and
β are scalars,
T denotes transposition and
H denotes conjugate transposition. For efficiency, the routine contains special code for the cases when one or both of
α,
β is equal to zero, unity or minus unity. The matrices, or their transposes, must be compatible for addition.
A and
B are either
m by
n or
n by
m matrices, depending on whether they are to be transposed before addition.
C is an
m by
n matrix.
None.
If on entry
IFAIL=0 or
-1, explanatory error messages are output on the current error message unit (as defined by
X04AAF).
The time taken for a call of F01CWF varies with
M,
N and the values of
α and
β. The routine is quickest if either or both of
α and
β are equal to zero, or plus or minus unity.
The following program reads in a pair of matrices
A and
B, along with values for
TRANSA,
TRANSB,
ALPHA and
BETA, and adds them together, printing the result matrix
C. The process is continued until the end of the input stream is reached.