pub trait Subgrid {
    fn mu2_grid(&self) -> Cow<'_, [Mu2]>;
    fn x1_grid(&self) -> Cow<'_, [f64]>;
    fn x2_grid(&self) -> Cow<'_, [f64]>;
    fn convolute(
        &self,
        x1: &[f64],
        x2: &[f64],
        mu2: &[Mu2],
        lumi: &mut dyn FnMut(usize, usize, usize) -> f64
    ) -> f64; fn fill(&mut self, ntuple: &Ntuple<f64>); fn is_empty(&self) -> bool; fn merge(&mut self, other: &mut SubgridEnum, transpose: bool); fn scale(&mut self, factor: f64); fn symmetrize(&mut self); fn clone_empty(&self) -> SubgridEnum; fn iter(&self) -> SubgridIter<'_>; fn stats(&self) -> Stats; }
Expand description

Trait each subgrid must implement.

Required Methods

Return a slice of Mu2 values corresponding to the (squared) renormalization and factorization values of the grid. If the subgrid does not use a grid, this method should return an empty slice.

Return a slice of values of x1. If the subgrid does not use a grid, this method should return an empty slice.

Return a slice of values of x2. If the subgrid does not use a grid, this method should return an empty slice.

Convolute the subgrid with a luminosity function, which takes indices as arguments that correspond to the entries given in the slices x1, x2 and mu2.

Fills the subgrid with weight for the parton momentum fractions x1 and x2, and the scale q2. Filling is currently only support where both renormalization and factorization scale have the same value.

Returns true if fill was never called for this grid.

Merges other into this subgrid.

Scale the subgrid by factor.

Assumes that the initial states for this grid are the same and uses this to optimize the grid by getting rid of almost half of the entries.

Returns an empty copy of the current subgrid.

Return an iterator over all non-zero elements of the subgrid.

Return statistics for this subgrid.

Implementors