Struct exmex::OwnedFlatEx[][src]

pub struct OwnedFlatEx<T, OF = FloatOpsFactory<T>> where
    T: Clone + Debug,
    OF: MakeOperators<T>, 
{ /* fields omitted */ }
Expand description

This is another representation of a flattened expression besides FlatEx. The difference is that OwnedFlatEx can be used without a lifetime parameter. All the data that FlatEx borrowed is kept in a buffer by OwnedFlatEx. The drawback is that parsing takes longer, since additional allocations are necessary. Evaluation time should be about the same for FlatEx and OwnedFlatEx.

use exmex::{Express, OwnedFlatEx};
let to_be_parsed = "log(z) + 2* (-z^(x-2) + sin(4*y))";
let expr_owned = OwnedFlatEx::<f64>::from_str(to_be_parsed)?;
assert!((expr_owned.eval(&[4.0, 3.7, 2.5])? - 14.992794866624788 as f64).abs() < 1e-12);

Implementations

Creates an OwnedFlatEx instance from an instance of FlatEx.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

The expression is displayed as a string created by unparse.

Formats the value using the given formatter. Read more

Parses a string into an expression that can be evaluated. Read more

Use custom number literals defined as regex to create an expression that can be evaluated. Read more

Use custom number literals defined as regex patterns to create an expression that can be evaluated. Read more

Evaluates an expression with the given variable values and returns the computed result. Read more

This method computes a new instance that is a partial derivative of self with default operators. Read more

Creates an expression string that corresponds to the FlatEx instance. Read more

This function frees some memory. After calling partial memory might be re-allocated. Read more

Returns the number of variables of the expression

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

Restrict a value to a certain interval. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

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

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

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

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.