Navigation

Operators and Keywords

Function List:

C++ API

: AA = balance (A)
: AA = balance (A, opt)
: [DD, AA] = balance (A, opt)
: [D, P, AA] = balance (A, opt)
: [CC, DD, AA, BB] = balance (A, B, opt)

Balance the matrix A to reduce numerical errors in future calculations.

Compute AA = DD \ A * DD in which AA is a matrix whose row and column norms are roughly equal in magnitude, and DD = P * D, in which P is a permutation matrix and D is a diagonal matrix of powers of two. This allows the equilibration to be computed without round-off. Results of eigenvalue calculation are typically improved by balancing first.

If two output values are requested, balance returns the diagonal D and the permutation P separately as vectors. In this case, DD = eye(n)(:,P) * diag (D), where n is the matrix size.

If four output values are requested, compute AA = CC*A*DD and BB = CC*B*DD, in which AA and BB have nonzero elements of approximately the same magnitude and CC and DD are permuted diagonal matrices as in DD for the algebraic eigenvalue problem.

The eigenvalue balancing option opt may be one of:

"noperm", "S"

Scale only; do not permute.

"noscal", "P"

Permute only; do not scale.

Algebraic eigenvalue balancing uses standard LAPACK routines.

Generalized eigenvalue problem balancing uses Ward’s algorithm (SIAM Journal on Scientific and Statistical Computing, 1981).

Package: octave