Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

Re^2: Parallelization of multiple nested loops

by roboticus (Chancellor)
on Feb 07, 2018 at 16:33 UTC ( #1208638=note: print w/replies, xml ) Need Help??

in reply to Re: Parallelization of multiple nested loops
in thread Parallelization of multiple nested loops

salva, biosub:

I'd suggest something like:

# customize to suit my @param_space = (0.0, 0.2, 0.4, 0.6, 0.8, 1.0); for my $i (@param_space) { for my $j (@param_space) { ... } }

This clarifies the code a little and might remove a few operations from the optree. It makes it simple to change the distribution (if desired), and you can use more arrays if you want to treat some parameters slightly differently.


When your only tool is a hammer, all problems look like your thumb.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1208638]
and a soft breeze sighs...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2018-07-18 16:51 GMT
Find Nodes?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?

    Results (393 votes). Check out past polls.