Tiziano,
I have updated the more efficient file, and I wanted to see if you would mind testing it with your data. It is at:
http://homepages.cae.wisc.edu/~jawilson/MEMPredictor.h
Could you place this file in the BCI2000/src/extlib/math/ folder, and re-compile the mem mex file? You can do this in matlab by going to the BCI2000/src/core/Tools/mex/ folder, and typing buildmex mem. Try running the mem file on your data again.
Alternatively, I would be more than happy to test it on your data as well. If you want to upload it, I can test it pretty quickly.
Here is a figure from each version on some EEG data, and the difference between each:

So, I think the updated version is working correctly, but I want to make sure before submitting it again.
Thanks!
Adam