From e5acaa2a17d123de3f87c44424c5c3332e051b9a Mon Sep 17 00:00:00 2001 From: Guillaume Fraux Date: Wed, 6 Sep 2023 18:07:34 +0200 Subject: [PATCH] Better validation of cutoff & atomic_gaussian_width --- rascaline/src/calculators/lode/radial_integral/gto.rs | 4 ++-- rascaline/src/calculators/soap/radial_integral/gto.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/rascaline/src/calculators/lode/radial_integral/gto.rs b/rascaline/src/calculators/lode/radial_integral/gto.rs index 408bd8adc..95507a878 100644 --- a/rascaline/src/calculators/lode/radial_integral/gto.rs +++ b/rascaline/src/calculators/lode/radial_integral/gto.rs @@ -31,13 +31,13 @@ impl LodeRadialIntegralGtoParameters { )); } - if self.cutoff < 0.0 || !self.cutoff.is_finite() { + if self.cutoff <= 1e-16 || !self.cutoff.is_finite() { return Err(Error::InvalidParameter( "cutoff must be a positive number for GTO radial integral".into() )); } - if self.atomic_gaussian_width < 0.0 || !self.atomic_gaussian_width.is_finite() { + if self.atomic_gaussian_width <= 1e-16 || !self.atomic_gaussian_width.is_finite() { return Err(Error::InvalidParameter( "atomic_gaussian_width must be a positive number for GTO radial integral".into() )); diff --git a/rascaline/src/calculators/soap/radial_integral/gto.rs b/rascaline/src/calculators/soap/radial_integral/gto.rs index 3d6d60d64..058592b3d 100644 --- a/rascaline/src/calculators/soap/radial_integral/gto.rs +++ b/rascaline/src/calculators/soap/radial_integral/gto.rs @@ -29,13 +29,13 @@ impl SoapRadialIntegralGtoParameters { )); } - if self.cutoff < 0.0 || !self.cutoff.is_finite() { + if self.cutoff <= 1e-16 || !self.cutoff.is_finite() { return Err(Error::InvalidParameter( "cutoff must be a positive number for GTO radial integral".into() )); } - if self.atomic_gaussian_width < 0.0 || !self.atomic_gaussian_width.is_finite() { + if self.atomic_gaussian_width <= 1e-16 || !self.atomic_gaussian_width.is_finite() { return Err(Error::InvalidParameter( "atomic_gaussian_width must be a positive number for GTO radial integral".into() ));