mirror of
https://github.com/vale981/stocproc
synced 2025-03-05 09:41:42 -05:00
add get_key to KLE and FFT class
This commit is contained in:
parent
4df40290a1
commit
e0a1aa6519
1 changed files with 8 additions and 0 deletions
|
@ -245,6 +245,10 @@ class StocProc_KLE(_absStocProc):
|
|||
|
||||
state = sqrt_lambda_ui_fine, t, seed, scale, key
|
||||
self.__setstate__(state)
|
||||
|
||||
@staticmethod
|
||||
def get_key(r_tau, t_max, tol=1e-2):
|
||||
return r_tau, t_max, tol
|
||||
|
||||
|
||||
# def get_key(self):
|
||||
|
@ -409,6 +413,10 @@ class StocProc_FFT(_absStocProc):
|
|||
self.yl = np.sqrt(self.yl)
|
||||
self.omega_min_correction = np.exp(-1j*(a+dx/2)*self.t) #self.t is from the parent class
|
||||
|
||||
@staticmethod
|
||||
def get_key(t_max, bcf_ref, intgr_tol=1e-2, intpl_tol=1e-2):
|
||||
return bcf_ref, t_max, intgr_tol, intpl_tol
|
||||
|
||||
def __getstate__(self):
|
||||
return self.yl, self.num_grid_points, self.omega_min_correction, self.t_max, self._seed, self.scale, self.key
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue