Re: scoring differences between bitmasks

Поиск
Список
Период
Сортировка
От Ben
Тема Re: scoring differences between bitmasks
Дата
Msg-id 1A194A50-0836-4F79-8501-CDFDF67294EC@silentmedia.com
обсуждение исходный текст
Ответ на Re: scoring differences between bitmasks  (Martijn van Oosterhout <kleptog@svana.org>)
Ответы Re: scoring differences between bitmasks  (Martijn van Oosterhout <kleptog@svana.org>)
Re: scoring differences between bitmasks  ("Todd A. Cook" <tcook@blackducksoftware.com>)
Список pgsql-general
Yes, that's the straightforward way to do it. But given that my
vectors are 256 bits in length, and that I'm going to eventually have
about 4 million of them to search through, I was hoping greater minds
than mine had figured out how to do it faster, or how compute some
kind of indexing....... somehow.

On Oct 2, 2005, at 5:39 AM, Martijn van Oosterhout wrote:
>
> Step 1: Use XOR to get the bits that are different.
> Step 2: Count the bits.
>
> Something like  x & ((~x) +1)  will give you the value of the last
> bit that is set, mask it out and repeat. If you need to do it a lot,
> build a table of 256 values and then process 8 bits at a time. Should
> be fairly straight forward...
>
> Hope this helps,
> --
> Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/
> kleptog/
>
>> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent
>> is a
>> tool for doing 5% of the work and then sitting around waiting for
>> someone
>> else to do the other 95% so you can sue them.
>


В списке pgsql-general по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Maximum # of schemas
Следующее
От: Shelby Cain
Дата:
Сообщение: Re: Pertinent to list? PostgreSQL and Dev-Cpp Dev-C++ on Windows example