#include <BitInfo.h>
Inheritance diagram for Conjecture::BitInfo:
*****************************************************************
This is an extension of BitOverlay that precomputes all relevant information and caches it in fields. The constructor performs a single pass over the bit-sequence to establish all of the information of interest and stores that info in fields.
In deciding when to use BitOverlay and when to use BitInfo, almost any time more than one method from BitInfo is needed on a particular bit sequence, using BitInfo is probably more efficient.
The only downside is that we have serious code redundancy - the individual methods in BitOverlay perform individual tasks, while the constructor in BitInfo performs those some tasks in one monolithic loop (calling individual methods in the constructor would defeat the entire purpose of having BitInfo - it is supposed to be faster than calling individual methods).
Public Member Functions | |
BitInfo (BitOverlay::Layout layout) | |
const BitOverlay::BitCount & | largestRegion () const |
const unsigned short * | regions () const |
const BitOverlay::BitCount & | regionCount () const |
const BitOverlay::BitPos & | firstLow () const |
const BitOverlay::BitPos & | firstHigh () const |
std::ostream & | print (std::ostream &os=std::cout, const std::string &indent="") const |
Static Public Member Functions | |
static void | Test (int argc=0, const char *argv[]=NULL) |
Protected Member Functions | |
void | largestRegionIs (const BitOverlay::BitCount &largestRegion) |
void | regionCountIs (const BitOverlay::BitCount ®ionCount) |
void | firstLowIs (const BitOverlay::BitPos &firstLow) |
void | firstHighIs (const BitOverlay::BitPos &firstHigh) |
|
The Unit-testing method Reimplemented from Conjecture::BitOverlay. |