> Not to be a downer, but this problem is technically NP-complete. The > so-called "knapsack problem" is to find a subset of a collection of > numbers that adds up to the specified number, and it is NP-complete. > Unfortunately, it is exactly what you need to do to find the indices > to a particular memory location in an array of shape (2,2,...,2).
Ha ha, right -- that is the knapsack problem isn't it. Oh well... I'll just require fortran- or C-style strided arrays, for which case it is easy to unravel offsets into indices. Thanks everyone! Zach _______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion