pub struct RewriteEngine { /* private fields */ }Expand description
Graph rewriting engine.
Implementations§
Source§impl RewriteEngine
impl RewriteEngine
Sourcepub fn add_rule(self, rule: RewriteRule) -> Self
pub fn add_rule(self, rule: RewriteRule) -> Self
Add a rewrite rule.
Sourcepub fn with_strategy(self, strategy: RewriteStrategy) -> Self
pub fn with_strategy(self, strategy: RewriteStrategy) -> Self
Set the rewrite strategy.
Sourcepub fn with_verification(self, enabled: bool) -> Self
pub fn with_verification(self, enabled: bool) -> Self
Enable or disable semantics verification.
Sourcepub fn stats(&self) -> &RewriteStats
pub fn stats(&self) -> &RewriteStats
Get rewrite statistics.
Sourcepub fn reset_stats(&mut self)
pub fn reset_stats(&mut self)
Reset statistics.
Sourcepub fn rewrite_simple(
&mut self,
node_count: usize,
) -> Result<usize, RewriteError>
pub fn rewrite_simple( &mut self, node_count: usize, ) -> Result<usize, RewriteError>
Apply rewrites to a simplified graph representation. In a real implementation, this would work with the actual EinsumGraph.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RewriteEngine
impl !RefUnwindSafe for RewriteEngine
impl !Send for RewriteEngine
impl !Sync for RewriteEngine
impl Unpin for RewriteEngine
impl !UnwindSafe for RewriteEngine
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