Skip to content

Commit

Permalink
Generalize lispyprod (fixes #288) (#291)
Browse files Browse the repository at this point in the history
  • Loading branch information
timholy authored Dec 21, 2018
1 parent 0ef0249 commit 8003925
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ shape() = ()
@inline keepvectors(x, rest...) = keepvectors(rest...)
keepvectors() = ()

@inline lispyprod(p, v::Vector{T}, rest...) where T = lispyprod(p*zero(T), rest...)
@inline lispyprod(p, v::AbstractVector{T}, rest...) where T = lispyprod(p*zero(T), rest...)
@inline lispyprod(p, x::Number, rest...) = lispyprod(p*x, rest...)
lispyprod(p) = p

Expand Down
4 changes: 4 additions & 0 deletions test/extrapolation/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@ using Test
itp = LinearInterpolation(xs, ys, extrapolation_bc = Flat())
@test itp(8.3) ys[end]

# Issue #288
etp = extrapolate(interpolate(collect(1:12), NoInterp()) , 0)
@test etp(0:23) == [0:12; zeros(Int, 11)]

include("type-stability.jl")
include("non1.jl")
end

0 comments on commit 8003925

Please sign in to comment.