NAG FL Interfacef01dff (real_​tri_​matmul)

▸▿ Contents

Settings help

FL Name Style:

FL Specification Language:

1Purpose

f01dff 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 $\alpha$ and $\beta$ are real scalars.

2Specification

Fortran Interface
 Subroutine f01dff ( uplo, n, a, lda, b, ldb, beta, c, ldc,
 Integer, Intent (In) :: n, lda, ldb, ldc Integer, Intent (Inout) :: ifail Real (Kind=nag_wp), Intent (In) :: alpha, a(lda,*), b(ldb,*), beta Real (Kind=nag_wp), Intent (Inout) :: c(ldc,*) Character (1), Intent (In) :: uplo, transa, transb
#include <nag.h>
 void f01dff_ (const char *uplo, const char *transa, const char *transb, const Integer *n, const double *alpha, const double a[], const Integer *lda, const double b[], const Integer *ldb, const double *beta, double c[], const Integer *ldc, Integer *ifail, const Charlen length_uplo, const Charlen length_transa, const Charlen length_transb)
The routine may be called by the names f01dff or nagf_matop_real_tri_matmul.

3Description

f01dff computes the triangular matrix product $C=\alpha \mathrm{op}\left(A\right)\mathrm{op}\left(B\right)+\beta C$, where $\mathrm{op}\left(A\right)$, $\mathrm{op}\left(B\right)$, and $C$ are all upper triangular or all lower triangular matrices, and where $\mathrm{op}\left(A\right)$ is either $A$ or ${A}^{\mathrm{T}}$.

None.

5Arguments

1: $\mathbf{uplo}$Character(1) Input
On entry: specifies whether $C$ is upper or lower triangular.
${\mathbf{uplo}}=\text{'U'}$
$C$ is upper triangular.
${\mathbf{uplo}}=\text{'L'}$
$C$ is lower triangular.
Constraint: ${\mathbf{uplo}}=\text{'U'}$ or $\text{'L'}$.
2: $\mathbf{transa}$Character(1) Input
On entry: specifies whether the operation involves $A$ or ${A}^{\mathrm{T}}$.
${\mathbf{transa}}=\text{'N'}$
The operation involves $A$.
${\mathbf{transa}}=\text{'T'}$ or $\text{'C'}$
The operation involves ${A}^{\mathrm{T}}$.
Constraint: ${\mathbf{transa}}=\text{'N'}$, $\text{'T'}$ or $\text{'C'}$.
3: $\mathbf{transb}$Character(1) Input
On entry: specifies whether the operation involves $B$ or ${B}^{\mathrm{T}}$.
${\mathbf{transb}}=\text{'N'}$
The operation involves $B$.
${\mathbf{transb}}=\text{'T'}$ or $\text{'C'}$
The operation involves ${B}^{\mathrm{T}}$.
Constraint: ${\mathbf{transb}}=\text{'N'}$, $\text{'T'}$ or $\text{'C'}$.
4: $\mathbf{n}$Integer Input
On entry: $n$, the order of the triangular matrices $A$, $B$, and $C$.
Constraint: ${\mathbf{n}}\ge 0$.
5: $\mathbf{alpha}$Real (Kind=nag_wp) Input
On entry: the scalar $\alpha$.
6: $\mathbf{a}\left({\mathbf{lda}},*\right)$Real (Kind=nag_wp) array Input
Note: the second dimension of the array a must be at least $\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{n}}\right)$.
On entry: the $n×n$ triangular matrix $A$.
• If ${\mathbf{uplo}}=\text{'U'}$,
• if ${\mathbf{transa}}=\text{'N'}$, $A$ is upper triangular and the elements of the array below the diagonal are not referenced;
• if ${\mathbf{transa}}=\text{'T'}$ or $\text{'C'}$, $A$ is lower triangular and the elements of the array above the diagonal are not referenced.
• If ${\mathbf{uplo}}=\text{'L'}$,
• if ${\mathbf{transa}}=\text{'N'}$, $A$ is lower triangular and the elements of the array above the diagonal are not referenced;
• if ${\mathbf{transa}}=\text{'T'}$ or $\text{'C'}$, $A$ is upper triangular and the elements of the array below the diagonal are not referenced.
7: $\mathbf{lda}$Integer Input
On entry: the first dimension of the array a as declared in the (sub)program from which f01dff is called.
Constraint: ${\mathbf{lda}}\ge \mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{n}}\right)$.
8: $\mathbf{b}\left({\mathbf{ldb}},*\right)$Real (Kind=nag_wp) array Input
Note: the second dimension of the array b must be at least $\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{n}}\right)$.
On entry: the $n×n$ triangular matrix $B$.
• If ${\mathbf{uplo}}=\text{'U'}$,
• if ${\mathbf{transa}}=\text{'N'}$, $B$ is upper triangular and the elements of the array below the diagonal are not referenced;
• if ${\mathbf{transa}}=\text{'T'}$ or $\text{'C'}$, $B$ is lower triangular and the elements of the array above the diagonal are not referenced.
• If ${\mathbf{uplo}}=\text{'L'}$,
• if ${\mathbf{transa}}=\text{'N'}$, $B$ is lower triangular and the elements of the array above the diagonal are not referenced;
• if ${\mathbf{transa}}=\text{'T'}$ or $\text{'C'}$, $B$ is upper triangular and the elements of the array below the diagonal are not referenced.
9: $\mathbf{ldb}$Integer Input
On entry: the first dimension of the array b as declared in the (sub)program from which f01dff is called.
Constraint: ${\mathbf{ldb}}\ge \mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{n}}\right)$.
10: $\mathbf{beta}$Real (Kind=nag_wp) Input
On entry: the scalar $\beta$.
11: $\mathbf{c}\left({\mathbf{ldc}},*\right)$Real (Kind=nag_wp) array Input/Output
Note: the second dimension of the array c must be at least $\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{n}}\right)$.
• If ${\mathbf{uplo}}=\text{'U'}$, $C$ is upper triangular and the elements of the array below the diagonal are not referenced.
• If ${\mathbf{uplo}}=\text{'L'}$, $C$ is lower triangular and the elements of the array above the diagonal are not referenced.
On entry: the $n×n$ matrix $C$.
If ${\mathbf{beta}}=0$, c need not be set.
On exit: the triangular part of $C$, as specified by uplo, is updated.
12: $\mathbf{ldc}$Integer Input
On entry: the first dimension of the array c as declared in the (sub)program from which f01dff is called.
Constraint: ${\mathbf{ldc}}\ge \mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{n}}\right)$.
13: $\mathbf{ifail}$Integer Input/Output
On entry: ifail must be set to $0$, $-1$ or $1$ to set behaviour on detection of an error; these values have no effect when no error is detected.
A value of $0$ causes the printing of an error message and program execution will be halted; otherwise program execution continues. A value of $-1$ means that an error message is printed while a value of $1$ means that it is not.
If halting is not appropriate, the value $-1$ or $1$ is recommended. If message printing is undesirable, then the value $1$ is recommended. Otherwise, the value $0$ is recommended. When the value $-\mathbf{1}$ or $\mathbf{1}$ is used it is essential to test the value of ifail on exit.
On exit: ${\mathbf{ifail}}={\mathbf{0}}$ unless the routine detects an error or a warning has been flagged (see Section 6).

6Error Indicators and Warnings

If on entry ${\mathbf{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:
${\mathbf{ifail}}=1$
On entry, ${\mathbf{uplo}}=⟨\mathit{\text{value}}⟩$.
Constraint: ${\mathbf{uplo}}=\text{'U'}$ or $\text{'L'}$.
${\mathbf{ifail}}=2$
On entry, ${\mathbf{transa}}=⟨\mathit{\text{value}}⟩$.
Constraint: ${\mathbf{transa}}=\text{'N'}$, $\text{'T'}$ or $\text{'C'}$.
${\mathbf{ifail}}=3$
On entry, ${\mathbf{transb}}=⟨\mathit{\text{value}}⟩$.
Constraint: ${\mathbf{transb}}=\text{'N'}$, $\text{'T'}$ or $\text{'C'}$.
${\mathbf{ifail}}=4$
On entry, ${\mathbf{n}}=⟨\mathit{\text{value}}⟩$.
Constraint: ${\mathbf{n}}\ge 0$.
${\mathbf{ifail}}=5$
On entry, ${\mathbf{lda}}=⟨\mathit{\text{value}}⟩$, ${\mathbf{n}}=⟨\mathit{\text{value}}⟩$.
Constraint: ${\mathbf{lda}}\ge \mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{n}}\right)$.
${\mathbf{ifail}}=6$
On entry, ${\mathbf{ldb}}=⟨\mathit{\text{value}}⟩$, ${\mathbf{n}}=⟨\mathit{\text{value}}⟩$.
Constraint: ${\mathbf{ldb}}\ge \mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{n}}\right)$.
${\mathbf{ifail}}=7$
On entry, ${\mathbf{ldc}}=⟨\mathit{\text{value}}⟩$, ${\mathbf{n}}=⟨\mathit{\text{value}}⟩$.
Constraint: ${\mathbf{ldc}}\ge \mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{n}}\right)$.
${\mathbf{ifail}}=-99$
See Section 7 in the Introduction to the NAG Library FL Interface for further information.
${\mathbf{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.
${\mathbf{ifail}}=-999$
Dynamic memory allocation failed.
See Section 9 in the Introduction to the NAG Library FL Interface for further information.

Not applicable.

8Parallelism and Performance

f01dff 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.

None.

10Example

This example reads in the lower triangular matrix $A$, the upper triangular matrix $B$, and the square matrix $C$. It then calls f01dff to compute the triangular matrix product $C=\alpha {A}^{\mathrm{T}}B+\beta C$, updating the upper triangular part of $C$.

10.1Program Text

Program Text (f01dffe.f90)

10.2Program Data

Program Data (f01dffe.d)

10.3Program Results

Program Results (f01dffe.r)