Skip to main content

VectorIndexBlock

Struct VectorIndexBlock 

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

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
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>,

Source§

type Inputs = Matrix<NROWS, NCOLS, T>

Source§

type Output = <[T; N] as TupleEquivalent<T, N>>::TupleEquivalent

Source§

type Parameters = Parameters<N>

Source§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

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

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.