[PD] table reverse lookup

Roman Haefeli reduzent at gmail.com
Tue Sep 4 23:16:40 CEST 2018


Hi

I'm using a couple of same-size tables to store tuples of numbers so
that their index is there ID. When (tab)reading all tables at the given
index, I get back the hole tuple. Mostly I have an ID and I need to
look up some value which is obviously an inexpensive task.

But sometimes I know two values (the combination of the two values is
unique) and I need to find the corresponding ID (index where both
values are found in their respective tables). I'm currently doing a
reverse lookup by scanning the table(s) which is more expensive than
the forward lookup. 

Let's assume memory usage is less of a concern, is there an
complementary way to store the data (x tuples of same size) that allows
for a quick reverse lookup? 

ID -> (x, y): easy

(x, y) -> ID: ??

Roman
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: This is a digitally signed message part
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20180904/3f050654/attachment.sig>


More information about the Pd-list mailing list