pub struct ScalarMatrixProductGeneral {
rhs_permutation: Permutation,
scalar_matrix_product: ScalarMatrixProduct,
}Expand description
Permutes the axes of the RHS tensor to the output order and multiply all elements by the single scalar in the 0-d LHS tensor.
This contraction can arise when the simplification of the LHS tensor results in all the
axes being summed before the two tensors are contracted. For example, in the contraction
i,jk->kj, the output matrix is equal to the RHS matrix, transposed and then scalar-multiplied
by the sum of the elements of the LHS tensor.
Fields§
§rhs_permutation: Permutation§scalar_matrix_product: ScalarMatrixProductImplementations§
Source§impl ScalarMatrixProductGeneral
impl ScalarMatrixProductGeneral
pub fn new(sc: &SizedContraction) -> Self
pub fn from_indices(input_indices: &[char], output_indices: &[char]) -> Self
Trait Implementations§
Source§impl Clone for ScalarMatrixProductGeneral
impl Clone for ScalarMatrixProductGeneral
Source§fn clone(&self) -> ScalarMatrixProductGeneral
fn clone(&self) -> ScalarMatrixProductGeneral
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ScalarMatrixProductGeneral
impl Debug for ScalarMatrixProductGeneral
Source§impl<A> PairContractor<A> for ScalarMatrixProductGeneral
impl<A> PairContractor<A> for ScalarMatrixProductGeneral
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,
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,
Auto Trait Implementations§
impl Freeze for ScalarMatrixProductGeneral
impl RefUnwindSafe for ScalarMatrixProductGeneral
impl Send for ScalarMatrixProductGeneral
impl Sync for ScalarMatrixProductGeneral
impl Unpin for ScalarMatrixProductGeneral
impl UnwindSafe for ScalarMatrixProductGeneral
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more