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

Do you have a larger test set--say max=100 ranges=100 rangesize=10--plus results?

Replies are listed 'Best First'.
Re^7: Can I speed this up?
by daverave (Scribe) on Nov 02, 2010 at 07:25 UTC
    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.

      An example with some of those "circular" ranges would be nice (x0>x1).
        See updated link.

      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?