pub struct ScalarGrid {
pub origin: Point,
pub cell: f64,
pub cols: usize,
pub rows: usize,
pub values: Vec<f64>,
}Available on crate feature
geometry only.Expand description
A regular grid of numbers.
Node (col, row) stands at origin + (col * cell, row * cell) and holds values[row * cols + col]. The fields
are public; a grid whose values do not hold exactly cols * rows numbers is malformed, and the functions that
read it panic.
Fields§
§origin: PointThe position of node (0, 0).
cell: f64The distance between neighbouring nodes.
cols: usizeThe count of columns of nodes.
rows: usizeThe count of rows of nodes.
values: Vec<f64>The numbers, row by row.
Implementations§
Source§impl ScalarGrid
impl ScalarGrid
Sourcepub fn zeros(
origin: Point,
cell: f64,
cols: usize,
rows: usize,
) -> Result<Self, GeometryError>
pub fn zeros( origin: Point, cell: f64, cols: usize, rows: usize, ) -> Result<Self, GeometryError>
A grid of zeros.
§Errors
GeometryError::BadParameter for a cell that is not finite and above zero, an origin that is not
finite, or cols or rows of zero, or a cols * rows that overflows (named cols).
Trait Implementations§
Source§impl Clone for ScalarGrid
impl Clone for ScalarGrid
Source§impl Debug for ScalarGrid
impl Debug for ScalarGrid
Source§impl PartialEq for ScalarGrid
impl PartialEq for ScalarGrid
impl StructuralPartialEq for ScalarGrid
Auto Trait Implementations§
impl Forget for ScalarGrid
impl Freeze for ScalarGrid
impl Move for ScalarGrid
impl RefUnwindSafe for ScalarGrid
impl Send for ScalarGridwhere
RawVecInner: Send,
impl Sync for ScalarGridwhere
RawVecInner: Sync,
impl Unpin for ScalarGrid
impl UnsafeUnpin for ScalarGrid
impl UnwindSafe for ScalarGridwhere
RawVecInner: UnwindSafe,
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§unsafe fn to_subset_unchecked(&self) -> SS
unsafe fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.