Skip to content

Commit

Permalink
typos
Browse files Browse the repository at this point in the history
  • Loading branch information
spaette committed Jun 11, 2024
1 parent 148c564 commit 5aa98a8
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/deprecated.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
8 changes: 4 additions & 4 deletions src/methods.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions src/to_vec.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion test/deprecated.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion test/grad.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion test/to_vec.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 5aa98a8

Please sign in to comment.