|
NAG[f08wvc] NAG[nag_zggbal] - Balance a pair of complex general matrices
|
|
Calling Sequence
f08wvc(job, n, a, b, ilo, ihi, lscale, rscale, 'fail'=fail)
nag_zggbal(. . .)
Parameters
|
job - String;
|
|
|
On entry: specifies the operations to be performed on matrices and .
|
|
Only permutations are used in balancing.
|
|
Only scalings are are used in balancing.
|
|
Both permutations and scalings are used in balancing.
|
|
Constraint: "Nag_DoNothing", "Nag_Permute", "Nag_Scale" or "Nag_DoBoth". .
|
|
|
n - integer;
|
|
|
Constraint: . .
|
|
|
a - Matrix(1..dim1, 1..dim2, datatype=complex[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.
|
|
|
b - Matrix(1..dim1, 1..dim2, datatype=complex[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 , b 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.
|
|
|
lscale - Vector(1..dim, datatype=float[8]);
|
|
|
Note: the dimension, dim, of the array lscale must be at least .
|
|
, for ;
|
|
, for ;
|
|
, for .
|
|
|
'fail'=fail - table; (optional)
|
|
|
The NAG error argument, see the documentation for NagError.
|
|
|
|
Description
|
|
|
Purpose
|
|
nag_zggbal (f08wvc) balances a pair of complex square matrices of order . Balancing usually improves the accuracy of computed generalized eigenvalues and eigenvectors.
|
|
Description
|
|
Balancing may reduce the 1-norm of the matrices and improve the accuracy of the computed eigenvalues and eigenvectors in the complex generalized eigenvalue problem
nag_zggbal (f08wvc) is usually the first step in the solution of the above generalized eigenvalue problem. Balancing is optional but it is highly recommended.
The term "balancing" covers two steps, each of which involves similarity transformations on and . The function can perform either or both of these steps. Both steps are optional.
|
The function first attempts to permute and 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 transformation usually improves the accuracy of computed generalized 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, compared to those in subsequent computations.
|
|
Further Comments
|
|
nag_zggbal (f08wvc) is usually the first step in computing the complex generalized eigenvalue problem but it is an optional step. The matrix is reduced to the triangular form using the factorization function f08asc (nag_zgeqrf) and the unitary transformation is applied to the matrix by calling f08auc (nag_zunmqr). This is followed by f08wsc (nag_zgghrd) which reduces the matrix pair into the generalized Hessenberg form.
If the matrix pair is balanced by this function, then any generalized eigenvectors computed subsequently are eigenvectors of the balanced matrix pair. In that case, to compute the generalized eigenvectors of the original matrix, f08wwc (nag_zggbak) must be called.
The total number of floating-point operations is approximately proportional to .
The real analogue of this function is f08whc (nag_dggbal).
|
|
|
Examples
|
|
>
|
job := "Nag_DoBoth":
n := 4:
a := Matrix([[1 +3*I , 1 +4*I , 1 +5*I , 1 +6*I ], [2 +2*I , 4 +3*I , 8 +4*I , 16 +5*I ], [3 +1*I , 9 +2*I , 27 +3*I , 81 +4*I ], [4 +0*I , 16 +1*I , 64 +2*I , 256 +3*I ]], datatype=complex[8]):
b := Matrix([[1 +0*I , 2 +1*I , 3 +2*I , 4 +3*I ], [1 +1*I , 4 +2*I , 9 +3*I , 16 +4*I ], [1 +2*I , 8 +3*I , 27 +4*I , 64 +5*I ], [1 +3*I , 16 +4*I , 81 +5*I , 256 +6*I ]], datatype=complex[8]):
lscale := Vector(4, datatype=float[8]):
rscale := Vector(4, datatype=float[8]):
NAG:-f08wvc(job, n, a, b, ilo, ihi, lscale, rscale):
|


|
|