On Sat, Jun 21, 2008 at 17:08, Anne Archibald <[EMAIL PROTECTED]> wrote:
> My suggestion is this: allow negative indices, accepting the cost in
> tight loops. (If bounds checking is enabled, the cost will be
> negligible anyway.) Provide a #pragma allowing the user to assert that
> a certain piece of code uses no negative indices.

Instead of a #pragma, you could rely on the type of the index. If it
is unsigned, you can do the fast path; if it is signed, you need to
check for and handle potential negatives.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
 -- Umberto Eco
_______________________________________________
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to