in reply to Re: This runs WAY too slow
in thread This runs WAY too slow
and here#prepopulate copy error array; sub popfilea { foreach my $ya ( 0 .. $gener ) { foreach my $xa ( 0 .. $total ) { $aoa[$xa][$ya] = (int rand(1+2*$copyerr)-$copyerr ) /$PCNT; } } }
moving the sprintf's to this linesub popnum1 { ( $x, $y ) = @_; if ( ($y==0) || ($aod[$x][ $y-1 ] ne 'a') ) { return $initial + $aoa[$x][0]; } else { return $aoa[$x][$y] + $aob[$x][ $y-1 ]; } }
or consider combining the two subs into one so that you have$coper = sprintf '%.2f', popnum1( $x, $y )
hth poj$coper = sprintf '%.2f', popnum( $model, $x, $y )
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: This runs WAY too slow
by Dandello (Monk) on Jan 18, 2011 at 20:52 UTC |