-
-
Notifications
You must be signed in to change notification settings - Fork 10
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
Interp
#8
Comments
I agree that it is a better fit for BasisMatrices.jl There is an existing Interpoland type that does some of what your Interp does, but doesn't store everything as a field (e.g. it doesn't store properties like I'd be happy to iterate with you and extend that type to fill all your needs here. |
That would be nice. What I really need are |
I don't do this right now, but we could store I do store a version of Similarly for
On the other hand, there are times when it is definitely faster to use the lu fact (same example, using just the first two dimensions): julia> b = Basis(SplineParams(25, -1, 1, 1),SplineParams(20, -1, 2, 3));
julia> Phi_tensor = BasisMatrix(b, Tensor, nodes(b)[2]);
julia> Phi = convert(Expanded, Phi_tensor);
julia> Phi_lu = lufact(Phi.vals[1]);
julia> y = rand(length(b));
julia> @benchmark Phi_lu \ y
BenchmarkTools.Trial:
memory estimate: 34.69 KiB
allocs estimate: 4
--------------
minimum time: 21.846 μs (0.00% GC)
median time: 22.484 μs (0.00% GC)
mean time: 23.865 μs (1.21% GC)
maximum time: 977.398 μs (89.64% GC)
--------------
samples: 10000
evals/sample: 1
julia> @benchmark funfitxy(b, Phi_tensor, y)
BenchmarkTools.Trial:
memory estimate: 170.13 KiB
allocs estimate: 346
--------------
minimum time: 91.221 μs (0.00% GC)
median time: 99.814 μs (0.00% GC)
mean time: 123.845 μs (8.72% GC)
maximum time: 3.180 ms (58.89% GC)
--------------
samples: 10000
evals/sample: 1 And once again using just the first dimension
We should probably be more scientific about these ideas, do some benchmarks to see when it becomes more efficient to use the Tensor form compared to precomputing the lu factorization. I would imagine that it is the size of the basis matrix and maybe also the sparsity pattern. |
Thanks! I have only used the
(phi_j is the j-th basis function and s_i is the i-th node). |
Useful pieces of information about interpolation are stored in
Interp
:And
ContinuousDP
keeps an instance ofInterp
as one of its fields.(1)
Conceptually, this is not part of a problem, but part of a solution algorithm.
(2)
One option is to include it in a "
Solver
" type, like(3)
Interp
should not necessarily belong here. It seems to fit better inBasisMatrices.jl
. Any thoughts @sglyon?The text was updated successfully, but these errors were encountered: