Struct lattice_qcd_rs::lattice::Direction
source · pub struct Direction<const D: usize> { /* private fields */ }
Expand description
Represent a cardinal direction
Implementations§
source§impl<const D: usize> Direction<D>
impl<const D: usize> Direction<D>
sourcepub const fn new(index_dir: usize, is_positive: bool) -> Option<Self>
pub const fn new(index_dir: usize, is_positive: bool) -> Option<Self>
New direction from a direction as an idex and wether it is in the positive direction.
sourcepub fn positives_vec() -> Vec<Self>
pub fn positives_vec() -> Vec<Self>
List of all positives directions.
This is very slow use Self::positive_directions
instead.
sourcepub fn directions_vec() -> Vec<Self>
pub fn directions_vec() -> Vec<Self>
List all directions.
This is very slow use DirectionList::directions
instead.
sourcepub const fn directions_array<const IS_POSITIVE: bool>() -> [Self; D]
pub const fn directions_array<const IS_POSITIVE: bool>() -> [Self; D]
Get all direction with the sign IS_POSITIVE
.
sourcepub const fn negative_directions() -> [Self; D]
pub const fn negative_directions() -> [Self; D]
Get all negative direction
sourcepub const fn positive_directions() -> [Self; D]
pub const fn positive_directions() -> [Self; D]
Get all positive direction
sourcepub const fn is_positive(&self) -> bool
pub const fn is_positive(&self) -> bool
Get if the position is positive.
sourcepub const fn is_negative(&self) -> bool
pub const fn is_negative(&self) -> bool
Get if the position is Negative. see Direction::is_positive
sourcepub const fn to_positive(self) -> Self
pub const fn to_positive(self) -> Self
Return the positive direction associated, for example -x
gives +x
and +x
gives +x
.
Example
assert_eq!(
Direction::<4>::new(1, false).unwrap().to_positive(),
Direction::<4>::new(1, true).unwrap()
);
assert_eq!(
Direction::<4>::new(1, true).unwrap().to_positive(),
Direction::<4>::new(1, true).unwrap()
);
sourcepub const fn index(&self) -> usize
pub const fn index(&self) -> usize
Get a index associated to the direction.
Example
assert_eq!(Direction::<4>::new(1, false).unwrap().index(), 1);
sourcepub fn to_vector(self, a: f64) -> SVector<Real, D>
pub fn to_vector(self, a: f64) -> SVector<Real, D>
Convert the direction into a vector of norm a
;
sourcepub fn to_unit_vector(self) -> SVector<Real, D>
pub fn to_unit_vector(self) -> SVector<Real, D>
Convert the direction into a vector of norm 1
;
sourcepub fn from_vector(v: &SVector<Real, D>) -> Self
pub fn from_vector(v: &SVector<Real, D>) -> Self
Find the direction the vector point the most.
For a zero vector return DirectionEnum::XPos
.
Example
assert_eq!(
Direction::from_vector(&nalgebra::Vector4::new(1_f64, 0_f64, 0_f64, 0_f64)),
Direction::<4>::new(0, true).ok_or(ImplementationError::OptionWithUnexpectedNone)?
);
assert_eq!(
Direction::from_vector(&nalgebra::Vector4::new(0_f64, -1_f64, 0_f64, 0_f64)),
Direction::<4>::new(1, false).ok_or(ImplementationError::OptionWithUnexpectedNone)?
);
assert_eq!(
Direction::from_vector(&nalgebra::Vector4::new(0.5_f64, 1_f64, 0_f64, 2_f64)),
Direction::<4>::new(3, true).ok_or(ImplementationError::OptionWithUnexpectedNone)?
);
Trait Implementations§
source§impl<'de, const D: usize> Deserialize<'de> for Direction<D>
impl<'de, const D: usize> Deserialize<'de> for Direction<D>
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl DirectionList for Direction<{ _ }>
impl DirectionList for Direction<{ _ }>
source§fn directions() -> &'static [Self]
fn directions() -> &'static [Self]
source§fn positive_directions() -> &'static [Self]
fn positive_directions() -> &'static [Self]
source§impl<const D: usize> From<&Direction<D>> for SVector<Real, D>
impl<const D: usize> From<&Direction<D>> for SVector<Real, D>
Return Direction::to_unit_vector
.
source§impl From<&DirectionEnum> for Direction<4>
impl From<&DirectionEnum> for Direction<4>
source§fn from(d: &DirectionEnum) -> Self
fn from(d: &DirectionEnum) -> Self
source§impl<const D: usize> From<&Matrix<f64, Const<D>, Const<1>, ArrayStorage<f64, D, 1>>> for Direction<D>
impl<const D: usize> From<&Matrix<f64, Const<D>, Const<1>, ArrayStorage<f64, D, 1>>> for Direction<D>
Return DirectionEnum::from_vector
.
source§impl<const D: usize> From<Direction<D>> for SVector<Real, D>
impl<const D: usize> From<Direction<D>> for SVector<Real, D>
Return Direction::to_unit_vector
.
source§impl From<DirectionEnum> for Direction<4>
impl From<DirectionEnum> for Direction<4>
source§fn from(d: DirectionEnum) -> Self
fn from(d: DirectionEnum) -> Self
source§impl<const D: usize> From<Matrix<f64, Const<D>, Const<1>, ArrayStorage<f64, D, 1>>> for Direction<D>
impl<const D: usize> From<Matrix<f64, Const<D>, Const<1>, ArrayStorage<f64, D, 1>>> for Direction<D>
Return DirectionEnum::from_vector
.
source§impl<const D: usize> LatticeElementToIndex<D> for Direction<D>
impl<const D: usize> LatticeElementToIndex<D> for Direction<D>
source§fn to_index(&self, _: &LatticeCyclic<D>) -> usize
fn to_index(&self, _: &LatticeCyclic<D>) -> usize
equivalent to Direction::to_index()
source§impl<const D: usize> PartialEq<Direction<D>> for Direction<D>
impl<const D: usize> PartialEq<Direction<D>> for Direction<D>
source§impl<const D: usize> PartialOrd<Direction<D>> for Direction<D>
impl<const D: usize> PartialOrd<Direction<D>> for Direction<D>
Partial ordering is set as follows: two directions can be compared if they have the same index or the same direction sign. In the first case a positive direction is greater than a negative direction In the latter case the ordering is done on the index.
Example
use std::cmp::Ordering;
let dir_1 =
Direction::<4>::new(1, false).ok_or(ImplementationError::OptionWithUnexpectedNone)?;
let dir_2 =
Direction::<4>::new(1, true).ok_or(ImplementationError::OptionWithUnexpectedNone)?;
assert!(dir_1 < dir_2);
assert_eq!(dir_1.partial_cmp(&dir_2), Some(Ordering::Less));
//--------
let dir_3 =
Direction::<4>::new(3, false).ok_or(ImplementationError::OptionWithUnexpectedNone)?;
let dir_4 =
Direction::<4>::new(1, false).ok_or(ImplementationError::OptionWithUnexpectedNone)?;
assert!(dir_3 > dir_4);
assert_eq!(dir_3.partial_cmp(&dir_4), Some(Ordering::Greater));
//--------
let dir_5 =
Direction::<4>::new(3, true).ok_or(ImplementationError::OptionWithUnexpectedNone)?;
let dir_6 =
Direction::<4>::new(1, false).ok_or(ImplementationError::OptionWithUnexpectedNone)?;
assert_eq!(dir_5.partial_cmp(&dir_6), None);
//--------
let dir_5 =
Direction::<4>::new(1, false).ok_or(ImplementationError::OptionWithUnexpectedNone)?;
let dir_6 =
Direction::<4>::new(1, false).ok_or(ImplementationError::OptionWithUnexpectedNone)?;
assert_eq!(dir_5.partial_cmp(&dir_6), Some(Ordering::Equal));
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moreimpl<const D: usize> Copy for Direction<D>
impl<const D: usize> Eq for Direction<D>
impl<const D: usize> StructuralEq for Direction<D>
impl<const D: usize> StructuralPartialEq for Direction<D>
Auto Trait Implementations§
impl<const D: usize> RefUnwindSafe for Direction<D>
impl<const D: usize> Send for Direction<D>
impl<const D: usize> Sync for Direction<D>
impl<const D: usize> Unpin for Direction<D>
impl<const D: usize> UnwindSafe for Direction<D>
Blanket Implementations§
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.