pub trait Dot<Rhs: ?Sized> {
type Output;
// Required method
fn dot(&self, rhs: &Rhs) -> Self::Output;
}Expand description
Matrix Multiplication
For two-dimensional arrays, the dot method computes the matrix multiplication.
Required Associated Types§
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
Source§impl<A, S> Dot<ArrayBase<S, Dim<[usize; 1]>>> for ArrayRef<A, Ix1>where
S: Data<Elem = A>,
A: LinalgScalar,
impl<A, S> Dot<ArrayBase<S, Dim<[usize; 1]>>> for ArrayRef<A, Ix1>where
S: Data<Elem = A>,
A: LinalgScalar,
Source§impl<A, S> Dot<ArrayBase<S, Dim<[usize; 1]>>> for ArrayRef<A, Ix2>where
S: Data<Elem = A>,
A: LinalgScalar,
impl<A, S> Dot<ArrayBase<S, Dim<[usize; 1]>>> for ArrayRef<A, Ix2>where
S: Data<Elem = A>,
A: LinalgScalar,
Source§impl<A, S> Dot<ArrayBase<S, Dim<[usize; 2]>>> for ArrayRef<A, Ix1>where
S: Data<Elem = A>,
A: LinalgScalar,
impl<A, S> Dot<ArrayBase<S, Dim<[usize; 2]>>> for ArrayRef<A, Ix1>where
S: Data<Elem = A>,
A: LinalgScalar,
Source§impl<A, S> Dot<ArrayBase<S, Dim<[usize; 2]>>> for ArrayRef<A, Ix2>where
S: Data<Elem = A>,
A: LinalgScalar,
impl<A, S> Dot<ArrayBase<S, Dim<[usize; 2]>>> for ArrayRef<A, Ix2>where
S: Data<Elem = A>,
A: LinalgScalar,
Source§impl<A, S> Dot<ArrayRef<A, Dim<[usize; 1]>>> for ArrayBase<S, Ix1>where
S: Data<Elem = A>,
A: LinalgScalar,
impl<A, S> Dot<ArrayRef<A, Dim<[usize; 1]>>> for ArrayBase<S, Ix1>where
S: Data<Elem = A>,
A: LinalgScalar,
Source§impl<A, S> Dot<ArrayRef<A, Dim<[usize; 1]>>> for ArrayBase<S, Ix2>where
S: Data<Elem = A>,
A: LinalgScalar,
impl<A, S> Dot<ArrayRef<A, Dim<[usize; 1]>>> for ArrayBase<S, Ix2>where
S: Data<Elem = A>,
A: LinalgScalar,
Source§impl<A, S> Dot<ArrayRef<A, Dim<[usize; 2]>>> for ArrayBase<S, Ix1>where
S: Data<Elem = A>,
A: LinalgScalar,
impl<A, S> Dot<ArrayRef<A, Dim<[usize; 2]>>> for ArrayBase<S, Ix1>where
S: Data<Elem = A>,
A: LinalgScalar,
Source§impl<A, S> Dot<ArrayRef<A, Dim<[usize; 2]>>> for ArrayBase<S, Ix2>where
S: Data<Elem = A>,
A: LinalgScalar,
impl<A, S> Dot<ArrayRef<A, Dim<[usize; 2]>>> for ArrayBase<S, Ix2>where
S: Data<Elem = A>,
A: LinalgScalar,
Source§impl<A> Dot<ArrayRef<A, Dim<IxDynImpl>>> for ArrayRef<A, IxDyn>where
A: LinalgScalar,
Dot product for dynamic-dimensional arrays (ArrayD).
impl<A> Dot<ArrayRef<A, Dim<IxDynImpl>>> for ArrayRef<A, IxDyn>where
A: LinalgScalar,
Dot product for dynamic-dimensional arrays (ArrayD).
For one-dimensional arrays, computes the vector dot product, which is the sum of the elementwise products (no conjugation of complex operands). Both arrays must have the same length.
For two-dimensional arrays, performs matrix multiplication. The array shapes must be compatible in the following ways:
- If
selfis M × N, thenrhsmust be N × K for matrix-matrix multiplication - If
selfis M × N andrhsis N, returns a vector of length M - If
selfis M andrhsis M × N, returns a vector of length N - If both arrays are one-dimensional of length N, returns a scalar
Panics if:
- The arrays have dimensions other than 1 or 2
- The array shapes are incompatible for the operation
- For vector dot product: the vectors have different lengths
Source§impl<A> Dot<ArrayRef<A, Dim<[usize; 1]>>> for ArrayRef<A, Ix2>where
A: LinalgScalar,
Perform the matrix multiplication of the rectangular array self and
column vector rhs.
impl<A> Dot<ArrayRef<A, Dim<[usize; 1]>>> for ArrayRef<A, Ix2>where
A: LinalgScalar,
Perform the matrix multiplication of the rectangular array self and
column vector rhs.
The array shapes must agree in the way that
if self is M × N, then rhs is N.
Return a result array with shape M.
Panics if shapes are incompatible.