# NAG Library Routine Document

## 1Purpose

f06yff (dtrmm) performs one of the matrix-matrix operations
 $B←αAB, B←αATB, B←αBA or B←αBAT,$
where $B$ is an $m$ by $n$ real matrix, $A$ is a real triangular matrix, and $\alpha$ is a real scalar.

## 2Specification

Fortran Interface
 Subroutine f06yff ( side, uplo, diag, m, n, a, lda, b, ldb)
 Integer, Intent (In) :: m, n, lda, ldb Real (Kind=nag_wp), Intent (In) :: alpha, a(lda,*) Real (Kind=nag_wp), Intent (Inout) :: b(ldb,*) Character (1), Intent (In) :: side, uplo, transa, diag
#include <nagmk26.h>
 void f06yff_ (const char *side, const char *uplo, const char *transa, const char *diag, const Integer *m, const Integer *n, const double *alpha, const double a[], const Integer *lda, double b[], const Integer *ldb, const Charlen length_side, const Charlen length_uplo, const Charlen length_transa, const Charlen length_diag)
The routine may be called by its BLAS name dtrmm.

None.

None.

## 5Arguments

1:     $\mathbf{side}$ – Character(1)Input
On entry: specifies whether $B$ is operated on from the left or the right.
${\mathbf{side}}=\text{'L'}$
$B$ is pre-multiplied from the left.
${\mathbf{side}}=\text{'R'}$
$B$ is post-multiplied from the right.
Constraint: ${\mathbf{side}}=\text{'L'}$ or $\text{'R'}$.
2:     $\mathbf{uplo}$ – Character(1)Input
On entry: specifies whether $A$ is upper or lower triangular.
${\mathbf{uplo}}=\text{'U'}$
$A$ is upper triangular.
${\mathbf{uplo}}=\text{'L'}$
$A$ is lower triangular.
Constraint: ${\mathbf{uplo}}=\text{'U'}$ or $\text{'L'}$.
3:     $\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'}$.
4:     $\mathbf{diag}$ – Character(1)Input
On entry: specifies whether $A$ has nonunit or unit diagonal elements.
${\mathbf{diag}}=\text{'N'}$
The diagonal elements are stored explicitly.
${\mathbf{diag}}=\text{'U'}$
The diagonal elements are assumed to be $1$, and are not referenced.
Constraint: ${\mathbf{diag}}=\text{'N'}$ or $\text{'U'}$.
5:     $\mathbf{m}$ – IntegerInput
On entry: $m$, the number of rows of the matrix $B$; the order of $A$ if ${\mathbf{side}}=\text{'L'}$.
Constraint: ${\mathbf{m}}\ge 0$.
6:     $\mathbf{n}$ – IntegerInput
On entry: $n$, the number of columns of the matrix $B$; the order of $A$ if ${\mathbf{side}}=\text{'R'}$.
Constraint: ${\mathbf{n}}\ge 0$.
7:     $\mathbf{alpha}$ – Real (Kind=nag_wp)Input
On entry: the scalar $\alpha$.
8:     $\mathbf{a}\left({\mathbf{lda}},*\right)$ – Real (Kind=nag_wp) arrayInput
Note: the second dimension of the array a must be at least $\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{m}}\right)$ if ${\mathbf{side}}=\text{'L'}$ and at least $\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{n}}\right)$ if ${\mathbf{side}}=\text{'R'}$.
On entry: the triangular matrix $A$; $A$ is $m$ by $m$ if ${\mathbf{side}}=\text{'L'}$, or $n$ by $n$ if ${\mathbf{side}}=\text{'R'}$.
• If ${\mathbf{uplo}}=\text{'U'}$, $A$ is upper triangular and the elements of the array below the diagonal are not referenced.
• If ${\mathbf{uplo}}=\text{'L'}$, $A$ is lower triangular and the elements of the array above the diagonal are not referenced.
• If ${\mathbf{diag}}=\text{'U'}$, the diagonal elements of $A$ are assumed to be $1$, and are not referenced.
9:     $\mathbf{lda}$ – IntegerInput
On entry: the first dimension of the array a as declared in the (sub)program from which f06yff (dtrmm) is called.
Constraints:
• if ${\mathbf{side}}=\text{'L'}$, ${\mathbf{lda}}\ge \mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{m}}\right)$;
• if ${\mathbf{side}}=\text{'R'}$, ${\mathbf{lda}}\ge \mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{n}}\right)$.
10:   $\mathbf{b}\left({\mathbf{ldb}},*\right)$ – Real (Kind=nag_wp) arrayInput/Output
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 $m$ by $n$ matrix $B$.
If ${\mathbf{alpha}}=0$, b need not be set.
On exit: the updated matrix $B$.
11:   $\mathbf{ldb}$ – IntegerInput
On entry: the first dimension of the array b as declared in the (sub)program from which f06yff (dtrmm) is called.
Constraint: ${\mathbf{ldb}}\ge \mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{m}}\right)$.

None.

Not applicable.

## 8Parallelism and Performance

f06yff (dtrmm) is threaded by NAG for parallel execution in multithreaded implementations of the NAG Library.
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.