pub struct VectorIndexBlock<const N: usize, T: Scalar, I: Pass>where
[T; N]: TupleEquivalent<T, N>,{
pub data: Vec<BlockData>,
/* private fields */
}Expand description
Extracts a set of values from an input matrix based on the linear index, and outputs them in the order of the indices.
The output of the block matches the order of the indices, for example if the indices are [15, 0], the 0th output of the block will be the 15th element of the input matrix and the 1st output of the block will be the 0th element of the input matrix.
Note: Indices are 0 based and linear. If the indices is output side the bounds of the input matrix, the output will be 0.
Fields§
§data: Vec<BlockData>Trait Implementations§
Source§impl<T: Scalar, const N: usize, I: Pass> Default for VectorIndexBlock<N, T, I>where
[T; N]: TupleEquivalent<T, N>,
impl<T: Scalar, const N: usize, I: Pass> Default for VectorIndexBlock<N, T, I>where
[T; N]: TupleEquivalent<T, N>,
Source§impl<T: Scalar, const N: usize, const NROWS: usize, const NCOLS: usize> ProcessBlock for VectorIndexBlock<N, T, Matrix<NROWS, NCOLS, T>>where
[T; N]: TupleEquivalent<T, N>,
impl<T: Scalar, const N: usize, const NROWS: usize, const NCOLS: usize> ProcessBlock for VectorIndexBlock<N, T, Matrix<NROWS, NCOLS, T>>where
[T; N]: TupleEquivalent<T, N>,
type Inputs = Matrix<NROWS, NCOLS, T>
type Output = <[T; N] as TupleEquivalent<T, N>>::TupleEquivalent
type Parameters = Parameters<N>
fn process( &mut self, parameters: &Self::Parameters, _context: &dyn Context, inputs: PassBy<'_, Self::Inputs>, ) -> PassBy<'_, Self::Output>
Auto Trait Implementations§
impl<const N: usize, T, I> !Freeze for VectorIndexBlock<N, T, I>
impl<const N: usize, T, I> !RefUnwindSafe for VectorIndexBlock<N, T, I>
impl<const N: usize, T, I> !Send for VectorIndexBlock<N, T, I>
impl<const N: usize, T, I> !Sync for VectorIndexBlock<N, T, I>
impl<const N: usize, T, I> !Unpin for VectorIndexBlock<N, T, I>
impl<const N: usize, T, I> !UnsafeUnpin for VectorIndexBlock<N, T, I>
impl<const N: usize, T, I> !UnwindSafe for VectorIndexBlock<N, T, I>
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<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.