[][src]Struct ndarray_einsum_beta::contractors::PairContraction

pub struct PairContraction<A> {
    lhs_simplification: Option<SimplificationMethodAndOutput<A>>,
    rhs_simplification: Option<SimplificationMethodAndOutput<A>>,
    method: PairMethod,
    op: Box<dyn PairContractor<A>>,
    simplified_einsum_string: String,
}

Holds a Boxed PairContractor trait object and two Option<Box>ed simplifications for the LHS and RHS tensors.

For example, the contraction ijk,kj->jk will currently be performed as follows:

  1. Simplify the LHS with the contraction ijk->jk
  2. Don't simplify the RHS
  3. Use HadamardProductGeneral to compute jk,kj->jk

A second example is the contraction iij,jkk->ik:

  1. Simplify the LHS with the contraction iij->ij
  2. Simplify the RHS with the contraction jkk->jk
  3. Use TensordotGeneral to compute ij,jk->ik

Since the axis lengths aren't known until runtime, and the actual einsum string may not be either, it is generally not possible to know at compile time which specific PairContractor will be used to perform a given contraction, or even which contractions will be performed; the optimizer could choose a different order.

Fields

lhs_simplification: Option<SimplificationMethodAndOutput<A>>rhs_simplification: Option<SimplificationMethodAndOutput<A>>method: PairMethodop: Box<dyn PairContractor<A>>simplified_einsum_string: String

Methods

impl<A> PairContraction<A>[src]

pub fn new(sc: &SizedContraction) -> Self[src]

Trait Implementations

impl<A> PairContractor<A> for PairContraction<A>[src]

fn contract_and_assign_pair<'a, 'b, 'c, 'd, 'e, 'f>(
    &self,
    lhs: &'b ArrayViewD<'a, A>,
    rhs: &'d ArrayViewD<'c, A>,
    out: &'f mut ArrayViewMutD<'e, A>
) where
    'a: 'b,
    'c: 'd,
    'e: 'f,
    A: Clone + LinalgScalar
[src]

impl<A> Debug for PairContraction<A>[src]

Auto Trait Implementations

impl<A> !Send for PairContraction<A>

impl<A> !Sync for PairContraction<A>

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]