Integer type:  int32  int64  nag_int  show int32  show int32  show int64  show int64  show nag_int  show nag_int

Chapter Contents
Chapter Introduction
NAG Toolbox

# NAG Toolbox: nag_matop_ztrttf (f01vf)

## Purpose

nag_matop_ztrttf (f01vf) copies a complex triangular matrix stored full format in a two-dimensional array to Rectangular Full Packed (RFP) format. The RFP storage format is described in Section [Rectangular Full Packed (RFP) Storage] in the F07 Chapter Introduction.

## Syntax

[arf, info] = f01vf(transr, uplo, a, 'n', n)
[arf, info] = nag_matop_ztrttf(transr, uplo, a, 'n', n)

## Description

nag_matop_ztrttf (f01vf) packs a complex n$n$ by n$n$ triangular matrix A$A$, stored conventionally in a two-dimensional array into RFP format. This function is intended for possible use in conjunction with functions from Chapter F07 where some functions that use triangular matrices store them in RFP format.

None.

## Parameters

### Compulsory Input Parameters

1:     transr – string (length ≥ 1)
Specifies whether the normal RFP representation of A$A$ or its conjugate transpose is stored.
transr = 'N'${\mathbf{transr}}=\text{'N'}$
The matrix A$A$ is stored in normal RFP format.
transr = 'C'${\mathbf{transr}}=\text{'C'}$
The conjugate transpose of the RFP representation of the matrix A$A$ is stored.
Constraint: transr = 'N'${\mathbf{transr}}=\text{'N'}$ or 'C'$\text{'C'}$.
2:     uplo – string (length ≥ 1)
Specifies whether A$A$ is upper or lower triangular.
uplo = 'U'${\mathbf{uplo}}=\text{'U'}$
A$A$ is upper triangular.
uplo = 'L'${\mathbf{uplo}}=\text{'L'}$
A$A$ is lower triangular.
Constraint: uplo = 'U'${\mathbf{uplo}}=\text{'U'}$ or 'L'$\text{'L'}$.
3:     a(lda, : $:$) – complex array
The first dimension of the array a must be at least max (1,n)$\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{n}}\right)$
The second dimension of the array must be at least n${\mathbf{n}}$
The triangular matrix A$A$.
• If uplo = 'U'${\mathbf{uplo}}=\text{'U'}$, a$a$ is upper triangular and the elements of the array below the diagonal are not referenced.
• If uplo = 'L'${\mathbf{uplo}}=\text{'L'}$, a$a$ is lower triangular and the elements of the array above the diagonal are not referenced.

### Optional Input Parameters

1:     n – int64int32nag_int scalar
Default: The first dimension of the array a.
n$n$, the order of the matrix A$A$.
Constraint: n0${\mathbf{n}}\ge 0$.

lda

### Output Parameters

1:     arf(n × (n + 1) / 2${\mathbf{n}}×\left({\mathbf{n}}+1\right)/2$) – complex array
The triangular matrix A$A$ in RFP format, as described in Section [Rectangular Full Packed (RFP) Storage] in the F07 Chapter Introduction.
2:     info – int64int32nag_int scalar
info = 0${\mathbf{info}}=0$ unless the function detects an error (see Section [Error Indicators and Warnings]).

## Error Indicators and Warnings

info = i${\mathbf{info}}=-i$
If info = i${\mathbf{info}}=-i$, parameter i$i$ had an illegal value on entry. The parameters are numbered as follows:
1: transr, 2: uplo, 3: n, 4: a, 5: lda, 6: arf, 7: info.
It is possible that info refers to a parameter that is omitted from the MATLAB interface. This usually indicates that an error in one of the other input parameters has caused an incorrect value to be inferred.

Not applicable.

None.

## Example

```function nag_matop_ztrttf_example
uplo   = 'u';
transr = 'n';
a = [1.1000 + 1.1000i,  1.2000 + 1.2000i,  1.3000 + 1.3000i,  1.4000 + 1.4000i;
0,              2.2000 + 2.2000i,  2.3000 + 2.3000i,  2.4000 + 2.4000i;
0,                  0,             3.3000 + 3.3000i,  3.4000 + 3.4000i;
0,                  0,                  0,            4.4000 + 4.4000i];
% Print the unpacked matrix
fprintf('\n');
[ifail] = ...
nag_file_print_matrix_complex_gen_comp(uplo, 'n', a, 'b', 'f5.2', 'Unpacked matrix a:', 'i', ...
'i', int64(80), int64(0));
% Convert to Rectangular Full Packed form
[arf, info] = nag_matop_ztrttf(transr, uplo, a);
% Print the packed vector
fprintf('\n');
[ifail] = ...
nag_file_print_matrix_complex_gen_comp('g', 'x', arf, 'b', 'f5.2', 'RFP Packed Array arf:', 'i', ...
'n', int64(80), int64(0))
```
```

Unpacked matrix a:
1             2             3             4
1  ( 1.10, 1.10) ( 1.20, 1.20) ( 1.30, 1.30) ( 1.40, 1.40)
2                ( 2.20, 2.20) ( 2.30, 2.30) ( 2.40, 2.40)
3                              ( 3.30, 3.30) ( 3.40, 3.40)
4                                            ( 4.40, 4.40)

RFP Packed Array arf:
1  ( 1.30, 1.30)
2  ( 2.30, 2.30)
3  ( 3.30, 3.30)
4  ( 1.10,-1.10)
5  ( 1.20,-1.20)
6  ( 1.40, 1.40)
7  ( 2.40, 2.40)
8  ( 3.40, 3.40)
9  ( 4.40, 4.40)
10  ( 2.20,-2.20)

ifail =

0

```
```function f01vf_example
uplo   = 'u';
transr = 'n';
a = [1.1000 + 1.1000i,  1.2000 + 1.2000i,  1.3000 + 1.3000i,  1.4000 + 1.4000i;
0,              2.2000 + 2.2000i,  2.3000 + 2.3000i,  2.4000 + 2.4000i;
0,                  0,             3.3000 + 3.3000i,  3.4000 + 3.4000i;
0,                  0,                  0,            4.4000 + 4.4000i];
% Print the unpacked matrix
fprintf('\n');
[ifail] = x04db(uplo, 'n', a, 'b', 'f5.2', 'Unpacked matrix a:', 'i', ...
'i', int64(80), int64(0));
% Convert to Rectangular Full Packed form
[arf, info] = f01vf(transr, uplo, a);
% Print the packed vector
fprintf('\n');
[ifail] = x04db('g', 'x', arf, 'b', 'f5.2', 'RFP Packed Array arf:', 'i', ...
'n', int64(80), int64(0))
```
```

Unpacked matrix a:
1             2             3             4
1  ( 1.10, 1.10) ( 1.20, 1.20) ( 1.30, 1.30) ( 1.40, 1.40)
2                ( 2.20, 2.20) ( 2.30, 2.30) ( 2.40, 2.40)
3                              ( 3.30, 3.30) ( 3.40, 3.40)
4                                            ( 4.40, 4.40)

RFP Packed Array arf:
1  ( 1.30, 1.30)
2  ( 2.30, 2.30)
3  ( 3.30, 3.30)
4  ( 1.10,-1.10)
5  ( 1.20,-1.20)
6  ( 1.40, 1.40)
7  ( 2.40, 2.40)
8  ( 3.40, 3.40)
9  ( 4.40, 4.40)
10  ( 2.20,-2.20)

ifail =

0

```