Struct lightmotif::dense::DenseMatrix
source · pub struct DenseMatrix<T: Default + Copy, C: Unsigned, A: Unsigned + PowerOfTwo = DefaultAlignment> { /* private fields */ }Expand description
A memory-aligned dense matrix with a constant number of columns.
Implementations§
source§impl<T: Default + Copy, C: Unsigned, A: Unsigned + PowerOfTwo> DenseMatrix<T, C, A>
impl<T: Default + Copy, C: Unsigned, A: Unsigned + PowerOfTwo> DenseMatrix<T, C, A>
sourcepub unsafe fn uninitialized(rows: usize) -> Self
pub unsafe fn uninitialized(rows: usize) -> Self
Create a new uninitialized matrix with the given number of rows.
sourcepub fn from_rows<I>(rows: I) -> Selfwhere
I: IntoIterator,
<I as IntoIterator>::Item: AsRef<[T]>,
<I as IntoIterator>::IntoIter: ExactSizeIterator,
pub fn from_rows<I>(rows: I) -> Selfwhere
I: IntoIterator,
<I as IntoIterator>::Item: AsRef<[T]>,
<I as IntoIterator>::IntoIter: ExactSizeIterator,
Create a new dense matrix from an iterable of rows.
§Panics
Panics if any of the rows does not have the number of elements corresponding to the dense matrix columns.
sourcepub const fn stride(&self) -> usize
pub const fn stride(&self) -> usize
The stride of the matrix, as a number of elements.
This may be different from the number of columns to account for memory
alignment constraints. Multiply by std::mem::size_of::<T>() to obtain
the stride in bytes.
§Example
let d = DenseMatrix::<u8, U43, U32>::new(0);
assert_eq!(d.stride(), 64);Trait Implementations§
source§impl<C: StrictlyPositive> AsMut<DenseMatrix<f32, C>> for StripedScores<C>
impl<C: StrictlyPositive> AsMut<DenseMatrix<f32, C>> for StripedScores<C>
source§fn as_mut(&mut self) -> &mut DenseMatrix<f32, C>
fn as_mut(&mut self) -> &mut DenseMatrix<f32, C>
Converts this type into a mutable reference of the (usually inferred) input type.
source§impl<A: Alphabet, C: StrictlyPositive> AsRef<DenseMatrix<<A as Alphabet>::Symbol, C>> for StripedSequence<A, C>
impl<A: Alphabet, C: StrictlyPositive> AsRef<DenseMatrix<<A as Alphabet>::Symbol, C>> for StripedSequence<A, C>
source§fn as_ref(&self) -> &DenseMatrix<A::Symbol, C>
fn as_ref(&self) -> &DenseMatrix<A::Symbol, C>
Converts this type into a shared reference of the (usually inferred) input type.
source§impl<A: Alphabet> AsRef<DenseMatrix<f32, <A as Alphabet>::K>> for FrequencyMatrix<A>
impl<A: Alphabet> AsRef<DenseMatrix<f32, <A as Alphabet>::K>> for FrequencyMatrix<A>
source§impl<A: Alphabet> AsRef<DenseMatrix<f32, <A as Alphabet>::K>> for ScoringMatrix<A>
impl<A: Alphabet> AsRef<DenseMatrix<f32, <A as Alphabet>::K>> for ScoringMatrix<A>
source§impl<A: Alphabet> AsRef<DenseMatrix<f32, <A as Alphabet>::K>> for WeightMatrix<A>
impl<A: Alphabet> AsRef<DenseMatrix<f32, <A as Alphabet>::K>> for WeightMatrix<A>
source§impl<C: StrictlyPositive> AsRef<DenseMatrix<f32, C>> for StripedScores<C>
impl<C: StrictlyPositive> AsRef<DenseMatrix<f32, C>> for StripedScores<C>
source§fn as_ref(&self) -> &DenseMatrix<f32, C>
fn as_ref(&self) -> &DenseMatrix<f32, C>
Converts this type into a shared reference of the (usually inferred) input type.
source§impl<A: Alphabet> AsRef<DenseMatrix<u32, <A as Alphabet>::K>> for CountMatrix<A>
impl<A: Alphabet> AsRef<DenseMatrix<u32, <A as Alphabet>::K>> for CountMatrix<A>
source§impl<T: Clone + Default + Copy, C: Clone + Unsigned, A: Clone + Unsigned + PowerOfTwo> Clone for DenseMatrix<T, C, A>
impl<T: Clone + Default + Copy, C: Clone + Unsigned, A: Clone + Unsigned + PowerOfTwo> Clone for DenseMatrix<T, C, A>
source§fn clone(&self) -> DenseMatrix<T, C, A>
fn clone(&self) -> DenseMatrix<T, C, A>
Returns a copy 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: Default + Copy + Debug, C: Unsigned, A: Unsigned + PowerOfTwo> Debug for DenseMatrix<T, C, A>
impl<T: Default + Copy + Debug, C: Unsigned, A: Unsigned + PowerOfTwo> Debug for DenseMatrix<T, C, A>
source§impl<A: Alphabet, C: StrictlyPositive> From<StripedSequence<A, C>> for DenseMatrix<A::Symbol, C>
impl<A: Alphabet, C: StrictlyPositive> From<StripedSequence<A, C>> for DenseMatrix<A::Symbol, C>
source§fn from(striped: StripedSequence<A, C>) -> Self
fn from(striped: StripedSequence<A, C>) -> Self
Converts to this type from the input type.
source§impl<T: Default + Copy, C: Unsigned, A: Unsigned + PowerOfTwo> Index<MatrixCoordinates> for DenseMatrix<T, C, A>
impl<T: Default + Copy, C: Unsigned, A: Unsigned + PowerOfTwo> Index<MatrixCoordinates> for DenseMatrix<T, C, A>
source§impl<T: Default + Copy, C: Unsigned, A: Unsigned + PowerOfTwo> Index<usize> for DenseMatrix<T, C, A>
impl<T: Default + Copy, C: Unsigned, A: Unsigned + PowerOfTwo> Index<usize> for DenseMatrix<T, C, A>
source§impl<T: Default + Copy, C: Unsigned, A: Unsigned + PowerOfTwo> IndexMut<usize> for DenseMatrix<T, C, A>
impl<T: Default + Copy, C: Unsigned, A: Unsigned + PowerOfTwo> IndexMut<usize> for DenseMatrix<T, C, A>
source§impl<'a, T: Default + Copy, C: Unsigned, A: Unsigned + PowerOfTwo> IntoIterator for &'a DenseMatrix<T, C, A>
impl<'a, T: Default + Copy, C: Unsigned, A: Unsigned + PowerOfTwo> IntoIterator for &'a DenseMatrix<T, C, A>
source§impl<'a, T: Default + Copy, C: Unsigned, A: Unsigned + PowerOfTwo> IntoIterator for &'a mut DenseMatrix<T, C, A>
impl<'a, T: Default + Copy, C: Unsigned, A: Unsigned + PowerOfTwo> IntoIterator for &'a mut DenseMatrix<T, C, A>
source§impl<'a, T: Default + Copy + PartialEq, C: Unsigned, A: Unsigned + PowerOfTwo> PartialEq for DenseMatrix<T, C, A>
impl<'a, T: Default + Copy + PartialEq, C: Unsigned, A: Unsigned + PowerOfTwo> PartialEq for DenseMatrix<T, C, A>
impl<T: Eq + Default + Copy, C: Eq + Unsigned, A: Eq + Unsigned + PowerOfTwo> Eq for DenseMatrix<T, C, A>
Auto Trait Implementations§
impl<T, C, A> Freeze for DenseMatrix<T, C, A>
impl<T, C, A> RefUnwindSafe for DenseMatrix<T, C, A>
impl<T, C, A> Send for DenseMatrix<T, C, A>
impl<T, C, A> Sync for DenseMatrix<T, C, A>
impl<T, C, A> Unpin for DenseMatrix<T, C, A>
impl<T, C, A> UnwindSafe for DenseMatrix<T, C, A>
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