# NAG FL Interfacef06yaf (dgemm)

## ▸▿ Contents

Settings help

FL Name Style:

FL Specification Language:

## 1Purpose

f06yaf 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 matrices, and $\alpha$ and $\beta$ are real scalars; $C$ is always $m×n$.

## 2Specification

Fortran Interface
 Subroutine f06yaf ( m, n, k, a, lda, b, ldb, beta, c, ldc)
 Integer, Intent (In) :: m, n, k, lda, ldb, ldc Real (Kind=nag_wp), Intent (In) :: alpha, a(lda,*), b(ldb,*), beta Real (Kind=nag_wp), Intent (Inout) :: c(ldc,*) Character (1), Intent (In) :: transa, transb
#include <nag.h>
 void f06yaf_ (const char *transa, const char *transb, const Integer *m, const Integer *n, const Integer *k, const double *alpha, const double a[], const Integer *lda, const double b[], const Integer *ldb, const double *beta, double c[], const Integer *ldc, const Charlen length_transa, const Charlen length_transb)
The routine may be called by the names f06yaf, nagf_blas_dgemm or its BLAS name dgemm.

None.

None.

## 5Arguments

1: $\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'}$.
2: $\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'}$.
3: $\mathbf{m}$Integer Input
On entry: $m$, the number of rows of the matrix $C$; the number of rows of $A$ if ${\mathbf{transa}}=\text{'N'}$, or the number of columns of $A$ if ${\mathbf{transa}}=\text{'T'}$ or $\text{'C'}$.
Constraint: ${\mathbf{m}}\ge 0$.
4: $\mathbf{n}$Integer Input
On entry: $n$, the number of columns of the matrix $C$; the number of columns of $B$ if ${\mathbf{transb}}=\text{'N'}$, or the number of rows of $B$ if ${\mathbf{transb}}=\text{'T'}$ or $\text{'C'}$.
Constraint: ${\mathbf{n}}\ge 0$.
5: $\mathbf{k}$Integer Input
On entry: $k$, the number of columns of $A$ if ${\mathbf{transa}}=\text{'N'}$, or the number of rows of $A$ if ${\mathbf{transa}}=\text{'T'}$ or $\text{'C'}$; the number of rows of $B$ if ${\mathbf{transb}}=\text{'N'}$, or the number of columns of $B$ if ${\mathbf{transb}}=\text{'T'}$ or $\text{'C'}$.
Constraint: ${\mathbf{k}}\ge 0$.
6: $\mathbf{alpha}$Real (Kind=nag_wp) Input
On entry: the scalar $\alpha$.
7: $\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{k}}\right)$ if ${\mathbf{transa}}=\text{'N'}$ and at least $\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{m}}\right)$ if ${\mathbf{transa}}=\text{'T'}$ or $\text{'C'}$.
On entry: the matrix $A$; $A$ is $m×k$ if ${\mathbf{transa}}=\text{'N'}$, or $k×m$ if ${\mathbf{transa}}=\text{'T'}$ or $\text{'C'}$.
8: $\mathbf{lda}$Integer Input
On entry: the first dimension of the array a as declared in the (sub)program from which f06yaf is called.
Constraints:
• if ${\mathbf{transa}}=\text{'N'}$, ${\mathbf{lda}}\ge \mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{m}}\right)$;
• if ${\mathbf{transa}}=\text{'T'}$ or $\text{'C'}$, ${\mathbf{lda}}\ge \mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{k}}\right)$.
9: $\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)$ if ${\mathbf{transb}}=\text{'N'}$ and at least $\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{k}}\right)$ if ${\mathbf{transb}}=\text{'T'}$ or $\text{'C'}$.
On entry: the matrix $B$; $B$ is $k×n$ if ${\mathbf{transb}}=\text{'N'}$, or $n×k$ if ${\mathbf{transb}}=\text{'T'}$ or $\text{'C'}$.
10: $\mathbf{ldb}$Integer Input
On entry: the first dimension of the array b as declared in the (sub)program from which f06yaf is called.
Constraints:
• if ${\mathbf{transb}}=\text{'N'}$, ${\mathbf{ldb}}\ge \mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{k}}\right)$;
• if ${\mathbf{transb}}=\text{'T'}$ or $\text{'C'}$, ${\mathbf{ldb}}\ge \mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{n}}\right)$.
11: $\mathbf{beta}$Real (Kind=nag_wp) Input
On entry: the scalar $\beta$.
12: $\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)$.
On entry: the $m×n$ matrix $C$.
If ${\mathbf{beta}}=0.0$, c need not be set.
On exit: the updated matrix $C$.
13: $\mathbf{ldc}$Integer Input
On entry: the first dimension of the array c as declared in the (sub)program from which f06yaf is called.
Constraint: ${\mathbf{ldc}}\ge \mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{m}}\right)$.

None.

Not applicable.