Skip to main content

Dot

Trait Dot 

Source
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§

Source

type Output

The result of the operation.

For two-dimensional arrays: a rectangular array.

Required Methods§

Source

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

Compute the dot product of two arrays.

Panics if the arrays’ shapes are not compatible.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<A, S, S2> Dot<ArrayBase<S2, Dim<[usize; 1]>>> for ArrayBase<S, Ix1>
where S: Data<Elem = A>, S2: Data<Elem = A>, A: LinalgScalar,

Source§

type Output = <ArrayRef<A, Dim<[usize; 1]>> as Dot<ArrayRef<A, Dim<[usize; 1]>>>>::Output

Source§

impl<A, S, S2> Dot<ArrayBase<S2, Dim<[usize; 1]>>> for ArrayBase<S, Ix2>
where S: Data<Elem = A>, S2: Data<Elem = A>, A: LinalgScalar,

Source§

type Output = <ArrayRef<A, Dim<[usize; 2]>> as Dot<ArrayRef<A, Dim<[usize; 1]>>>>::Output

Source§

impl<A, S, S2> Dot<ArrayBase<S2, Dim<[usize; 2]>>> for ArrayBase<S, Ix1>
where S: Data<Elem = A>, S2: Data<Elem = A>, A: LinalgScalar,

Source§

type Output = <ArrayRef<A, Dim<[usize; 1]>> as Dot<ArrayRef<A, Dim<[usize; 2]>>>>::Output

Source§

impl<A, S, S2> Dot<ArrayBase<S2, Dim<[usize; 2]>>> for ArrayBase<S, Ix2>
where S: Data<Elem = A>, S2: Data<Elem = A>, A: LinalgScalar,

Source§

type Output = <ArrayRef<A, Dim<[usize; 2]>> as Dot<ArrayRef<A, Dim<[usize; 2]>>>>::Output

Source§

impl<A, S> Dot<ArrayBase<S, Dim<[usize; 1]>>> for ArrayRef<A, Ix1>
where S: Data<Elem = A>, A: LinalgScalar,

Source§

type Output = <ArrayRef<A, Dim<[usize; 1]>> as Dot<ArrayRef<A, Dim<[usize; 1]>>>>::Output

Source§

impl<A, S> Dot<ArrayBase<S, Dim<[usize; 1]>>> for ArrayRef<A, Ix2>
where S: Data<Elem = A>, A: LinalgScalar,

Source§

type Output = <ArrayRef<A, Dim<[usize; 2]>> as Dot<ArrayRef<A, Dim<[usize; 1]>>>>::Output

Source§

impl<A, S> Dot<ArrayBase<S, Dim<[usize; 2]>>> for ArrayRef<A, Ix1>
where S: Data<Elem = A>, A: LinalgScalar,

Source§

type Output = <ArrayRef<A, Dim<[usize; 1]>> as Dot<ArrayRef<A, Dim<[usize; 2]>>>>::Output

Source§

impl<A, S> Dot<ArrayBase<S, Dim<[usize; 2]>>> for ArrayRef<A, Ix2>
where S: Data<Elem = A>, A: LinalgScalar,

Source§

type Output = <ArrayRef<A, Dim<[usize; 2]>> as Dot<ArrayRef<A, Dim<[usize; 2]>>>>::Output

Source§

impl<A, S> Dot<ArrayRef<A, Dim<[usize; 1]>>> for ArrayBase<S, Ix1>
where S: Data<Elem = A>, A: LinalgScalar,

Source§

type Output = <ArrayRef<A, Dim<[usize; 1]>> as Dot<ArrayRef<A, Dim<[usize; 1]>>>>::Output

Source§

impl<A, S> Dot<ArrayRef<A, Dim<[usize; 1]>>> for ArrayBase<S, Ix2>
where S: Data<Elem = A>, A: LinalgScalar,

Source§

type Output = <ArrayRef<A, Dim<[usize; 2]>> as Dot<ArrayRef<A, Dim<[usize; 1]>>>>::Output

Source§

impl<A, S> Dot<ArrayRef<A, Dim<[usize; 2]>>> for ArrayBase<S, Ix1>
where S: Data<Elem = A>, A: LinalgScalar,

Source§

type Output = <ArrayRef<A, Dim<[usize; 1]>> as Dot<ArrayRef<A, Dim<[usize; 2]>>>>::Output

Source§

impl<A, S> Dot<ArrayRef<A, Dim<[usize; 2]>>> for ArrayBase<S, Ix2>
where S: Data<Elem = A>, A: LinalgScalar,

Source§

type Output = <ArrayRef<A, Dim<[usize; 2]>> as Dot<ArrayRef<A, Dim<[usize; 2]>>>>::Output

Source§

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 self is M × N, then rhs must be N × K for matrix-matrix multiplication
  • If self is M × N and rhs is N, returns a vector of length M
  • If self is M and rhs is 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, Ix1>
where A: LinalgScalar,

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.

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.

Source§

impl<A> Dot<ArrayRef<A, Dim<[usize; 2]>>> for ArrayRef<A, Ix1>
where A: LinalgScalar,

Source§

impl<A> Dot<ArrayRef<A, Dim<[usize; 2]>>> for ArrayRef<A, Ix2>
where A: LinalgScalar,