Skip to content

Commit

Permalink
Remove un-needed ambiguity resolving methods
Browse files Browse the repository at this point in the history
Thanks to JuliaLang/julia#10525 we no longer need these :)
  • Loading branch information
tomasaschan committed Jul 22, 2015
1 parent 98d32f9 commit 2594b6b
Showing 1 changed file with 0 additions and 26 deletions.
26 changes: 0 additions & 26 deletions src/b-splines/indexing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,32 +23,6 @@ function getindex_impl{T,N,TCoefs,IT<:DimSpec{BSpline},GT<:DimSpec{GridType},Pad
end
end

# Resolve ambiguity with general array indexing,
# getindex{T,N}(A::AbstractArray{T,N}, I::AbstractArray{T,N})
function getindex{T,N}(itp::BSplineInterpolation{T,N}, I::AbstractArray{T,N})
error("Array indexing is not defined for interpolation objects.")
end

# Resolve ambiguity with colon indexing for 1D interpolations
# getindex{T}(A::AbstractArray{T,1}, C::Colon)
function getindex{T}(itp::BSplineInterpolation{T,1}, c::Colon)
error("Colon indexing is not supported for interpolation objects")
end

# Resolve ambiguity with indexing with Real indices
# getindex{T,N}(A::AbstractArray{T,N}, x::Real...)
@generated function getindex{T,N,TCoefs,IT<:BSpline}(itp::BSplineInterpolation{T,N,TCoefs,IT}, xs::Real...)
getindex_impl(itp)
end

# Linear indexing is supported only for 1D interpolations
@generated function getindex{T,N}(itp::BSplineInterpolation{T,N}, xs::Real)
if N > 1
error("Linear indexing is not supported for interpolation objects")
end
getindex_impl(itp)
end

@generated function getindex{T,N}(itp::BSplineInterpolation{T,N}, xs...)
getindex_impl(itp)
end
Expand Down

0 comments on commit 2594b6b

Please sign in to comment.