pub struct CSE<N, C: CSEController<Node = N>> { /* private fields */ }
Expand description
The main entry point of Common Subexpression Elimination.
CSE
requires a CSEController
, that defines how common subtrees of a particular
TreeNode
tree can be eliminated. The elimination process can be started with the
CSE::extract_common_nodes()
method.
Implementations§
Source§impl<N: TreeNode + HashNode + Clone + Eq, C: CSEController<Node = N>> CSE<N, C>
impl<N: TreeNode + HashNode + Clone + Eq, C: CSEController<Node = N>> CSE<N, C>
pub fn new(controller: C) -> Self
Sourcepub fn extract_common_nodes(
&mut self,
nodes_list: Vec<Vec<N>>,
) -> Result<FoundCommonNodes<N>>
pub fn extract_common_nodes( &mut self, nodes_list: Vec<Vec<N>>, ) -> Result<FoundCommonNodes<N>>
Extracts common TreeNode
s and rewrites nodes_list
.
Returns FoundCommonNodes
recording the result of the extraction.
Auto Trait Implementations§
impl<N, C> Freeze for CSE<N, C>where
C: Freeze,
impl<N, C> RefUnwindSafe for CSE<N, C>where
C: RefUnwindSafe,
N: RefUnwindSafe,
impl<N, C> Send for CSE<N, C>
impl<N, C> Sync for CSE<N, C>
impl<N, C> Unpin for CSE<N, C>
impl<N, C> UnwindSafe for CSE<N, C>where
C: UnwindSafe,
N: UnwindSafe,
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