pub struct Grid2D {
pub nx: usize,
pub ny: usize,
pub dx: f32,
pub dy: f32,
/* private fields */
}Expand description
Grille 2D de f32 stockée en ligne-majeure (index = y * nx + x).
Fields§
§nx: usize§ny: usize§dx: f32§dy: f32Implementations§
Source§impl Grid2D
impl Grid2D
pub fn new(nx: usize, ny: usize, dx: f32, dy: f32) -> Self
pub fn index(&self, x: usize, y: usize) -> usize
pub fn get(&self, x: usize, y: usize) -> f32
pub fn set(&mut self, x: usize, y: usize, val: f32)
pub fn fill(&mut self, val: f32)
Sourcepub fn as_slice(&self) -> &[f32]
pub fn as_slice(&self) -> &[f32]
Lecture seule des données brutes (export, rendu, boucles rapides).
Sourcepub fn as_mut_slice(&mut self) -> &mut [f32]
pub fn as_mut_slice(&mut self) -> &mut [f32]
Écriture sur les données brutes.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Grid2D
impl RefUnwindSafe for Grid2D
impl Send for Grid2D
impl Sync for Grid2D
impl Unpin for Grid2D
impl UnsafeUnpin for Grid2D
impl UnwindSafe for Grid2D
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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