pub struct BasicDerivatives;Expand description
Basic derivative operations
Implementations§
Source§impl BasicDerivatives
impl BasicDerivatives
Sourcepub fn handle_calculus(
expr: &Expression,
data: &CalculusData,
variable: Symbol,
) -> Expression
pub fn handle_calculus( expr: &Expression, data: &CalculusData, variable: Symbol, ) -> Expression
Handle derivative of calculus expressions
§Examples
use mathhook_core::{Expression, symbol};
use mathhook_core::calculus::derivatives::Derivative;
let x = symbol!(x);
let expr = Expression::derivative(Expression::symbol(x.clone()), x.clone(), 1);
let second = expr.derivative(x);Sourcepub fn handle_symbol(sym: &Symbol, variable: &Symbol) -> Expression
pub fn handle_symbol(sym: &Symbol, variable: &Symbol) -> Expression
Handle derivative of symbol expressions
§Examples
use mathhook_core::{Expression, symbol};
use mathhook_core::calculus::derivatives::Derivative;
let x = symbol!(x);
let y = symbol!(y);
let expr = Expression::symbol(x.clone());
let dx = expr.derivative(x);
let dy = expr.derivative(y);Sourcepub fn handle_sum(terms: &[Expression], variable: &Symbol) -> Expression
pub fn handle_sum(terms: &[Expression], variable: &Symbol) -> Expression
Handle derivative of sum expressions using linearity
§Examples
use mathhook_core::{Expression};
use mathhook_core::symbol;
use mathhook_core::calculus::derivatives::Derivative;
let x = symbol!(x);
let expr = Expression::add(vec![
Expression::symbol(x.clone()),
Expression::integer(5)
]);
let result = expr.derivative(x);Auto Trait Implementations§
impl Freeze for BasicDerivatives
impl RefUnwindSafe for BasicDerivatives
impl Send for BasicDerivatives
impl Sync for BasicDerivatives
impl Unpin for BasicDerivatives
impl UnsafeUnpin for BasicDerivatives
impl UnwindSafe for BasicDerivatives
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