The routine xGEBAL
may be used to **balance** the
matrix ** A** prior to reduction to Hessenberg form. Balancing involves two
steps, either of which is optional:

- first, xGEBAL
attempts to permute
by a similarity transformation to block upper triangular form:*A*

whereis a permutation matrix and*P*and*A*'_{11}are*A*'_{33}*upper triangular*. Thus the matrix is already in Schur form outside the central diagonal blockin rows and columns ILO to IHI. Subsequent operations by xGEBAL, xGEHRD or xHSEQR need only be applied to these rows and columns; therefore ILO and IHI are passed as arguments to xGEHRD and xHSEQR. This can save a significant amount of work if ILO*A*'_{22}**>**1 or IHI**<**. If no suitable permutation can be found (as is very often the case), xGEBAL sets ILO = 1 and IHI =*n*, and*n*is the whole of*A*'_{22}.*A* - secondly, xGEBAL applies a diagonal similarity transformation to
to make the rows and columns of*A*'as close in norm in possible:*A*'_{22}

This can improve the accuracy of later processing in some cases; see subsection 4.8.1.2.

If ** A** was balanced by xGEBAL, then eigenvectors computed by subsequent
operations are eigenvectors of the balanced matrix