NAG Library Function Document
nag_dpoequ (f07ffc) computes a diagonal scaling matrix intended to equilibrate a real by symmetric positive definite matrix and reduce its condition number.
||nag_dpoequ (Nag_OrderType order,
const double a,
nag_dpoequ (f07ffc) computes a diagonal scaling matrix
chosen so that
This means that the matrix
has diagonal elements equal to unity. This in turn means that the condition number of
, is within a factor
of the matrix of smallest possible condition number over all possible choices of diagonal scalings (see Corollary 7.6 of Higham (2002)
Higham N J (2002) Accuracy and Stability of Numerical Algorithms (2nd Edition) SIAM, Philadelphia
order – Nag_OrderTypeInput
: 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
. See Section 126.96.36.199
in the Essential Introduction for a more detailed explanation of the use of this argument.
n – IntegerInput
, the order of the matrix .
a – const doubleInput
the dimension, dim
, of the array a
must be at least
th element of the matrix
is stored in
- when ;
- when .
: the matrix
whose scaling factors are to be computed. Only the diagonal elements of the array a
pda – IntegerInput
: the stride separating row or column elements (depending on the value of order
) in the array a
s[n] – doubleOutput
contains the diagonal elements of the scaling matrix
scond – double *Output
contains the ratio of the smallest value of s
to the largest value of s
is neither too large nor too small, it is not worth scaling by
amax – double *Output
. If amax
is very close to overflow or underflow, the matrix
should be scaled.
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.
On entry, argument had an illegal value.
On entry, .
On entry, .
On entry, and .
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
The th diagonal element of is not positive (and hence cannot be positive definite).
The computed scale factors will be close to the exact scale factors.
The complex analogue of this function is nag_zpoequ (f07ftc)
This example equilibrates the symmetric positive definite matrix
Details of the scaling factors and the scaled matrix are output.
9.1 Program Text
Program Text (f07ffce.c)
9.2 Program Data
Program Data (f07ffce.d)
9.3 Program Results
Program Results (f07ffce.r)