in reply to PDL vs C speed question
This was about 3x faster than (my interpretation of) your original, for me. Some of that comes from changing the looping constructs, but a chunk of it comes from fewer math ops.for my $i (0..$#data){ my $sum_j = 0; $sum_j += $data[$_] for $i..$#data; $pears += $data[$i] * $sum_j; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: PDL vs C speed question
by glwtta (Hermit) on May 07, 2005 at 23:58 UTC |