Equation

Struct Equation 

Source
pub struct Equation {
    pub lhs: Box<dyn Expr>,
    pub rhs: Box<dyn Expr>,
}

Fields§

§lhs: Box<dyn Expr>§rhs: Box<dyn Expr>

Implementations§

Source§

impl Equation

Source

pub fn into_new(lhs: &Box<dyn Expr>, rhs: &Box<dyn Expr>) -> Equation

Source

pub fn new(lhs: &dyn Expr, rhs: &dyn Expr) -> Equation

Source

pub fn new_box(lhs: Box<dyn Expr>, rhs: Box<dyn Expr>) -> Box<dyn Expr>

Source

pub fn from_str(s: &str) -> Result<Equation, Error>

Source§

impl Equation

Source

pub fn solve<'a, S: IntoIterator<Item = &'a dyn Expr>>( &self, exprs: S, ) -> Result<Equation, SolvingError>

Trait Implementations§

Source§

impl Clone for Equation

Source§

fn clone(&self) -> Equation

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 Equation

Source§

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

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

impl<'de> Deserialize<'de> for Equation

Source§

fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for Equation

Source§

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

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

impl DivAssign<&(dyn Expr + 'static)> for Equation

Source§

fn div_assign(&mut self, rhs: &dyn Expr)

Performs the /= operation. Read more
Source§

impl Expr for Equation

Source§

fn name(&self) -> String

Source§

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

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 as_f64(&self) -> Option<f64>

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 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 is_one(&self) -> bool

Source§

fn is_neg_one(&self) -> bool

Source§

fn is_number(&self) -> bool

Source§

fn is_negative_number(&self) -> bool

Source§

fn is_zero(&self) -> bool

Source§

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

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 FromStr for Equation

Source§

type Err = ParseEquationError

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 JsonSchema for Equation

Source§

fn schema_name() -> Cow<'static, str>

The name of the generated JSON Schema. Read more
Source§

fn schema_id() -> Cow<'static, str>

Returns a string that uniquely identifies the schema produced by this type. Read more
Source§

fn json_schema(_generator: &mut SchemaGenerator) -> Schema

Generates a JSON Schema for this type. Read more
Source§

fn inline_schema() -> bool

Whether JSON Schemas generated for this type should be included directly in parent schemas, rather than being re-used where possible using the $ref keyword. Read more
Source§

impl PartialEq for Equation

Source§

fn eq(&self, other: &Self) -> 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 Serialize for Equation

Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl SubAssign<&(dyn Expr + 'static)> for Equation

Source§

fn sub_assign(&mut self, rhs: &dyn Expr)

Performs the -= operation. Read more

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<T> DynClone for T
where T: Clone,

Source§

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

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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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,

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,