Struct Cuboid

Source
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>
where F: AbsDiffEq + PartialEq, <F as AbsDiffEq>::Epsilon: Clone,

Source§

type Epsilon = <F as AbsDiffEq>::Epsilon

Used for specifying relative comparisons.
Source§

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

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

The inverse of AbsDiffEq::abs_diff_eq.
Source§

impl<F: Clone, const D: usize> Clone for Cuboid<F, D>

Source§

fn clone(&self) -> Cuboid<F, D>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<F: Debug, const D: usize> Debug for Cuboid<F, D>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<F: PartialEq, const D: usize> PartialEq for Cuboid<F, D>

Source§

fn eq(&self, other: &Cuboid<F, D>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<F, const D: usize> RelativeEq for Cuboid<F, D>

Source§

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

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

The inverse of RelativeEq::relative_eq.
Source§

impl<F, const D: usize> Send for Cuboid<F, D>

Source§

impl<F, const D: usize> StructuralPartialEq for Cuboid<F, D>

Source§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

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

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.