pub struct StackedLayout {
pub sorted_cols: Vec<(usize, usize, StackedSlice)>,
pub mat_starts: Vec<usize>,
/* private fields */
}Fields§
§sorted_cols: Vec<(usize, usize, StackedSlice)>The columns of the unstacked matrices in sorted order. Each entry (matrix index, column index, coordinate) contains the pointer (matrix index, column index) to a column of the
unstacked collection of matrices as well as coordinate which is a pointer to where the
column starts in the stacked matrix.
mat_starts: Vec<usize>mat_starts[mat_idx] is the index in sorted_cols where the matrix with index mat_idx
starts.
Implementations§
Source§impl StackedLayout
impl StackedLayout
Source§impl StackedLayout
impl StackedLayout
Sourcepub fn new(
l_skip: usize,
log_stacked_height: usize,
sorted: Vec<(usize, usize)>,
) -> Result<Self, StackedPcsError>
pub fn new( l_skip: usize, log_stacked_height: usize, sorted: Vec<(usize, usize)>, ) -> Result<Self, StackedPcsError>
Computes the layout of greedily stacking columns with dimension metadata given by sorted
into a stacked matrix.
l_skipis a threshold log2 height: if a column has height less than2^l_skip, it is stacked as a column of height2^l_skipwith stride2^{l_skip - log_height}.log_stacked_heightis the log2 height of the stacked matrix.sortedis Vec of(width, log_height)that must already be sorted in descending order oflog_height.
Sourcepub fn from_raw_parts(
l_skip: usize,
log_stacked_height: usize,
sorted_cols: Vec<(usize, usize, StackedSlice)>,
) -> Result<Self, StackedPcsError>
pub fn from_raw_parts( l_skip: usize, log_stacked_height: usize, sorted_cols: Vec<(usize, usize, StackedSlice)>, ) -> Result<Self, StackedPcsError>
Raw unsafe constructor
pub fn unstacked_slices_iter(&self) -> impl Iterator<Item = &StackedSlice>
Sourcepub fn get(&self, mat_idx: usize, col_idx: usize) -> Option<&StackedSlice>
pub fn get(&self, mat_idx: usize, col_idx: usize) -> Option<&StackedSlice>
(mat_idx, col_idx) should be indexing into the unstacked collection of matrices.
pub fn width_of(&self, mat_idx: usize) -> usize
Sourcepub fn mat_view<'a, F>(
&self,
unstacked_mat_idx: usize,
stacked_matrix: &'a ColMajorMatrix<F>,
) -> StridedColMajorMatrixView<'a, F>
pub fn mat_view<'a, F>( &self, unstacked_mat_idx: usize, stacked_matrix: &'a ColMajorMatrix<F>, ) -> StridedColMajorMatrixView<'a, F>
Due to the definition of stacking, in a column major matrix the lifted columns of the unstacked matrix will always be contiguous in memory within the stacked matrix, so we can return the sub-view.
Trait Implementations§
Source§impl Clone for StackedLayout
impl Clone for StackedLayout
Source§fn clone(&self) -> StackedLayout
fn clone(&self) -> StackedLayout
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for StackedLayout
impl Debug for StackedLayout
Source§impl<'de> Deserialize<'de> for StackedLayout
impl<'de> Deserialize<'de> for StackedLayout
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for StackedLayout
impl RefUnwindSafe for StackedLayout
impl Send for StackedLayout
impl Sync for StackedLayout
impl Unpin for StackedLayout
impl UnsafeUnpin for StackedLayout
impl UnwindSafe for StackedLayout
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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>
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