[][src]Struct nasbench::AdjacencyMatrix

pub struct AdjacencyMatrix { /* fields omitted */ }

Adjacency (upper-triangular) matrix of a module.

Examples

use nasbench::AdjacencyMatrix;

let matrix0 = AdjacencyMatrix::new(vec![
    vec![false, true, false, false, true, true, false],
    vec![false, false, true, false, false, false, false],
    vec![false, false, false, true, false, false, true],
    vec![false, false, false, false, false, true, false],
    vec![false, false, false, false, false, true, false],
    vec![false, false, false, false, false, false, true],
    vec![false, false, false, false, false, false, false]
])?;
assert_eq!(matrix0.dimension(), 7);

let matrix1 = "0100110001000000010010000010000001000000010000000".parse()?;
assert_eq!(matrix0, matrix1);

Methods

impl AdjacencyMatrix[src]

pub fn new(matrix: Vec<Vec<bool>>) -> Result<Self>[src]

Makes a new AdjacencyMatrix instance.

pub fn dimension(&self) -> usize[src]

Returns the dimension of this matrix.

Trait Implementations

impl Clone for AdjacencyMatrix[src]

impl Debug for AdjacencyMatrix[src]

impl Eq for AdjacencyMatrix[src]

impl FromStr for AdjacencyMatrix[src]

type Err = Failure

The associated error which can be returned from parsing.

impl Hash for AdjacencyMatrix[src]

impl PartialEq<AdjacencyMatrix> for AdjacencyMatrix[src]

impl StructuralEq for AdjacencyMatrix[src]

impl StructuralPartialEq for AdjacencyMatrix[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.