From 7dad83794da1a4291bea11998c266298bca04703 Mon Sep 17 00:00:00 2001 From: Bruce Mitchener Date: Tue, 29 Oct 2024 14:22:35 +0700 Subject: [PATCH] Fix some typos. --- benches/core/vector.rs | 2 +- benches/lib.rs | 2 +- benches/linalg/schur.rs | 12 ++++++------ benches/linalg/svd.rs | 24 ++++++++++++------------ benches/linalg/symmetric_eigen.rs | 6 +++--- nalgebra-sparse/tests/unit_tests/coo.rs | 2 +- src/base/storage.rs | 2 +- src/geometry/rotation_specialization.rs | 2 +- tests/geometry/quaternion.rs | 2 +- 9 files changed, 27 insertions(+), 27 deletions(-) diff --git a/benches/core/vector.rs b/benches/core/vector.rs index 66025bc51..6d5dbdc41 100644 --- a/benches/core/vector.rs +++ b/benches/core/vector.rs @@ -96,7 +96,7 @@ fn vec10000_axpy_f64_static(bh: &mut criterion::Criterion) { let b = SVector::::new_random(); let n = rng.gen::(); - // NOTE: for some reasons, it is much faster if the arument are boxed (Box::new(OVector...)). + // NOTE: for some reasons, it is much faster if the argument are boxed (Box::new(OVector...)). bh.bench_function("vec10000_axpy_f64_static", move |bh| { bh.iter(|| a.axpy(n, &b, 1.0)) }); diff --git a/benches/lib.rs b/benches/lib.rs index d0ade4b95..48633317d 100644 --- a/benches/lib.rs +++ b/benches/lib.rs @@ -14,7 +14,7 @@ pub mod core; pub mod geometry; pub mod linalg; -fn reproductible_dmatrix(nrows: usize, ncols: usize) -> DMatrix { +fn reproducible_dmatrix(nrows: usize, ncols: usize) -> DMatrix { use rand::SeedableRng; let mut rng = IsaacRng::seed_from_u64(0); DMatrix::::from_fn(nrows, ncols, |_, _| rng.gen()) diff --git a/benches/linalg/schur.rs b/benches/linalg/schur.rs index 2014f1451..4acfa5fb2 100644 --- a/benches/linalg/schur.rs +++ b/benches/linalg/schur.rs @@ -8,21 +8,21 @@ fn schur_decompose_4x4(bh: &mut criterion::Criterion) { } fn schur_decompose_10x10(bh: &mut criterion::Criterion) { - let m = crate::reproductible_dmatrix(10, 10); + let m = crate::reproducible_dmatrix(10, 10); bh.bench_function("schur_decompose_10x10", move |bh| { bh.iter(|| std::hint::black_box(Schur::new(m.clone()))) }); } fn schur_decompose_100x100(bh: &mut criterion::Criterion) { - let m = crate::reproductible_dmatrix(100, 100); + let m = crate::reproducible_dmatrix(100, 100); bh.bench_function("schur_decompose_100x100", move |bh| { bh.iter(|| std::hint::black_box(Schur::new(m.clone()))) }); } fn schur_decompose_200x200(bh: &mut criterion::Criterion) { - let m = crate::reproductible_dmatrix(200, 200); + let m = crate::reproducible_dmatrix(200, 200); bh.bench_function("schur_decompose_200x200", move |bh| { bh.iter(|| std::hint::black_box(Schur::new(m.clone()))) }); @@ -36,21 +36,21 @@ fn eigenvalues_4x4(bh: &mut criterion::Criterion) { } fn eigenvalues_10x10(bh: &mut criterion::Criterion) { - let m = crate::reproductible_dmatrix(10, 10); + let m = crate::reproducible_dmatrix(10, 10); bh.bench_function("eigenvalues_10x10", move |bh| { bh.iter(|| std::hint::black_box(m.complex_eigenvalues())) }); } fn eigenvalues_100x100(bh: &mut criterion::Criterion) { - let m = crate::reproductible_dmatrix(100, 100); + let m = crate::reproducible_dmatrix(100, 100); bh.bench_function("eigenvalues_100x100", move |bh| { bh.iter(|| std::hint::black_box(m.complex_eigenvalues())) }); } fn eigenvalues_200x200(bh: &mut criterion::Criterion) { - let m = crate::reproductible_dmatrix(200, 200); + let m = crate::reproducible_dmatrix(200, 200); bh.bench_function("eigenvalues_200x200", move |bh| { bh.iter(|| std::hint::black_box(m.complex_eigenvalues())) }); diff --git a/benches/linalg/svd.rs b/benches/linalg/svd.rs index c95e44de1..fe279093f 100644 --- a/benches/linalg/svd.rs +++ b/benches/linalg/svd.rs @@ -22,21 +22,21 @@ fn svd_decompose_4x4(bh: &mut criterion::Criterion) { } fn svd_decompose_10x10(bh: &mut criterion::Criterion) { - let m = crate::reproductible_dmatrix(10, 10); + let m = crate::reproducible_dmatrix(10, 10); bh.bench_function("svd_decompose_10x10", move |bh| { bh.iter(|| std::hint::black_box(SVD::new(m.clone(), true, true))) }); } fn svd_decompose_100x100(bh: &mut criterion::Criterion) { - let m = crate::reproductible_dmatrix(100, 100); + let m = crate::reproducible_dmatrix(100, 100); bh.bench_function("svd_decompose_100x100", move |bh| { bh.iter(|| std::hint::black_box(SVD::new(m.clone(), true, true))) }); } fn svd_decompose_200x200(bh: &mut criterion::Criterion) { - let m = crate::reproductible_dmatrix(200, 200); + let m = crate::reproducible_dmatrix(200, 200); bh.bench_function("svd_decompose_200x200", move |bh| { bh.iter(|| std::hint::black_box(SVD::new(m.clone(), true, true))) }); @@ -50,21 +50,21 @@ fn rank_4x4(bh: &mut criterion::Criterion) { } fn rank_10x10(bh: &mut criterion::Criterion) { - let m = crate::reproductible_dmatrix(10, 10); + let m = crate::reproducible_dmatrix(10, 10); bh.bench_function("rank_10x10", move |bh| { bh.iter(|| std::hint::black_box(m.rank(1.0e-10))) }); } fn rank_100x100(bh: &mut criterion::Criterion) { - let m = crate::reproductible_dmatrix(100, 100); + let m = crate::reproducible_dmatrix(100, 100); bh.bench_function("rank_100x100", move |bh| { bh.iter(|| std::hint::black_box(m.rank(1.0e-10))) }); } fn rank_200x200(bh: &mut criterion::Criterion) { - let m = crate::reproductible_dmatrix(200, 200); + let m = crate::reproducible_dmatrix(200, 200); bh.bench_function("rank_200x200", move |bh| { bh.iter(|| std::hint::black_box(m.rank(1.0e-10))) }); @@ -78,21 +78,21 @@ fn singular_values_4x4(bh: &mut criterion::Criterion) { } fn singular_values_10x10(bh: &mut criterion::Criterion) { - let m = crate::reproductible_dmatrix(10, 10); + let m = crate::reproducible_dmatrix(10, 10); bh.bench_function("singular_values_10x10", move |bh| { bh.iter(|| std::hint::black_box(m.singular_values())) }); } fn singular_values_100x100(bh: &mut criterion::Criterion) { - let m = crate::reproductible_dmatrix(100, 100); + let m = crate::reproducible_dmatrix(100, 100); bh.bench_function("singular_values_100x100", move |bh| { bh.iter(|| std::hint::black_box(m.singular_values())) }); } fn singular_values_200x200(bh: &mut criterion::Criterion) { - let m = crate::reproductible_dmatrix(200, 200); + let m = crate::reproducible_dmatrix(200, 200); bh.bench_function("singular_values_200x200", move |bh| { bh.iter(|| std::hint::black_box(m.singular_values())) }); @@ -106,21 +106,21 @@ fn pseudo_inverse_4x4(bh: &mut criterion::Criterion) { } fn pseudo_inverse_10x10(bh: &mut criterion::Criterion) { - let m = crate::reproductible_dmatrix(10, 10); + let m = crate::reproducible_dmatrix(10, 10); bh.bench_function("pseudo_inverse_10x10", move |bh| { bh.iter(|| std::hint::black_box(m.clone().pseudo_inverse(1.0e-10))) }); } fn pseudo_inverse_100x100(bh: &mut criterion::Criterion) { - let m = crate::reproductible_dmatrix(100, 100); + let m = crate::reproducible_dmatrix(100, 100); bh.bench_function("pseudo_inverse_100x100", move |bh| { bh.iter(|| std::hint::black_box(m.clone().pseudo_inverse(1.0e-10))) }); } fn pseudo_inverse_200x200(bh: &mut criterion::Criterion) { - let m = crate::reproductible_dmatrix(200, 200); + let m = crate::reproducible_dmatrix(200, 200); bh.bench_function("pseudo_inverse_200x200", move |bh| { bh.iter(|| std::hint::black_box(m.clone().pseudo_inverse(1.0e-10))) }); diff --git a/benches/linalg/symmetric_eigen.rs b/benches/linalg/symmetric_eigen.rs index 07ecc2a2b..10fa2adf8 100644 --- a/benches/linalg/symmetric_eigen.rs +++ b/benches/linalg/symmetric_eigen.rs @@ -8,21 +8,21 @@ fn symmetric_eigen_decompose_4x4(bh: &mut criterion::Criterion) { } fn symmetric_eigen_decompose_10x10(bh: &mut criterion::Criterion) { - let m = crate::reproductible_dmatrix(10, 10); + let m = crate::reproducible_dmatrix(10, 10); bh.bench_function("symmetric_eigen_decompose_10x10", move |bh| { bh.iter(|| std::hint::black_box(SymmetricEigen::new(m.clone()))) }); } fn symmetric_eigen_decompose_100x100(bh: &mut criterion::Criterion) { - let m = crate::reproductible_dmatrix(100, 100); + let m = crate::reproducible_dmatrix(100, 100); bh.bench_function("symmetric_eigen_decompose_100x100", move |bh| { bh.iter(|| std::hint::black_box(SymmetricEigen::new(m.clone()))) }); } fn symmetric_eigen_decompose_200x200(bh: &mut criterion::Criterion) { - let m = crate::reproductible_dmatrix(200, 200); + let m = crate::reproducible_dmatrix(200, 200); bh.bench_function("symmetric_eigen_decompose_200x200", move |bh| { bh.iter(|| std::hint::black_box(SymmetricEigen::new(m.clone()))) }); diff --git a/nalgebra-sparse/tests/unit_tests/coo.rs b/nalgebra-sparse/tests/unit_tests/coo.rs index c3702c492..1dacc7c2a 100644 --- a/nalgebra-sparse/tests/unit_tests/coo.rs +++ b/nalgebra-sparse/tests/unit_tests/coo.rs @@ -298,7 +298,7 @@ fn coo_clear_triplets_valid_entries() { ); coo.clear_triplets(); assert_eq!(coo.triplet_iter().collect::>(), vec![]); - // making sure everyhting works after clearing + // making sure everything works after clearing coo.push(0, 0, 1); coo.push(0, 0, 2); coo.push(2, 2, 3); diff --git a/src/base/storage.rs b/src/base/storage.rs index 708a14402..09bbd553a 100644 --- a/src/base/storage.rs +++ b/src/base/storage.rs @@ -220,7 +220,7 @@ pub unsafe trait RawStorageMut: RawStorage { unsafe fn swap_unchecked_linear(&mut self, i1: usize, i2: usize) { // we can't just use the pointers returned from `get_address_unchecked_linear_mut` because calling a // method taking self mutably invalidates any existing (mutable) pointers. since `get_address_unchecked_linear_mut` can - // also be overriden by a custom implementation, we can't just use `wrapping_add` assuming that's what the method does. + // also be overridden by a custom implementation, we can't just use `wrapping_add` assuming that's what the method does. // instead, we use `offset_from` to compute the re-calculate the pointers from the base pointer. // this is sound as long as this trait matches the Validity preconditions // (and it's the caller's responsibility to ensure the indices are in-bounds). diff --git a/src/geometry/rotation_specialization.rs b/src/geometry/rotation_specialization.rs index 45db03528..1aaf7bac1 100644 --- a/src/geometry/rotation_specialization.rs +++ b/src/geometry/rotation_specialization.rs @@ -1124,7 +1124,7 @@ impl Rotation3 { // lambda = 0, so ensure angle2 -> [0, pi] angles[1] < T::zero() || angles[1] > T::pi() } else { - // lamda = + or - pi/2, so ensure angle2 -> [-pi/2, pi/2] + // lambda = + or - pi/2, so ensure angle2 -> [-pi/2, pi/2] angles[1] < -T::frac_pi_2() || angles[1] > T::frac_pi_2() }; diff --git a/tests/geometry/quaternion.rs b/tests/geometry/quaternion.rs index 75d8b870d..ff7eff6cb 100644 --- a/tests/geometry/quaternion.rs +++ b/tests/geometry/quaternion.rs @@ -102,7 +102,7 @@ proptest!( /* * - * Quaterion * Vector == Rotation * Vector + * Quaternion * Vector == Rotation * Vector * */ #[test]