Reputation: 1133
It is easy to save an array as files (such as .txt/.csv formats) in Julia/Python, but is there any way to save a function generated from interpolating an array? Taking a simple example:
using Interpolations
inter = Dict("constant" => BSpline(Constant()),
"linear" => BSpline(Linear()),
"quadratic" => BSpline(Quadratic(Line(OnCell()))),
"cubic" => BSpline(Cubic(Line(OnCell())))
)
arr = rand(100, 100, 100) # 3D array
func = interpolate(arr, inter["cubic"])
How can this function be saved for future use, such that one does not need to interpolate the function again each time when one runs the program?
Upvotes: 0
Views: 356