my $aref = $matches{ $fasta_id }{ $sitekey }; my( $lo, $hi ) = ( 0, scalar @{ $aref } ); ++$lo while ($aref->[ $lo + 1 ] < $lowerlimit && $lo < $hi-2); --$hi while ($aref->[ $hi - 1 ] > $upperlimit && $hi > 0 );
I would love to post the timing results from dprofpp, but after 25 minutes, it is still running. And, since I have a print statement in there for just this purpose, I know that it is not hung up, the program is still running as intended. So, the binary selector in this case is even slower than the first 2 alternatives.
Back to the drawing board, I guess. I'd really love to make this sub run much much faster.
Hey, here's a random thought.... Is there a way to quickly zoom in to a location in an array that your variable's value is near? Like:
That would be great.... Oh well.@a = ( 1 .. 100 ); $val = 43.56; $nearby = zoom($val,@a); # $nearby now is essentially an index for @a somewhere in the near # vicinity of 43.56, say 40 or so..
Thanks,
Matt
In reply to Re^2: Help tightening up a subroutine please
by mdunnbass
in thread Help tightening up a subroutine please
by mdunnbass
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |