NAG FL Interface
f01duf (complex_​tri_​matmul_​inplace)

1 Purpose

f01duf performs one of the matrix-matrix operations
BαAB, BαATB, BαAHB, BαBA, BαBAT  or BαBAH,  
where A and B are complex triangular matrices, and α is a complex scalar.

2 Specification

Fortran Interface
Subroutine f01duf ( side, uplo, transa, n, alpha, a, lda, b, ldb, ifail)
Integer, Intent (In) :: n, lda, ldb
Integer, Intent (Inout) :: ifail
Complex (Kind=nag_wp), Intent (In) :: alpha, a(lda,*)
Complex (Kind=nag_wp), Intent (Inout) :: b(ldb,*)
Character (1), Intent (In) :: side, uplo, transa
C Header Interface
#include <nag.h>
void  f01duf_ (const char *side, const char *uplo, const char *transa, const Integer *n, const Complex *alpha, const Complex a[], const Integer *lda, Complex b[], const Integer *ldb, Integer *ifail, const Charlen length_side, const Charlen length_uplo, const Charlen length_transa)
The routine may be called by the names f01duf or nagf_matop_complex_tri_matmul_inplace.

3 Description

f01duf computes the matrix product B=αAB or B=αBA for two upper triangular or two lower triangular matrices. The storage method for matrices A and B must match (e.g., A and B must both be upper triangular or lower triangular matrices). When the transpose or the conjugate transpose of the input matrix A is used during computation, the solution matrix B is a general matrix. Otherwise, the solution matrix B is a triangular matrix with the storage method identified by the input parameter uplo.

4 References

None.

5 Arguments

1: side Character(1) Input
On entry: specifies whether B is operated on from the left or the right.
side='L'
B is pre-multiplied from the left.
side='R'
B is post-multiplied from the right.
Constraint: side='L' or 'R'.
2: uplo Character(1) Input
On entry: specifies whether A and B are upper or lower triangular.
uplo='U'
A and B are upper triangular.
uplo='L'
A and B are lower triangular.
Constraint: uplo='U' or 'L'.
3: transa Character(1) Input
On entry: specifies whether the operation involves A, AT or AH.
transa='N'
The operation involves A.
transa='T'
The operation involves AT.
transa='C'
The operation involves AH.
Constraint: transa='N', 'T' or 'C'.
4: n Integer Input
On entry: n, the order of the triangular matrices A and B.
Constraint: n0.
5: alpha Complex (Kind=nag_wp) Input
On entry: the scalar α.
6: alda* Complex (Kind=nag_wp) array Input
Note: the second dimension of the array a must be at least max1,n.
On entry: the n by n triangular matrix A.
  • If uplo='U', A is upper triangular and the elements of the array below the diagonal are not referenced.
  • If uplo='L', A is lower triangular and the elements of the array above the diagonal are not referenced.
7: lda Integer Input
On entry: the first dimension of the array a as declared in the (sub)program from which f01duf is called.
Constraint: ldamax1,n.
8: bldb* Complex (Kind=nag_wp) array Input/Output
Note: the second dimension of the array b must be at least max1,n.
On entry: the n by n triangular matrix B.
  • If uplo='U', B is upper triangular and the elements of the array below the diagonal are not referenced.
  • If uplo='L', B is lower triangularand the elements of the array above the diagonal are not referenced.
If alpha=0, b need not be set.
On exit: B is overwritten.
  • If transa='N',
    • if uplo='U', B is upper triangular and the elements of the array below the diagonal are not set.
    • if uplo='L', B is lower triangular and the elements of the array above the diagonal are not set.
  • If transa='T' or 'C', B is a general matrix.
9: ldb Integer Input
On entry: the first dimension of the array b as declared in the (sub)program from which f01duf is called.
Constraint: ldbmax1,n.
10: ifail Integer Input/Output
On entry: ifail must be set to 0, -1 or 1. If you are unfamiliar with this argument you should refer to Section 4 in the Introduction to the NAG Library FL Interface for details.
For environments where it might be inappropriate to halt program execution when an error is detected, the value -1 or 1 is recommended. If the output of error messages is undesirable, then the value 1 is recommended. Otherwise, if you are not familiar with this argument, the recommended value is 0. When the value -1 or 1 is used it is essential to test the value of ifail on exit.
On exit: ifail=0 unless the routine detects an error or a warning has been flagged (see Section 6).

6 Error Indicators and Warnings

If on entry ifail=0 or -1, explanatory error messages are output on the current error message unit (as defined by x04aaf).
Errors or warnings detected by the routine:
ifail=1
On entry, side=value.
Constraint: side='L' or 'R'.
ifail=2
On entry, uplo=value.
Constraint: uplo='U' or 'L'.
ifail=3
On entry, transa=value.
Constraint: transa='N', 'T' or 'C'.
ifail=4
On entry, n=value.
Constraint: n0.
ifail=5
On entry, lda=value, n=value.
Constraint: ldamax1,n.
ifail=6
On entry, ldb=value, n=value.
Constraint: ldbmax1,n.
ifail=-99
An unexpected error has been triggered by this routine. Please contact NAG.
See Section 7 in the Introduction to the NAG Library FL Interface for further information.
ifail=-399
Your licence key may have expired or may not have been installed correctly.
See Section 8 in the Introduction to the NAG Library FL Interface for further information.
ifail=-999
Dynamic memory allocation failed.
See Section 9 in the Introduction to the NAG Library FL Interface for further information.

7 Accuracy

Not applicable.

8 Parallelism and Performance

f01duf makes calls to BLAS and/or LAPACK routines, which may be threaded within the vendor library used by this implementation. Consult the documentation for the vendor library for further information.
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.

9 Further Comments

None.

10 Example

This example reads in two upper triangular matrices A and B. It then calls f01duf to compute the triangular matrix product B=αAHB.

10.1 Program Text

Program Text (f01dufe.f90)

10.2 Program Data

Program Data (f01dufe.d)

10.3 Program Results

Program Results (f01dufe.r)