Skip to content

Commit

Permalink
Get padding as Int when used for sizing
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomas Lycken committed Jan 2, 2015
1 parent 4f6d476 commit 35a9342
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Interpolations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ Interpolation{TIn,N,IT<:InterpolationType,EB<:ExtrapolationBehavior}(A::Abstract
# We also ensure that the coefficient array is of the correct type
prefilter{T,N,TCoefs,IT<:InterpolationType}(::Type{TCoefs}, A::AbstractArray{T,N}, ::IT) = copy!(Array(TCoefs,size(A)...), A)

size{T,N,TCoefs,IT<:InterpolationType}(itp::Interpolation{T,N,TCoefs,IT}, d::Integer) = size(itp.coefs, d) - 2*padding(TCoefs,IT())
size{T,N,TCoefs,IT<:InterpolationType}(itp::Interpolation{T,N,TCoefs,IT}, d::Integer) = size(itp.coefs, d) - 2*padding(Int,IT())
size(itp::AbstractInterpolation) = tuple([size(itp,i) for i in 1:ndims(itp)]...)
ndims(itp::Interpolation) = ndims(itp.coefs)
eltype{T}(itp::Interpolation{T}) = T
Expand Down Expand Up @@ -113,7 +113,7 @@ function pad_size_and_index(sz::Tuple, pad)
sz, ind
end
function copy_with_padding(TCoefs, A, it::InterpolationType)
pad = padding(it)
pad = padding(Int, it)
sz,ind = pad_size_and_index(size(A), pad)
coefs = fill!(Array(TCoefs, sz...), 0)
coefs[ind...] = A
Expand Down

0 comments on commit 35a9342

Please sign in to comment.