Skip to main content

ContractWith

Trait ContractWith 

Source
pub trait ContractWith<Rhs> {
    type Output;

    // Required method
    fn contract_with(&self, rhs: &Rhs) -> Self::Output;
}
Expand description

The full contraction of two tensors whose units need not agree.

Tensor::full_contraction contracts a tensor with another of its own type and gives a number. Contracting tensors of different units gives a quantity whose unit is the product of theirs — a stress with a rate is a power density — which is what erased views used to stand in for.

Required Associated Types§

Source

type Output

The quantity the contraction gives.

Required Methods§

Source

fn contract_with(&self, rhs: &Rhs) -> Self::Output

Returns the full contraction with the other tensor.

Implementors§

Source§

impl<T, V> ContractWith<TensorVector<V>> for TensorVector<T>
where T: ContractWith<V> + Tensor, V: Tensor, <T as ContractWith<V>>::Output: Sum,

Source§

impl<T, V, const N: usize> ContractWith<TensorList<V, N>> for TensorList<T, N>
where T: ContractWith<V> + Tensor, V: Tensor, <T as ContractWith<V>>::Output: Sum,

Source§

impl<const D: usize, I, J, U, V> ContractWith<TensorRank2<D, I, J, V>> for TensorRank2<D, I, J, U>
where U: UnitMul<V>,

Source§

impl<const D: usize, I, U, V> ContractWith<TensorRank1<D, I, V>> for TensorRank1<D, I, U>
where U: UnitMul<V>,