pub struct HorizontalPair<Left, Right> {
pub left: Left,
pub right: Right,
}
Expand description
A matrix composed by placing two matrices side-by-side horizontally.
Both matrices must have the same height
.
The resulting matrix has dimensions:
width
: The sum of thewidths
of the input matrices.height
: The same as the inputs.
Element access and iteration for a given row i
will first access the elements in the i
’th row of the left matrix,
followed by elements in the i'
th row of the right matrix.
Fields§
§left: Left
The left matrix in the horizontal composition.
right: Right
The right matrix in the horizontal composition.
Implementations§
Source§impl<Left, Right> HorizontalPair<Left, Right>
impl<Left, Right> HorizontalPair<Left, Right>
Trait Implementations§
Source§impl<Left: Clone, Right: Clone> Clone for HorizontalPair<Left, Right>
impl<Left: Clone, Right: Clone> Clone for HorizontalPair<Left, Right>
Source§fn clone(&self) -> HorizontalPair<Left, Right>
fn clone(&self) -> HorizontalPair<Left, Right>
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<T: Send + Sync + Clone, Left: Matrix<T>, Right: Matrix<T>> Matrix<T> for HorizontalPair<Left, Right>
impl<T: Send + Sync + Clone, Left: Matrix<T>, Right: Matrix<T>> Matrix<T> for HorizontalPair<Left, Right>
Source§unsafe fn get_unchecked(&self, r: usize, c: usize) -> T
unsafe fn get_unchecked(&self, r: usize, c: usize) -> T
Returns the element at the given row and column. Read more
Source§unsafe fn row_unchecked(
&self,
r: usize,
) -> impl IntoIterator<Item = T, IntoIter = impl Iterator<Item = T> + Send + Sync>
unsafe fn row_unchecked( &self, r: usize, ) -> impl IntoIterator<Item = T, IntoIter = impl Iterator<Item = T> + Send + Sync>
Returns an iterator over the elements of the
r
-th row. Read moreSource§fn dimensions(&self) -> Dimensions
fn dimensions(&self) -> Dimensions
Returns the dimensions (width, height) of the matrix.
Source§fn get(&self, r: usize, c: usize) -> Option<T>
fn get(&self, r: usize, c: usize) -> Option<T>
Returns the element at the given row and column. Read more
Source§fn row(
&self,
r: usize,
) -> Option<impl IntoIterator<Item = T, IntoIter = impl Iterator<Item = T> + Send + Sync>>
fn row( &self, r: usize, ) -> Option<impl IntoIterator<Item = T, IntoIter = impl Iterator<Item = T> + Send + Sync>>
Returns an iterator over the elements of the
r
-th row. Read moreSource§unsafe fn row_subseq_unchecked(
&self,
r: usize,
start: usize,
end: usize,
) -> impl IntoIterator<Item = T, IntoIter = impl Iterator<Item = T> + Send + Sync>
unsafe fn row_subseq_unchecked( &self, r: usize, start: usize, end: usize, ) -> impl IntoIterator<Item = T, IntoIter = impl Iterator<Item = T> + Send + Sync>
Source§fn row_slice(&self, r: usize) -> Option<impl Deref<Target = [T]>>
fn row_slice(&self, r: usize) -> Option<impl Deref<Target = [T]>>
Returns the elements of the
r
-th row as something which can be coerced to a slice. Read moreSource§unsafe fn row_slice_unchecked(&self, r: usize) -> impl Deref<Target = [T]>
unsafe fn row_slice_unchecked(&self, r: usize) -> impl Deref<Target = [T]>
Returns the elements of the
r
-th row as something which can be coerced to a slice. Read moreSource§unsafe fn row_subslice_unchecked(
&self,
r: usize,
start: usize,
end: usize,
) -> impl Deref<Target = [T]>
unsafe fn row_subslice_unchecked( &self, r: usize, start: usize, end: usize, ) -> impl Deref<Target = [T]>
Returns a subset of elements of the
r
-th row as something which can be coerced to a slice. Read moreSource§fn rows(&self) -> impl Iterator<Item = impl Iterator<Item = T>> + Send + Sync
fn rows(&self) -> impl Iterator<Item = impl Iterator<Item = T>> + Send + Sync
Returns an iterator over all rows in the matrix.
Source§fn par_rows(
&self,
) -> impl IndexedParallelIterator<Item = impl Iterator<Item = T>> + Send + Sync
fn par_rows( &self, ) -> impl IndexedParallelIterator<Item = impl Iterator<Item = T>> + Send + Sync
Returns a parallel iterator over all rows in the matrix.
Source§fn wrapping_row_slices(
&self,
r: usize,
c: usize,
) -> Vec<impl Deref<Target = [T]>>
fn wrapping_row_slices( &self, r: usize, c: usize, ) -> Vec<impl Deref<Target = [T]>>
Collect the elements of the rows
r
through r + c
. If anything is larger than self.height()
simply wrap around to the beginning of the matrix.Source§fn first_row(
&self,
) -> Option<impl IntoIterator<Item = T, IntoIter = impl Iterator<Item = T> + Send + Sync>>
fn first_row( &self, ) -> Option<impl IntoIterator<Item = T, IntoIter = impl Iterator<Item = T> + Send + Sync>>
Returns an iterator over the first row of the matrix. Read more
Source§fn last_row(
&self,
) -> Option<impl IntoIterator<Item = T, IntoIter = impl Iterator<Item = T> + Send + Sync>>
fn last_row( &self, ) -> Option<impl IntoIterator<Item = T, IntoIter = impl Iterator<Item = T> + Send + Sync>>
Returns an iterator over the last row of the matrix. Read more
Source§fn to_row_major_matrix(self) -> RowMajorMatrix<T>
fn to_row_major_matrix(self) -> RowMajorMatrix<T>
Converts the matrix into a
RowMajorMatrix
by collecting all rows into a single vector.Source§fn horizontally_packed_row<'a, P>(
&'a self,
r: usize,
) -> (impl Iterator<Item = P> + Send + Sync, impl Iterator<Item = T> + Send + Sync)where
P: PackedValue<Value = T>,
T: Clone + 'a,
fn horizontally_packed_row<'a, P>(
&'a self,
r: usize,
) -> (impl Iterator<Item = P> + Send + Sync, impl Iterator<Item = T> + Send + Sync)where
P: PackedValue<Value = T>,
T: Clone + 'a,
Get a packed iterator over the
r
-th row. Read moreSource§fn padded_horizontally_packed_row<'a, P>(
&'a self,
r: usize,
) -> impl Iterator<Item = P> + Send + Sync
fn padded_horizontally_packed_row<'a, P>( &'a self, r: usize, ) -> impl Iterator<Item = P> + Send + Sync
Get a packed iterator over the
r
-th row. Read moreSource§fn par_horizontally_packed_rows<'a, P>(
&'a self,
) -> impl IndexedParallelIterator<Item = (impl Iterator<Item = P> + Send + Sync, impl Iterator<Item = T> + Send + Sync)>where
P: PackedValue<Value = T>,
T: Clone + 'a,
fn par_horizontally_packed_rows<'a, P>(
&'a self,
) -> impl IndexedParallelIterator<Item = (impl Iterator<Item = P> + Send + Sync, impl Iterator<Item = T> + Send + Sync)>where
P: PackedValue<Value = T>,
T: Clone + 'a,
Get a parallel iterator over all packed rows of the matrix. Read more
Source§fn par_padded_horizontally_packed_rows<'a, P>(
&'a self,
) -> impl IndexedParallelIterator<Item = impl Iterator<Item = P> + Send + Sync>
fn par_padded_horizontally_packed_rows<'a, P>( &'a self, ) -> impl IndexedParallelIterator<Item = impl Iterator<Item = P> + Send + Sync>
Get a parallel iterator over all packed rows of the matrix. Read more
Source§fn vertically_packed_row<P>(&self, r: usize) -> impl Iterator<Item = P>where
T: Copy,
P: PackedValue<Value = T>,
fn vertically_packed_row<P>(&self, r: usize) -> impl Iterator<Item = P>where
T: Copy,
P: PackedValue<Value = T>,
Pack together a collection of adjacent rows from the matrix. Read more
Source§fn vertically_packed_row_pair<P>(&self, r: usize, step: usize) -> Vec<P>where
T: Copy,
P: PackedValue<Value = T>,
fn vertically_packed_row_pair<P>(&self, r: usize, step: usize) -> Vec<P>where
T: Copy,
P: PackedValue<Value = T>,
Pack together a collection of rows and “next” rows from the matrix. Read more
Source§fn vertically_strided(
self,
stride: usize,
offset: usize,
) -> VerticallyStridedMatrixView<Self>where
Self: Sized,
fn vertically_strided(
self,
stride: usize,
offset: usize,
) -> VerticallyStridedMatrixView<Self>where
Self: Sized,
Returns a view over a vertically strided submatrix. Read more
Source§fn columnwise_dot_product<EF>(&self, v: &[EF]) -> Vec<EF>where
T: Field,
EF: ExtensionField<T>,
fn columnwise_dot_product<EF>(&self, v: &[EF]) -> Vec<EF>where
T: Field,
EF: ExtensionField<T>,
Compute Mᵀv, aka premultiply this matrix by the given vector,
aka scale each row by the corresponding entry in
v
and take the sum across rows.
v
can be a vector of extension elements.Source§fn rowwise_packed_dot_product<EF>(
&self,
vec: &[EF::ExtensionPacking],
) -> impl IndexedParallelIterator<Item = EF>where
T: Field,
EF: ExtensionField<T>,
fn rowwise_packed_dot_product<EF>(
&self,
vec: &[EF::ExtensionPacking],
) -> impl IndexedParallelIterator<Item = EF>where
T: Field,
EF: ExtensionField<T>,
Compute the matrix vector product
M . vec
, aka take the dot product of each
row of M
by vec
. If the length of vec
is longer than the width of M
,
vec
is truncated to the first width()
elements. Read moreimpl<Left: Copy, Right: Copy> Copy for HorizontalPair<Left, Right>
Auto Trait Implementations§
impl<Left, Right> Freeze for HorizontalPair<Left, Right>
impl<Left, Right> RefUnwindSafe for HorizontalPair<Left, Right>where
Left: RefUnwindSafe,
Right: RefUnwindSafe,
impl<Left, Right> Send for HorizontalPair<Left, Right>
impl<Left, Right> Sync for HorizontalPair<Left, Right>
impl<Left, Right> Unpin for HorizontalPair<Left, Right>
impl<Left, Right> UnwindSafe for HorizontalPair<Left, Right>where
Left: UnwindSafe,
Right: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more