@@ -68,13 +68,12 @@ immutable InPlace <: Flag end
68
68
immutable InPlaceQ <: Flag end
69
69
typealias Natural Line
70
70
71
- # TODO : size might have to be faster?
72
- size {T,N} (itp:: AbstractInterpolation{T,N} ) = ntuple (i-> size (itp,i), N):: NTuple{N,Int}
71
+ @generated size {T, N} (itp:: AbstractInterpolation{T,N} ) = Expr (:tuple , [:(size (itp, $ i)) for i in 1 : N]. .. )
73
72
size (exp:: AbstractExtrapolation , d) = size (exp. itp, d)
74
73
bounds {T,N} (itp:: AbstractInterpolation{T,N} ) = tuple (zip (lbounds (itp), ubounds (itp))... )
75
74
bounds {T,N} (itp:: AbstractInterpolation{T,N} , d) = (lbound (itp,d),ubound (itp,d))
76
- lbounds {T,N} (itp:: AbstractInterpolation{T,N} ) = ntuple (i -> lbound (itp,i), N) :: NTuple{N,T}
77
- ubounds {T,N} (itp:: AbstractInterpolation{T,N} ) = ntuple (i -> ubound (itp,i), N) :: NTuple{N,T}
75
+ @generated lbounds {T,N} (itp:: AbstractInterpolation{T,N} ) = Expr ( :tuple , [:( lbound (itp, $ i)) for i in 1 : N] . .. )
76
+ @generated ubounds {T,N} (itp:: AbstractInterpolation{T,N} ) = Expr ( :tuple , [:( ubound (itp, $ i)) for i in 1 : N] . .. )
78
77
lbound {T,N} (itp:: AbstractInterpolation{T,N} , d) = 1
79
78
ubound {T,N} (itp:: AbstractInterpolation{T,N} , d) = size (itp, d)
80
79
itptype {T,N,IT<:DimSpec{InterpolationType},GT<:DimSpec{GridType}} (:: Type{AbstractInterpolation{T,N,IT,GT}} ) = IT
0 commit comments