Function Reference
— Loadable Function: aa = balance (a, opt)
— Loadable Function: [dd, aa] = balance (a, opt)
— Loadable Function: [cc, dd, aa, bb] = balance (a, b, opt)

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 roundoff. Results of eigenvalue calculation are typically improved by balancing first.

If four output values are requested, compute aa = cc*a*dd and bb = cc*b*dd), in which aa and bb have non-zero 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:

"N", "n"
No balancing; arguments copied, transformation(s) set to identity.
"P", "p"
Permute argument(s) to isolate eigenvalues where possible.
"S", "s"
Scale to improve accuracy of computed eigenvalues.
"B", "b"
Permute and scale, in that order. Rows/columns of a (and b) that are isolated by permutation are not scaled. This is the default behavior.

Algebraic eigenvalue balancing uses standard Lapack routines.

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