ComposedOperator

Struct ComposedOperator 

Source
pub struct ComposedOperator<Input, Output> { /* private fields */ }
Expand description

A composition of one or more Operators.

Operator composition can be done using multiplication syntax:

let op: ComposedOperator<_, _> = mesh.star() * mesh.d::<1, Primal>();

A free function compose is also provided for the same purpose.

A single operator (ExteriorDerivative or HodgeStar) can also be converted into a ComposedOperator without actually composing it with anything using the std From trait. This enables writing all your operator types as ComposedOperator<Input, Output>, a convenient pattern which can be written more concisely with the type alias Op. See the crate-level docs and examples for details.

Implementations§

Source§

impl<Input, Output> ComposedOperator<Input, Output>
where Input: Operand, Output: Operand,

Source

pub fn exclude_subset( self, set: &SubsetImpl<<Output as Operand>::Dimension, <Output as Operand>::Primality>, ) -> Self

Set a subset of elements in the output cochain to zero when this operator is applied (i.e. set a subset of rows in the operator matrix to zero). useful for boundary conditions.

Trait Implementations§

Source§

impl<Input: Clone, Output: Clone> Clone for ComposedOperator<Input, Output>

Source§

fn clone(&self) -> ComposedOperator<Input, Output>

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<Input: Debug, Output: Debug> Debug for ComposedOperator<Input, Output>

Source§

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

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

impl<Input, Output> From<CsrMatrix<f64>> for ComposedOperator<Input, Output>

Source§

fn from(mat: CsrMatrix<f64>) -> Self

Converts to this type from the input type.
Source§

impl<const D: usize, P> From<ExteriorDerivative<D, P>> for ComposedOperator<<ExteriorDerivative<D, P> as Operator>::Input, <ExteriorDerivative<D, P> as Operator>::Output>
where Const<D>: DimNameAdd<U1>,

Source§

fn from(d: ExteriorDerivative<D, P>) -> Self

Converts to this type from the input type.
Source§

impl<const D: usize, const MD: usize, P> From<HodgeStar<D, MD, P>> for ComposedOperator<<HodgeStar<D, MD, P> as Operator>::Input, <HodgeStar<D, MD, P> as Operator>::Output>
where Const<MD>: DimNameSub<Const<D>>, P: MeshPrimality,

Source§

fn from(s: HodgeStar<D, MD, P>) -> Self

Converts to this type from the input type.
Source§

impl<O, D, P> Mul<&CochainImpl<D, P>> for &ComposedOperator<CochainImpl<D, P>, O>
where O: Operand,

Source§

type Output = O

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &CochainImpl<D, P>) -> Self::Output

Performs the * operation. Read more
Source§

impl<O, D, P> Mul<&CochainImpl<D, P>> for ComposedOperator<CochainImpl<D, P>, O>
where O: Operand,

Source§

type Output = <ComposedOperator<CochainImpl<D, P>, O> as Operator>::Output

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &CochainImpl<D, P>) -> Self::Output

Performs the * operation. Read more
Source§

impl<L, R> Mul<ComposedOperator<L, R>> for f64

Source§

type Output = ComposedOperator<L, R>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: ComposedOperator<L, R>) -> Self::Output

Performs the * operation. Read more
Source§

impl<I, O, Op> Mul<Op> for ComposedOperator<I, O>
where I: Operand, O: Operand, Op: Operator<Output = <Self as Operator>::Input>,

Source§

type Output = ComposedOperator<<Op as Operator>::Input, <ComposedOperator<I, O> as Operator>::Output>

The resulting type after applying the * operator.
Source§

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

Performs the * operation. Read more
Source§

impl<Input, Output> Operator for ComposedOperator<Input, Output>
where Input: Operand, Output: Operand,

Source§

type Input = Input

The type of cochain this operator takes as an input.
Source§

type Output = Output

The type of cochain this operator produces as an output.
Source§

fn apply(&self, input: &Self::Input) -> Self::Output

Apply this operator to an input cochain.
Source§

fn into_csr(self) -> CsrMatrix<f64>

Convert this operator into a CSR matrix.
Source§

impl<L, R> PartialEq for ComposedOperator<L, R>

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.

Auto Trait Implementations§

§

impl<Input, Output> Freeze for ComposedOperator<Input, Output>

§

impl<Input, Output> RefUnwindSafe for ComposedOperator<Input, Output>
where Input: RefUnwindSafe, Output: RefUnwindSafe,

§

impl<Input, Output> Send for ComposedOperator<Input, Output>
where Input: Send, Output: Send,

§

impl<Input, Output> Sync for ComposedOperator<Input, Output>
where Input: Sync, Output: Sync,

§

impl<Input, Output> Unpin for ComposedOperator<Input, Output>
where Input: Unpin, Output: Unpin,

§

impl<Input, Output> UnwindSafe for ComposedOperator<Input, Output>
where Input: UnwindSafe, Output: UnwindSafe,

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

Source§

type Output = T

Should always be Self
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
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<T> Scalar for T
where T: 'static + Clone + PartialEq + Debug,