Public Member Functions

WeightOracle Class Reference

Superclass for weight oracles that provide weights for edges. More...

#include <WeightOracle.h>

Inheritance diagram for WeightOracle:
BipartiteFunctionOracle BipartiteMatrixOracle FunctionOracle MatrixOracle

List of all members.

Public Member Functions

void  computeIndex ()
int  getWeightIndex (int row, int rank)
double  getIndexedWeight (int row, int rank)
double  getWeight (int row, int col)
virtual double  computeWeight (int row, int col)
virtual int  getSize ()
int  getCacheSize ()
void  setCacheSize (int c)
void  printStatsString ()

Detailed Description

Superclass for weight oracles that provide weights for edges.

Subclasses can implement different weight functions between nodes etc.


Member Function Documentation

void WeightOracle::computeIndex (  )

Computes the lookup index for the top few weights of each node

double WeightOracle::computeWeight ( int   row,
int   col  
) [virtual]

returns the weight between the row'th and col'th nodes

Parameters:
[in]rowrow or id of first node
[in]colcol or id of second node
Returns:
weight of edge between first and second node

Reimplemented in BipartiteFunctionOracle, BipartiteMatrixOracle, FunctionOracle, and MatrixOracle.

int WeightOracle::getCacheSize (  )

returns the size of the indexed cache of top few weights of each node

Returns:
the size of the indexed cache of top few weights of each node
double WeightOracle::getIndexedWeight ( int   row,
int   rank  
)

returns the rank'th greatest weight for the row'th node

Parameters:
[in]rowrow index to look up
[in]rankrank of the element to look up
Returns:
weight of the rank'th greatest weight of row'th node
int WeightOracle::getSize (  ) [virtual]

returns the number of nodes

Returns:
total number of nodes

Reimplemented in BipartiteFunctionOracle, BipartiteMatrixOracle, FunctionOracle, and MatrixOracle.

double WeightOracle::getWeight ( int   row,
int   col  
)

returns the weight between the row'th and col'th nodes, checking cache first, and if not in cache, calls computeWeight

Parameters:
[in]rowrow or id of first node
[in]colcol or id of second node
Returns:
weight of edge between first and second node
int WeightOracle::getWeightIndex ( int   row,
int   rank  
)

returns the index of the rank'th greatest weight for the row'th node

Parameters:
[in]rowrow index to look up
[in]rankrank of element to look up
Returns:
index of the rank'th greatest weight for the row'th node
void WeightOracle::printStatsString (  )

prints text describing statistics collected by both caches

void WeightOracle::setCacheSize ( int   c  )

sets the size of the indexed cache of top few weights

Parameters:
[in]csize of the indexed cache of top few weights

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Defines