Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

Re: Small examples of string eval

by jwkrahn (Monsignor)
on May 13, 2006 at 23:40 UTC ( #549282=note: print w/replies, xml ) Need Help??

in reply to Small examples of string eval

Replies are listed 'Best First'.
Re^2: Small examples of string eval
by ikegami (Pope) on May 14, 2006 at 04:24 UTC

    Check out NestedLoops in Algorithm::Loops. In this case,

    use Algorithm::Loops qw( NestedLoops ); use List::Util qw( reduce sum ); sub mul { return reduce { $a * $b } @_; } NestedLoops( [ map { [ 0..$n_ra->[$_] ] } 0..$#$n_ra ], sub { $prob_ra[sum @_] += mul map { $f_raa->[$_]->[$_[$_]] } 0..$#_; } );

    I suspect that
    is equal to
    in which case
    map { [ 0..$n_ra->[$_] ] } 0..$#$n_ra
    can be replaced with
    map { [ 0..$#$_ ] } @$f_raa

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://549282]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2018-01-23 02:39 GMT
Find Nodes?
    Voting Booth?
    How did you see in the new year?

    Results (238 votes). Check out past polls.