pub enum Operation {
Value(Value),
Add(NodeIndex, NodeIndex),
Sub(NodeIndex, NodeIndex),
Mul(NodeIndex, NodeIndex),
Exp(NodeIndex, usize),
}
Expand description
Operation defines the various node types represented in the AlgebraicGraph.
Variants§
Value(Value)
Evaluates to a Value
This is always a leaf node in the graph.
Add(NodeIndex, NodeIndex)
Evaluates by addition over two operands (given as nodes in the graph)
Sub(NodeIndex, NodeIndex)
Evaluates by subtraction over two operands (given as nodes in the graph)
Mul(NodeIndex, NodeIndex)
Evaluates by multiplication over two operands (given as nodes in the graph)
Exp(NodeIndex, usize)
Evaluates by exponentiation over two operands (the first given as a node in the graph, the second as a constant).
NOTE: The exponent must be a constant value currently. In the future, it may be possible to support non-constant exponents, but it is not supported at this time.
Implementations§
Trait Implementations§
source§impl PartialEq<Operation> for Operation
impl PartialEq<Operation> for Operation
impl Copy for Operation
impl Eq for Operation
impl StructuralEq for Operation
impl StructuralPartialEq for Operation
Auto Trait Implementations§
impl RefUnwindSafe for Operation
impl Send for Operation
impl Sync for Operation
impl Unpin for Operation
impl UnwindSafe for Operation
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
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.