sort.h File Reference

#include <vector>
Include dependency graph for sort.h:
This graph shows which files directly or indirectly include this file:

Functions

template<class T >
bool lowerCost (T x, T y, double *cost, int N, int dimSize)
template<class T >
void sortOnCost (vector< T > &vec, double *cost, int N=1, int dimSize=1)
template<class T >
void sortOnCost (list< T > &vec, double *cost, int N=1, int dimSize=1)

Function Documentation

template<class T >
bool lowerCost ( x,
y,
double *  cost,
int  N,
int  dimSize 
)

lowerCost () The function returns true if x has lower cost then y.

Referenced by sortOnCost().

template<class T >
void sortOnCost ( list< T > &  vec,
double *  cost,
int  N = 1,
int  dimSize = 1 
)

sortOnCost () Sort a list 'vec' using an N-dimensional cost function. The elements of 'vec' are ordered with a cost from low to high. Each element of the vector must be a pointer to an object that has a 'getId' function. The 'getId' function must return an index into the 'cost' array. The size of one dimension (maximal id returned by getId + 1) is equal to dimSize. The number of dimensions contained in the array is 'N'. The cost of an object located at position i the vector 'vec' in dimension 'd' (d < N) is equal to: cost[vec[i]->getId() + d * dimSize]

Note that all dimensions must have the same size.

References lowerCost().

Here is the call graph for this function:

template<class T >
void sortOnCost ( vector< T > &  vec,
double *  cost,
int  N = 1,
int  dimSize = 1 
)

sortOnCost () Sort a vector 'vec' using an N-dimensional cost function. The elements of 'vec' are ordered with a cost from low to high. Each element of the vector must be a pointer to an object that has a 'getId' function. The 'getId' function must return an index into the 'cost' array. The size of one dimension (maximal id returned by getId + 1) is equal to dimSize. The number of dimensions contained in the array is 'N'. The cost of an object located at position i the vector 'vec' in dimension 'd' (d < N) is equal to: cost[vec[i]->getId() + d * dimSize]

Note that all dimensions must have the same size.

References lowerCost().

Referenced by LoadBalanceBinding::optimizeActorToTileBindings(), LoadBalanceBinding::sortActorsOnCriticality(), LoadBalanceBinding::sortTilesOnCommunicationOverhead(), and LoadBalanceBinding::sortTilesOnLoad().

Here is the call graph for this function: