Main Page | Modules | Namespace List | Data Structures | File List | Data Fields | Globals

Bitmap4 Class Reference
[Bitmap Processing]

A vertical representation of the data. More...

#include <Bitmap4.h>


Public Member Functions

 Bitmap4 (int numCustomers, unsigned int *&memory)
 Allocate the memory for Bitmap4 for this many customers.

 Bitmap4 (Bitmap4 &b, unsigned int *&memory)
 Copy constructor.

 ~Bitmap4 ()
 Destructor (does nothing).

void Deallocate (unsigned int *&memory)
 Pop this bitmap's memory from the global stack (allocation is done in the constructor, but deallocation is not done in the destructor.

void FillEmptyPosition (int j)
 Fill in a 1 in a certain position.

void Or (const Bitmap4 &b1, const Bitmap4 &b2)
 Bitwise OR 2 bitmap4s and store the result.

void And (const Bitmap4 &b1, const Bitmap4 &b2)
 Bitwise AND 2 bitmap4s and store the result.

int Count ()
 find the support of this bitmap4 in *number of customers*

void CreateSBitmap (const Bitmap4 &iBitmap)
 Create a s-bitmap from an i-bitmap.

void CreateCBitmap (const Bitmap4 &iBitmap)
 create a c-bitmap for compression

int getIntSize () const

Static Public Member Functions

void Init ()
 Initialize the counting tables.

void Destroy ()
 deallocate counting tables

int CalcSize (int numCust)

Static Public Attributes

int _countOr = 0
 counters for performance measurements

int _countAnd = 0
int _countCount = 0
int _countCreateSBitmap = 0
int _countCreateCBitmap = 0
const int _lookupTableSize = 0x10000
 lookup table for counting

int * _countLookupTable = 0
 lookup table for the counting

int * _sBitmapLookupTable = 0
 lookup table for creating a s-bitmap from an i-bitmap

int * _cBitmapLookupTable = 0
 lookup table for creating a c-bitmap for compression


Private Attributes

unsigned int * _memory
 where data is stored

int _memSizeInt
 size of memory allocated in sizeof(int)

int _memSizeShort
 size of memory allocated in sizeof(short)

int _numCust
 number of customers


Friends

class SeqBitmap


Detailed Description

A vertical representation of the data.

It handles both uncompressed and compressed data.

This bitmap can represent customers with up to 4 transactions since it allocates exactly 4 bits per customer

Definition at line 56 of file Bitmap4.h.


Constructor & Destructor Documentation

Bitmap4::Bitmap4 int  numCustomers,
unsigned int *&  memory
[inline]
 

Allocate the memory for Bitmap4 for this many customers.

Parameters:
numCustomers # of customers
memory 

Definition at line 87 of file Bitmap4.h.

Bitmap4::Bitmap4 Bitmap4 b,
unsigned int *&  memory
[inline]
 

Copy constructor.

Parameters:
b Bitmap4 to copy
memory 

Definition at line 123 of file Bitmap4.h.

Bitmap4::~Bitmap4  )  [inline]
 

Destructor (does nothing).

Definition at line 141 of file Bitmap4.h.


Member Function Documentation

void Bitmap4::And const Bitmap4 b1,
const Bitmap4 b2
 

Bitwise AND 2 bitmap4s and store the result.

Parameters:
b1 the first Bitmap4
b2 the second Bitmap4

Definition at line 223 of file Bitmap4.cpp.

Referenced by SeqBitmap::And().

int Bitmap4::CalcSize int  numCust  )  [inline, static]
 

Definition at line 65 of file Bitmap4.h.

int Bitmap4::Count  ) 
 

find the support of this bitmap4 in *number of customers*

Returns:
the number of customers that have some bit set among their 4 bits

Definition at line 241 of file Bitmap4.cpp.

Referenced by SeqBitmap::Count(), SeqBitmap::CountSmaller(), and SeqBitmap::PrintBitmap().

void Bitmap4::CreateCBitmap const Bitmap4 iBitmap  ) 
 

create a c-bitmap for compression

Parameters:
iBitmap the bitmap4 from which we create c-bitmap

Definition at line 308 of file Bitmap4.cpp.

Referenced by SeqBitmap::CreateCBitmap().

void Bitmap4::CreateSBitmap const Bitmap4 iBitmap  ) 
 

Create a s-bitmap from an i-bitmap.

Idea : Again, we go thru each element of _memory. For each element, if it is greater than 0, we look up the transformation table (postProcessTable) to find the corresponding value for the s-bitmap, and set the remaining SHORTs of the current custom to USHRT_MAX (i.e. all 1's).

Note : For example, if the bitmap is [0001 | 1100 | 0011 | 1111 | 0000 | 0000] and [00001111 | 00011111 | 11111111]. Refer to the paper for details.

Parameters:
iBitmap the bitmap4 from which we create s-bitmap

Definition at line 279 of file Bitmap4.cpp.

Referenced by SeqBitmap::CreateSBitmap().

void Bitmap4::Deallocate unsigned int *&  memory  )  [inline]
 

Pop this bitmap's memory from the global stack (allocation is done in the constructor, but deallocation is not done in the destructor.

Definition at line 151 of file Bitmap4.h.

Referenced by SeqBitmap::Deallocate().

void Bitmap4::Destroy  )  [static]
 

deallocate counting tables

Definition at line 186 of file Bitmap4.cpp.

Referenced by SeqBitmap::Destroy().

void Bitmap4::FillEmptyPosition int  j  )  [inline]
 

Fill in a 1 in a certain position.

Parameters:
j bit position in Bitmap4 to be changed

Definition at line 161 of file Bitmap4.h.

Referenced by SeqBitmap::FillEmptyPosition().

int Bitmap4::getIntSize  )  const [inline]
 

Definition at line 182 of file Bitmap4.h.

Referenced by SeqBitmap::printSizes().

void Bitmap4::Init  )  [static]
 

Initialize the counting tables.

Definition at line 58 of file Bitmap4.cpp.

Referenced by SeqBitmap::Init().

void Bitmap4::Or const Bitmap4 b1,
const Bitmap4 b2
 

Bitwise OR 2 bitmap4s and store the result.

Parameters:
b1 the first Bitmap4
b2 the second Bitmap4

Definition at line 204 of file Bitmap4.cpp.

Referenced by SeqBitmap::Or().


Friends And Related Function Documentation

friend class SeqBitmap [friend]
 

Definition at line 58 of file Bitmap4.h.


Field Documentation

int * Bitmap4::_cBitmapLookupTable = 0 [static]
 

lookup table for creating a c-bitmap for compression

Definition at line 51 of file Bitmap4.cpp.

Referenced by CreateCBitmap(), Destroy(), and Init().

int Bitmap4::_countAnd = 0 [static]
 

Definition at line 45 of file Bitmap4.cpp.

Referenced by And().

int Bitmap4::_countCount = 0 [static]
 

Definition at line 46 of file Bitmap4.cpp.

Referenced by Count().

int Bitmap4::_countCreateCBitmap = 0 [static]
 

Definition at line 48 of file Bitmap4.cpp.

Referenced by CreateCBitmap().

int Bitmap4::_countCreateSBitmap = 0 [static]
 

Definition at line 47 of file Bitmap4.cpp.

Referenced by CreateSBitmap().

int * Bitmap4::_countLookupTable = 0 [static]
 

lookup table for the counting

Definition at line 49 of file Bitmap4.cpp.

Referenced by Count(), Destroy(), and Init().

int Bitmap4::_countOr = 0 [static]
 

counters for performance measurements

Definition at line 44 of file Bitmap4.cpp.

Referenced by Or().

const int Bitmap4::_lookupTableSize = 0x10000 [static]
 

lookup table for counting

Definition at line 42 of file Bitmap4.cpp.

Referenced by Init().

unsigned int* Bitmap4::_memory [private]
 

where data is stored

Definition at line 209 of file Bitmap4.h.

Referenced by And(), Bitmap4(), SeqBitmap::Compress16(), SeqBitmap::Compress32(), SeqBitmap::Compress4(), SeqBitmap::Compress64(), SeqBitmap::Compress8(), Count(), CreateCBitmap(), CreateSBitmap(), FillEmptyPosition(), Or(), and SeqBitmap::PrintBitmap().

int Bitmap4::_memSizeInt [private]
 

size of memory allocated in sizeof(int)

Definition at line 210 of file Bitmap4.h.

Referenced by And(), Bitmap4(), SeqBitmap::Compress4(), CreateCBitmap(), CreateSBitmap(), Deallocate(), getIntSize(), SeqBitmap::memSize(), Or(), and SeqBitmap::PrintBitmap().

int Bitmap4::_memSizeShort [private]
 

size of memory allocated in sizeof(short)

Definition at line 211 of file Bitmap4.h.

Referenced by Bitmap4(), Count(), CreateCBitmap(), and CreateSBitmap().

int Bitmap4::_numCust [private]
 

number of customers

Definition at line 212 of file Bitmap4.h.

Referenced by Bitmap4().

int * Bitmap4::_sBitmapLookupTable = 0 [static]
 

lookup table for creating a s-bitmap from an i-bitmap

Definition at line 50 of file Bitmap4.cpp.

Referenced by CreateSBitmap(), Destroy(), and Init().


The documentation for this class was generated from the following files:
Generated on Thu Mar 11 12:01:54 2004 for SPAM by doxygen 1.3.4