Integer

Struct Integer 

Source
pub struct Integer {
    pub value: isize,
}

Fields§

§value: isize

Implementations§

Source§

impl Integer

Source

pub fn new_box(value: isize) -> Box<dyn Expr>

Source

pub fn new(value: isize) -> Self

Source

pub fn zero() -> Integer

Source

pub fn one_box() -> Box<dyn Expr>

Source

pub fn zero_box() -> Box<dyn Expr>

Trait Implementations§

Source§

impl Add<&Integer> for &Rational

Source§

type Output = Box<dyn Expr>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: &Integer) -> Self::Output

Performs the + operation. Read more
Source§

impl Add<&Rational> for &Integer

Source§

type Output = Box<dyn Expr>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: &Rational) -> Self::Output

Performs the + operation. Read more
Source§

impl Clone for Integer

Source§

fn clone(&self) -> Integer

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Integer

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Expr for Integer

Source§

fn get_ref<'a>(&'a self) -> &'a dyn Expr

Source§

fn known_expr(&self) -> KnownExpr<'_>

Source§

fn as_f64(&self) -> Option<f64>

Source§

fn is_one(&self) -> bool

Source§

fn is_neg_one(&self) -> bool

Source§

fn is_negative_number(&self) -> bool

Source§

fn is_number(&self) -> bool

Source§

fn is_zero(&self) -> bool

Source§

fn for_each_arg(&self, f: &mut dyn FnMut(&dyn Arg))

Source§

fn from_args(&self, args: Vec<Box<dyn Arg>>) -> Box<dyn Expr>

Source§

fn clone_box(&self) -> Box<dyn Expr>

Source§

fn str(&self) -> String

Source§

fn as_expr(&self) -> Option<Box<dyn Expr>>

Source§

fn args(&self) -> Vec<Box<dyn Arg>>

Source§

fn args_map_exprs( &self, _f: &dyn Fn(&dyn Expr) -> Box<dyn Arg>, ) -> Vec<Box<dyn Arg>>

Source§

fn as_arg(&self) -> Box<dyn Arg>

Source§

fn as_function(&self) -> Option<&Func>

Source§

fn equals(&self, other: &dyn Expr) -> bool

Source§

fn as_symbol(&self) -> Option<Symbol>

Source§

fn as_eq(&self) -> Option<Equation>

Source§

fn as_mul(&self) -> Option<&Mul>

Source§

fn as_pow(&self) -> Option<&Pow>

Source§

fn to_cpp(&self) -> String

Source§

fn simplify(&self) -> Box<dyn Expr>

Source§

fn simplify_with_dimension(&self, dim: usize) -> Box<dyn Expr>

Source§

fn as_int(&self) -> Option<Integer>

Source§

fn pow(&self, exponent: &Box<dyn Expr>) -> Box<dyn Expr>

Source§

fn ipow(&self, exponent: isize) -> Box<dyn Expr>

Source§

fn sqrt(&self) -> Box<dyn Expr>

Source§

fn get_exponent(&self) -> (Box<dyn Expr>, Box<dyn Expr>)

Source§

fn diff(&self, var: &str, order: usize) -> Box<dyn Expr>

Source§

fn name(&self) -> String

Source§

fn subs(&self, substitutions: &[[Box<dyn Expr>; 2]]) -> Box<dyn Expr>

Source§

fn has(&self, expr: &dyn Expr) -> bool

Source§

fn has_box(&self, expr: Box<dyn Expr>) -> bool

Source§

fn expand(&self) -> Box<dyn Expr>

Expands an expression. For example: (x + y) * z -> xz + yz
Source§

fn factor(&self, factors: &[&dyn Expr]) -> Box<dyn Expr>

Factorizes an expression For example: factor(ax + cx + zy, [x]) -> (a + c)x + zy
Source§

fn terms<'a>(&'a self) -> Box<dyn Iterator<Item = &'a dyn Expr> + 'a>

Source§

fn get_coeff(&self) -> (Rational, Box<dyn Expr>)

Source§

fn compare(&self, other: &dyn Expr) -> Option<Ordering>

Source§

fn evaluate(&self, vars: Option<HashMap<Symbol, BoxExpr>>) -> BoxExpr

Source§

impl From<&Integer> for (Rational, Box<dyn Expr>)

Source§

fn from(i: &Integer) -> Self

Converts to this type from the input type.
Source§

impl FromStr for Integer

Source§

type Err = ParseIntegerError

The associated error which can be returned from parsing.
Source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
Source§

impl Mul<&Box<dyn Expr>> for &Integer

Source§

type Output = Box<dyn Expr>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &Box<dyn Expr>) -> Self::Output

Performs the * operation. Read more
Source§

impl<E: Expr> Mul<&E> for &Integer

Source§

type Output = Box<dyn Expr>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &E) -> Self::Output

Performs the * operation. Read more
Source§

impl Neg for &Integer

Source§

type Output = Integer

The resulting type after applying the - operator.
Source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
Source§

impl Neg for Integer

Source§

type Output = Integer

The resulting type after applying the - operator.
Source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
Source§

impl Ord for Integer

Source§

fn cmp(&self, other: &Integer) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq for Integer

Source§

fn eq(&self, other: &Integer) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for Integer

Source§

fn partial_cmp(&self, other: &Integer) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl ToInteger for &Integer

Source§

impl ToInteger for Integer

Source§

impl ToPrimitive for &Integer

Source§

fn to_i64(&self) -> Option<i64>

Converts the value of self to an i64. If the value cannot be represented by an i64, then None is returned.
Source§

fn to_u64(&self) -> Option<u64>

Converts the value of self to a u64. If the value cannot be represented by a u64, then None is returned.
Source§

fn to_isize(&self) -> Option<isize>

Converts the value of self to an isize. If the value cannot be represented by an isize, then None is returned.
Source§

fn to_i8(&self) -> Option<i8>

Converts the value of self to an i8. If the value cannot be represented by an i8, then None is returned.
Source§

fn to_i16(&self) -> Option<i16>

Converts the value of self to an i16. If the value cannot be represented by an i16, then None is returned.
Source§

fn to_i32(&self) -> Option<i32>

Converts the value of self to an i32. If the value cannot be represented by an i32, then None is returned.
Source§

fn to_i128(&self) -> Option<i128>

Converts the value of self to an i128. If the value cannot be represented by an i128 (i64 under the default implementation), then None is returned. Read more
Source§

fn to_usize(&self) -> Option<usize>

Converts the value of self to a usize. If the value cannot be represented by a usize, then None is returned.
Source§

fn to_u8(&self) -> Option<u8>

Converts the value of self to a u8. If the value cannot be represented by a u8, then None is returned.
Source§

fn to_u16(&self) -> Option<u16>

Converts the value of self to a u16. If the value cannot be represented by a u16, then None is returned.
Source§

fn to_u32(&self) -> Option<u32>

Converts the value of self to a u32. If the value cannot be represented by a u32, then None is returned.
Source§

fn to_u128(&self) -> Option<u128>

Converts the value of self to a u128. If the value cannot be represented by a u128 (u64 under the default implementation), then None is returned. Read more
Source§

fn to_f32(&self) -> Option<f32>

Converts the value of self to an f32. Overflows may map to positive or negative inifinity, otherwise None is returned if the value cannot be represented by an f32.
Source§

fn to_f64(&self) -> Option<f64>

Converts the value of self to an f64. Overflows may map to positive or negative inifinity, otherwise None is returned if the value cannot be represented by an f64. Read more
Source§

impl ToPrimitive for Integer

Source§

fn to_i64(&self) -> Option<i64>

Converts the value of self to an i64. If the value cannot be represented by an i64, then None is returned.
Source§

fn to_u64(&self) -> Option<u64>

Converts the value of self to a u64. If the value cannot be represented by a u64, then None is returned.
Source§

fn to_isize(&self) -> Option<isize>

Converts the value of self to an isize. If the value cannot be represented by an isize, then None is returned.
Source§

fn to_i8(&self) -> Option<i8>

Converts the value of self to an i8. If the value cannot be represented by an i8, then None is returned.
Source§

fn to_i16(&self) -> Option<i16>

Converts the value of self to an i16. If the value cannot be represented by an i16, then None is returned.
Source§

fn to_i32(&self) -> Option<i32>

Converts the value of self to an i32. If the value cannot be represented by an i32, then None is returned.
Source§

fn to_i128(&self) -> Option<i128>

Converts the value of self to an i128. If the value cannot be represented by an i128 (i64 under the default implementation), then None is returned. Read more
Source§

fn to_usize(&self) -> Option<usize>

Converts the value of self to a usize. If the value cannot be represented by a usize, then None is returned.
Source§

fn to_u8(&self) -> Option<u8>

Converts the value of self to a u8. If the value cannot be represented by a u8, then None is returned.
Source§

fn to_u16(&self) -> Option<u16>

Converts the value of self to a u16. If the value cannot be represented by a u16, then None is returned.
Source§

fn to_u32(&self) -> Option<u32>

Converts the value of self to a u32. If the value cannot be represented by a u32, then None is returned.
Source§

fn to_u128(&self) -> Option<u128>

Converts the value of self to a u128. If the value cannot be represented by a u128 (u64 under the default implementation), then None is returned. Read more
Source§

fn to_f32(&self) -> Option<f32>

Converts the value of self to an f32. Overflows may map to positive or negative inifinity, otherwise None is returned if the value cannot be represented by an f32.
Source§

fn to_f64(&self) -> Option<f64>

Converts the value of self to an f64. Overflows may map to positive or negative inifinity, otherwise None is returned if the value cannot be represented by an f64. Read more
Source§

impl Copy for Integer

Source§

impl Eq for Integer

Source§

impl StructuralPartialEq for Integer

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Arg for T
where T: Expr,

Source§

fn srepr(&self) -> String

Source§

fn clone_arg(&self) -> Box<dyn Arg>

Source§

fn as_expr(&self) -> Option<Box<dyn Expr>>

Source§

fn map_expr(&self, f: &dyn Fn(&dyn Expr) -> Box<dyn Expr>) -> Box<dyn Arg>

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Comparable<K> for Q
where Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> ExprOperations for T
where T: Expr,

Source§

fn subs_refs<'a, Iter: IntoIterator<Item = [&'a dyn Expr; 2]>>( &self, substitutions: Iter, ) -> Box<dyn Expr>
where Self: Expr,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<A> ArgOperations for A
where A: Arg,