[][src]Trait vrp_core::models::matrix::AdjacencyMatrix

pub trait AdjacencyMatrix {
    fn new(size: usize) -> Self;
fn values<'a>(&'a self) -> Box<dyn Iterator<Item = f64> + 'a>;
fn set_cell(&mut self, row: usize, col: usize, value: f64);
fn scan_row<F>(&self, row: usize, predicate: F) -> Option<usize>
    where
        F: Fn(f64) -> bool
; }

An adjacency matrix trait specifies behaviour of a data structure which is used to store VRP solution.

Required methods

fn new(size: usize) -> Self

Creates a new AdjacencyMatrix with size*size

fn values<'a>(&'a self) -> Box<dyn Iterator<Item = f64> + 'a>

Iterates over unique matrix values.

fn set_cell(&mut self, row: usize, col: usize, value: f64)

Sets given value to cell.

fn scan_row<F>(&self, row: usize, predicate: F) -> Option<usize> where
    F: Fn(f64) -> bool

Scans given row in order to find first occurrence of element for which predicate returns true.

Loading content...

Implementors

impl AdjacencyMatrix for SparseMatrix[src]

Loading content...