Struct HyperCube

Source
pub struct HyperCube(/* private fields */);

Implementations§

Source§

impl HyperCube

Source

pub fn new(n: u64) -> HyperCube

Examples found in repository?
examples/hyper_cube_examples.rs (line 19)
14fn example_lemma1() {
15    println!("this is an example of lemma1 on a HyperCube.");
16    let n = 8;
17    let s = 0b0000_0001;
18
19    let graph = HyperCube::new(n);
20
21    let path = graph.lemma1(n, s);
22
23    println!("{:#?}", path);
24}
25
26fn example_lemma2() {
27    println!("this is an example of lemma2 on a HyperCube");
28    let n = 8;
29    let s = 0b0011_0011;
30    let d = 0b1010_1010;
31
32    let graph = HyperCube::new(n);
33
34    let path = graph.lemma2(s, d);
35
36    println!("{:?}", path);
37}
38
39fn example_node_to_set() {
40    println!("This is an example of node to set on a HyperCube");
41    let n = 8;
42    let s = 0b0101_0101;
43    let mut d = vec![];
44
45    for i in 0..8 {
46        d.push(1 << i);
47    }
48
49    let graph = HyperCube::new(n);
50
51    let paths = graph.node_to_set(s, &d);
52
53    println!("{:#?}", paths);
54}
55
56fn example_node_to_node() {
57    println!("This is an example of node to node on a HyperCube");
58    let n = 8;
59    let s = 0b0101_0101;
60    let d = 0b0000_1111;
61
62    let graph = HyperCube::new(n);
63
64    let paths = graph.node_to_node(s, d);
65
66    println!("{:#?}", paths);
67}

Trait Implementations§

Auto Trait Implementations§

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> 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<F> Lemma1 for F

Source§

fn lemma1(&self, n: u64, d: u64) -> Vec<NodePath<'_>>

Source§

impl<F> Lemma2 for F

Source§

fn lemma2(&self, s: u64, d: u64) -> NodePath<'_>

Source§

fn R(&self, s: u64, d: u64) -> NodePath<'_>

Source§

fn R_helper(&self, n: u64, s: u64, d: u64, path: &mut NodePath<'_>)

Source§

impl<F> NodeToNode for F

Source§

fn N2N(&self, s: u64, d: u64) -> Vec<NodePath<'_>>

Source§

fn node_to_node(&self, s: u64, d: u64) -> Vec<NodePath<'_>>

Source§

fn node_to_node_helper(&self, n: u64, s: u64, d: u64) -> Vec<NodePath<'_>>

Source§

impl<F> NodeToSet for F

Source§

fn N2S(&self, s: u64, d: &[u64]) -> Vec<NodePath<'_>>

Source§

fn node_to_set(&self, s: u64, d: &[u64]) -> Vec<NodePath<'_>>

Source§

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

Source§

type Error = Infallible

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

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

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.