in reply to Re^6: Can I speed this up?
in thread Can I speed this up? (repetitively scanning ranges in a large array)

This is one of the smallest real examples I have: example.corrected.tar.gz.

A few notes:

1. Remember coordinates start from 1, not zero.

2. Max length = 87688.

3. Results are given in half sizes (e.g., if the minimal uncovered window centered at i is of size 3, the result will be 1, if it's 5 the result will be 2, etc.).

UPDATED link with a corrected version of the ranges. Previously wrapped ranges span out of max length, now they are in the correct form.

Replies are listed 'Best First'.
Re^8: Can I speed this up?
by choroba (Cardinal) on Nov 02, 2010 at 12:56 UTC
    An example with some of those "circular" ranges would be nice (x0>x1).
      See updated link.
Re^8: Can I speed this up?
by BrowserUk (Patriarch) on Nov 03, 2010 at 16:58 UTC

    How confident are you that the algorithm in the OP code is completely correct?


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
      About 78% confident... :)

      Do you think it's erroneous?