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_dgb_norm (f16rb)

 Contents

    1  Purpose
    2  Syntax
    7  Accuracy
    9  Example

Purpose

nag_blast_dgb_norm (f16rb) calculates the value of the 1-norm, the -norm, the Frobenius norm or the maximum absolute value of the elements of a real m by n band matrix stored in banded 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] = f16rb(job, m, kl, ku, ab, 'n', n)
[result] = nag_blast_dgb_norm(job, m, kl, ku, ab, 'n', n)

Description

Given a real m by n banded matrix, A, nag_blast_dgb_norm (f16rb) 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=1naij21/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_dgb_norm (f16rb) 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_dgb_norm (f16rb) returns 0.
3:     kl int64int32nag_int scalar
kl, the number of subdiagonals within the band of A. If kl0 on input, nag_blast_dgb_norm (f16rb) returns 0.
4:     ku int64int32nag_int scalar
ku, the number of superdiagonals within the band of A. If ku0 on input, nag_blast_dgb_norm (f16rb) returns 0.
5:     abldab: – double 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_dgb_norm (f16rb) 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

Calculates the various norms of a 6 by 4 banded matrix with two subdiagonals and one superdiagonal.
function f16rb_example


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

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

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

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

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

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

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


f16rb example results


Norms of banded matrix ab:

One norm           =   18.0000
Infinity norm      =   12.0000
Frobenious norm    =   13.5647
Maximum norm       =    6.0000

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