pub enum Tree {
Add(Vec<Self>),
Mul(Vec<Self>),
Num(Rational),
Sym(Symbol),
}Expand description
Non-binary algebraic expression tree up to symbolic Multivector expressions.
Unifies and simplifies following implementations due to being an intermediate and recursive data structure:
impl Display for Multivectorimpl Octal for Multivector
Convert from:
Tree::from(Multivector)orTree::with_factorization(v, true)Tree::from(Factorization)Tree::from(Polynomial)Tree::from(Monomial)Tree::from(Rational)Tree::from(Symbol)
Convert to:
Variants§
Add(Vec<Self>)
Sum of subtrees.
Mul(Vec<Self>)
Product of subtrees.
Num(Rational)
Rational leaf node.
Sym(Symbol)
Symbolic leaf node.
Implementations§
Source§impl Tree
impl Tree
Sourcepub fn with_factorization<B: Algebra>(v: Multivector<B>, signed: bool) -> Self
pub fn with_factorization<B: Algebra>(v: Multivector<B>, signed: bool) -> Self
Performs factorization on v and creates tree.
Optionally, the GCDs are signed comprising the factored predominant sign.
Trait Implementations§
Source§impl From<Factorization> for Tree
impl From<Factorization> for Tree
Source§fn from(f: Factorization) -> Self
fn from(f: Factorization) -> Self
Converts to this type from the input type.
Source§impl<B: Algebra> From<Multivector<B>> for Tree
impl<B: Algebra> From<Multivector<B>> for Tree
Source§fn from(v: Multivector<B>) -> Self
fn from(v: Multivector<B>) -> Self
Converts to this type from the input type.
Source§impl From<Polynomial> for Tree
impl From<Polynomial> for Tree
Source§fn from(p: Polynomial) -> Self
fn from(p: Polynomial) -> Self
Converts to this type from the input type.
Source§impl Ord for Tree
impl Ord for Tree
Source§impl PartialOrd for Tree
impl PartialOrd for Tree
impl Eq for Tree
impl StructuralPartialEq for Tree
Auto Trait Implementations§
impl Freeze for Tree
impl RefUnwindSafe for Tree
impl Send for Tree
impl Sync for Tree
impl Unpin for Tree
impl UnwindSafe for Tree
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