Skip to content

Commit

Permalink
Rel dist macro now correctly uses max_relative (#105)
Browse files Browse the repository at this point in the history
* Rel dist macro now correctly uses max_relative

* Deleted blank line

* Fixed unit test for CI
  • Loading branch information
tbetcke authored Dec 16, 2024
1 parent 68c287c commit 28329d6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/dense/tools.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}};
}
Expand Down
4 changes: 2 additions & 2 deletions tests/array_operations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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!(c64, 1E-14);
mat_mul_test_impl!(c32, 1E-4);
mat_mul_test_impl!(c64, 1E-12);
18 changes: 9 additions & 9 deletions tests/linalg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down Expand Up @@ -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) => {
Expand Down Expand Up @@ -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);

0 comments on commit 28329d6

Please sign in to comment.