阅读背景:

Python:从函数中重新定义函数

来源:互联网 

I have some expensive function f(x) that I want to only calculate once, but is called rather frequently. In essence, the first time the function is called, it should compute a whole bunch of values for a range of x since it will be integrated over anyway and then interpolate that one with splines, and cache the coefficients somehow, possibly in a file for further use.I have some expensive function f(x) that I want




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: