NAG CL Interface
f01dfc (real_​tri_​matmul)

Settings help

CL Name Style:


1 Purpose

f01dfc performs one of the matrix-matrix operations
CαAB+βC, CαATB+βC, CαABT+βC  or CαATBT+βC,  
where A, B and C are real triangular matrices, and α and β are real scalars.

2 Specification

#include <nag.h>
void  f01dfc (Nag_UploType uplo, Nag_TransType transa, Nag_TransType transb, Integer n, double alpha, const double a[], Integer pda, const double b[], Integer pdb, double beta, double c[], Integer pdc, NagError *fail)
The function may be called by the names: f01dfc or nag_matop_real_tri_matmul.

3 Description

f01dfc computes the triangular matrix product C=αop(A)op(B)+βC, where op(A), op(B), and C are all upper triangular or all lower triangular matrices, and where op(A) is either A or AT.

4 References

None.

5 Arguments

1: uplo Nag_UploType Input
On entry: specifies whether C is upper or lower triangular.
uplo=Nag_Upper
C is upper triangular.
uplo=Nag_Lower
C is lower triangular.
Constraint: uplo=Nag_Upper or Nag_Lower.
2: 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.
3: transb Nag_TransType Input
On entry: specifies whether the operation involves B or BT.
transb=Nag_NoTrans
The operation involves B.
transb=Nag_Trans or Nag_ConjTrans
The operation involves BT.
Constraint: transb=Nag_NoTrans, Nag_Trans or Nag_ConjTrans.
4: n Integer Input
On entry: n, the order of the triangular matrices A, B, and C.
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 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,
    • if transa=Nag_NoTrans, A is upper triangular and the elements of the array below the diagonal are not referenced;
    • if transa=Nag_Trans or transa=Nag_ConjTrans, A is lower triangular and the elements of the array above the diagonal are not referenced.
  • If uplo=Nag_Lower
    • if transa=Nag_NoTrans, A is lower triangular and the elements of the array above the diagonal are not referenced;
    • if transa=Nag_Trans or transa=Nag_ConjTrans, A is upper triangular and the elements of the array below 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] const double Input
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,
    • if transa=Nag_NoTrans, B is upper triangular and the elements of the array below the diagonal are not referenced;
    • if transa=Nag_Trans or transa=Nag_ConjTrans, B is lower triangular and the elements of the array above the diagonal are not referenced.
  • If uplo=Nag_Lower
    • if transa=Nag_NoTrans, B is lower triangular and the elements of the array above the diagonal are not referenced;
    • if transa=Nag_Trans or transa=Nag_ConjTrans, B is upper triangular and the elements of the array below the diagonal are not referenced.
9: pdb Integer Input
On entry: the stride separating row elements of the matrix B in the array b.
Constraint: pdbmax(1,n).
10: beta double Input
On entry: the scalar β.
11: c[dim] double Input/Output
Note: the dimension, dim, of the array c must be at least max(1,pdc×n).
Cij is stored in c[(j-1)×pdc+i-1].
On entry: the n×n matrix C.
If beta=0, c need not be set.
On exit: the triangular part of C, as specified by uplo, is updated.
12: pdc Integer Input
On entry: the stride separating row elements of the matrix C in the array c.
Constraint: pdcmax(1,n).
13: 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).
On entry, pdc=value, n=value.
Constraint: pdcmax(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

f01dfc 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 the lower triangular matrix A, the upper triangular matrix B, and the square matrix C. It then calls f01dfc to compute the triangular matrix product C=αATB+βC, updating the upper triangular part of C.

10.1 Program Text

Program Text (f01dfce.c)

10.2 Program Data

Program Data (f01dfce.d)

10.3 Program Results

Program Results (f01dfce.r)