Superclass for weight oracles that provide weights for edges. More...
#include <WeightOracle.h>
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 () |
Superclass for weight oracles that provide weights for edges.
Subclasses can implement different weight functions between nodes etc.
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
[in] | row | row or id of first node |
[in] | col | col or id of 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
double WeightOracle::getIndexedWeight | ( | int | row, |
int | rank | ||
) |
returns the rank'th greatest weight for the row'th node
[in] | row | row index to look up |
[in] | rank | rank of the element to look up |
int WeightOracle::getSize | ( | ) | [virtual]
|
returns the 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
[in] | row | row or id of first node |
[in] | col | col or id of second node |
int WeightOracle::getWeightIndex | ( | int | row, |
int | rank | ||
) |
returns the index of the rank'th greatest weight for the row'th node
[in] | row | row index to look up |
[in] | rank | rank of element to look up |
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
[in] | c | size of the indexed cache of top few weights |