tlycken/Interpolations.jl — pull request #15 by tlycken (2014-12-29 04:56:54+00:00)
Title: Multidimensional display isn't working properly

Run from the package directory:

```
$ julia test/output.jl
3-element Interpolation{Float64,1,Linear{OnGrid},ExtrapError}:
0.0952039
0.438459
0.758061
3-element Interpolation{Float64,1,Linear{OnGrid},ExtrapError}:
0.0952039
5.0
0.758061
3x3 Interpolation{Float64,2,Linear{OnGrid},ExtrapError}:
0.355406 0.875922 0.569037
0.512562 0.506918 0.78563
0.327117 0.509231 0.931878
3x3x3 Interpolation{Float64,3,Linear{OnGrid},ExtrapError}:
[:, :, 1] =
#undef #undef #undef
#undef #undef #undef
#undef #undef #undef

[:, :, 2] =
#undef #undef #undef
#undef #undef #undef
#undef #undef #undef

[:, :, 3] =
#undef #undef #undef
#undef #undef #undef
#undef #undef #undef
```

For 1D and 2D we fixed it by adding a method `getindex{T}(itp::Interpolation{T,1}, x::Real, d)` which only worked for `d==1`, but apparently it doesn't help in 3D. Adding similar methods with an extra argument for 2D and 3D as per definitions below doesn't seem to mitigate the issue

```
getindex{T}(itp::Interpolation{T,2}, x::Real, y::Real, d) = (d==1 || throw(BoundsError()); itp[x,y])
getindex{T}(itp::Interpolation{T,3}, x::Real, y::Real, z::Real, d) = (d==1 || throw(BoundsError()); itp[x,y,z])
```

Is there anything that can be done about this?