{
// scale diagonal
Tnew.set(i,i, Math.pow(Tnew.get(i,i), 1.0/timescaleFactor));
// compute off-diagonal scaling factor
double cOffdiag = (1.0 - Tnew.get(i,i)) / (alg.sum(Tnew.viewRow(i)) - Tnew.get(i,i));
for (int j=0; j<Tnew.columns(); j++)
{
if (j != i)
Tnew.set(i, j, cOffdiag * Tnew.get(i,j));