the-virtual-brain/scientific_library — pull request #13 by mmwoodman (2013-10-24 10:38:20+00:00)
Title: Add optimized JansenRit model

This adds an optimized JanseRit model that includes local coupling (the original does not).

Optimization proceeds by using numexpr and almost entirely avoid allocation. The dot product with `local_coupling` still results in temporaries, but would require some digging in the scipy sparse lib because no `out=` keyword argument is available.

Profiling with surface simulation shows a 10x reduction in time spent evaluating the differential equations. Significant additional time is required to evaluate local coupling product, but this is expected.