pub struct Cuboid<F, const D: usize> {
pub min: [F; D],
pub max: [F; D],
}
Expand description
Generalized cuboid in D
dimensions
use spatial_decomposition::*;
use approx::assert_abs_diff_eq;
let c1 = Cuboid {
min: [1.; 4],
max: [15., 15., 10., 10.],
};
let c2 = Cuboid {
min: [1.1; 4],
max: [14.9, 14.99, 10.02, 9.97],
};
assert_abs_diff_eq!(c1, c2, epsilon = 0.11);
Fields§
§min: [F; D]
Lower bounds of cuboid
max: [F; D]
Upper bounds of cuboid
Trait Implementations§
Source§impl<F, const D: usize> AbsDiffEq for Cuboid<F, D>
impl<F, const D: usize> AbsDiffEq for Cuboid<F, D>
Source§fn default_epsilon() -> Self::Epsilon
fn default_epsilon() -> Self::Epsilon
The default tolerance to use when testing values that are close together. Read more
Source§fn abs_diff_eq(&self, other: &Self, epsilon: Self::Epsilon) -> bool
fn abs_diff_eq(&self, other: &Self, epsilon: Self::Epsilon) -> bool
A test for equality that uses the absolute difference to compute the approximimate
equality of two numbers.
Source§fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool
fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool
The inverse of
AbsDiffEq::abs_diff_eq
.Source§impl<F, const D: usize> RelativeEq for Cuboid<F, D>
impl<F, const D: usize> RelativeEq for Cuboid<F, D>
Source§fn default_max_relative() -> Self::Epsilon
fn default_max_relative() -> Self::Epsilon
The default relative tolerance for testing values that are far-apart. Read more
Source§fn relative_eq(
&self,
other: &Self,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon,
) -> bool
fn relative_eq( &self, other: &Self, epsilon: Self::Epsilon, max_relative: Self::Epsilon, ) -> bool
A test for equality that uses a relative comparison if the values are far apart.
Source§fn relative_ne(
&self,
other: &Rhs,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon,
) -> bool
fn relative_ne( &self, other: &Rhs, epsilon: Self::Epsilon, max_relative: Self::Epsilon, ) -> bool
The inverse of
RelativeEq::relative_eq
.impl<F, const D: usize> Send for Cuboid<F, D>
impl<F, const D: usize> StructuralPartialEq for Cuboid<F, D>
impl<F, const D: usize> Sync for Cuboid<F, D>
Auto Trait Implementations§
impl<F, const D: usize> Freeze for Cuboid<F, D>where
F: Freeze,
impl<F, const D: usize> RefUnwindSafe for Cuboid<F, D>where
F: RefUnwindSafe,
impl<F, const D: usize> Unpin for Cuboid<F, D>where
F: Unpin,
impl<F, const D: usize> UnwindSafe for Cuboid<F, D>where
F: 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<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§fn to_subset_unchecked(&self) -> SS
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.