diff --git a/src/deprecated.jl b/src/deprecated.jl index cf10a91..5f334da 100644 --- a/src/deprecated.jl +++ b/src/deprecated.jl @@ -8,9 +8,9 @@ end """ rand_tangent([rng::AbstractRNG,] x) -Returns a arbitary tangent vector _appropriate_ for the primal value `x`. +Returns an arbitrary tangent vector _appropriate_ for the primal value `x`. Note that despite the name, no promises on the statistical randomness are made. -Rather it is an arbitary value, that is generated using the `rng`. +Rather it is an arbitrary value, that is generated using the `rng`. """ rand_tangent(x) = rand_tangent(Random.GLOBAL_RNG, x) diff --git a/src/methods.jl b/src/methods.jl index 6783530..f3d8ea7 100644 --- a/src/methods.jl +++ b/src/methods.jl @@ -67,9 +67,9 @@ difference method, `bound_estimator`, will be tasked with estimating the `P`th o derivative in a _neighbourhood_, not just at some `x`. To do this, it will use a careful reweighting of the function evaluations to estimate the `P`th order derivative at, in the case of a central method, `x - h`, `x`, and `x + h`, where `h` is the step size. The -coeffients for this estimate, the _neighbourhood estimate_, are given by the three sets of -coeffients in `bound_estimator.coefs_neighbourhood`. The round-off error is estimated by the -round-off error of the function evaluations performed by `bound_estimator`. The trunction +coefficients for this estimate, the _neighbourhood estimate_, are given by the three sets of +coefficients in `bound_estimator.coefs_neighbourhood`. The round-off error is estimated by the +round-off error of the function evaluations performed by `bound_estimator`. The truncation error is amplified by `condition`, and the round-off error is amplified by `factor`. The quantities `∇f_magnitude_mult` and `f_error_mult` are precomputed quantities that facilitate the step size adaptation procedure. @@ -490,7 +490,7 @@ for direction in [:forward, :central, :backward] geom::Bool=false ) -Contruct a finite difference method at a $($(Meta.quot(direction))) grid of `p` points. +Construct a finite difference method at a $($(Meta.quot(direction))) grid of `p` points. # Arguments - `p::Int`: Number of grid points. diff --git a/src/to_vec.jl b/src/to_vec.jl index 2d20313..079fbd1 100644 --- a/src/to_vec.jl +++ b/src/to_vec.jl @@ -196,7 +196,7 @@ end function to_vec(x::F) where {F <: SVD} # Convert the vector S to a matrix so we can work with a vector of matrices - # only and inferrence work + # only and inference work v = [x.U, reshape(x.S, length(x.S), 1), x.Vt] x_vec, back = to_vec(v) function SVD_from_vec(v) @@ -216,7 +216,7 @@ end function to_vec(x::S) where {U, S <: Union{LinearAlgebra.QRCompactWYQ{U}, LinearAlgebra.QRCompactWY{U}}} # x.T is composed of upper triangular blocks. The subdiagonals elements - # of the blocks are abitrary. We make sure to set all of them to zero + # of the blocks are arbitrary. We make sure to set all of them to zero # to avoid NaN. blocksize, cols = size(x.T) T = zeros(U, blocksize, cols) diff --git a/test/deprecated.jl b/test/deprecated.jl index 7ca97e2..640298c 100644 --- a/test/deprecated.jl +++ b/test/deprecated.jl @@ -102,7 +102,7 @@ rand_tangent(args...) = @test_deprecated FiniteDifferences.rand_tangent(args...) ) end - @testset "compsition of addition" begin + @testset "composition of addition" begin x = Foo(1.5, 2, Foo(1.1, 3, [1.7, 1.4, 0.9])) @test x + rand_tangent(x) isa typeof(x) @test x + (rand_tangent(x) + rand_tangent(x)) isa typeof(x) diff --git a/test/grad.jl b/test/grad.jl index cf36893..095777e 100644 --- a/test/grad.jl +++ b/test/grad.jl @@ -61,7 +61,7 @@ using FiniteDifferences: grad, jacobian, _jvp, jvp, j′vp, _j′vp, to_vec @test _jvp(fdm, f, x, ẋ) ≈ J_exact * ẋ @test _j′vp(fdm, f, ȳ, x) ≈ transpose(J_exact) * ȳ - # Check that no mutation occured that wasn't reverted. + # Check that no mutation occurred that wasn't reverted. @test xc == x end diff --git a/test/to_vec.jl b/test/to_vec.jl index f18e756..9de188d 100644 --- a/test/to_vec.jl +++ b/test/to_vec.jl @@ -146,7 +146,7 @@ end test_to_vec(cholesky(P)) # Special treatment for QR since it is represented by a matrix - # with some arbirtrary values. + # with some arbitrary values. F = qr(M) @inferred to_vec(F) F_vec, back = to_vec(F)