pub struct PartialUtils;Expand description
Utility functions for partial derivatives
Implementations§
Source§impl PartialUtils
impl PartialUtils
Sourcepub fn expressions_equal(expr1: &Expression, expr2: &Expression) -> bool
pub fn expressions_equal(expr1: &Expression, expr2: &Expression) -> bool
Fast expression equality check with caching
§Examples
use mathhook_core::simplify::Simplify;
use mathhook_core::calculus::derivatives::PartialUtils;
use mathhook_core::calculus::derivatives::MatrixUtils;
use mathhook_core::{Expression};
use mathhook_core::symbol;
let x = symbol!(x);
let expr1 = Expression::symbol(x.clone());
let expr2 = Expression::symbol(x.clone());
let equal = PartialUtils::expressions_equal(&expr1, &expr2);Sourcepub fn is_zero(expr: &Expression) -> bool
pub fn is_zero(expr: &Expression) -> bool
Fast zero check with pattern matching
§Examples
use mathhook_core::calculus::derivatives::PartialUtils;
use mathhook_core::Expression;
let zero = Expression::integer(0);
let is_zero = PartialUtils::is_zero(&zero);Auto Trait Implementations§
impl Freeze for PartialUtils
impl RefUnwindSafe for PartialUtils
impl Send for PartialUtils
impl Sync for PartialUtils
impl Unpin for PartialUtils
impl UnwindSafe for PartialUtils
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> 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