Re: search algorithm



On Jan 6, 7:56 pm, p...@xxxxxxxxxxxxxxxxx (Pascal J. Bourguignon)
wrote:
fenwayfool <peterson.russ...@xxxxxxxxx> writes:
On Jan 6, 7:02 pm, Patricia Shanahan <p...@xxxxxxx> wrote:
fenwayfool wrote:
Anyone ever do something similar to the following (in C++ or some
other language)...

I need to create a database that has a fairly long key.  Consider the
key a bitstring.  My problem is that this key also has an associated
mask.  All bits that we "care" about in the key have a mask value of
'1' while the don't care bits are marked with a zero.

Basically I want to simulate the operation of a ternary CAM in
software in a semi efficient manner.  I have a few other databases I
use a hash_map<> for which works just fine... but the introduction of
a "don't care" mask eliminates this as a possibility.

Is the mask fixed for a given item in the database, or subject to change
from search to search?

Patricia

The mask is fixed for any given database entry... but each entry may
have a different mask.

And what about the queries?

--
__Pascal Bourguignon__- Hide quoted text -

- Show quoted text -

The queries are simply a byte stream. That is a query does NOT
specify a mask. I was thinking in some ways it is the opposite of a
dictionary database (full of text words) where you can do a partial
match search (using a regular expression as the query key).
.



Relevant Pages

  • Re: search algorithm
    ... associated mask. ... All bits that we "care" about in the key have a ... I'm guessing that you mean by this that any match for the search key ... But your indicated match has the pattern ...
    (comp.programming)
  • Re: Where can I find the color format of source surface in DrvCopyBits function?
    ... Why do you care about the source? ... EngCopyBits(Dest = TemporarySurface, Source = DeviceSurface) ... aren't you specifying them in DEVINFO::hpalDefault ... But could you please explain more how to get the mask ...
    (microsoft.public.development.device.drivers)
  • Re: search algorithm
    ... mask. ... '1' while the don't care bits are marked with a zero. ... That is a query does NOT ... the database to classify the byte stream input. ...
    (comp.programming)
  • Re: search algorithm
    ... fenwayfool writes: ... key a bitstring. ... All bits that we "care" about in the key have a mask value of ... '1' while the don't care bits are marked with a zero. ...
    (comp.programming)
  • Re: search algorithm
    ... associated mask. ... mask value of '1' while the don't care bits are marked with a ... source port, dest port, protocol). ... databases where the lookup result of 1 returns another database... ...
    (comp.programming)