Enum reform::structure::Element [−][src]
pub enum Element<ID: Id = VarName> { VariableArgument(ID), Wildcard(ID, Vec<Element<ID>>), FnWildcard(ID, Box<(Vec<Element<ID>>, Vec<Element<ID>>)>), Dollar(ID, Vec<Element<ID>>), Var(ID, Number), Pow(bool, Box<(Element<ID>, Element<ID>)>), NumberRange(Number, Ordering), Comparison(bool, Box<(Element<ID>, Element<ID>)>, Ordering), Fn(bool, ID, Vec<Element<ID>>), Term(bool, Vec<Element<ID>>), SubExpr(bool, Vec<Element<ID>>), Num(bool, Number), RationalPolynomialCoefficient(bool, Box<(Polynomial, Polynomial)>), }
Variants
VariableArgument(ID)
Wildcard(ID, Vec<Element<ID>>)
FnWildcard(ID, Box<(Vec<Element<ID>>, Vec<Element<ID>>)>)
Dollar(ID, Vec<Element<ID>>)
Var(ID, Number)
Pow(bool, Box<(Element<ID>, Element<ID>)>)
NumberRange(Number, Ordering)
Comparison(bool, Box<(Element<ID>, Element<ID>)>, Ordering)
Fn(bool, ID, Vec<Element<ID>>)
Term(bool, Vec<Element<ID>>)
SubExpr(bool, Vec<Element<ID>>)
Num(bool, Number)
RationalPolynomialCoefficient(bool, Box<(Polynomial, Polynomial)>)
Methods
impl Element
[src]
impl Element
pub fn partial_cmp_factor(
&self,
other: &Element,
var_info: &GlobalVarInfo
) -> Option<Ordering>
[src]
pub fn partial_cmp_factor(
&self,
other: &Element,
var_info: &GlobalVarInfo
) -> Option<Ordering>
A custom partial order that is used to normalize a term. TODO: check consistency with partial_cmp!
pub fn partial_cmp(
&self,
other: &Element,
var_info: &GlobalVarInfo,
ground_level: bool
) -> Option<Ordering>
[src]
pub fn partial_cmp(
&self,
other: &Element,
var_info: &GlobalVarInfo,
ground_level: bool
) -> Option<Ordering>
pub fn partial_cmp_full(
&self,
other: &Element,
var_info: &GlobalVarInfo,
ground_level: bool
) -> Option<Ordering>
[src]
pub fn partial_cmp_full(
&self,
other: &Element,
var_info: &GlobalVarInfo,
ground_level: bool
) -> Option<Ordering>
A custom partial order that ignores coefficients for the ground level, i.e., x and x*2 are considered equal.
impl Element
[src]
impl Element
pub fn fmt_output(
&self,
f: &mut Formatter,
print_mode: PrintMode,
var_info: &GlobalVarInfo
) -> Result
[src]
pub fn fmt_output(
&self,
f: &mut Formatter,
print_mode: PrintMode,
var_info: &GlobalVarInfo
) -> Result
impl Element<String>
[src]
impl Element<String>
pub fn to_element(&mut self, var_info: &mut VarInfo) -> Element
[src]
pub fn to_element(&mut self, var_info: &mut VarInfo) -> Element
Replaces string names by numerical IDs.
impl Element
[src]
impl Element
pub fn contains_dollar(&self) -> bool
[src]
pub fn contains_dollar(&self) -> bool
pub fn replace_dollar(
&mut self,
map: &HashMap<VarName, HashMap<Vec<Element>, Element>>
) -> ReplaceResult
[src]
pub fn replace_dollar(
&mut self,
map: &HashMap<VarName, HashMap<Vec<Element>, Element>>
) -> ReplaceResult
pub fn replace_elements(&mut self, map: &HashMap<VarName, Element>) -> bool
[src]
pub fn replace_elements(&mut self, map: &HashMap<VarName, Element>) -> bool
pub fn replace(&mut self, orig: &Element, new: &Element) -> bool
[src]
pub fn replace(&mut self, orig: &Element, new: &Element) -> bool
impl Element
[src]
impl Element
pub fn expand(self, var_info: &GlobalVarInfo) -> Element
[src]
pub fn expand(self, var_info: &GlobalVarInfo) -> Element
Expands products and positive powers in the element (non-iteratively).
impl Element
[src]
impl Element
pub fn apply_map<'a>(&self, m: &MatchObject<'a>) -> MatchOptOwned
[src]
pub fn apply_map<'a>(&self, m: &MatchObject<'a>) -> MatchOptOwned
impl Element
[src]
impl Element
pub fn append_factors(self, other: &Element) -> Element
[src]
pub fn append_factors(self, other: &Element) -> Element
pub fn append_factors_mut(&mut self, other: &Element)
[src]
pub fn append_factors_mut(&mut self, other: &Element)
pub fn append_factors_mut_move(&mut self, other: Element)
[src]
pub fn append_factors_mut_move(&mut self, other: Element)
pub fn pow(self, num: Element) -> Element
[src]
pub fn pow(self, num: Element) -> Element
impl Element
[src]
impl Element
pub fn apply_builtin_functions(
&mut self,
var_info: &GlobalVarInfo,
_ground_level: bool
) -> bool
[src]
pub fn apply_builtin_functions(
&mut self,
var_info: &GlobalVarInfo,
_ground_level: bool
) -> bool
Apply builtin-functions, such as delta_
and nargs_
.
This function should be called during normalization.
pub fn should_normalize(&self) -> bool
[src]
pub fn should_normalize(&self) -> bool
pub fn normalize_inplace(&mut self, var_info: &GlobalVarInfo) -> bool
[src]
pub fn normalize_inplace(&mut self, var_info: &GlobalVarInfo) -> bool
Normalize an element in-place. Returns true if element changed.
impl Element
[src]
impl Element
pub fn serialize(&self, buffer: &mut Write) -> usize
[src]
pub fn serialize(&self, buffer: &mut Write) -> usize
pub fn deserialize(buffer: &mut Read) -> Result<Element, Error>
[src]
pub fn deserialize(buffer: &mut Read) -> Result<Element, Error>
pub fn compare_serialized(
b1: &mut Cursor<&Vec<u8>>,
b2: &mut Cursor<&Vec<u8>>,
ground_level: bool
) -> Ordering
[src]
pub fn compare_serialized(
b1: &mut Cursor<&Vec<u8>>,
b2: &mut Cursor<&Vec<u8>>,
ground_level: bool
) -> Ordering
Compare normalized elements in serialized form.
pub fn compare_term_serialized(
b1: &mut Cursor<&Vec<u8>>,
b2: &mut Cursor<&Vec<u8>>
) -> Ordering
[src]
pub fn compare_term_serialized(
b1: &mut Cursor<&Vec<u8>>,
b2: &mut Cursor<&Vec<u8>>
) -> Ordering
pub fn serialize_term<W: Write + Seek>(&self, buffer: &mut W)
[src]
pub fn serialize_term<W: Write + Seek>(&self, buffer: &mut W)
Serialize any element to a term. Extra information is stored to quickly jump to the coefficient in the case serialized terms have to be merged.
pub fn add_terms_serialized(
b1: &mut Cursor<&mut Vec<u8>>,
b2: &mut Cursor<&mut Vec<u8>>
) -> bool
[src]
pub fn add_terms_serialized(
b1: &mut Cursor<&mut Vec<u8>>,
b2: &mut Cursor<&mut Vec<u8>>
) -> bool
Add two serialized terms which are identical in all but the coefficient.
The result will be written in b1
.
Returns true if the result is 0.
Trait Implementations
impl<ID: Debug + Id> Debug for Element<ID>
[src]
impl<ID: Debug + Id> Debug for Element<ID>
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<ID: Clone + Id> Clone for Element<ID>
[src]
impl<ID: Clone + Id> Clone for Element<ID>
fn clone(&self) -> Element<ID>
[src]
fn clone(&self) -> Element<ID>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl<ID: Hash + Id> Hash for Element<ID>
[src]
impl<ID: Hash + Id> Hash for Element<ID>
fn hash<__HID: Hasher>(&self, state: &mut __HID)
[src]
fn hash<__HID: Hasher>(&self, state: &mut __HID)
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl<ID: PartialEq + Id> PartialEq for Element<ID>
[src]
impl<ID: PartialEq + Id> PartialEq for Element<ID>
fn eq(&self, other: &Element<ID>) -> bool
[src]
fn eq(&self, other: &Element<ID>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Element<ID>) -> bool
[src]
fn ne(&self, other: &Element<ID>) -> bool
This method tests for !=
.
impl<ID: Eq + Id> Eq for Element<ID>
[src]
impl<ID: Eq + Id> Eq for Element<ID>
impl<ID: Id> Default for Element<ID>
[src]
impl<ID: Id> Default for Element<ID>
impl Display for Element
[src]
impl Display for Element
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl FromStr for Element<String>
[src]
impl FromStr for Element<String>