Skip to main content

BenchmarkGraph

Struct BenchmarkGraph 

Source
pub struct BenchmarkGraph<const N: usize> { /* private fields */ }
Expand description

A directed graph with N integer objectives per edge, over states 0..nodes, as the suite’s instances are.

Implementations§

Source§

impl<const N: usize> BenchmarkGraph<N>

Source

pub fn from_arcs(nodes: u32, arcs: &[(u32, u32, [u32; N])]) -> Self

A graph over nodes states with the arcs (from, to, costs).

§Panics

Panics if an arc names a state >= nodes.

Source

pub fn node_count(&self) -> u32

The number of states.

§Panics

Never: the graph was built from a u32 count.

Source

pub fn arc_count(&self) -> usize

The number of arcs.

Source

pub fn arcs(&self) -> impl Iterator<Item = (u32, u32, [u32; N])> + '_

Every arc as (from, to, costs).

§Panics

Never: the graph was built from a u32 count.

Source

pub fn project<const M: usize>( &self, objectives: [usize; M], ) -> BenchmarkGraph<M>

The same graph with only the objectives objectives, in that order (for example the three-, four- and five-objective DIMACS-Extended variants of one five-objective graph).

§Panics

Panics if an objective index is >= N.

Trait Implementations§

Source§

impl<const N: usize> Clone for BenchmarkGraph<N>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<const N: usize> Debug for BenchmarkGraph<N>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<const N: usize> Eq for BenchmarkGraph<N>

Source§

impl<const N: usize> Graph for BenchmarkGraph<N>

Source§

type State = u32

A search state. Ord keys the per-state bookkeeping (a BTreeMap, since the crate is no_std).
Source§

type Weight = [u32; N]

The cost vector of one edge, for example [u32; 2].
Source§

fn successors(&self, state: &u32, out: &mut Vec<(u32, [u32; N])>)

Appends every outgoing edge of state to out as (successor, weight). Read more
Source§

impl<const N: usize> PartialEq for BenchmarkGraph<N>

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl<const N: usize> ReverseGraph for BenchmarkGraph<N>

Source§

fn predecessors(&self, state: &u32, out: &mut Vec<(u32, [u32; N])>)

Appends every incoming edge of state to out as (predecessor, weight), where weight is the cost of the edge from predecessor to state. Read more
Source§

impl<const N: usize> StructuralPartialEq for BenchmarkGraph<N>

Auto Trait Implementations§

§

impl<const N: usize> Forget for BenchmarkGraph<N>

§

impl<const N: usize> Freeze for BenchmarkGraph<N>
where Vec<Vec<(u32, [u32; N])>>: Freeze,

§

impl<const N: usize> Move for BenchmarkGraph<N>

§

impl<const N: usize> RefUnwindSafe for BenchmarkGraph<N>
where Vec<Vec<(u32, [u32; N])>>: RefUnwindSafe,

§

impl<const N: usize> Send for BenchmarkGraph<N>
where Vec<Vec<(u32, [u32; N])>>: Send,

§

impl<const N: usize> Sync for BenchmarkGraph<N>
where Vec<Vec<(u32, [u32; N])>>: Sync,

§

impl<const N: usize> Unpin for BenchmarkGraph<N>
where Vec<Vec<(u32, [u32; N])>>: Unpin,

§

impl<const N: usize> UnsafeUnpin for BenchmarkGraph<N>
where Vec<Vec<(u32, [u32; N])>>: UnsafeUnpin,

§

impl<const N: usize> UnwindSafe for BenchmarkGraph<N>
where Vec<Vec<(u32, [u32; N])>>: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.