DHART
Loading...
Searching...
No Matches
HF::Pathfinding::DistanceAndPredecessor Struct Reference

Holds and maintains a distance and predecessor matrix. More...

#include <path_finder.h>

+ Collaboration diagram for HF::Pathfinding::DistanceAndPredecessor:

Public Member Functions

 DistanceAndPredecessor (int size)
 Create and allocate a pair of distance and predecessor arrays. More...
 
float * GetRowOfDist (int i)
 Get a pointer to the beginning of the ith row of the distance array. More...
 
int * GetRowOfPred (int i)
 Get a pointer to the beginning of the ith row of the predecessor array. More...
 

Public Attributes

std::vector< float > * dist
 
std::vector< int > * pred
 
int size = 0
 Number of rows and colums. More...
 

Detailed Description

Holds and maintains a distance and predecessor matrix.

Remarks
This is mostly used for the implementation of GenerateDistanceAndPredecessor.
Warning
This object does NOT delete it's internal arrays upon destruction. It's the owner's responsibility to do this!

Definition at line 409 of file path_finder.h.

Constructor & Destructor Documentation

◆ DistanceAndPredecessor()

HF::Pathfinding::DistanceAndPredecessor::DistanceAndPredecessor ( int  size)
inline

Create and allocate a pair of distance and predecessor arrays.

Parameters
sizeNumber of rows and columns. Size of each array will be this to the power of 2

All arrays will be initialized with NAN as their default values

Definition at line 423 of file path_finder.h.

References dist, pred, and size.

Member Function Documentation

◆ GetRowOfDist()

float * HF::Pathfinding::DistanceAndPredecessor::GetRowOfDist ( int  i)
inline

Get a pointer to the beginning of the ith row of the distance array.

Parameters
iIndex of the row to get.
Returns
a pointer to the beginning of row i.

Definition at line 439 of file path_finder.h.

References dist, and size.

Referenced by HF::Pathfinding::GenerateDistanceAndPred(), and operator<<().

+ Here is the caller graph for this function:

◆ GetRowOfPred()

int * HF::Pathfinding::DistanceAndPredecessor::GetRowOfPred ( int  i)
inline

Get a pointer to the beginning of the ith row of the predecessor array.

Parameters
iIndex of the row to get.
Returns
a pointer to the beginning of row i.

Definition at line 453 of file path_finder.h.

References pred, and size.

Referenced by HF::Pathfinding::GenerateDistanceAndPred(), and operator<<().

+ Here is the caller graph for this function:

Member Data Documentation

◆ dist

std::vector<float>* HF::Pathfinding::DistanceAndPredecessor::dist

◆ pred

std::vector<int>* HF::Pathfinding::DistanceAndPredecessor::pred

◆ size

int HF::Pathfinding::DistanceAndPredecessor::size = 0

Number of rows and colums.

Definition at line 413 of file path_finder.h.

Referenced by DistanceAndPredecessor(), GetRowOfDist(), GetRowOfPred(), and operator<<().


The documentation for this struct was generated from the following file: