From ab3c64b1668e632b1b3ddf2e3ad81be777a0d413 Mon Sep 17 00:00:00 2001 From: Canleskis <91223490+Canleskis@users.noreply.github.com> Date: Sun, 13 Oct 2024 10:37:22 +0200 Subject: [PATCH] Fix missing tests for `nalgebra` and `ultraviolet` --- examples/ring-formation/Cargo.toml | 2 +- particular/src/gravity/impls/nalgebra.rs | 40 ++++++++++----------- particular/src/gravity/impls/ultraviolet.rs | 16 ++++----- particular/src/tree/mod.rs | 2 +- 4 files changed, 30 insertions(+), 30 deletions(-) diff --git a/examples/ring-formation/Cargo.toml b/examples/ring-formation/Cargo.toml index e5c0767..a15c382 100644 --- a/examples/ring-formation/Cargo.toml +++ b/examples/ring-formation/Cargo.toml @@ -6,7 +6,7 @@ version.workspace = true license.workspace = true [dependencies] -particular = { path = "../../particular", features = ["glam"]} +particular = { path = "../../particular", features = ["glam"] } bevy = "0.12.1" bevy_rapier3d = { version = "0.23", features = ["simd-stable"] } bevy_egui = "0.24" diff --git a/particular/src/gravity/impls/nalgebra.rs b/particular/src/gravity/impls/nalgebra.rs index e131271..dacffcc 100644 --- a/particular/src/gravity/impls/nalgebra.rs +++ b/particular/src/gravity/impls/nalgebra.rs @@ -179,24 +179,24 @@ crate::impl_acceleration_gpu_3d!(SVector, f32); #[cfg(test)] mod tests { - // use super::*; - - // #[inline] - // fn div(v1: SVector, v2: SVector) -> SVector - // where - // S: nalgebra::ComplexField, - // { - // v1.component_div(&v2) - // } - - // crate::tests_algorithms!(SVector::, f32, repeat, div, [4, 8], vec2 on cpu and gpu); - // crate::tests_algorithms!(SVector::, f32, repeat, div, [4, 8], vec3 on cpu and gpu); - // crate::tests_algorithms!(SVector::, f32, repeat, div, [4, 8],vec4 on cpu); - // crate::tests_algorithms!(SVector::, f32, repeat, div, [4, 8], vec5 on cpu); - // crate::tests_algorithms!(SVector::, f32, repeat, div, [4, 8], vec6 on cpu); - // crate::tests_algorithms!(SVector::, f64, repeat, div, [4], dvec2 on cpu); - // crate::tests_algorithms!(SVector::, f64, repeat,div, [4], dvec3 on cpu); - // crate::tests_algorithms!(SVector::,f64, repeat, div, [4], dvec4 on cpu); - // crate::tests_algorithms!(SVector::, f64, repeat, div, [4], dvec5 on cpu); - // crate::tests_algorithms!(SVector::, f64, repeat, div, [4], dvec6 on cpu); + use super::*; + + #[inline] + fn div(v1: SVector, v2: SVector) -> SVector + where + S: nalgebra::ComplexField, + { + v1.component_div(&v2) + } + + crate::tests_algorithms!(SVector::, f32, repeat, div, [4, 8], vec2 on cpu and gpu); + crate::tests_algorithms!(SVector::, f32, repeat, div, [4, 8], vec3 on cpu and gpu); + crate::tests_algorithms!(SVector::, f32, repeat, div, [4, 8],vec4 on cpu); + crate::tests_algorithms!(SVector::, f32, repeat, div, [4, 8], vec5 on cpu); + crate::tests_algorithms!(SVector::, f32, repeat, div, [4, 8], vec6 on cpu); + crate::tests_algorithms!(SVector::, f64, repeat, div, [4], dvec2 on cpu); + crate::tests_algorithms!(SVector::, f64, repeat, div, [4], dvec3 on cpu); + crate::tests_algorithms!(SVector::,f64, repeat, div, [4], dvec4 on cpu); + crate::tests_algorithms!(SVector::, f64, repeat, div, [4], dvec5 on cpu); + crate::tests_algorithms!(SVector::, f64, repeat, div, [4], dvec6 on cpu); } diff --git a/particular/src/gravity/impls/ultraviolet.rs b/particular/src/gravity/impls/ultraviolet.rs index 621a095..849d8b5 100644 --- a/particular/src/gravity/impls/ultraviolet.rs +++ b/particular/src/gravity/impls/ultraviolet.rs @@ -94,13 +94,13 @@ crate::impl_acceleration_gpu_3d!(Vec3, f32); #[cfg(test)] mod tests { - // use super::*; - // use std::ops::Div; + use super::*; + use std::ops::Div; - // crate::tests_algorithms!(Vec2, f32, broadcast, Div::div, [4, 8], vec2 on cpu and gpu); - // crate::tests_algorithms!(Vec3, f32, broadcast, Div::div, [4, 8], vec3 on cpu and gpu); - // crate::tests_algorithms!(Vec4, f32, broadcast, Div::div, [4, 8], vec4 on cpu); - // crate::tests_algorithms!(DVec2, f64, broadcast, Div::div, [2, 4], dvec2 on cpu); - // crate::tests_algorithms!(DVec3, f64, broadcast, Div::div, [2, 4], dvec3 on cpu); - // crate::tests_algorithms!(DVec4, f64, broadcast, Div::div, [2, 4], dvec4 on cpu); + crate::tests_algorithms!(Vec2, f32, broadcast, Div::div, [4, 8], vec2 on cpu and gpu); + crate::tests_algorithms!(Vec3, f32, broadcast, Div::div, [4, 8], vec3 on cpu and gpu); + crate::tests_algorithms!(Vec4, f32, broadcast, Div::div, [4, 8], vec4 on cpu); + crate::tests_algorithms!(DVec2, f64, broadcast, Div::div, [2, 4], dvec2 on cpu); + crate::tests_algorithms!(DVec3, f64, broadcast, Div::div, [2, 4], dvec3 on cpu); + crate::tests_algorithms!(DVec4, f64, broadcast, Div::div, [2, 4], dvec4 on cpu); } diff --git a/particular/src/tree/mod.rs b/particular/src/tree/mod.rs index f1f1327..85a2dd4 100644 --- a/particular/src/tree/mod.rs +++ b/particular/src/tree/mod.rs @@ -5,7 +5,7 @@ use std::ops::{Add, Sub}; pub use partition::*; -/// Index of a [`Node`] in a [`Graph`]. +/// Index of a [`Node`] in a [`Tree`]. pub type NodeID = u32; /// Generic tree data structure.