Chris Marshall <[email protected]> wrote:

> > 1) Why is that O(N**3) memory ops? I'm not very versed with PDL,
> > but it looks to me that ->dummy() and ->xchg() should not cost any
> > memory. Is there a reason why ->inner() costs extra memory?
> 
> The inner product takes 2 O(N) vectors and produces O(1) result.
> The threading is over O(N**2) elements of the output matrix.
> O(N) * O(N**2) is O(N**3)

Wait... it's doing the inner product in parallel?  Why? Unless PDL was
dividing the work among different CPUs (and my system monitor clearly
shows that it isn't) what would be the purpose of computing N**2 dot
products at the same time instead of one at a time?

Secondly, why does it need a brand-new copy of the vectors for each
computation? If vector/column 'v' is involved in N computations, that
doesn't mean it has to be copied N times in memory.

I haven't thought much about algorithms in years, so maybe my brain is
numb, but this all seems odd to me. I would have thought that the inner
product would be just 3 for loops and require no additional memory
besides what's needed for the input (2 x N**2) and the output (N**2).


Daniel.

_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl

Reply via email to