Struct lattice_qcd_rs::lattice::LatticeLink
source · pub struct LatticeLink<const D: usize> { /* private fields */ }
Expand description
A lattice link, contrary to LatticeLinkCanonical
the direction can be negative.
This means that multiple link can be equivalent but does not have the same data and therefore hash (hopefully).
By itself the link does not store data about the lattice. Hence most function require a LatticeCyclic
.
It also means that there is no guarantee that the object is inside a lattice.
You can use modulus over the elements to use inside a lattice.
Implementations§
source§impl<const D: usize> LatticeLink<D>
impl<const D: usize> LatticeLink<D>
sourcepub const fn new(from: LatticePoint<D>, dir: Direction<D>) -> Self
pub const fn new(from: LatticePoint<D>, dir: Direction<D>) -> Self
Create a link from position from
and direction dir
.
sourcepub const fn pos(&self) -> &LatticePoint<D>
pub const fn pos(&self) -> &LatticePoint<D>
Get the position of the link.
sourcepub fn pos_mut(&mut self) -> &mut LatticePoint<D>
pub fn pos_mut(&mut self) -> &mut LatticePoint<D>
Get a mutable reference to the position of the link.
sourcepub fn dir_mut(&mut self) -> &mut Direction<D>
pub fn dir_mut(&mut self) -> &mut Direction<D>
Get a mutable reference to the direction of the link.
sourcepub const fn is_dir_positive(&self) -> bool
pub const fn is_dir_positive(&self) -> bool
Get if the direction of the link is positive.
sourcepub const fn is_dir_negative(&self) -> bool
pub const fn is_dir_negative(&self) -> bool
Get if the direction of the link is negative.
Trait Implementations§
source§impl<const D: usize> Clone for LatticeLink<D>
impl<const D: usize> Clone for LatticeLink<D>
source§fn clone(&self) -> LatticeLink<D>
fn clone(&self) -> LatticeLink<D>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<const D: usize> Debug for LatticeLink<D>
impl<const D: usize> Debug for LatticeLink<D>
source§impl<'de, const D: usize> Deserialize<'de> for LatticeLink<D>
impl<'de, const D: usize> Deserialize<'de> for LatticeLink<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>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<const D: usize> Display for LatticeLink<D>
impl<const D: usize> Display for LatticeLink<D>
source§impl<const D: usize> From<&LatticeLinkCanonical<D>> for LatticeLink<D>
impl<const D: usize> From<&LatticeLinkCanonical<D>> for LatticeLink<D>
source§fn from(l: &LatticeLinkCanonical<D>) -> Self
fn from(l: &LatticeLinkCanonical<D>) -> Self
Converts to this type from the input type.
source§impl<const D: usize> From<LatticeLinkCanonical<D>> for LatticeLink<D>
impl<const D: usize> From<LatticeLinkCanonical<D>> for LatticeLink<D>
source§fn from(l: LatticeLinkCanonical<D>) -> Self
fn from(l: LatticeLinkCanonical<D>) -> Self
Converts to this type from the input type.
source§impl<const D: usize> Hash for LatticeLink<D>
impl<const D: usize> Hash for LatticeLink<D>
source§impl<const D: usize> PartialEq<LatticeLink<D>> for LatticeLink<D>
impl<const D: usize> PartialEq<LatticeLink<D>> for LatticeLink<D>
source§fn eq(&self, other: &LatticeLink<D>) -> bool
fn eq(&self, other: &LatticeLink<D>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl<const D: usize> Serialize for LatticeLink<D>
impl<const D: usize> Serialize for LatticeLink<D>
impl<const D: usize> Copy for LatticeLink<D>
impl<const D: usize> Eq for LatticeLink<D>
impl<const D: usize> StructuralEq for LatticeLink<D>
impl<const D: usize> StructuralPartialEq for LatticeLink<D>
Auto Trait Implementations§
impl<const D: usize> RefUnwindSafe for LatticeLink<D>
impl<const D: usize> Send for LatticeLink<D>
impl<const D: usize> Sync for LatticeLink<D>
impl<const D: usize> Unpin for LatticeLink<D>
impl<const D: usize> UnwindSafe for LatticeLink<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>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read more§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).§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.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.