Commit Graph

5 Commits

Author SHA1 Message Date
Zachary Pincus 0994d80d4e allow negative-cost elements 2011-01-07 08:08:54 -05:00
Zachary Pincus 171bd18f80 fix infinite-handling in mcp and precision issues in heap 2011-01-07 08:01:21 -05:00
Zachary Pincus 56a5cadde2 Performance fix for heap; correctness for _mcp
(1) normalize_indices in _mcp.pyx should convert indices to ints: fixed
(2) huge (order of magnitude) performance problems in heap.pyx from changing
lines like:
ii = (i-1)/2 # CalcPrevAbs

to:
ii = (int)(i-1)/2 # CalcPrevAbs

for some reason,  the latter goes through the python division machinery!
However, the former is invalid for cython >=0.12, so the proper solution is:
ii = (i-1)//2 # CalcPrevAbs
2010-04-08 18:11:47 -04:00
Stefan van der Walt bc8ab59966 graph: mcp: Clean up long lines. Fix tests. 2010-01-01 13:24:32 +02:00
Zachary Pincus 6f39426485 Added classes for minimum-cost-pathfinding through n-d arrays.
mcp.py presents the interface and a simple usage example; the classes of
interest are in _mcp.pyx. Basic tests are included.
2009-12-29 13:05:53 -05:00