# NAG C Library Function Document

## 1Purpose

nag_trans_hessenberg_controller (g13exc) reduces the matrix pair $\left(B,A\right)$ to lower or upper controller Hessenberg form using (and optionally accumulating) the unitary state-space transformations.

## 2Specification

 #include #include
 void nag_trans_hessenberg_controller (Integer n, Integer m, Nag_ControllerForm reduceto, double a[], Integer tda, double b[], Integer tdb, double u[], Integer tdu, NagError *fail)

## 3Description

nag_trans_hessenberg_controller (g13exc) computes a unitary state-space transformation U, which reduces the matrix pair $\left(B,A\right)$ to give a compound matrix in one of the following controller Hessenberg forms:
 $m n U B ∣ U A UT = * . . . * * . . . . . . * . . . . . . . . . . . . * * . . * . . . . . . . * . . * n$
if ${\mathbf{reduceto}}=\mathrm{Nag_UH_Controller}$, or
 $n m U A UT ∣ U B = * . . * . . . . . . . * . . * . . . . . . . . . . . . * . . . . . . * * . . . n$
if ${\mathbf{reduceto}}=\mathrm{Nag_LH_Controller}$. If $m>n$, then the matrix $UB$ is trapezoidal and if $m+1\ge n$ then the matrix $UA{U}^{\mathrm{T}}$ is full.

## 4References

van Dooren P and Verhaegen M (1985) On the use of unitary state-space transformations. In: Contemporary Mathematics on Linear Algebra and its Role in Systems Theory 47 AMS, Providence

## 5Arguments

1:    $\mathbf{n}$IntegerInput
On entry: the actual state dimension, $n$, i.e., the order of the matrix $A$.
Constraint: ${\mathbf{n}}\ge 1$.
2:    $\mathbf{m}$IntegerInput
On entry: the actual input dimension, $m$.
Constraint: ${\mathbf{m}}\ge 1$.
3:    $\mathbf{reduceto}$Nag_ControllerFormInput
On entry: indicates whether the matrix pair $\left(B,A\right)$ is to be reduced to upper or lower controller Hessenberg form as follows:
${\mathbf{reduceto}}=\mathrm{Nag_UH_Controller}$
Upper controller Hessenberg form).
${\mathbf{reduceto}}=\mathrm{Nag_LH_Controller}$
Lower controller Hessenberg form).
Constraint: ${\mathbf{reduceto}}=\mathrm{Nag_UH_Controller}$ or $\mathrm{Nag_LH_Controller}$.
4:    $\mathbf{a}\left[{\mathbf{n}}×{\mathbf{tda}}\right]$doubleInput/Output
Note: the $\left(i,j\right)$th element of the matrix $A$ is stored in ${\mathbf{a}}\left[\left(i-1\right)×{\mathbf{tda}}+j-1\right]$.
On entry: the leading $n$ by $n$ part of this array must contain the state transition matrix $A$ to be transformed.
On exit: the leading $n$ by $n$ part of this array contains the transformed state transition matrix $UA{U}^{\mathrm{T}}$.
5:    $\mathbf{tda}$IntegerInput
On entry: the stride separating matrix column elements in the array a.
Constraint: ${\mathbf{tda}}\ge {\mathbf{n}}$.
6:    $\mathbf{b}\left[{\mathbf{n}}×{\mathbf{tdb}}\right]$doubleInput/Output
Note: the $\left(i,j\right)$th element of the matrix $B$ is stored in ${\mathbf{b}}\left[\left(i-1\right)×{\mathbf{tdb}}+j-1\right]$.
On entry: the leading $n$ by $m$ part of this array must contain the input matrix $B$ to be transformed.
On exit: the leading $n$ by $m$ part of this array contains the transformed input matrix $UB$.
7:    $\mathbf{tdb}$IntegerInput
On entry: the stride separating matrix column elements in the array b.
Constraint: ${\mathbf{tdb}}\ge {\mathbf{m}}$.
8:    $\mathbf{u}\left[{\mathbf{n}}×{\mathbf{tdu}}\right]$doubleInput/Output
Note: the $\left(i,j\right)$th element of the matrix $U$ is stored in ${\mathbf{u}}\left[\left(i-1\right)×{\mathbf{tdu}}+j-1\right]$.
On entry: if u is not NULL, then the leading $n$ by $n$ part of this array must contain either a transformation matrix (e.g., from a previous call to this function) or be initialized as the identity matrix. If this information is not to be input then u must be set to NULL.
On exit: if u is not NULL, then the leading $n$ by $n$ part of this array contains the product of the input matrix $U$ and the state-space transformation matrix which reduces the given pair to observer Hessenberg form.
9:    $\mathbf{tdu}$IntegerInput
On entry: the stride separating matrix column elements in the array u.
Constraint: ${\mathbf{tdu}}\ge {\mathbf{n}}$ if u is defined.
10:  $\mathbf{fail}$NagError *Input/Output
The NAG error argument (see Section 3.7 in How to Use the NAG Library and its Documentation).

## 6Error Indicators and Warnings

NE_2_INT_ARG_LT
On entry, ${\mathbf{tda}}=〈\mathit{\text{value}}〉$ while ${\mathbf{n}}=〈\mathit{\text{value}}〉$. These arguments must satisfy ${\mathbf{tda}}\ge {\mathbf{n}}$. On entry ${\mathbf{tdb}}=〈\mathit{\text{value}}〉$ while ${\mathbf{m}}=〈\mathit{\text{value}}〉$. These arguments must satisfy ${\mathbf{tdb}}\ge {\mathbf{m}}$. On entry ${\mathbf{tdu}}=〈\mathit{\text{value}}〉$ while ${\mathbf{n}}=〈\mathit{\text{value}}〉$. These arguments must satisfy ${\mathbf{tdu}}\ge {\mathbf{n}}$.
On entry, argument reduceto had an illegal value.
NE_INT_ARG_LT
On entry, ${\mathbf{m}}=〈\mathit{\text{value}}〉$.
Constraint: ${\mathbf{m}}\ge 1$.
On entry, ${\mathbf{n}}=〈\mathit{\text{value}}〉$.
Constraint: ${\mathbf{n}}\ge 1$.

## 7Accuracy

The algorithm is backward stable.

## 8Parallelism and Performance

nag_trans_hessenberg_controller (g13exc) is not threaded in any implementation.

The algorithm requires $O\left(\left(n+m\right){n}^{2}\right)$ operations (see van Dooren and Verhaegen (1985)).

## 10Example

To reduce the matrix pair $\left(B,A\right)$ to upper controller Hessenberg form, and return the unitary state-space transformation matrix $U$.

### 10.1Program Text

Program Text (g13exce.c)

### 10.2Program Data

Program Data (g13exce.d)

### 10.3Program Results

Program Results (g13exce.r)