Skip to content

Commit

Permalink
Do not evolve the same Q2 slice more than once
Browse files Browse the repository at this point in the history
  • Loading branch information
cschwan committed Aug 30, 2024
1 parent 7085e51 commit 38fc97d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pineappl/src/evolution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use ndarray::{s, Array1, Array2, Array3, ArrayView1, ArrayView4, Axis};
use std::iter;

/// Number of ULPS used to de-duplicate grid values in [`Grid::evolve_info`].
pub(crate) const EVOLVE_INFO_TOL_ULPS: i64 = 64;
pub(crate) const EVOLVE_INFO_TOL_ULPS: i64 = 256;

/// Number of ULPS used to search for grid values in this module. This value must be a large-enough
/// multiple of [`EVOLVE_INFO_TOL_ULPS`], because otherwise similar values are not found in
Expand Down
18 changes: 18 additions & 0 deletions pineappl/src/grid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1418,6 +1418,15 @@ impl Grid {

op_fac1.push(info.fac1);

// it's possible that due to small numerical differences we get two slices which are
// almost the same. We have to skip those in order not to evolve the 'same' slice twice
if used_op_fac1
.iter()
.any(|&fac| approx_eq!(f64, fac, info.fac1, ulps = EVOLVE_INFO_TOL_ULPS))
{
continue;
}

// skip slices that the grid doesn't use
if !grid_fac1
.iter()
Expand Down Expand Up @@ -1543,6 +1552,15 @@ impl Grid {

op_fac1.push(info_a.fac1);

// it's possible that due to small numerical differences we get two slices which are
// almost the same. We have to skip those in order not to evolve the 'same' slice twice
if used_op_fac1
.iter()
.any(|&fac| approx_eq!(f64, fac, info_a.fac1, ulps = EVOLVE_INFO_TOL_ULPS))
{
continue;
}

// skip slices that the grid doesn't use
if !grid_fac1
.iter()
Expand Down

0 comments on commit 38fc97d

Please sign in to comment.