[PD] table reverse lookup

William Brent william.brent at gmail.com
Wed Sep 5 01:51:41 CEST 2018


The "equals" method of [tabletool] returns the indices of a value you're
searching for, as well as the number of occurrences.



On Tue, Sep 4, 2018, 5:19 PM Roman Haefeli <reduzent at gmail.com> wrote:

> 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
> _______________________________________________
> Pd-list at lists.iem.at mailing list
> UNSUBSCRIBE and account-management ->
> https://lists.puredata.info/listinfo/pd-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20180904/64bf64f9/attachment.html>


More information about the Pd-list mailing list