Skip to content

Commit

Permalink
type stability: use dims=n, not dims=[n]
Browse files Browse the repository at this point in the history
  • Loading branch information
stevengj authored Feb 4, 2025
1 parent bd97844 commit 3b6a4c7
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Dierckx.jl
Original file line number Diff line number Diff line change
Expand Up @@ -644,11 +644,11 @@ end

_evaluate(t::Vector{Float64}, c::Matrix{Float64}, k::Int,
x::Vector{Float64}, bc::Int) =
mapslices(v -> _evaluate(t, v, k, x, bc), c, dims=[2])
mapslices(v -> _evaluate(t, v, k, x, bc), c, dims=2)

_evaluate(t::Vector{Float64}, c::Matrix{Float64}, k::Int,
x::Real, bc::Int) =
vec(mapslices(v -> _evaluate(t, v, k, x, bc), c, dims=[2]))
vec(mapslices(v -> _evaluate(t, v, k, x, bc), c, dims=2))

function evaluate(spline::ParametricSpline, x::AbstractVector)
xin = convert(Vector{Float64}, x)
Expand All @@ -660,11 +660,11 @@ evaluate(spline::ParametricSpline, x::Real) =

_derivative(t::Vector{Float64}, c::Matrix{Float64}, k::Int,
x::Vector{Float64}, nu::Int, bc::Int, wrk::Vector{Float64}) =
mapslices(v -> _derivative(t, v, k, x, nu, bc, wrk), c, dims=[2])
mapslices(v -> _derivative(t, v, k, x, nu, bc, wrk), c, dims=2)

_derivative(t::Vector{Float64}, c::Matrix{Float64}, k::Int,
x::Real, nu::Int, bc::Int, wrk::Vector{Float64}) =
vec(mapslices(v -> _derivative(t, v, k, x, nu, bc, wrk), c, dims=[2]))
vec(mapslices(v -> _derivative(t, v, k, x, nu, bc, wrk), c, dims=2))

derivative(spline::ParametricSpline, x::AbstractVector, nu::Int=1) =
_derivative(spline.t, spline.c, spline.k,
Expand All @@ -678,7 +678,7 @@ derivative(spline::ParametricSpline, x::Real, nu::Int=1) =

_integrate(t::Vector{Float64}, c::Matrix{Float64}, k::Int,
a::Real, b::Real, wrk::Vector{Float64}) =
vec(mapslices(v -> _integrate(t, v, k, a, b, wrk), c, dims=[2]))
vec(mapslices(v -> _integrate(t, v, k, a, b, wrk), c, dims=2))

integrate(spline::ParametricSpline, a::Real, b::Real) =
_integrate(spline.t, spline.c, spline.k, a, b, spline.wrk)
Expand Down

0 comments on commit 3b6a4c7

Please sign in to comment.