# NAG CPP Interfacenagcpp::blas::dgemm (f06ya)

Settings help

CPP Name Style:

## 1Purpose

dgemm 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

```#include "f06/nagcpp_f06ya.hpp"
```
```template <typename A, typename B, typename C>

void function dgemm(const string transa, const string transb, const double alpha, const A &a, const B &b, const double beta, C &&c, OptionalF06YA opt)```
```template <typename A, typename B, typename C>

void function dgemm(const string transa, const string transb, const double alpha, const A &a, const B &b, const double beta, C &&c)```

None.
None.

## 5Arguments

1: $\mathbf{transa}$string 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}$string 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{alpha}$double Input
On entry: the scalar $\alpha$.
4: $\mathbf{a}\left(:,:\right)$double array Input
Note: the first dimension of a is given by: if ${\mathbf{transa}}=\text{"N"}$: ${\mathbf{m}}$; if ${\mathbf{transa}}=\text{"T"}\text{ or }{\mathbf{transa}}=\text{"C"}$: ${\mathbf{k}}$; otherwise: $0$.
Note: the second dimension of a is given by: if ${\mathbf{transa}}=\text{"N"}$: ${\mathbf{k}}$; if ${\mathbf{transa}}=\text{"T"}\text{ or }{\mathbf{transa}}=\text{"C"}$: ${\mathbf{m}}$; otherwise: $0$.
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'}$.
5: $\mathbf{b}\left(:,:\right)$double array Input
Note: the first dimension of b is given by: if ${\mathbf{transb}}=\text{"N"}$: ${\mathbf{k}}$; if ${\mathbf{transb}}=\text{"T"}\text{ or }{\mathbf{transb}}=\text{"C"}$: ${\mathbf{n}}$; otherwise: $0$.
Note: the second dimension of b is given by: if ${\mathbf{transb}}=\text{"N"}$: ${\mathbf{n}}$; if ${\mathbf{transb}}=\text{"T"}\text{ or }{\mathbf{transb}}=\text{"C"}$: ${\mathbf{k}}$; otherwise: $0$.
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'}$.
6: $\mathbf{beta}$double Input
On entry: the scalar $\beta$.
7: $\mathbf{c}\left({\mathbf{m}},{\mathbf{n}}\right)$double array Input/Output
On entry: the $m×n$ matrix $C$.
If ${\mathbf{beta}}=0.0$, c need not be set.
On exit: the updated matrix $C$.
8: $\mathbf{opt}$OptionalF06YA Input/Output
Optional parameter container, derived from Optional.

1: $\mathbf{m}$
$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"}\text{​ or ​}\text{"C"}$
2: $\mathbf{n}$
$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"}\text{​ or ​}\text{"C"}$
3: $\mathbf{k}$
$k$, the number of columns of $A$ if ${\mathbf{transa}}=\text{"N"}$, or the number of rows of $A$ if ${\mathbf{transa}}=\text{"T"}\text{​ 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"}\text{​ or ​}\text{"C"}$

## 6Exceptions and Warnings

All errors and warnings have an associated numeric error code field, errorid, stored either as a member of the thrown exception object (see errorid), or as a member of opt.ifail, depending on how errors and warnings are being handled (see Error Handling for more details).
Raises: ErrorException
$\mathbf{errorid}=1$
On entry, error in parameter transa.
Constraint: ${\mathbf{transa}}=\text{"N"},\text{"T"}\text{​ or ​}\text{"C"}$.
$\mathbf{errorid}=2$
On entry, error in parameter transb.
Constraint: ${\mathbf{transb}}=\text{"N"},\text{"T"}\text{​ or ​}\text{"C"}$.
$\mathbf{errorid}=3$
On entry, error in parameter ${\mathbf{m}}$.
Constraint: ${\mathbf{m}}\ge 0$.
$\mathbf{errorid}=4$
On entry, error in parameter ${\mathbf{n}}$.
Constraint: ${\mathbf{n}}\ge 0$.
$\mathbf{errorid}=5$
On entry, error in parameter ${\mathbf{k}}$.
Constraint: ${\mathbf{k}}\ge 0$.
$\mathbf{errorid}=10601$
On entry, argument $⟨\mathit{\text{value}}⟩$ must be a $⟨\mathit{\text{value}}⟩$ x $⟨\mathit{\text{value}}⟩$ array.
Supplied argument has $⟨\mathit{\text{value}}⟩$ dimensions.
$\mathbf{errorid}=10601$
On entry, argument $⟨\mathit{\text{value}}⟩$ must be a $⟨\mathit{\text{value}}⟩$ x $⟨\mathit{\text{value}}⟩$ array.
Supplied argument was a $⟨\mathit{\text{value}}⟩$ x $⟨\mathit{\text{value}}⟩$ array.
$\mathbf{errorid}=10601$
On entry, argument $⟨\mathit{\text{value}}⟩$ must be a $⟨\mathit{\text{value}}⟩$ x $⟨\mathit{\text{value}}⟩$ array.
Not all of the sizes for the supplied array could be ascertained.
$\mathbf{errorid}=10602$
On entry, the raw data component of $⟨\mathit{\text{value}}⟩$ is null.
$\mathbf{errorid}=10603$
On entry, unable to ascertain a value for $⟨\mathit{\text{value}}⟩$.
$\mathbf{errorid}=10604$
On entry, the data in $⟨\mathit{\text{value}}⟩$ is stored in $⟨\mathit{\text{value}}⟩$ Major Order.
The data was expected to be in $⟨\mathit{\text{value}}⟩$ Major Order.
$\mathbf{errorid}=-99$
An unexpected error has been triggered by this routine.
$\mathbf{errorid}=-999$
Dynamic memory allocation failed.

Not applicable.

## 8Parallelism and Performance

Please see the description for the underlying computational routine in this section of the FL Interface documentation.