`(D,B)=balance(A)`

Inputs | |

`A` |
A square matrix. |

Outputs | |

`D` |
A diagonal matrix of the same size as `A` . |

`B` |
A matrix of the same size as `A` . |

For a square matrix

`A`

, `balance(A)`

returns a diagonal matrix `D`

such that
` D\B*D=A`

The object of the computation is to find a

`D`

such that `B`

is better
conditioned than `A`

for eigenvalue computations.