in reply to fastest way to compare numerical strings?
Lots of nested loops, but probably a big time saver.my %CellMembers; for my $i (0..$npoints) { my $cellid = int($lat[$i]).",".int($long[$i]); push(@{$CellMembers{$cellid}}, $i); } # iterate over cells for my $ci (keys %CellMembers) { for my $cj (...cells within distance 1 of $ci...) { for my $i (@{$CellMembers{$ci}}) { for my $j (@{$CellMembers{$cj}} { ...compare points $i and $j... } } } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: fastest way to compare numerical strings?
by salva (Canon) on Jul 01, 2008 at 07:11 UTC |