code: @Override
  	public DoubleMatrix1D getMatrixScalingFactorsSymm(DoubleMatrix2D A) {
  		DoubleFactory1D F1 = DoubleFactory1D.dense;
  		DoubleFactory2D F2 = DoubleFactory2D.sparse;
  		int dim = A.columns();
  		DoubleMatrix1D D1 = F1.make(dim, 1);
  		DoubleMatrix2D AK = A.copy();
  		DoubleMatrix2D DR = F2.identity(dim);
  		DoubleMatrix1D DRInv = F1.make(dim);
  		int maxIteration = 50;
  		for(int k=0; k<=maxIteration; k++){
  			double normR = -Double.MAX_VALUE;
  			for(int i=0; i<dim; i++){
  				double dri = getRowInfinityNorm(AK, i);
  				DR.setQuick(i, i, Math.sqrt(dri));
  				DRInv.setQuick(i, 1./Math.sqrt(dri));
  				normR = Math.max(normR, Math.abs(1-dri));
  				if(Double.isNaN(normR)){
  					throw new IllegalArgumentException("matrix is singular");
  				}
  			}
  			
  			if(normR < eps){
  				break;
  			}
  			
  			for(int i=0; i<dim; i++){
  				double prevD1I = D1.getQuick(i);
  				double newD1I = prevD1I * DRInv.getQuick(i);
  				D1.setQuick(i, newD1I);
  			}
  			
  			if(k==maxIteration){
  				log.warn("max iteration reached");
  			}
  			
  			AK = ColtUtils.diagonalMatrixMult(DRInv, AK, DRInv);
  		}
  		
  		return D1;
  	}
docs: Scaling factors for symmetric (not singular) matrices.
  Just the subdiagonal elements of the matrix are required.
  @see Daniel Ruiz, "A scaling algorithm to equilibrate both rows and columns norms in matrices"
  @see Philip A. Knight, Daniel Ruiz, Bora Ucar "A Symmetry Preserving Algorithm for Matrix Scaling"