nlsr::RoutingTableCalculator Class Reference

#include <routing-table-calculator.hpp>

Inheritance diagram for nlsr::RoutingTableCalculator:
[legend]
Collaboration diagram for nlsr::RoutingTableCalculator:
[legend]

Public Member Functions

 RoutingTableCalculator ()
 
 RoutingTableCalculator (size_t nRouters)
 

Protected Member Functions

void allocateAdjMatrix ()
 Allocate the space needed for the adj. matrix. More...
 
void initMatrix ()
 Zero every cell of the matrix to ensure that the memory is safe. More...
 
void makeAdjMatrix (Nlsr &pnlsr, Map pMap)
 Constructs an adj. matrix to calculate with. More...
 
void writeAdjMatrixLog ()
 
int getNumOfLinkfromAdjMatrix (int sRouter)
 Returns how many links a router in the matrix has. More...
 
void freeAdjMatrix ()
 
void adjustAdMatrix (int source, int link, double linkCost)
 Adjust a link cost in the adj. matrix. More...
 
void getLinksFromAdjMatrix (int *links, double *linkCosts, int source)
 Populates temp. variables with the link costs for some router. More...
 
void allocateLinks ()
 
void allocateLinkCosts ()
 
void freeLinks ()
 
void freeLinksCosts ()
 
void setNoLink (int nl)
 

Protected Attributes

double ** adjMatrix
 
size_t m_nRouters
 
int vNoLink
 
int * links
 
double * linkCosts
 

Detailed Description

Definition at line 39 of file routing-table-calculator.hpp.

Constructor & Destructor Documentation

nlsr::RoutingTableCalculator::RoutingTableCalculator ( )
inline

Definition at line 42 of file routing-table-calculator.hpp.

nlsr::RoutingTableCalculator::RoutingTableCalculator ( size_t  nRouters)
inline

Definition at line 45 of file routing-table-calculator.hpp.

Here is the call graph for this function:

Member Function Documentation

void nlsr::RoutingTableCalculator::adjustAdMatrix ( int  source,
int  link,
double  linkCost 
)
protected

Adjust a link cost in the adj. matrix.

Parameters
sourceThe source router whose adjacency to adjust.
linkThe adjacency of the source to adjust.
linkCostThe cost to change to.

Definition at line 132 of file routing-table-calculator.cpp.

Here is the caller graph for this function:

void nlsr::RoutingTableCalculator::allocateAdjMatrix ( )
protected

Allocate the space needed for the adj. matrix.

Definition at line 39 of file routing-table-calculator.cpp.

Here is the caller graph for this function:

void nlsr::RoutingTableCalculator::allocateLinkCosts ( )
protected

Definition at line 188 of file routing-table-calculator.cpp.

Here is the caller graph for this function:

void nlsr::RoutingTableCalculator::allocateLinks ( )
protected

Allocates an array large enough to hold multipath calculation temps.

Definition at line 182 of file routing-table-calculator.cpp.

Here is the caller graph for this function:

void nlsr::RoutingTableCalculator::freeAdjMatrix ( )
protected

Definition at line 173 of file routing-table-calculator.cpp.

Here is the caller graph for this function:

void nlsr::RoutingTableCalculator::freeLinks ( )
protected

Definition at line 195 of file routing-table-calculator.cpp.

Here is the caller graph for this function:

void nlsr::RoutingTableCalculator::freeLinksCosts ( )
protected

Definition at line 200 of file routing-table-calculator.cpp.

Here is the caller graph for this function:

void nlsr::RoutingTableCalculator::getLinksFromAdjMatrix ( int *  links,
double *  linkCosts,
int  source 
)
protected

Populates temp. variables with the link costs for some router.

Parameters
sourceThe router whose values are to be adjusted.
linksAn integer pointer array for the link mappingNos.
linkCostsA double pointer array that stores the link costs.

Obtains a sparse list of adjacencies and link costs for some router. Since this is sparse, that means while generating these arrays, if there is no adjacency at i in the matrix, these temporary variables will not contain a 0 at i, but rather will contain the values for the next valid adjacency.

Definition at line 158 of file routing-table-calculator.cpp.

Here is the caller graph for this function:

int nlsr::RoutingTableCalculator::getNumOfLinkfromAdjMatrix ( int  sRouter)
protected

Returns how many links a router in the matrix has.

Parameters
sRouterThe router to count the links of.

Definition at line 145 of file routing-table-calculator.cpp.

Here is the caller graph for this function:

void nlsr::RoutingTableCalculator::initMatrix ( )
protected

Zero every cell of the matrix to ensure that the memory is safe.

Definition at line 49 of file routing-table-calculator.cpp.

Here is the caller graph for this function:

void nlsr::RoutingTableCalculator::makeAdjMatrix ( Nlsr pnlsr,
Map  pMap 
)
protected

Constructs an adj. matrix to calculate with.

Parameters
pnlsrThe NLSR object that contains the LSAs that we need to iterate over.
pMapThe map to populate with the adj. data.

Definition at line 59 of file routing-table-calculator.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void nlsr::RoutingTableCalculator::setNoLink ( int  nl)
inlineprotected

Definition at line 113 of file routing-table-calculator.hpp.

Here is the caller graph for this function:

void nlsr::RoutingTableCalculator::writeAdjMatrixLog ( )
protected

Definition at line 119 of file routing-table-calculator.cpp.

Here is the caller graph for this function:

Field Documentation

double** nlsr::RoutingTableCalculator::adjMatrix
protected

Definition at line 119 of file routing-table-calculator.hpp.

double* nlsr::RoutingTableCalculator::linkCosts
protected

Definition at line 124 of file routing-table-calculator.hpp.

int* nlsr::RoutingTableCalculator::links
protected

Definition at line 123 of file routing-table-calculator.hpp.

size_t nlsr::RoutingTableCalculator::m_nRouters
protected

Definition at line 120 of file routing-table-calculator.hpp.

int nlsr::RoutingTableCalculator::vNoLink
protected

Definition at line 122 of file routing-table-calculator.hpp.