|Don't ask to ask, just ask|
Re: Obtaining terms in an expansionby ivancho (Hermit)
|on Jan 06, 2006 at 00:57 UTC||Need Help??|
ok, so the 2^N terms are each a product of N terms, a[i][j], where j can be 0 or 1 and i goes from 0 to N-1
ie, each one looks like, say
a * a * a * a * ... * a[N-1]
So, we want do some binary magic.
how about something like:
note, $size must be a power of 2, for vec to work, and unless you're on a 64-bit machine, it probably cannot be more than 32.
also, this works for $N no more than 31(32?) - but you may have other problems (memory say), if you want to go above that.Hope this helps.