Struct scotch::graph::Data

source ·
#[non_exhaustive]
pub struct Data<'d> { pub baseval: Num, pub verttab: &'d [Num], pub vendtab: &'d [Num], pub velotab: &'d [Num], pub vlbltab: &'d [Num], pub edgetab: &'d [Num], pub edlotab: &'d [Num], }
Expand description

Deconstructed graph data.

Invariants

This structure ensures the following invariants are met:

  • if vendtab is empty,
    1. verttab must be non-empty,
    2. velotab, if non-empty, must have exactly one less element than verttab, and
    3. vlbltab, if non-empty, must have exactly one less element than verttab,
  • if vendtab is non-empty,
    1. verttab and vendtab must have the same length,
    2. velotab, if non-empty, must have the same length as verttab, and
    3. vlbltab, if non-empty, must have the same length as verttab,
  • edlotab, if non-empty, must have the same length as edgetab,
  • The length of verttab must fit in a Num,
  • The length of edgetab must fit in a Num.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§baseval: Num

Graph base value for arrays (typically 0).

§verttab: &'d [Num]

Adjency start index array.

Adjacent nodes of node #i are stored in &edgetab[verttab[i]..vendtab[i]].

§vendtab: &'d [Num]

Adjency end index array.

Adjacent nodes of node #i are stored in &edgetab[verttab[i]..vendtab[i]].

This is typically empty, and Scotch sets it to the default &verttab[1..].

§velotab: &'d [Num]

Vertex load array.

§vlbltab: &'d [Num]

Vertex label array.

§edgetab: &'d [Num]

Adjency array.

§edlotab: &'d [Num]

Edge load array.

Implementations§

source§

impl<'d> Data<'d>

source

pub fn new( baseval: Num, verttab: &'d [Num], vendtab: &'d [Num], velotab: &'d [Num], vlbltab: &'d [Num], edgetab: &'d [Num], edlotab: &'d [Num] ) -> Data<'d>

Group-up graph data.

Panics

The invariants of Data must be uphold, otherwise this function will panic.

source

pub fn vertnbr(&self) -> Num

The number of vertices.

Auto Trait Implementations§

§

impl<'d> RefUnwindSafe for Data<'d>

§

impl<'d> Send for Data<'d>

§

impl<'d> Sync for Data<'d>

§

impl<'d> Unpin for Data<'d>

§

impl<'d> UnwindSafe for Data<'d>

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

const: unstable · 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, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.