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)

Purpose

nag_blast_dgb_norm (f16rb) calculates the value of the 11-norm, the -norm, the Frobenius norm or the maximum absolute value of the elements of a real mm by nn band matrix, stored in banded form.
It can also be used to compute the value of the 22-norm of a row nn-vector or a column mm-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 mm by nn banded matrix, AA, nag_blast_dgb_norm (f16rb) calculates one of the values given by
A1 = maxj i = 1m|aij|A1=maxji=1m|aij| (the 11-norm of AA),
A = maxi j = 1n|aij|A=maxij= 1n|aij| (the -norm of AA),
AF = (i = 1mj = 1n|aij|2)1 / 2AF=(i=1mj=1n|aij|2)1/2 (the Frobenius norm of AA),   or
maxi,j |aij|maxi,j|aij| (the maximum absolute element value of AA).
If mm or nn is 11 then additionally nag_blast_dgb_norm (f16rb) can calculate the value A2 = sqrt(ai2)A2=ai2 (the 22-norm of AA).

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 = 'One_Norm'job='One_Norm'
The 11-norm.
job = 'Two_Norm'job='Two_Norm'
The 22-norm of a row or column vector.
job = 'Inf_Norm'job='Inf_Norm'
The -norm.
job = 'Frobenius_Norm'job='Frobenius_Norm'
The Frobenius (or Euclidean) norm.
job = 'Max_Norm'job='Max_Norm'
The value maxi,j |aij|maxi,j|aij| (not a norm).
Constraint: job = 'One_Norm'job='One_Norm', 'Two_Norm''Two_Norm', 'Inf_Norm''Inf_Norm', 'Frobenius_Norm''Frobenius_Norm' or 'Max_Norm''Max_Norm'.
2:     m – int64int32nag_int scalar
mm, the number of rows of the matrix AA. If m0m0 on input, nag_blast_dgb_norm (f16rb) returns 00.
3:     kl – int64int32nag_int scalar
klkl, the number of subdiagonals within the band of AA. If kl0kl0 on input, nag_blast_dgb_norm (f16rb) returns 00.
4:     ku – int64int32nag_int scalar
kuku, the number of superdiagonals within the band of AA. If ku0ku0 on input, nag_blast_dgb_norm (f16rb) returns 00.
5:     ab(ldab, : :) – double array
The first dimension of the array ab must be at least kl + ku + 1kl+ku+1
The second dimension of the array must be at least max (1,n)max(1,n)
The mm by nn band matrix AA.
The matrix is stored in rows 11 to kl + ku + 1kl+ku+1, more precisely, the element AijAij must be stored in
ab(ku + 1 + ij,j)  for ​max (1,jku)imin (m,j + kl).
abku+1+i-jj  for ​max(1,j-ku)imin(m,j+kl).

Optional Input Parameters

1:     n – int64int32nag_int scalar
Default: The second dimension of the array ab.
nn, the number of columns of the matrix AA. If n0n0 on input, nag_blast_dgb_norm (f16rb) returns 00.

Input Parameters Omitted from the MATLAB Interface

ldab

Output Parameters

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

Error Indicators and Warnings

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

function nag_blast_dgb_norm_example
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] = nag_matop_real_band_pack('p', kl, ku, a, ab);

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

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

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

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

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

Norms of banded matrix ab:

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

function f16rb_example
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);
 

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–2013