Skip to main content

triangular_mask_view_into_uninit

Function triangular_mask_view_into_uninit 

Source
pub fn triangular_mask_view_into_uninit<T: Copy + MaybeSendSync>(
    output: &mut [MaybeUninit<T>],
    src: &StridedView<'_, T>,
    k: i64,
    upper: bool,
    fill: T,
) -> Result<()>
Expand description

Mask a triangular region of a strided input into caller-owned contiguous storage.

The source layout is given by src; reads follow its strides and offset, so a reversed, transposed or otherwise strided source needs no staging copy. Kept elements come from src; masked elements receive fill. Every output element is written exactly once and the masked region of the source is never read.

ยงErrors

Returns RankMismatch or ShapeMismatch for invalid shapes and buffer lengths, and OffsetOverflow for unrepresentable layouts, before writing.