Accumulate and order partial scores. More...
Public Member Functions | |
Accumulator (int asize=ACCUMULATOR_SIZE) | |
Construct the Accumulator with a given buffer size. | |
void | add_element (T *element) |
Add an element to the accumulator. | |
int | filled (void) |
Check if the accumulator is full. | |
void | finaliseAccumulator (void) |
Perform the finishing operations on the accumulator. | |
Heap< OrderByPosition< T > > * | topElements (int number=RESULTS_SIZE) |
Use a heap to order the accumulator elements by their position. | |
Heap< OrderByValue< T > > * | topElementsByValue (int number=RESULTS_SIZE) |
Use a heap to order the accumulator elements by their value. | |
void | operator+= (Accumulator< T > *otherAccumulator) |
Add the results from another accumulator to this one. | |
void | operator*= (float multiplier) |
Multiply all of the accumulator elements by a constant. | |
Protected Attributes | |
HASHREC< unsigned int, float > * | hashElement |
Using to look up elements. | |
float | cohesion |
Experimental variable. | |
HashTable< unsigned int, float > * | accumulatorHash |
The accumulator hash table for fast look ups. |
Accumulate and order partial scores.
This class is used to keep track of partially computed scores, to allow the user to stop when wanted and return the partial (or complete) score is the desired order.