F01CTF adds two real matrices, each one optionally transposed and multiplied by a scalar.
SUBROUTINE F01CTF ( |
TRANSA, TRANSB, M, N, ALPHA, A, LDA, BETA, B, LDB, C, LDC, IFAIL) |
INTEGER |
M, N, LDA, LDB, LDC, IFAIL |
REAL (KIND=nag_wp) |
ALPHA, A(LDA,*), BETA, B(LDB,*), C(LDC,*) |
CHARACTER(1) |
TRANSA, TRANSB |
|
F01CTF performs one of the operations
- ,
- ,
- or
- ,
where
,
and
are matrices, and
and
are scalars. 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.
and
are either
by
or
by
matrices, depending on whether they are to be transposed before addition.
is an
by
matrix.
None.
If on entry
or
, explanatory error messages are output on the current error message unit (as defined by
X04AAF).
F01CTF is threaded by NAG for parallel execution in multithreaded implementations of the NAG Library.
Please consult the
X06 Chapter Introduction for information on how to control and interrogate the OpenMP environment used within this routine. Please also consult the
Users' Note for your implementation for any additional implementation-specific information.
The time taken for a call of F01CTF 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
and
, along with values for
TRANSA,
TRANSB,
ALPHA and
BETA, and adds them together, printing the result matrix
. The process is continued until the end of the input stream is reached.