hide long namesshow long names
hide short namesshow short names
Integer type:  int32  int64  nag_int  show int32  show int32  show int64  show int64  show nag_int  show nag_int

PDF version (NAG web site, 64-bit version, 64-bit version)
Chapter Contents
Chapter Introduction
NAG Toolbox

NAG Toolbox: nag_matop_dtrttp (f01va)

 Contents

    1  Purpose
    2  Syntax
    7  Accuracy
    9  Example

Purpose

nag_matop_dtrttp (f01va) copies a real triangular matrix, stored in a full format array, to a standard packed format array.

Syntax

[ap, info] = f01va(uplo, a, 'n', n)
[ap, info] = nag_matop_dtrttp(uplo, a, 'n', n)

Description

nag_matop_dtrttp (f01va) packs a real n by n triangular matrix A, stored conventionally in a full format array, into an array of length nn+1/2. The matrix is packed by columns. This function is intended for possible use in conjunction with functions from Chapters F07, F08 and F16 where some functions use triangular matrices stored in the packed form. Packed storage format is described in Packed storage in the F07 Chapter Introduction.

References

None.

Parameters

Compulsory Input Parameters

1:     uplo – string (length ≥ 1)
Specifies whether A is upper or lower triangular.
uplo='U'
A is upper triangular.
uplo='L'
A is lower triangular.
Constraint: uplo='U' or 'L'.
2:     alda: – double array
The first dimension of the array a must be at least max1,n.
The second dimension of the array a must be at least n.
The triangular matrix A.
  • If uplo='U', a is upper triangular and the elements of the array below the diagonal are not referenced.
  • If uplo='L', 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 second dimension of the array a.
n, the order of the matrix A.
Constraint: n0.

Output Parameters

1:     apn×n+1/2 – double array
The n by n triangular matrix A, packed by columns.
More precisely,
  • if uplo='U', the upper triangle of A is stored with element Aij in api+jj-1/2 for ij;
  • if uplo='L', the lower triangle of A is stored with element Aij in api+2n-jj-1/2 for ij.
2:     info int64int32nag_int scalar
info=0 unless the function detects an error (see Error Indicators and Warnings).

Error Indicators and Warnings

   info<0
If info=-i, argument i had an illegal value. An explanatory message is output, and execution of the program is terminated.

Accuracy

Not applicable.

Further Comments

None.

Example

This example reads in a triangular matrix and copies it to packed format.
function f01va_example


fprintf('f01va example results\n\n');

uplo = 'u';
a = [1.1, 1.2, 1.3, 1.4;
     0.0, 2.2, 2.3, 2.4;
     0.0, 0.0, 3.3, 3.4;
     0.0, 0.0, 0.0, 4.4];
% Print the unpacked matrix
fprintf('\n');
[ifail] = x04cb(uplo, 'n', a, 'f5.2', 'Unpacked matrix a:', 'i', ...
                {''}, 'i', {''}, int64(80), int64(0));
% Convert to packed vector form
[ap, info] = f01va(uplo, a);
% Print the packed vector
fprintf('\n');
[ifail] = x04cb('g', 'x', ap, 'f5.2', 'Packed matrix ap:', 'i', ...
                {''}, 'n', {''}, int64(80), int64(0));


f01va example results


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

 Packed matrix ap:
  1  1.10
  2  1.20
  3  2.20
  4  1.30
  5  2.30
  6  3.30
  7  1.40
  8  2.40
  9  3.40
 10  4.40

PDF version (NAG web site, 64-bit version, 64-bit version)
Chapter Contents
Chapter Introduction
NAG Toolbox

© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2015