ResultTable< T > Class Template Reference

This class represents entities to be kept in main memory. More...

#include <result_table.h>

List of all members.

Public Member Functions

 ResultTable (int entitySize)
 Constructor.
int getId (int index)
 Returns id of tuple at given index.
const T * getFeatureArray (int index)
 Returns feature vector of tuple at given index.
double getEps (int index)
 Returns eps of tuple at given index.
int getTruthValue (int index)
 Returns truth value of tuple at given index.
int * getPointer (int index)
 Returns pointer to the id of tuple at given index.
void setEps (int index, double new_eps)
 Sets eps value of tuple at given index.
void setFeatureVectorComponent (int index, int featureIndex, VFloat featureValue)
 Sets feature vector component of tuple at given index.
void setFeatureVectorFromStr (int index, std::string str)
 Sets feature vector of tuple at given index from string in svm format.
void setTruthValue (int index, int new_truth_value)
 Sets truth value of tuple at given index.
void setId (int index, int id)
 Sets id of tuple at given index.
void sort ()
 sorts entities based on epsilons

Private Member Functions

int resultTupleComp (const void *, const void *)
 Compares two tuples based on eps and returns -1 if first one is smaller, 0 if they are equal and 1 otherwise.

Private Attributes

int tupleSize
 size of tuple
int entity_size
 # of entities
resultTupletable
 all entities
T * pFeatures
 packed feature vectors
int * packedIds
 packed ids
bool bCluster
 set this to recluster in memory on each sort

Classes

struct  resultTuple


Detailed Description

template<class T>
class ResultTable< T >

This class represents entities to be kept in main memory.


Constructor & Destructor Documentation

template<class T>
ResultTable< T >::ResultTable ( int  entitySize  ) 

Constructor.

Parameters:
[in] entitySize # of entities


Member Function Documentation

template<class T>
double ResultTable< T >::getEps ( int  index  ) 

Returns eps of tuple at given index.

Parameters:
[in] index index of entity in entity table
Returns:
epsilon of tuple

template<class T>
const T * ResultTable< T >::getFeatureArray ( int  index  ) 

Returns feature vector of tuple at given index.

Parameters:
[in] index index of entity in entity table
Returns:
feature vector of tuple

template<class T>
int ResultTable< T >::getId ( int  index  ) 

Returns id of tuple at given index.

Parameters:
[in] index index of entity in entity table
Returns:
id of tuple

template<class T>
int * ResultTable< T >::getPointer ( int  index  ) 

Returns pointer to the id of tuple at given index.

Parameters:
[in] index index of entity in entity table
Returns:
pointer to the id of tuple

template<class T>
int ResultTable< T >::getTruthValue ( int  index  ) 

Returns truth value of tuple at given index.

Parameters:
[in] index index of entity in entity table
Returns:
truth value of tuple

template<class T>
int ResultTable< T >::resultTupleComp ( const void *  a,
const void *  b 
) [private]

Compares two tuples based on eps and returns -1 if first one is smaller, 0 if they are equal and 1 otherwise.

Parameters:
[in] a first tuple
[in] b second tuple
Returns:
-1 if first eps < second eps, 0 if they are equal, 1 otherwise

template<class T>
void ResultTable< T >::setEps ( int  index,
double  new_eps 
)

Sets eps value of tuple at given index.

Parameters:
[in] index index of entity in entity table
[in] new_eps new eps value

template<class T>
void ResultTable< T >::setFeatureVectorComponent ( int  index,
int  featureIndex,
VFloat  featureValue 
)

Sets feature vector component of tuple at given index.

Parameters:
[in] index index of entity in entity table
[in] featureIndex index of feature vector
[in] featureValue value of feature vector at given featureIndex

template<class T>
void ResultTable< T >::setFeatureVectorFromStr ( int  index,
std::string  str 
)

Sets feature vector of tuple at given index from string in svm format.

Parameters:
[in] index index of entity in entity table
[in] str feature vector in svm format

template<class T>
void ResultTable< T >::setId ( int  index,
int  id 
)

Sets id of tuple at given index.

Parameters:
[in] index index of entity in entity table
[in] id new id

template<class T>
void ResultTable< T >::setTruthValue ( int  index,
int  new_truth_value 
)

Sets truth value of tuple at given index.

Parameters:
[in] index index of entity in entity table
[in] new_truth_value new truth value

template<class T>
void ResultTable< T >::sort (  ) 

sorts entities based on epsilons


Member Data Documentation

template<class T>
bool ResultTable< T >::bCluster [private]

set this to recluster in memory on each sort

template<class T>
int ResultTable< T >::entity_size [private]

# of entities

template<class T>
int* ResultTable< T >::packedIds [private]

packed ids

template<class T>
T* ResultTable< T >::pFeatures [private]

packed feature vectors

template<class T>
resultTuple* ResultTable< T >::table [private]

all entities

template<class T>
int ResultTable< T >::tupleSize [private]

size of tuple


The documentation for this class was generated from the following files:
Generated on Wed Dec 15 10:46:16 2010 for Hazy_System by  doxygen 1.4.7