Skip to content

Commit

Permalink
Fix some typos. (#1428)
Browse files Browse the repository at this point in the history
  • Loading branch information
waywardmonkeys authored Oct 29, 2024
1 parent ed9d9cc commit 0183803
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 27 deletions.
2 changes: 1 addition & 1 deletion benches/core/vector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ fn vec10000_axpy_f64_static(bh: &mut criterion::Criterion) {
let b = SVector::<f64, 10000>::new_random();
let n = rng.gen::<f64>();

// 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))
});
Expand Down
2 changes: 1 addition & 1 deletion benches/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pub mod core;
pub mod geometry;
pub mod linalg;

fn reproductible_dmatrix(nrows: usize, ncols: usize) -> DMatrix<f64> {
fn reproducible_dmatrix(nrows: usize, ncols: usize) -> DMatrix<f64> {
use rand::SeedableRng;
let mut rng = IsaacRng::seed_from_u64(0);
DMatrix::<f64>::from_fn(nrows, ncols, |_, _| rng.gen())
Expand Down
12 changes: 6 additions & 6 deletions benches/linalg/schur.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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())))
});
Expand All @@ -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()))
});
Expand Down
24 changes: 12 additions & 12 deletions benches/linalg/svd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
});
Expand All @@ -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)))
});
Expand All @@ -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()))
});
Expand All @@ -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)))
});
Expand Down
6 changes: 3 additions & 3 deletions benches/linalg/symmetric_eigen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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())))
});
Expand Down
2 changes: 1 addition & 1 deletion nalgebra-sparse/tests/unit_tests/coo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ fn coo_clear_triplets_valid_entries() {
);
coo.clear_triplets();
assert_eq!(coo.triplet_iter().collect::<Vec<_>>(), 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);
Expand Down
2 changes: 1 addition & 1 deletion src/base/storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ pub unsafe trait RawStorageMut<T, R: Dim, C: Dim = U1>: RawStorage<T, R, C> {
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).
Expand Down
2 changes: 1 addition & 1 deletion src/geometry/rotation_specialization.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1124,7 +1124,7 @@ impl<T: SimdRealField> Rotation3<T> {
// 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()
};

Expand Down
2 changes: 1 addition & 1 deletion tests/geometry/quaternion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ proptest!(

/*
*
* Quaterion * Vector == Rotation * Vector
* Quaternion * Vector == Rotation * Vector
*
*/
#[test]
Expand Down

0 comments on commit 0183803

Please sign in to comment.