NAG CL Interface
f01dgc (real_​tri_​matmul_​inplace)

1 Purpose

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

2 Specification

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

3 Description

f01dgc 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 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 argument 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 or AT.
transa=Nag_NoTrans
The operation involves A.
transa=Nag_Trans or Nag_ConjTrans
The operation involves AT.
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 double Input
On entry: the scalar α.
6: a[dim] const double Input
Note: the dimension, dim, of the array a must be at least max1,n×pda.
On entry: the n by n triangular matrix A.
Aij is stored in a[i-1×pda+j-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: pdamax1,n.
8: b[dim] double Input/Output
Note: the dimension, dim, of the array b must be at least max1,n×pdb.
On entry: the n by n triangular matrix B.
Bij is stored in b[i-1×pdb+j-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[i-1×pdb+j-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: pdbmax1,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: pdamax1,n.
On entry, pdb=value, n=value.
Constraint: pdbmax1,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

f01dgc 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 f01dgc to compute the triangular matrix product B=αATB.

10.1 Program Text

Program Text (f01dgce.c)

10.2 Program Data

Program Data (f01dgce.d)

10.3 Program Results

Program Results (f01dgce.r)