ComplexExpression

Struct ComplexExpression 

Source
pub struct ComplexExpression {
    pub real: Expression,
    pub imag: Expression,
}

Fields§

§real: Expression§imag: Expression

Implementations§

Source§

impl ComplexExpression

Source

pub fn from_string(input: impl AsRef<str>) -> Self

Source

pub fn from_real_64(input: f64) -> Self

Source

pub fn from_real_32(input: f32) -> Self

Source

pub fn new(cisc_expr: CiscExpression) -> Self

Source

pub fn one() -> Self

Source

pub fn zero() -> Self

Source

pub fn i() -> Self

Source

pub fn pi() -> Self

Source

pub fn is_real(&self) -> bool

Source

pub fn is_imag(&self) -> bool

Source

pub fn is_cplx(&self) -> bool

Source

pub fn is_real_fast(&self) -> bool

Source

pub fn is_imag_fast(&self) -> bool

Source

pub fn is_cplx_fast(&self) -> bool

Source

pub fn is_e(&self) -> bool

Source

pub fn is_zero(&self) -> bool

Source

pub fn is_one(&self) -> bool

Source

pub fn is_zero_fast(&self) -> bool

Source

pub fn is_one_fast(&self) -> bool

Source

pub fn eval<C: ComplexScalar>(&self, args: &HashMap<&str, C::R>) -> C

Source

pub fn map_var_names(&self, var_map: &HashMap<String, String>) -> Self

Source

pub fn conjugate(&self) -> Self

Source

pub fn conjugate_in_place(&mut self)

Source

pub fn differentiate(&self, wrt: &str) -> Self

Source

pub fn simplify(&self) -> Self

Source

pub fn get_ancestors(&self, variable: &str) -> Vec<Expression>

Source

pub fn substitute<S: AsRef<Expression>, T: AsRef<Expression>>( &self, original: S, substitution: T, ) -> Self

Source

pub fn rename_variable<S: AsRef<str>, T: AsRef<str>>( &self, original: S, new: T, ) -> Self

Source

pub fn get_unique_variables(&self) -> Vec<String>

Source

pub fn is_parameterized(&self) -> bool

Trait Implementations§

Source§

impl Add<&ComplexExpression> for &ComplexExpression

Source§

type Output = ComplexExpression

The resulting type after applying the + operator.
Source§

fn add(self, rhs: &ComplexExpression) -> ComplexExpression

Performs the + operation. Read more
Source§

impl Add<&ComplexExpression> for ComplexExpression

Source§

type Output = ComplexExpression

The resulting type after applying the + operator.
Source§

fn add(self, rhs: &ComplexExpression) -> ComplexExpression

Performs the + operation. Read more
Source§

impl Add<ComplexExpression> for &ComplexExpression

Source§

type Output = ComplexExpression

The resulting type after applying the + operator.
Source§

fn add(self, rhs: ComplexExpression) -> ComplexExpression

Performs the + operation. Read more
Source§

impl Add for ComplexExpression

Source§

type Output = ComplexExpression

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Self) -> Self

Performs the + operation. Read more
Source§

impl AddAssign<&ComplexExpression> for ComplexExpression

Source§

fn add_assign(&mut self, rhs: &Self)

Performs the += operation. Read more
Source§

impl AddAssign for ComplexExpression

Source§

fn add_assign(&mut self, rhs: Self)

Performs the += operation. Read more
Source§

impl Clone for ComplexExpression

Source§

fn clone(&self) -> ComplexExpression

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 ComplexExpression

Source§

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

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

impl Div<&ComplexExpression> for &ComplexExpression

Source§

type Output = ComplexExpression

The resulting type after applying the / operator.
Source§

fn div(self, rhs: &ComplexExpression) -> ComplexExpression

Performs the / operation. Read more
Source§

impl Div<&ComplexExpression> for ComplexExpression

Source§

type Output = ComplexExpression

The resulting type after applying the / operator.
Source§

fn div(self, rhs: &ComplexExpression) -> ComplexExpression

Performs the / operation. Read more
Source§

impl Div<ComplexExpression> for &ComplexExpression

Source§

type Output = ComplexExpression

The resulting type after applying the / operator.
Source§

fn div(self, rhs: ComplexExpression) -> ComplexExpression

Performs the / operation. Read more
Source§

impl Div for ComplexExpression

Source§

type Output = ComplexExpression

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Self) -> Self

Performs the / operation. Read more
Source§

impl DivAssign<&ComplexExpression> for ComplexExpression

Source§

fn div_assign(&mut self, rhs: &Self)

Performs the /= operation. Read more
Source§

impl DivAssign for ComplexExpression

Source§

fn div_assign(&mut self, rhs: Self)

Performs the /= operation. Read more
Source§

impl<C: ComplexScalar> From<C> for ComplexExpression

Source§

fn from(value: C) -> Self

Converts to this type from the input type.
Source§

impl Hash for ComplexExpression

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Mul<&ComplexExpression> for &ComplexExpression

Source§

type Output = ComplexExpression

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &ComplexExpression) -> ComplexExpression

Performs the * operation. Read more
Source§

impl Mul<&ComplexExpression> for ComplexExpression

Source§

type Output = ComplexExpression

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &ComplexExpression) -> ComplexExpression

Performs the * operation. Read more
Source§

impl Mul<ComplexExpression> for &ComplexExpression

Source§

type Output = ComplexExpression

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: ComplexExpression) -> ComplexExpression

Performs the * operation. Read more
Source§

impl Mul for ComplexExpression

Source§

type Output = ComplexExpression

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Self) -> Self

Performs the * operation. Read more
Source§

impl MulAssign<&ComplexExpression> for ComplexExpression

Source§

fn mul_assign(&mut self, rhs: &Self)

Performs the *= operation. Read more
Source§

impl MulAssign for ComplexExpression

Source§

fn mul_assign(&mut self, rhs: Self)

Performs the *= operation. Read more
Source§

impl Neg for &ComplexExpression

Source§

type Output = ComplexExpression

The resulting type after applying the - operator.
Source§

fn neg(self) -> ComplexExpression

Performs the unary - operation. Read more
Source§

impl Neg for ComplexExpression

Source§

type Output = ComplexExpression

The resulting type after applying the - operator.
Source§

fn neg(self) -> Self

Performs the unary - operation. Read more
Source§

impl PartialEq for ComplexExpression

Source§

fn eq(&self, other: &ComplexExpression) -> 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 Sub<&ComplexExpression> for &ComplexExpression

Source§

type Output = ComplexExpression

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: &ComplexExpression) -> ComplexExpression

Performs the - operation. Read more
Source§

impl Sub<&ComplexExpression> for ComplexExpression

Source§

type Output = ComplexExpression

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: &ComplexExpression) -> ComplexExpression

Performs the - operation. Read more
Source§

impl Sub<ComplexExpression> for &ComplexExpression

Source§

type Output = ComplexExpression

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: ComplexExpression) -> ComplexExpression

Performs the - operation. Read more
Source§

impl Sub for ComplexExpression

Source§

type Output = ComplexExpression

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Self) -> Self

Performs the - operation. Read more
Source§

impl SubAssign<&ComplexExpression> for ComplexExpression

Source§

fn sub_assign(&mut self, rhs: &Self)

Performs the -= operation. Read more
Source§

impl SubAssign for ComplexExpression

Source§

fn sub_assign(&mut self, rhs: Self)

Performs the -= operation. Read more
Source§

impl Eq for ComplexExpression

Source§

impl StructuralPartialEq for ComplexExpression

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<Rhs, Lhs, Output> AddByRef<Rhs> for Lhs
where &'a Lhs: for<'a> Add<&'a Rhs, Output = Output>,

Source§

type Output = Output

Source§

fn add_by_ref(&self, rhs: &Rhs) -> <Lhs as AddByRef<Rhs>>::Output

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> 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> ByRef<T> for T

Source§

fn by_ref(&self) -> &T

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> DistributionExt for T
where T: ?Sized,

Source§

fn rand<T>(&self, rng: &mut (impl Rng + ?Sized)) -> T
where Self: Distribution<T>,

Source§

impl<Rhs, Lhs, Output> DivByRef<Rhs> for Lhs
where &'a Lhs: for<'a> Div<&'a Rhs, Output = Output>,

Source§

type Output = Output

Source§

fn div_by_ref(&self, rhs: &Rhs) -> <Lhs as DivByRef<Rhs>>::Output

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
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<Rhs, Lhs, Output> MulByRef<Rhs> for Lhs
where &'a Lhs: for<'a> Mul<&'a Rhs, Output = Output>,

Source§

type Output = Output

Source§

fn mul_by_ref(&self, rhs: &Rhs) -> <Lhs as MulByRef<Rhs>>::Output

Source§

impl<T, Output> NegByRef for T
where &'a T: for<'a> Neg<Output = Output>,

Source§

type Output = Output

Source§

fn neg_by_ref(&self) -> <T as NegByRef>::Output

Source§

impl<Rhs, Lhs, Output> SubByRef<Rhs> for Lhs
where &'a Lhs: for<'a> Sub<&'a Rhs, Output = Output>,

Source§

type Output = Output

Source§

fn sub_by_ref(&self, rhs: &Rhs) -> <Lhs as SubByRef<Rhs>>::Output

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, 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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V