C06 Chapter Contents
C06 Chapter Introduction
NAG Library Manual

# NAG Library Routine DocumentC06GSF

Note:  before using this routine, please read the Users' Note for your implementation to check the interpretation of bold italicised terms and other implementation-dependent details.

## 1  Purpose

C06GSF takes $m$ Hermitian sequences, each containing $n$ data values, and forms the real and imaginary parts of the $m$ corresponding complex sequences.

## 2  Specification

 SUBROUTINE C06GSF ( M, N, X, U, V, IFAIL)
 INTEGER M, N, IFAIL REAL (KIND=nag_wp) X(M*N), U(M*N), V(M*N)

## 3  Description

This is a utility routine for use in conjunction with C06FPF and C06FQF (see the C06 Chapter Introduction).

None.

## 5  Parameters

1:     M – INTEGERInput
On entry: $m$, the number of Hermitian sequences to be converted into complex form.
Constraint: ${\mathbf{M}}\ge 1$.
2:     N – INTEGERInput
On entry: $n$, the number of data values in each Hermitian sequence.
Constraint: ${\mathbf{N}}\ge 1$.
3:     X(${\mathbf{M}}×{\mathbf{N}}$) – REAL (KIND=nag_wp) arrayInput
On entry: the data must be stored in X as if in a two-dimensional array of dimension $\left(1:{\mathbf{M}},0:{\mathbf{N}}-1\right)$; each of the $m$ sequences is stored in a row of the array in Hermitian form. If the $n$ data values ${z}_{j}^{p}$ are written as ${x}_{j}^{p}+i{y}_{j}^{p}$, then for $0\le j\le n/2$, ${x}_{j}^{p}$ is contained in ${\mathbf{X}}\left(p,j\right)$, and for $1\le j\le \left(n-1\right)/2$, ${y}_{j}^{p}$ is contained in ${\mathbf{X}}\left(p,n-j\right)$. (See also Section 2.1.2 in the C06 Chapter Introduction.)
4:     U(${\mathbf{M}}×{\mathbf{N}}$) – REAL (KIND=nag_wp) arrayOutput
5:     V(${\mathbf{M}}×{\mathbf{N}}$) – REAL (KIND=nag_wp) arrayOutput
On exit: the real and imaginary parts of the $m$ sequences of length $n$, are stored in U and V respectively, as if in two-dimensional arrays of dimension $\left(1:{\mathbf{M}},0:{\mathbf{N}}-1\right)$; each of the $m$ sequences is stored as if in a row of each array. In other words, if the real parts of the $p$th sequence are denoted by ${x}_{\mathit{j}}^{p}$, for $\mathit{j}=0,1,\dots ,n-1$ then the $mn$ elements of the array U contain the values
 $x01, x02, …, x0m, x11, x12, …, x1m, …, x n-1 1 , x n-1 2 ,…, x n-1 m$
6:     IFAIL – INTEGERInput/Output
On entry: IFAIL must be set to $0$, $-1\text{​ or ​}1$. If you are unfamiliar with this parameter you should refer to Section 3.3 in the Essential Introduction for details.
For environments where it might be inappropriate to halt program execution when an error is detected, the value $-1\text{​ or ​}1$ is recommended. If the output of error messages is undesirable, then the value $1$ is recommended. Otherwise, if you are not familiar with this parameter, the recommended value is $0$. When the value $-\mathbf{1}\text{​ or ​}\mathbf{1}$ is used it is essential to test the value of IFAIL on exit.
On exit: ${\mathbf{IFAIL}}={\mathbf{0}}$ unless the routine detects an error or a warning has been flagged (see Section 6).

## 6  Error Indicators and Warnings

If on entry ${\mathbf{IFAIL}}={\mathbf{0}}$ or $-{\mathbf{1}}$, explanatory error messages are output on the current error message unit (as defined by X04AAF).
Errors or warnings detected by the routine:
${\mathbf{IFAIL}}=1$
 On entry, ${\mathbf{M}}<1$.
${\mathbf{IFAIL}}=2$
 On entry, ${\mathbf{N}}<1$.

Exact.

None.

## 9  Example

This example reads in sequences of real data values which are assumed to be Hermitian sequences of complex data stored in Hermitian form. The sequences are then expanded into full complex form using C06GSF and printed.

### 9.1  Program Text

Program Text (c06gsfe.f90)

### 9.2  Program Data

Program Data (c06gsfe.d)

### 9.3  Program Results

Program Results (c06gsfe.r)