Skip to content

Commit

Permalink
Fix missing tests for nalgebra and ultraviolet
Browse files Browse the repository at this point in the history
  • Loading branch information
Canleskis committed Oct 13, 2024
1 parent f0ac9f3 commit ab3c64b
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 30 deletions.
2 changes: 1 addition & 1 deletion examples/ring-formation/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
40 changes: 20 additions & 20 deletions particular/src/gravity/impls/nalgebra.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,24 +179,24 @@ crate::impl_acceleration_gpu_3d!(SVector<f32, 3>, f32);

#[cfg(test)]
mod tests {
// use super::*;

// #[inline]
// fn div<const D: usize, S>(v1: SVector<S, D>, v2: SVector<S, D>) -> SVector<S, D>
// where
// S: nalgebra::ComplexField,
// {
// v1.component_div(&v2)
// }

// crate::tests_algorithms!(SVector::<f32, 2>, f32, repeat, div, [4, 8], vec2 on cpu and gpu);
// crate::tests_algorithms!(SVector::<f32, 3>, f32, repeat, div, [4, 8], vec3 on cpu and gpu);
// crate::tests_algorithms!(SVector::<f32, 4>, f32, repeat, div, [4, 8],vec4 on cpu);
// crate::tests_algorithms!(SVector::<f32, 5>, f32, repeat, div, [4, 8], vec5 on cpu);
// crate::tests_algorithms!(SVector::<f32, 6>, f32, repeat, div, [4, 8], vec6 on cpu);
// crate::tests_algorithms!(SVector::<f64, 2>, f64, repeat, div, [4], dvec2 on cpu);
// crate::tests_algorithms!(SVector::<f64, 3>, f64, repeat,div, [4], dvec3 on cpu);
// crate::tests_algorithms!(SVector::<f64, 4>,f64, repeat, div, [4], dvec4 on cpu);
// crate::tests_algorithms!(SVector::<f64, 5>, f64, repeat, div, [4], dvec5 on cpu);
// crate::tests_algorithms!(SVector::<f64, 6>, f64, repeat, div, [4], dvec6 on cpu);
use super::*;

#[inline]
fn div<const D: usize, S>(v1: SVector<S, D>, v2: SVector<S, D>) -> SVector<S, D>
where
S: nalgebra::ComplexField,
{
v1.component_div(&v2)
}

crate::tests_algorithms!(SVector::<f32, 2>, f32, repeat, div, [4, 8], vec2 on cpu and gpu);
crate::tests_algorithms!(SVector::<f32, 3>, f32, repeat, div, [4, 8], vec3 on cpu and gpu);
crate::tests_algorithms!(SVector::<f32, 4>, f32, repeat, div, [4, 8],vec4 on cpu);
crate::tests_algorithms!(SVector::<f32, 5>, f32, repeat, div, [4, 8], vec5 on cpu);
crate::tests_algorithms!(SVector::<f32, 6>, f32, repeat, div, [4, 8], vec6 on cpu);
crate::tests_algorithms!(SVector::<f64, 2>, f64, repeat, div, [4], dvec2 on cpu);
crate::tests_algorithms!(SVector::<f64, 3>, f64, repeat, div, [4], dvec3 on cpu);
crate::tests_algorithms!(SVector::<f64, 4>,f64, repeat, div, [4], dvec4 on cpu);
crate::tests_algorithms!(SVector::<f64, 5>, f64, repeat, div, [4], dvec5 on cpu);
crate::tests_algorithms!(SVector::<f64, 6>, f64, repeat, div, [4], dvec6 on cpu);
}
16 changes: 8 additions & 8 deletions particular/src/gravity/impls/ultraviolet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
2 changes: 1 addition & 1 deletion particular/src/tree/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit ab3c64b

Please sign in to comment.