Skip to content

Commit d6023c7

Browse files
committed
rcpr minor changes
1 parent 01e67ae commit d6023c7

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

‎src/bca.rs‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
use super::*;
22
use rand::RngExt;
33

4+
45
#[cfg(feature = "cpr_rootfinder")]
56
const CPR_ROOTFINDER_LOWER_BOUND: f64 = 1e-4;
67

@@ -17,6 +18,8 @@ use rcpr::rootfinders::{
1718
real_polynomial_roots,
1819
Config
1920
};
21+
#[cfg(feature = "cpr_rootfinder")]
22+
use rcpr::chebyshev::ErrorCalc;
2023

2124
/// Geometrical quantities of binary collision.
2225
pub struct BinaryCollisionGeometry {
@@ -606,8 +609,6 @@ fn transform(x: f64, l: f64) -> f64 {
606609
l/(x*PI/2.).tan().powi(2)
607610
}
608611

609-
610-
611612
#[cfg(feature = "cpr_rootfinder")]
612613
/// Computes the distance of closest approach of two particles with atomic numbers `Za`, `Zb` and masses `Ma`, `Mb` for an arbitrary interaction potential (e.g., Morse) for a given impact parameter and incident energy `E0` using the Chebyshev-Proxy Root-Finder method.
613614
///
@@ -655,7 +656,8 @@ pub fn cpr_rootfinder(Za: f64, Zb: f64, Ma: f64, Mb: f64, E0: f64, impact_parame
655656
nmax,
656657
complex_threshold,
657658
far_from_zero,
658-
interval_limit
659+
interval_limit,
660+
ErrorCalc::Relative,
659661
);
660662

661663
let roots = find_roots(&g, vec![(lower_bound, upper_bound)], config)?;

0 commit comments

Comments
 (0)