[−][src]Struct auto_diff::collection::graph::Graph
Methods
impl Graph
[src]
pub fn new() -> Graph
[src]
Create a graph with defaults
pub fn list_data(&self) -> Vec<NetIndex>
[src]
iterator over data node.
pub fn list_op(&self) -> Vec<NetIndex>
[src]
iterator over op node.
pub fn add_data(&mut self, id: &NetIndex) -> Result<NetIndex, &str>
[src]
Add a data node.
let mut g = Graph::new(); let data1 = NetIndex::new(0,0); let data2 = NetIndex::new(1,0); g.add_data(&data1); g.add_data(&data2);
pub fn del_data(&mut self, id: &NetIndex) -> Result<NetIndex, &str>
[src]
Remove a data node, op node and downstream data/op node are removed.
pub fn add_op(&mut self, id: &NetIndex) -> Result<NetIndex, &str>
[src]
Add a danglging op node.
pub fn del_op(&mut self, id: &NetIndex) -> Result<NetIndex, &str>
[src]
Remvoe an op node, input data node and downstream data/op node are removed.
pub fn get_input_cache(&self) -> BTreeSet<NetIndex>
[src]
list data node without upstream op node in a set.
pub fn get_output_cache(&self) -> BTreeSet<NetIndex>
[src]
list data node without downstream op node in a set.
pub fn connect(
&mut self,
dti: &[NetIndex],
dto: &[NetIndex],
op: &NetIndex
) -> Result<NetIndex, &str>
[src]
&mut self,
dti: &[NetIndex],
dto: &[NetIndex],
op: &NetIndex
) -> Result<NetIndex, &str>
Connect input data, output data and operation
pub fn walk<F>(
&self,
start_set: &[NetIndex],
forward: bool,
closure: F
) -> Result<(), BTreeSet<NetIndex>> where
F: Fn(&[NetIndex], &[NetIndex], &NetIndex),
[src]
&self,
start_set: &[NetIndex],
forward: bool,
closure: F
) -> Result<(), BTreeSet<NetIndex>> where
F: Fn(&[NetIndex], &[NetIndex], &NetIndex),
Walk through the graph with a starting set of data nodes. Go through backwards if forward is false.
Auto Trait Implementations
impl RefUnwindSafe for Graph
impl Send for Graph
impl Sync for Graph
impl Unpin for Graph
impl UnwindSafe for Graph
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,