Skip to content

Commit ec86625

Browse files
committed
Apply more maxes to URRs.
1 parent 5096f05 commit ec86625

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/majorant.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,9 @@ double NeutronMajorant::calculate_max_urr_xs(
343343
max_urr_xs_E1 =
344344
std::max(max_urr_xs_E1, urr.xs_values_(i_energy + 1, i_cdf).total);
345345
}
346+
// Handle the rare case where the points could be negative.
347+
max_urr_xs_E0 = std::max(max_urr_xs_E0, 0.0);
348+
max_urr_xs_E1 = std::max(max_urr_xs_E1, 0.0);
346349

347350
// Interpolate the bounding energy points.
348351
double interp_urr_xs = 0.0;
@@ -359,7 +362,7 @@ double NeutronMajorant::calculate_max_urr_xs(
359362
interp_urr_xs *= smooth_xs;
360363
}
361364

362-
max_urr_xs = std::max(max_urr_xs, interp_urr_xs);
365+
max_urr_xs = std::max({max_urr_xs, interp_urr_xs, smooth_xs});
363366
}
364367

365368
return max_urr_xs;

0 commit comments

Comments
 (0)