posted 22 years ago
Hi,
I'm looking for an efficient way to program an "injection" function:
A method that will map one or more values onto another value.
The coding needs to be adaptable, so it has to be possible to construct the function from the mappings. The number of possible beginning values and possible end values is know however.
So suppose I have a group of:
A = {a,b,c,d,e}
and B = {q,r}
and I need a "codebook", with which I can construct a function that does for instance:
f(a)=q
f(b)=r
f(c)=q
f(d)=q
f(e)=r
A different codebook would then "map" these values differently.
The big problem is that I need to keep the size of the "codebooks" to an absolute minimum, since I need a *lot* of them. A bit-based system would be nice.
Is there any standard solution out there? Ideas anyone?
Thanks in advance,
Thomas