|
NAG[f08nhc] NAG[nag_dgebal] - Balance real general matrix
|
|
Calling Sequence
f08nhc(job, a, ilo, ihi, scale, 'n'=n, 'fail'=fail)
nag_dgebal(. . .)
Parameters
|
a - Matrix(1..dim1, 1..dim2, datatype=float[8], order=order);
|
|
|
Note: this array may be supplied in Fortran_order or C_order , as specified by order. All array parameters must use a consistent order.
|
|
On exit: is overwritten by the balanced matrix. If , a is not referenced.
|
|
|
ilo - assignable;
ihi - assignable;
|
|
|
Note: On exit the variable ilo will have a value of type integer, ihi will have a value of type integer.
|
|
|
scale - Vector(1..dim, datatype=float[8]);
|
|
|
Note: the dimension, dim, of the array scale must be at least .
|
|
|
'n'=n - integer; (optional)
|
|
|
Default value: the dimension of the array a.
|
|
On entry: , the order of the matrix .
|
|
Constraint: . .
|
|
|
'fail'=fail - table; (optional)
|
|
|
The NAG error argument, see the documentation for NagError.
|
|
|
|
Description
|
|
|
Purpose
|
|
nag_dgebal (f08nhc) balances a real general matrix in order to improve the accuracy of computed eigenvalues and/or eigenvectors.
|
|
Description
|
|
nag_dgebal (f08nhc) balances a real general matrix . The term "balancing" covers two steps, each of which involves a similarity transformation of . The function can perform either or both of these steps.
|
The function first attempts to permute to block upper triangular form by a similarity transformation:
|
|
The function applies a diagonal similarity transformation to , to make the rows and columns of as close in norm as possible:
|
|
This scaling can reduce the norm of the matrix (that is, ) and hence reduce the effect of rounding errors on the accuracy of computed eigenvalues and eigenvectors.
|
|
|
Error Indicators and Warnings
|
|
"NE_ALLOC_FAIL"
Dynamic memory allocation failed.
"NE_BAD_PARAM"
On entry, argument had an illegal value.
"NE_INT"
On entry, . Constraint: .
"NE_INTERNAL_ERROR"
An internal error has occurred in this function. Check the function call and any array sizes. If the call is correct then please consult NAG for assistance.
|
|
Accuracy
|
|
The errors are negligible.
|
|
|
Examples
|
|
>
|
job := "Nag_DoBoth":
n := 4:
a := Matrix([[5.14, 0.91, 0, -32.8], [0.91, 0.2, 0, 34.5], [1.9, 0.8, -0.4, -3], [-0.33, 0.35, 0, 0.66]], datatype=float[8]):
scale := Vector(4, datatype=float[8]):
NAG:-f08nhc(job, a, ilo, ihi, scale, 'n' = n):
|
|
|