Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Anyone used std::bitset?

Author: Bo Persson

Date: 04:14:09 08/04/02

Go up one level in this thread


On August 04, 2002 at 04:44:45, Russell Reagan wrote:

>I was just wondering if anyone has used std::bitset in their bitboard engine. It
>provides it's own bit counting routine, but unfortunately not a least
>significant bit. It seems like it might be interesting nevertheless. Is this
>another one of the STL containers that isn't a good idea if absolute speed is a
>priority (ex. using std::map as a transposition table, ack!)?
>
>Russell

It is interesting, but there are some problems.  :-(

One thing is that you can only initialize a bitset from a long or a string. That
makes it hard to build constants.

It is also templated on its size, meaning that it contains code to take care of
odd sizes, like 93. You need a *really* good optimizer to realize that some of
this code can be removed for sizes like 64 (n*sizeof(unsigned long)), and that
some loops should be unrolled for this particular size.

As you say, there is also the problem of finding what bits are set.


You might use it as a starting point ("inspiration") for a bitset<64> class.


Bo Persson
bop2@telia.com



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.