pub trait NodeWeightArray<WeightType> {
    // Required methods
    fn new(size: usize) -> Self;
    fn get(&self, node_index: usize) -> WeightType;
    fn get_mut<'this: 'result, 'result>(
        &'this mut self,
        node_index: usize
    ) -> &'result mut WeightType;
    fn set(&mut self, node_index: usize, weight: WeightType);
    fn clear(&mut self);
    fn size(&self) -> usize;
}
Expand description

An array to store minimal node weights for Dijkstra’s algorithm.

Required Methods§

source

fn new(size: usize) -> Self

Create a new NodeWeightArray of given size.

source

fn get(&self, node_index: usize) -> WeightType

Returns the current weight of the given node index.

source

fn get_mut<'this: 'result, 'result>( &'this mut self, node_index: usize ) -> &'result mut WeightType

Returns the current weight of the given node index as mutable reference.

source

fn set(&mut self, node_index: usize, weight: WeightType)

Sets the current weight of the given node index.

source

fn clear(&mut self)

Resets the weights of all node indices to infinity

source

fn size(&self) -> usize

Returns the number of nodes whose weight is stored in the data structure.

Implementations on Foreign Types§

source§

impl<WeightType: DijkstraWeight + Copy> NodeWeightArray<WeightType> for Vec<WeightType>

source§

fn new(size: usize) -> Self

source§

fn get(&self, node_index: usize) -> WeightType

source§

fn get_mut<'this: 'result, 'result>( &'this mut self, node_index: usize ) -> &'result mut WeightType

source§

fn set(&mut self, node_index: usize, weight: WeightType)

source§

fn clear(&mut self)

source§

fn size(&self) -> usize

Implementors§

source§

impl<WeightType: DijkstraWeight + Copy> NodeWeightArray<WeightType> for EpochNodeWeightArray<WeightType>