pub struct MmapArray2F32 { /* private fields */ }Expand description
A memory-mapped array of f32 values.
This struct provides zero-copy access to large arrays stored on disk.
Implementations§
Source§impl MmapArray2F32
impl MmapArray2F32
Sourcepub fn from_raw_file(path: &Path) -> Result<Self>
pub fn from_raw_file(path: &Path) -> Result<Self>
Load a 2D f32 array from a raw binary file.
The file format is:
- 8 bytes: nrows (i64 little-endian)
- 8 bytes: ncols (i64 little-endian)
- nrows * ncols * 4 bytes: f32 data (little-endian)
Sourcepub fn row(&self, idx: usize) -> ArrayView1<'_, f32>
pub fn row(&self, idx: usize) -> ArrayView1<'_, f32>
Get a view of a row.
Auto Trait Implementations§
impl Freeze for MmapArray2F32
impl RefUnwindSafe for MmapArray2F32
impl Send for MmapArray2F32
impl Sync for MmapArray2F32
impl Unpin for MmapArray2F32
impl UnsafeUnpin for MmapArray2F32
impl UnwindSafe for MmapArray2F32
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<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>
Converts
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>
Converts
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