pub trait Inner<T> {
type Out: Copy + Default;
// Required method
fn inner_into(
&self,
a: &[T],
b: &[T],
size: [usize; 3],
out: &mut [Self::Out],
);
// Provided methods
fn inner(&self, a: &[T], b: &[T], size: [usize; 3]) -> Vec<Self::Out> { ... }
fn checked_into(
&self,
a: &[T],
b: &[T],
size: [usize; 3],
out: &mut [Self::Out],
) -> bool { ... }
fn inner_ops(
&self,
a: &[T],
b: &[T],
_: [Orientation; 2],
_: [usize; 3],
) -> Vec<Self::Out>
where T: Copy { ... }
fn inner_mapped(
&self,
a: Mapped<'_, T>,
b: Mapped<'_, T>,
orientations: [Orientation; 2],
size: [usize; 3],
) -> Vec<Self::Out>
where T: Element { ... }
fn inner_mapped_into(
&self,
a: Mapped<'_, T>,
b: Mapped<'_, T>,
_: [Orientation; 2],
size: [usize; 3],
out: &mut [Self::Out],
)
where T: Element { ... }
}Expand description
An inner product f.g at item type T. Each pair object implements it at the item types listed here. Its loops compile in rustymath, as slice forms do.
Required Associated Types§
Required Methods§
Sourcefn inner_into(&self, a: &[T], b: &[T], size: [usize; 3], out: &mut [Self::Out])
fn inner_into(&self, a: &[T], b: &[T], size: [usize; 3], out: &mut [Self::Out])
The m×n inner product of a, an m×k matrix, and b, a k×n matrix, both row-major, written row-major into out, which holds m×n items. size is [m, k, n]. Where k is 0, each result is the identity of f. An integer result that doesn’t fit its type panics, where checked_into gives false.
Provided Methods§
Sourcefn inner(&self, a: &[T], b: &[T], size: [usize; 3]) -> Vec<Self::Out>
fn inner(&self, a: &[T], b: &[T], size: [usize; 3]) -> Vec<Self::Out>
inner_into’s results, as a new row-major matrix.
Sourcefn checked_into(
&self,
a: &[T],
b: &[T],
size: [usize; 3],
out: &mut [Self::Out],
) -> bool
fn checked_into( &self, a: &[T], b: &[T], size: [usize; 3], out: &mut [Self::Out], ) -> bool
inner_into, or false where an integer result doesn’t fit its type, for callers that keep integers exact or report overflow. Where it gives true, out holds the exact results. Floats always give true.
Sourcefn inner_ops(
&self,
a: &[T],
b: &[T],
_: [Orientation; 2],
_: [usize; 3],
) -> Vec<Self::Out>where
T: Copy,
fn inner_ops(
&self,
a: &[T],
b: &[T],
_: [Orientation; 2],
_: [usize; 3],
) -> Vec<Self::Out>where
T: Copy,
inner of the matrices that a and b give in the orientations given, with size [m, k, n] for those matrices. A transposed a holds a k×m matrix, row-major, and gives its m×k transpose. This default copies a transposed operand into its orientation. Float and complex PlusTimes read it in place.
Sourcefn inner_mapped(
&self,
a: Mapped<'_, T>,
b: Mapped<'_, T>,
orientations: [Orientation; 2],
size: [usize; 3],
) -> Vec<Self::Out>where
T: Element,
fn inner_mapped(
&self,
a: Mapped<'_, T>,
b: Mapped<'_, T>,
orientations: [Orientation; 2],
size: [usize; 3],
) -> Vec<Self::Out>where
T: Element,
inner_mapped_into’s results, as a new row-major matrix.
Sourcefn inner_mapped_into(
&self,
a: Mapped<'_, T>,
b: Mapped<'_, T>,
_: [Orientation; 2],
size: [usize; 3],
out: &mut [Self::Out],
)where
T: Element,
fn inner_mapped_into(
&self,
a: Mapped<'_, T>,
b: Mapped<'_, T>,
_: [Orientation; 2],
size: [usize; 3],
out: &mut [Self::Out],
)where
T: Element,
inner_into of operands whose items come through mappings, as Mapped describes. This default reads each operand whole and copies transposed operands into their orientations. Float and complex PlusTimes read an operand that isn’t held in order one block of its stored rows at a time and multiply each block as it’s read. Only one block of that operand then exists at once.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
Source§impl Inner<f16> for PlusTimes
+.× of f16 matrices, summed and returned at f32. rustymath’s own kernels convert each item to f32 as they pack it, so neither operand is copied whole. Accelerate has no f16 product, so where it serves the process, both operands convert to f32 copies for its f32 product.
impl Inner<f16> for PlusTimes
+.× of f16 matrices, summed and returned at f32. rustymath’s own kernels convert each item to f32 as they pack it, so neither operand is copied whole. Accelerate has no f16 product, so where it serves the process, both operands convert to f32 copies for its f32 product.