[PD] table reverse lookup

Roman Haefeli reduzent at gmail.com
Wed Sep 5 08:50:59 CEST 2018


Hi William

On Tue, 2018-09-04 at 19:51 -0400, William Brent wrote:
> The "equals" method of [tabletool] returns the indices of a value
> you're searching for, as well as the number of occurrences. 

Thanks. That's quite a cool external and definitely covers what I need.

I'm still curious, though, if it's possible to implement a lookup and
reverse lookup in a way that does not require a scan. 

Roman

> 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/l
> > istinfo/pd-list
-------------- 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/20180905/bf327272/attachment.sig>


More information about the Pd-list mailing list