pub struct Integer {
pub value: isize,
}Fields§
§value: isizeImplementations§
Trait Implementations§
Source§impl Expr for Integer
impl Expr for Integer
fn get_ref<'a>(&'a self) -> &'a dyn Expr
fn known_expr(&self) -> KnownExpr<'_>
fn as_f64(&self) -> Option<f64>
fn is_one(&self) -> bool
fn is_neg_one(&self) -> bool
fn is_negative_number(&self) -> bool
fn is_number(&self) -> bool
fn is_zero(&self) -> bool
fn for_each_arg(&self, f: &mut dyn FnMut(&dyn Arg))
fn from_args(&self, args: Vec<Box<dyn Arg>>) -> Box<dyn Expr>
fn clone_box(&self) -> Box<dyn Expr>
fn str(&self) -> String
fn as_expr(&self) -> Option<Box<dyn Expr>>
fn args(&self) -> Vec<Box<dyn Arg>>
fn args_map_exprs( &self, _f: &dyn Fn(&dyn Expr) -> Box<dyn Arg>, ) -> Vec<Box<dyn Arg>>
fn as_arg(&self) -> Box<dyn Arg>
fn as_function(&self) -> Option<&Func>
fn equals(&self, other: &dyn Expr) -> bool
fn as_symbol(&self) -> Option<Symbol>
fn as_eq(&self) -> Option<Equation>
fn as_mul(&self) -> Option<&Mul>
fn as_pow(&self) -> Option<&Pow>
fn to_cpp(&self) -> String
fn simplify(&self) -> Box<dyn Expr>
fn simplify_with_dimension(&self, dim: usize) -> Box<dyn Expr>
fn as_int(&self) -> Option<Integer>
fn pow(&self, exponent: &Box<dyn Expr>) -> Box<dyn Expr>
fn ipow(&self, exponent: isize) -> Box<dyn Expr>
fn sqrt(&self) -> Box<dyn Expr>
fn get_exponent(&self) -> (Box<dyn Expr>, Box<dyn Expr>)
fn diff(&self, var: &str, order: usize) -> Box<dyn Expr>
fn name(&self) -> String
fn subs(&self, substitutions: &[[Box<dyn Expr>; 2]]) -> Box<dyn Expr>
fn has(&self, expr: &dyn Expr) -> bool
fn has_box(&self, expr: Box<dyn Expr>) -> bool
Source§fn factor(&self, factors: &[&dyn Expr]) -> Box<dyn Expr>
fn factor(&self, factors: &[&dyn Expr]) -> Box<dyn Expr>
Factorizes an expression
For example:
factor(ax + cx + zy, [x]) -> (a + c)x + zy
fn terms<'a>(&'a self) -> Box<dyn Iterator<Item = &'a dyn Expr> + 'a>
fn get_coeff(&self) -> (Rational, Box<dyn Expr>)
fn compare(&self, other: &dyn Expr) -> Option<Ordering>
fn evaluate(&self, vars: Option<HashMap<Symbol, BoxExpr>>) -> BoxExpr
Source§impl Ord for Integer
impl Ord for Integer
Source§impl PartialOrd for Integer
impl PartialOrd for Integer
Source§impl ToPrimitive for &Integer
impl ToPrimitive for &Integer
Source§fn to_i64(&self) -> Option<i64>
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>
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>
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>
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>
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>
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>
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 moreSource§fn to_usize(&self) -> Option<usize>
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>
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>
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>
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>
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 moreSource§impl ToPrimitive for Integer
impl ToPrimitive for Integer
Source§fn to_i64(&self) -> Option<i64>
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>
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>
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>
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>
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>
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>
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 moreSource§fn to_usize(&self) -> Option<usize>
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>
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>
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>
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>
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 moreimpl Copy for Integer
impl Eq for Integer
impl StructuralPartialEq for Integer
Auto Trait Implementations§
impl Freeze for Integer
impl RefUnwindSafe for Integer
impl Send for Integer
impl Sync for Integer
impl Unpin for Integer
impl UnwindSafe for Integer
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> ExprOperations for Twhere
T: Expr,
impl<T> ExprOperations for Twhere
T: Expr,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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