Hi Ralf 2009/11/3 Ralf Gommers <ralf.gommers@googlemail.com>:
About the build first, I had to run the setup.py in analysis separately, it wasn't picked up by the main setup.py. I do not have Cython installed.
I think I fixed that this morning, please confirm.
- why only left-to-right through the image? it would be easy to have an axis keyword and then transpose the image if necessary.
I guess you can manipulate the data any way you like before sending it in. This is just the way most algorithms, such as Viterbi, are defined.
- module name. "analysis" is quite generic, if that is where most algorithms end up it will be a very large module after a while. maybe that is okay, i'm not sure.
I'd be glad for some suggestions on a different name -- I wasn't quite sure myself.
- docstring is rather incomplete: needs Returns, References, Examples, Notes: synonym=Dijkstra's algorithm
I added some of that last night, but it could do with a lot more, you're right!
- for the test, why is path [0, 0, 1] instead of either [1, 0 ,1] or [0, 1, 0]? I would expect path to contain either indices or values of the followed path.
It contains the row coordinate for each column. Using that information, constructing the values along that path would be easy: x[path, :] -> values If there are many equivalent paths, the first is picked.
* can you write r_bracket_min = max(r - 1, 0) and leave out the if < 0 check afterward?
You could, but then you'd need to define max, otherwise a Python call is made.
* what is the overhead (if any) of a triple for loop in Cython? I don't see an obvious way to vectorize things, but if it's possible (even partially), would that help?
I don't think there's any advantage in this case -- we're working at the C level, so vectorising has very little chance on making things faster (unless you somehow manage to get better cache locality). When you vectorise, you just pass the buck to a library lower down the food chain. Regards Stéfan