#include <routing-table-calculator.hpp>
◆ RoutingTableCalculator()
nlsr::RoutingTableCalculator::RoutingTableCalculator |
( |
size_t |
nRouters | ) |
|
|
inline |
◆ adjustAdMatrix()
void nlsr::RoutingTableCalculator::adjustAdMatrix |
( |
int |
source, |
|
|
int |
link, |
|
|
double |
linkCost |
|
) |
| |
|
protected |
Adjust a link cost in the adj. matrix.
- Parameters
-
source | The source router whose adjacency to adjust. |
link | The adjacency of the source to adjust. |
linkCost | The cost to change to. |
Definition at line 161 of file routing-table-calculator.cpp.
◆ allocateAdjMatrix()
void nlsr::RoutingTableCalculator::allocateAdjMatrix |
( |
| ) |
|
|
protected |
◆ allocateLinkCosts()
void nlsr::RoutingTableCalculator::allocateLinkCosts |
( |
| ) |
|
|
protected |
◆ allocateLinks()
void nlsr::RoutingTableCalculator::allocateLinks |
( |
| ) |
|
|
protected |
◆ freeAdjMatrix()
void nlsr::RoutingTableCalculator::freeAdjMatrix |
( |
| ) |
|
|
protected |
◆ freeLinks()
void nlsr::RoutingTableCalculator::freeLinks |
( |
| ) |
|
|
protected |
◆ freeLinksCosts()
void nlsr::RoutingTableCalculator::freeLinksCosts |
( |
| ) |
|
|
protected |
◆ getLinksFromAdjMatrix()
void nlsr::RoutingTableCalculator::getLinksFromAdjMatrix |
( |
int * |
links, |
|
|
double * |
linkCosts, |
|
|
int |
source |
|
) |
| |
|
protected |
Populates temp. variables with the link costs for some router.
- Parameters
-
source | The router whose values are to be adjusted. |
links | An integer pointer array for the link mappingNos. |
linkCosts | A 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 NON_ADJACENT_COST (-12345) at i, but rather will contain the values for the next valid adjacency.
Definition at line 188 of file routing-table-calculator.cpp.
◆ getNumOfLinkfromAdjMatrix()
int nlsr::RoutingTableCalculator::getNumOfLinkfromAdjMatrix |
( |
int |
sRouter | ) |
|
|
protected |
Returns how many links a router in the matrix has.
- Parameters
-
sRouter | The router to count the links of. |
Definition at line 175 of file routing-table-calculator.cpp.
◆ initMatrix()
void nlsr::RoutingTableCalculator::initMatrix |
( |
| ) |
|
|
protected |
set NON_ADJACENT_COST i.e. -12345 to every cell of the matrix to ensure that the memory is safe. This is also to incorporate zero cost links
Definition at line 56 of file routing-table-calculator.cpp.
◆ makeAdjMatrix()
void nlsr::RoutingTableCalculator::makeAdjMatrix |
( |
const Lsdb & |
lsdb, |
|
|
Map & |
pMap |
|
) |
| |
|
protected |
Constructs an adj. matrix to calculate with.
- Parameters
-
lsdb | Reference to the Lsdb |
pMap | The map to populate with the adj. data. |
Definition at line 66 of file routing-table-calculator.cpp.
◆ setNoLink()
void nlsr::RoutingTableCalculator::setNoLink |
( |
int |
nl | ) |
|
|
inlineprotected |
◆ writeAdjMatrixLog()
void nlsr::RoutingTableCalculator::writeAdjMatrixLog |
( |
const Map & |
map | ) |
const |
|
protected |
Writes a formated adjacent matrix to DEBUG log.
- Parameters
-
map | The map containing adjacent matrix data |
Definition at line 123 of file routing-table-calculator.cpp.
◆ adjMatrix
double** nlsr::RoutingTableCalculator::adjMatrix |
|
protected |
◆ linkCosts
double* nlsr::RoutingTableCalculator::linkCosts |
|
protected |
◆ links
int* nlsr::RoutingTableCalculator::links |
|
protected |
◆ m_nRouters
size_t nlsr::RoutingTableCalculator::m_nRouters |
|
protected |
◆ vNoLink
int nlsr::RoutingTableCalculator::vNoLink |
|
protected |