Enum symbolic_polynomials::Composite
[−]
[src]
pub enum Composite<I, C, P> where
I: Id,
C: Coefficient,
P: Power, { Variable(I), Floor(Rc<Polynomial<I, C, P>>, Rc<Polynomial<I, C, P>>), Ceil(Rc<Polynomial<I, C, P>>, Rc<Polynomial<I, C, P>>), Min(Rc<Polynomial<I, C, P>>, Rc<Polynomial<I, C, P>>), Max(Rc<Polynomial<I, C, P>>, Rc<Polynomial<I, C, P>>), }
A composite expression (tagged union) of a variable or an irreducible function (floor, ceil, max, min)
Variants
Variable(I)
Floor(Rc<Polynomial<I, C, P>>, Rc<Polynomial<I, C, P>>)
Ceil(Rc<Polynomial<I, C, P>>, Rc<Polynomial<I, C, P>>)
Min(Rc<Polynomial<I, C, P>>, Rc<Polynomial<I, C, P>>)
Max(Rc<Polynomial<I, C, P>>, Rc<Polynomial<I, C, P>>)
Methods
impl<I, C, P> Composite<I, C, P> where
I: Id,
C: Coefficient,
P: Power,
[src]
I: Id,
C: Coefficient,
P: Power,
fn eval(&self, values: &HashMap<I, C>) -> Result<C, (I, String)>
Evaluates the Composite
given the provided mapping of identifier to value assignment.
fn to_code<F>(&self, format: &F) -> String where
F: Fn(I) -> String,
F: Fn(I) -> String,
Returns a code equivalent string representation of the Composite
.
The format
specifies a function how to render the identifiers;
Trait Implementations
impl<I: Clone, C: Clone, P: Clone> Clone for Composite<I, C, P> where
I: Id,
C: Coefficient,
P: Power,
[src]
I: Id,
C: Coefficient,
P: Power,
fn clone(&self) -> Composite<I, C, P>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl<I: Debug, C: Debug, P: Debug> Debug for Composite<I, C, P> where
I: Id,
C: Coefficient,
P: Power,
[src]
I: Id,
C: Coefficient,
P: Power,
impl<I: PartialEq, C: PartialEq, P: PartialEq> PartialEq for Composite<I, C, P> where
I: Id,
C: Coefficient,
P: Power,
[src]
I: Id,
C: Coefficient,
P: Power,
fn eq(&self, __arg_0: &Composite<I, C, P>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Composite<I, C, P>) -> bool
This method tests for !=
.
impl<I: Eq, C: Eq, P: Eq> Eq for Composite<I, C, P> where
I: Id,
C: Coefficient,
P: Power,
[src]
I: Id,
C: Coefficient,
P: Power,
impl<I, C, P> Display for Composite<I, C, P> where
I: Id,
C: Coefficient,
P: Power,
[src]
I: Id,
C: Coefficient,
P: Power,
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
Formats the value using the given formatter. Read more
impl<I, C, P> PartialOrd for Composite<I, C, P> where
I: Id,
C: Coefficient,
P: Power,
[src]
I: Id,
C: Coefficient,
P: Power,
fn partial_cmp(&self, other: &Composite<I, C, P>) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &Rhs) -> bool
1.0.0
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &Rhs) -> bool
1.0.0
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &Rhs) -> bool
1.0.0
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &Rhs) -> bool
1.0.0
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl<I, C, P> Ord for Composite<I, C, P> where
I: Id,
C: Coefficient,
P: Power,
[src]
I: Id,
C: Coefficient,
P: Power,