nag_dpbequ (f07hfc) (PDF version)
f07 Chapter Contents
f07 Chapter Introduction
NAG Library Manual

NAG Library Function Document

nag_dpbequ (f07hfc)


    1  Purpose
    7  Accuracy

1  Purpose

nag_dpbequ (f07hfc) computes a diagonal scaling matrix S  intended to equilibrate a real n  by n  symmetric positive definite band matrix A , with bandwidth 2kd+1 , and reduce its condition number.

2  Specification

#include <nag.h>
#include <nagf07.h>
void  nag_dpbequ (Nag_OrderType order, Nag_UploType uplo, Integer n, Integer kd, const double ab[], Integer pdab, double s[], double *scond, double *amax, NagError *fail)

3  Description

nag_dpbequ (f07hfc) computes a diagonal scaling matrix S  chosen so that
sj=1 / ajj .  
This means that the matrix B  given by
B=SAS ,  
has diagonal elements equal to unity. This in turn means that the condition number of B , κ2B , is within a factor n  of the matrix of smallest possible condition number over all possible choices of diagonal scalings (see Corollary 7.6 of Higham (2002)).

4  References

Higham N J (2002) Accuracy and Stability of Numerical Algorithms (2nd Edition) SIAM, Philadelphia

5  Arguments

1:     order Nag_OrderTypeInput
On entry: the order argument specifies the two-dimensional storage scheme being used, i.e., row-major ordering or column-major ordering. C language defined storage is specified by order=Nag_RowMajor. See Section in the Essential Introduction for a more detailed explanation of the use of this argument.
Constraint: order=Nag_RowMajor or Nag_ColMajor.
2:     uplo Nag_UploTypeInput
On entry: indicates whether the upper or lower triangular part of A is stored in the array ab, as follows:
The upper triangle of A is stored.
The lower triangle of A is stored.
Constraint: uplo=Nag_Upper or Nag_Lower.
3:     n IntegerInput
On entry: n, the order of the matrix A.
Constraint: n0.
4:     kd IntegerInput
On entry: kd, the number of superdiagonals of the matrix A if uplo=Nag_Upper, or the number of subdiagonals if uplo=Nag_Lower.
Constraint: kd0.
5:     ab[dim] const doubleInput
Note: the dimension, dim, of the array ab must be at least max1,pdab×n.
On entry: the upper or lower triangle of the symmetric positive definite band matrix A whose scaling factors are to be computed.
This is stored as a notional two-dimensional array with row elements or column elements stored contiguously. The storage of elements of Aij, depends on the order and uplo arguments as follows:
  • if order=Nag_ColMajor and uplo=Nag_Upper,
              Aij is stored in ab[kd+i-j+j-1×pdab], for j=1,,n and i=max1,j-kd,,j;
  • if order=Nag_ColMajor and uplo=Nag_Lower,
              Aij is stored in ab[i-j+j-1×pdab], for j=1,,n and i=j,,minn,j+kd;
  • if order=Nag_RowMajor and uplo=Nag_Upper,
              Aij is stored in ab[j-i+i-1×pdab], for i=1,,n and j=i,,minn,i+kd;
  • if order=Nag_RowMajor and uplo=Nag_Lower,
              Aij is stored in ab[kd+j-i+i-1×pdab], for i=1,,n and j=max1,i-kd,,i.
Only the elements of the array ab corresponding to the diagonal elements of A are referenced. (Row kd+1 of ab when uplo=Nag_Upper, row 1 of ab when uplo=Nag_Lower.)
6:     pdab IntegerInput
On entry: the stride separating row or column elements (depending on the value of order) of the matrix A in the array ab.
Constraint: pdabkd+1.
7:     s[n] doubleOutput
On exit: if fail.code= NE_NOERROR, s contains the diagonal elements of the scaling matrix S.
8:     scond double *Output
On exit: if fail.code= NE_NOERROR, scond contains the ratio of the smallest value of s to the largest value of s. If scond0.1 and amax is neither too large nor too small, it is not worth scaling by S.
9:     amax double *Output
On exit: maxaij. If amax is very close to overflow or underflow, the matrix A should be scaled.
10:   fail NagError *Input/Output
The NAG error argument (see Section 3.6 in the Essential Introduction).

6  Error Indicators and Warnings

Dynamic memory allocation failed.
See Section in the Essential Introduction for further information.
On entry, argument value had an illegal value.
On entry, kd=value.
Constraint: kd0.
On entry, n=value.
Constraint: n0.
On entry, pdab=value.
Constraint: pdab>0.
On entry, pdab=value and kd=value.
Constraint: pdabkd+1.
An internal error has occurred in this function. Check the function call and any array sizes. If the call is correct then please contact NAG for assistance.
An unexpected error has been triggered by this function. Please contact NAG.
See Section 3.6.6 in the Essential Introduction for further information.
The valueth diagonal element of A is not positive (and hence A cannot be positive definite).
Your licence key may have expired or may not have been installed correctly.
See Section 3.6.5 in the Essential Introduction for further information.

7  Accuracy

The computed scale factors will be close to the exact scale factors.

8  Parallelism and Performance

Not applicable.

9  Further Comments

The complex analogue of this function is nag_zpbequ (f07htc).

10  Example

This example equilibrates the symmetric positive definite matrix A  given by
A = 5.49 -2.68×1010 -0 -0 2.68×1010 -5.63×1020 -2.39×1010 -0 0 -2.39×1010 -2.60 -2.22 0 -0 -2.22 -5.17 .  
Details of the scaling factors and the scaled matrix are output.

10.1  Program Text

Program Text (f07hfce.c)

10.2  Program Data

Program Data (f07hfce.d)

10.3  Program Results

Program Results (f07hfce.r)

nag_dpbequ (f07hfc) (PDF version)
f07 Chapter Contents
f07 Chapter Introduction
NAG Library Manual

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