#include #include #include "nr.h" using namespace std; void NR::balanc(Mat_IO_DP &a) { const DP RADIX = numeric_limits::radix; int i,j,last=0; DP s,r,g,f,c,sqrdx; int n=a.nrows(); sqrdx=RADIX*RADIX; while (last == 0) { last=1; for (i=0;ig) { f /= RADIX; c /= sqrdx; } if ((c+r)/f < 0.95*s) { last=0; g=1.0/f; for (j=0;j