pub struct DecomposedGraph {
pub input_count: usize,
pub nodes: Vec<(Box<dyn PolydatNode>, Vec<DecomposedWire>)>,
pub output_wires: Vec<DecomposedWire>,
}Expand description
A mini-DAG used for equivalence testing.
Built by fused nodes to represent their unfused (decomposed) form. Not used at runtime — only in tests.
Fields§
§input_count: usizeExternal inputs the graph takes.
nodes: Vec<(Box<dyn PolydatNode>, Vec<DecomposedWire>)>Each node with the wiring of its inputs, in order.
output_wires: Vec<DecomposedWire>Where each output comes from.
Implementations§
Source§impl DecomposedGraph
impl DecomposedGraph
Sourcepub fn add_node(
&mut self,
node: Box<dyn PolydatNode>,
wires: Vec<DecomposedWire>,
) -> usize
pub fn add_node( &mut self, node: Box<dyn PolydatNode>, wires: Vec<DecomposedWire>, ) -> usize
Add a node and return its index.
Sourcepub fn set_outputs(&mut self, wires: Vec<DecomposedWire>)
pub fn set_outputs(&mut self, wires: Vec<DecomposedWire>)
Set the output wire(s) of this graph.
Auto Trait Implementations§
impl !RefUnwindSafe for DecomposedGraph
impl !UnwindSafe for DecomposedGraph
impl Forget for DecomposedGraph
impl Freeze for DecomposedGraphwhere
*const u8 is !null: Freeze,
PhantomData<(Box<dyn PolydatNode>, Vec<DecomposedWire>)>: Freeze,
PhantomData<DecomposedWire>: Freeze,
impl Move for DecomposedGraph
impl Send for DecomposedGraph
impl Sync for DecomposedGraph
impl Unpin for DecomposedGraph
impl UnsafeUnpin for DecomposedGraphwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<(Box<dyn PolydatNode>, Vec<DecomposedWire>)>: UnsafeUnpin,
PhantomData<DecomposedWire>: UnsafeUnpin,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more