1
# This module should be used for functions both in numpy and scipy if
2
# you want to use the numpy version if available but the scipy version
4
# Usage --- from numpy.dual import fft, inv
6
__all__ = ['fft','ifft','fftn','ifftn','fft2','ifft2',
7
'norm','inv','svd','solve','det','eig','eigvals',
8
'eigh','eigvalsh','lstsq', 'pinv','cholesky','i0']
10
import numpy.linalg as linpkg
11
import numpy.dft as fftpkg
12
from numpy.lib import i0
29
eigvals = linpkg.eigvals
31
eigvalsh = linpkg.eigvalsh
34
cholesky = linpkg.cholesky
38
def register_func(name, func):
39
if name not in __all__:
40
raise ValueError, "%s not a dual function." % name
41
f = sys._getframe(0).f_globals
42
_restore_dict[name] = f[name]
45
def restore_func(name):
46
if name not in __all__:
47
raise ValueError, "%s not a dual function." % name
49
val = _restore_dict[name]
53
sys._getframe(0).f_globals[name] = val
56
for name in _restore_dict.keys():