File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change 2121from numpy import sum as array_sum
2222from scipy .special import gamma , kv as K_nu
2323from scipy .sparse .linalg .interface import LinearOperator
24+ from scipy .fftpack import dctn , fftn
2425
2526import pyfftw .interfaces .cache
2627from pyfftw import next_fast_len
@@ -450,13 +451,14 @@ def det(self):
450451 -------
451452 float
452453 """
454+ correlations = self ._ifft (self ._corr_fourier )
453455 if self ._is_cyclic :
454- return prod ( self ._corr_fourier .real )
455- index = tuple (
456- slice ( 1 , None , 2 )
457- for _ in self . _underlying_shape
458- )
459- return prod (self . _corr_fourier [ index ]. real )
456+ spectrum = fftn ( correlations , shape = self ._underlying_shape ) .real
457+ # The order is different from la.eigvalsh, but that
458+ # doesn't matter
459+ return prod ( spectrum )
460+ spectrum = dctn ( correlations , type = 1 , shape = self . _underlying_shape )
461+ return prod (spectrum )
460462
461463
462464def make_matrix (corr_func , shape ):
You can’t perform that action at this time.
0 commit comments