[][src]Struct pineappl::lumi::LumiEntry

pub struct LumiEntry { /* fields omitted */ }

This structure represens an entry of a luminosity function. Each entry consists of a tuple, which contains, in the following order, the PDG id of the first incoming parton, then the PDG id of the second parton, and finally a numerical factor that will multiply the result for this specific combination.

Implementations

impl LumiEntry[src]

#[must_use]pub fn new(entry: Vec<(i32, i32, f64)>) -> Self[src]

Constructor for LumiEntry. Note that entry must be non-empty, otherwise this function panics.

Examples

Ordering of the arguments doesn't matter:

use pineappl::lumi::LumiEntry;

let entry1 = LumiEntry::new(vec![(2, 2, 1.0), (4, 4, 1.0)]);
let entry2 = LumiEntry::new(vec![(4, 4, 1.0), (2, 2, 1.0)]);

// checks that the ordering doesn't matter
assert_eq!(entry1, entry2);

Panics

Creating an entry with content panics:

This example panics
use pineappl::lumi::LumiEntry;

let _ = LumiEntry::new(vec![]);

#[must_use]pub fn equal_after_sort(lhs: &[Self], rhs: &[Self]) -> bool[src]

Compares two vectors of LumiEntry for equality after sorting them.

#[must_use]pub fn entry(&self) -> &[(i32, i32, f64)][src]

Returns a tuple representation of this entry.

Examples

use pineappl::lumi_entry;
use pineappl::lumi::LumiEntry;

let entry = lumi_entry![4, 4, 1.0; 2, 2, 1.0];

assert_eq!(entry.entry(), [(2, 2, 1.0), (4, 4, 1.0)]);

Trait Implementations

impl Clone for LumiEntry[src]

impl Debug for LumiEntry[src]

impl<'de> Deserialize<'de> for LumiEntry[src]

impl PartialEq<LumiEntry> for LumiEntry[src]

impl PartialOrd<LumiEntry> for LumiEntry[src]

impl Serialize for LumiEntry[src]

impl StructuralPartialEq for LumiEntry[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.