Re: Encoding/decoding ranges of unsigned integers...



Hi Willem,

Thanks for contributing your thoughts and time.
I answer your questions below...

Willem wrote:
In other words: It's okay to, say, sort the ranges ?
Is there a minimum and maximum value to the integers ?
Can the ranges overlap ?

There could be millions of ranges. Sorting them would take too long. (too long = longer than acceptable in a soft real-time system)


The minimum value would be 0.
The maximum value would be the greatest value you can store in an unsigned 64-bit integer. (as stated by C99)


) Is there a smart way to encode these ranges into a representation that ) would be both compact and efficient to encode/decode.

Sort the ranges in increasing order, calculate the differences/deltas,
encode those with an arith coder or whatever.

I don't think sorting is an option. See above.

It rather depends on the distribution of those ranges and other factors.

I agree. I am sorry I have not been clear enough.

The distribution of the ranges is undetermined. I could only say this:

At time t1,
if you were to sort the ranges from left to right ([2,9] < [10,11] < etc.),
you would find the density of ranges is higher on the left side of the sorted sequence.




SaSW, Willem
.



Relevant Pages

  • Re: Nested loop with no overlap
    ... SaSW, Willem ... Disclaimer: I am in no way responsible for any of the statements ... #EOT ...
    (comp.programming)
  • Re: MOST USEFUL Computer Language
    ... > And it's a Turing-Complete language. ... > SaSW, Willem ... > Disclaimer: I am in no way responsible for any of the statements ...
    (comp.theory)
  • Re: seamless scrolling back
    ... SaSW, Willem ... Disclaimer: I am in no way responsible for any of the statements ...
    (comp.programming)
  • Re: Cow eating Grass
    ... unless there's a trick that I'm missing ... The 1/3 in three days apears to be irrelevant. ... SaSW, Willem ...
    (rec.puzzles)
  • Re: MOST USEFUL Computer Language
    ... > And it's a Turing-Complete language. ... > SaSW, Willem ... > Disclaimer: I am in no way responsible for any of the statements ...
    (comp.programming)