pub struct HyperCube(/* private fields */);
Implementations§
Source§impl HyperCube
impl HyperCube
Sourcepub fn new(n: u64) -> HyperCube
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§
impl Freeze for HyperCube
impl RefUnwindSafe for HyperCube
impl Send for HyperCube
impl Sync for HyperCube
impl Unpin for HyperCube
impl UnwindSafe for HyperCube
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more