From e6177cf4c0337540fe1295fb79034a090b582862 Mon Sep 17 00:00:00 2001 From: Timo Betcke Date: Mon, 16 Dec 2024 11:44:45 +0000 Subject: [PATCH 1/3] Rel dist macro now correctly uses max_relative --- src/dense/tools.rs | 2 +- src/sparse/distributed_vector.rs | 1 + tests/array_operations.rs | 2 +- tests/linalg.rs | 18 +++++++++--------- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/dense/tools.rs b/src/dense/tools.rs index 23bb9622..07c8a525 100644 --- a/src/dense/tools.rs +++ b/src/dense/tools.rs @@ -109,7 +109,7 @@ macro_rules! assert_array_relative_eq { use approx::assert_relative_eq; assert_eq!($expected_array.shape(), $actual_array.shape()); for (actual, expected) in $actual_array.iter().zip($expected_array.iter()) { - assert_relative_eq!(actual, expected, epsilon = $epsilon); + assert_relative_eq!(actual, expected, max_relative = $epsilon); } }}; } diff --git a/src/sparse/distributed_vector.rs b/src/sparse/distributed_vector.rs index b4c35c1c..bc6340ca 100644 --- a/src/sparse/distributed_vector.rs +++ b/src/sparse/distributed_vector.rs @@ -58,6 +58,7 @@ impl<'a, Layout: IndexLayout, Item: RlstScalar + Equivalence> DistributedVector< global_result } + /// Gather `Self` to all processes and store in `arr`. pub fn gather_to_all< ArrayImpl: UnsafeRandomAccessByValue<1, Item = Item> diff --git a/tests/array_operations.rs b/tests/array_operations.rs index a9bc3aed..1ed3e238 100644 --- a/tests/array_operations.rs +++ b/tests/array_operations.rs @@ -563,4 +563,4 @@ fn test_integer_array() { mat_mul_test_impl!(f64, 1E-14); mat_mul_test_impl!(f32, 1E-5); mat_mul_test_impl!(c32, 1E-5); -mat_mul_test_impl!(c64, 1E-14); +mat_mul_test_impl!(c64, 1E-12); diff --git a/tests/linalg.rs b/tests/linalg.rs index bfc923e5..b7feb341 100644 --- a/tests/linalg.rs +++ b/tests/linalg.rs @@ -162,7 +162,7 @@ macro_rules! impl_lu_tests { impl_lu_tests!(f64, 1E-12); impl_lu_tests!(f32, 1E-5); impl_lu_tests!(c64, 1E-12); -impl_lu_tests!(c32, 1E-5); +impl_lu_tests!(c32, 1E-4); macro_rules! impl_pinv_tests { ($scalar:ty, $tol:expr) => { @@ -322,10 +322,10 @@ macro_rules! implement_qr_tests { }; } -implement_qr_tests!(f32, 1E-6); -implement_qr_tests!(f64, 1E-12); -implement_qr_tests!(c32, 1E-6); -implement_qr_tests!(c64, 1E-12); +implement_qr_tests!(f32, 1E-5); +implement_qr_tests!(f64, 1E-10); +implement_qr_tests!(c32, 1E-4); +implement_qr_tests!(c64, 1E-10); macro_rules! impl_tests { ($scalar:ty, $tol:expr) => { @@ -443,7 +443,7 @@ macro_rules! impl_tests { }; } -impl_tests!(f32, 1E-5); -impl_tests!(f64, 1E-12); -impl_tests!(c32, 1E-5); -impl_tests!(c64, 1E-12); +impl_tests!(f32, 1E-4); +impl_tests!(f64, 1E-11); +impl_tests!(c32, 1E-4); +impl_tests!(c64, 1E-10); From 6ef81133a5af52c7292562721ec81572644e91b0 Mon Sep 17 00:00:00 2001 From: Timo Betcke Date: Mon, 16 Dec 2024 11:58:53 +0000 Subject: [PATCH 2/3] Deleted blank line --- src/sparse/distributed_vector.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/sparse/distributed_vector.rs b/src/sparse/distributed_vector.rs index bc6340ca..b4c35c1c 100644 --- a/src/sparse/distributed_vector.rs +++ b/src/sparse/distributed_vector.rs @@ -58,7 +58,6 @@ impl<'a, Layout: IndexLayout, Item: RlstScalar + Equivalence> DistributedVector< global_result } - /// Gather `Self` to all processes and store in `arr`. pub fn gather_to_all< ArrayImpl: UnsafeRandomAccessByValue<1, Item = Item> From 9c4543de356797fe14dbb661732bae700e916bb1 Mon Sep 17 00:00:00 2001 From: Timo Betcke Date: Mon, 16 Dec 2024 12:54:38 +0000 Subject: [PATCH 3/3] Fixed unit test for CI --- tests/array_operations.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/array_operations.rs b/tests/array_operations.rs index 1ed3e238..6ccd3aec 100644 --- a/tests/array_operations.rs +++ b/tests/array_operations.rs @@ -562,5 +562,5 @@ fn test_integer_array() { mat_mul_test_impl!(f64, 1E-14); mat_mul_test_impl!(f32, 1E-5); -mat_mul_test_impl!(c32, 1E-5); +mat_mul_test_impl!(c32, 1E-4); mat_mul_test_impl!(c64, 1E-12);