#include <Bitmap32.h>
Public Member Functions | |
Bitmap32 (int numCustomers, unsigned int *&memory) | |
Allocate the memory for Bitmap32 for this many customers. | |
Bitmap32 (Bitmap32 &b, unsigned int *&memory) | |
Copy constructor. | |
~Bitmap32 () | |
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 Bitmap32 &b1, const Bitmap32 &b2) |
Bitwise OR 2 bitmap32s and store the result. | |
void | And (const Bitmap32 &b1, const Bitmap32 &b2) |
Bitwise AND 2 bitmaps32 and store the result. | |
int | Count () |
find the support of this bitmap in *number of customers* | |
void | CreateSBitmap (const Bitmap32 &iBitmap) |
Create a s-bitmap from an i-bitmap. | |
void | CreateCBitmap (const Bitmap32 &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 * | _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 |
It handles both uncompressed and compressed data.
This bitmap can represent customers with up to 32 transactions since it allocates exactly 32 bits per customer
Definition at line 56 of file Bitmap32.h.
|
Allocate the memory for Bitmap32 for this many customers.
Definition at line 76 of file Bitmap32.h. |
|
Copy constructor.
Definition at line 96 of file Bitmap32.h. |
|
Destructor (does nothing).
Definition at line 113 of file Bitmap32.h. |
|
Bitwise AND 2 bitmaps32 and store the result.
Definition at line 140 of file Bitmap32.cpp. Referenced by SeqBitmap::And(). |
|
Definition at line 65 of file Bitmap32.h. |
|
find the support of this bitmap in *number of customers*
Definition at line 159 of file Bitmap32.cpp. Referenced by SeqBitmap::Count(). |
|
create a c-bitmap for compression
Definition at line 238 of file Bitmap32.cpp. Referenced by SeqBitmap::CreateCBitmap(). |
|
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.
Definition at line 191 of file Bitmap32.cpp. Referenced by SeqBitmap::CreateSBitmap(). |
|
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 123 of file Bitmap32.h. Referenced by SeqBitmap::Deallocate(). |
|
deallocate counting tables
Definition at line 106 of file Bitmap32.cpp. Referenced by SeqBitmap::Destroy(). |
|
Fill in a 1 in a certain position.
Definition at line 133 of file Bitmap32.h. Referenced by SeqBitmap::FillEmptyPosition(). |
|
Definition at line 170 of file Bitmap32.h. Referenced by SeqBitmap::printSizes(). |
|
Initialize the counting tables.
Definition at line 58 of file Bitmap32.cpp. Referenced by SeqBitmap::Init(). |
|
Bitwise OR 2 bitmap32s and store the result.
Definition at line 121 of file Bitmap32.cpp. Referenced by SeqBitmap::Or(). |
|
Definition at line 58 of file Bitmap32.h. |
|
lookup table for creating a c-bitmap for compression
Definition at line 51 of file Bitmap32.cpp. Referenced by CreateCBitmap(), Destroy(), and Init(). |
|
Definition at line 46 of file Bitmap32.cpp. Referenced by And(). |
|
Definition at line 47 of file Bitmap32.cpp. Referenced by Count(). |
|
Definition at line 49 of file Bitmap32.cpp. Referenced by CreateCBitmap(). |
|
Definition at line 48 of file Bitmap32.cpp. Referenced by CreateSBitmap(). |
|
counters for performance measurements
Definition at line 45 of file Bitmap32.cpp. Referenced by Or(). |
|
lookup table for counting
Definition at line 43 of file Bitmap32.cpp. Referenced by Init(). |
|
where data is stored
Definition at line 177 of file Bitmap32.h. Referenced by And(), Bitmap32(), SeqBitmap::Compress32(), Count(), SeqBitmap::CountSmaller(), CreateCBitmap(), CreateSBitmap(), FillEmptyPosition(), Or(), and SeqBitmap::PrintBitmap(). |
|
size of memory allocated in sizeof(int)
Definition at line 178 of file Bitmap32.h. Referenced by And(), Bitmap32(), SeqBitmap::Compress32(), Count(), SeqBitmap::CountSmaller(), CreateCBitmap(), CreateSBitmap(), Deallocate(), getIntSize(), SeqBitmap::memSize(), Or(), and SeqBitmap::PrintBitmap(). |
|
size of memory allocated in sizeof(short)
Definition at line 179 of file Bitmap32.h. Referenced by Bitmap32(), CreateCBitmap(), and CreateSBitmap(). |
|
number of customers
Definition at line 180 of file Bitmap32.h. Referenced by Bitmap32(). |
|
lookup table for creating a s-bitmap from an i-bitmap
Definition at line 50 of file Bitmap32.cpp. Referenced by CreateSBitmap(), Destroy(), and Init(). |