diff --git a/CHANGELOG.md b/CHANGELOG.md index 124c32ad..a9aeda37 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -130,7 +130,7 @@ This adds support for serialization using the Pure Rust implementation of some Blas operations: - * `.iamax()` retuns the index of the maximum value of a vector. + * `.iamax()` returns the index of the maximum value of a vector. * `.axpy(...)` computes `self = a * x + b * self`. * `.gemv(...)` computes `self = alpha * a * x + beta * self` with a matrix and vector `a` and `x`. * `.ger(...)` computes `self = alpha * x^t * y + beta * self` where `x` and `y` are vectors. @@ -367,7 +367,7 @@ crate for vectors, rotations and points. To enable them, activate the ## [0.7.0] ### Added - * Added implementation of assignement operators (+=, -=, etc.) for + * Added implementation of assignment operators (+=, -=, etc.) for everything. ### Modified * Points and vectors are now linked to each other with associated types diff --git a/nalgebra-glm/src/ext/matrix_clip_space.rs b/nalgebra-glm/src/ext/matrix_clip_space.rs index 0795a873..c0f3f128 100644 --- a/nalgebra-glm/src/ext/matrix_clip_space.rs +++ b/nalgebra-glm/src/ext/matrix_clip_space.rs @@ -90,7 +90,7 @@ pub fn ortho(left: N, right: N, bottom: N, top: N, znear: N, zfar: N) - // unimplemented!() //} -/// Creates a matrix for a symetric perspective-view frustum based on the right handedness and OpenGL near and far clip planes definition. +/// Creates a matrix for a symmetric perspective-view frustum based on the right handedness and OpenGL near and far clip planes definition. pub fn perspective(fovy: N, aspect: N, near: N, far: N) -> TMat4 { Perspective3::new(fovy, aspect, near, far).unwrap() } diff --git a/nalgebra-glm/src/ext/matrix_projection.rs b/nalgebra-glm/src/ext/matrix_projection.rs index f07e0c45..5a340e4a 100644 --- a/nalgebra-glm/src/ext/matrix_projection.rs +++ b/nalgebra-glm/src/ext/matrix_projection.rs @@ -64,7 +64,7 @@ pub fn project_zo(obj: &TVec3, model: &TMat4, proj: &TMat4, vi ) } -/// Map the specified window coordinates (win.x, win.y, win.z) into object coordinates using OpengGL near and far clip planes definition. +/// Map the specified window coordinates (win.x, win.y, win.z) into object coordinates using OpenGL near and far clip planes definition. /// /// # Parameters /// * `obj`: Specify the window coordinates to be mapped. @@ -119,4 +119,4 @@ pub fn unproject_zo(win: &TVec3, model: &TMat4, proj: &TMat4, let result = transform * pt; result.fixed_rows::(0) / result.w -} \ No newline at end of file +} diff --git a/nalgebra-glm/src/gtx/rotate_vector.rs b/nalgebra-glm/src/gtx/rotate_vector.rs index 0e248fcf..76dcdbfa 100644 --- a/nalgebra-glm/src/gtx/rotate_vector.rs +++ b/nalgebra-glm/src/gtx/rotate_vector.rs @@ -56,7 +56,7 @@ pub fn rotate_z_vec4(v: &TVec4, angle: N) -> TVec4 { Rotation3::from_axis_angle(&TVec3::z_axis(), angle).to_homogeneous() * v } -/// Computes a spehical linear interpolation between the vectors `x` and `y` assumed to be normalized. +/// Computes a spherical linear interpolation between the vectors `x` and `y` assumed to be normalized. pub fn slerp(x: &TVec3, y: &TVec3, a: N) -> TVec3 { Unit::new_unchecked(*x).slerp(&Unit::new_unchecked(*y), a).unwrap() } diff --git a/nalgebra-glm/src/lib.rs b/nalgebra-glm/src/lib.rs index aff24058..60dbdd14 100644 --- a/nalgebra-glm/src/lib.rs +++ b/nalgebra-glm/src/lib.rs @@ -50,13 +50,13 @@ * Functions operating in 2d will usually end with the `2d` suffix, e.g., `glm::rotade2d` is for 2D while `glm::rotate` is for 3D. * Functions operating on vector will often end with the `_vec` suffix, possibly followed by the dimension of vector, e.g., `glm::rotate_vec2`. * Every function related to quaternions start with the `quat_` prefix, e.g., `glm::quat_dot(q1, q2)`. - * All the conversion functions have unique names as described [bellow](#conversions). + * All the conversion functions have unique names as described [below](#conversions). ### Vector and matrix construction Vectors, matrices, and quaternions can be constructed using several approaches: * Using functions with the same name as their type in lower-case. For example `glm::vec3(x, y, z)` will create a 3D vector. * Using the `::new` constructor. For example `Vec3::new(x, y, z)` will create a 3D vector. * Using the functions prefixed by `make_` to build a vector a matrix from a slice. For example `glm::make_vec3(&[x, y, z])` will create a 3D vector. - Keep in mind that constructing a matrix using this type of funcitons require its components to be arrange in column-major order on the slice. + Keep in mind that constructing a matrix using this type of functions require its components to be arrange in column-major order on the slice. * Using a geometric construction function. For example `glm::rotation(angle, axis)` will build a 4x4 homogeneous rotation matrix from an angle (in radians) and an axis. * Using swizzling and conversions as described in the next sections. ### Swizzling @@ -184,4 +184,4 @@ mod exponential; mod ext; mod gtc; -mod gtx; \ No newline at end of file +mod gtx; diff --git a/nalgebra-lapack/src/cholesky.rs b/nalgebra-lapack/src/cholesky.rs index c76a2676..26d2ef92 100644 --- a/nalgebra-lapack/src/cholesky.rs +++ b/nalgebra-lapack/src/cholesky.rs @@ -11,7 +11,7 @@ use na::{DefaultAllocator, Matrix, MatrixMN, MatrixN, Scalar}; use lapack; -/// The cholesky decomposion of a symmetric-definite-positive matrix. +/// The cholesky decomposition of a symmetric-definite-positive matrix. #[cfg_attr(feature = "serde-serialize", derive(Serialize, Deserialize))] #[cfg_attr( feature = "serde-serialize", @@ -50,7 +50,7 @@ impl Cholesky where DefaultAllocator: Allocator, { - /// Complutes the cholesky decomposition of the given symmetric-definite-positive square + /// Computes the cholesky decomposition of the given symmetric-definite-positive square /// matrix. /// /// Only the lower-triangular part of the input matrix is considered. @@ -183,7 +183,7 @@ where * */ /// Trait implemented by floats (`f32`, `f64`) and complex floats (`Complex`, `Complex`) -/// supported by the cholesky decompotition. +/// supported by the cholesky decomposition. pub trait CholeskyScalar: Scalar { #[allow(missing_docs)] fn xpotrf(uplo: u8, n: i32, a: &mut [Self], lda: i32, info: &mut i32); diff --git a/nalgebra-lapack/src/eigen.rs b/nalgebra-lapack/src/eigen.rs index 4fe74ce3..e1c71075 100644 --- a/nalgebra-lapack/src/eigen.rs +++ b/nalgebra-lapack/src/eigen.rs @@ -317,7 +317,7 @@ where * Lapack functions dispatch. * */ -/// Trait implemented by scalar type for which Lapack funtion exist to compute the +/// Trait implemented by scalar type for which Lapack function exist to compute the /// eigendecomposition. pub trait EigenScalar: Scalar { #[allow(missing_docs)] diff --git a/nalgebra-lapack/src/lu.rs b/nalgebra-lapack/src/lu.rs index 4fb5a72f..cab7b763 100644 --- a/nalgebra-lapack/src/lu.rs +++ b/nalgebra-lapack/src/lu.rs @@ -244,7 +244,7 @@ where /// Solves in-place the linear system `self * x = b`, where `x` is the unknown to be determined. /// - /// Retuns `false` if no solution was found (the decomposed matrix is singular). + /// Returns `false` if no solution was found (the decomposed matrix is singular). pub fn solve_mut(&self, b: &mut MatrixMN) -> bool where DefaultAllocator: Allocator + Allocator, @@ -255,7 +255,7 @@ where /// Solves in-place the linear system `self.transpose() * x = b`, where `x` is the unknown to be /// determined. /// - /// Retuns `false` if no solution was found (the decomposed matrix is singular). + /// Returns `false` if no solution was found (the decomposed matrix is singular). pub fn solve_transpose_mut(&self, b: &mut MatrixMN) -> bool where DefaultAllocator: Allocator + Allocator, @@ -266,7 +266,7 @@ where /// Solves in-place the linear system `self.conjugate_transpose() * x = b`, where `x` is the unknown to /// be determined. /// - /// Retuns `false` if no solution was found (the decomposed matrix is singular). + /// Returns `false` if no solution was found (the decomposed matrix is singular). pub fn solve_conjugate_transpose_mut( &self, b: &mut MatrixMN, diff --git a/nalgebra-lapack/src/qr.rs b/nalgebra-lapack/src/qr.rs index 775fd10b..f41cb7ce 100644 --- a/nalgebra-lapack/src/qr.rs +++ b/nalgebra-lapack/src/qr.rs @@ -171,7 +171,7 @@ where * Lapack functions dispatch. * */ -/// Trait implemented by scalar types for which Lapack funtion exist to compute the +/// Trait implemented by scalar types for which Lapack function exist to compute the /// QR decomposition. pub trait QRScalar: Scalar { fn xgeqrf( @@ -195,7 +195,7 @@ pub trait QRScalar: Scalar { ) -> i32; } -/// Trait implemented by reals for which Lapack funtion exist to compute the +/// Trait implemented by reals for which Lapack function exist to compute the /// QR decomposition. pub trait QRReal: QRScalar { #[allow(missing_docs)] diff --git a/nalgebra-lapack/src/schur.rs b/nalgebra-lapack/src/schur.rs index 5f3bb4f0..b26e464b 100644 --- a/nalgebra-lapack/src/schur.rs +++ b/nalgebra-lapack/src/schur.rs @@ -59,14 +59,14 @@ impl RealSchur where DefaultAllocator: Allocator + Allocator, { - /// Computes the eigenvalues and real Schur foorm of the matrix `m`. + /// Computes the eigenvalues and real Schur form of the matrix `m`. /// /// Panics if the method did not converge. pub fn new(m: MatrixN) -> Self { Self::try_new(m).expect("RealSchur decomposition: convergence failed.") } - /// Computes the eigenvalues and real Schur foorm of the matrix `m`. + /// Computes the eigenvalues and real Schur form of the matrix `m`. /// /// Returns `None` if the method did not converge. pub fn try_new(mut m: MatrixN) -> Option { diff --git a/src/base/blas.rs b/src/base/blas.rs index 3c04b8e0..23d80a08 100644 --- a/src/base/blas.rs +++ b/src/base/blas.rs @@ -180,7 +180,7 @@ where let mut res = N::zero(); // We have to define them outside of the loop (and not inside at first assignment) - // otherwize vectorization won't kick in for some reason. + // otherwise vectorization won't kick in for some reason. let mut acc0; let mut acc1; let mut acc2; @@ -527,7 +527,7 @@ where let is_dynamic = R1::is::() || C1::is::() || R2::is::() || C2::is::() || R3::is::() || C3::is::(); - // Thershold determined ampirically. + // Threshold determined empirically. const SMALL_DIM: usize = 5; if is_dynamic && nrows1 > SMALL_DIM && ncols1 > SMALL_DIM && nrows2 > SMALL_DIM diff --git a/src/base/componentwise.rs b/src/base/componentwise.rs index 2a4036e4..ab398a9a 100644 --- a/src/base/componentwise.rs +++ b/src/base/componentwise.rs @@ -1,4 +1,4 @@ -// Non-convensional componentwise operators. +// Non-conventional componentwise operators. use num::{Signed, Zero}; use std::ops::{Add, Mul}; diff --git a/src/base/matrix.rs b/src/base/matrix.rs index 6d99acbf..0336df71 100644 --- a/src/base/matrix.rs +++ b/src/base/matrix.rs @@ -58,7 +58,7 @@ pub type MatrixCross = /// components. /// /// The matrix dimensions parameters `R` and `C` can either be: -/// - type-level unsigned integer contants (e.g. `U1`, `U124`) from the `nalgebra::` root module. +/// - type-level unsigned integer constants (e.g. `U1`, `U124`) from the `nalgebra::` root module. /// All numbers from 0 to 127 are defined that way. /// - type-level unsigned integer constants (e.g. `U1024`, `U10000`) from the `typenum::` crate. /// Using those, you will not get error messages as nice as for numbers smaller than 128 defined on @@ -1298,7 +1298,7 @@ impl> Matrix { /// Normalizes this matrix in-place or does nothing if its norm is smaller or equal to `eps`. /// - /// If the normalization succeded, returns the old normal of this matrix. + /// If the normalization succeeded, returns the old normal of this matrix. #[inline] pub fn try_normalize_mut(&mut self, min_norm: N) -> Option { let n = self.norm(); diff --git a/src/base/matrix_slice.rs b/src/base/matrix_slice.rs index 3067dc55..6ab3c6b6 100644 --- a/src/base/matrix_slice.rs +++ b/src/base/matrix_slice.rs @@ -676,8 +676,8 @@ pub trait SliceRange { /// The start index of the range. fn begin(&self, shape: D) -> usize; - // NOTE: this is the index immediatly after the last index. - /// The index immediatly after the last index inside of the range. + // NOTE: this is the index immediately after the last index. + /// The index immediately after the last index inside of the range. fn end(&self, shape: D) -> usize; /// The number of elements of the range, i.e., `self.end - self.begin`. fn size(&self, shape: D) -> Self::Size; diff --git a/src/base/matrix_vec.rs b/src/base/matrix_vec.rs index 723e10fb..8a28b26c 100644 --- a/src/base/matrix_vec.rs +++ b/src/base/matrix_vec.rs @@ -58,10 +58,10 @@ impl MatrixVec { &mut self.data } - /// Resizes the undelying mutable data storage and unrwaps it. + /// Resizes the underlying mutable data storage and unwraps it. /// /// If `sz` is larger than the current size, additional elements are uninitialized. - /// If `sz` is smaller than the current size, additional elements are trucated. + /// If `sz` is smaller than the current size, additional elements are truncated. #[inline] pub unsafe fn resize(mut self, sz: usize) -> Vec { let len = self.len(); diff --git a/src/base/ops.rs b/src/base/ops.rs index 2daa77ce..217ed194 100644 --- a/src/base/ops.rs +++ b/src/base/ops.rs @@ -124,7 +124,7 @@ where /* * - * Addition & Substraction + * Addition & Subtraction * */ @@ -415,7 +415,7 @@ macro_rules! componentwise_scalarop_impl( // XXX: optimize our iterator! // - // Using our own iterator prevents loop unrolling, wich breaks some optimization + // Using our own iterator prevents loop unrolling, which breaks some optimization // (like SIMD). On the other hand, using the slice iterator is 4x faster. // for left in res.iter_mut() { @@ -469,7 +469,7 @@ macro_rules! left_scalar_mul_impl( // XXX: optimize our iterator! // - // Using our own iterator prevents loop unrolling, wich breaks some optimization + // Using our own iterator prevents loop unrolling, which breaks some optimization // (like SIMD). On the other hand, using the slice iterator is 4x faster. // for rhs in res.iter_mut() { diff --git a/src/base/scalar.rs b/src/base/scalar.rs index 6ba5440f..ca6da510 100644 --- a/src/base/scalar.rs +++ b/src/base/scalar.rs @@ -7,7 +7,7 @@ use std::any::Any; /// This does not make any assumption on the algebraic properties of `Self`. pub trait Scalar: Copy + PartialEq + Debug + Any { #[inline] - /// Tests if `Self` the the same as the type `T` + /// Tests if `Self` the same as the type `T` /// /// Typically used to test of `Self` is a f32 or a f64 with `N::is::()`. fn is() -> bool { diff --git a/src/base/storage.rs b/src/base/storage.rs index 68936022..63d10bcb 100644 --- a/src/base/storage.rs +++ b/src/base/storage.rs @@ -50,7 +50,7 @@ pub unsafe trait Storage: Debug + Sized { /// element of any dimension. Must be equal to `Self::dimension()` if it is not `None`. fn shape(&self) -> (R, C); - /// The spacing between concecutive row elements and consecutive column elements. + /// The spacing between consecutive row elements and consecutive column elements. /// /// For example this returns `(1, 5)` for a row-major matrix with 5 columns. fn strides(&self) -> (Self::RStride, Self::CStride); diff --git a/src/base/unit.rs b/src/base/unit.rs index 6924f6fd..b49bc83c 100644 --- a/src/base/unit.rs +++ b/src/base/unit.rs @@ -13,9 +13,9 @@ use abomonation::Abomonation; use alga::general::SubsetOf; use alga::linear::NormedSpace; -/// A wrapper that ensures the undelying algebraic entity has a unit norm. +/// A wrapper that ensures the underlying algebraic entity has a unit norm. /// -/// Use `.as_ref()` or `.unwrap()` to obtain the undelying value by-reference or by-move. +/// Use `.as_ref()` or `.unwrap()` to obtain the underlying value by-reference or by-move. #[repr(C)] #[derive(Eq, PartialEq, Clone, Hash, Debug, Copy)] pub struct Unit { @@ -187,7 +187,7 @@ where // } // } -// FIXME:re-enable this impl when spacialization is possible. +// FIXME:re-enable this impl when specialization is possible. // Currently, it is disabled so that we can have a nice output for the `UnitQuaternion` display. /* impl fmt::Display for Unit { diff --git a/src/geometry/isometry_ops.rs b/src/geometry/isometry_ops.rs index 7145269c..c30c2ac1 100644 --- a/src/geometry/isometry_ops.rs +++ b/src/geometry/isometry_ops.rs @@ -378,7 +378,7 @@ isometry_from_composition_impl_all!( (D, D), (D, U1) for D: DimName; self: Rotation, right: Isometry>, Output = Isometry>; - // FIXME: don't call iverse explicitly? + // FIXME: don't call inverse explicitly? [val val] => self * right.inverse(); [ref val] => self * right.inverse(); [val ref] => self * right.inverse(); diff --git a/src/geometry/op_macros.rs b/src/geometry/op_macros.rs index 62058d8f..873c6d7d 100644 --- a/src/geometry/op_macros.rs +++ b/src/geometry/op_macros.rs @@ -5,7 +5,7 @@ /// Macro for the implementation of multiplication and division. macro_rules! md_impl( ( - // Operator, operator method, and calar bounds. + // Operator, operator method, and scalar bounds. $Op: ident, $op: ident $(where N: $($ScalarBounds: ident),*)*; // Storage dimensions, and dimension bounds. ($R1: ty, $C1: ty),($R2: ty, $C2: ty) for $($Dims: ident: $DimsBound: ident $(<$($BoundParam: ty),*>)*),+ @@ -13,7 +13,7 @@ macro_rules! md_impl( $(where $ConstraintType: ty: $ConstraintBound: ident<$($ConstraintBoundParams: ty $( = $EqBound: ty )*),*> )*; // Argument identifiers and types + output. $lhs: ident: $Lhs: ty, $rhs: ident: $Rhs: ty, Output = $Result: ty; - // Operator actual mplementation. + // Operator actual implementation. $action: expr; // Lifetime. $($lives: tt),*) => { @@ -38,7 +38,7 @@ macro_rules! md_impl( /// Implements all the argument reference combinations. macro_rules! md_impl_all( ( - // Operator, operator method, and calar bounds. + // Operator, operator method, and scalar bounds. $Op: ident, $op: ident $(where N: $($ScalarBounds: ident),*)*; // Storage dimensions, and dimension bounds. ($R1: ty, $C1: ty),($R2: ty, $C2: ty) for $($Dims: ident: $DimsBound: ident $(<$($BoundParam: ty),*>)*),+ @@ -82,7 +82,7 @@ macro_rules! md_impl_all( } ); -/// Macro for the implementation of assignement-multiplication and assignement-division. +/// Macro for the implementation of assignment-multiplication and assignment-division. macro_rules! md_assign_impl( ( // Operator, operator method, and scalar bounds. @@ -109,7 +109,7 @@ macro_rules! md_assign_impl( } ); -/// Macro for the implementation of assignement-multiplication and assignement-division with and +/// Macro for the implementation of assignment-multiplication and assignment-division with and /// without reference to the right-hand-side. macro_rules! md_assign_impl_all( ( @@ -165,7 +165,7 @@ macro_rules! add_sub_impl( ); // FIXME: merge with `md_assign_impl`. -/// Macro for the implementation of assignement-addition and assignement-subtraction. +/// Macro for the implementation of assignment-addition and assignment-subtraction. macro_rules! add_sub_assign_impl( ($Op: ident, $op: ident, $bound: ident; ($R1: ty, $C1: ty),($R2: ty, $C2: ty) for $($Dims: ident: $DimsBound: ident),+; diff --git a/src/geometry/perspective.rs b/src/geometry/perspective.rs index 4ceb29f0..4b4dfeae 100644 --- a/src/geometry/perspective.rs +++ b/src/geometry/perspective.rs @@ -149,19 +149,19 @@ impl Perspective3 { self.matrix } - /// Gets the `width / height` aspect ratio of the view frustrum. + /// Gets the `width / height` aspect ratio of the view frustum. #[inline] pub fn aspect(&self) -> N { self.matrix[(1, 1)] / self.matrix[(0, 0)] } - /// Gets the y field of view of the view frustrum. + /// Gets the y field of view of the view frustum. #[inline] pub fn fovy(&self) -> N { (N::one() / self.matrix[(1, 1)]).atan() * ::convert(2.0) } - /// Gets the near plane offset of the view frustrum. + /// Gets the near plane offset of the view frustum. #[inline] pub fn znear(&self) -> N { let ratio = (-self.matrix[(2, 2)] + N::one()) / (-self.matrix[(2, 2)] - N::one()); @@ -169,7 +169,7 @@ impl Perspective3 { self.matrix[(2, 3)] / (ratio * ::convert(2.0)) - self.matrix[(2, 3)] / ::convert(2.0) } - /// Gets the far plane offset of the view frustrum. + /// Gets the far plane offset of the view frustum. #[inline] pub fn zfar(&self) -> N { let ratio = (-self.matrix[(2, 2)] + N::one()) / (-self.matrix[(2, 2)] - N::one()); @@ -219,7 +219,7 @@ impl Perspective3 { } /// Updates this perspective matrix with a new `width / height` aspect ratio of the view - /// frustrum. + /// frustum. #[inline] pub fn set_aspect(&mut self, aspect: N) { assert!( @@ -229,7 +229,7 @@ impl Perspective3 { self.matrix[(0, 0)] = self.matrix[(1, 1)] / aspect; } - /// Updates this perspective with a new y field of view of the view frustrum. + /// Updates this perspective with a new y field of view of the view frustum. #[inline] pub fn set_fovy(&mut self, fovy: N) { let old_m22 = self.matrix[(1, 1)]; @@ -237,21 +237,21 @@ impl Perspective3 { self.matrix[(0, 0)] = self.matrix[(0, 0)] * (self.matrix[(1, 1)] / old_m22); } - /// Updates this perspective matrix with a new near plane offset of the view frustrum. + /// Updates this perspective matrix with a new near plane offset of the view frustum. #[inline] pub fn set_znear(&mut self, znear: N) { let zfar = self.zfar(); self.set_znear_and_zfar(znear, zfar); } - /// Updates this perspective matrix with a new far plane offset of the view frustrum. + /// Updates this perspective matrix with a new far plane offset of the view frustum. #[inline] pub fn set_zfar(&mut self, zfar: N) { let znear = self.znear(); self.set_znear_and_zfar(znear, zfar); } - /// Updates this perspective matrix with new near and far plane offsets of the view frustrum. + /// Updates this perspective matrix with new near and far plane offsets of the view frustum. #[inline] pub fn set_znear_and_zfar(&mut self, znear: N, zfar: N) { self.matrix[(2, 2)] = (zfar + znear) / (znear - zfar); diff --git a/src/geometry/point_construction.rs b/src/geometry/point_construction.rs index 5915c8fb..837b3e44 100644 --- a/src/geometry/point_construction.rs +++ b/src/geometry/point_construction.rs @@ -53,7 +53,7 @@ where /* * - * Traits that buid points. + * Traits that build points. * */ impl Bounded for Point diff --git a/src/geometry/quaternion.rs b/src/geometry/quaternion.rs index eafb0de6..ccfd6af0 100644 --- a/src/geometry/quaternion.rs +++ b/src/geometry/quaternion.rs @@ -391,7 +391,7 @@ impl UnitQuaternion { pub fn angle(&self) -> N { let w = self.quaternion().scalar().abs(); - // Handle innacuracies that make break `.acos`. + // Handle inaccuracies that make break `.acos`. if w >= N::one() { N::zero() } else { @@ -507,7 +507,7 @@ impl UnitQuaternion { Unit::try_new(v, N::zero()) } - /// The rotation axis of this unit quaternion multiplied by the rotation agle. + /// The rotation axis of this unit quaternion multiplied by the rotation angle. #[inline] pub fn scaled_axis(&self) -> Vector3 { if let Some(axis) = self.axis() { diff --git a/src/geometry/quaternion_construction.rs b/src/geometry/quaternion_construction.rs index e5f9b19f..be2c64c7 100644 --- a/src/geometry/quaternion_construction.rs +++ b/src/geometry/quaternion_construction.rs @@ -278,7 +278,7 @@ impl UnitQuaternion { if let Some(axis) = Unit::try_new(c, N::default_epsilon()) { let cos = na.dot(&nb); - // The cosinus may be out of [-1, 1] because of innacuracies. + // The cosinus may be out of [-1, 1] because of inaccuracies. if cos <= -N::one() { return None; } else if cos >= N::one() { diff --git a/src/geometry/reflection.rs b/src/geometry/reflection.rs index f3a3ecdb..bd4da0cd 100644 --- a/src/geometry/reflection.rs +++ b/src/geometry/reflection.rs @@ -44,7 +44,7 @@ impl> Reflection { &self.axis } - // FIXME: naming convension: reflect_to, reflect_assign ? + // FIXME: naming convention: reflect_to, reflect_assign ? /// Applies the reflection to the columns of `rhs`. pub fn reflect(&self, rhs: &mut Matrix) where diff --git a/src/geometry/rotation_ops.rs b/src/geometry/rotation_ops.rs index 11b319e9..c6f9e2e3 100644 --- a/src/geometry/rotation_ops.rs +++ b/src/geometry/rotation_ops.rs @@ -53,7 +53,7 @@ md_impl_all!( ); // Rotation ÷ Rotation -// FIXME: instead of calling inverse explicitely, could we just add a `mul_tr` or `mul_inv` method? +// FIXME: instead of calling inverse explicitly, could we just add a `mul_tr` or `mul_inv` method? md_impl_all!( Div, div; (D, D), (D, D) for D: DimName; diff --git a/src/geometry/rotation_specialization.rs b/src/geometry/rotation_specialization.rs index 0f91ee39..46a9627a 100644 --- a/src/geometry/rotation_specialization.rs +++ b/src/geometry/rotation_specialization.rs @@ -35,7 +35,7 @@ impl Rotation2 { Self::new(axisangle[0]) } - /// The rotation matrix required to align `a` and `b` but with its angl. + /// The rotation matrix required to align `a` and `b` but with its angle. /// /// This is the rotation `R` such that `(R * a).angle(b) == 0 && (R * a).dot(b).is_positive()`. #[inline] @@ -279,7 +279,7 @@ impl Rotation3 { Self::new_observer_frame(dir, up).inverse() } - /// The rotation matrix required to align `a` and `b` but with its angl. + /// The rotation matrix required to align `a` and `b` but with its angle. /// /// This is the rotation `R` such that `(R * a).angle(b) == 0 && (R * a).dot(b).is_positive()`. #[inline] diff --git a/src/geometry/similarity.rs b/src/geometry/similarity.rs index 371be5f0..c29a0209 100644 --- a/src/geometry/similarity.rs +++ b/src/geometry/similarity.rs @@ -246,8 +246,8 @@ where } } -// NOTE: we don't require `R: Rotation<...>` here becaus this is not useful for the implementation -// and makes it harde to use it, e.g., for Transform × Isometry implementation. +// NOTE: we don't require `R: Rotation<...>` here because this is not useful for the implementation +// and makes it harder to use it, e.g., for Transform × Isometry implementation. // This is OK since all constructors of the isometry enforce the Rotation bound already (and // explicit struct construction is prevented by the private scaling factor). impl Similarity diff --git a/src/geometry/similarity_construction.rs b/src/geometry/similarity_construction.rs index 0e74dd23..99e18407 100644 --- a/src/geometry/similarity_construction.rs +++ b/src/geometry/similarity_construction.rs @@ -65,7 +65,7 @@ where R: AlgaRotation>, DefaultAllocator: Allocator, { - /// The similarity that applies tha scaling factor `scaling`, followed by the rotation `r` with + /// The similarity that applies the scaling factor `scaling`, followed by the rotation `r` with /// its axis passing through the point `p`. #[inline] pub fn rotation_wrt_point(r: R, p: Point, scaling: N) -> Self { @@ -135,7 +135,7 @@ macro_rules! similarity_construction_impl( Self::from_isometry(Isometry::<_, U3, $Rot>::new(translation, axisangle), scaling) } - /// Creates an similarity that corresponds to the a scaling factor and a local frame of + /// Creates an similarity that corresponds to a scaling factor and a local frame of /// an observer standing at the point `eye` and looking toward `target`. /// /// It maps the view direction `target - eye` to the positive `z` axis and the origin to the diff --git a/src/geometry/similarity_ops.rs b/src/geometry/similarity_ops.rs index 171a351a..92e77d08 100644 --- a/src/geometry/similarity_ops.rs +++ b/src/geometry/similarity_ops.rs @@ -445,7 +445,7 @@ similarity_from_composition_impl_all!( (D, D), (D, U1) for D: DimName; self: Rotation, right: Similarity>, Output = Similarity>; - // FIXME: don't call iverse explicitly? + // FIXME: don't call inverse explicitly? [val val] => self * right.inverse(); [ref val] => self * right.inverse(); [val ref] => self * right.inverse(); diff --git a/src/geometry/transform.rs b/src/geometry/transform.rs index 7b393d21..78a53829 100644 --- a/src/geometry/transform.rs +++ b/src/geometry/transform.rs @@ -256,7 +256,7 @@ where self.matrix } - /// A reference to the underlynig matrix. + /// A reference to the underlying matrix. #[inline] pub fn matrix(&self) -> &MatrixN> { &self.matrix diff --git a/src/geometry/translation_ops.rs b/src/geometry/translation_ops.rs index 8b0f49f0..639affdd 100644 --- a/src/geometry/translation_ops.rs +++ b/src/geometry/translation_ops.rs @@ -31,7 +31,7 @@ add_sub_impl!(Mul, mul, ClosedAdd; Translation::from_vector(self.vector + right.vector); ); // Translation ÷ Translation -// FIXME: instead of calling inverse explicitely, could we just add a `mul_tr` or `mul_inv` method? +// FIXME: instead of calling inverse explicitly, could we just add a `mul_tr` or `mul_inv` method? add_sub_impl!(Div, div, ClosedSub; (D, U1), (D, U1) -> (D) for D: DimName; self: &'a Translation, right: &'b Translation, Output = Translation; diff --git a/src/geometry/unit_complex_construction.rs b/src/geometry/unit_complex_construction.rs index ce10ef73..4b020789 100644 --- a/src/geometry/unit_complex_construction.rs +++ b/src/geometry/unit_complex_construction.rs @@ -35,7 +35,7 @@ impl UnitComplex { Self::new(angle) } - /// Builds the unit complex number frow the sinus and cosinus of the rotation angle. + /// Builds the unit complex number from the sinus and cosinus of the rotation angle. /// /// The input values are not checked. #[inline] diff --git a/src/lib.rs b/src/lib.rs index a1a4a5b9..bade4b70 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -233,8 +233,8 @@ where /// /// In particular: /// * If `min < val < max`, this returns `val`. -/// * If `val <= min`, this retuns `min`. -/// * If `val >= max`, this retuns `max`. +/// * If `val <= min`, this returns `min`. +/// * If `val >= max`, this returns `max`. #[inline] pub fn clamp(val: T, min: T, max: T) -> T { if val > min { diff --git a/src/linalg/cholesky.rs b/src/linalg/cholesky.rs index d385ff0b..e6592227 100644 --- a/src/linalg/cholesky.rs +++ b/src/linalg/cholesky.rs @@ -9,7 +9,7 @@ use constraint::{SameNumberOfRows, ShapeConstraint}; use dimension::{Dim, DimSub, Dynamic}; use storage::{Storage, StorageMut}; -/// The Cholesky decomposion of a symmetric-definite-positive matrix. +/// The Cholesky decomposition of a symmetric-definite-positive matrix. #[cfg_attr(feature = "serde-serialize", derive(Serialize, Deserialize))] #[cfg_attr( feature = "serde-serialize", @@ -50,7 +50,7 @@ where { /// Attempts to compute the Cholesky decomposition of `matrix`. /// - /// Returns `None` if the input matrix is not definite-positive. The intput matrix is assumed + /// Returns `None` if the input matrix is not definite-positive. The input matrix is assumed /// to be symmetric and only the lower-triangular part is read. pub fn new(mut matrix: MatrixN) -> Option { assert!(matrix.is_square(), "The input matrix must be square."); @@ -157,7 +157,7 @@ where { /// Attempts to compute the Cholesky decomposition of this matrix. /// - /// Returns `None` if the input matrix is not definite-positive. The intput matrix is assumed + /// Returns `None` if the input matrix is not definite-positive. The input matrix is assumed /// to be symmetric and only the lower-triangular part is read. pub fn cholesky(self) -> Option> { Cholesky::new(self.into_owned()) diff --git a/src/linalg/full_piv_lu.rs b/src/linalg/full_piv_lu.rs index 695bc0ca..85079b17 100644 --- a/src/linalg/full_piv_lu.rs +++ b/src/linalg/full_piv_lu.rs @@ -174,7 +174,7 @@ where { /// Solves the linear system `self * x = b`, where `x` is the unknown to be determined. /// - /// Retuns `None` if the decomposed matrix is not invertible. + /// Returns `None` if the decomposed matrix is not invertible. pub fn solve( &self, b: &Matrix, diff --git a/src/linalg/householder.rs b/src/linalg/householder.rs index f3a1f2bf..22799adb 100644 --- a/src/linalg/householder.rs +++ b/src/linalg/householder.rs @@ -112,7 +112,7 @@ where let dim = m.data.shape().0; // NOTE: we could build the identity matrix and call p_mult on it. - // Instead we don't so that we take in accout the matrix sparcity. + // Instead we don't so that we take in account the matrix sparseness. let mut res = MatrixN::identity_generic(dim, dim); for i in (0..dim.value() - 1).rev() { diff --git a/src/linalg/inverse.rs b/src/linalg/inverse.rs index 7b07698c..e00f4b8b 100644 --- a/src/linalg/inverse.rs +++ b/src/linalg/inverse.rs @@ -118,7 +118,7 @@ impl> SquareMatrix { } } -// NOTE: this is an extremely efficient, loop-unrolled matrix inverse from MESA (MIT licenced). +// NOTE: this is an extremely efficient, loop-unrolled matrix inverse from MESA (MIT licensed). fn do_inverse4>( m: &MatrixN, out: &mut SquareMatrix, diff --git a/src/linalg/qr.rs b/src/linalg/qr.rs index f2092de7..0dea31a7 100644 --- a/src/linalg/qr.rs +++ b/src/linalg/qr.rs @@ -107,7 +107,7 @@ where let (nrows, ncols) = self.qr.data.shape(); // NOTE: we could build the identity matrix and call q_mul on it. - // Instead we don't so that we take in accout the matrix sparcity. + // Instead we don't so that we take in account the matrix sparseness. let mut res = Matrix::identity_generic(nrows, nrows.min(ncols)); let dim = self.diag.len(); diff --git a/src/linalg/schur.rs b/src/linalg/schur.rs index 25a73008..fd385512 100644 --- a/src/linalg/schur.rs +++ b/src/linalg/schur.rs @@ -72,7 +72,7 @@ where /// /// # Arguments /// - /// * `eps` − tolerence used to determine when a value converged to 0. + /// * `eps` − tolerance used to determine when a value converged to 0. /// * `max_niter` − maximum total number of iterations performed by the algorithm. If this /// number of iteration is exceeded, `None` is returned. If `niter == 0`, then the algorithm /// continues indefinitely until convergence. @@ -519,7 +519,7 @@ where /// /// # Arguments /// - /// * `eps` − tolerence used to determine when a value converged to 0. + /// * `eps` − tolerance used to determine when a value converged to 0. /// * `max_niter` − maximum total number of iterations performed by the algorithm. If this /// number of iteration is exceeded, `None` is returned. If `niter == 0`, then the algorithm /// continues indefinitely until convergence. @@ -536,7 +536,7 @@ where let mut work = unsafe { VectorN::new_uninitialized_generic(self.data.shape().0, U1) }; - // Special case for 2x2 natrices. + // Special case for 2x2 matrices. if self.nrows() == 2 { // FIXME: can we avoid this slicing // (which is needed here just to transform D to U2)? diff --git a/src/linalg/solve.rs b/src/linalg/solve.rs index b770295e..904a1b29 100644 --- a/src/linalg/solve.rs +++ b/src/linalg/solve.rs @@ -8,7 +8,7 @@ use base::{DefaultAllocator, Matrix, MatrixMN, SquareMatrix, Vector}; impl> SquareMatrix { /// Computes the solution of the linear system `self . x = b` where `x` is the unknown and only - /// the lower-triangular part of `self` (including the diagonal) is concidered not-zero. + /// the lower-triangular part of `self` (including the diagonal) is considered not-zero. #[inline] pub fn solve_lower_triangular( &self, @@ -28,7 +28,7 @@ impl> SquareMatrix { } /// Computes the solution of the linear system `self . x = b` where `x` is the unknown and only - /// the upper-triangular part of `self` (including the diagonal) is concidered not-zero. + /// the upper-triangular part of `self` (including the diagonal) is considered not-zero. #[inline] pub fn solve_upper_triangular( &self, @@ -48,7 +48,7 @@ impl> SquareMatrix { } /// Solves the linear system `self . x = b` where `x` is the unknown and only the - /// lower-triangular part of `self` (including the diagonal) is concidered not-zero. + /// lower-triangular part of `self` (including the diagonal) is considered not-zero. pub fn solve_lower_triangular_mut( &self, b: &mut Matrix, @@ -98,7 +98,7 @@ impl> SquareMatrix { // FIXME: add the same but for solving upper-triangular. /// Solves the linear system `self . x = b` where `x` is the unknown and only the - /// lower-triangular part of `self` is concidered not-zero. The diagonal is never read as it is + /// lower-triangular part of `self` is considered not-zero. The diagonal is never read as it is /// assumed to be equal to `diag`. Returns `false` and does not modify its inputs if `diag` is zero. pub fn solve_lower_triangular_with_diag_mut( &self, @@ -130,7 +130,7 @@ impl> SquareMatrix { } /// Solves the linear system `self . x = b` where `x` is the unknown and only the - /// upper-triangular part of `self` (including the diagonal) is concidered not-zero. + /// upper-triangular part of `self` (including the diagonal) is considered not-zero. pub fn solve_upper_triangular_mut( &self, b: &mut Matrix, @@ -185,7 +185,7 @@ impl> SquareMatrix { */ /// Computes the solution of the linear system `self.transpose() . x = b` where `x` is the unknown and only - /// the lower-triangular part of `self` (including the diagonal) is concidered not-zero. + /// the lower-triangular part of `self` (including the diagonal) is considered not-zero. #[inline] pub fn tr_solve_lower_triangular( &self, @@ -205,7 +205,7 @@ impl> SquareMatrix { } /// Computes the solution of the linear system `self.transpose() . x = b` where `x` is the unknown and only - /// the upper-triangular part of `self` (including the diagonal) is concidered not-zero. + /// the upper-triangular part of `self` (including the diagonal) is considered not-zero. #[inline] pub fn tr_solve_upper_triangular( &self, @@ -225,7 +225,7 @@ impl> SquareMatrix { } /// Solves the linear system `self.transpose() . x = b` where `x` is the unknown and only the - /// lower-triangular part of `self` (including the diagonal) is concidered not-zero. + /// lower-triangular part of `self` (including the diagonal) is considered not-zero. pub fn tr_solve_lower_triangular_mut( &self, b: &mut Matrix, @@ -272,7 +272,7 @@ impl> SquareMatrix { } /// Solves the linear system `self.transpose() . x = b` where `x` is the unknown and only the - /// upper-triangular part of `self` (including the diagonal) is concidered not-zero. + /// upper-triangular part of `self` (including the diagonal) is considered not-zero. pub fn tr_solve_upper_triangular_mut( &self, b: &mut Matrix, diff --git a/src/linalg/svd.rs b/src/linalg/svd.rs index 87baddc9..43e2946e 100644 --- a/src/linalg/svd.rs +++ b/src/linalg/svd.rs @@ -94,7 +94,7 @@ where /// /// * `compute_u` − set this to `true` to enable the computation of left-singular vectors. /// * `compute_v` − set this to `true` to enable the computation of left-singular vectors. - /// * `eps` − tolerence used to determine when a value converged to 0. + /// * `eps` − tolerance used to determine when a value converged to 0. /// * `max_niter` − maximum total number of iterations performed by the algorithm. If this /// number of iteration is exceeded, `None` is returned. If `niter == 0`, then the algorithm /// continues indefinitely until convergence. @@ -251,7 +251,7 @@ where end -= 1; } - // Re-delimit the suproblem in case some decoupling occured. + // Re-delimit the subproblem in case some decoupling occurred. let sub = Self::delimit_subproblem(&mut b, &mut u, &mut v_t, end, eps); start = sub.0; end = sub.1; @@ -593,7 +593,7 @@ where /// /// * `compute_u` − set this to `true` to enable the computation of left-singular vectors. /// * `compute_v` − set this to `true` to enable the computation of left-singular vectors. - /// * `eps` − tolerence used to determine when a value converged to 0. + /// * `eps` − tolerance used to determine when a value converged to 0. /// * `max_niter` − maximum total number of iterations performed by the algorithm. If this /// number of iteration is exceeded, `None` is returned. If `niter == 0`, then the algorithm /// continues indefinitely until convergence. diff --git a/src/linalg/symmetric_eigen.rs b/src/linalg/symmetric_eigen.rs index d7b2fd23..1628f4ba 100644 --- a/src/linalg/symmetric_eigen.rs +++ b/src/linalg/symmetric_eigen.rs @@ -214,7 +214,7 @@ where end -= 1; } - // Re-delimit the suproblem in case some decoupling occured. + // Re-delimit the subproblem in case some decoupling occurred. let sub = Self::delimit_subproblem(&diag, &mut off_diag, end, eps); start = sub.0; @@ -297,7 +297,7 @@ where pub fn wilkinson_shift(tmm: N, tnn: N, tmn: N) -> N { let sq_tmn = tmn * tmn; if !sq_tmn.is_zero() { - // We have the guarantee thet the denominator won't be zero. + // We have the guarantee that the denominator won't be zero. let d = (tmm - tnn) * ::convert(0.5); tnn - sq_tmn / (d + d.signum() * (d * d + sq_tmn).sqrt()) } else {