<div dir="auto">The "equals" method of [tabletool] returns the indices of a value you're searching for, as well as the number of occurrences. <div dir="auto"><br></div><div dir="auto"><br></div></div><br><div class="gmail_quote"><div dir="ltr">On Tue, Sep 4, 2018, 5:19 PM Roman Haefeli <<a href="mailto:reduzent@gmail.com">reduzent@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi<br>
<br>
I'm using a couple of same-size tables to store tuples of numbers so<br>
that their index is there ID. When (tab)reading all tables at the given<br>
index, I get back the hole tuple. Mostly I have an ID and I need to<br>
look up some value which is obviously an inexpensive task.<br>
<br>
But sometimes I know two values (the combination of the two values is<br>
unique) and I need to find the corresponding ID (index where both<br>
values are found in their respective tables). I'm currently doing a<br>
reverse lookup by scanning the table(s) which is more expensive than<br>
the forward lookup. <br>
<br>
Let's assume memory usage is less of a concern, is there an<br>
complementary way to store the data (x tuples of same size) that allows<br>
for a quick reverse lookup? <br>
<br>
ID -> (x, y): easy<br>
<br>
(x, y) -> ID: ??<br>
<br>
Roman<br>
_______________________________________________<br>
<a href="mailto:Pd-list@lists.iem.at" target="_blank" rel="noreferrer">Pd-list@lists.iem.at</a> mailing list<br>
UNSUBSCRIBE and account-management -> <a href="https://lists.puredata.info/listinfo/pd-list" rel="noreferrer noreferrer" target="_blank">https://lists.puredata.info/listinfo/pd-list</a><br>
</blockquote></div>