Jump to content

  • Log In with Google      Sign In   
  • Create Account

compression algoritm for this case


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 lomateron   Members   -  Reputation: 363

Like
0Likes
Like

Posted 23 February 2014 - 12:31 AM

I have an unsigned int array[x] 

the array size never changes

a) I need to constantly change the "unsigned int" values of the array one by one

b) I need to constantly read a random "unsigned int"

I need to do "a" and "b" while the array is compressed

 

do you know place in the internet that explains a solution for this?


Edited by lomateron, 23 February 2014 - 12:42 AM.


Sponsor:

#2 wodinoneeye   Members   -  Reputation: 876

Like
0Likes
Like

Posted 23 February 2014 - 02:39 AM

I assume the range of numeric values is to large to fit within a 'char' (byte)  types value span ??

That would A straight forward 'natural' compression.

 

That would be the first thing I would check when I considered storage  (that include fixed values which DONT use the entire range of values inside the min/max  values  (if significantly less a lookup array can shrink the saved range which is now an index into aseperate fixed value array...)

 

Otherwise a more complicated 'compression' method usually employs rebuilding the entire data set when substituting new values  -- BUT if this may happen infrequently that might still pay off.

 

You didnt say how large this array is.  or what overhead is acceptable (or not) for the different operations

 

(those effects whether overhead overrides the data size savings -- after all memory is alot cheaper than it was long ago).

 

When you say 'read a random'  do you mean itsa true random selection or simply that any access may be from any array element.   There might be ways with some optimized compression schemes which are cheap  'at the edges'  (treating the array like a circular buffer), but where the value of the index is not locked in (itself a random value used to facilitate a random pick)


--------------------------------------------Ratings are Opinion, not Fact




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS