NAG CL Interface
f01duc (complex_​tri_​matmul_​inplace)

Settings help

CL Name Style:


1 Purpose

f01duc 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

#include <nag.h>
void  f01duc (Nag_SideType side, Nag_UploType uplo, Nag_TransType transa, Integer n, Complex alpha, const Complex a[], Integer pda, Complex b[], Integer pdb, NagError *fail)
The function may be called by the names: f01duc or nag_matop_complex_tri_matmul_inplace.

3 Description

f01duc 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 Nag_SideType Input
On entry: specifies whether B is operated on from the left or the right.
side=Nag_LeftSide
B is pre-multiplied from the left.
side=Nag_RightSide
B is post-multiplied from the right.
Constraint: side=Nag_LeftSide or Nag_RightSide.
2: uplo Nag_UploType Input
On entry: specifies whether A and B are upper or lower triangular.
uplo=Nag_Upper
A and B are upper triangular.
uplo=Nag_Lower
A and B are lower triangular.
Constraint: uplo=Nag_Upper or Nag_Lower.
3: transa Nag_TransType Input
On entry: specifies whether the operation involves A, AT or AH.
transa=Nag_NoTrans
The operation involves A.
transa=Nag_Trans
The operation involves AT.
transa=Nag_ConjTrans
The operation involves AH.
Constraint: transa=Nag_NoTrans, Nag_Trans or Nag_ConjTrans.
4: n Integer Input
On entry: n, the order of the triangular matrices A and B.
Constraint: n0.
5: alpha Complex Input
On entry: the scalar α.
6: a[dim] const Complex Input
Note: the dimension, dim, of the array a must be at least max(1,pda×n).
On entry: the n×n triangular matrix A.
Aij is stored in a[(j-1)×pda+i-1].
If uplo=Nag_Upper, the upper triangular part of A must be stored and the elements of the array below the diagonal are not referenced.
If uplo=Nag_Lower, the lower triangular part of A must be stored and the elements of the array above the diagonal are not referenced.
7: pda Integer Input
On entry: the stride separating row elements of the matrix A in the array a.
Constraint: pdamax(1,n).
8: b[dim] Complex Input/Output
Note: the dimension, dim, of the array b must be at least max(1,pdb×n).
On entry: the n×n triangular matrix B.
Bij is stored in b[(j-1)×pdb+i-1].
If uplo=Nag_Upper, the upper triangular part of B must be stored and the elements of the array below the diagonal are not referenced.
If uplo=Nag_Lower, the lower triangular part of B must be stored and the elements of the array above the diagonal are not referenced.
If alpha=0, b need not be set.
On exit: B is overwritten.
Bij is stored in b[(j-1)×pdb+i-1].
If uplo=Nag_Upper and transa=Nag_NoTrans, B is upper triangular and the elements of the array below the diagonal are not set.
If uplo=Nag_Lower and transa=Nag_NoTrans, B is lower triangular and the elements of the array above the diagonal are not set.
If transa=Nag_Trans or transa=Nag_ConjTrans, B is a general matrix.
9: pdb Integer Input
On entry: the stride separating row elements of the matrix B in the array b.
Constraint: pdbmax(1,n).
10: fail NagError * Input/Output
The NAG error argument (see Section 7 in the Introduction to the NAG Library CL Interface).

6 Error Indicators and Warnings

NE_ALLOC_FAIL
Dynamic memory allocation failed.
See Section 3.1.2 in the Introduction to the NAG Library CL Interface for further information.
NE_BAD_PARAM
On entry, argument value had an illegal value.
NE_INT
On entry, n=value.
Constraint: n0.
NE_INT_2
On entry, pda=value, n=value.
Constraint: pdamax(1,n).
On entry, pdb=value, n=value.
Constraint: pdbmax(1,n).
NE_INTERNAL_ERROR
An internal error has occurred in this function. Check the function call and any array sizes. If the call is correct then please contact NAG for assistance.
See Section 7.5 in the Introduction to the NAG Library CL Interface for further information.
NE_NO_LICENCE
Your licence key may have expired or may not have been installed correctly.
See Section 8 in the Introduction to the NAG Library CL Interface for further information.

7 Accuracy

Not applicable.

8 Parallelism and Performance

f01duc 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 function. 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 f01duc to compute the triangular matrix product B=αAHB.

10.1 Program Text

Program Text (f01duce.c)

10.2 Program Data

Program Data (f01duce.d)

10.3 Program Results

Program Results (f01duce.r)