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
sourcefn mu2_grid(&self) -> Cow<'_, [Mu2]>
fn mu2_grid(&self) -> Cow<'_, [Mu2]>
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.
sourcefn x1_grid(&self) -> Cow<'_, [f64]>
fn x1_grid(&self) -> Cow<'_, [f64]>
Return a slice of values of x1
. If the subgrid does not use a grid, this method should
return an empty slice.
sourcefn x2_grid(&self) -> Cow<'_, [f64]>
fn x2_grid(&self) -> Cow<'_, [f64]>
Return a slice of values of x2
. If the subgrid does not use a grid, this method should
return an empty slice.
sourcefn convolute(
&self,
x1: &[f64],
x2: &[f64],
mu2: &[Mu2],
lumi: &mut dyn FnMut(usize, usize, usize) -> f64
) -> f64
fn convolute(
&self,
x1: &[f64],
x2: &[f64],
mu2: &[Mu2],
lumi: &mut dyn FnMut(usize, usize, usize) -> f64
) -> f64
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
.
sourcefn fill(&mut self, ntuple: &Ntuple<f64>)
fn fill(&mut self, ntuple: &Ntuple<f64>)
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.
sourcefn merge(&mut self, other: &mut SubgridEnum, transpose: bool)
fn merge(&mut self, other: &mut SubgridEnum, transpose: bool)
Merges other
into this subgrid.
sourcefn symmetrize(&mut self)
fn symmetrize(&mut self)
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.
sourcefn clone_empty(&self) -> SubgridEnum
fn clone_empty(&self) -> SubgridEnum
Returns an empty copy of the current subgrid.
sourcefn iter(&self) -> SubgridIter<'_>
fn iter(&self) -> SubgridIter<'_>
Return an iterator over all non-zero elements of the subgrid.