# NAG FL Interfacef06tvf (zutsrh)

## 1Purpose

f06tvf transforms a complex upper triangular matrix to an upper Hessenberg matrix by applying a given sequence of plane rotations.

## 2Specification

Fortran Interface
 Subroutine f06tvf ( side, n, k1, k2, c, s, a, lda)
 Integer, Intent (In) :: n, k1, k2, lda Real (Kind=nag_wp), Intent (Inout) :: s(*) Complex (Kind=nag_wp), Intent (In) :: c(*) Complex (Kind=nag_wp), Intent (Inout) :: a(lda,*) Character (1), Intent (In) :: side
#include <nag.h>
 void f06tvf_ (const char *side, const Integer *n, const Integer *k1, const Integer *k2, const Complex c[], double s[], Complex a[], const Integer *lda, const Charlen length_side)
The routine may be called by the names f06tvf or nagf_blas_zutsrh.

## 3Description

f06tvf transforms an $n$ by $n$ complex upper triangular matrix $U$ with real diagonal elements, to an upper Hessenberg matrix $H$, by applying a given sequence of plane rotations from either the left or the right, in planes ${\mathit{k}}_{1}$ to ${\mathit{k}}_{2}$; $H$ has real nonzero subdiagonal elements ${h}_{\mathit{k}+1,\mathit{k}}$, for $\mathit{k}={\mathit{k}}_{1},\dots ,{\mathit{k}}_{2}-1$ only.
If ${\mathbf{side}}=\text{'L'}$, the rotations are applied from the left:
 $H=PU ,$
where $P={P}_{{k}_{1}}{P}_{{k}_{1}+1}\cdots {P}_{{k}_{2}-1}$.
If ${\mathbf{side}}=\text{'R'}$, the rotations are applied from the right:
 $H = UPH ,$
where $P={P}_{{k}_{2}-1}\cdots {P}_{{k}_{1}+1}{P}_{{k}_{1}}$.
In either case, ${P}_{k}$ is a rotation in the $\left(k,k+1\right)$ plane.
The $2$ by $2$ plane rotation part of ${P}_{k}$ has the form
 $c¯k sk -sk ck$
with ${s}_{k}$ real.

None.

## 5Arguments

1: $\mathbf{side}$Character(1) Input
On entry: specifies whether $U$ is operated on from the left or the right.
${\mathbf{side}}=\text{'L'}$
$U$ is pre-multiplied from the left.
${\mathbf{side}}=\text{'R'}$
$U$ is post-multiplied from the right.
Constraint: ${\mathbf{side}}=\text{'L'}$ or $\text{'R'}$.
2: $\mathbf{n}$Integer Input
On entry: $n$, the order of the matrices $U$ and $H$.
Constraint: ${\mathbf{n}}\ge 0$.
3: $\mathbf{k1}$Integer Input
4: $\mathbf{k2}$Integer Input
On entry: the values ${k}_{1}$ and ${k}_{2}$.
If ${\mathbf{k1}}<1$ or ${\mathbf{k2}}\le {\mathbf{k1}}$ or ${\mathbf{k2}}>{\mathbf{n}}$, an immediate return is effected.
5: $\mathbf{c}\left(*\right)$Complex (Kind=nag_wp) array Input
Note: the dimension of the array c must be at least ${\mathbf{k2}}-1$.
On entry: ${\mathbf{c}}\left(\mathit{k}\right)$ must hold ${c}_{\mathit{k}}$, the cosine of the rotation ${P}_{\mathit{k}}$, for $\mathit{k}={\mathit{k}}_{1},\dots ,{\mathit{k}}_{2}-1$.
6: $\mathbf{s}\left(*\right)$Real (Kind=nag_wp) array Input/Output
Note: the dimension of the array s must be at least ${\mathbf{k2}}-1$.
On entry: ${\mathbf{s}}\left(\mathit{k}\right)$ must hold ${s}_{\mathit{k}}$, the sine of the rotation ${P}_{\mathit{k}}$, for $\mathit{k}={\mathit{k}}_{1},\dots ,{\mathit{k}}_{2}-1$.
On exit: ${\mathbf{s}}\left(\mathit{k}\right)$ holds ${h}_{\mathit{k}+1,\mathit{k}}$, the subdiagonal element of $H$, for $\mathit{k}={\mathit{k}}_{1},\dots ,{\mathit{k}}_{2}-1$.
7: $\mathbf{a}\left({\mathbf{lda}},*\right)$Complex (Kind=nag_wp) array Input/Output
Note: the second dimension of the array a must be at least ${\mathbf{n}}$.
On entry: the $n$ by $n$ upper triangular matrix $U$. The imaginary parts of the diagonal elements must be zero.
On exit: the upper triangular part of the upper Hessenberg matrix $H$.
8: $\mathbf{lda}$Integer Input
On entry: the first dimension of the array a as declared in the (sub)program from which f06tvf is called.
Constraint: ${\mathbf{lda}}\ge \mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{n}}\right)$.

None.

Not applicable.

## 8Parallelism and Performance

f06tvf is not threaded in any implementation.