From 86bde5ff1dcc4b37e84bbbedc412a5fe505ae713 Mon Sep 17 00:00:00 2001 From: Moritz Hedtke Date: Mon, 21 Aug 2023 21:40:12 +0000 Subject: [PATCH 1/3] Implement `Clone` for `CsrTripletIter` and `CscTripletIter` --- nalgebra-sparse/src/csc.rs | 9 +++++++++ nalgebra-sparse/src/csr.rs | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/nalgebra-sparse/src/csc.rs b/nalgebra-sparse/src/csc.rs index 8d6615a9..de4af43d 100644 --- a/nalgebra-sparse/src/csc.rs +++ b/nalgebra-sparse/src/csc.rs @@ -625,6 +625,15 @@ pub struct CscTripletIter<'a, T> { values_iter: Iter<'a, T>, } +impl<'a, T> Clone for CscTripletIter<'a, T> { + fn clone(&self) -> Self { + CscTripletIter { + pattern_iter: self.pattern_iter.clone(), + values_iter: self.values_iter.clone(), + } + } +} + impl<'a, T: Clone> CscTripletIter<'a, T> { /// Adapts the triplet iterator to return owned values. /// diff --git a/nalgebra-sparse/src/csr.rs b/nalgebra-sparse/src/csr.rs index d31c86b0..7a38aeeb 100644 --- a/nalgebra-sparse/src/csr.rs +++ b/nalgebra-sparse/src/csr.rs @@ -626,6 +626,15 @@ pub struct CsrTripletIter<'a, T> { values_iter: Iter<'a, T>, } +impl<'a, T> Clone for CsrTripletIter<'a, T> { + fn clone(&self) -> Self { + CsrTripletIter { + pattern_iter: self.pattern_iter.clone(), + values_iter: self.values_iter.clone(), + } + } +} + impl<'a, T: Clone> CsrTripletIter<'a, T> { /// Adapts the triplet iterator to return owned values. /// From bbac38b2f5056b3b1ba6e2e436ff8525ee90dbfc Mon Sep 17 00:00:00 2001 From: Joona Aalto Date: Sat, 27 Jan 2024 21:11:47 +0200 Subject: [PATCH 2/3] Support Glam 0.25 type conversion --- CHANGELOG.md | 1 + Cargo.toml | 2 ++ src/third_party/glam/mod.rs | 2 ++ src/third_party/glam/v025/mod.rs | 18 ++++++++++++++++++ 4 files changed, 23 insertions(+) create mode 100644 src/third_party/glam/v025/mod.rs diff --git a/CHANGELOG.md b/CHANGELOG.md index f92dfffb..28beb9cc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ This project adheres to [Semantic Versioning](https://semver.org/). - Add the methods `Matrix1::as_scalar`, `::as_scalar_mut`, `::to_scalar`, `::into_scalar`. - Add `Rotation3::euler_angles_ordered`, a generalized euler angles calculation. - Add the `glam-0.24` feature to enable conversion from/to types from `glam` v0.24. +- Add the `glam-0.25` feature to enable conversion from/to types from `glam` v0.25. - Add the `lerp` method to points. - Implement `Clone` for `MatrixIter`. diff --git a/Cargo.toml b/Cargo.toml index 16551aa1..2e31b1ec 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -48,6 +48,7 @@ convert-glam021 = [ "glam021" ] convert-glam022 = [ "glam022" ] convert-glam023 = [ "glam023" ] convert-glam024 = [ "glam024" ] +convert-glam025 = [ "glam025" ] # Serialization ## To use serde in a #[no-std] environment, enable the @@ -103,6 +104,7 @@ glam021 = { package = "glam", version = "0.21", optional = true } glam022 = { package = "glam", version = "0.22", optional = true } glam023 = { package = "glam", version = "0.23", optional = true } glam024 = { package = "glam", version = "0.24", optional = true } +glam025 = { package = "glam", version = "0.25", optional = true } rayon = { version = "1.6", optional = true } [dev-dependencies] diff --git a/src/third_party/glam/mod.rs b/src/third_party/glam/mod.rs index b868817a..680e65e5 100644 --- a/src/third_party/glam/mod.rs +++ b/src/third_party/glam/mod.rs @@ -20,3 +20,5 @@ mod v022; mod v023; #[cfg(feature = "glam024")] mod v024; +#[cfg(feature = "glam025")] +mod v025; diff --git a/src/third_party/glam/v025/mod.rs b/src/third_party/glam/v025/mod.rs new file mode 100644 index 00000000..b9f41e34 --- /dev/null +++ b/src/third_party/glam/v025/mod.rs @@ -0,0 +1,18 @@ +#[path = "../common/glam_isometry.rs"] +mod glam_isometry; +#[path = "../common/glam_matrix.rs"] +mod glam_matrix; +#[path = "../common/glam_point.rs"] +mod glam_point; +#[path = "../common/glam_quaternion.rs"] +mod glam_quaternion; +#[path = "../common/glam_rotation.rs"] +mod glam_rotation; +#[path = "../common/glam_similarity.rs"] +mod glam_similarity; +#[path = "../common/glam_translation.rs"] +mod glam_translation; +#[path = "../common/glam_unit_complex.rs"] +mod glam_unit_complex; + +pub(self) use glam025 as glam; From cf44429837fd508ae94d2afa29f0b1f85ae5a998 Mon Sep 17 00:00:00 2001 From: Yotam Ofek Date: Wed, 20 Mar 2024 13:12:01 +0000 Subject: [PATCH 3/3] Fix redundant import errors in `nalgebra-glm` More fallout from https://github.com/rust-lang/rust/issues/121708 Should make CI green again --- nalgebra-glm/src/ext/quaternion_common.rs | 2 +- nalgebra-glm/src/traits.rs | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/nalgebra-glm/src/ext/quaternion_common.rs b/nalgebra-glm/src/ext/quaternion_common.rs index 44b4a5bf..b1e10f74 100644 --- a/nalgebra-glm/src/ext/quaternion_common.rs +++ b/nalgebra-glm/src/ext/quaternion_common.rs @@ -1,4 +1,4 @@ -use na::{self, Unit}; +use na::Unit; use crate::aliases::Qua; use crate::RealNumber; diff --git a/nalgebra-glm/src/traits.rs b/nalgebra-glm/src/traits.rs index ccdb4a02..3d919eb1 100644 --- a/nalgebra-glm/src/traits.rs +++ b/nalgebra-glm/src/traits.rs @@ -1,7 +1,6 @@ use approx::AbsDiffEq; use num::{Bounded, Signed}; -use core::cmp::PartialOrd; use na::Scalar; use simba::scalar::{ClosedAdd, ClosedMul, ClosedSub, RealField};