public void renormalizeN ( ) { int targetMax = maxN / 20 ; for ( int i = 0 ; i < managers . length ; i ++ ) { TldFernManager m = managers [ i ] ; for ( int j = 0 ; j < m . table . length ; j ++ ) { TldFernFeature f = m . table [ j ] ; if ( f == null ) continue ; f . numN = targetMax * f . numN / maxN ; } } maxN = targetMax ; }
Renormalizes fern . numN to avoid overflow