pub struct FourVector { /* private fields */ }Expand description
A basic four-vector
The zero component is the energy/time component. The remainder are the spatial components
Implementations§
Source§impl FourVector
impl FourVector
Sourcepub fn euclid_norm(&self) -> N64
pub fn euclid_norm(&self) -> N64
The euclidean norm \sqrt{\sum v_\mu^2} with \mu = 0,1,2,3
Sourcepub fn euclid_norm_sq(&self) -> N64
pub fn euclid_norm_sq(&self) -> N64
The square \sum v_\mu^2 with \mu = 0,1,2,3 of the euclidean norm
Sourcepub fn spatial_norm(&self) -> N64
pub fn spatial_norm(&self) -> N64
The spatial norm \sqrt{\sum v_i^2} with i = 1,2,3
Sourcepub fn spatial_norm_sq(&self) -> N64
pub fn spatial_norm_sq(&self) -> N64
The square \sum v_i^2 with i = 1,2,3 of the spatial norm
Trait Implementations§
Source§impl Add for FourVector
impl Add for FourVector
Source§type Output = FourVector
type Output = FourVector
The resulting type after applying the
+ operator.Source§impl AddAssign for FourVector
impl AddAssign for FourVector
Source§fn add_assign(&mut self, rhs: FourVector)
fn add_assign(&mut self, rhs: FourVector)
Performs the
+= operation. Read moreSource§impl Clone for FourVector
impl Clone for FourVector
Source§fn clone(&self) -> FourVector
fn clone(&self) -> FourVector
Returns a duplicate 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 Debug for FourVector
impl Debug for FourVector
Source§impl Default for FourVector
impl Default for FourVector
Source§fn default() -> FourVector
fn default() -> FourVector
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for FourVector
impl<'de> Deserialize<'de> for FourVector
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 From<&FourVector> for PseudoJet
impl From<&FourVector> for PseudoJet
Source§fn from(p: &FourVector) -> Self
fn from(p: &FourVector) -> Self
Converts to this type from the input type.
Source§impl From<[NoisyFloat<f64, NumChecker>; 4]> for FourVector
impl From<[NoisyFloat<f64, NumChecker>; 4]> for FourVector
Source§impl From<FourVector> for PseudoJet
impl From<FourVector> for PseudoJet
Source§fn from(p: FourVector) -> Self
fn from(p: FourVector) -> Self
Converts to this type from the input type.
Source§impl From<PseudoJet> for FourVector
impl From<PseudoJet> for FourVector
Source§impl Index<usize> for FourVector
impl Index<usize> for FourVector
Source§impl Ord for FourVector
impl Ord for FourVector
Source§fn cmp(&self, other: &FourVector) -> Ordering
fn cmp(&self, other: &FourVector) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for FourVector
impl PartialEq for FourVector
Source§impl PartialOrd for FourVector
impl PartialOrd for FourVector
Source§impl Serialize for FourVector
impl Serialize for FourVector
Source§impl Sub for FourVector
impl Sub for FourVector
Source§type Output = FourVector
type Output = FourVector
The resulting type after applying the
- operator.Source§impl SubAssign for FourVector
impl SubAssign for FourVector
Source§fn sub_assign(&mut self, rhs: FourVector)
fn sub_assign(&mut self, rhs: FourVector)
Performs the
-= operation. Read moreimpl Copy for FourVector
impl Eq for FourVector
impl StructuralPartialEq for FourVector
Auto Trait Implementations§
impl Freeze for FourVector
impl RefUnwindSafe for FourVector
impl Send for FourVector
impl Sync for FourVector
impl Unpin for FourVector
impl UnwindSafe for FourVector
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<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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 more