This class defines a simple table of bit fields with very limited functionality that is used for storing the information on the verified combinations of cubes' neighbors. More...
#include <known.h>
Public Member Functions | |
BitFields () | |
The default constructor. | |
~BitFields () | |
The destructor. | |
void | setkblimit (int limit=-1, int dim=-1) |
Sets the limit for the number of kilobytes used for BitFields. | |
int | getkblimit (int dim=0) const |
Returns the current limit for the given dimension. | |
SetOfBitFields * | operator[] (int dim) |
Returns the corresponding bit field set and allocates it if not used so far. | |
void | forget (int dim=-1) |
Forgets the given bit field set or all the sets. | |
Private Member Functions | |
void | extend (int n) |
Extends the table to the given length if necessary. | |
void | allocate (int dim) |
Allocates the specific bit field set. | |
Private Attributes | |
SetOfBitFields ** | tab |
The table of bit field sets for each dimension. | |
int | len |
The length of the currently allocated table. | |
int * | maxkb |
The memory limit for each table (in kilobytes), -1 for none. |
This class defines a simple table of bit fields with very limited functionality that is used for storing the information on the verified combinations of cubes' neighbors.
Definition at line 54 of file known.h.
chomp::homology::BitFields::BitFields | ( | ) | [inline] |
chomp::homology::BitFields::~BitFields | ( | ) |
The destructor.
void chomp::homology::BitFields::allocate | ( | int | dim | ) | [private] |
Allocates the specific bit field set.
Referenced by operator[]().
void chomp::homology::BitFields::extend | ( | int | n | ) | [private] |
Extends the table to the given length if necessary.
Referenced by operator[]().
void chomp::homology::BitFields::forget | ( | int | dim = -1 |
) |
Forgets the given bit field set or all the sets.
int chomp::homology::BitFields::getkblimit | ( | int | dim = 0 |
) | const |
Returns the current limit for the given dimension.
SetOfBitFields * chomp::homology::BitFields::operator[] | ( | int | dim | ) | [inline] |
Returns the corresponding bit field set and allocates it if not used so far.
If no bit field set is in use, returns 0.
Definition at line 107 of file known.h.
References allocate(), extend(), len, maxkb, and tab.
{ // make sure the dimension is positive if (dim <= 0) throw "Trying to get a bit field set of non-positive dim."; // extend the tables if necessary if (dim >= len) extend (dim + 1); // allocate the bit field set if necessary if (!tab [dim] && maxkb [dim]) allocate (dim); // return the pointer to the requested bit field set return tab [dim]; } /* BitFields::operator [] */
void chomp::homology::BitFields::setkblimit | ( | int | limit = -1 , |
|
int | dim = -1 | |||
) |
Sets the limit for the number of kilobytes used for BitFields.
The limit applied to dimension < 0 is copied to all the others and can be retrieved as the limit for dimension 0. The limit for dim. 0 is the default if not defined otherwise.
int chomp::homology::BitFields::len [private] |
The length of the currently allocated table.
Definition at line 84 of file known.h.
Referenced by BitFields(), and operator[]().
int* chomp::homology::BitFields::maxkb [private] |
The memory limit for each table (in kilobytes), -1 for none.
Definition at line 87 of file known.h.
Referenced by BitFields(), and operator[]().
SetOfBitFields** chomp::homology::BitFields::tab [private] |
The table of bit field sets for each dimension.
Definition at line 81 of file known.h.
Referenced by BitFields(), and operator[]().