You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently product() iterates over its parameters in a "column-major" order (I guess, to be consistent with the order of array indices). I believe it would be useful to be able to iterate in a row-major order as well (that is, the first iterable changes the slowest). Of course, one can piggy-back on product, passing it reverse()ed arguments, and reverse()ing back the results of next(), but it makes the iteration several times slower.
Logic-wise, the only thing that will need to change is the iteration in next() — from for i in 1:n to for i in n:-1:1. I am not sure how to handle the eltype() properly. Perhaps a parametrization of Product on a value type is needed?
The text was updated successfully, but these errors were encountered:
Currently
product()
iterates over its parameters in a "column-major" order (I guess, to be consistent with the order of array indices). I believe it would be useful to be able to iterate in a row-major order as well (that is, the first iterable changes the slowest). Of course, one can piggy-back onproduct
, passing itreverse()
ed arguments, andreverse()
ing back the results ofnext()
, but it makes the iteration several times slower.Logic-wise, the only thing that will need to change is the iteration in
next()
— fromfor i in 1:n
tofor i in n:-1:1
. I am not sure how to handle theeltype()
properly. Perhaps a parametrization ofProduct
on a value type is needed?The text was updated successfully, but these errors were encountered: