@@ -77,28 +77,20 @@ const Natural = Line
77
77
78
78
Base. IndexStyle (:: Type{<:AbstractInterpolation} ) = IndexCartesian ()
79
79
80
- size (itp:: AbstractInterpolation ) = map (length, itp. parentaxes)
81
80
size (exp:: AbstractExtrapolation ) = size (exp. itp)
82
- axes (itp:: AbstractInterpolation ) = itp. parentaxes
83
81
axes (exp:: AbstractExtrapolation ) = axes (exp. itp)
84
82
85
- bounds (itp:: AbstractInterpolation ) = map (twotuple, lbounds (itp), ubounds (itp))
86
83
twotuple (r:: AbstractUnitRange ) = (first (r), last (r))
87
84
twotuple (x, y) = (x, y)
85
+ bounds (itp:: AbstractInterpolation ) = map (twotuple, lbounds (itp), ubounds (itp))
88
86
bounds (itp:: AbstractInterpolation , d) = bounds (itp)[d]
89
- lbounds (itp:: AbstractInterpolation ) = _lbounds (itp. parentaxes, itpflag (itp), gridflag (itp))
90
- ubounds (itp:: AbstractInterpolation ) = _ubounds (itp. parentaxes, itpflag (itp), gridflag (itp))
91
- _lbounds (axs:: NTuple{N,Any} , itp, gt) where N = ntuple (d-> lbound (axs[d], iextract (itp,d), iextract (gt,d)), Val (N))
92
- _ubounds (axs:: NTuple{N,Any} , itp, gt) where N = ntuple (d-> ubound (axs[d], iextract (itp,d), iextract (gt,d)), Val (N))
93
87
94
88
itptype (:: Type{AbstractInterpolation{T,N,IT,GT}} ) where {T,N,IT<: DimSpec{InterpolationType} ,GT<: DimSpec{GridType} } = IT
95
89
itptype (:: Type{ITP} ) where {ITP<: AbstractInterpolation } = itptype (supertype (ITP))
96
90
itptype (itp:: AbstractInterpolation ) = itptype (typeof (itp))
97
- itpflag (itp:: AbstractInterpolation ) = itp. it
98
91
gridtype (:: Type{AbstractInterpolation{T,N,IT,GT}} ) where {T,N,IT<: DimSpec{InterpolationType} ,GT<: DimSpec{GridType} } = GT
99
92
gridtype (:: Type{ITP} ) where {ITP<: AbstractInterpolation } = gridtype (supertype (ITP))
100
93
gridtype (itp:: AbstractInterpolation ) = gridtype (typeof (itp))
101
- gridflag (itp:: AbstractInterpolation ) = itp. gt
102
94
ndims (:: Type{AbstractInterpolation{T,N,IT,GT}} ) where {T,N,IT<: DimSpec{InterpolationType} ,GT<: DimSpec{GridType} } = N
103
95
ndims (:: Type{ITP} ) where {ITP<: AbstractInterpolation } = ndims (supertype (ITP))
104
96
ndims (itp:: AbstractInterpolation ) = ndims (typeof (itp))
@@ -184,7 +176,7 @@ Base.to_index(::AbstractInterpolation, x::Number) = x
184
176
185
177
# Commented out because you can't add methods to an abstract type.
186
178
# @inline function (itp::AbstractInterpolation)(x::Vararg{UnexpandedIndexTypes})
187
- # itp(to_indices(itp, x))
179
+ # itp(to_indices(itp, x)... )
188
180
# end
189
181
function gradient (itp:: AbstractInterpolation , x:: Vararg{UnexpandedIndexTypes} )
190
182
gradient (itp, to_indices (itp, x)... )
0 commit comments