Rewrote LinearInterp from scratch (#107)
Rewrote LinearInterp from scratch (#107)

* Rewrote LinearInterp from scratch

LinearInterp was previously mostly an extension of
scipy.interpolate.UnivariateSpline.  It has now been rewritten as a
fully custom class for HARK.  This was done because UnivariateSpline
uses 6-7x more memory than is necessary.  This is not a problem in
isolation, but can lead to memory constraints being binding in very
large models-- those with tens of thousands of LinearInterps.

All code runs identically as before these changes.  Old version remains
as LinearInterpOLD, for testing.  Should be deleted.  Some applications
run 5% faster, others are up to 14% slower than before.  We can fix
speed later by adding an option to the class that makes it use 50% more
memory.

Also fixed all classes where distance_criteria was not a static
attribute.

* Some minor suggested changes to Matts LinearInterp class.  This commit reorganizes the method so there is only one (_evalOrDer) that actually does anything.  The other methods just call _evalOrDer.  This avoids the repetition of code that was in the previous version.  Tested some and seems to work (and perhaps be a bit faster), though it needs to be tested more thoroughly with the rest of HARK.

econ-ark/HARK,econ-ark/HARK