DHART
Loading...
Searching...
No Matches
HF::SpatialStructures::EdgeCostSet Class Reference

A set of edge costs for a graph. More...

#include <graph.h>

+ Collaboration diagram for HF::SpatialStructures::EdgeCostSet:

Public Member Functions

 EdgeCostSet ()
 Construct an empty edge cost set. More...
 
 EdgeCostSet (int size)
 Create an edge cost set and allocate a specific size. More...
 
int size () const
 Get the size of this edge matrix. More...
 
void ResizeIfNeeded (int new_size)
 Resize this edge matrix if needed. More...
 
void Clear ()
 Clear all values from this edge cost set. More...
 
float & operator[] (int i)
 Index internal values array. More...
 
bool bounds_check (int i) const
 
float operator[] (int i) const
 Index internal values array. More...
 
float * GetPtr ()
 Get the pointer to the start of this array. More...
 
const float * GetPtr () const
 Get the pointer to the start of this array. More...
 

Private Attributes

std::vector< float > costs
 Array of costs to be used like eigen's internal indices array. More...
 

Detailed Description

A set of edge costs for a graph.

Arrays that can be swapped in and out of the array's indices.

Definition at line 375 of file graph.h.

Constructor & Destructor Documentation

◆ EdgeCostSet() [1/2]

HF::SpatialStructures::EdgeCostSet::EdgeCostSet ( )
inline

Construct an empty edge cost set.

Definition at line 381 of file graph.h.

◆ EdgeCostSet() [2/2]

HF::SpatialStructures::EdgeCostSet::EdgeCostSet ( int  size)
inline

Create an edge cost set and allocate a specific size.

Parameters
sizeSize of this cost set to be preallocated upon construction.

Definition at line 388 of file graph.h.

References ResizeIfNeeded().

+ Here is the call graph for this function:

Member Function Documentation

◆ bounds_check()

bool HF::SpatialStructures::EdgeCostSet::bounds_check ( int  i) const
inline

Definition at line 429 of file graph.h.

References size().

Referenced by operator[]().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Clear()

void HF::SpatialStructures::EdgeCostSet::Clear ( )
inline

Clear all values from this edge cost set.

Definition at line 417 of file graph.h.

◆ GetPtr() [1/2]

float * HF::SpatialStructures::EdgeCostSet::GetPtr ( )
inline

Get the pointer to the start of this array.

Returns
a pointer to the value of this EdgeCostSet's internal costs array

Definition at line 448 of file graph.h.

◆ GetPtr() [2/2]

const float * HF::SpatialStructures::EdgeCostSet::GetPtr ( ) const
inline

Get the pointer to the start of this array.

Returns
a pointer to the value of this EdgeCostSet's internal costs array

Definition at line 458 of file graph.h.

◆ operator[]() [1/2]

float & HF::SpatialStructures::EdgeCostSet::operator[] ( int  i)
inline

Index internal values array.

Parameters
iindex to get the cost of
Returns
the value at index i in costs.

Definition at line 424 of file graph.h.

References bounds_check().

+ Here is the call graph for this function:

◆ operator[]() [2/2]

float HF::SpatialStructures::EdgeCostSet::operator[] ( int  i) const
inline

Index internal values array.

Parameters
iindex to get the cost of
Returns
the value at index i in costs.

Definition at line 438 of file graph.h.

References bounds_check().

+ Here is the call graph for this function:

◆ ResizeIfNeeded()

void HF::SpatialStructures::EdgeCostSet::ResizeIfNeeded ( int  new_size)
inline

Resize this edge matrix if needed.

Parameters
new_sizenew size of the array to allocate to

If size is less than the current size, this function doesn't do anything. All new values are defaulted to NAN.

Definition at line 403 of file graph.h.

References costs, and size().

Referenced by EdgeCostSet().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ size()

int HF::SpatialStructures::EdgeCostSet::size ( ) const
inline

Get the size of this edge matrix.

Returns
how many values this matrix can hold, or the size of its internal costs array.

Definition at line 394 of file graph.h.

Referenced by bounds_check(), and ResizeIfNeeded().

+ Here is the caller graph for this function:

Member Data Documentation

◆ costs

std::vector<float> HF::SpatialStructures::EdgeCostSet::costs
private

Array of costs to be used like eigen's internal indices array.

Definition at line 377 of file graph.h.

Referenced by ResizeIfNeeded().


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