in reply to Re: finding neighbors of an element in arrays
in thread finding neighbors of an element in arrays
thank you so much.it was great.but please give me some explanation about these lines of code.thank you again.
for my $idx (0 .. $#$domain) { my @near = grep {$_ >= 0 && $_ <= $#$domain} $idx - 1, $idx + +1; push @{$neighbours{$domain->[$idx]}}, map {$domain->[$_]} @nea +r; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: finding neighbors of an element in arrays
by GrandFather (Saint) on Jul 28, 2011 at 20:45 UTC |