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_blast_zgb_norm (f16ub)

 Contents

    1  Purpose
    2  Syntax
    7  Accuracy
    9  Example

Purpose

nag_blast_zgb_norm (f16ub) calculates the value of the 1-norm, the -norm, the Frobenius norm or the maximum absolute value of the elements of a complex m by n band matrix stored in banded packed form.
It can also be used to compute the value of the 2-norm of a row n-vector or a column m-vector.

Syntax

[result] = f16ub(job, m, kl, ku, ab, 'n', n)
[result] = nag_blast_zgb_norm(job, m, kl, ku, ab, 'n', n)

Description

Given a complex m by n band matrix, A, nag_blast_zgb_norm (f16ub) calculates one of the values given by
A1=maxji=1maij (the 1-norm of A),
A=maxij= 1naij (the -norm of A),
AF=i=1mj=1n aij21/2 (the Frobenius norm of A),  or
maxi,jaij (the maximum absolute element value of A).
If m or n is 1 then additionally nag_blast_zgb_norm (f16ub) can calculate the value A2=ai2 (the 2-norm of A).

References

Basic Linear Algebra Subprograms Technical (BLAST) Forum (2001) Basic Linear Algebra Subprograms Technical (BLAST) Forum Standard University of Tennessee, Knoxville, Tennessee http://www.netlib.org/blas/blast-forum/blas-report.pdf

Parameters

Compulsory Input Parameters

1:     job – string (length ≥ 1)
Specifies the value to be returned.
job='O'
The 1-norm.
job='T'
The 2-norm of a row or column vector.
job='I'
The -norm.
job='F'
The Frobenius (or Euclidean) norm.
job='M'
The value maxi,jaij (not a norm).
Constraints:
  • job='O', 'T', 'I', 'F' or 'M';
  • if job='T', m=1 or n=1.
2:     m int64int32nag_int scalar
m, the number of rows of the matrix A. If m0 on input, nag_blast_zgb_norm (f16ub) returns 0.
3:     kl int64int32nag_int scalar
kl, the number of subdiagonals within the band of A. If kl0 on input, nag_blast_zgb_norm (f16ub) returns 0.
4:     ku int64int32nag_int scalar
ku, the number of superdiagonals within the band of A. If ku0 on input, nag_blast_zgb_norm (f16ub) returns 0.
5:     abldab: – complex array
The first dimension of the array ab must be at least kl+ku+1.
The second dimension of the array ab must be at least max1,n.
The m by n band matrix A.
The matrix is stored in rows 1 to kl+ku+1, more precisely, the element Aij must be stored in
abku+1+i-jj  for ​max1,j-kuiminm,j+kl. 

Optional Input Parameters

1:     n int64int32nag_int scalar
Default: the second dimension of the array ab.
n, the number of columns of the matrix A. If n0 on input, nag_blast_zgb_norm (f16ub) returns 0.

Output Parameters

1:     result – double scalar
The result of the function.

Error Indicators and Warnings

If any constraint on an input parameter is violated, an error message is printed and program execution is terminated.

Accuracy

The BLAS standard requires accurate implementations which avoid unnecessary over/underflow (see Section 2.7 of Basic Linear Algebra Subprograms Technical (BLAST) Forum (2001)).

Further Comments

None.

Example

Reads in a 6 by 4 banded complex matrix A with two subdiagonals and one superdiagonal, and prints the four norms of A.
function f16ub_example


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

kl = int64(2);
ku = int64(1);
m  = int64(6);
a = [ 1+i, 1+2i, 0,    0;
      2+i, 2+2i, 2+3i, 0;
      3+i, 3+2i, 3+3i, 3+4i;
      0,   4+2i, 4+3i, 4+4i;
      0,   0,    5+3i, 5+4i;
      0,   0,    0,    6+4i];
ab = complex(zeros(4, 6));
% Convert a to packed storage
[a, ab, ifail] = f01zd( ...
			'p', kl, ku, a, ab);

fprintf('\nNorms of banded matrix ab:\n\n');

r_one = f16ub('o', m, kl, ku, ab);
fprintf('One norm           = %9.4f\n', r_one);

r_inf = f16ub('i', m, kl, ku, ab);
fprintf('Infinity norm      = %9.4f\n', r_inf);

r_fro = f16ub('f', m, kl, ku, ab);
fprintf('Frobenious norm    = %9.4f\n', r_fro);

r_max = f16ub('m', m, kl, ku, ab);
fprintf('Maximum norm       = %9.4f\n', r_max);


f16ub example results


Norms of banded matrix ab:

One norm           =   24.2711
Infinity norm      =   16.0105
Frobenious norm    =   17.4069
Maximum norm       =    7.2111

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