nag_dgbequ (f07bfc) (PDF version)
f07 Chapter Contents
f07 Chapter Introduction
NAG Library Manual

NAG Library Function Document

nag_dgbequ (f07bfc)

+ Contents

    1  Purpose
    7  Accuracy

1  Purpose

nag_dgbequ (f07bfc) computes diagonal scaling matrices DR  and DC  intended to equilibrate a real m  by n  band matrix A  of band width kl + ku + 1 , and reduce its condition number.

2  Specification

#include <nag.h>
#include <nagf07.h>
void  nag_dgbequ (Nag_OrderType order, Integer m, Integer n, Integer kl, Integer ku, const double ab[], Integer pdab, double r[], double c[], double *rowcnd, double *colcnd, double *amax, NagError *fail)

3  Description

nag_dgbequ (f07bfc) computes the diagonal scaling matrices. The diagonal scaling matrices are chosen to try to make the elements of largest absolute value in each row and column of the matrix B  given by
have absolute value 1 . The diagonal elements of DR  and DC  are restricted to lie in the safe range δ,1/δ , where δ  is the value returned by function nag_real_safe_small_number (X02AMC). Use of these scaling factors is not guaranteed to reduce the condition number of A  but works well in practice.

4  References


5  Arguments

1:     orderNag_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:     mIntegerInput
On entry: m, the number of rows of the matrix A.
Constraint: m0.
3:     nIntegerInput
On entry: n, the number of columns of the matrix A.
Constraint: n0.
4:     klIntegerInput
On entry: kl, the number of subdiagonals of the matrix A.
Constraint: kl0.
5:     kuIntegerInput
On entry: ku, the number of superdiagonals of the matrix A.
Constraint: ku0.
6:     ab[dim]const doubleInput
Note: the dimension, dim, of the array ab must be at least
  • max1,pdab×n when order=Nag_ColMajor;
  • max1,m×pdab when order=Nag_RowMajor.
On entry: the m by n 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 Aij, for row i=1,,m and column j=max1,i-kl,,minn,i+ku, depends on the order argument as follows:
  • if order=Nag_ColMajor, Aij is stored as ab[j-1×pdab+ku+i-j];
  • if order=Nag_RowMajor, Aij is stored as ab[i-1×pdab+kl+j-i].
See Section 9 in nag_dgbsv (f07bac) for further details.
7:     pdabIntegerInput
On entry: the stride separating row or column elements (depending on the value of order) of the matrix A in the array ab.
Constraint: pdabkl+ku+1.
8:     r[m]doubleOutput
On exit: if fail.code= NE_NOERROR or fail.code= NE_MAT_COL_ZERO, r contains the row scale factors, the diagonal elements of DR. The elements of r will be positive.
9:     c[n]doubleOutput
On exit: if fail.code= NE_NOERROR, c contains the column scale factors, the diagonal elements of DC. The elements of c will be positive.
10:   rowcnddouble *Output
On exit: if fail.code= NE_NOERROR or fail.code= NE_MAT_COL_ZERO, rowcnd contains the ratio of the smallest value of r[i-1] to the largest value of r[i-1]. If rowcnd0.1 and amax is neither too large nor too small, it is not worth scaling by DR.
11:   colcnddouble *Output
On exit: if fail.code= NE_NOERROR, colcnd contains the ratio of the smallest value of c[i-1] to the largest value of c[i-1].
If colcnd0.1, it is not worth scaling by DC.
12:   amaxdouble *Output
On exit: maxaij. If amax is very close to overflow or underflow, the matrix A should be scaled.
13:   failNagError *Input/Output
The NAG error argument (see Section 3.6 in the Essential Introduction).

6  Error Indicators and Warnings

Dynamic memory allocation failed.
On entry, argument value had an illegal value.
On entry, kl=value.
Constraint: kl0.
On entry, ku=value.
Constraint: ku0.
On entry, m=value.
Constraint: m0.
On entry, n=value.
Constraint: n0.
On entry, pdab=value.
Constraint: pdab>0.
On entry, pdab=value, kl=value and ku=value.
Constraint: pdabkl+ku+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.
The value column of A is exactly zero.
The value row of A is exactly zero.

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_zgbequ (f07btc).

10  Example

This example equilibrates the band matrix A  given by
A = -0.23 2.54 -3.66×10-10 -0 -6.98×1010 2.46×1010 -2.73 -2.13×1010 -0 2.56 -2.46×10-10 -4.07 -0 0 -4.78×10-10 -3.82 .
Details of the scaling factors, and the scaled matrix are output.

10.1  Program Text

Program Text (f07bfce.c)

10.2  Program Data

Program Data (f07bfce.d)

10.3  Program Results

Program Results (f07bfce.r)

nag_dgbequ (f07bfc) (PDF version)
f07 Chapter Contents
f07 Chapter Introduction
NAG Library Manual

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