Thanks for the response. I think I have settled on how to get this to work.
This is what I have right now
immutable ShiftedInterpGrid{T,N,BC,IT}
IG::InterpGrid{T,N,BC,IT}
m::Number
b::Number
end
function ShiftedInterpGrid{T,BC,IT}(V::Vector{T}, X::Vector{T}, ::Type{BC},
::Type{IT})
n = size(X, 1)
(b, m) = [1 X[1]; 1 X[n]] \ [1; n]
IG = InterpGrid(V, BC, IT)
ShiftedInterpGrid(IG, m, b)
end
function getindex{T,R<:Real}(G::ShiftedInterpGrid{T,1}, x::AbstractVector{R})
s_x::AbstractVector{R} = G.b .+ G.m.*x
return getindex(G.IG, s_x)
end
function getindex{T,R<:Real}(G::ShiftedInterpGrid{T,1}, x::R)
s_x::R = G.b + G.m * x
return getindex(G.IG, s_x)
end
It seems to me that this would be fairly standard functionality. I am sure
there is a benefit to having the default getindex methods deal in “index
units” instead of physical ones, but I can’t tell what that benefit is? Is
there a reason you chose to have it set up the way it is?
Thanks again,
Spencer