PairContractor

Trait PairContractor 

Source
pub trait PairContractor<A>: Debug {
    // Required method
    fn contract_pair<'a, 'b, 'c, 'd>(
        &self,
        lhs: &'b ArrayViewD<'a, A>,
        rhs: &'d ArrayViewD<'c, A>,
    ) -> ArrayD<A>
       where A: Clone + LinalgScalar,
             'a: 'b,
             'c: 'd;

    // Provided method
    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: Clone + LinalgScalar,
             'a: 'b,
             'c: 'd,
             'e: 'f { ... }
}
Expand description

let new_array = obj.contract_pair(lhs_view, rhs_view);

All pair contractions should implement this trait. It returns a new owned ArrayD. The trait also has a method with a default implementation, obj.contract_and_assign_pair(lhs_view: &ArrayViewD, rhs_view: &ArrayViewD, out: &mut ArrayViewD) -> ().

Required Methods§

Source

fn contract_pair<'a, 'b, 'c, 'd>( &self, lhs: &'b ArrayViewD<'a, A>, rhs: &'d ArrayViewD<'c, A>, ) -> ArrayD<A>
where A: Clone + LinalgScalar, 'a: 'b, 'c: 'd,

Provided Methods§

Source

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: Clone + LinalgScalar, 'a: 'b, 'c: 'd, 'e: 'f,

Implementors§