# NAG Library Routine Document

## 1Purpose

f06thf forms the complex $m$ by $n$ rectangular or trapezoidal matrix $A$ given by

## 2Specification

Fortran Interface
 Subroutine f06thf ( m, n, con, diag, a, lda)
 Integer, Intent (In) :: m, n, lda Complex (Kind=nag_wp), Intent (In) :: con, diag Complex (Kind=nag_wp), Intent (Inout) :: a(lda,*) Character (1), Intent (In) :: matrix
C Header Interface
#include <nagmk26.h>
 void f06thf_ (const char *matrix, const Integer *m, const Integer *n, const Complex *con, const Complex *diag, Complex a[], const Integer *lda, const Charlen length_matrix)

None.
None.

## 5Arguments

1:     $\mathbf{matrix}$ – Character(1)Input
On entry: the matrix type.
${\mathbf{matrix}}=\text{'G'}$
General matrix.
${\mathbf{matrix}}=\text{'U'}$
Upper trapezoidal matrix (upper triangular if $m=n$).
${\mathbf{matrix}}=\text{'L'}$
Lower trapezoidal matrix (lower triangular if $m=n$).
Constraint: ${\mathbf{matrix}}=\text{'G'}$, $\text{'U'}$ or $\text{'L'}$.
2:     $\mathbf{m}$ – IntegerInput
On entry: $m$, the number of rows of the matrix $A$.
Constraint: ${\mathbf{m}}\ge 0$.
3:     $\mathbf{n}$ – IntegerInput
On entry: $n$, the number of columns of the matrix $A$.
Constraint: ${\mathbf{n}}\ge 0$.
4:     $\mathbf{con}$ – Complex (Kind=nag_wp)Input
On entry: the value to be assigned to the off-diagonal elements of $A$.
5:     $\mathbf{diag}$ – Complex (Kind=nag_wp)Input
On entry: the value to be assigned to the diagonal elements of $A$.
6:     $\mathbf{a}\left({\mathbf{lda}},*\right)$ – Complex (Kind=nag_wp) arrayOutput
Note: the second dimension of the array a must be at least ${\mathbf{n}}$.
On exit: the $m$ by $n$ general or trapezoidal matrix $A$.
• If ${\mathbf{matrix}}=\text{'U'}$, $A$ is upper trapezoidal and the elements of the array below the diagonal are not referenced.
• If ${\mathbf{matrix}}=\text{'L'}$, $A$ is lower trapezoidal and the elements of the array above the diagonal are not referenced.
7:     $\mathbf{lda}$ – IntegerInput
On entry: the first dimension of the array a as declared in the (sub)program from which f06thf is called.
Constraint: ${\mathbf{lda}}\ge \mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{m}}\right)$.

None.

Not applicable.

## 8Parallelism and Performance

f06thf is not threaded in any implementation.

None.

None.