in reply to Read Bit String...!!!

Hi guys,

Ikegami i already use the three last solutions that you said
and the regular expression is the best one...


Now about the C solution the problem is that i dont know very well
this language unfortunately and i dont have time to learn it..


I believe if i will work the bit string without unpack it
will be the fastest solution ..
Can you give me some help with the mask and vec functions???

About what i want to do with the bit string...

In the string i save possitive compressed integers and to
decode them i read from the start the string how many
1s exist until i will find the first 0 (lets assume N ones).Then the compressed
number is (in binary) the next N bits after the 0, plus an
additional bit in the begining of the next N digits. Like this way for the next bits..


For example lets assume that i compressed in the below bit string just one number...

BitString: 1110,001
N=3 (the first 1s until the first 0)
The next N digits are : 001
So the number in binary is 1001 by add one bit in the start of the next N bits...


Can you tell me an optimal way to decode this bit string...??

Thanks Guys!!!

Mimis

Replies are listed 'Best First'.
Re^2: Read Bit String...!!!
by tachyon-II (Chaplain) on Apr 09, 2008 at 15:31 UTC

    I believe if i will work the bit string without unpack it will be the fastest solution ..

    Why? I believe that you believe but why do you believe? I believe because either I have faith, or because I have read informed expert discussion, or because I have tested and know it to be true.

    For other monks information please refer to this to see what MimisIVI actually wants to do. I believe he is barking up the wrong tree, seeking the solution to a problem that does not actually exist, and trying to optimise a bad algorithm.