Bug introduced in 8.0 and fixed in 9.0.0
I have an InterpolatingFunction
based on irregularly-gridded data, like this:
int=Interpolation[{{0,0,1},{1,0,1},{0,1,1},{1,1,1},{0.5,0.5,0}},InterpolationOrder -> 1]
InterpolatingFunction[{{0.00075,0.00735},{0.00335,0.00555}}]
int[0.5,0.5]
0.
that I want to save in a file for later, using a recommendation from Szabolcs in a comment on this question:
Export["test.mmaz",Compress[int],"String"];
but importing it returns a broken function
intNew=Uncompress[Import["test.mmaz"]]
InterpolatingFunction[{{0.,1.},{0.,1.}},{4,4225,0,{5,0},{2,2},0,0,0,0,Automatic},{NDSolve`FEM`ElementMesh[{{0.,1.},{0.,1.}},{NDSolve`FEM`TriangleElement[<4>]}]},{1.,1.,1.,1.,0.},{Automatic}]
Not what I expected. Moreover, it does not evaluate with arguments:
intNew[0.5,0.5]
InterpolatingFunction[{{0.,1.},{0.,1.}},{4,4225,0,{5,0},{2,2},0,0,0,0,Automatic},{NDSolve`FEM`ElementMesh[{{0.,1.},{0.,1.}},{NDSolve`FEM`TriangleElement[<4>]}]},{1.,1.,1.,1.,0.},{Automatic}][0.5,0.5]
And yet
intNew == int
True
As far as I've seen this behaviour does not arise when using regularly-gridded data. I'm not aware of the full scope of the issue.
What breaks the InterpolatingFunction
on import? Is there a fix for an existing saved function? What is the correct way to store the function safely?