I encounter a problem when saving a LinearSolveFunction to disk, where the LinearSolveFunction is obtained with LinearSolve for a non-square matrix. If I read the function object from disk, it can no longer be applied to an array.
For example:
In[1]:= a = LinearSolve[{{1, 0}, {0, 1}, {1, 0}}];
In[2]:= a >> "tst.m";
In[3]:= b = << "tst.m";
At this point, a===b and the displayed FullForm of a and b are equal. However:
In[4]:= a[{0, 0, 0}]
Out[4]= {0, 0}
In[5]:= b[{0, 0, 0}]
Out[5]= LinearSolveFunction[{3,2},{2,False,{{{1,0},{0,1},{1,0}}},{0,Automatic,Automatic},0}][{0,0,0}]
I am using Mathematica 8.0.4 (64bit) on Linux.
Is this a bug ? Is there a good workaround ? Of course, I could avoid caching the LinearSolve result altogether and save only the matrix to be "inverted".
InterpolatingFunctiona while back, and I think I moved on without an answer – Rojo Oct 24 '12 at 18:48