Open zsunberg opened 1 month ago
For the algorithms, I was inspired by this paper when implementing the value function approximation for collision avoidance.
I think we do want to be able to support an API that returns the indices, but the function that does the interpolation does not have to call the index creating function.
I did a little more playing around, and found that in the benchmarks, interpolate
for RectangleGrid does not allocate, so I think there is just an issue with using @ballocate
in the tests for some reason.
Unfortunately, SimplexGrid does still allocate. I am not planning to fix it at this time, but if anyone wants to take a stab at it, PRs are welcome.
Since there does not appear to be a regression from previous performance, I am going to tag a new release with the recent changes.
It would be nice to avoid allocations altogether at interpolation time (see also #50).
This problem can alternatively be stated as "where should the memory for interpolants live?" I see three options:
interpolate!
might be able to solve this. However, the memory is needed for the return values ofinterpolants
, notinterpolate
, so that is not the memory that we need.interpolate
function. If we did it all in the same function, it may be easier to do everything on the stack.@mykelk it seems like we might need to actually go back and understand the original algorithm for this :smile: . Do you remember where you got it from? A textbook or paper or something?