-
-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LinearInterpolation: Output Vector for u::AbstractMatrix
#339
LinearInterpolation: Output Vector for u::AbstractMatrix
#339
Conversation
753f498
to
c6eaa04
Compare
This only fixes matrix, not the array. Fix the array dispatch. |
We intend to fix the julia> using DataInterpolations
julia> u2d = rand(5,5);
julia> t = 0:1:4
0:1:4
julia> LinearInterpolation(u2d, t)(0.1)
5-element Vector{Float64}:
0.6412661219777369
0.45226380542841466
0.667059578536869
0.3410690837298372
0.8883286346809633
julia> u3d = rand(5,5,5);
julia> LinearInterpolation(u3d, t)(0.1)
5×5×1 Array{Float64, 3}:
[:, :, 1] =
0.885232 0.433556 0.225437 0.683801 0.450121
0.572518 0.0916726 0.244869 0.339845 0.472721
0.346758 0.568071 0.823261 0.231083 0.803863
0.627925 0.158742 0.909838 0.38132 0.846073
0.381645 0.756691 0.31842 0.106938 0.565953 |
For N-D called with just a single time point, shouldn't it be (N-1)-D output? |
Right, fixed it now the output looks like this: julia> u2d = rand(5,5);
julia> u3d = rand(5,5,5);
julia> t = 0:1:4
0:1:4
julia> LinearInterpolation(u2d, t)(0.12)
5-element Vector{Float64}:
0.8955879753612471
0.17218902066690886
0.5403394528994946
0.28106129729671586
0.264249745025073
julia> LinearInterpolation(u3d, t)(0.12)
5×5 Matrix{Float64}:
0.491654 0.237982 0.819793 0.93269 0.516005
0.480924 0.733239 0.543345 0.0662969 0.67747
0.552783 0.18947 0.362321 0.238529 0.0915166
0.625032 0.844209 0.498186 0.171338 0.357868
0.485161 0.653258 0.703258 0.860978 0.0744935 |
Checklist
contributor guidelines, in particular the SciML Style Guide and
COLPRAC.
Additional context
Add any other context about the problem here.