Improve speed of MPC by about 30%

Dear diary, I spend a whole day searching for why this implementation
of the MPC was slower then my own implementation. I checked *everything*.
I rewrote the front evolution to match with mine almost exactly. I was
about to give up. And then I saw this... Arg!
This commit is contained in:
Almar Klein
2013-12-13 15:13:24 +01:00
parent 4b2136bc7d
commit 8d09300155
+1 -1
View File
@@ -290,7 +290,7 @@ cdef class MCP:
self.flat_cumulative_costs.fill(np.inf)
self.dim = len(costs.shape)
self.costs_shape = costs.shape
self.costs_heap = heap.FastUpdateBinaryHeap(initial_capacity=size,
self.costs_heap = heap.FastUpdateBinaryHeap(initial_capacity=128,
max_reference=size-1)
# This array stores, for each point, the index into the offset