pyFFTW-0.10.1/0000775000175000017500000000000012652703650012314 5ustar whgwhg00000000000000pyFFTW-0.10.1/CHANGELOG.md0000664000175000017500000002271712652703601014132 0ustar whgwhg00000000000000# Change Log ## [v0.10.1](https://github.com/hgomersall/pyFFTW/tree/v0.10.1) (2016-01-29) [Full Changelog](https://github.com/hgomersall/pyFFTW/compare/v0.10.0...v0.10.1) ## [v0.10.0](https://github.com/hgomersall/pyFFTW/tree/v0.10.0) (2016-01-29) [Full Changelog](https://github.com/hgomersall/pyFFTW/compare/v0.9.2...v0.10.0) **Closed issues:** - Conda downloads are failing [\#76](https://github.com/hgomersall/pyFFTW/issues/76) - Python 3.4 and WinPython [\#74](https://github.com/hgomersall/pyFFTW/issues/74) - Installing pyfftw on Anaconda3 on Windows 7 [\#73](https://github.com/hgomersall/pyFFTW/issues/73) - is python 3.5 supported? [\#71](https://github.com/hgomersall/pyFFTW/issues/71) - deadlock of cache handler at interpreter shutdown [\#69](https://github.com/hgomersall/pyFFTW/issues/69) - pyFFTW breaks when forked [\#65](https://github.com/hgomersall/pyFFTW/issues/65) - build with mingw [\#62](https://github.com/hgomersall/pyFFTW/issues/62) - Striding in n\_byte\_align not on a uniform standard [\#61](https://github.com/hgomersall/pyFFTW/issues/61) - No exception on wrong arguments of function call of pyfftw.FFTW\(...\) [\#60](https://github.com/hgomersall/pyFFTW/issues/60) - pyfftw vs numpy.fft: faster and slower [\#58](https://github.com/hgomersall/pyFFTW/issues/58) - simple transposes? [\#57](https://github.com/hgomersall/pyFFTW/issues/57) - `Datatype not supported` with scipy [\#56](https://github.com/hgomersall/pyFFTW/issues/56) - Update tutorial with new byte align functions [\#53](https://github.com/hgomersall/pyFFTW/issues/53) - OS X Installation errors: [\#52](https://github.com/hgomersall/pyFFTW/issues/52) - Wrong results for pyfftw's ifft? [\#51](https://github.com/hgomersall/pyFFTW/issues/51) - Installing on OS X Mavericks [\#49](https://github.com/hgomersall/pyFFTW/issues/49) - Install error. Ld cannot find -lfftw3f [\#48](https://github.com/hgomersall/pyFFTW/issues/48) - new source release with updated licensing [\#43](https://github.com/hgomersall/pyFFTW/issues/43) - Crash during initialization of FFTW plan for r2c and c2r with Intel compiler [\#37](https://github.com/hgomersall/pyFFTW/issues/37) - Move FFTW class definition to pyfftw.pxd [\#36](https://github.com/hgomersall/pyFFTW/issues/36) - Provide transform metadata such as axes and direction [\#34](https://github.com/hgomersall/pyFFTW/issues/34) - Provide shape and dtype properties [\#33](https://github.com/hgomersall/pyFFTW/issues/33) - problem with very large arrays: OverflowError: value too large to convert to int [\#30](https://github.com/hgomersall/pyFFTW/issues/30) - add support for in-place multidimensional r2c transform [\#29](https://github.com/hgomersall/pyFFTW/issues/29) - Add numpy interface for hfft [\#28](https://github.com/hgomersall/pyFFTW/issues/28) - add cython as a build dependency [\#25](https://github.com/hgomersall/pyFFTW/issues/25) - Potential memory leak in caching [\#22](https://github.com/hgomersall/pyFFTW/issues/22) - Allow GIL to be released with threads=1 [\#13](https://github.com/hgomersall/pyFFTW/issues/13) - Building for 64bit windows [\#12](https://github.com/hgomersall/pyFFTW/issues/12) - Test failure using numpy 1.6.2 [\#9](https://github.com/hgomersall/pyFFTW/issues/9) - Remove the requirement for users to specify alignment [\#8](https://github.com/hgomersall/pyFFTW/issues/8) - pyfftw.interfaces can only handle numpy arrays [\#7](https://github.com/hgomersall/pyFFTW/issues/7) **Merged pull requests:** - Release GIL during both single- and multi-thread execution \(cleaned up patch\) [\#81](https://github.com/hgomersall/pyFFTW/pull/81) ([zpincus](https://github.com/zpincus)) - Support FFTW\_WISDOM\_ONLY \(cleaned up patch\) [\#80](https://github.com/hgomersall/pyFFTW/pull/80) ([zpincus](https://github.com/zpincus)) - Release GIL around FFTW planning [\#78](https://github.com/hgomersall/pyFFTW/pull/78) ([zpincus](https://github.com/zpincus)) - Updated the tutorial to reflect changes with new aligned array creation functions. [\#54](https://github.com/hgomersall/pyFFTW/pull/54) ([drwells](https://github.com/drwells)) - Add description for installing on OS X [\#50](https://github.com/hgomersall/pyFFTW/pull/50) ([arve0](https://github.com/arve0)) - close issue \#8 \(More numpy like aligned array creation functions\) [\#44](https://github.com/hgomersall/pyFFTW/pull/44) ([drwells](https://github.com/drwells)) - Discrete sine transform imports [\#42](https://github.com/hgomersall/pyFFTW/pull/42) ([insertinterestingnamehere](https://github.com/insertinterestingnamehere)) ## [v0.9.2](https://github.com/hgomersall/pyFFTW/tree/v0.9.2) (2013-09-20) [Full Changelog](https://github.com/hgomersall/pyFFTW/compare/v0.9.2_docs...v0.9.2) ## [v0.9.2_docs](https://github.com/hgomersall/pyFFTW/tree/v0.9.2_docs) (2013-09-11) [Full Changelog](https://github.com/hgomersall/pyFFTW/compare/v0.9.1_docs...v0.9.2_docs) ## [v0.9.1_docs](https://github.com/hgomersall/pyFFTW/tree/v0.9.1_docs) (2013-09-11) [Full Changelog](https://github.com/hgomersall/pyFFTW/compare/v0.9.1...v0.9.1_docs) ## [v0.9.1](https://github.com/hgomersall/pyFFTW/tree/v0.9.1) (2013-09-11) [Full Changelog](https://github.com/hgomersall/pyFFTW/compare/v0.9_docs...v0.9.1) **Closed issues:** - Overwriting previous input when cache is enabled. [\#23](https://github.com/hgomersall/pyFFTW/issues/23) - Race condition in cache culling [\#21](https://github.com/hgomersall/pyFFTW/issues/21) - Memory corruption at exit [\#19](https://github.com/hgomersall/pyFFTW/issues/19) - In-place transform? [\#18](https://github.com/hgomersall/pyFFTW/issues/18) - Support for 2.6? [\#17](https://github.com/hgomersall/pyFFTW/issues/17) - Install fails; can't find library? [\#16](https://github.com/hgomersall/pyFFTW/issues/16) - Please include cython source code [\#11](https://github.com/hgomersall/pyFFTW/issues/11) - Make repeated axes act like numpy.fft's repeated axes [\#2](https://github.com/hgomersall/pyFFTW/issues/2) - Implement numpy.fft API to pyfftw [\#1](https://github.com/hgomersall/pyFFTW/issues/1) **Merged pull requests:** - register fftw cleanup with Py\_AtExit [\#20](https://github.com/hgomersall/pyFFTW/pull/20) ([rainwoodman](https://github.com/rainwoodman)) ## [v0.9_docs](https://github.com/hgomersall/pyFFTW/tree/v0.9_docs) (2013-02-15) [Full Changelog](https://github.com/hgomersall/pyFFTW/compare/v0.9...v0.9_docs) ## [v0.9](https://github.com/hgomersall/pyFFTW/tree/v0.9) (2013-02-15) [Full Changelog](https://github.com/hgomersall/pyFFTW/compare/v0.8.2_docs...v0.9) **Closed issues:** - Issue getting PyFFTW to import in Python 3 [\#6](https://github.com/hgomersall/pyFFTW/issues/6) - Some tests fail [\#5](https://github.com/hgomersall/pyFFTW/issues/5) - n\_byte\_array\(\) and n\_byte\_align\_empty\(\) break for large arrays [\#4](https://github.com/hgomersall/pyFFTW/issues/4) ## [v0.8.2_docs](https://github.com/hgomersall/pyFFTW/tree/v0.8.2_docs) (2012-05-29) [Full Changelog](https://github.com/hgomersall/pyFFTW/compare/v0.8.2...v0.8.2_docs) ## [v0.8.2](https://github.com/hgomersall/pyFFTW/tree/v0.8.2) (2012-05-29) [Full Changelog](https://github.com/hgomersall/pyFFTW/compare/v0.8.1_docs...v0.8.2) **Closed issues:** - export\_wisdom\(\) fails on windows 7 and vista [\#3](https://github.com/hgomersall/pyFFTW/issues/3) ## [v0.8.1_docs](https://github.com/hgomersall/pyFFTW/tree/v0.8.1_docs) (2012-05-20) [Full Changelog](https://github.com/hgomersall/pyFFTW/compare/v0.8.1...v0.8.1_docs) ## [v0.8.1](https://github.com/hgomersall/pyFFTW/tree/v0.8.1) (2012-05-20) [Full Changelog](https://github.com/hgomersall/pyFFTW/compare/v0.8.0_docs...v0.8.1) ## [v0.8.0_docs](https://github.com/hgomersall/pyFFTW/tree/v0.8.0_docs) (2012-04-08) [Full Changelog](https://github.com/hgomersall/pyFFTW/compare/v0.8.0...v0.8.0_docs) ## [v0.8.0](https://github.com/hgomersall/pyFFTW/tree/v0.8.0) (2012-04-08) [Full Changelog](https://github.com/hgomersall/pyFFTW/compare/v0.7.0_docs...v0.8.0) ## [v0.7.0_docs](https://github.com/hgomersall/pyFFTW/tree/v0.7.0_docs) (2012-03-04) [Full Changelog](https://github.com/hgomersall/pyFFTW/compare/v0.7.0...v0.7.0_docs) ## [v0.7.0](https://github.com/hgomersall/pyFFTW/tree/v0.7.0) (2012-02-29) [Full Changelog](https://github.com/hgomersall/pyFFTW/compare/v0.6.1_docs...v0.7.0) ## [v0.6.1_docs](https://github.com/hgomersall/pyFFTW/tree/v0.6.1_docs) (2012-02-26) [Full Changelog](https://github.com/hgomersall/pyFFTW/compare/v0.6.1...v0.6.1_docs) ## [v0.6.1](https://github.com/hgomersall/pyFFTW/tree/v0.6.1) (2012-02-26) [Full Changelog](https://github.com/hgomersall/pyFFTW/compare/v0.6.0_docs...v0.6.1) ## [v0.6.0_docs](https://github.com/hgomersall/pyFFTW/tree/v0.6.0_docs) (2012-02-06) [Full Changelog](https://github.com/hgomersall/pyFFTW/compare/v0.6.0...v0.6.0_docs) ## [v0.6.0](https://github.com/hgomersall/pyFFTW/tree/v0.6.0) (2012-02-06) [Full Changelog](https://github.com/hgomersall/pyFFTW/compare/v0.5.1_docs...v0.6.0) ## [v0.5.1_docs](https://github.com/hgomersall/pyFFTW/tree/v0.5.1_docs) (2012-02-05) [Full Changelog](https://github.com/hgomersall/pyFFTW/compare/v0.5.1...v0.5.1_docs) ## [v0.5.1](https://github.com/hgomersall/pyFFTW/tree/v0.5.1) (2012-02-04) [Full Changelog](https://github.com/hgomersall/pyFFTW/compare/v0.5.0...v0.5.1) ## [v0.5.0](https://github.com/hgomersall/pyFFTW/tree/v0.5.0) (2012-02-01) [Full Changelog](https://github.com/hgomersall/pyFFTW/compare/v0.5.0_docs...v0.5.0) ## [v0.5.0_docs](https://github.com/hgomersall/pyFFTW/tree/v0.5.0_docs) (2012-02-01) \* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*pyFFTW-0.10.1/test/0000775000175000017500000000000012652703650013273 5ustar whgwhg00000000000000pyFFTW-0.10.1/test/test_pyfftw_multithreaded.py0000664000175000017500000000701712570060606021137 0ustar whgwhg00000000000000# Copyright 2014 Knowledge Economy Developments Ltd # # Henry Gomersall # heng@kedevelopments.co.uk # # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, this # list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright notice, # this list of conditions and the following disclaimer in the documentation # and/or other materials provided with the distribution. # # * Neither the name of the copyright holder nor the names of its contributors # may be used to endorse or promote products derived from this software without # specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. # from pyfftw import FFTW import numpy from timeit import Timer from .test_pyfftw_base import run_test_suites import unittest from .test_pyfftw_base import FFTWBaseTest class Complex64MultiThreadedTest(FFTWBaseTest): def run_multithreaded_test(self, threads): in_shape = self.input_shapes['2d']; out_shape = self.output_shapes['2d'] axes=(-1,) a, b = self.create_test_arrays(in_shape, out_shape) fft, ifft = self.run_validate_fft(a, b, axes, threads=threads) fft_, ifft_ = self.run_validate_fft(a, b, axes, threads=1) self.timer_routine(fft.execute, fft_.execute, comparison_string='singled threaded') self.assertTrue(True) def test_2_threads(self): self.run_multithreaded_test(2) def test_4_threads(self): self.run_multithreaded_test(4) def test_7_threads(self): self.run_multithreaded_test(7) def test_25_threads(self): self.run_multithreaded_test(25) class Complex128MultiThreadedTest(Complex64MultiThreadedTest): def setUp(self): self.input_dtype = numpy.complex128 self.output_dtype = numpy.complex128 self.np_fft_comparison = numpy.fft.fft return class ComplexLongDoubleMultiThreadedTest(Complex64MultiThreadedTest): def setUp(self): self.input_dtype = numpy.clongdouble self.output_dtype = numpy.clongdouble self.np_fft_comparison = self.reference_fftn return def reference_fftn(self, a, axes): # numpy.fft.fftn doesn't support complex256 type, # so we need to compare to a lower precision type. a = numpy.complex128(a) return numpy.fft.fftn(a, axes=axes) test_cases = ( Complex64MultiThreadedTest, Complex128MultiThreadedTest, ComplexLongDoubleMultiThreadedTest,) test_set = None if __name__ == '__main__': run_test_suites(test_cases, test_set) pyFFTW-0.10.1/test/test_pyfftw_nbyte_align.py0000664000175000017500000003101012570060606020565 0ustar whgwhg00000000000000# Copyright 2014 Knowledge Economy Developments Ltd # Copyright 2014 David Wells # # Henry Gomersall # heng@kedevelopments.co.uk # David Wells # drwells vt.edu # # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, this # list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright notice, # this list of conditions and the following disclaimer in the documentation # and/or other materials provided with the distribution. # # * Neither the name of the copyright holder nor the names of its contributors # may be used to endorse or promote products derived from this software without # specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. # from pyfftw import (byte_align, is_byte_aligned, ones_aligned, empty_aligned, zeros_aligned, simd_alignment,) # Test the deprecated functions. from pyfftw import n_byte_align, n_byte_align_empty, is_n_byte_aligned import numpy from timeit import Timer from .test_pyfftw_base import run_test_suites import unittest import warnings def ignore_deprecation_warning(function): def new_function(*args, **kwargs): with warnings.catch_warnings(): warnings.filterwarnings("ignore", category=DeprecationWarning) return function(*args, **kwargs) return new_function class ByteAlignTest(unittest.TestCase): def __init__(self, *args, **kwargs): super(ByteAlignTest, self).__init__(*args, **kwargs) if not hasattr(self, 'assertRaisesRegex'): self.assertRaisesRegex = self.assertRaisesRegexp def setUp(self): return def tearDown(self): return def test_ones_aligned(self): shape = (10,10) # Test a few alignments and dtypes for each in [(3, 'float64'), (7, 'float64'), (9, 'float32'), (16, 'int64'), (24, 'bool'), (23, 'complex64'), (63, 'complex128'), (64, 'int8')]: n = each[0] a = numpy.ones(shape, dtype=each[1]) b = ones_aligned(shape, dtype=each[1], n=n) self.assertTrue(b.ctypes.data%n == 0) self.assertTrue(b.dtype == each[1]) self.assertTrue(numpy.array_equal(a, b)) def test_zeros_aligned(self): shape = (10,10) # Test a few alignments and dtypes for each in [(3, 'float64'), (7, 'float64'), (9, 'float32'), (16, 'int64'), (24, 'bool'), (23, 'complex64'), (63, 'complex128'), (64, 'int8')]: n = each[0] a = numpy.zeros(shape, dtype=each[1]) b = zeros_aligned(shape, dtype=each[1], n=n) self.assertTrue(b.ctypes.data%n == 0) self.assertTrue(b.dtype == each[1]) self.assertTrue(numpy.array_equal(a, b)) def test_empty_aligned(self): shape = (10,10) # Test a few alignments and dtypes for each in [(3, 'float64'), (7, 'float64'), (9, 'float32'), (16, 'int64'), (24, 'bool'), (23, 'complex64'), (63, 'complex128'), (64, 'int8')]: n = each[0] b = empty_aligned(shape, dtype=each[1], n=n) self.assertTrue(b.ctypes.data%n == 0) self.assertTrue(b.dtype == each[1]) @ignore_deprecation_warning def test_n_byte_align_empty(self): shape = (10,10) # Test a few alignments and dtypes for each in [(3, 'float64'), (7, 'float64'), (9, 'float32'), (16, 'int64'), (24, 'bool'), (23, 'complex64'), (63, 'complex128'), (64, 'int8')]: n = each[0] b = n_byte_align_empty(shape, n, dtype=each[1]) self.assertTrue(b.ctypes.data%n == 0) self.assertTrue(b.dtype == each[1]) def test_byte_align(self): shape = (10,10) a = numpy.random.randn(*shape) # Test a few alignments for n in [None, 3, 7, 9, 16, 24, 23, 63, 64]: expected_alignment = get_expected_alignment(n) b = byte_align(a, n=n) self.assertTrue(b.ctypes.data % expected_alignment == 0) @ignore_deprecation_warning def test_n_byte_align(self): shape = (10,10) a = numpy.random.randn(*shape) # Test a few alignments for n in [3, 7, 9, 16, 24, 23, 63, 64]: b = n_byte_align(a, n) self.assertTrue(b.ctypes.data%n == 0) def test_byte_align_integer_shape(self): shape = 100 a = numpy.random.randn(shape) # Test a few alignments for n in [None, 3, 7, 9, 16, 24, 23, 63, 64]: expected_alignment = get_expected_alignment(n) b = byte_align(a, n=n) self.assertTrue(b.ctypes.data % expected_alignment == 0) @ignore_deprecation_warning def test_n_byte_align_integer_shape(self): shape = 100 a = numpy.random.randn(shape) # Test a few alignments for n in [3, 7, 9, 16, 24, 23, 63, 64]: b = n_byte_align(a, n) self.assertTrue(b.ctypes.data%n == 0) def test_is_byte_aligned(self): a = empty_aligned(100) self.assertTrue(is_byte_aligned(a, get_expected_alignment(None))) a = empty_aligned(100, n=16) self.assertTrue(is_byte_aligned(a, n=16)) a = empty_aligned(100, n=5) self.assertTrue(is_byte_aligned(a, n=5)) a = empty_aligned(100, dtype='float32', n=16)[1:] self.assertFalse(is_byte_aligned(a, n=16)) self.assertTrue(is_byte_aligned(a, n=4)) @ignore_deprecation_warning def test_is_n_byte_aligned(self): a = n_byte_align_empty(100, 16) self.assertTrue(is_n_byte_aligned(a, 16)) a = n_byte_align_empty(100, 5) self.assertTrue(is_n_byte_aligned(a, 5)) a = n_byte_align_empty(100, 16, dtype='float32')[1:] self.assertFalse(is_n_byte_aligned(a, 16)) self.assertTrue(is_n_byte_aligned(a, 4)) def test_is_byte_aligned_fail_with_non_array(self): a = [1, 2, 3, 4] self.assertRaisesRegex(TypeError, 'Invalid array', is_byte_aligned, a, n=16) @ignore_deprecation_warning def test_is_n_byte_aligned_fail_with_non_array(self): a = [1, 2, 3, 4] self.assertRaisesRegex(TypeError, 'Invalid array', is_n_byte_aligned, a, 16) def test_byte_align_fail_with_non_array(self): a = [1, 2, 3, 4] self.assertRaisesRegex(TypeError, 'Invalid array', byte_align, a, n=16) @ignore_deprecation_warning def test_n_byte_align_fail_with_non_array(self): a = [1, 2, 3, 4] self.assertRaisesRegex(TypeError, 'Invalid array', n_byte_align, a, 16) def test_byte_align_consistent_data(self): shape = (10,10) a = numpy.int16(numpy.random.randn(*shape)*16000) b = numpy.float64(numpy.random.randn(*shape)) c = numpy.int8(numpy.random.randn(*shape)*255) # Test a few alignments for n in [None, 3, 7, 9, 16, 24, 23, 63, 64]: d = byte_align(a, n=n) self.assertTrue(numpy.array_equal(a, d)) d = byte_align(b, n=n) self.assertTrue(numpy.array_equal(b, d)) d = byte_align(c, n=n) self.assertTrue(numpy.array_equal(c, d)) @ignore_deprecation_warning def test_n_byte_align_consistent_data(self): shape = (10,10) a = numpy.int16(numpy.random.randn(*shape)*16000) b = numpy.float64(numpy.random.randn(*shape)) c = numpy.int8(numpy.random.randn(*shape)*255) # Test a few alignments for n in [3, 7, 9, 16, 24, 23, 63, 64]: d = n_byte_align(a, n) self.assertTrue(numpy.array_equal(a, d)) d = n_byte_align(b, n) self.assertTrue(numpy.array_equal(b, d)) d = n_byte_align(c, n) self.assertTrue(numpy.array_equal(c, d)) def test_byte_align_different_dtypes(self): shape = (10,10) a = numpy.int16(numpy.random.randn(*shape)*16000) b = numpy.float64(numpy.random.randn(*shape)) c = numpy.int8(numpy.random.randn(*shape)*255) # Test a few alignments for n in [None, 3, 7, 9, 16, 24, 23, 63, 64]: expected_alignment = get_expected_alignment(n) d = byte_align(a, n=n) self.assertTrue(d.ctypes.data % expected_alignment == 0) self.assertTrue(d.__class__ == a.__class__) d = byte_align(b, n=n) self.assertTrue(d.ctypes.data % expected_alignment == 0) self.assertTrue(d.__class__ == b.__class__) d = byte_align(c, n=n) self.assertTrue(d.ctypes.data % expected_alignment == 0) self.assertTrue(d.__class__ == c.__class__) @ignore_deprecation_warning def test_n_byte_align_different_dtypes(self): shape = (10,10) a = numpy.int16(numpy.random.randn(*shape)*16000) b = numpy.float64(numpy.random.randn(*shape)) c = numpy.int8(numpy.random.randn(*shape)*255) # Test a few alignments for n in [3, 7, 9, 16, 24, 23, 63, 64]: d = n_byte_align(a, n) self.assertTrue(d.ctypes.data%n == 0) self.assertTrue(d.__class__ == a.__class__) d = n_byte_align(b, n) self.assertTrue(d.ctypes.data%n == 0) self.assertTrue(d.__class__ == b.__class__) d = n_byte_align(c, n) self.assertTrue(d.ctypes.data%n == 0) self.assertTrue(d.__class__ == c.__class__) def test_byte_align_set_dtype(self): shape = (10,10) a = numpy.int16(numpy.random.randn(*shape)*16000) b = numpy.float64(numpy.random.randn(*shape)) c = numpy.int8(numpy.random.randn(*shape)*255) # Test a few alignments for n in [None, 3, 7, 9, 16, 24, 23, 63, 64]: expected_alignment = get_expected_alignment(n) d = byte_align(a, dtype='float32', n=n) self.assertTrue(d.ctypes.data % expected_alignment == 0) self.assertTrue(d.dtype == 'float32') d = byte_align(b, dtype='float32', n=n) self.assertTrue(d.ctypes.data % expected_alignment == 0) self.assertTrue(d.dtype == 'float32') d = byte_align(c, dtype='float64', n=n) self.assertTrue(d.ctypes.data % expected_alignment == 0) self.assertTrue(d.dtype == 'float64') @ignore_deprecation_warning def test_n_byte_align_set_dtype(self): shape = (10,10) a = numpy.int16(numpy.random.randn(*shape)*16000) b = numpy.float64(numpy.random.randn(*shape)) c = numpy.int8(numpy.random.randn(*shape)*255) # Test a few alignments for n in [3, 7, 9, 16, 24, 23, 63, 64]: d = n_byte_align(a, n, dtype='float32') self.assertTrue(d.ctypes.data%n == 0) self.assertTrue(d.dtype == 'float32') d = n_byte_align(b, n, dtype='float32') self.assertTrue(d.ctypes.data%n == 0) self.assertTrue(d.dtype == 'float32') d = n_byte_align(c, n, dtype='float64') self.assertTrue(d.ctypes.data%n == 0) self.assertTrue(d.dtype == 'float64') def get_expected_alignment(n): if n is None: return simd_alignment else: return n test_cases = ( ByteAlignTest,) test_set = None if __name__ == '__main__': run_test_suites(test_cases, test_set) pyFFTW-0.10.1/test/test_pyfftw_call.py0000664000175000017500000003616012570060606017220 0ustar whgwhg00000000000000# Copyright 2014 Knowledge Economy Developments Ltd # # Henry Gomersall # heng@kedevelopments.co.uk # # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, this # list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright notice, # this list of conditions and the following disclaimer in the documentation # and/or other materials provided with the distribution. # # * Neither the name of the copyright holder nor the names of its contributors # may be used to endorse or promote products derived from this software without # specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. # from pyfftw import ( FFTW, empty_aligned, byte_align) from .test_pyfftw_base import run_test_suites import numpy import unittest class FFTWCallTest(unittest.TestCase): def __init__(self, *args, **kwargs): super(FFTWCallTest, self).__init__(*args, **kwargs) if not hasattr(self, 'assertRaisesRegex'): self.assertRaisesRegex = self.assertRaisesRegexp def setUp(self): self.input_array = empty_aligned((256, 512), dtype='complex128', n=16) self.output_array = empty_aligned((256, 512), dtype='complex128', n=16) self.fft = FFTW(self.input_array, self.output_array) self.input_array[:] = (numpy.random.randn(*self.input_array.shape) + 1j*numpy.random.randn(*self.input_array.shape)) def test_call(self): '''Test a call to an instance of the class. ''' self.input_array[:] = (numpy.random.randn(*self.input_array.shape) + 1j*numpy.random.randn(*self.input_array.shape)) output_array = self.fft() self.assertTrue(numpy.alltrue(output_array == self.output_array)) def test_call_with_positional_input_update(self): '''Test the class call with a positional input update. ''' input_array = byte_align( (numpy.random.randn(*self.input_array.shape) + 1j*numpy.random.randn(*self.input_array.shape)), n=16) output_array = self.fft(byte_align(input_array.copy(), n=16)).copy() self.fft.update_arrays(input_array, self.output_array) self.fft.execute() self.assertTrue(numpy.alltrue(output_array == self.output_array)) def test_call_with_keyword_input_update(self): '''Test the class call with a keyword input update. ''' input_array = byte_align( numpy.random.randn(*self.input_array.shape) + 1j*numpy.random.randn(*self.input_array.shape), n=16) output_array = self.fft( input_array=byte_align(input_array.copy(), n=16)).copy() self.fft.update_arrays(input_array, self.output_array) self.fft.execute() self.assertTrue(numpy.alltrue(output_array == self.output_array)) def test_call_with_keyword_output_update(self): '''Test the class call with a keyword output update. ''' output_array = byte_align( (numpy.random.randn(*self.output_array.shape) + 1j*numpy.random.randn(*self.output_array.shape)), n=16) returned_output_array = self.fft( output_array=byte_align(output_array.copy(), n=16)).copy() self.fft.update_arrays(self.input_array, output_array) self.fft.execute() self.assertTrue( numpy.alltrue(returned_output_array == output_array)) def test_call_with_positional_updates(self): '''Test the class call with a positional array updates. ''' input_array = byte_align((numpy.random.randn(*self.input_array.shape) + 1j*numpy.random.randn(*self.input_array.shape)), n=16) output_array = byte_align((numpy.random.randn(*self.output_array.shape) + 1j*numpy.random.randn(*self.output_array.shape)), n=16) returned_output_array = self.fft( byte_align(input_array.copy(), n=16), byte_align(output_array.copy(), n=16)).copy() self.fft.update_arrays(input_array, output_array) self.fft.execute() self.assertTrue(numpy.alltrue(returned_output_array == output_array)) def test_call_with_keyword_updates(self): '''Test the class call with a positional output update. ''' input_array = byte_align( (numpy.random.randn(*self.input_array.shape) + 1j*numpy.random.randn(*self.input_array.shape)), n=16) output_array = byte_align( (numpy.random.randn(*self.output_array.shape) + 1j*numpy.random.randn(*self.output_array.shape)), n=16) returned_output_array = self.fft( output_array=byte_align(output_array.copy(), n=16), input_array=byte_align(input_array.copy(), n=16)).copy() self.fft.update_arrays(input_array, output_array) self.fft.execute() self.assertTrue(numpy.alltrue(returned_output_array == output_array)) def test_call_with_different_input_dtype(self): '''Test the class call with an array with a different input dtype ''' input_array = byte_align(numpy.complex64( numpy.random.randn(*self.input_array.shape) + 1j*numpy.random.randn(*self.input_array.shape)), n=16) output_array = self.fft(byte_align(input_array.copy(), n=16)).copy() _input_array = byte_align(numpy.asarray(input_array, dtype=self.input_array.dtype), n=16) self.assertTrue(_input_array.dtype != input_array.dtype) self.fft.update_arrays(_input_array, self.output_array) self.fft.execute() self.assertTrue(numpy.alltrue(output_array == self.output_array)) def test_call_with_list_input(self): '''Test the class call with a list rather than an array ''' output_array = self.fft().copy() test_output_array = self.fft(self.input_array.tolist()).copy() self.assertTrue(numpy.alltrue(output_array == test_output_array)) def test_call_with_invalid_update(self): '''Test the class call with an invalid update. ''' new_shape = self.input_array.shape + (2, ) invalid_array = (numpy.random.randn(*new_shape) + 1j*numpy.random.randn(*new_shape)) self.assertRaises(ValueError, self.fft, *(), **{'output_array':invalid_array}) self.assertRaises(ValueError, self.fft, *(), **{'input_array':invalid_array}) def test_call_with_auto_input_alignment(self): '''Test the class call with a keyword input update. ''' input_array = (numpy.random.randn(*self.input_array.shape) + 1j*numpy.random.randn(*self.input_array.shape)) output_array = self.fft( input_array=byte_align(input_array.copy(), n=16)).copy() # Offset by one from 16 byte aligned to guarantee it's not # 16 byte aligned a = input_array a__ = empty_aligned(numpy.prod(a.shape)*a.itemsize+1, dtype='int8', n=16) a_ = a__[1:].view(dtype=a.dtype).reshape(*a.shape) a_[:] = a # Just confirm that a usual update will fail self.assertRaisesRegex(ValueError, 'Invalid input alignment', self.fft.update_arrays, *(a_, self.output_array)) self.fft(a_, self.output_array) self.assertTrue(numpy.alltrue(output_array == self.output_array)) # now try with a single byte offset and SIMD off ar, ai = numpy.float32(numpy.random.randn(2, 257)) a = ar[1:] + 1j*ai[1:] b = a.copy() a_size = len(a.ravel())*a.itemsize update_array = numpy.frombuffer( numpy.zeros(a_size + 1, dtype='int8')[1:].data, dtype=a.dtype).reshape(a.shape) fft = FFTW(a, b, flags=('FFTW_UNALIGNED',)) # Confirm that a usual update will fail (it's not on the # byte boundary) self.assertRaisesRegex(ValueError, 'Invalid input alignment', fft.update_arrays, *(update_array, b)) fft(update_array, b) def test_call_with_invalid_output_striding(self): '''Test the class call with an invalid strided output update. ''' # Add an extra dimension to bugger up the striding new_shape = self.output_array.shape + (2,) output_array = byte_align(numpy.random.randn(*new_shape) + 1j*numpy.random.randn(*new_shape), n=16) self.assertRaisesRegex(ValueError, 'Invalid output striding', self.fft, **{'output_array': output_array[:,:,1]}) def test_call_with_different_striding(self): '''Test the input update with different strides to internal array. ''' shape = self.input_array.shape + (2,) input_array = byte_align(numpy.random.randn(*shape) + 1j*numpy.random.randn(*shape), n=16) fft = FFTW(input_array[:,:,0], self.output_array) test_output_array = fft().copy() new_input_array = byte_align( input_array[:, :, 0].copy(), n=16) new_output = fft(new_input_array).copy() # Test the test! self.assertTrue(new_input_array.strides != input_array[:,:,0].strides) self.assertTrue(numpy.alltrue(test_output_array == new_output)) def test_call_with_copy_with_missized_array_error(self): '''Force an input copy with a missized array. ''' shape = list(self.input_array.shape + (2,)) shape[0] += 1 input_array = byte_align(numpy.random.randn(*shape) + 1j*numpy.random.randn(*shape), n=16) fft = FFTW(self.input_array, self.output_array) self.assertRaisesRegex(ValueError, 'Invalid input shape', self.fft, **{'input_array': input_array[:,:,0]}) def test_call_with_unaligned(self): '''Make sure the right thing happens with unaligned data. ''' input_array = (numpy.random.randn(*self.input_array.shape) + 1j*numpy.random.randn(*self.input_array.shape)) output_array = self.fft( input_array=byte_align(input_array.copy(), n=16)).copy() input_array = byte_align(input_array, n=16) output_array = byte_align(output_array, n=16) # Offset by one from 16 byte aligned to guarantee it's not # 16 byte aligned a = byte_align(input_array.copy(), n=16) a__ = empty_aligned(numpy.prod(a.shape)*a.itemsize+1, dtype='int8', n=16) a_ = a__[1:].view(dtype=a.dtype).reshape(*a.shape) a_[:] = a # Create a different second array the same way b = byte_align(output_array.copy(), n=16) b__ = empty_aligned(numpy.prod(b.shape)*a.itemsize+1, dtype='int8', n=16) b_ = b__[1:].view(dtype=b.dtype).reshape(*b.shape) b_[:] = a # Set up for the first array fft = FFTW(input_array, output_array) a_[:] = a output_array = fft().copy() # Check a_ is not aligned... self.assertRaisesRegex(ValueError, 'Invalid input alignment', self.fft.update_arrays, *(a_, output_array)) # and b_ too self.assertRaisesRegex(ValueError, 'Invalid output alignment', self.fft.update_arrays, *(input_array, b_)) # But it should still work with the a_ fft(a_) # However, trying to update the output will raise an error self.assertRaisesRegex(ValueError, 'Invalid output alignment', self.fft.update_arrays, *(input_array, b_)) # Same with SIMD off fft = FFTW(input_array, output_array, flags=('FFTW_UNALIGNED',)) fft(a_) self.assertRaisesRegex(ValueError, 'Invalid output alignment', self.fft.update_arrays, *(input_array, b_)) def test_call_with_normalisation_on(self): _input_array = empty_aligned((256, 512), dtype='complex128', n=16) ifft = FFTW(self.output_array, _input_array, direction='FFTW_BACKWARD') self.fft(normalise_idft=True) # Shouldn't make any difference ifft(normalise_idft=True) self.assertTrue(numpy.allclose(self.input_array, _input_array)) def test_call_with_normalisation_off(self): _input_array = empty_aligned((256, 512), dtype='complex128', n=16) ifft = FFTW(self.output_array, _input_array, direction='FFTW_BACKWARD') self.fft(normalise_idft=True) # Shouldn't make any difference ifft(normalise_idft=False) _input_array /= ifft.N self.assertTrue(numpy.allclose(self.input_array, _input_array)) def test_call_with_normalisation_default(self): _input_array = empty_aligned((256, 512), dtype='complex128', n=16) ifft = FFTW(self.output_array, _input_array, direction='FFTW_BACKWARD') self.fft() ifft() # Scaling is performed by default self.assertTrue(numpy.allclose(self.input_array, _input_array)) def test_call_with_normalisation_precision(self): '''The normalisation should use a double precision scaling. ''' # Should be the case for double inputs... _input_array = empty_aligned((256, 512), dtype='complex128', n=16) ifft = FFTW(self.output_array, _input_array, direction='FFTW_BACKWARD') ref_output = ifft(normalise_idft=False).copy()/numpy.float64(ifft.N) test_output = ifft(normalise_idft=True).copy() self.assertTrue(numpy.alltrue(ref_output == test_output)) # ... and single inputs. _input_array = empty_aligned((256, 512), dtype='complex64', n=16) ifft = FFTW(numpy.array(self.output_array, _input_array.dtype), _input_array, direction='FFTW_BACKWARD') ref_output = ifft(normalise_idft=False).copy()/numpy.float64(ifft.N) test_output = ifft(normalise_idft=True).copy() self.assertTrue(numpy.alltrue(ref_output == test_output)) test_cases = ( FFTWCallTest,) test_set = None if __name__ == '__main__': run_test_suites(test_cases, test_set) pyFFTW-0.10.1/test/test_pyfftw_interfaces_cache.py0000664000175000017500000002733612652625174021570 0ustar whgwhg00000000000000# # Copyright 2014 Knowledge Economy Developments Ltd # # Henry Gomersall # heng@kedevelopments.co.uk # # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, this # list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright notice, # this list of conditions and the following disclaimer in the documentation # and/or other materials provided with the distribution. # # * Neither the name of the copyright holder nor the names of its contributors # may be used to endorse or promote products derived from this software without # specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. # from pyfftw import interfaces, builders import numpy import unittest from .test_pyfftw_base import run_test_suites from .test_pyfftw_numpy_interface import InterfacesNumpyFFTTestFFT import threading import time import os '''Test the caching functionality of the interfaces package. ''' class InterfacesNumpyFFTCacheTestFFT(InterfacesNumpyFFTTestFFT): test_shapes = ( ((100,), {}), ((128, 64), {'axis': 0}), ((128, 32), {'axis': -1}), ((32, 64), {}), ) def validate(self, array_type, test_shape, dtype, s, kwargs): # Do it with the cache interfaces.cache.enable() output = self._validate(array_type, test_shape, dtype, s, kwargs) output2 = self._validate(array_type, test_shape, dtype, s, kwargs) self.assertIsNot(output, output2) # Turn it off to finish interfaces.cache.disable() class CacheSpecificInterfacesUtils(unittest.TestCase): def test_slow_lookup_no_race_condition(self): '''Checks that lookups in _utils longer than the keepalive time are ok. ''' # Any old size, it doesn't matter data_shape = (128,) # Monkey patch the module with a custom _Cache object _Cache_class = interfaces.cache._Cache class _SlowLookupCache(_Cache_class): def _lookup(self, key): return _Cache_class.lookup(self, key) def lookup(self, key): time.sleep(0.1) return self._lookup(key) try: interfaces.cache._Cache = _SlowLookupCache interfaces.cache.enable() # something shortish interfaces.cache.set_keepalive_time(0.001) ar, ai = numpy.random.randn(*(2,) + data_shape) a = ar + 1j*ai # Both the following should work without exception # (even if it fails to get from the cache) interfaces.numpy_fft.fft(a) interfaces.numpy_fft.fft(a) interfaces.cache.disable() finally: # Revert the monkey patching interfaces.cache._Cache = _Cache_class class InterfacesCacheTest(unittest.TestCase): def test_missing_threading(self): self.assertIs(interfaces.cache._fftw_cache, None) mod_threading = interfaces.cache._threading interfaces.cache._threading = None with self.assertRaises(ImportError): interfaces.cache.enable() interfaces.cache._threading = mod_threading def test_is_enabled(self): self.assertIs(interfaces.cache._fftw_cache, None) interfaces.cache.enable() self.assertTrue(interfaces.cache.is_enabled()) interfaces.cache.disable() self.assertFalse(interfaces.cache.is_enabled()) def test_cache_enable_disable(self): self.assertIs(interfaces.cache._fftw_cache, None) interfaces.cache.enable() self.assertIsInstance( interfaces.cache._fftw_cache, interfaces.cache._Cache) interfaces.cache.disable() self.assertIs(interfaces.cache._fftw_cache, None) def test_set_keepalive_time(self): with self.assertRaises(interfaces.cache.CacheError): interfaces.cache.set_keepalive_time(10) interfaces.cache.enable() interfaces.cache.set_keepalive_time(10) self.assertTrue( interfaces.cache._fftw_cache.keepalive_time == 10.0) interfaces.cache.disable() class CacheTest(unittest.TestCase): def test_cache_parent_thread_ended(self): '''Test ending cache parent thread ends cache thread. ''' # Firstly make sure we've exited any lingering threads from other # tests. time.sleep(0.1) self.assertTrue(threading.active_count() == 1) def cache_parent_thread(): cache = interfaces.cache._Cache() time.sleep(0.5) parent_t = threading.Thread(target=cache_parent_thread) parent_t.start() time.sleep(0.1) # Check it's running self.assertTrue(threading.active_count() == 3) parent_t.join() time.sleep(0.1) # Check both threads have exited properly self.assertTrue(threading.active_count() == 1) def test_delete_cache_object(self): '''Test deleting a cache object ends cache thread. ''' # Firstly make sure we've exited any lingering threads from other # tests. time.sleep(0.2) self.assertTrue(threading.active_count() == 1) _cache = interfaces.cache._Cache() time.sleep(0.2) self.assertTrue(threading.active_count() == 2) del _cache time.sleep(0.2) self.assertTrue(threading.active_count() == 1) def test_insert_and_lookup_item(self): _cache = interfaces.cache._Cache() key = 'the key' test_array = numpy.random.randn(16) obj = builders.fft(test_array) _cache.insert(obj, key) self.assertIs(_cache.lookup(key), obj) def test_invalid_lookup(self): _cache = interfaces.cache._Cache() key = 'the key' test_array = numpy.random.randn(16) obj = builders.fft(test_array) _cache.insert(obj, key) self.assertRaises(KeyError, _cache.lookup, 'wrong_key') def test_keepalive_time_update(self): _cache = interfaces.cache._Cache() # The default self.assertEqual(_cache.keepalive_time, 0.1) _cache.set_keepalive_time(0.3) self.assertEqual(_cache.keepalive_time, 0.3) _cache.set_keepalive_time(10.0) self.assertEqual(_cache.keepalive_time, 10.0) _cache.set_keepalive_time('0.2') self.assertEqual(_cache.keepalive_time, 0.2) with self.assertRaises(ValueError): _cache.set_keepalive_time('foo') with self.assertRaises(TypeError): _cache.set_keepalive_time([]) def test_contains(self): _cache = interfaces.cache._Cache() key = 'the key' test_array = numpy.random.randn(16) obj = builders.fft(test_array) _cache.insert(obj, key) self.assertTrue(key in _cache) self.assertFalse('Not a key' in _cache) def test_objects_removed_after_keepalive(self): _cache = interfaces.cache._Cache() key = 'the key' test_array = numpy.random.randn(16) obj = builders.fft(test_array) _cache.insert(obj, key) self.assertIs(_cache.lookup(key), obj) keepalive_time = _cache.keepalive_time if os.name == 'nt': # A hack to keep appveyor from falling over here. I suspect the # contention is too much to work properly. Either way, let's # assume it's a windows problem for now... time.sleep(keepalive_time * 8) else: # Relax a bit more otherwise time.sleep(keepalive_time * 4) self.assertRaises(KeyError, _cache.lookup, key) _cache.insert(obj, key) old_keepalive_time = _cache.keepalive_time _cache.set_keepalive_time(old_keepalive_time * 4) self.assertIs(_cache.lookup(key), obj) time.sleep(old_keepalive_time * 3.5) # still should be there self.assertIs(_cache.lookup(key), obj) if os.name == 'nt': # As above, but with a bit longer time.sleep(old_keepalive_time * 16) else: time.sleep(old_keepalive_time * 8) self.assertRaises(KeyError, _cache.lookup, key) class InterfacesNumpyFFTCacheTestIFFT(InterfacesNumpyFFTCacheTestFFT): func = 'ifft' class InterfacesNumpyFFTCacheTestRFFT(InterfacesNumpyFFTCacheTestFFT): func = 'rfft' class InterfacesNumpyFFTCacheTestIRFFT(InterfacesNumpyFFTCacheTestFFT): func = 'irfft' realinv = True class InterfacesNumpyFFTCacheTestFFT2(InterfacesNumpyFFTCacheTestFFT): axes_kw = 'axes' func = 'ifft2' test_shapes = ( ((128, 64), {'axes': None}), ((128, 32), {'axes': None}), ((32, 64), {'axes': (-2, -1)}), ((4, 6, 8, 4), {'axes': (0, 3)}), ) invalid_args = ( ((100,), ((100, 200),), ValueError, 'Shape error'), ((100, 200), ((100, 200, 100),), ValueError, 'Shape error'), ((100,), ((100, 200), (-3, -2, -1)), ValueError, 'Shape error'), ((100, 200), (100, -1), TypeError, ''), ((100, 200), ((100, 200), (-3, -2)), IndexError, 'Invalid axes'), ((100, 200), ((100,), (-3,)), IndexError, 'Invalid axes')) class InterfacesNumpyFFTCacheTestIFFT2(InterfacesNumpyFFTCacheTestFFT2): func = 'ifft2' class InterfacesNumpyFFTCacheTestRFFT2(InterfacesNumpyFFTCacheTestFFT2): func = 'rfft2' class InterfacesNumpyFFTCacheTestIRFFT2(InterfacesNumpyFFTCacheTestFFT2): func = 'irfft2' realinv = True class InterfacesNumpyFFTCacheTestFFTN(InterfacesNumpyFFTCacheTestFFT2): func = 'ifftn' test_shapes = ( ((128, 32, 4), {'axes': None}), ((64, 128, 16), {'axes': (0, 1, 2)}), ((4, 6, 8, 4), {'axes': (0, 3, 1)}), ((4, 6, 8, 4), {'axes': (0, 3, 1, 2)}), ) class InterfacesNumpyFFTCacheTestIFFTN(InterfacesNumpyFFTCacheTestFFTN): func = 'ifftn' class InterfacesNumpyFFTCacheTestRFFTN(InterfacesNumpyFFTCacheTestFFTN): func = 'rfftn' class InterfacesNumpyFFTCacheTestIRFFTN(InterfacesNumpyFFTCacheTestFFTN): func = 'irfftn' realinv = True test_cases = ( CacheTest, InterfacesCacheTest, CacheSpecificInterfacesUtils, InterfacesNumpyFFTCacheTestFFT, InterfacesNumpyFFTCacheTestIFFT, InterfacesNumpyFFTCacheTestRFFT, InterfacesNumpyFFTCacheTestIRFFT, InterfacesNumpyFFTCacheTestFFT2, InterfacesNumpyFFTCacheTestIFFT2, InterfacesNumpyFFTCacheTestRFFT2, InterfacesNumpyFFTCacheTestIRFFT2, InterfacesNumpyFFTCacheTestFFTN, InterfacesNumpyFFTCacheTestIFFTN, InterfacesNumpyFFTCacheTestRFFTN, InterfacesNumpyFFTCacheTestIRFFTN,) test_set = None if __name__ == '__main__': run_test_suites(test_cases, test_set) pyFFTW-0.10.1/test/test_pyfftw_scipy_interface.py0000664000175000017500000001452512570060606021455 0ustar whgwhg00000000000000# Copyright 2014 Knowledge Economy Developments Ltd # # Henry Gomersall # heng@kedevelopments.co.uk # # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, this # list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright notice, # this list of conditions and the following disclaimer in the documentation # and/or other materials provided with the distribution. # # * Neither the name of the copyright holder nor the names of its contributors # may be used to endorse or promote products derived from this software without # specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. # from pyfftw.interfaces import scipy_fftpack import pyfftw import numpy try: import scipy import scipy.fftpack import scipy.signal except ImportError: scipy_missing = True else: scipy_missing = False import unittest from .test_pyfftw_base import run_test_suites from . import test_pyfftw_numpy_interface '''pyfftw.interfaces.scipy_fftpack just wraps pyfftw.interfaces.numpy_fft. All the tests here just check that the call is made correctly. ''' funcs = ('fft','ifft', 'fft2', 'ifft2', 'fftn', 'ifftn', 'rfft', 'irfft') acquired_names = ('dct', 'idct', 'diff', 'tilbert', 'itilbert', 'hilbert', 'ihilbert', 'cs_diff', 'sc_diff', 'ss_diff', 'cc_diff', 'shift', 'fftshift', 'ifftshift', 'fftfreq', 'rfftfreq', 'convolve', '_fftpack') def make_complex_data(shape, dtype): ar, ai = dtype(numpy.random.randn(2, *shape)) return ar + 1j*ai def make_r2c_real_data(shape, dtype): return dtype(numpy.random.randn(*shape)) def make_c2r_real_data(shape, dtype): return dtype(numpy.random.randn(*shape)) make_complex_data = test_pyfftw_numpy_interface.make_complex_data complex_dtypes = test_pyfftw_numpy_interface.complex_dtypes real_dtypes = test_pyfftw_numpy_interface.real_dtypes def numpy_fft_replacement(a, s, axes, overwrite_input, planner_effort, threads, auto_align_input, auto_contiguous): return (a, s, axes, overwrite_input, planner_effort, threads, auto_align_input, auto_contiguous) io_dtypes = { 'complex': (complex_dtypes, make_complex_data), 'r2c': (real_dtypes, make_r2c_real_data), 'c2r': (real_dtypes, make_c2r_real_data)} @unittest.skipIf(scipy_missing, 'scipy is not installed, so this feature is' 'unavailable') class InterfacesScipyFFTPackTestSimple(unittest.TestCase): ''' A really simple test suite to check simple implementation. ''' def test_scipy_overwrite(self): scipy_fftn = scipy.signal.signaltools.fftn scipy_ifftn = scipy.signal.signaltools.ifftn a = pyfftw.empty_aligned((128, 64), dtype='complex128', n=16) b = pyfftw.empty_aligned((128, 64), dtype='complex128', n=16) a[:] = (numpy.random.randn(*a.shape) + 1j*numpy.random.randn(*a.shape)) b[:] = (numpy.random.randn(*b.shape) + 1j*numpy.random.randn(*b.shape)) scipy_c = scipy.signal.fftconvolve(a, b) scipy.signal.signaltools.fftn = scipy_fftpack.fftn scipy.signal.signaltools.ifftn = scipy_fftpack.ifftn scipy_replaced_c = scipy.signal.fftconvolve(a, b) self.assertTrue(numpy.allclose(scipy_c, scipy_replaced_c)) scipy.signal.signaltools.fftn = scipy_fftn scipy.signal.signaltools.ifftn = scipy_ifftn def test_funcs(self): for each_func in funcs: func_being_replaced = getattr(scipy_fftpack, each_func) #create args (8 of them) args = [] for n in range(8): args.append(object()) args = tuple(args) try: setattr(scipy_fftpack, each_func, numpy_fft_replacement) return_args = getattr(scipy_fftpack, each_func)(*args) for n, each_arg in enumerate(args): # Check that what comes back is what is sent # (which it should be) self.assertIs(each_arg, return_args[n]) except: raise finally: setattr(scipy_fftpack, each_func, func_being_replaced) def test_acquired_names(self): for each_name in acquired_names: fftpack_attr = getattr(scipy.fftpack, each_name) acquired_attr = getattr(scipy_fftpack, each_name) self.assertIs(fftpack_attr, acquired_attr) # Construct all the test classes automatically. built_classes = [] for each_func in funcs: class_name = 'InterfacesScipyFFTPackTest' + each_func.upper() parent_class_name = 'InterfacesNumpyFFTTest' + each_func.upper() parent_class = getattr(test_pyfftw_numpy_interface, parent_class_name) class_dict = {'validator_module': scipy.fftpack, 'test_interface': scipy_fftpack, 'io_dtypes': io_dtypes, 'overwrite_input_flag': 'overwrite_x', 'default_s_from_shape_slicer': slice(None)} globals()[class_name] = type(class_name, (parent_class,), class_dict) built_classes.append(globals()[class_name]) built_classes = tuple(built_classes) test_cases = ( InterfacesScipyFFTPackTestSimple,) + built_classes test_set = None #test_set = {'InterfacesScipyFFTPackTestIFFTN': ['test_auto_align_input']} if __name__ == '__main__': run_test_suites(test_cases, test_set) pyFFTW-0.10.1/test/test_pyfftw_wisdom.py0000664000175000017500000000553512570060606017611 0ustar whgwhg00000000000000# Copyright 2014 Knowledge Economy Developments Ltd # # Henry Gomersall # heng@kedevelopments.co.uk # # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, this # list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright notice, # this list of conditions and the following disclaimer in the documentation # and/or other materials provided with the distribution. # # * Neither the name of the copyright holder nor the names of its contributors # may be used to endorse or promote products derived from this software without # specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. # from pyfftw import ( FFTW, empty_aligned, export_wisdom, import_wisdom, forget_wisdom) from .test_pyfftw_base import run_test_suites import numpy import pickle import unittest class FFTWWisdomTest(unittest.TestCase): def generate_wisdom(self): for each_dtype in (numpy.complex128, numpy.complex64, numpy.clongdouble): a = empty_aligned((1,1024), each_dtype, n=16) b = empty_aligned(a.shape, dtype=a.dtype, n=16) fft = FFTW(a,b) def test_export(self): forget_wisdom() before_wisdom = export_wisdom() self.generate_wisdom() after_wisdom = export_wisdom() for n in range(0,2): self.assertNotEqual(before_wisdom[n], after_wisdom[n]) def test_import(self): forget_wisdom() self.generate_wisdom() after_wisdom = export_wisdom() forget_wisdom() before_wisdom = export_wisdom() success = import_wisdom(after_wisdom) for n in range(0,2): self.assertNotEqual(before_wisdom[n], after_wisdom[n]) self.assertEqual(success, (True, True, True)) test_cases = ( FFTWWisdomTest,) test_set = None if __name__ == '__main__': run_test_suites(test_cases, test_set) pyFFTW-0.10.1/test/test_pyfftw_utils.py0000664000175000017500000000607512570060606017447 0ustar whgwhg00000000000000# Copyright 2014 Knowledge Economy Developments Ltd # # Henry Gomersall # heng@kedevelopments.co.uk # # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, this # list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright notice, # this list of conditions and the following disclaimer in the documentation # and/or other materials provided with the distribution. # # * Neither the name of the copyright holder nor the names of its contributors # may be used to endorse or promote products derived from this software without # specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. # from .test_pyfftw_base import run_test_suites import unittest import pyfftw import platform import os def get_cpus_info(): if 'Linux' in platform.system(): # A simple /proc/cpuinfo parser with open(os.path.join('/', 'proc','cpuinfo'), 'r') as f: cpus_info = [] idx = 0 for line in f.readlines(): if line.find(':') < 0: idx += 1 continue key, values = [each.strip() for each in line.split(':')] try: cpus_info[idx][key] = values except IndexError: cpus_info.append({key: values}) else: cpus_info = None return cpus_info class UtilsTest(unittest.TestCase): def setUp(self): return def tearDown(self): return @unittest.skipIf('Linux' not in platform.system(), 'Skipping as we only have it set up for Linux at present.') def test_get_alignment(self): cpus_info = get_cpus_info() for each_cpu in cpus_info: if 'avx' in each_cpu['flags']: self.assertTrue(pyfftw.simd_alignment == 32) elif 'sse' in each_cpu['flags']: self.assertTrue(pyfftw.simd_alignment == 16) else: self.assertTrue(pyfftw.simd_alignment == 1) test_cases = ( UtilsTest,) test_set = None if __name__ == '__main__': run_test_suites(test_cases, test_set) pyFFTW-0.10.1/test/test_pyfftw_complex.py0000664000175000017500000006442212652630177017765 0ustar whgwhg00000000000000# # Copyright 2014 Knowledge Economy Developments Ltd # # Henry Gomersall # heng@kedevelopments.co.uk # # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, this # list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright notice, # this list of conditions and the following disclaimer in the documentation # and/or other materials provided with the distribution. # # * Neither the name of the copyright holder nor the names of its contributors # may be used to endorse or promote products derived from this software without # specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. # from pyfftw import FFTW, byte_align, empty_aligned, forget_wisdom import pyfftw import numpy from timeit import Timer import time import unittest from .test_pyfftw_base import FFTWBaseTest, run_test_suites # We make this 1D case not inherit from FFTWBaseTest. # It needs to be combined with FFTWBaseTest to work. # This allows us to separate out tests that are use # in multiple locations. class Complex64FFTW1DTest(object): def test_time(self): in_shape = self.input_shapes['2d'] out_shape = self.output_shapes['2d'] axes=(-1,) a, b = self.create_test_arrays(in_shape, out_shape) fft, ifft = self.run_validate_fft(a, b, axes) self.timer_routine(fft.execute, lambda: self.np_fft_comparison(a)) self.assertTrue(True) def test_invalid_args_raise(self): in_shape = self.input_shapes['1d'] out_shape = self.output_shapes['1d'] axes=(-1,) a, b = self.create_test_arrays(in_shape, out_shape) # Note "thread" is incorrect, it should be "threads" self.assertRaises(TypeError, FFTW, a, b, axes, thread=4) def test_1d(self): in_shape = self.input_shapes['1d'] out_shape = self.output_shapes['1d'] axes=(0,) a, b = self.create_test_arrays(in_shape, out_shape) self.run_validate_fft(a, b, axes) def test_multiple_1d(self): in_shape = self.input_shapes['2d'] out_shape = self.output_shapes['2d'] axes=(-1,) a, b = self.create_test_arrays(in_shape, out_shape) self.run_validate_fft(a, b, axes) def test_default_args(self): in_shape = self.input_shapes['2d'] out_shape = self.output_shapes['2d'] a, b = self.create_test_arrays(in_shape, out_shape) fft = FFTW(a,b) fft.execute() ref_b = self.reference_fftn(a, axes=(-1,)) self.assertTrue(numpy.allclose(b, ref_b, rtol=1e-2, atol=1e-3)) def test_time_with_array_update(self): in_shape = self.input_shapes['2d'] out_shape = self.output_shapes['2d'] axes=(-1,) a, b = self.create_test_arrays(in_shape, out_shape) fft, ifft = self.run_validate_fft(a, b, axes) def fftw_callable(): fft.update_arrays(a,b) fft.execute() self.timer_routine(fftw_callable, lambda: self.np_fft_comparison(a)) self.assertTrue(True) def test_planning_time_limit(self): in_shape = self.input_shapes['1d'] out_shape = self.output_shapes['1d'] axes=(0,) a, b = self.create_test_arrays(in_shape, out_shape) # run this a few times runs = 10 t1 = time.time() for n in range(runs): forget_wisdom() fft = FFTW(a, b, axes=axes) unlimited_time = (time.time() - t1)/runs time_limit = (unlimited_time)/8 # Now do it again but with an upper limit on the time t1 = time.time() for n in range(runs): forget_wisdom() fft = FFTW(a, b, axes=axes, planning_timelimit=time_limit) limited_time = (time.time() - t1)/runs import sys if sys.platform == 'win32': # Give a 6x margin on windows. The timers are low # precision and FFTW seems to take longer anyway. # Also, we need to allow for processor contention which # Appveyor seems prone to. self.assertTrue(limited_time < time_limit*6) else: # Otherwise have a 2x margin self.assertTrue(limited_time < time_limit*2) def test_invalid_planning_time_limit(self): in_shape = self.input_shapes['1d'] out_shape = self.output_shapes['1d'] axes=(0,) a, b = self.create_test_arrays(in_shape, out_shape) self.assertRaisesRegex(TypeError, 'Invalid planning timelimit', FFTW, *(a,b, axes), **{'planning_timelimit': 'foo'}) def test_planner_flags(self): '''Test all the planner flags on a small array ''' in_shape = self.input_shapes['small_1d'] out_shape = self.output_shapes['small_1d'] axes=(0,) a, b = self.create_test_arrays(in_shape, out_shape) for each_flag in pyfftw.pyfftw._flag_dict: if each_flag == 'FFTW_WISDOM_ONLY': continue fft, ifft = self.run_validate_fft(a, b, axes, flags=(each_flag,)) self.assertTrue(each_flag in fft.flags) self.assertTrue(each_flag in ifft.flags) # also, test no flags (which should still work) fft, ifft = self.run_validate_fft(a, b, axes, flags=()) def test_wisdom_only(self): in_shape = self.input_shapes['small_1d'] out_shape = self.output_shapes['small_1d'] axes=(0,) a, b = self.create_test_arrays(in_shape, out_shape) forget_wisdom() # with no wisdom, an error should be raised with FFTW_WISDOM_ONLY # # NB: wisdom is specific to aligned/unaligned distinction, so we must # ensure that the arrays don't get copied (and potentially # switched between aligned and unaligned) by run_validate_fft()... self.assertRaisesRegex(RuntimeError, 'No FFTW wisdom', self.run_validate_fft, *(a, b, axes), **{'flags':('FFTW_ESTIMATE', 'FFTW_WISDOM_ONLY'), 'create_array_copies': False}) # now plan the FFT self.run_validate_fft(a, b, axes, flags=('FFTW_ESTIMATE',), create_array_copies=False) # now FFTW_WISDOM_ONLY should not raise an error because the plan should # be in the wisdom self.run_validate_fft(a, b, axes, flags=('FFTW_ESTIMATE', 'FFTW_WISDOM_ONLY'), create_array_copies=False) def test_destroy_input(self): '''Test the destroy input flag ''' # We can't really test it actually destroys the input, as it might # not (plus it's not exactly something we want). # It's enough just to check it runs ok with that flag. in_shape = self.input_shapes['1d'] out_shape = self.output_shapes['1d'] axes=(0,) a, b = self.create_test_arrays(in_shape, out_shape) self.run_validate_fft(a, b, axes, flags=('FFTW_ESTIMATE','FFTW_DESTROY_INPUT')) def test_invalid_flag_fail(self): '''Test passing a garbage flag fails ''' in_shape = self.input_shapes['1d'] out_shape = self.output_shapes['1d'] axes=(0,) a, b = self.create_test_arrays(in_shape, out_shape) self.assertRaisesRegex(ValueError, 'Invalid flag', self.run_validate_fft, *(a, b, axes), **{'flags':('garbage',)}) def test_alignment(self): '''Test to see if the alignment is returned correctly ''' in_shape = self.input_shapes['2d'] out_shape = self.output_shapes['2d'] input_dtype_alignment = self.get_input_dtype_alignment() output_dtype_alignment = self.get_output_dtype_alignment() axes=(-1,) a, b = self.create_test_arrays(in_shape, out_shape) a = byte_align(a, n=16) b = byte_align(b, n=16) fft, ifft = self.run_validate_fft(a, b, axes, force_unaligned_data=True) a, b = self.create_test_arrays(in_shape, out_shape) a = byte_align(a, n=16) b = byte_align(b, n=16) a_orig = a.copy() b_orig = b.copy() # Offset from 16 byte aligned to guarantee it's not # 16 byte aligned a__ = empty_aligned( numpy.prod(in_shape)*a.itemsize + input_dtype_alignment, dtype='int8', n=16) a_ = (a__[input_dtype_alignment:] .view(dtype=self.input_dtype).reshape(*in_shape)) a_[:] = a b__ = empty_aligned( numpy.prod(out_shape)*b.itemsize + input_dtype_alignment, dtype='int8', n=16) b_ = (b__[input_dtype_alignment:] .view(dtype=self.output_dtype).reshape(*out_shape)) b_[:] = b a[:] = a_orig fft, ifft = self.run_validate_fft(a, b, axes, create_array_copies=False) self.assertTrue(fft.input_alignment == 16) self.assertTrue(fft.output_alignment == 16) a[:] = a_orig fft, ifft = self.run_validate_fft(a, b_, axes, create_array_copies=False) self.assertTrue(fft.input_alignment == input_dtype_alignment) self.assertTrue(fft.output_alignment == output_dtype_alignment) a_[:] = a_orig fft, ifft = self.run_validate_fft(a_, b, axes, create_array_copies=False) self.assertTrue(fft.input_alignment == input_dtype_alignment) self.assertTrue(fft.output_alignment == output_dtype_alignment) a_[:] = a_orig fft, ifft = self.run_validate_fft(a_, b_, axes, create_array_copies=False) self.assertTrue(fft.input_alignment == input_dtype_alignment) self.assertTrue(fft.output_alignment == output_dtype_alignment) a[:] = a_orig fft, ifft = self.run_validate_fft(a, b, axes, create_array_copies=False, force_unaligned_data=True) self.assertTrue(fft.input_alignment == input_dtype_alignment) self.assertTrue(fft.output_alignment == output_dtype_alignment) def test_incorrect_byte_alignment_fails(self): in_shape = self.input_shapes['2d'] out_shape = self.output_shapes['2d'] input_dtype_alignment = self.get_input_dtype_alignment() axes=(-1,) a, b = self.create_test_arrays(in_shape, out_shape) a = byte_align(a, n=16) b = byte_align(b, n=16) fft, ifft = self.run_validate_fft(a, b, axes, force_unaligned_data=True) a, b = self.create_test_arrays(in_shape, out_shape) # Offset from 16 byte aligned to guarantee it's not # 16 byte aligned a__ = empty_aligned( numpy.prod(in_shape)*a.itemsize + 1, dtype='int8', n=16) a_ = a__[1:].view(dtype=self.input_dtype).reshape(*in_shape) a_[:] = a b__ = empty_aligned( numpy.prod(out_shape)*b.itemsize + 1, dtype='int8', n=16) b_ = b__[1:].view(dtype=self.output_dtype).reshape(*out_shape) b_[:] = b self.assertRaisesRegex(ValueError, 'Invalid output alignment', FFTW, *(a, b_)) self.assertRaisesRegex(ValueError, 'Invalid input alignment', FFTW, *(a_, b)) self.assertRaisesRegex(ValueError, 'Invalid input alignment', FFTW, *(a_, b_)) def test_zero_length_fft_axis_fail(self): in_shape = (1024, 0) out_shape = in_shape axes = (-1,) a, b = self.create_test_arrays(in_shape, out_shape) self.assertRaisesRegex(ValueError, 'Zero length array', self.run_validate_fft, *(a,b, axes)) def test_missized_fail(self): in_shape = self.input_shapes['2d'] _out_shape = self.output_shapes['2d'] out_shape = (_out_shape[0]+1, _out_shape[1]) axes=(0,) a, b = self.create_test_arrays(in_shape, out_shape) with self.assertRaisesRegex(ValueError, 'Invalid shapes'): FFTW(a, b, axes, direction=self.direction) def test_missized_nonfft_axes_fail(self): in_shape = self.input_shapes['3d'] _out_shape = self.output_shapes['3d'] out_shape = (_out_shape[0], _out_shape[1]+1, _out_shape[2]) axes=(2,) a, b = self.create_test_arrays(in_shape, out_shape) with self.assertRaisesRegex(ValueError, 'Invalid shapes'): FFTW(a, b, direction=self.direction) def test_extra_dimension_fail(self): in_shape = self.input_shapes['2d'] _out_shape = self.output_shapes['2d'] out_shape = (2, _out_shape[0], _out_shape[1]) axes=(1,) a, b = self.create_test_arrays(in_shape, out_shape) with self.assertRaisesRegex(ValueError, 'Invalid shapes'): FFTW(a, b, direction=self.direction) def test_f_contiguous_1d(self): in_shape = self.input_shapes['2d'] out_shape = self.output_shapes['2d'] axes=(0,) a, b = self.create_test_arrays(in_shape, out_shape) # Taking the transpose just makes the array F contiguous a = a.transpose() b = b.transpose() self.run_validate_fft(a, b, axes, create_array_copies=False) def test_different_dtypes_fail(self): in_shape = self.input_shapes['2d'] out_shape = self.output_shapes['2d'] axes=(-1,) a, b = self.create_test_arrays(in_shape, out_shape) a_ = numpy.complex64(a) b_ = numpy.complex128(b) self.assertRaisesRegex(ValueError, 'Invalid scheme', FFTW, *(a_,b_)) a_ = numpy.complex128(a) b_ = numpy.complex64(b) self.assertRaisesRegex(ValueError, 'Invalid scheme', FFTW, *(a_,b_)) def test_update_data(self): in_shape = self.input_shapes['2d'] out_shape = self.output_shapes['2d'] axes=(-1,) a, b = self.create_test_arrays(in_shape, out_shape) fft, ifft = self.run_validate_fft(a, b, axes) a, b = self.create_test_arrays(in_shape, out_shape) self.run_validate_fft(a, b, axes, fft=fft, ifft=ifft) def test_with_not_ndarray_error(self): in_shape = self.input_shapes['2d'] out_shape = self.output_shapes['2d'] a, b = self.create_test_arrays(in_shape, out_shape) self.assertRaisesRegex(ValueError, 'Invalid output array', FFTW, *(a,10)) self.assertRaisesRegex(ValueError, 'Invalid input array', FFTW, *(10,b)) def test_update_data_with_not_ndarray_error(self): in_shape = self.input_shapes['2d'] out_shape = self.output_shapes['2d'] axes=(-1,) a, b = self.create_test_arrays(in_shape, out_shape) fft, ifft = self.run_validate_fft(a, b, axes, create_array_copies=False) self.assertRaisesRegex(ValueError, 'Invalid output array', fft.update_arrays, *(a,10)) self.assertRaisesRegex(ValueError, 'Invalid input array', fft.update_arrays, *(10,b)) def test_update_data_with_stride_error(self): in_shape = self.input_shapes['2d'] out_shape = self.output_shapes['2d'] axes=(-1,) a, b = self.create_test_arrays(in_shape, out_shape) fft, ifft = self.run_validate_fft(a, b, axes, create_array_copies=False) # We offset by 16 to make sure the byte alignment is still correct. in_shape = (in_shape[0]+16, in_shape[1]+16) out_shape = (out_shape[0]+16, out_shape[1]+16) a_, b_ = self.create_test_arrays(in_shape, out_shape) a_ = a_[16:,16:] b_ = b_[16:,16:] with self.assertRaisesRegex(ValueError, 'Invalid input striding'): self.run_validate_fft(a_, b, axes, fft=fft, ifft=ifft, create_array_copies=False) with self.assertRaisesRegex(ValueError, 'Invalid output striding'): self.run_validate_fft(a, b_, axes, fft=fft, ifft=ifft, create_array_copies=False) def test_update_data_with_shape_error(self): in_shape = self.input_shapes['2d'] out_shape = self.output_shapes['2d'] axes=(-1,) a, b = self.create_test_arrays(in_shape, out_shape) fft, ifft = self.run_validate_fft(a, b, axes) in_shape = (in_shape[0]-10, in_shape[1]) out_shape = (out_shape[0], out_shape[1]+5) a_, b_ = self.create_test_arrays(in_shape, out_shape) with self.assertRaisesRegex(ValueError, 'Invalid input shape'): self.run_validate_fft(a_, b, axes, fft=fft, ifft=ifft, create_array_copies=False) with self.assertRaisesRegex(ValueError, 'Invalid output shape'): self.run_validate_fft(a, b_, axes, fft=fft, ifft=ifft, create_array_copies=False) def test_update_unaligned_data_with_FFTW_UNALIGNED(self): in_shape = self.input_shapes['2d'] out_shape = self.output_shapes['2d'] input_dtype_alignment = self.get_input_dtype_alignment() axes=(-1,) a, b = self.create_test_arrays(in_shape, out_shape) a = byte_align(a, n=16) b = byte_align(b, n=16) fft, ifft = self.run_validate_fft(a, b, axes, force_unaligned_data=True) a, b = self.create_test_arrays(in_shape, out_shape) # Offset from 16 byte aligned to guarantee it's not # 16 byte aligned a__ = empty_aligned( numpy.prod(in_shape)*a.itemsize + input_dtype_alignment, dtype='int8', n=16) a_ = (a__[input_dtype_alignment:] .view(dtype=self.input_dtype).reshape(*in_shape)) a_[:] = a b__ = empty_aligned( numpy.prod(out_shape)*b.itemsize + input_dtype_alignment, dtype='int8', n=16) b_ = (b__[input_dtype_alignment:] .view(dtype=self.output_dtype).reshape(*out_shape)) b_[:] = b self.run_validate_fft(a, b_, axes, fft=fft, ifft=ifft) self.run_validate_fft(a_, b, axes, fft=fft, ifft=ifft) self.run_validate_fft(a_, b_, axes, fft=fft, ifft=ifft) def test_update_data_with_unaligned_original(self): in_shape = self.input_shapes['2d'] out_shape = self.output_shapes['2d'] input_dtype_alignment = self.get_input_dtype_alignment() axes=(-1,) a, b = self.create_test_arrays(in_shape, out_shape) # Offset from 16 byte aligned to guarantee it's not # 16 byte aligned a__ = empty_aligned( numpy.prod(in_shape)*a.itemsize + input_dtype_alignment, dtype='int8', n=16) a_ = a__[input_dtype_alignment:].view(dtype=self.input_dtype).reshape(*in_shape) a_[:] = a b__ = empty_aligned( numpy.prod(out_shape)*b.itemsize + input_dtype_alignment, dtype='int8', n=16) b_ = b__[input_dtype_alignment:].view(dtype=self.output_dtype).reshape(*out_shape) b_[:] = b fft, ifft = self.run_validate_fft(a_, b_, axes, force_unaligned_data=True) self.run_validate_fft(a, b_, axes, fft=fft, ifft=ifft) self.run_validate_fft(a_, b, axes, fft=fft, ifft=ifft) self.run_validate_fft(a_, b_, axes, fft=fft, ifft=ifft) def test_update_data_with_alignment_error(self): in_shape = self.input_shapes['2d'] out_shape = self.output_shapes['2d'] byte_error = 1 axes=(-1,) a, b = self.create_test_arrays(in_shape, out_shape) a = byte_align(a, n=16) b = byte_align(b, n=16) fft, ifft = self.run_validate_fft(a, b, axes) a, b = self.create_test_arrays(in_shape, out_shape) # Offset from 16 byte aligned to guarantee it's not # 16 byte aligned a__ = empty_aligned( numpy.prod(in_shape)*a.itemsize+byte_error, dtype='int8', n=16) a_ = (a__[byte_error:] .view(dtype=self.input_dtype).reshape(*in_shape)) a_[:] = a b__ = empty_aligned( numpy.prod(out_shape)*b.itemsize+byte_error, dtype='int8', n=16) b_ = (b__[byte_error:] .view(dtype=self.output_dtype).reshape(*out_shape)) b_[:] = b with self.assertRaisesRegex(ValueError, 'Invalid output alignment'): self.run_validate_fft(a, b_, axes, fft=fft, ifft=ifft, create_array_copies=False) with self.assertRaisesRegex(ValueError, 'Invalid input alignment'): self.run_validate_fft(a_, b, axes, fft=fft, ifft=ifft, create_array_copies=False) # Should also be true for the unaligned case fft, ifft = self.run_validate_fft(a, b, axes, force_unaligned_data=True) with self.assertRaisesRegex(ValueError, 'Invalid output alignment'): self.run_validate_fft(a, b_, axes, fft=fft, ifft=ifft, create_array_copies=False) with self.assertRaisesRegex(ValueError, 'Invalid input alignment'): self.run_validate_fft(a_, b, axes, fft=fft, ifft=ifft, create_array_copies=False) def test_invalid_axes(self): in_shape = self.input_shapes['2d'] out_shape = self.output_shapes['2d'] axes=(-3,) a, b = self.create_test_arrays(in_shape, out_shape) with self.assertRaisesRegex(IndexError, 'Invalid axes'): FFTW(a, b, axes, direction=self.direction) axes=(10,) with self.assertRaisesRegex(IndexError, 'Invalid axes'): FFTW(a, b, axes, direction=self.direction) class Complex64FFTWTest(Complex64FFTW1DTest, FFTWBaseTest): def test_2d(self): in_shape = self.input_shapes['2d'] out_shape = self.output_shapes['2d'] axes=(-2,-1) a, b = self.create_test_arrays(in_shape, out_shape) self.run_validate_fft(a, b, axes, create_array_copies=False) def test_multiple_2d(self): in_shape = self.input_shapes['3d'] out_shape = self.output_shapes['3d'] axes=(-2,-1) a, b = self.create_test_arrays(in_shape, out_shape) self.run_validate_fft(a, b, axes, create_array_copies=False) def test_3d(self): in_shape = self.input_shapes['3d'] out_shape = self.output_shapes['3d'] axes=(0, 1, 2) a, b = self.create_test_arrays(in_shape, out_shape) self.run_validate_fft(a, b, axes, create_array_copies=False) def test_non_monotonic_increasing_axes(self): '''Test the case where the axes arg does not monotonically increase. ''' axes=(1, 0) # We still need the shapes to work! in_shape = numpy.asarray(self.input_shapes['2d'])[list(axes)] out_shape = numpy.asarray(self.output_shapes['2d'])[list(axes)] a, b = self.create_test_arrays(in_shape, out_shape, axes=axes) self.run_validate_fft(a, b, axes, create_array_copies=False) def test_non_contiguous_2d(self): in_shape = self.input_shapes['2d'] out_shape = self.output_shapes['2d'] axes=(-2,-1) a, b = self.create_test_arrays(in_shape, out_shape) # Some arbitrary and crazy slicing a_sliced = a[12:200:3, 300:2041:9] # b needs to be the same size b_sliced = b[20:146:2, 100:1458:7] self.run_validate_fft(a_sliced, b_sliced, axes, create_array_copies=False) def test_non_contiguous_2d_in_3d(self): in_shape = (256, 4, 2048) out_shape = in_shape axes=(0,2) a, b = self.create_test_arrays(in_shape, out_shape) # Some arbitrary and crazy slicing a_sliced = a[12:200:3, :, 300:2041:9] # b needs to be the same size b_sliced = b[20:146:2, :, 100:1458:7] self.run_validate_fft(a_sliced, b_sliced, axes, create_array_copies=False) class Complex128FFTWTest(Complex64FFTWTest): def setUp(self): self.input_dtype = numpy.complex128 self.output_dtype = numpy.complex128 self.np_fft_comparison = numpy.fft.fft self.direction = 'FFTW_FORWARD' return class ComplexLongDoubleFFTWTest(Complex64FFTWTest): def setUp(self): self.input_dtype = numpy.clongdouble self.output_dtype = numpy.clongdouble self.np_fft_comparison = self.reference_fftn self.direction = 'FFTW_FORWARD' return def reference_fftn(self, a, axes): # numpy.fft.fftn doesn't support complex256 type, # so we need to compare to a lower precision type. a = numpy.complex128(a) return numpy.fft.fftn(a, axes=axes) @unittest.skip('numpy.fft has issues with this dtype.') def test_time(self): pass @unittest.skip('numpy.fft has issues with this dtype.') def test_time_with_array_update(self): pass test_cases = ( Complex64FFTWTest, Complex128FFTWTest, ComplexLongDoubleFFTWTest,) test_set = None #test_set = {'all':['test_alignment', 'test_incorrect_byte_alignment_fails']} if __name__ == '__main__': run_test_suites(test_cases, test_set) pyFFTW-0.10.1/test/test_pyfftw_numpy_interface.py0000664000175000017500000005352612640763213021504 0ustar whgwhg00000000000000# Copyright 2015 Knowledge Economy Developments Ltd # # Henry Gomersall # heng@kedevelopments.co.uk # # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, this # list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright notice, # this list of conditions and the following disclaimer in the documentation # and/or other materials provided with the distribution. # # * Neither the name of the copyright holder nor the names of its contributors # may be used to endorse or promote products derived from this software without # specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. # from pyfftw import interfaces from .test_pyfftw_base import run_test_suites from ._get_default_args import get_default_args import unittest import numpy from numpy import fft as np_fft import warnings import copy warnings.filterwarnings('always') if numpy.version.version <= '1.6.2': # We overwrite the broken _cook_nd_args with a fixed version. from ._cook_nd_args import _cook_nd_args numpy.fft.fftpack._cook_nd_args = _cook_nd_args complex_dtypes = (numpy.complex64, numpy.complex128, numpy.clongdouble) real_dtypes = (numpy.float32, numpy.float64, numpy.longdouble) def make_complex_data(shape, dtype): ar, ai = dtype(numpy.random.randn(2, *shape)) return ar + 1j*ai def make_real_data(shape, dtype): return dtype(numpy.random.randn(*shape)) functions = { 'fft': 'complex', 'ifft': 'complex', 'rfft': 'r2c', 'irfft': 'c2r', 'rfftn': 'r2c', 'hfft': 'c2r', 'ihfft': 'r2c', 'irfftn': 'c2r', 'rfft2': 'r2c', 'irfft2': 'c2r', 'fft2': 'complex', 'ifft2': 'complex', 'fftn': 'complex', 'ifftn': 'complex'} acquired_names = ('fftfreq', 'fftshift', 'ifftshift') class InterfacesNumpyFFTTestModule(unittest.TestCase): ''' A really simple test suite to check the module works as expected. ''' def test_acquired_names(self): for each_name in acquired_names: numpy_fft_attr = getattr(numpy.fft, each_name) acquired_attr = getattr(interfaces.numpy_fft, each_name) self.assertIs(numpy_fft_attr, acquired_attr) class InterfacesNumpyFFTTestFFT(unittest.TestCase): io_dtypes = { 'complex': (complex_dtypes, make_complex_data), 'r2c': (real_dtypes, make_real_data), 'c2r': (complex_dtypes, make_complex_data)} validator_module = np_fft test_interface = interfaces.numpy_fft func = 'fft' axes_kw = 'axis' overwrite_input_flag = 'overwrite_input' default_s_from_shape_slicer = slice(-1, None) test_shapes = ( ((100,), {}), ((128, 64), {'axis': 0}), ((128, 32), {'axis': -1}), ((59, 100), {}), ((59, 99), {'axis': -1}), ((59, 99), {'axis': 0}), ((32, 32, 4), {'axis': 1}), ((64, 128, 16), {}), ) # invalid_s_shapes is: # (size, invalid_args, error_type, error_string) invalid_args = ( ((100,), ((100, 200),), TypeError, ''), ((100, 200), ((100, 200),), TypeError, ''), ((100,), (100, (-2, -1)), TypeError, ''), ((100,), (100, -20), IndexError, '')) realinv = False @property def test_data(self): for test_shape, kwargs in self.test_shapes: axes = self.axes_from_kwargs(kwargs) s = self.s_from_kwargs(test_shape, kwargs) if self.realinv: test_shape = list(test_shape) test_shape[axes[-1]] = test_shape[axes[-1]]//2 + 1 test_shape = tuple(test_shape) yield test_shape, s, kwargs def __init__(self, *args, **kwargs): super(InterfacesNumpyFFTTestFFT, self).__init__(*args, **kwargs) # Assume python 3, but keep backwards compatibility if not hasattr(self, 'assertRaisesRegex'): self.assertRaisesRegex = self.assertRaisesRegexp def validate(self, array_type, test_shape, dtype, s, kwargs): # Do it without the cache # without: interfaces.cache.disable() self._validate(array_type, test_shape, dtype, s, kwargs) def munge_input_array(self, array, kwargs): return array def _validate(self, array_type, test_shape, dtype, s, kwargs): input_array = self.munge_input_array( array_type(test_shape, dtype), kwargs) orig_input_array = copy.copy(input_array) np_input_array = numpy.asarray(input_array) if np_input_array.dtype == 'clongdouble': np_input_array = numpy.complex128(input_array) elif np_input_array.dtype == 'longdouble': np_input_array = numpy.float64(input_array) with warnings.catch_warnings(record=True) as w: # We catch the warnings so as to pick up on when # a complex array is turned into a real array if 'axes' in kwargs: axes = {'axes': kwargs['axes']} elif 'axis' in kwargs: axes = {'axis': kwargs['axis']} else: axes = {} try: test_out_array = getattr(self.validator_module, self.func)( copy.copy(np_input_array), s, **axes) except Exception as e: interface_exception = None try: getattr(self.test_interface, self.func)( copy.copy(input_array), s, **kwargs) except Exception as _interface_exception: # It's necessary to assign the exception to the # already defined variable in Python 3. # See http://www.python.org/dev/peps/pep-3110/#semantic-changes interface_exception = _interface_exception # If the test interface raised, so must this. self.assertEqual(type(interface_exception), type(e), msg='Interface exception raised. ' + 'Testing for: ' + repr(e)) return output_array = getattr(self.test_interface, self.func)( copy.copy(input_array), s, **kwargs) if (functions[self.func] == 'r2c'): if numpy.iscomplexobj(input_array): if len(w) > 0: # Make sure a warning is raised self.assertIs( w[-1].category, numpy.ComplexWarning) self.assertTrue( numpy.allclose(output_array, test_out_array, rtol=1e-2, atol=1e-4)) input_precision_dtype = numpy.asanyarray(input_array).real.dtype self.assertEqual(input_precision_dtype, output_array.real.dtype) if (not self.overwrite_input_flag in kwargs or not kwargs[self.overwrite_input_flag]): self.assertTrue(numpy.allclose(input_array, orig_input_array)) return output_array def axes_from_kwargs(self, kwargs): default_args = get_default_args( getattr(self.test_interface, self.func)) if 'axis' in kwargs: axes = (kwargs['axis'],) elif 'axes' in kwargs: axes = kwargs['axes'] if axes is None: axes = default_args['axes'] else: if 'axis' in default_args: # default 1D axes = (default_args['axis'],) else: # default nD axes = default_args['axes'] if axes is None: axes = (-1,) return axes def s_from_kwargs(self, test_shape, kwargs): ''' Return either a scalar s or a tuple depending on whether axis or axes is specified ''' default_args = get_default_args( getattr(self.test_interface, self.func)) if 'axis' in kwargs: s = test_shape[kwargs['axis']] elif 'axes' in kwargs: axes = kwargs['axes'] if axes is not None: s = [] for each_axis in axes: s.append(test_shape[each_axis]) else: # default nD s = [] try: for each_axis in default_args['axes']: s.append(test_shape[each_axis]) except TypeError: try: s = list(test_shape[ self.default_s_from_shape_slicer]) except TypeError: # We had an integer as the default, so force # it to be a list s = [test_shape[self.default_s_from_shape_slicer]] else: if 'axis' in default_args: # default 1D s = test_shape[default_args['axis']] else: # default nD s = [] try: for each_axis in default_args['axes']: s.append(test_shape[each_axis]) except TypeError: s = None return s def test_valid(self): dtype_tuple = self.io_dtypes[functions[self.func]] for dtype in dtype_tuple[0]: for test_shape, s, kwargs in self.test_data: s = None self.validate(dtype_tuple[1], test_shape, dtype, s, kwargs) def test_on_non_numpy_array(self): dtype_tuple = self.io_dtypes[functions[self.func]] array_type = (lambda test_shape, dtype: dtype_tuple[1](test_shape, dtype).tolist()) for dtype in dtype_tuple[0]: for test_shape, s, kwargs in self.test_data: s = None self.validate(array_type, test_shape, dtype, s, kwargs) def test_fail_on_invalid_s_or_axes(self): dtype_tuple = self.io_dtypes[functions[self.func]] for dtype in dtype_tuple[0]: for test_shape, args, exception, e_str in self.invalid_args: input_array = dtype_tuple[1](test_shape, dtype) self.assertRaisesRegex(exception, e_str, getattr(self.test_interface, self.func), *((input_array,) + args)) def test_same_sized_s(self): dtype_tuple = self.io_dtypes[functions[self.func]] for dtype in dtype_tuple[0]: for test_shape, s, kwargs in self.test_data: self.validate(dtype_tuple[1], test_shape, dtype, s, kwargs) def test_bigger_s(self): dtype_tuple = self.io_dtypes[functions[self.func]] for dtype in dtype_tuple[0]: for test_shape, s, kwargs in self.test_data: try: for each_axis, length in enumerate(s): s[each_axis] += 2 except TypeError: s += 2 self.validate(dtype_tuple[1], test_shape, dtype, s, kwargs) def test_smaller_s(self): dtype_tuple = self.io_dtypes[functions[self.func]] for dtype in dtype_tuple[0]: for test_shape, s, kwargs in self.test_data: try: for each_axis, length in enumerate(s): s[each_axis] -= 2 except TypeError: s -= 2 self.validate(dtype_tuple[1], test_shape, dtype, s, kwargs) def check_arg(self, arg, arg_test_values, array_type, test_shape, dtype, s, kwargs): '''Check that the correct arg is passed to the builder''' # We trust the builders to work as expected when passed # the correct arg (the builders have their own unittests). return_values = [] input_array = array_type(test_shape, dtype) def fake_fft(*args, **kwargs): return_values.append((args, kwargs)) return (args, kwargs) try: # Replace the function that is to be used real_fft = getattr(self.test_interface, self.func) setattr(self.test_interface, self.func, fake_fft) _kwargs = kwargs.copy() for each_value in arg_test_values: _kwargs[arg] = each_value builder_args = getattr(self.test_interface, self.func)( input_array.copy(), s, **_kwargs) self.assertTrue(builder_args[1][arg] == each_value) # make sure it was called self.assertTrue(len(return_values) > 0) except: raise finally: # Make sure we set it back setattr(self.test_interface, self.func, real_fft) # Validate it aswell for each_value in arg_test_values: _kwargs[arg] = each_value builder_args = getattr(self.test_interface, self.func)( input_array.copy(), s, **_kwargs) self.validate(array_type, test_shape, dtype, s, _kwargs) def test_auto_align_input(self): dtype_tuple = self.io_dtypes[functions[self.func]] for dtype in dtype_tuple[0]: for test_shape, s, kwargs in self.test_data: self.check_arg('auto_align_input', (True, False), dtype_tuple[1], test_shape, dtype, s, kwargs) def test_auto_contiguous_input(self): dtype_tuple = self.io_dtypes[functions[self.func]] for dtype in dtype_tuple[0]: for test_shape, s, kwargs in self.test_data: self.check_arg('auto_contiguous', (True, False), dtype_tuple[1], test_shape, dtype, s, kwargs) def test_bigger_and_smaller_s(self): dtype_tuple = self.io_dtypes[functions[self.func]] for dtype in dtype_tuple[0]: i = -1 for test_shape, s, kwargs in self.test_data: try: for each_axis, length in enumerate(s): s[each_axis] += i * 2 i *= i except TypeError: s += i * 2 i *= i self.validate(dtype_tuple[1], test_shape, dtype, s, kwargs) def test_dtype_coercian(self): # Make sure we input a dtype that needs to be coerced if functions[self.func] == 'r2c': dtype_tuple = self.io_dtypes['complex'] else: dtype_tuple = self.io_dtypes['r2c'] for dtype in dtype_tuple[0]: for test_shape, s, kwargs in self.test_data: s = None self.validate(dtype_tuple[1], test_shape, dtype, s, kwargs) def test_planner_effort(self): '''Test the planner effort arg ''' dtype_tuple = self.io_dtypes[functions[self.func]] test_shape = (16,) for dtype in dtype_tuple[0]: s = None if self.axes_kw == 'axis': kwargs = {'axis': -1} else: kwargs = {'axes': (-1,)} for each_effort in ('FFTW_ESTIMATE', 'FFTW_MEASURE', 'FFTW_PATIENT', 'FFTW_EXHAUSTIVE'): kwargs['planner_effort'] = each_effort self.validate( dtype_tuple[1], test_shape, dtype, s, kwargs) kwargs['planner_effort'] = 'garbage' self.assertRaisesRegex(ValueError, 'Invalid planner effort', self.validate, *(dtype_tuple[1], test_shape, dtype, s, kwargs)) def test_threads_arg(self): '''Test the threads argument ''' dtype_tuple = self.io_dtypes[functions[self.func]] test_shape = (16,) for dtype in dtype_tuple[0]: s = None if self.axes_kw == 'axis': kwargs = {'axis': -1} else: kwargs = {'axes': (-1,)} self.check_arg('threads', (1, 2, 5, 10), dtype_tuple[1], test_shape, dtype, s, kwargs) kwargs['threads'] = 'bleh' # Should not work self.assertRaises(TypeError, self.validate, *(dtype_tuple[1], test_shape, dtype, s, kwargs)) def test_overwrite_input(self): '''Test the overwrite_input flag ''' dtype_tuple = self.io_dtypes[functions[self.func]] for dtype in dtype_tuple[0]: for test_shape, s, _kwargs in self.test_data: s = None kwargs = _kwargs.copy() self.validate(dtype_tuple[1], test_shape, dtype, s, kwargs) self.check_arg(self.overwrite_input_flag, (True, False), dtype_tuple[1], test_shape, dtype, s, kwargs) def test_input_maintained(self): '''Test to make sure the input is maintained by default. ''' dtype_tuple = self.io_dtypes[functions[self.func]] for dtype in dtype_tuple[0]: for test_shape, s, kwargs in self.test_data: input_array = dtype_tuple[1](test_shape, dtype) orig_input_array = input_array.copy() getattr(self.test_interface, self.func)( input_array, s, **kwargs) self.assertTrue( numpy.alltrue(input_array == orig_input_array)) class InterfacesNumpyFFTTestIFFT(InterfacesNumpyFFTTestFFT): func = 'ifft' class InterfacesNumpyFFTTestRFFT(InterfacesNumpyFFTTestFFT): func = 'rfft' class InterfacesNumpyFFTTestIRFFT(InterfacesNumpyFFTTestFFT): func = 'irfft' realinv = True class InterfacesNumpyFFTTestHFFT(InterfacesNumpyFFTTestFFT): func = 'hfft' realinv = True class InterfacesNumpyFFTTestIHFFT(InterfacesNumpyFFTTestFFT): func = 'ihfft' class InterfacesNumpyFFTTestFFT2(InterfacesNumpyFFTTestFFT): axes_kw = 'axes' func = 'ifft2' test_shapes = ( ((128, 64), {'axes': None}), ((128, 32), {'axes': None}), ((128, 32, 4), {'axes': (0, 2)}), ((59, 100), {'axes': (-2, -1)}), ((64, 128, 16), {'axes': (0, 2)}), ((4, 6, 8, 4), {'axes': (0, 3)}), ) invalid_args = ( ((100,), ((100, 200),), ValueError, 'Shape error'), ((100, 200), ((100, 200, 100),), ValueError, 'Shape error'), ((100,), ((100, 200), (-3, -2, -1)), ValueError, 'Shape error'), ((100, 200), (100, -1), TypeError, ''), ((100, 200), ((100, 200), (-3, -2)), IndexError, 'Invalid axes'), ((100, 200), ((100,), (-3,)), IndexError, 'Invalid axes')) def test_shape_and_s_different_lengths(self): dtype_tuple = self.io_dtypes[functions[self.func]] for dtype in dtype_tuple[0]: for test_shape, s, _kwargs in self.test_data: kwargs = copy.copy(_kwargs) try: s = s[1:] except TypeError: self.skipTest('Not meaningful test on 1d arrays.') del kwargs['axes'] self.validate(dtype_tuple[1], test_shape, dtype, s, kwargs) class InterfacesNumpyFFTTestIFFT2(InterfacesNumpyFFTTestFFT2): func = 'ifft2' class InterfacesNumpyFFTTestRFFT2(InterfacesNumpyFFTTestFFT2): func = 'rfft2' class InterfacesNumpyFFTTestIRFFT2(InterfacesNumpyFFTTestFFT2): func = 'irfft2' realinv = True class InterfacesNumpyFFTTestFFTN(InterfacesNumpyFFTTestFFT2): func = 'ifftn' test_shapes = ( ((128, 32, 4), {'axes': None}), ((64, 128, 16), {'axes': (0, 1, 2)}), ((4, 6, 8, 4), {'axes': (0, 3, 1)}), ((4, 6, 8, 4), {'axes': (0, 3, 1, 2)}), ) class InterfacesNumpyFFTTestIFFTN(InterfacesNumpyFFTTestFFTN): func = 'ifftn' class InterfacesNumpyFFTTestRFFTN(InterfacesNumpyFFTTestFFTN): func = 'rfftn' class InterfacesNumpyFFTTestIRFFTN(InterfacesNumpyFFTTestFFTN): func = 'irfftn' realinv = True test_cases = ( InterfacesNumpyFFTTestModule, InterfacesNumpyFFTTestFFT, InterfacesNumpyFFTTestIFFT, InterfacesNumpyFFTTestRFFT, InterfacesNumpyFFTTestIRFFT, InterfacesNumpyFFTTestHFFT, InterfacesNumpyFFTTestIHFFT, InterfacesNumpyFFTTestFFT2, InterfacesNumpyFFTTestIFFT2, InterfacesNumpyFFTTestRFFT2, InterfacesNumpyFFTTestIRFFT2, InterfacesNumpyFFTTestFFTN, InterfacesNumpyFFTTestIFFTN, InterfacesNumpyFFTTestRFFTN, InterfacesNumpyFFTTestIRFFTN,) #test_set = {'InterfacesNumpyFFTTestHFFT': ('test_valid',)} test_set = None if __name__ == '__main__': run_test_suites(test_cases, test_set) pyFFTW-0.10.1/test/test_pyfftw_real_backward.py0000664000175000017500000002660712570060606021073 0ustar whgwhg00000000000000# Copyright 2014 Knowledge Economy Developments Ltd # # Henry Gomersall # heng@kedevelopments.co.uk # # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, this # list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright notice, # this list of conditions and the following disclaimer in the documentation # and/or other materials provided with the distribution. # # * Neither the name of the copyright holder nor the names of its contributors # may be used to endorse or promote products derived from this software without # specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. # from pyfftw import FFTW, forget_wisdom import numpy from timeit import Timer import time from .test_pyfftw_base import run_test_suites import unittest from .test_pyfftw_complex import Complex64FFTWTest class RealBackwardDoubleFFTWTest(Complex64FFTWTest): def setUp(self): self.input_dtype = numpy.complex128 self.output_dtype = numpy.float64 self.np_fft_comparison = numpy.fft.irfft self.direction = 'FFTW_BACKWARD' def make_shapes(self): self.input_shapes = { 'small_1d': (9,), '1d': (1025,), '2d': (256, 1025), '3d': (5, 256, 1025)} self.output_shapes = { 'small_1d': (16,), '1d': (2048,), '2d': (256, 2048), '3d': (5, 256, 2048)} def test_invalid_args_raise(self): in_shape = self.input_shapes['1d'] out_shape = self.output_shapes['1d'] axes=(-1,) a, b = self.create_test_arrays(in_shape, out_shape) # Note "thread" is incorrect, it should be "threads" self.assertRaises(TypeError, FFTW, a, b, axes, direction='FFTW_BACKWARD', thread=4) def create_test_arrays(self, input_shape, output_shape, axes=None): a = self.input_dtype(numpy.random.randn(*input_shape) +1j*numpy.random.randn(*input_shape)) b = self.output_dtype(numpy.random.randn(*output_shape)) # We fill a by doing the forward FFT from b. # This means that the relevant bits that should be purely # real will be (for example the zero freq component). # This is easier than writing a complicate system to work it out. try: if axes == None: fft = FFTW(b,a,direction='FFTW_FORWARD') else: fft = FFTW(b,a,direction='FFTW_FORWARD', axes=axes) b[:] = self.output_dtype(numpy.random.randn(*output_shape)) fft.execute() scaling = numpy.prod(numpy.array(a.shape)) a = self.input_dtype(a/scaling) except ValueError: # In this case, we assume that it was meant to error, # so we can return what we want. pass b = self.output_dtype(numpy.random.randn(*output_shape)) return a, b def run_validate_fft(self, a, b, axes, fft=None, ifft=None, force_unaligned_data=False, create_array_copies=True, threads=1, flags=('FFTW_ESTIMATE',)): ''' *** EVERYTHING IS FLIPPED AROUND BECAUSE WE ARE VALIDATING AN INVERSE FFT *** Run a validation of the FFTW routines for the passed pair of arrays, a and b, and the axes argument. a and b are assumed to be the same shape (but not necessarily the same layout in memory). fft and ifft, if passed, should be instantiated FFTW objects. If force_unaligned_data is True, the flag FFTW_UNALIGNED will be passed to the fftw routines. ''' if create_array_copies: # Don't corrupt the original mutable arrays a = a.copy() b = b.copy() a_orig = a.copy() flags = list(flags) if force_unaligned_data: flags.append('FFTW_UNALIGNED') if ifft == None: ifft = FFTW(a, b, axes=axes, direction='FFTW_BACKWARD', flags=flags, threads=threads) else: ifft.update_arrays(a,b) if fft == None: fft = FFTW(b, a, axes=axes, direction='FFTW_FORWARD', flags=flags, threads=threads) else: fft.update_arrays(b,a) a[:] = a_orig # Test the inverse FFT by comparing it to the result from numpy.fft ifft.execute() a[:] = a_orig ref_b = self.reference_fftn(a, axes=axes) # The scaling is the product of the lengths of the fft along # the axes along which the fft is taken. scaling = numpy.prod(numpy.array(b.shape)[list(axes)]) self.assertEqual(ifft.N, scaling) self.assertEqual(fft.N, scaling) # This is actually quite a poor relative error, but it still # sometimes fails. I assume that numpy.fft has different internals # to fftw. self.assertTrue(numpy.allclose(b/scaling, ref_b, rtol=1e-2, atol=1e-3)) # Test the FFT by comparing the result to the starting # value (which is scaled as per FFTW being unnormalised). fft.execute() self.assertTrue(numpy.allclose(a/scaling, a_orig, rtol=1e-2, atol=1e-3)) return fft, ifft def test_time_with_array_update(self): in_shape = self.input_shapes['2d'] out_shape = self.output_shapes['2d'] axes=(-1,) a, b = self.create_test_arrays(in_shape, out_shape) fft, ifft = self.run_validate_fft(a, b, axes) def fftw_callable(): fft.update_arrays(b,a) fft.execute() self.timer_routine(fftw_callable, lambda: self.np_fft_comparison(a)) self.assertTrue(True) def reference_fftn(self, a, axes): # This needs to be an inverse return numpy.fft.irfftn(a, axes=axes) def test_wrong_direction_fail(self): in_shape = self.input_shapes['2d'] out_shape = self.output_shapes['2d'] axes=(-1,) a, b = self.create_test_arrays(in_shape, out_shape) with self.assertRaisesRegex(ValueError, 'Invalid direction'): FFTW(a, b, direction='FFTW_FORWARD') def test_planning_time_limit(self): in_shape = self.input_shapes['1d'] out_shape = self.output_shapes['1d'] axes=(0,) a, b = self.create_test_arrays(in_shape, out_shape) # run this a few times runs = 10 t1 = time.time() for n in range(runs): forget_wisdom() fft = FFTW(b, a, axes=axes) unlimited_time = (time.time() - t1)/runs time_limit = (unlimited_time)/8 # Now do it again but with an upper limit on the time t1 = time.time() for n in range(runs): forget_wisdom() fft = FFTW(b, a, axes=axes, planning_timelimit=time_limit) limited_time = (time.time() - t1)/runs import sys if sys.platform == 'win32': # Give a 4x margin on windows. The timers are low # precision and FFTW seems to take longer anyway self.assertTrue(limited_time < time_limit*4) else: # Otherwise have a 2x margin self.assertTrue(limited_time < time_limit*2) def test_invalid_planning_time_limit(self): in_shape = self.input_shapes['1d'] out_shape = self.output_shapes['1d'] axes=(0,) a, b = self.create_test_arrays(in_shape, out_shape) self.assertRaisesRegex(TypeError, 'Invalid planning timelimit', FFTW, *(b, a, axes), **{'planning_timelimit': 'foo'}) def test_default_args(self): in_shape = self.input_shapes['2d'] out_shape = self.output_shapes['2d'] a, b = self.create_test_arrays(in_shape, out_shape) # default args should fail for backwards transforms # (as the default is FFTW_FORWARD) with self.assertRaisesRegex(ValueError, 'Invalid direction'): FFTW(a, b) def test_non_contiguous_2d(self): in_shape = self.input_shapes['2d'] out_shape = self.output_shapes['2d'] axes=(-2,-1) a, b = self.create_test_arrays(in_shape, out_shape) # Some arbitrary and crazy slicing a_sliced = a[20:146:2, 100:786:7] # b needs to be compatible b_sliced = b[12:200:3, 300:2041:9] self.run_validate_fft(a_sliced, b_sliced, axes, create_array_copies=False) def test_non_contiguous_2d_in_3d(self): in_shape = (256, 4, 1025) out_shape = (256, 4, 2048) axes=(0,2) a, b = self.create_test_arrays(in_shape, out_shape) # Some arbitrary and crazy slicing a_sliced = a[20:146:2, :, 100:786:7] # b needs to be compatible b_sliced = b[12:200:3, :, 300:2041:9] # The data doesn't work, so we need to generate it for the # correct size a_, b_ = self.create_test_arrays(a_sliced.shape, b_sliced.shape, axes=axes) # And then copy it into the non contiguous array a_sliced[:] = a_ b_sliced[:] = b_ self.run_validate_fft(a_sliced, b_sliced, axes, create_array_copies=False) def test_non_monotonic_increasing_axes(self): super(RealBackwardDoubleFFTWTest, self).test_non_monotonic_increasing_axes() class RealBackwardSingleFFTWTest(RealBackwardDoubleFFTWTest): def setUp(self): self.input_dtype = numpy.complex64 self.output_dtype = numpy.float32 self.np_fft_comparison = numpy.fft.irfft self.direction = 'FFTW_BACKWARD' class RealBackwardLongDoubleFFTWTest(RealBackwardDoubleFFTWTest): def setUp(self): self.input_dtype = numpy.clongdouble self.output_dtype = numpy.longdouble self.np_fft_comparison = numpy.fft.irfft self.direction = 'FFTW_BACKWARD' def reference_fftn(self, a, axes): a = numpy.complex128(a) return numpy.fft.irfftn(a, axes=axes) @unittest.skip('numpy.fft has issues with this dtype.') def test_time(self): pass @unittest.skip('numpy.fft has issues with this dtype.') def test_time_with_array_update(self): pass test_cases = ( RealBackwardDoubleFFTWTest, RealBackwardSingleFFTWTest, RealBackwardLongDoubleFFTWTest,) test_set = None if __name__ == '__main__': run_test_suites(test_cases, test_set) del Complex64FFTWTest pyFFTW-0.10.1/test/test_pyfftw_real_forward.py0000664000175000017500000001203112570060606020743 0ustar whgwhg00000000000000# Copyright 2014 Knowledge Economy Developments Ltd # # Henry Gomersall # heng@kedevelopments.co.uk # # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, this # list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright notice, # this list of conditions and the following disclaimer in the documentation # and/or other materials provided with the distribution. # # * Neither the name of the copyright holder nor the names of its contributors # may be used to endorse or promote products derived from this software without # specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. # from pyfftw import FFTW import numpy from timeit import Timer from .test_pyfftw_base import run_test_suites import unittest from .test_pyfftw_complex import Complex64FFTWTest class RealForwardDoubleFFTWTest(Complex64FFTWTest): def setUp(self): self.input_dtype = numpy.float64 self.output_dtype = numpy.complex128 self.np_fft_comparison = numpy.fft.rfft self.direction = 'FFTW_FORWARD' def make_shapes(self): self.input_shapes = { 'small_1d': (16,), '1d': (2048,), '2d': (256, 2048), '3d': (5, 256, 2048)} self.output_shapes = { 'small_1d': (9,), '1d': (1025,), '2d': (256, 1025), '3d': (5, 256, 1025)} def create_test_arrays(self, input_shape, output_shape, axes=None): a = self.input_dtype(numpy.random.randn(*input_shape)) b = self.output_dtype(numpy.random.randn(*output_shape) +1j*numpy.random.randn(*output_shape)) return a, b def reference_fftn(self, a, axes): return numpy.fft.rfftn(a, axes=axes) def test_wrong_direction_fail(self): in_shape = self.input_shapes['2d'] out_shape = self.output_shapes['2d'] axes=(-1,) a, b = self.create_test_arrays(in_shape, out_shape) with self.assertRaisesRegex(ValueError, 'Invalid direction'): FFTW(a, b, direction='FFTW_BACKWARD') def test_non_contiguous_2d(self): in_shape = self.input_shapes['2d'] out_shape = self.output_shapes['2d'] axes=(-2,-1) a, b = self.create_test_arrays(in_shape, out_shape) # Some arbitrary and crazy slicing a_sliced = a[12:200:3, 300:2041:9] # b needs to be compatible b_sliced = b[20:146:2, 100:786:7] self.run_validate_fft(a_sliced, b_sliced, axes, create_array_copies=False) def test_non_contiguous_2d_in_3d(self): in_shape = (256, 4, 2048) out_shape = in_shape axes=(0,2) a, b = self.create_test_arrays(in_shape, out_shape) # Some arbitrary and crazy slicing a_sliced = a[12:200:3, :, 300:2041:9] # b needs to be compatible b_sliced = b[20:146:2, :, 100:786:7] self.run_validate_fft(a_sliced, b_sliced, axes, create_array_copies=False) class RealForwardSingleFFTWTest(RealForwardDoubleFFTWTest): def setUp(self): self.input_dtype = numpy.float32 self.output_dtype = numpy.complex64 self.np_fft_comparison = numpy.fft.rfft self.direction = 'FFTW_FORWARD' class RealForwardLongDoubleFFTWTest(RealForwardDoubleFFTWTest): def setUp(self): self.input_dtype = numpy.longdouble self.output_dtype = numpy.clongdouble self.np_fft_comparison = numpy.fft.rfft self.direction = 'FFTW_FORWARD' @unittest.skip('numpy.fft has issues with this dtype.') def test_time(self): pass @unittest.skip('numpy.fft has issues with this dtype.') def test_time_with_array_update(self): pass def reference_fftn(self, a, axes): a = numpy.float64(a) return numpy.fft.rfftn(a, axes=axes) test_cases = ( RealForwardDoubleFFTWTest, RealForwardSingleFFTWTest, RealForwardLongDoubleFFTWTest,) test_set = None if __name__ == '__main__': run_test_suites(test_cases, test_set) del Complex64FFTWTest pyFFTW-0.10.1/test/test_pyfftw_builders.py0000664000175000017500000012677412640763213020133 0ustar whgwhg00000000000000# Copyright 2015 Knowledge Economy Developments Ltd # # Henry Gomersall # heng@kedevelopments.co.uk # # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, this # list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright notice, # this list of conditions and the following disclaimer in the documentation # and/or other materials provided with the distribution. # # * Neither the name of the copyright holder nor the names of its contributors # may be used to endorse or promote products derived from this software without # specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. # from pyfftw import builders, empty_aligned, byte_align, FFTW from pyfftw.builders import _utils as utils from .test_pyfftw_base import run_test_suites from ._get_default_args import get_default_args import unittest import numpy import numpy as np from numpy import fft as np_fft import copy import warnings warnings.filterwarnings('always') complex_dtypes = (numpy.complex64, numpy.complex128, numpy.clongdouble) real_dtypes = (numpy.float32, numpy.float64, numpy.longdouble) def make_complex_data(shape, dtype): ar, ai = numpy.random.randn(2, *shape).astype(dtype) return ar + 1j*ai def make_real_data(shape, dtype): return numpy.random.randn(*shape).astype(dtype) input_dtypes = { 'complex': (complex_dtypes, make_complex_data), 'r2c': (real_dtypes, make_real_data), 'c2r': (complex_dtypes, make_complex_data)} output_dtypes = { 'complex': complex_dtypes, 'r2c': complex_dtypes, 'c2r': real_dtypes} functions = { 'fft': 'complex', 'ifft': 'complex', 'rfft': 'r2c', 'irfft': 'c2r', 'rfftn': 'r2c', 'irfftn': 'c2r', 'rfft2': 'r2c', 'irfft2': 'c2r', 'fft2': 'complex', 'ifft2': 'complex', 'fftn': 'complex', 'ifftn': 'complex'} class BuildersTestFFT(unittest.TestCase): func = 'fft' axes_kw = 'axis' test_shapes = ( ((100,), {}), ((128, 64), {'axis': 0}), ((128, 32), {'axis': -1}), ((59, 100), {}), ((32, 32, 4), {'axis': 1}), ((64, 128, 16), {}), ) # invalid_s_shapes is: # (size, invalid_args, error_type, error_string) invalid_args = ( ((100,), ((100, 200),), TypeError, ''), ((100, 200), ((100, 200),), TypeError, ''), ((100,), (100, (-2, -1)), TypeError, ''), ((100,), (100, -20), IndexError, '')) realinv = False def __init__(self, *args, **kwargs): super(BuildersTestFFT, self).__init__(*args, **kwargs) if not hasattr(self, 'assertRaisesRegex'): self.assertRaisesRegex = self.assertRaisesRegexp @property def test_data(self): for test_shape, kwargs in self.test_shapes: axes = self.axes_from_kwargs(kwargs) s = self.s_from_kwargs(test_shape, kwargs) if self.realinv: test_shape = list(test_shape) test_shape[axes[-1]] = test_shape[axes[-1]]//2 + 1 test_shape = tuple(test_shape) yield test_shape, s, kwargs def validate_pyfftw_object(self, array_type, test_shape, dtype, s, kwargs): input_array = array_type(test_shape, dtype) # Use char because of potential MSVC related bug. if input_array.dtype.char == np.dtype('clongdouble').char: np_input_array = numpy.complex128(input_array) elif input_array.dtype.char == np.dtype('longdouble').char: np_input_array = numpy.float64(input_array) else: np_input_array = input_array with warnings.catch_warnings(record=True) as w: # We catch the warnings so as to pick up on when # a complex array is turned into a real array FFTW_object = getattr(builders, self.func)( input_array.copy(), s, **kwargs) # We run FFT twice to check two operations don't # yield different results (which they might if # the state is buggered up). output_array = FFTW_object(input_array.copy()) output_array_2 = FFTW_object(input_array.copy()) if 'axes' in kwargs: axes = {'axes': kwargs['axes']} elif 'axis' in kwargs: axes = {'axis': kwargs['axis']} else: axes = {} test_out_array = getattr(np_fft, self.func)( np_input_array.copy(), s, **axes) if (functions[self.func] == 'r2c'): if numpy.iscomplexobj(input_array): if len(w) > 0: # Make sure a warning is raised self.assertIs( w[-1].category, numpy.ComplexWarning) self.assertTrue( numpy.allclose(output_array, test_out_array, rtol=1e-2, atol=1e-4)) self.assertTrue( numpy.allclose(output_array_2, test_out_array, rtol=1e-2, atol=1e-4)) return FFTW_object def axes_from_kwargs(self, kwargs): default_args = get_default_args(getattr(builders, self.func)) if 'axis' in kwargs: axes = (kwargs['axis'],) elif 'axes' in kwargs: axes = kwargs['axes'] if axes is None: axes = default_args['axes'] else: if 'axis' in default_args: # default 1D axes = (default_args['axis'],) else: # default nD axes = default_args['axes'] if axes is None: axes = (-1,) return axes def s_from_kwargs(self, test_shape, kwargs): ''' Return either a scalar s or a tuple depending on whether axis or axes is specified ''' default_args = get_default_args(getattr(builders, self.func)) if 'axis' in kwargs: s = test_shape[kwargs['axis']] elif 'axes' in kwargs: axes = kwargs['axes'] if axes is not None: s = [] for each_axis in axes: s.append(test_shape[each_axis]) else: # default nD s = [] try: for each_axis in default_args['axes']: s.append(test_shape[each_axis]) except TypeError: s = [test_shape[-1]] else: if 'axis' in default_args: # default 1D s = test_shape[default_args['axis']] else: # default nD s = [] try: for each_axis in default_args['axes']: s.append(test_shape[each_axis]) except TypeError: s = None return s def test_valid(self): dtype_tuple = input_dtypes[functions[self.func]] for dtype in dtype_tuple[0]: for test_shape, s, kwargs in self.test_data: s = None FFTW_object = self.validate_pyfftw_object(dtype_tuple[1], test_shape, dtype, s, kwargs) self.assertTrue(type(FFTW_object) == FFTW) def test_output_dtype_correct(self): '''The output dtype should be correct given the input dtype. It was noted that this is a particular problem on windows 64 due longdouble being mapped to double, but the dtype().char attribute still being different. ''' inp_dtype_tuple = input_dtypes[functions[self.func]] output_dtype_tuple = output_dtypes[functions[self.func]] for input_dtype, output_dtype in zip(inp_dtype_tuple[0], output_dtype_tuple): for test_shape, s, kwargs in self.test_data: s = None FFTW_object = self.validate_pyfftw_object(inp_dtype_tuple[1], test_shape, input_dtype, s, kwargs) self.assertTrue( FFTW_object.output_array.dtype.char == np.dtype(output_dtype).char) def test_fail_on_invalid_s_or_axes(self): dtype_tuple = input_dtypes[functions[self.func]] for dtype in dtype_tuple[0]: for test_shape, args, exception, e_str in self.invalid_args: input_array = dtype_tuple[1](test_shape, dtype) self.assertRaisesRegex(exception, e_str, getattr(builders, self.func), *((input_array,) + args)) def test_same_sized_s(self): dtype_tuple = input_dtypes[functions[self.func]] for dtype in dtype_tuple[0]: for test_shape, s, kwargs in self.test_data: FFTW_object = self.validate_pyfftw_object(dtype_tuple[1], test_shape, dtype, s, kwargs) self.assertTrue(type(FFTW_object) == FFTW) def test_bigger_s_overwrite_input(self): '''Test that FFTWWrapper deals with a destroyed input properly. ''' dtype_tuple = input_dtypes[functions[self.func]] for dtype in dtype_tuple[0]: for test_shape, s, kwargs in self.test_data: try: for each_axis, length in enumerate(s): s[each_axis] += 2 except TypeError: s += 2 _kwargs = kwargs.copy() if self.func not in ('irfft2', 'irfftn'): # They implicitly overwrite the input anyway _kwargs['overwrite_input'] = True FFTW_object = self.validate_pyfftw_object(dtype_tuple[1], test_shape, dtype, s, _kwargs) self.assertTrue( type(FFTW_object) == utils._FFTWWrapper) def test_bigger_s(self): dtype_tuple = input_dtypes[functions[self.func]] for dtype in dtype_tuple[0]: for test_shape, s, kwargs in self.test_data: try: for each_axis, length in enumerate(s): s[each_axis] += 2 except TypeError: s += 2 FFTW_object = self.validate_pyfftw_object(dtype_tuple[1], test_shape, dtype, s, kwargs) self.assertTrue( type(FFTW_object) == utils._FFTWWrapper) def test_smaller_s(self): dtype_tuple = input_dtypes[functions[self.func]] for dtype in dtype_tuple[0]: for test_shape, s, kwargs in self.test_data: try: for each_axis, length in enumerate(s): s[each_axis] -= 2 except TypeError: s -= 2 FFTW_object = self.validate_pyfftw_object(dtype_tuple[1], test_shape, dtype, s, kwargs) self.assertTrue( type(FFTW_object) == utils._FFTWWrapper) def test_bigger_and_smaller_s(self): dtype_tuple = input_dtypes[functions[self.func]] for dtype in dtype_tuple[0]: i = -1 for test_shape, s, kwargs in self.test_data: try: for each_axis, length in enumerate(s): s[each_axis] += i * 2 i *= i except TypeError: s += i * 2 i *= i FFTW_object = self.validate_pyfftw_object(dtype_tuple[1], test_shape, dtype, s, kwargs) self.assertTrue( type(FFTW_object) == utils._FFTWWrapper) def test_auto_contiguous_input(self): dtype_tuple = input_dtypes[functions[self.func]] for dtype in dtype_tuple[0]: for test_shape, s, kwargs in self.test_data: _kwargs = kwargs.copy() s1 = None s2 = copy.copy(s) try: for each_axis, length in enumerate(s): s2[each_axis] += 2 except TypeError: s2 += 2 _test_shape = [] slices = [] for each_dim in test_shape: _test_shape.append(each_dim*2) slices.append(slice(None, None, 2)) input_array = dtype_tuple[1](_test_shape, dtype)[slices] # check the input is non contiguous self.assertFalse(input_array.flags['C_CONTIGUOUS'] or input_array.flags['F_CONTIGUOUS']) # Firstly check the non-contiguous case (for both # FFTW and _FFTWWrapper) _kwargs['auto_contiguous'] = False # We also need to make sure we're not copying due # to a trivial misalignment _kwargs['auto_align_input'] = False FFTW_object = getattr(builders, self.func)( input_array, s1, **_kwargs) internal_input_array = FFTW_object.input_array flags = internal_input_array.flags self.assertTrue(input_array is internal_input_array) self.assertFalse(flags['C_CONTIGUOUS'] or flags['F_CONTIGUOUS']) FFTW_object = getattr(builders, self.func)( input_array, s2, **_kwargs) internal_input_array = FFTW_object.input_array flags = internal_input_array.flags # We actually expect the _FFTWWrapper to be C_CONTIGUOUS self.assertTrue(flags['C_CONTIGUOUS']) # Now for the contiguous case (for both # FFTW and _FFTWWrapper) _kwargs['auto_contiguous'] = True FFTW_object = getattr(builders, self.func)( input_array, s1, **_kwargs) internal_input_array = FFTW_object.input_array flags = internal_input_array.flags self.assertTrue(flags['C_CONTIGUOUS'] or flags['F_CONTIGUOUS']) FFTW_object = getattr(builders, self.func)( input_array, s2, **_kwargs) internal_input_array = FFTW_object.input_array flags = internal_input_array.flags # as above self.assertTrue(flags['C_CONTIGUOUS']) def test_auto_align_input(self): dtype_tuple = input_dtypes[functions[self.func]] for dtype in dtype_tuple[0]: for test_shape, s, kwargs in self.test_data: _kwargs = kwargs.copy() s1 = None s2 = copy.copy(s) try: for each_axis, length in enumerate(s): s2[each_axis] += 2 except TypeError: s2 += 2 input_array = dtype_tuple[1](test_shape, dtype) # Firstly check the unaligned case (for both # FFTW and _FFTWWrapper) _kwargs['auto_align_input'] = False FFTW_object = getattr(builders, self.func)( input_array.copy(), s1, **_kwargs) self.assertFalse(FFTW_object.simd_aligned) FFTW_object = getattr(builders, self.func)( input_array.copy(), s2, **_kwargs) self.assertFalse(FFTW_object.simd_aligned) # Now for the aligned case (for both # FFTW and _FFTWWrapper) _kwargs['auto_align_input'] = True FFTW_object = getattr(builders, self.func)( input_array.copy(), s1, **_kwargs) self.assertTrue(FFTW_object.simd_aligned) self.assertTrue('FFTW_UNALIGNED' not in FFTW_object.flags) FFTW_object = getattr(builders, self.func)( input_array.copy(), s2, **_kwargs) self.assertTrue(FFTW_object.simd_aligned) self.assertTrue('FFTW_UNALIGNED' not in FFTW_object.flags) def test_dtype_coercian(self): # Make sure we input a dtype that needs to be coerced if functions[self.func] == 'r2c': dtype_tuple = input_dtypes['complex'] else: dtype_tuple = input_dtypes['r2c'] for dtype in dtype_tuple[0]: for test_shape, s, kwargs in self.test_data: s = None FFTW_object = self.validate_pyfftw_object(dtype_tuple[1], test_shape, dtype, s, kwargs) self.assertTrue(type(FFTW_object) == FFTW) def test_persistent_padding(self): '''Test to confirm the padding it not touched after creation. ''' dtype_tuple = input_dtypes[functions[self.func]] for dtype in dtype_tuple[0]: for test_shape, s, kwargs in self.test_data: n_add = 2 # these slicers get the padding # from the internal input array padding_slicer = [slice(None)] * len(test_shape) axes = self.axes_from_kwargs(kwargs) try: for each_axis, length in enumerate(s): s[each_axis] += n_add padding_slicer[axes[each_axis]] = ( slice(s[each_axis], None)) except TypeError: s += n_add padding_slicer[axes[0]] = slice(s, None) # Get a valid object FFTW_object = self.validate_pyfftw_object(dtype_tuple[1], test_shape, dtype, s, kwargs) internal_array = FFTW_object.input_array padding = internal_array[padding_slicer] # Fill the padding with garbage initial_padding = dtype_tuple[1](padding.shape, dtype) padding[:] = initial_padding # Now confirm that nothing is done to the padding FFTW_object() final_padding = FFTW_object.input_array[padding_slicer] self.assertTrue(numpy.all(final_padding == initial_padding)) def test_planner_effort(self): '''Test the planner effort arg ''' dtype_tuple = input_dtypes[functions[self.func]] test_shape = (16,) for dtype in dtype_tuple[0]: s = None if self.axes_kw == 'axis': kwargs = {'axis': -1} else: kwargs = {'axes': (-1,)} for each_effort in ('FFTW_ESTIMATE', 'FFTW_MEASURE', 'FFTW_PATIENT', 'FFTW_EXHAUSTIVE'): kwargs['planner_effort'] = each_effort FFTW_object = self.validate_pyfftw_object( dtype_tuple[1], test_shape, dtype, s, kwargs) self.assertTrue(each_effort in FFTW_object.flags) kwargs['planner_effort'] = 'garbage' self.assertRaisesRegex(ValueError, 'Invalid planner effort', self.validate_pyfftw_object, *(dtype_tuple[1], test_shape, dtype, s, kwargs)) def test_threads_arg(self): '''Test the threads argument ''' dtype_tuple = input_dtypes[functions[self.func]] test_shape = (16,) for dtype in dtype_tuple[0]: s = None if self.axes_kw == 'axis': kwargs = {'axis': -1} else: kwargs = {'axes': (-1,)} kwargs['threads'] = 2 # Should just work FFTW_object = self.validate_pyfftw_object( dtype_tuple[1], test_shape, dtype, s, kwargs) kwargs['threads'] = 'bleh' # Should not work self.assertRaises(TypeError, self.validate_pyfftw_object, *(dtype_tuple[1], test_shape, dtype, s, kwargs)) def test_overwrite_input(self): '''Test the overwrite_input flag ''' dtype_tuple = input_dtypes[functions[self.func]] for dtype in dtype_tuple[0]: for test_shape, s, _kwargs in self.test_data: s = None kwargs = _kwargs.copy() FFTW_object = self.validate_pyfftw_object(dtype_tuple[1], test_shape, dtype, s, kwargs) if self.func not in ('irfft2', 'irfftn'): self.assertTrue( 'FFTW_DESTROY_INPUT' not in FFTW_object.flags) kwargs['overwrite_input'] = True FFTW_object = self.validate_pyfftw_object( dtype_tuple[1], test_shape, dtype, s, kwargs) self.assertTrue('FFTW_DESTROY_INPUT' in FFTW_object.flags) def test_input_maintained(self): '''Test to make sure the input is maintained ''' dtype_tuple = input_dtypes[functions[self.func]] for dtype in dtype_tuple[0]: for test_shape, s, kwargs in self.test_data: input_array = dtype_tuple[1](test_shape, dtype) FFTW_object = getattr( builders, self.func)(input_array, s, **kwargs) final_input_array = FFTW_object.input_array self.assertTrue( numpy.alltrue(input_array == final_input_array)) def test_avoid_copy(self): '''Test the avoid_copy flag ''' dtype_tuple = input_dtypes[functions[self.func]] for dtype in dtype_tuple[0]: for test_shape, s, kwargs in self.test_data: _kwargs = kwargs.copy() _kwargs['avoid_copy'] = True s2 = copy.copy(s) try: for each_axis, length in enumerate(s): s2[each_axis] += 2 except TypeError: s2 += 2 input_array = dtype_tuple[1](test_shape, dtype) self.assertRaisesRegex(ValueError, 'Cannot avoid copy.*transform shape.*', getattr(builders, self.func), input_array, s2, **_kwargs) non_contiguous_shape = [ each_dim * 2 for each_dim in test_shape] non_contiguous_slices = ( [slice(None, None, 2)] * len(test_shape)) misaligned_input_array = dtype_tuple[1]( non_contiguous_shape, dtype)[non_contiguous_slices] self.assertRaisesRegex(ValueError, 'Cannot avoid copy.*not contiguous.*', getattr(builders, self.func), misaligned_input_array, s, **_kwargs) # Offset by one from 16 byte aligned to guarantee it's not # 16 byte aligned _input_array = empty_aligned( numpy.prod(test_shape)*input_array.itemsize+1, dtype='int8', n=16) misaligned_input_array = _input_array[1:].view( dtype=input_array.dtype).reshape(*test_shape) self.assertRaisesRegex(ValueError, 'Cannot avoid copy.*not aligned.*', getattr(builders, self.func), misaligned_input_array, s, **_kwargs) _input_array = byte_align(input_array.copy()) FFTW_object = getattr(builders, self.func)( _input_array, s, **_kwargs) # A catch all to make sure the internal array # is not a copy self.assertTrue(FFTW_object.input_array is _input_array) class BuildersTestIFFT(BuildersTestFFT): func = 'ifft' class BuildersTestRFFT(BuildersTestFFT): func = 'rfft' class BuildersTestIRFFT(BuildersTestFFT): func = 'irfft' realinv = True class BuildersTestFFT2(BuildersTestFFT): axes_kw = 'axes' func = 'ifft2' test_shapes = ( ((128, 64), {'axes': None}), ((128, 32), {'axes': None}), ((128, 32, 4), {'axes': (0, 2)}), ((59, 100), {'axes': (-2, -1)}), ((64, 128, 16), {'axes': (0, 2)}), ((4, 6, 8, 4), {'axes': (0, 3)}), ) invalid_args = ( ((100,), ((100, 200),), ValueError, 'Shape error'), ((100, 200), ((100, 200, 100),), ValueError, 'Shape error'), ((100,), ((100, 200), (-3, -2, -1)), ValueError, 'Shape error'), ((100, 200), (100, -1), TypeError, ''), ((100, 200), ((100, 200), (-3, -2)), IndexError, 'Invalid axes'), ((100, 200), ((100,), (-3,)), IndexError, 'Invalid axes')) class BuildersTestIFFT2(BuildersTestFFT2): func = 'ifft2' class BuildersTestRFFT2(BuildersTestFFT2): func = 'rfft2' class BuildersTestIRFFT2(BuildersTestFFT2): func = 'irfft2' realinv = True class BuildersTestFFTN(BuildersTestFFT2): func = 'ifftn' test_shapes = ( ((128, 32, 4), {'axes': None}), ((64, 128, 16), {'axes': (0, 1, 2)}), ((4, 6, 8, 4), {'axes': (0, 3, 1)}), ((4, 6, 8, 4), {'axes': (0, 3, 1, 2)}), ) class BuildersTestIFFTN(BuildersTestFFTN): func = 'ifftn' class BuildersTestRFFTN(BuildersTestFFTN): func = 'rfftn' class BuildersTestIRFFTN(BuildersTestFFTN): func = 'irfftn' realinv = True class BuildersTestFFTWWrapper(unittest.TestCase): '''This basically reimplements the FFTW.__call__ tests, with a few tweaks. ''' def __init__(self, *args, **kwargs): super(BuildersTestFFTWWrapper, self).__init__(*args, **kwargs) if not hasattr(self, 'assertRaisesRegex'): self.assertRaisesRegex = self.assertRaisesRegexp def setUp(self): self.input_array_slicer = [slice(None), slice(256)] self.FFTW_array_slicer = [slice(128), slice(None)] self.input_array = empty_aligned((128, 512), dtype='complex128') self.output_array = empty_aligned((256, 256), dtype='complex128') self.internal_array = empty_aligned((256, 256), dtype='complex128') self.fft = utils._FFTWWrapper(self.internal_array, self.output_array, input_array_slicer=self.input_array_slicer, FFTW_array_slicer=self.FFTW_array_slicer) self.input_array[:] = (numpy.random.randn(*self.input_array.shape) + 1j*numpy.random.randn(*self.input_array.shape)) self.internal_array[:] = 0 self.internal_array[self.FFTW_array_slicer] = ( self.input_array[self.input_array_slicer]) def update_arrays(self, input_array, output_array): '''Does what the internal update arrays does for an FFTW object but with a reslicing. ''' internal_input_array = self.fft.input_array internal_output_array = self.fft.output_array internal_input_array[self.FFTW_array_slicer] = ( input_array[self.input_array_slicer]) self.fft(output_array=output_array) def test_call(self): '''Test a call to an instance of the class. ''' self.input_array[:] = (numpy.random.randn(*self.input_array.shape) + 1j*numpy.random.randn(*self.input_array.shape)) output_array = self.fft() self.assertTrue(numpy.alltrue(output_array == self.output_array)) def test_call_with_positional_input_update(self): '''Test the class call with a positional input update. ''' input_array = byte_align( (numpy.random.randn(*self.input_array.shape) + 1j*numpy.random.randn(*self.input_array.shape))) output_array = self.fft( byte_align(input_array.copy())).copy() self.update_arrays(input_array, self.output_array) self.fft.execute() self.assertTrue(numpy.alltrue(output_array == self.output_array)) def test_call_with_keyword_input_update(self): '''Test the class call with a keyword input update. ''' input_array = byte_align( numpy.random.randn(*self.input_array.shape) + 1j*numpy.random.randn(*self.input_array.shape)) output_array = self.fft( input_array=byte_align(input_array.copy())).copy() self.update_arrays(input_array, self.output_array) self.fft.execute() self.assertTrue(numpy.alltrue(output_array == self.output_array)) def test_call_with_keyword_output_update(self): '''Test the class call with a keyword output update. ''' output_array = byte_align( (numpy.random.randn(*self.output_array.shape) + 1j*numpy.random.randn(*self.output_array.shape))) returned_output_array = self.fft( output_array=byte_align(output_array.copy())).copy() self.update_arrays(self.input_array, output_array) self.fft.execute() self.assertTrue( numpy.alltrue(returned_output_array == output_array)) def test_call_with_positional_updates(self): '''Test the class call with a positional array updates. ''' input_array = byte_align((numpy.random.randn(*self.input_array.shape) + 1j*numpy.random.randn(*self.input_array.shape))) output_array = byte_align((numpy.random.randn(*self.output_array.shape) + 1j*numpy.random.randn(*self.output_array.shape))) returned_output_array = self.fft( byte_align(input_array.copy()), byte_align(output_array.copy())).copy() self.update_arrays(input_array, output_array) self.fft.execute() self.assertTrue(numpy.alltrue(returned_output_array == output_array)) def test_call_with_keyword_updates(self): '''Test the class call with a positional output update. ''' input_array = byte_align( (numpy.random.randn(*self.input_array.shape) + 1j*numpy.random.randn(*self.input_array.shape))) output_array = byte_align( (numpy.random.randn(*self.output_array.shape) + 1j*numpy.random.randn(*self.output_array.shape))) returned_output_array = self.fft( output_array=byte_align(output_array.copy()), input_array=byte_align(input_array.copy())).copy() self.update_arrays(input_array, output_array) self.fft.execute() self.assertTrue(numpy.alltrue(returned_output_array == output_array)) def test_call_with_different_input_dtype(self): '''Test the class call with an array with a different input dtype ''' input_array = byte_align(numpy.complex64( numpy.random.randn(*self.input_array.shape) + 1j*numpy.random.randn(*self.input_array.shape))) output_array = self.fft(byte_align(input_array.copy())).copy() _input_array = numpy.asarray(input_array, dtype=self.input_array.dtype) self.update_arrays(_input_array, self.output_array) self.fft.execute() self.assertTrue(numpy.alltrue(output_array == self.output_array)) def test_call_with_list_input(self): '''Test the class call with a list rather than an array ''' output_array = self.fft().copy() test_output_array = self.fft(self.input_array.tolist()).copy() self.assertTrue(numpy.alltrue(output_array == test_output_array)) def test_call_with_invalid_update(self): '''Test the class call with an invalid update. ''' new_shape = self.input_array.shape + (2, ) invalid_array = (numpy.random.randn(*new_shape) + 1j*numpy.random.randn(*new_shape)) self.assertRaises(ValueError, self.fft, *(), **{'output_array':invalid_array}) self.assertRaises(ValueError, self.fft, *(), **{'input_array':invalid_array}) def test_call_with_invalid_output_striding(self): '''Test the class call with an invalid strided output update. ''' # Add an extra dimension to bugger up the striding new_shape = self.output_array.shape + (2,) output_array = byte_align(numpy.random.randn(*new_shape) + 1j*numpy.random.randn(*new_shape)) self.assertRaisesRegex(ValueError, 'Invalid output striding', self.fft, **{'output_array': output_array[:,:,1]}) def test_call_with_different_striding(self): '''Test the input update with different strides to internal array. ''' input_array_shape = self.input_array.shape + (2,) internal_array_shape = self.internal_array.shape internal_array = byte_align( numpy.random.randn(*internal_array_shape) + 1j*numpy.random.randn(*internal_array_shape)) fft = utils._FFTWWrapper(internal_array, self.output_array, input_array_slicer=self.input_array_slicer, FFTW_array_slicer=self.FFTW_array_slicer) test_output_array = fft().copy() new_input_array = empty_aligned(input_array_shape, dtype=internal_array.dtype) new_input_array[:] = 0 new_input_array[:,:,0][self.input_array_slicer] = ( internal_array[self.FFTW_array_slicer]) new_output = fft(new_input_array[:,:,0]).copy() # Test the test! self.assertTrue( new_input_array[:,:,0].strides != internal_array.strides) self.assertTrue(numpy.alltrue(test_output_array == new_output)) def test_call_with_copy_with_missized_array_error(self): '''Force an input copy with a missized array. ''' shape = list(self.input_array.shape + (2,)) shape[0] += 1 input_array = byte_align(numpy.random.randn(*shape) + 1j*numpy.random.randn(*shape)) self.assertRaisesRegex(ValueError, 'Invalid input shape', self.fft, **{'input_array': input_array[:,:,0]}) def test_call_with_normalisation_on(self): _input_array = empty_aligned(self.internal_array.shape, dtype='complex128') ifft = utils._FFTWWrapper(self.output_array, _input_array, direction='FFTW_BACKWARD', input_array_slicer=slice(None), FFTW_array_slicer=slice(None)) self.fft(normalise_idft=True) # Shouldn't make any difference ifft(normalise_idft=True) self.assertTrue(numpy.allclose( self.input_array[self.input_array_slicer], _input_array[self.FFTW_array_slicer])) def test_call_with_normalisation_off(self): _input_array = empty_aligned(self.internal_array.shape, dtype='complex128') ifft = utils._FFTWWrapper(self.output_array, _input_array, direction='FFTW_BACKWARD', input_array_slicer=slice(None), FFTW_array_slicer=slice(None)) self.fft(normalise_idft=True) # Shouldn't make any difference ifft(normalise_idft=False) _input_array /= ifft.N self.assertTrue(numpy.allclose( self.input_array[self.input_array_slicer], _input_array[self.FFTW_array_slicer])) def test_call_with_normalisation_default(self): _input_array = empty_aligned(self.internal_array.shape, dtype='complex128') ifft = utils._FFTWWrapper(self.output_array, _input_array, direction='FFTW_BACKWARD', input_array_slicer=slice(None), FFTW_array_slicer=slice(None)) self.fft() ifft() # Scaling is performed by default self.assertTrue(numpy.allclose( self.input_array[self.input_array_slicer], _input_array[self.FFTW_array_slicer])) class BuildersTestUtilities(unittest.TestCase): def __init__(self, *args, **kwargs): super(BuildersTestUtilities, self).__init__(*args, **kwargs) if not hasattr(self, 'assertRaisesRegex'): self.assertRaisesRegex = self.assertRaisesRegexp def test_setup_input_slicers(self): inputs = ( ((4, 5), (4, 5)), ((4, 4), (3, 5)), ((4, 5), (3, 5)), ) outputs = ( ([slice(0, 4), slice(0, 5)], [slice(None), slice(None)]), ([slice(0, 3), slice(0, 4)], [slice(None), slice(0, 4)]), ([slice(0, 3), slice(0, 5)], [slice(None), slice(None)]), ) for _input, _output in zip(inputs, outputs): self.assertEqual( utils._setup_input_slicers(*_input), _output) def test_compute_array_shapes(self): # inputs are: # (a.shape, s, axes, inverse, real) inputs = ( ((4, 5), (4, 5), (-2, -1), False, False), ((4, 5), (4, 5), (-1, -2), False, False), ((4, 5), (4, 5), (-1, -2), True, False), ((4, 5), (4, 5), (-1, -2), True, True), ((4, 5), (4, 5), (-2, -1), True, True), ((4, 5), (4, 5), (-2, -1), False, True), ((4, 5), (4, 5), (-1, -2), False, True), ((4, 5, 6), (4, 5), (-2, -1), False, False), ((4, 5, 6), (5, 6), (-2, -1), False, False), ((4, 5, 6), (3, 5), (-3, -1), False, False), ((4, 5, 6), (4, 5), (-2, -1), True, False), ((4, 5, 6), (3, 5), (-3, -1), True, False), ((4, 5, 6), (4, 5), (-2, -1), True, True), ((4, 5, 6), (3, 5), (-3, -1), True, True), ((4, 5, 6), (4, 5), (-2, -1), False, True), ((4, 5, 6), (3, 5), (-3, -1), False, True), ) outputs = ( ((4, 5), (4, 5)), ((5, 4), (5, 4)), ((5, 4), (5, 4)), ((3, 4), (5, 4)), ((4, 3), (4, 5)), ((4, 5), (4, 3)), ((5, 4), (3, 4)), ((4, 4, 5), (4, 4, 5)), ((4, 5, 6), (4, 5, 6)), ((3, 5, 5), (3, 5, 5)), ((4, 4, 5), (4, 4, 5)), ((3, 5, 5), (3, 5, 5)), ((4, 4, 3), (4, 4, 5)), ((3, 5, 3), (3, 5, 5)), ((4, 4, 5), (4, 4, 3)), ((3, 5, 5), (3, 5, 3)), ) for _input, output in zip(inputs, outputs): shape, s, axes, inverse, real = _input a = numpy.empty(shape) self.assertEqual( utils._compute_array_shapes(a, s, axes, inverse, real), output) def test_compute_array_shapes_invalid_axes(self): a = numpy.zeros((3, 4)) s = (3, 4) test_axes = ((1, 2, 3),) for each_axes in test_axes: args = (a, s, each_axes, False, False) self.assertRaisesRegex(IndexError, 'Invalid axes', utils._compute_array_shapes, *args) def _call_cook_nd_args(self, arg_tuple): a = numpy.zeros(arg_tuple[0]) args = ('s', 'axes', 'invreal') arg_dict = {'a': a} for arg_name, arg in zip(args, arg_tuple[1:]): if arg is not None: arg_dict[arg_name] = arg return utils._cook_nd_args(**arg_dict) def test_cook_nd_args_normal(self): # inputs are (a.shape, s, axes, invreal) # None corresponds to no argument inputs = ( ((2, 3), None, (-1,), False), ((2, 3), (5, 6), (-2, -1), False), ((2, 3), (5, 6), (-1, -2), False), ((2, 3), None, (-1, -2), False), ((2, 3, 5), (5, 6), (-1, -2), False), ((2, 3, 5), (5, 6), None, False), ((2, 3, 5), None, (-1, -2), False), ((2, 3, 5), None, (-1, -3), False)) outputs = ( ((3,), (-1,)), ((5, 6), (-2, -1)), ((5, 6), (-1, -2)), ((3, 2), (-1, -2)), ((5, 6), (-1, -2)), ((5, 6), (-2, -1)), ((5, 3), (-1, -2)), ((5, 2), (-1, -3)) ) for each_input, each_output in zip(inputs, outputs): self.assertEqual(self._call_cook_nd_args(each_input), each_output) def test_cook_nd_args_invreal(self): # inputs are (a.shape, s, axes, invreal) # None corresponds to no argument inputs = ( ((2, 3), None, (-1,), True), ((2, 3), (5, 6), (-2, -1), True), ((2, 3), (5, 6), (-1, -2), True), ((2, 3), None, (-1, -2), True), ((2, 3, 5), (5, 6), (-1, -2), True), ((2, 3, 5), (5, 6), None, True), ((2, 3, 5), None, (-1, -2), True), ((2, 3, 5), None, (-1, -3), True)) outputs = ( ((4,), (-1,)), ((5, 6), (-2, -1)), ((5, 6), (-1, -2)), ((3, 2), (-1, -2)), ((5, 6), (-1, -2)), ((5, 6), (-2, -1)), ((5, 4), (-1, -2)), ((5, 2), (-1, -3)) ) for each_input, each_output in zip(inputs, outputs): self.assertEqual(self._call_cook_nd_args(each_input), each_output) def test_cook_nd_args_invalid_inputs(self): # inputs are (a.shape, s, axes, invreal) # None corresponds to no argument inputs = ( ((2, 3), (1,), (-1, -2), None), ((2, 3), (2, 3, 4), (-3, -2, -1), None), ) # all the inputs should yield an error for each_input in inputs: self.assertRaisesRegex(ValueError, 'Shape error', self._call_cook_nd_args, *(each_input,)) test_cases = ( BuildersTestFFTWWrapper, BuildersTestUtilities, BuildersTestFFT, BuildersTestIFFT, BuildersTestRFFT, BuildersTestIRFFT, BuildersTestFFT2, BuildersTestIFFT2, BuildersTestRFFT2, BuildersTestIRFFT2, BuildersTestFFTN, BuildersTestIFFTN, BuildersTestRFFTN, BuildersTestIRFFTN) #test_set = {'BuildersTestRFFTN': ['test_dtype_coercian']} test_set = None if __name__ == '__main__': run_test_suites(test_cases, test_set) pyFFTW-0.10.1/test/__init__.py0000664000175000017500000000000012570060606015366 0ustar whgwhg00000000000000pyFFTW-0.10.1/test/test_pyfftw_class_misc.py0000664000175000017500000003250412570060606020423 0ustar whgwhg00000000000000# Copyright 2014 Knowledge Economy Developments Ltd # # Henry Gomersall # heng@kedevelopments.co.uk # # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, this # list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright notice, # this list of conditions and the following disclaimer in the documentation # and/or other materials provided with the distribution. # # * Neither the name of the copyright holder nor the names of its contributors # may be used to endorse or promote products derived from this software without # specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. # from pyfftw import ( FFTW, empty_aligned, is_byte_aligned, simd_alignment) import pyfftw from .test_pyfftw_base import run_test_suites import unittest import numpy import warnings # FFTW tests that don't seem to fit anywhere else class FFTWMiscTest(unittest.TestCase): def __init__(self, *args, **kwargs): super(FFTWMiscTest, self).__init__(*args, **kwargs) # Assume python 3, but keep backwards compatibility if not hasattr(self, 'assertRaisesRegex'): self.assertRaisesRegex = self.assertRaisesRegexp def setUp(self): self.input_array = empty_aligned((256, 512), dtype='complex128', n=16) self.output_array = empty_aligned((256, 512), dtype='complex128', n=16) self.fft = FFTW(self.input_array, self.output_array) self.output_array[:] = (numpy.random.randn(*self.output_array.shape) + 1j*numpy.random.randn(*self.output_array.shape)) def test_aligned_flag(self): '''Test to see if the aligned flag is correct ''' fft = FFTW(self.input_array, self.output_array) self.assertTrue(fft.simd_aligned) fft = FFTW(self.input_array, self.output_array, flags=('FFTW_UNALIGNED',)) self.assertFalse(fft.simd_aligned) def test_flags(self): '''Test to see if the flags are correct ''' fft = FFTW(self.input_array, self.output_array) self.assertEqual(fft.flags, ('FFTW_MEASURE',)) fft = FFTW(self.input_array, self.output_array, flags=('FFTW_DESTROY_INPUT', 'FFTW_UNALIGNED')) self.assertEqual(fft.flags, ('FFTW_DESTROY_INPUT', 'FFTW_UNALIGNED')) # Test an implicit flag _input_array = empty_aligned(256, dtype='complex64', n=16) _output_array = empty_aligned(256, dtype='complex64', n=16) # These are guaranteed to be misaligned (due to dtype size == 8) input_array = _input_array[:-1] output_array = _output_array[:-1] u_input_array = _input_array[1:] u_output_array = _output_array[1:] fft = FFTW(input_array, u_output_array) self.assertEqual(fft.flags, ('FFTW_MEASURE', 'FFTW_UNALIGNED')) fft = FFTW(u_input_array, output_array) self.assertEqual(fft.flags, ('FFTW_MEASURE', 'FFTW_UNALIGNED')) fft = FFTW(u_input_array, u_output_array) self.assertEqual(fft.flags, ('FFTW_MEASURE', 'FFTW_UNALIGNED')) def test_differing_aligned_arrays_update(self): '''Test to see if the alignment code is working as expected ''' # Start by creating arrays that are only on various byte # alignments (4, 16 and 32) _input_array = empty_aligned(len(self.input_array.ravel())*2+5, dtype='float32', n=32) _output_array = empty_aligned(len(self.output_array.ravel())*2+5, dtype='float32', n=32) _input_array[:] = 0 _output_array[:] = 0 input_array_4 = ( numpy.frombuffer(_input_array[1:-4].data, dtype='complex64') .reshape(self.input_array.shape)) output_array_4 = ( numpy.frombuffer(_output_array[1:-4].data, dtype='complex64') .reshape(self.output_array.shape)) input_array_16 = ( numpy.frombuffer(_input_array[4:-1].data, dtype='complex64') .reshape(self.input_array.shape)) output_array_16 = ( numpy.frombuffer(_output_array[4:-1].data, dtype='complex64') .reshape(self.output_array.shape)) input_array_32 = ( numpy.frombuffer(_input_array[:-5].data, dtype='complex64') .reshape(self.input_array.shape)) output_array_32 = ( numpy.frombuffer(_output_array[:-5].data, dtype='complex64') .reshape(self.output_array.shape)) input_arrays = {4: input_array_4, 16: input_array_16, 32: input_array_32} output_arrays = {4: output_array_4, 16: output_array_16, 32: output_array_32} alignments = (4, 16, 32) # Test the arrays are aligned on 4 bytes... self.assertTrue(is_byte_aligned(input_arrays[4], n=4)) self.assertTrue(is_byte_aligned(output_arrays[4], n=4)) # ...and on 16... self.assertFalse(is_byte_aligned(input_arrays[4], n=16)) self.assertFalse(is_byte_aligned(output_arrays[4], n=16)) self.assertTrue(is_byte_aligned(input_arrays[16], n=16)) self.assertTrue(is_byte_aligned(output_arrays[16], n=16)) # ...and on 32... self.assertFalse(is_byte_aligned(input_arrays[16], n=32)) self.assertFalse(is_byte_aligned(output_arrays[16], n=32)) self.assertTrue(is_byte_aligned(input_arrays[32], n=32)) self.assertTrue(is_byte_aligned(output_arrays[32], n=32)) if len(pyfftw.pyfftw._valid_simd_alignments) > 0: max_align = pyfftw.pyfftw._valid_simd_alignments[0] else: max_align = simd_alignment for in_align in alignments: for out_align in alignments: expected_align = min(in_align, out_align, max_align) fft = FFTW(input_arrays[in_align], output_arrays[out_align]) self.assertTrue(fft.input_alignment == expected_align) self.assertTrue(fft.output_alignment == expected_align) for update_align in alignments: if update_align < expected_align: # This should fail (not aligned properly) self.assertRaisesRegex(ValueError, 'Invalid input alignment', fft.update_arrays, input_arrays[update_align], output_arrays[out_align]) self.assertRaisesRegex(ValueError, 'Invalid output alignment', fft.update_arrays, input_arrays[in_align], output_arrays[update_align]) else: # This should work (and not segfault!) fft.update_arrays(input_arrays[update_align], output_arrays[out_align]) fft.update_arrays(input_arrays[in_align], output_arrays[update_align]) fft.execute() def test_get_input_array(self): '''Test to see the get_input_array method returns the correct thing ''' with warnings.catch_warnings(record=True) as w: # This method is deprecated, so check the deprecation warning # is raised. warnings.simplefilter("always") input_array = self.fft.get_input_array() self.assertEqual(len(w), 1) self.assertTrue(issubclass(w[-1].category, DeprecationWarning)) self.assertIs(self.input_array, input_array) def test_get_output_array(self): '''Test to see the get_output_array method returns the correct thing ''' with warnings.catch_warnings(record=True) as w: # This method is deprecated, so check the deprecation warning # is raised. warnings.simplefilter("always") output_array = self.fft.get_output_array() self.assertEqual(len(w), 1) self.assertTrue(issubclass(w[-1].category, DeprecationWarning)) self.assertIs(self.output_array, output_array) def test_input_array(self): '''Test to see the input_array property returns the correct thing ''' self.assertIs(self.input_array, self.fft.input_array) def test_output_array(self): '''Test to see the output_array property returns the correct thing ''' self.assertIs(self.output_array, self.fft.output_array) def test_input_strides(self): '''Test to see if the input_strides property returns the correct thing ''' self.assertEqual(self.fft.input_strides, self.input_array.strides) new_input_array = self.input_array[::2, ::4] new_output_array = self.output_array[::2, ::4] new_fft = FFTW(new_input_array, new_output_array) self.assertEqual(new_fft.input_strides, new_input_array.strides) def test_output_strides(self): '''Test to see if the output_strides property returns the correct thing ''' self.assertEqual(self.fft.output_strides, self.output_array.strides) new_input_array = self.output_array[::2, ::4] new_output_array = self.output_array[::2, ::4] new_fft = FFTW(new_input_array, new_output_array) self.assertEqual(new_fft.output_strides, new_output_array.strides) def test_input_shape(self): '''Test to see if the input_shape property returns the correct thing ''' self.assertEqual(self.fft.input_shape, self.input_array.shape) new_input_array = self.input_array[::2, ::4] new_output_array = self.output_array[::2, ::4] new_fft = FFTW(new_input_array, new_output_array) self.assertEqual(new_fft.input_shape, new_input_array.shape) def test_output_strides(self): '''Test to see if the output_shape property returns the correct thing ''' self.assertEqual(self.fft.output_shape, self.output_array.shape) new_input_array = self.output_array[::2, ::4] new_output_array = self.output_array[::2, ::4] new_fft = FFTW(new_input_array, new_output_array) self.assertEqual(new_fft.output_shape, new_output_array.shape) def test_input_dtype(self): '''Test to see if the input_dtype property returns the correct thing ''' self.assertEqual(self.fft.input_dtype, self.input_array.dtype) new_input_array = numpy.complex64(self.input_array) new_output_array = numpy.complex64(self.output_array) new_fft = FFTW(new_input_array, new_output_array) self.assertEqual(new_fft.input_dtype, new_input_array.dtype) def test_output_dtype(self): '''Test to see if the output_dtype property returns the correct thing ''' self.assertEqual(self.fft.output_dtype, self.output_array.dtype) new_input_array = numpy.complex64(self.input_array) new_output_array = numpy.complex64(self.output_array) new_fft = FFTW(new_input_array, new_output_array) self.assertEqual(new_fft.output_dtype, new_output_array.dtype) def test_direction_property(self): '''Test to see if the direction property returns the correct thing ''' self.assertEqual(self.fft.direction, 'FFTW_FORWARD') new_fft = FFTW(self.input_array, self.output_array, direction='FFTW_BACKWARD') self.assertEqual(new_fft.direction, 'FFTW_BACKWARD') def test_axes_property(self): '''Test to see if the axes property returns the correct thing ''' self.assertEqual(self.fft.axes, (1,)) new_fft = FFTW(self.input_array, self.output_array, axes=(-1, -2)) self.assertEqual(new_fft.axes, (1, 0)) new_fft = FFTW(self.input_array, self.output_array, axes=(-2, -1)) self.assertEqual(new_fft.axes, (0, 1)) new_fft = FFTW(self.input_array, self.output_array, axes=(1, 0)) self.assertEqual(new_fft.axes, (1, 0)) new_fft = FFTW(self.input_array, self.output_array, axes=(1,)) self.assertEqual(new_fft.axes, (1,)) new_fft = FFTW(self.input_array, self.output_array, axes=(0,)) self.assertEqual(new_fft.axes, (0,)) test_cases = ( FFTWMiscTest,) test_set = None if __name__ == '__main__': run_test_suites(test_cases, test_set) pyFFTW-0.10.1/test/test_pyfftw_base.py0000664000175000017500000001621412570060606017215 0ustar whgwhg00000000000000# Copyright 2014 Knowledge Economy Developments Ltd # # Henry Gomersall # heng@kedevelopments.co.uk # # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, this # list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright notice, # this list of conditions and the following disclaimer in the documentation # and/or other materials provided with the distribution. # # * Neither the name of the copyright holder nor the names of its contributors # may be used to endorse or promote products derived from this software without # specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. # from pyfftw import FFTW import numpy import struct from timeit import Timer import unittest class FFTWBaseTest(unittest.TestCase): def reference_fftn(self, a, axes): return numpy.fft.fftn(a, axes=axes) def __init__(self, *args, **kwargs): super(FFTWBaseTest, self).__init__(*args, **kwargs) self.make_shapes() if not hasattr(self, 'assertRaisesRegex'): self.assertRaisesRegex = self.assertRaisesRegexp def setUp(self): self.input_dtype = numpy.complex64 self.output_dtype = numpy.complex64 self.np_fft_comparison = numpy.fft.fft self.direction = 'FFTW_FORWARD' return def tearDown(self): return def get_input_dtype_alignment(self): return self.input_dtype([]).real.dtype.alignment def get_output_dtype_alignment(self): return self.input_dtype([]).real.dtype.alignment def make_shapes(self): self.input_shapes = { 'small_1d': (16,), '1d': (2048,), '2d': (256, 2048), '3d': (5, 256, 2048)} self.output_shapes = { 'small_1d': (16,), '1d': (2048,), '2d': (256, 2048), '3d': (5, 256, 2048)} def create_test_arrays(self, input_shape, output_shape, axes=None): a = self.input_dtype(numpy.random.randn(*input_shape) +1j*numpy.random.randn(*input_shape)) b = self.output_dtype(numpy.random.randn(*output_shape) +1j*numpy.random.randn(*output_shape)) return a, b def timer_routine(self, pyfftw_callable, numpy_fft_callable, comparison_string='numpy.fft'): N = 100 t = Timer(stmt=pyfftw_callable) t_numpy_fft = Timer(stmt=numpy_fft_callable) t_str = ("%.2f" % (1000.0/N*t.timeit(N)))+' ms' t_numpy_str = ("%.2f" % (1000.0/N*t_numpy_fft.timeit(N)))+' ms' print('One run: '+ t_str + \ ' (versus ' + t_numpy_str + ' for ' + comparison_string + \ ')') def run_validate_fft(self, a, b, axes, fft=None, ifft=None, force_unaligned_data=False, create_array_copies=True, threads=1, flags=('FFTW_ESTIMATE',)): ''' Run a validation of the FFTW routines for the passed pair of arrays, a and b, and the axes argument. a and b are assumed to be the same shape (but not necessarily the same layout in memory). fft and ifft, if passed, should be instantiated FFTW objects. If force_unaligned_data is True, the flag FFTW_UNALIGNED will be passed to the fftw routines. The threads argument runs the validation with multiple threads. flags is passed to the creation of the FFTW object. ''' if create_array_copies: # Don't corrupt the original mutable arrays a = a.copy() b = b.copy() a_orig = a.copy() flags = list(flags) if force_unaligned_data: flags.append('FFTW_UNALIGNED') if fft == None: fft = FFTW(a,b,axes=axes, direction='FFTW_FORWARD', flags=flags, threads=threads) else: fft.update_arrays(a,b) if ifft == None: ifft = FFTW(b, a, axes=axes, direction='FFTW_BACKWARD', flags=flags, threads=threads) else: ifft.update_arrays(b,a) a[:] = a_orig # Test the forward FFT by comparing it to the result from numpy.fft fft.execute() ref_b = self.reference_fftn(a, axes=axes) # This is actually quite a poor relative error, but it still # sometimes fails. I assume that numpy.fft has different internals # to fftw. self.assertTrue(numpy.allclose(b, ref_b, rtol=1e-2, atol=1e-3)) # Test the inverse FFT by comparing the result to the starting # value (which is scaled as per FFTW being unnormalised). ifft.execute() # The scaling is the product of the lengths of the fft along # the axes along which the fft is taken. scaling = numpy.prod(numpy.array(a.shape)[list(axes)]) self.assertEqual(ifft.N, scaling) self.assertEqual(fft.N, scaling) self.assertTrue(numpy.allclose(a/scaling, a_orig, rtol=1e-2, atol=1e-3)) return fft, ifft def run_test_suites(test_suites, run_tests=None): '''From each test case (derived from TestCase) in test_suites, load and run all the test cases within. If run_tests is not None, then it should be a dictionary with keys being the test suite class name, and the values being a list of test methods to run. Alternatively, the key can be 'all' in which case all the test suites will be run with the provided list of test suites. ''' suite = unittest.TestSuite() for test_class in test_suites: tests = unittest.TestLoader().loadTestsFromTestCase(test_class) if run_tests is not None: if test_class.__name__ in run_tests: this_suite_run = set(run_tests[test_class.__name__]) else: this_suite_run = set() if 'all' in run_tests: this_suite_run = this_suite_run.union(run_tests['all']) _tests = [] for each_test in tests: if (each_test.id().split('.')[-1] in this_suite_run): _tests.append(each_test) tests = _tests suite.addTests(tests) unittest.TextTestRunner(verbosity=2).run(suite) pyFFTW-0.10.1/LICENSE.txt0000664000175000017500000000313112570060606014131 0ustar whgwhg00000000000000 Except for fftw3.h, all the code in pyfftw is released under the 3-clause BSD license (set out below). fftw3.h is released under the 2-clause BSD license. See each file for the copyright holder. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. pyFFTW-0.10.1/PKG-INFO0000664000175000017500000000437512652703650013422 0ustar whgwhg00000000000000Metadata-Version: 1.1 Name: pyFFTW Version: 0.10.1 Summary: A pythonic wrapper around FFTW, the FFT library, presenting a unified interface for all the supported transforms. Home-page: http://hgomersall.github.com/pyFFTW/ Author: Henry Gomersall Author-email: heng@kedevelopments.co.uk License: UNKNOWN Description: pyFFTW is a pythonic wrapper around `FFTW `_, the speedy FFT library. The ultimate aim is to present a unified interface for all the possible transforms that FFTW can perform. Both the complex DFT and the real DFT are supported, as well as arbitrary axes of abitrary shaped and strided arrays, which makes it almost feature equivalent to standard and real FFT functions of ``numpy.fft`` (indeed, it supports the ``clongdouble`` dtype which ``numpy.fft`` does not). Operating FFTW in multithreaded mode is supported. A comprehensive unittest suite can be found with the source on the github repository. To build for windows from source, download the fftw dlls for your system and the header file from here (they're in a zip file): http://www.fftw.org/install/windows.html and place them in the pyfftw directory. The files are libfftw3-3.dll, libfftw3l-3.dll, libfftw3f-3.dll and libfftw3.h. Under linux, to build from source, the FFTW library must be installed already. This should probably work for OSX, though I've not tried it. Numpy is a dependency for both. The documentation can be found `here `_, and the source is on `github `_. Platform: UNKNOWN Classifier: Programming Language :: Python Classifier: Programming Language :: Python :: 3 Classifier: Development Status :: 4 - Beta Classifier: License :: OSI Approved :: BSD License Classifier: Operating System :: OS Independent Classifier: Intended Audience :: Developers Classifier: Intended Audience :: Science/Research Classifier: Topic :: Scientific/Engineering Classifier: Topic :: Scientific/Engineering :: Mathematics Classifier: Topic :: Multimedia :: Sound/Audio :: Analysis pyFFTW-0.10.1/MANIFEST.in0000664000175000017500000000052412652702060014045 0ustar whgwhg00000000000000include CHANGELOG.md include LICENSE.txt include requirements.txt include README.rst include pyfftw/pyfftw.c include pyfftw/pyfftw.pyx include pyfftw/pyfftw.pxd include pyfftw/cpu.pxd include pyfftw/utils.pxi include test/test_*.py include test/__init__.py recursive-include include *.h recursive-include docs *.html *.css *.png *.js *.rst pyFFTW-0.10.1/pyfftw/0000775000175000017500000000000012652703650013633 5ustar whgwhg00000000000000pyFFTW-0.10.1/pyfftw/utils.pxi0000664000175000017500000002102012625624663015516 0ustar whgwhg00000000000000# Copyright 2014 Knowledge Economy Developments Ltd # Copyright 2014 David Wells # # Henry Gomersall # heng@kedevelopments.co.uk # David Wells # drwells vt.edu # # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, this # list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright notice, # this list of conditions and the following disclaimer in the documentation # and/or other materials provided with the distribution. # # * Neither the name of the copyright holder nor the names of its contributors # may be used to endorse or promote products derived from this software without # specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. # cimport numpy as np cimport cpu from libc.stdint cimport intptr_t import warnings cdef int _simd_alignment = cpu.simd_alignment() #: The optimum SIMD alignment in bytes, found by inspecting the CPU. simd_alignment = _simd_alignment #: A tuple of simd alignments that make sense for this cpu if _simd_alignment == 16: _valid_simd_alignments = (16,) elif _simd_alignment == 32: _valid_simd_alignments = (16, 32) else: _valid_simd_alignments = () cpdef n_byte_align_empty(shape, n, dtype='float64', order='C'): '''n_byte_align_empty(shape, n, dtype='float64', order='C') **This function is deprecated:** ``empty_aligned`` **should be used instead.** Function that returns an empty numpy array that is n-byte aligned. The alignment is given by the first optional argument, ``n``. If ``n`` is not provided then this function will inspect the CPU to determine alignment. The rest of the arguments are as per :func:`numpy.empty`. ''' warnings.warn('This function is deprecated in favour of' '``empty_aligned``.', DeprecationWarning) return empty_aligned(shape, dtype=dtype, order=order, n=n) cpdef n_byte_align(array, n, dtype=None): '''n_byte_align(array, n, dtype=None) **This function is deprecated:** ``byte_align`` **should be used instead.** Function that takes a numpy array and checks it is aligned on an n-byte boundary, where ``n`` is an optional parameter. If ``n`` is not provided then this function will inspect the CPU to determine alignment. If the array is aligned then it is returned without further ado. If it is not aligned then a new array is created and the data copied in, but aligned on the n-byte boundary. ``dtype`` is an optional argument that forces the resultant array to be of that dtype. ''' warnings.warn('This function is deprecated in favour of' '``byte_align``.', DeprecationWarning) return byte_align(array, n=n, dtype=dtype) cpdef byte_align(array, n=None, dtype=None): '''byte_align(array, n=None, dtype=None) Function that takes a numpy array and checks it is aligned on an n-byte boundary, where ``n`` is an optional parameter. If ``n`` is not provided then this function will inspect the CPU to determine alignment. If the array is aligned then it is returned without further ado. If it is not aligned then a new array is created and the data copied in, but aligned on the n-byte boundary. ``dtype`` is an optional argument that forces the resultant array to be of that dtype. ''' if not isinstance(array, np.ndarray): raise TypeError('Invalid array: byte_align requires a subclass ' 'of ndarray') if n is None: n = _simd_alignment if dtype is not None: if not array.dtype == dtype: update_dtype = True else: dtype = array.dtype update_dtype = False # See if we're already n byte aligned. If so, do nothing. offset = np.PyArray_DATA(array) %n if offset is not 0 or update_dtype: _array_aligned = empty_aligned(array.shape, dtype, n=n) _array_aligned[:] = array array = _array_aligned.view(type=array.__class__) return array cpdef is_byte_aligned(array, n=None): ''' is_n_byte_aligned(array, n=None) Function that takes a numpy array and checks it is aligned on an n-byte boundary, where ``n`` is an optional parameter, returning ``True`` if it is, and ``False`` if it is not. If ``n`` is not provided then this function will inspect the CPU to determine alignment. ''' if not isinstance(array, np.ndarray): raise TypeError('Invalid array: is_n_byte_aligned requires a subclass ' 'of ndarray') if n is None: n = _simd_alignment # See if we're n byte aligned. offset = np.PyArray_DATA(array) %n return not bool(offset) cpdef is_n_byte_aligned(array, n): ''' is_n_byte_aligned(array, n) **This function is deprecated:** ``is_byte_aligned`` **should be used instead.** Function that takes a numpy array and checks it is aligned on an n-byte boundary, where ``n`` is a passed parameter, returning ``True`` if it is, and ``False`` if it is not. ''' return is_byte_aligned(array, n=n) cpdef empty_aligned(shape, dtype='float64', order='C', n=None): '''empty_aligned(shape, dtype='float64', order='C', n=None) Function that returns an empty numpy array that is n-byte aligned, where ``n`` is determined by inspecting the CPU if it is not provided. The alignment is given by the final optional argument, ``n``. If ``n`` is not provided then this function will inspect the CPU to determine alignment. The rest of the arguments are as per :func:`numpy.empty`. ''' if n is None: n = _simd_alignment itemsize = np.dtype(dtype).itemsize # Apparently there is an issue with numpy.prod wrapping around on 32-bits # on Windows 64-bit. This shouldn't happen, but the following code # alleviates the problem. if not isinstance(shape, (int, np.integer)): array_length = 1 for each_dimension in shape: array_length *= each_dimension else: array_length = shape # Allocate a new array that will contain the aligned data _array_aligned = np.empty(array_length*itemsize+n, dtype='int8') # We now need to know how to offset _array_aligned # so it is correctly aligned _array_aligned_offset = (n-np.PyArray_DATA(_array_aligned))%n array = np.frombuffer( _array_aligned[_array_aligned_offset:_array_aligned_offset-n].data, dtype=dtype).reshape(shape, order=order) return array cpdef zeros_aligned(shape, dtype='float64', order='C', n=None): '''zeros_aligned(shape, dtype='float64', order='C', n=None) Function that returns a numpy array of zeros that is n-byte aligned, where ``n`` is determined by inspecting the CPU if it is not provided. The alignment is given by the final optional argument, ``n``. If ``n`` is not provided then this function will inspect the CPU to determine alignment. The rest of the arguments are as per :func:`numpy.zeros`. ''' array = empty_aligned(shape, dtype=dtype, order=order, n=n) array.fill(0) return array cpdef ones_aligned(shape, dtype='float64', order='C', n=None): '''ones_aligned(shape, dtype='float64', order='C', n=None) Function that returns a numpy array of ones that is n-byte aligned, where ``n`` is determined by inspecting the CPU if it is not provided. The alignment is given by the final optional argument, ``n``. If ``n`` is not provided then this function will inspect the CPU to determine alignment. The rest of the arguments are as per :func:`numpy.ones`. ''' array = empty_aligned(shape, dtype=dtype, order=order, n=n) array.fill(1) return array pyFFTW-0.10.1/pyfftw/interfaces/0000775000175000017500000000000012652703650015756 5ustar whgwhg00000000000000pyFFTW-0.10.1/pyfftw/interfaces/scipy_fftpack.py0000664000175000017500000002634212570060606021160 0ustar whgwhg00000000000000#!/usr/bin/env python # # Henry Gomersall # heng@kedevelopments.co.uk # # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, this # list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright notice, # this list of conditions and the following disclaimer in the documentation # and/or other materials provided with the distribution. # # * Neither the name of the copyright holder nor the names of its contributors # may be used to endorse or promote products derived from this software without # specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. # ''' This module implements those functions that replace aspects of the :mod:`scipy.fftpack` module. This module *provides* the entire documented namespace of :mod:`scipy.fftpack`, but those functions that are not included here are imported directly from :mod:`scipy.fftpack`. The exceptions raised by each of these functions are mostly as per their equivalents in :mod:`scipy.fftpack`, though there are some corner cases in which this may not be true. It is notable that unlike :mod:`scipy.fftpack`, these functions will generally return an output array with the same precision as the input array, and the transform that is chosen is chosen based on the precision of the input array. That is, if the input array is 32-bit floating point, then the transform will be 32-bit floating point and so will the returned array. If any type conversion is required, the default will be double precision. Some corner (mis)usages of :mod:`scipy.fftpack` may not transfer neatly. For example, using :func:`scipy.fftpack.fft2` with a non 1D array and a 2D `shape` argument will return without exception whereas :func:`pyfftw.interfaces.scipy_fftpack.fft2` will raise a `ValueError`. ''' from . import numpy_fft import numpy # Complete the namespace (these are not actually used in this module) from scipy.fftpack import (dct, idct, diff, tilbert, itilbert, hilbert, ihilbert, cs_diff, sc_diff, ss_diff, cc_diff, shift, fftshift, ifftshift, fftfreq, rfftfreq, convolve, _fftpack) try: from scipy.fftpack import dst, idst except ImportError: pass __all__ = ['fft','ifft','fftn','ifftn','rfft','irfft', 'fft2','ifft2', 'diff', 'tilbert','itilbert','hilbert','ihilbert', 'sc_diff', 'cs_diff','cc_diff','ss_diff', 'shift', 'rfftfreq'] def fft(x, n=None, axis=-1, overwrite_x=False, planner_effort='FFTW_MEASURE', threads=1, auto_align_input=True, auto_contiguous=True): '''Perform a 1D FFT. The first three arguments are as per :func:`scipy.fftpack.fft`; the rest of the arguments are documented in the :ref:`additional argument docs`. ''' return numpy_fft.fft(x, n, axis, overwrite_x, planner_effort, threads, auto_align_input, auto_contiguous) def ifft(x, n=None, axis=-1, overwrite_x=False, planner_effort='FFTW_MEASURE', threads=1, auto_align_input=True, auto_contiguous=True): '''Perform a 1D inverse FFT. The first three arguments are as per :func:`scipy.fftpack.ifft`; the rest of the arguments are documented in the :ref:`additional argument docs`. ''' return numpy_fft.ifft(x, n, axis, overwrite_x, planner_effort, threads, auto_align_input, auto_contiguous) def fft2(x, shape=None, axes=(-2,-1), overwrite_x=False, planner_effort='FFTW_MEASURE', threads=1, auto_align_input=True, auto_contiguous=True): '''Perform a 2D FFT. The first three arguments are as per :func:`scipy.fftpack.fft2`; the rest of the arguments are documented in the :ref:`additional argument docs`. ''' return numpy_fft.fft2(x, shape, axes, overwrite_x, planner_effort, threads, auto_align_input, auto_contiguous) def ifft2(x, shape=None, axes=(-2,-1), overwrite_x=False, planner_effort='FFTW_MEASURE', threads=1, auto_align_input=True, auto_contiguous=True): '''Perform a 2D inverse FFT. The first three arguments are as per :func:`scipy.fftpack.ifft2`; the rest of the arguments are documented in the :ref:`additional argument docs `. ''' return numpy_fft.ifft2(x, shape, axes, overwrite_x, planner_effort, threads, auto_align_input, auto_contiguous) def fftn(x, shape=None, axes=None, overwrite_x=False, planner_effort='FFTW_MEASURE', threads=1, auto_align_input=True, auto_contiguous=True): '''Perform an n-D FFT. The first three arguments are as per :func:`scipy.fftpack.fftn`; the rest of the arguments are documented in the :ref:`additional argument docs`. ''' if shape is not None: if ((axes is not None and len(shape) != len(axes)) or (axes is None and len(shape) != x.ndim)): raise ValueError('Shape error: In order to maintain better ' 'compatibility with scipy.fftpack.fftn, a ValueError ' 'is raised when the length of the shape argument is ' 'not the same as x.ndim if axes is None or the length ' 'of axes if it is not. If this is problematic, consider ' 'using the numpy interface.') return numpy_fft.fftn(x, shape, axes, overwrite_x, planner_effort, threads, auto_align_input, auto_contiguous) def ifftn(x, shape=None, axes=None, overwrite_x=False, planner_effort='FFTW_MEASURE', threads=1, auto_align_input=True, auto_contiguous=True): '''Perform an n-D inverse FFT. The first three arguments are as per :func:`scipy.fftpack.ifftn`; the rest of the arguments are documented in the :ref:`additional argument docs`. ''' if shape is not None: if ((axes is not None and len(shape) != len(axes)) or (axes is None and len(shape) != x.ndim)): raise ValueError('Shape error: In order to maintain better ' 'compatibility with scipy.fftpack.ifftn, a ValueError ' 'is raised when the length of the shape argument is ' 'not the same as x.ndim if axes is None or the length ' 'of axes if it is not. If this is problematic, consider ' 'using the numpy interface.') return numpy_fft.ifftn(x, shape, axes, overwrite_x, planner_effort, threads, auto_align_input, auto_contiguous) def _complex_to_rfft_output(complex_output, output_shape, axis): '''Convert the complex output from pyfftw to the real output expected from :func:`scipy.fftpack.rfft`. ''' rfft_output = numpy.empty(output_shape, dtype=complex_output.real.dtype) source_slicer = [slice(None)] * complex_output.ndim target_slicer = [slice(None)] * complex_output.ndim # First element source_slicer[axis] = slice(0, 1) target_slicer[axis] = slice(0, 1) rfft_output[target_slicer] = complex_output[source_slicer].real # Real part source_slicer[axis] = slice(1, None) target_slicer[axis] = slice(1, None, 2) rfft_output[target_slicer] = complex_output[source_slicer].real # Imaginary part if output_shape[axis] % 2 == 0: end_val = -1 else: end_val = None source_slicer[axis] = slice(1, end_val, None) target_slicer[axis] = slice(2, None, 2) rfft_output[target_slicer] = complex_output[source_slicer].imag return rfft_output def _irfft_input_to_complex(irfft_input, axis): '''Convert the expected real input to :func:`scipy.fftpack.irfft` to the complex input needed by pyfftw. ''' complex_dtype = numpy.result_type(irfft_input, 1j) input_shape = list(irfft_input.shape) input_shape[axis] = input_shape[axis]//2 + 1 complex_input = numpy.empty(input_shape, dtype=complex_dtype) source_slicer = [slice(None)] * len(input_shape) target_slicer = [slice(None)] * len(input_shape) # First element source_slicer[axis] = slice(0, 1) target_slicer[axis] = slice(0, 1) complex_input[target_slicer] = irfft_input[source_slicer] # Real part source_slicer[axis] = slice(1, None, 2) target_slicer[axis] = slice(1, None) complex_input[target_slicer].real = irfft_input[source_slicer] # Imaginary part if irfft_input.shape[axis] % 2 == 0: end_val = -1 target_slicer[axis] = slice(-1, None) complex_input[target_slicer].imag = 0.0 else: end_val = None source_slicer[axis] = slice(2, None, 2) target_slicer[axis] = slice(1, end_val) complex_input[target_slicer].imag = irfft_input[source_slicer] return complex_input def rfft(x, n=None, axis=-1, overwrite_x=False, planner_effort='FFTW_MEASURE', threads=1, auto_align_input=True, auto_contiguous=True): '''Perform a 1D real FFT. The first three arguments are as per :func:`scipy.fftpack.rfft`; the rest of the arguments are documented in the :ref:`additional argument docs`. ''' if not numpy.isrealobj(x): raise TypeError('Input array must be real to maintain ' 'compatibility with scipy.fftpack.rfft.') x = numpy.asanyarray(x) complex_output = numpy_fft.rfft(x, n, axis, overwrite_x, planner_effort, threads, auto_align_input, auto_contiguous) output_shape = list(x.shape) if n is not None: output_shape[axis] = n return _complex_to_rfft_output(complex_output, output_shape, axis) def irfft(x, n=None, axis=-1, overwrite_x=False, planner_effort='FFTW_MEASURE', threads=1, auto_align_input=True, auto_contiguous=True): '''Perform a 1D real inverse FFT. The first three arguments are as per :func:`scipy.fftpack.irfft`; the rest of the arguments are documented in the :ref:`additional argument docs`. ''' if not numpy.isrealobj(x): raise TypeError('Input array must be real to maintain ' 'compatibility with scipy.fftpack.irfft.') x = numpy.asanyarray(x) if n is None: n = x.shape[axis] complex_input = _irfft_input_to_complex(x, axis) return numpy_fft.irfft(complex_input, n, axis, overwrite_x, planner_effort, threads, auto_align_input, auto_contiguous) pyFFTW-0.10.1/pyfftw/interfaces/numpy_fft.py0000664000175000017500000002701712570060606020342 0ustar whgwhg00000000000000#!/usr/bin/env python # # Henry Gomersall # heng@kedevelopments.co.uk # # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, this # list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright notice, # this list of conditions and the following disclaimer in the documentation # and/or other materials provided with the distribution. # # * Neither the name of the copyright holder nor the names of its contributors # may be used to endorse or promote products derived from this software without # specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. # ''' This module implements those functions that replace aspects of the :mod:`numpy.fft` module. This module *provides* the entire documented namespace of :mod:`numpy.fft`, but those functions that are not included here are imported directly from :mod:`numpy.fft`. It is notable that unlike :mod:`numpy.fftpack`, these functions will generally return an output array with the same precision as the input array, and the transform that is chosen is chosen based on the precision of the input array. That is, if the input array is 32-bit floating point, then the transform will be 32-bit floating point and so will the returned array. If any type conversion is required, the default will be double precision. One known caveat is that repeated axes are handled differently to :mod:`numpy.fft`; axes that are repeated in the axes argument are considered only once, as compared to :mod:`numpy.fft` in which repeated axes results in the DFT being taken along that axes as many times as the axis occurs. The exceptions raised by each of these functions are mostly as per their equivalents in :mod:`numpy.fft`, though there are some corner cases in which this may not be true. ''' from ._utils import _Xfftn # Complete the namespace (these are not actually used in this module) from numpy.fft import fftfreq, fftshift, ifftshift import numpy __all__ = ['fft','ifft', 'fft2', 'ifft2', 'fftn', 'ifftn', 'rfft', 'irfft', 'rfft2', 'irfft2', 'rfftn', 'irfftn', 'hfft', 'ihfft', 'fftfreq', 'fftshift', 'ifftshift'] def fft(a, n=None, axis=-1, overwrite_input=False, planner_effort='FFTW_MEASURE', threads=1, auto_align_input=True, auto_contiguous=True): '''Perform a 1D FFT. The first three arguments are as per :func:`numpy.fft.fft`; the rest of the arguments are documented in the :ref:`additional arguments docs`. ''' calling_func = 'fft' return _Xfftn(a, n, axis, overwrite_input, planner_effort, threads, auto_align_input, auto_contiguous, calling_func) def ifft(a, n=None, axis=-1, overwrite_input=False, planner_effort='FFTW_MEASURE', threads=1, auto_align_input=True, auto_contiguous=True): '''Perform a 1D inverse FFT. The first three arguments are as per :func:`numpy.fft.ifft`; the rest of the arguments are documented in the :ref:`additional arguments docs`. ''' calling_func = 'ifft' return _Xfftn(a, n, axis, overwrite_input, planner_effort, threads, auto_align_input, auto_contiguous, calling_func) def fft2(a, s=None, axes=(-2,-1), overwrite_input=False, planner_effort='FFTW_MEASURE', threads=1, auto_align_input=True, auto_contiguous=True): '''Perform a 2D FFT. The first three arguments are as per :func:`numpy.fft.fft2`; the rest of the arguments are documented in the :ref:`additional arguments docs`. ''' calling_func = 'fft2' return _Xfftn(a, s, axes, overwrite_input, planner_effort, threads, auto_align_input, auto_contiguous, calling_func) def ifft2(a, s=None, axes=(-2,-1), overwrite_input=False, planner_effort='FFTW_MEASURE', threads=1, auto_align_input=True, auto_contiguous=True): '''Perform a 2D inverse FFT. The first three arguments are as per :func:`numpy.fft.ifft2`; the rest of the arguments are documented in the :ref:`additional arguments docs`. ''' calling_func = 'ifft2' return _Xfftn(a, s, axes, overwrite_input, planner_effort, threads, auto_align_input, auto_contiguous, calling_func) def fftn(a, s=None, axes=None, overwrite_input=False, planner_effort='FFTW_MEASURE', threads=1, auto_align_input=True, auto_contiguous=True): '''Perform an n-D FFT. The first three arguments are as per :func:`numpy.fft.fftn`; the rest of the arguments are documented in the :ref:`additional arguments docs`. ''' calling_func = 'fftn' return _Xfftn(a, s, axes, overwrite_input, planner_effort, threads, auto_align_input, auto_contiguous, calling_func) def ifftn(a, s=None, axes=None, overwrite_input=False, planner_effort='FFTW_MEASURE', threads=1, auto_align_input=True, auto_contiguous=True): '''Perform an n-D inverse FFT. The first three arguments are as per :func:`numpy.fft.ifftn`; the rest of the arguments are documented in the :ref:`additional arguments docs`. ''' calling_func = 'ifftn' return _Xfftn(a, s, axes, overwrite_input, planner_effort, threads, auto_align_input, auto_contiguous, calling_func) def rfft(a, n=None, axis=-1, overwrite_input=False, planner_effort='FFTW_MEASURE', threads=1, auto_align_input=True, auto_contiguous=True): '''Perform a 1D real FFT. The first three arguments are as per :func:`numpy.fft.rfft`; the rest of the arguments are documented in the :ref:`additional arguments docs`. ''' calling_func = 'rfft' return _Xfftn(a, n, axis, overwrite_input, planner_effort, threads, auto_align_input, auto_contiguous, calling_func) def irfft(a, n=None, axis=-1, overwrite_input=False, planner_effort='FFTW_MEASURE', threads=1, auto_align_input=True, auto_contiguous=True): '''Perform a 1D real inverse FFT. The first three arguments are as per :func:`numpy.fft.irfft`; the rest of the arguments are documented in the :ref:`additional arguments docs`. ''' calling_func = 'irfft' return _Xfftn(a, n, axis, overwrite_input, planner_effort, threads, auto_align_input, auto_contiguous, calling_func) def rfft2(a, s=None, axes=(-2,-1), overwrite_input=False, planner_effort='FFTW_MEASURE', threads=1, auto_align_input=True, auto_contiguous=True): '''Perform a 2D real FFT. The first three arguments are as per :func:`numpy.fft.rfft2`; the rest of the arguments are documented in the :ref:`additional arguments docs`. ''' calling_func = 'rfft2' return _Xfftn(a, s, axes, overwrite_input, planner_effort, threads, auto_align_input, auto_contiguous, calling_func) def irfft2(a, s=None, axes=(-2,-1), overwrite_input=False, planner_effort='FFTW_MEASURE', threads=1, auto_align_input=True, auto_contiguous=True): '''Perform a 2D real inverse FFT. The first three arguments are as per :func:`numpy.fft.irfft2`; the rest of the arguments are documented in the :ref:`additional arguments docs`. ''' calling_func = 'irfft2' return _Xfftn(a, s, axes, overwrite_input, planner_effort, threads, auto_align_input, auto_contiguous, calling_func) def rfftn(a, s=None, axes=None, overwrite_input=False, planner_effort='FFTW_MEASURE', threads=1, auto_align_input=True, auto_contiguous=True): '''Perform an n-D real FFT. The first three arguments are as per :func:`numpy.fft.rfftn`; the rest of the arguments are documented in the :ref:`additional arguments docs`. ''' calling_func = 'rfftn' return _Xfftn(a, s, axes, overwrite_input, planner_effort, threads, auto_align_input, auto_contiguous, calling_func) def irfftn(a, s=None, axes=None, overwrite_input=False, planner_effort='FFTW_MEASURE', threads=1, auto_align_input=True, auto_contiguous=True): '''Perform an n-D real inverse FFT. The first three arguments are as per :func:`numpy.fft.rfftn`; the rest of the arguments are documented in the :ref:`additional arguments docs`. ''' calling_func = 'irfftn' return _Xfftn(a, s, axes, overwrite_input, planner_effort, threads, auto_align_input, auto_contiguous, calling_func) def hfft(a, n=None, axis=-1, overwrite_input=False, planner_effort='FFTW_MEASURE', threads=1, auto_align_input=True, auto_contiguous=True): '''Perform a 1D FFT of a signal with hermitian symmetry. This yields a real output spectrum. See :func:`numpy.fft.hfft` for more information. The first three arguments are as per :func:`numpy.fft.hfft`; the rest of the arguments are documented in the :ref:`additional arguments docs`. ''' # The hermitian symmetric transform is equivalent to the # irfft of the conjugate of the input (do the maths!) without # any normalisation of the result (so normalise_idft is set to # False). a = numpy.conjugate(a) calling_func = 'irfft' return _Xfftn(a, n, axis, overwrite_input, planner_effort, threads, auto_align_input, auto_contiguous, calling_func, normalise_idft=False) def ihfft(a, n=None, axis=-1, overwrite_input=False, planner_effort='FFTW_MEASURE', threads=1, auto_align_input=True, auto_contiguous=True): '''Perform a 1D inverse FFT of a real-spectrum, yielding a signal with hermitian symmetry. See :func:`numpy.fft.ihfft` for more information. The first three arguments are as per :func:`numpy.fft.ihfft`; the rest of the arguments are documented in the :ref:`additional arguments docs`. ''' # Result is equivalent to the conjugate of the output of # the rfft of a. # It is necessary to perform the inverse scaling, as this # is not done by rfft. if n is None: if not isinstance(a, numpy.ndarray): a = numpy.asarray(a) n = a.shape[axis] scaling = 1.0/n return scaling * rfft(a, n, axis, overwrite_input, planner_effort, threads, auto_align_input, auto_contiguous).conj() pyFFTW-0.10.1/pyfftw/interfaces/cache.py0000664000175000017500000002211212643723063017371 0ustar whgwhg00000000000000#!/usr/bin/env python # # Copyright 2015 Knowledge Economy Developments Ltd # # Henry Gomersall # heng@kedevelopments.co.uk # # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, this # list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright notice, # this list of conditions and the following disclaimer in the documentation # and/or other materials provided with the distribution. # # * Neither the name of the copyright holder nor the names of its contributors # may be used to endorse or promote products derived from this software without # specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. # ''' During calls to functions implemented in :mod:`pyfftw.interfaces`, a :class:`pyfftw.FFTW` object is necessarily created. Although the time to create a new :class:`pyfftw.FFTW` is short (assuming that the planner possesses the necessary wisdom to create the plan immediately), it may still take longer than a short transform. This module implements a method by which objects that are created through :mod:`pyfftw.interfaces` are temporarily cached. If an equivalent transform is then performed within a short period, the object is acquired from the cache rather than a new one created. The equivalency is quite conservative and in practice means that if any of the arguments change, or if the properties of the array (shape, strides, dtype) change in any way, then the cache lookup will fail. The cache temporarily stores a copy of any interim :class:`pyfftw.FFTW` objects that are created. If they are not used for some period of time, which can be set with :func:`pyfftw.interfaces.cache.set_keepalive_time`, then they are removed from the cache (liberating any associated memory). The default keepalive time is 0.1 seconds. Enable the cache by calling :func:`pyfftw.interfaces.cache.enable`. Disable it by calling :func:`pyfftw.interfaces.cache.disable`. By default, the cache is disabled. Note that even with the cache enabled, there is a fixed overhead associated with lookups. This means that for small transforms, the overhead may exceed the transform. At this point, it's worth looking at using :class:`pyfftw.FFTW` directly. When the cache is enabled, the module spawns a new thread to keep track of the objects. If :mod:`threading` is not available, then the cache is not available and trying to use it will raise an ImportError exception. The actual implementation of the cache is liable to change, but the documented API is stable. ''' try: import threading as _threading _threading_import_error = None except ImportError as e: _threading_import_error = e _threading == None import time import weakref __all__ = ['enable', 'disable', 'set_keepalive_time'] _fftw_cache = None class CacheError(Exception): pass def enable(): '''Enable the cache. ''' global _fftw_cache if _threading is not None: if _fftw_cache is None: _fftw_cache = _Cache() else: raise ImportError(_threading_import_error) def disable(): '''Disable the cache. ''' global _fftw_cache _fftw_cache = None def is_enabled(): '''Return whether the cache is currently enabled. ''' if _fftw_cache is None: return False else: return True def set_keepalive_time(keepalive_time): '''Set the minimum time in seconds for which any :mod:`pyfftw.FFTW` object in the cache is kept alive. When the cache is enabled, the interim objects that are used through a :mod:`pyfftw.interfaces` function are cached for the time set through this function. If the object is not used for the that time, it is removed from the cache. Using the object zeros the timer. The time is not precise, and sets a minimum time to be alive. In practice, it may be quite a bit longer before the object is deleted from the cache (due to implementational details - e.g. contention from other threads). ''' global _fftw_cache if _fftw_cache is None: raise CacheError('Cache is not currently enabled') else: _fftw_cache.set_keepalive_time(keepalive_time) class _Cache(object): @property def keepalive_time(self): return self._keepalive_time def __init__(self, keepalive_time=0.1): self._cache_dict = {} self.set_keepalive_time(keepalive_time) # A set of objects to be kept alive during the next cull self._keepalive_set = set() self._cull_lock = _threading.Lock() self._keepalive_set_lock = _threading.Lock() self.initialised = _threading.Event() self._parent_thread = _threading.current_thread() self._close_thread_now = _threading.Event() self._initialised = _threading.Event() self._initialised.clear() # Explicitly clear it for clarity self._thread_object = _threading.Thread(target=_Cache._run, args=(weakref.proxy(self), )) self._thread_object.daemon = True self._thread_object.start() while not self._initialised.is_set(): # This loop is necessary to stop the main thread doing # anything until the exception handler in _run can deal with # the object being deleted. pass def __del__(self): # Wait until the thread object has quit before # exiting (which it will because a reference error will # be raised). try: self._close_thread_now.set() except TypeError: # Not sure what's going on here, but IPython baulks on exit pass def __contains__(self, key): return key in self._cache_dict def _run(self): last_cull_time = time.time() try: self._initialised.set() while True: if (not self._parent_thread.is_alive() or self._close_thread_now.is_set()): break if time.time() - last_cull_time > self._keepalive_time: # Perform a cull last_cull_time = time.time() with self._cull_lock: # Operate on a copy of the cache dict # so lookups continue. new_cache_dict = self._cache_dict.copy() with self._keepalive_set_lock: # Work out which should be culled cull_set = set(new_cache_dict).difference( self._keepalive_set) self._keepalive_set = set() for each_key in cull_set: del new_cache_dict[each_key] # Necessarily atomic, so no problem with # the lookups continuing self._cache_dict = new_cache_dict time.sleep(self._wakeup_time) except ReferenceError: pass def set_keepalive_time(self, keepalive_time=0.1): '''Set the minimum time in seconds for which any object in the cache is kept alive. The time is not precise, and sets a minimum time to be alive. In practice, it may be up to twice as long before the object is deleted from the cache (due to implementational details). ''' self._keepalive_time = float(keepalive_time) if self._keepalive_time/2 > 0.1: self._wakeup_time = 0.1 else: self._wakeup_time = self._keepalive_time/2 def _refresh(self, key): '''Refresh the object referenced by key to stop it being culled on the next round. ''' with self._keepalive_set_lock: self._keepalive_set.add(key) def insert(self, obj, key): '''Insert the passed object into the cache, referenced by key, a hashable. ''' with self._cull_lock: self._cache_dict[key] = obj self._refresh(key) def lookup(self, key): '''Lookup the object referenced by key and return it, refreshing the cache at the same time. ''' self._refresh(key) return self._cache_dict[key] pyFFTW-0.10.1/pyfftw/interfaces/_utils.py0000664000175000017500000001071712570060606017631 0ustar whgwhg00000000000000#!/usr/bin/env python # # Copyright 2014 Knowledge Economy Developments Ltd # # Henry Gomersall # heng@kedevelopments.co.uk # # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, this # list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright notice, # this list of conditions and the following disclaimer in the documentation # and/or other materials provided with the distribution. # # * Neither the name of the copyright holder nor the names of its contributors # may be used to endorse or promote products derived from this software without # specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. # ''' Utility functions for the interfaces routines ''' import pyfftw.builders as builders import pyfftw import numpy from . import cache def _Xfftn(a, s, axes, overwrite_input, planner_effort, threads, auto_align_input, auto_contiguous, calling_func, normalise_idft=True): reload_after_transform = False a = numpy.asanyarray(a) try: s = tuple(s) except TypeError: pass try: axes = tuple(axes) except TypeError: pass if calling_func in ('irfft2', 'irfftn'): # overwrite_input is not an argument to irfft2 or irfftn args = (a, s, axes, planner_effort, threads, auto_align_input, auto_contiguous) if not overwrite_input: # Only irfft2 and irfftn have overwriting the input # as the default (and so require the input array to # be reloaded). reload_after_transform = True else: args = (a, s, axes, overwrite_input, planner_effort, threads, auto_align_input, auto_contiguous) if cache.is_enabled(): key = (calling_func, a.shape, a.strides, a.dtype, s.__hash__(), axes.__hash__(), args[3:]) try: if key in cache._fftw_cache: FFTW_object = cache._fftw_cache.lookup(key) else: FFTW_object = None except KeyError: # This occurs if the object has fallen out of the cache between # the check and the lookup FFTW_object = None if not cache.is_enabled() or FFTW_object is None: # If we're going to create a new FFTW object, we need to copy # the input array to preserve it, otherwise we can't actually # take the transform of the input array! (in general, we have # to assume that the input array will be destroyed during # planning). a_copy = a.copy() FFTW_object = getattr(builders, calling_func)(*args) # Only copy if the input array is what was actually used # (otherwise it shouldn't be overwritten) if FFTW_object.input_array is a: a[:] = a_copy if cache.is_enabled(): cache._fftw_cache.insert(FFTW_object, key) output_array = FFTW_object(normalise_idft=normalise_idft) else: if reload_after_transform: a_copy = a.copy() orig_output_array = FFTW_object.output_array output_shape = orig_output_array.shape output_dtype = orig_output_array.dtype output_alignment = FFTW_object.output_alignment output_array = pyfftw.empty_aligned( output_shape, output_dtype, n=output_alignment) FFTW_object(input_array=a, output_array=output_array, normalise_idft=normalise_idft) if reload_after_transform: a[:] = a_copy return output_array pyFFTW-0.10.1/pyfftw/interfaces/__init__.py0000664000175000017500000002307512570060606020072 0ustar whgwhg00000000000000#!/usr/bin/env python '''The :mod:`pyfftw.interfaces` package provides interfaces to :mod:`pyfftw` that implement the API of other, more commonly used FFT libraries; specifically :mod:`numpy.fft` and :mod:`scipy.fftpack`. The intention is to satisfy two clear use cases: 1. Simple, clean and well established interfaces to using :mod:`pyfftw`, removing the requirement for users to know or understand about creating and using :class:`pyfftw.FFTW` objects, whilst still benefiting from most of the speed benefits of FFTW. 2. A library that can be dropped into code that is already written to use a supported FFT library, with no significant change to the existing code. The power of python allows this to be done at runtime to a third party library, without changing any of that library's code. The :mod:`pyfftw.interfaces` implementation is designed to sacrifice a small amount of the flexibility compared to accessing the :class:`pyfftw.FFTW` object directly, but implements a reasonable set of defaults and optional tweaks that should satisfy most situations. The precision of the transform that is used is selected from the array that is passed in, defaulting to double precision if any type conversion is required. This module works by generating a :class:`pyfftw.FFTW` object behind the scenes using the :mod:`pyfftw.builders` interface, which is then executed. There is therefore a potentially substantial overhead when a new plan needs to be created. This is down to FFTW's internal planner process. After a specific transform has been planned once, subsequent calls in which the input array is equivalent will be much faster, though still not without potentially significant overhead. *This* overhead can be largely alleviated by enabling the :mod:`pyfftw.interfaces.cache` functionality. However, even when the cache is used, very small transforms may suffer a significant relative slow-down not present when accessing :mod:`pyfftw.FFTW` directly (because the transform time can be negligibly small compared to the fixed :mod:`pyfftw.interfaces` overhead). In addition, potentially extra copies of the input array might be made. If speed or memory conservation is of absolutely paramount importance, the suggestion is to use :mod:`pyfftw.FFTW` (which provides better control over copies and so on), either directly or through :mod:`pyfftw.builders`. As always, experimentation is the best guide to optimisation. In practice, this means something like the following (taking :mod:`~pyfftw.interfaces.numpy_fft` as an example): .. doctest:: >>> import pyfftw, numpy >>> a = pyfftw.empty_aligned((128, 64), dtype='complex64', n=16) >>> a[:] = numpy.random.randn(*a.shape) + 1j*numpy.random.randn(*a.shape) >>> fft_a = pyfftw.interfaces.numpy_fft.fft2(a) # Will need to plan .. doctest:: >>> b = pyfftw.empty_aligned((128, 64), dtype='complex64', n=16) >>> b[:] = a >>> fft_b = pyfftw.interfaces.numpy_fft.fft2(b) # Already planned, so faster .. doctest:: >>> c = pyfftw.empty_aligned(132, dtype='complex128', n=16) >>> fft_c = pyfftw.interfaces.numpy_fft.fft(c) # Needs a new plan >>> c[:] = numpy.random.randn(*c.shape) + 1j*numpy.random.randn(*c.shape) .. doctest:: >>> pyfftw.interfaces.cache.enable() >>> fft_a = pyfftw.interfaces.numpy_fft.fft2(a) # still planned >>> fft_b = pyfftw.interfaces.numpy_fft.fft2(b) # much faster, from the cache The usual wisdom import and export functions work well for the case where the initial plan might be prohibitively expensive. Just use :func:`pyfftw.export_wisdom` and :func:`pyfftw.import_wisdom` as needed after having performed the transform once. Implemented Functions --------------------- The implemented functions are listed below. :mod:`numpy.fft` is implemented by :mod:`pyfftw.interfaces.numpy_fft` and :mod:`scipy.fftpack` by :mod:`pyfftw.interfaces.scipy_fftpack`. All the implemented functions are extended by the use of additional arguments, which are :ref:`documented below`. Not all the functions provided by :mod:`numpy.fft` and :mod:`scipy.fftpack` are implemented by :mod:`pyfftw.interfaces`. In the case where a function is not implemented, the function is imported into the namespace from the corresponding library. This means that all the documented functionality of the library *is* provided through :mod:`pyfftw.interfaces`. One known caveat is that repeated axes are potentially handled differently. This is certainly the case for :mod:`numpy.fft` and probably also true for :mod:`scipy.fftpack` (though it is not defined in the docs); axes that are repeated in the axes argument are considered only once, as compared to :mod:`numpy.fft` in which repeated axes results in the DFT being taken along that axes as many times as the axis occurs. :mod:`~pyfftw.interfaces.numpy_fft` """"""""""""""""""""""""""""""""""" * :func:`pyfftw.interfaces.numpy_fft.fft` * :func:`pyfftw.interfaces.numpy_fft.ifft` * :func:`pyfftw.interfaces.numpy_fft.fft2` * :func:`pyfftw.interfaces.numpy_fft.ifft2` * :func:`pyfftw.interfaces.numpy_fft.fftn` * :func:`pyfftw.interfaces.numpy_fft.ifftn` * :func:`pyfftw.interfaces.numpy_fft.rfft` * :func:`pyfftw.interfaces.numpy_fft.irfft` * :func:`pyfftw.interfaces.numpy_fft.rfft2` * :func:`pyfftw.interfaces.numpy_fft.irfft2` * :func:`pyfftw.interfaces.numpy_fft.rfftn` * :func:`pyfftw.interfaces.numpy_fft.irfftn` * :func:`pyfftw.interfaces.numpy_fft.hfft` * :func:`pyfftw.interfaces.numpy_fft.ihfft` :mod:`~pyfftw.interfaces.scipy_fftpack` """"""""""""""""""""""""""""""""""""""" * :func:`pyfftw.interfaces.scipy_fftpack.fft` * :func:`pyfftw.interfaces.scipy_fftpack.ifft` * :func:`pyfftw.interfaces.scipy_fftpack.fft2` * :func:`pyfftw.interfaces.scipy_fftpack.ifft2` * :func:`pyfftw.interfaces.scipy_fftpack.fftn` * :func:`pyfftw.interfaces.scipy_fftpack.ifftn` * :func:`pyfftw.interfaces.scipy_fftpack.rfft` * :func:`pyfftw.interfaces.scipy_fftpack.irfft` .. _interfaces_additional_args: Additional Arguments -------------------- In addition to the equivalent arguments in :mod:`numpy.fft` and :mod:`scipy.fftpack`, all these functions also add several additional arguments for finer control over the FFT. These additional arguments are largely a subset of the keyword arguments in :mod:`pyfftw.builders` with a few exceptions and with different defaults. * ``overwrite_input``: Whether or not the input array can be overwritten during the transform. This sometimes results in a faster algorithm being made available. It causes the ``'FFTW_DESTROY_INPUT'`` flag to be passed to the intermediate :class:`pyfftw.FFTW` object. Unlike with :mod:`pyfftw.builders`, this argument is included with *every* function in this package. In :mod:`~pyfftw.interfaces.scipy_fftpack`, this argument is replaced by ``overwrite_x``, to which it is equivalent (albeit at the same position). The default is ``False`` to be consistent with :mod:`numpy.fft`. * ``planner_effort``: A string dictating how much effort is spent in planning the FFTW routines. This is passed to the creation of the intermediate :class:`pyfftw.FFTW` object as an entry in the flags list. They correspond to flags passed to the :class:`pyfftw.FFTW` object. The valid strings, in order of their increasing impact on the time to compute are: ``'FFTW_ESTIMATE'``, ``'FFTW_MEASURE'`` (default), ``'FFTW_PATIENT'`` and ``'FFTW_EXHAUSTIVE'``. The `Wisdom `_ that FFTW has accumulated or has loaded (through :func:`pyfftw.import_wisdom`) is used during the creation of :class:`pyfftw.FFTW` objects. Note that the first time planning stage can take a substantial amount of time. For this reason, the default is to use ``'FFTW_ESTIMATE'``, which potentially results in a slightly suboptimal plan being used, but with a substantially quicker first-time planner step. * ``threads``: The number of threads used to perform the FFT. The default is ``1``. * ``auto_align_input``: Correctly byte align the input array for optimal usage of vector instructions. This can lead to a substantial speedup. This argument being ``True`` makes sure that the input array is correctly aligned. It is possible to correctly byte align the array prior to calling this function (using, for example, :func:`pyfftw.byte_align`). If and only if a realignment is necessary is a new array created. It's worth noting that just being aligned may not be sufficient to create the fastest possible transform. For example, if the array is not contiguous (i.e. certain axes have gaps in memory between slices), it may be faster to plan a transform for a contiguous array, and then rely on the array being copied in before the transform (which :class:`pyfftw.FFTW` will handle for you). The ``auto_contiguous`` argument controls whether this function also takes care of making sure the array is contiguous or not. The default is ``True``. * ``auto_contiguous``: Make sure the input array is contiguous in memory before performing the transform on it. If the array is not contiguous, it is copied into an interim array. This is because it is often faster to copy the data before the transform and then transform a contiguous array than it is to try to take the transform of a non-contiguous array. This is particularly true in conjunction with the ``auto_align_input`` argument which is used to make sure that the transform is taken of an aligned array. The default is ``True``. ''' from . import ( numpy_fft, cache,) try: import scipy.fftpack except ImportError: pass else: del scipy from . import scipy_fftpack pyFFTW-0.10.1/pyfftw/pyfftw.pyx0000664000175000017500000021160412652630646015724 0ustar whgwhg00000000000000# Copyright 2015 Knowledge Economy Developments Ltd # # Henry Gomersall # heng@kedevelopments.co.uk # # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, this # list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright notice, # this list of conditions and the following disclaimer in the documentation # and/or other materials provided with the distribution. # # * Neither the name of the copyright holder nor the names of its contributors # may be used to endorse or promote products derived from this software without # specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. # import numpy as np cimport numpy as np from libc.stdlib cimport calloc, malloc, free from libc.stdint cimport intptr_t, int64_t from libc cimport limits import warnings import threading include 'utils.pxi' cdef extern from *: int Py_AtExit(void (*callback)()) cdef object directions directions = {'FFTW_FORWARD': FFTW_FORWARD, 'FFTW_BACKWARD': FFTW_BACKWARD} cdef object directions_lookup directions_lookup = {FFTW_FORWARD: 'FFTW_FORWARD', FFTW_BACKWARD: 'FFTW_BACKWARD'} cdef object flag_dict flag_dict = {'FFTW_MEASURE': FFTW_MEASURE, 'FFTW_EXHAUSTIVE': FFTW_EXHAUSTIVE, 'FFTW_PATIENT': FFTW_PATIENT, 'FFTW_ESTIMATE': FFTW_ESTIMATE, 'FFTW_UNALIGNED': FFTW_UNALIGNED, 'FFTW_DESTROY_INPUT': FFTW_DESTROY_INPUT, 'FFTW_WISDOM_ONLY': FFTW_WISDOM_ONLY} _flag_dict = flag_dict.copy() # Need a global lock to protect FFTW planning so that multiple Python threads # do not attempt to plan simultaneously. cdef object plan_lock = threading.Lock() # Function wrappers # ================= # All of these have the same signature as the fftw_generic functions # defined in the .pxd file. The arguments and return values are # cast as required in order to call the actual fftw functions. # # The wrapper function names are simply the fftw names prefixed # with a single underscore. # Planners # ======== # # Complex double precision cdef void* _fftw_plan_guru_dft( int rank, fftw_iodim *dims, int howmany_rank, fftw_iodim *howmany_dims, void *_in, void *_out, int sign, unsigned flags) nogil: return fftw_plan_guru_dft(rank, dims, howmany_rank, howmany_dims, _in, _out, sign, flags) # Complex single precision cdef void* _fftwf_plan_guru_dft( int rank, fftw_iodim *dims, int howmany_rank, fftw_iodim *howmany_dims, void *_in, void *_out, int sign, unsigned flags) nogil: return fftwf_plan_guru_dft(rank, dims, howmany_rank, howmany_dims, _in, _out, sign, flags) # Complex long double precision cdef void* _fftwl_plan_guru_dft( int rank, fftw_iodim *dims, int howmany_rank, fftw_iodim *howmany_dims, void *_in, void *_out, int sign, unsigned flags) nogil: return fftwl_plan_guru_dft(rank, dims, howmany_rank, howmany_dims, _in, _out, sign, flags) # real to complex double precision cdef void* _fftw_plan_guru_dft_r2c( int rank, fftw_iodim *dims, int howmany_rank, fftw_iodim *howmany_dims, void *_in, void *_out, int sign, unsigned flags) nogil: return fftw_plan_guru_dft_r2c(rank, dims, howmany_rank, howmany_dims, _in, _out, flags) # real to complex single precision cdef void* _fftwf_plan_guru_dft_r2c( int rank, fftw_iodim *dims, int howmany_rank, fftw_iodim *howmany_dims, void *_in, void *_out, int sign, unsigned flags) nogil: return fftwf_plan_guru_dft_r2c(rank, dims, howmany_rank, howmany_dims, _in, _out, flags) # real to complex long double precision cdef void* _fftwl_plan_guru_dft_r2c( int rank, fftw_iodim *dims, int howmany_rank, fftw_iodim *howmany_dims, void *_in, void *_out, int sign, unsigned flags) nogil: return fftwl_plan_guru_dft_r2c(rank, dims, howmany_rank, howmany_dims, _in, _out, flags) # complex to real double precision cdef void* _fftw_plan_guru_dft_c2r( int rank, fftw_iodim *dims, int howmany_rank, fftw_iodim *howmany_dims, void *_in, void *_out, int sign, unsigned flags) nogil: return fftw_plan_guru_dft_c2r(rank, dims, howmany_rank, howmany_dims, _in, _out, flags) # complex to real single precision cdef void* _fftwf_plan_guru_dft_c2r( int rank, fftw_iodim *dims, int howmany_rank, fftw_iodim *howmany_dims, void *_in, void *_out, int sign, unsigned flags) nogil: return fftwf_plan_guru_dft_c2r(rank, dims, howmany_rank, howmany_dims, _in, _out, flags) # complex to real long double precision cdef void* _fftwl_plan_guru_dft_c2r( int rank, fftw_iodim *dims, int howmany_rank, fftw_iodim *howmany_dims, void *_in, void *_out, int sign, unsigned flags) nogil: return fftwl_plan_guru_dft_c2r(rank, dims, howmany_rank, howmany_dims, _in, _out, flags) # Executors # ========= # # Complex double precision cdef void _fftw_execute_dft(void *_plan, void *_in, void *_out) nogil: fftw_execute_dft(_plan, _in, _out) # Complex single precision cdef void _fftwf_execute_dft(void *_plan, void *_in, void *_out) nogil: fftwf_execute_dft(_plan, _in, _out) # Complex long double precision cdef void _fftwl_execute_dft(void *_plan, void *_in, void *_out) nogil: fftwl_execute_dft(_plan, _in, _out) # real to complex double precision cdef void _fftw_execute_dft_r2c(void *_plan, void *_in, void *_out) nogil: fftw_execute_dft_r2c(_plan, _in, _out) # real to complex single precision cdef void _fftwf_execute_dft_r2c(void *_plan, void *_in, void *_out) nogil: fftwf_execute_dft_r2c(_plan, _in, _out) # real to complex long double precision cdef void _fftwl_execute_dft_r2c(void *_plan, void *_in, void *_out) nogil: fftwl_execute_dft_r2c(_plan, _in, _out) # complex to real double precision cdef void _fftw_execute_dft_c2r(void *_plan, void *_in, void *_out) nogil: fftw_execute_dft_c2r(_plan, _in, _out) # complex to real single precision cdef void _fftwf_execute_dft_c2r(void *_plan, void *_in, void *_out) nogil: fftwf_execute_dft_c2r(_plan, _in, _out) # complex to real long double precision cdef void _fftwl_execute_dft_c2r(void *_plan, void *_in, void *_out) nogil: fftwl_execute_dft_c2r(_plan, _in, _out) # Destroyers # ========== # # Double precision cdef void _fftw_destroy_plan(void *_plan): fftw_destroy_plan(_plan) # Single precision cdef void _fftwf_destroy_plan(void *_plan): fftwf_destroy_plan(_plan) # Long double precision cdef void _fftwl_destroy_plan(void *_plan): fftwl_destroy_plan(_plan) # Function lookup tables # ====================== # Planner table (of side the number of planners). cdef fftw_generic_plan_guru planners[9] cdef fftw_generic_plan_guru * _build_planner_list(): planners[0] = &_fftw_plan_guru_dft planners[1] = &_fftwf_plan_guru_dft planners[2] = &_fftwl_plan_guru_dft planners[3] = &_fftw_plan_guru_dft_r2c planners[4] = &_fftwf_plan_guru_dft_r2c planners[5] = &_fftwl_plan_guru_dft_r2c planners[6] = &_fftw_plan_guru_dft_c2r planners[7] = &_fftwf_plan_guru_dft_c2r planners[8] = &_fftwl_plan_guru_dft_c2r # Executor table (of size the number of executors) cdef fftw_generic_execute executors[9] cdef fftw_generic_execute * _build_executor_list(): executors[0] = &_fftw_execute_dft executors[1] = &_fftwf_execute_dft executors[2] = &_fftwl_execute_dft executors[3] = &_fftw_execute_dft_r2c executors[4] = &_fftwf_execute_dft_r2c executors[5] = &_fftwl_execute_dft_r2c executors[6] = &_fftw_execute_dft_c2r executors[7] = &_fftwf_execute_dft_c2r executors[8] = &_fftwl_execute_dft_c2r # Destroyer table (of size the number of destroyers) cdef fftw_generic_destroy_plan destroyers[3] cdef fftw_generic_destroy_plan * _build_destroyer_list(): destroyers[0] = &_fftw_destroy_plan destroyers[1] = &_fftwf_destroy_plan destroyers[2] = &_fftwl_destroy_plan # nthreads plan setters table cdef fftw_generic_plan_with_nthreads nthreads_plan_setters[3] cdef fftw_generic_plan_with_nthreads * _build_nthreads_plan_setters_list(): nthreads_plan_setters[0] = ( &fftw_plan_with_nthreads) nthreads_plan_setters[1] = ( &fftwf_plan_with_nthreads) nthreads_plan_setters[2] = ( &fftwl_plan_with_nthreads) # Set planner timelimits cdef fftw_generic_set_timelimit set_timelimit_funcs[3] cdef fftw_generic_set_timelimit * _build_set_timelimit_funcs_list(): set_timelimit_funcs[0] = ( &fftw_set_timelimit) set_timelimit_funcs[1] = ( &fftwf_set_timelimit) set_timelimit_funcs[2] = ( &fftwl_set_timelimit) # Data validators table cdef validator validators[2] cdef validator * _build_validators_list(): validators[0] = &_validate_r2c_arrays validators[1] = &_validate_c2r_arrays # Validator functions # =================== cdef bint _validate_r2c_arrays(np.ndarray input_array, np.ndarray output_array, int64_t *axes, int64_t *not_axes, int64_t axes_length): ''' Validates the input and output array to check for a valid real to complex transform. ''' # We firstly need to confirm that the dimenions of the arrays # are the same if not (input_array.ndim == output_array.ndim): return False in_shape = input_array.shape out_shape = output_array.shape for n in range(axes_length - 1): if not out_shape[axes[n]] == in_shape[axes[n]]: return False # The critical axis is the last of those over which the # FFT is taken. if not (out_shape[axes[axes_length-1]] == in_shape[axes[axes_length-1]]//2 + 1): return False for n in range(input_array.ndim - axes_length): if not out_shape[not_axes[n]] == in_shape[not_axes[n]]: return False return True cdef bint _validate_c2r_arrays(np.ndarray input_array, np.ndarray output_array, int64_t *axes, int64_t *not_axes, int64_t axes_length): ''' Validates the input and output array to check for a valid complex to real transform. ''' # We firstly need to confirm that the dimenions of the arrays # are the same if not (input_array.ndim == output_array.ndim): return False in_shape = input_array.shape out_shape = output_array.shape for n in range(axes_length - 1): if not in_shape[axes[n]] == out_shape[axes[n]]: return False # The critical axis is the last of those over which the # FFT is taken. if not (in_shape[axes[axes_length-1]] == out_shape[axes[axes_length-1]]//2 + 1): return False for n in range(input_array.ndim - axes_length): if not in_shape[not_axes[n]] == out_shape[not_axes[n]]: return False return True # Shape lookup functions # ====================== def _lookup_shape_r2c_arrays(input_array, output_array): return input_array.shape def _lookup_shape_c2r_arrays(input_array, output_array): return output_array.shape # fftw_schemes is a dictionary with a mapping from a keys, # which are a tuple of the string representation of numpy # dtypes to a scheme name. # # scheme_functions is a dictionary of functions, either # an index to the array of functions in the case of # 'planner', 'executor' and 'generic_precision' or a callable # in the case of 'validator' (generic_precision is a catchall for # functions that only change based on the precision changing - # i.e the prefix fftw, fftwl and fftwf is the only bit that changes). # # The array indices refer to the relevant functions for each scheme, # the tables to which are defined above. # # The 'validator' function is a callable for validating the arrays # that has the following signature: # bool callable(ndarray in_array, ndarray out_array, axes, not_axes) # and checks that the arrays are a valid pair. If it is set to None, # then the default check is applied, which confirms that the arrays # have the same shape. # # The 'fft_shape_lookup' function is a callable for returning the # FFT shape - that is, an array that describes the length of the # fft along each axis. It has the following signature: # fft_shape = fft_shape_lookup(in_array, out_array) # (note that this does not correspond to the lengths of the FFT that is # actually taken, it's the lengths of the FFT that *could* be taken # along each axis. It's necessary because the real FFT has a length # that is different to the length of the input array). cdef object fftw_schemes fftw_schemes = { (np.dtype('complex128'), np.dtype('complex128')): ('c2c', '64'), (np.dtype('complex64'), np.dtype('complex64')): ('c2c', '32'), (np.dtype('float64'), np.dtype('complex128')): ('r2c', '64'), (np.dtype('float32'), np.dtype('complex64')): ('r2c', '32'), (np.dtype('complex128'), np.dtype('float64')): ('c2r', '64'), (np.dtype('complex64'), np.dtype('float32')): ('c2r', '32')} if np.dtype('longdouble') != np.dtype('float64'): fftw_schemes.update({ (np.dtype('clongdouble'), np.dtype('clongdouble')): ('c2c', 'ld'), (np.dtype('longdouble'), np.dtype('clongdouble')): ('r2c', 'ld'), (np.dtype('clongdouble'), np.dtype('longdouble')): ('c2r', 'ld')}) cdef object scheme_directions scheme_directions = { ('c2c', '64'): ['FFTW_FORWARD', 'FFTW_BACKWARD'], ('c2c', '32'): ['FFTW_FORWARD', 'FFTW_BACKWARD'], ('c2c', 'ld'): ['FFTW_FORWARD', 'FFTW_BACKWARD'], ('r2c', '64'): ['FFTW_FORWARD'], ('r2c', '32'): ['FFTW_FORWARD'], ('r2c', 'ld'): ['FFTW_FORWARD'], ('c2r', '64'): ['FFTW_BACKWARD'], ('c2r', '32'): ['FFTW_BACKWARD'], ('c2r', 'ld'): ['FFTW_BACKWARD']} # In the following, -1 denotes using the default. A segfault has been # reported on some systems when this is set to None. It seems # sufficiently trivial to use -1 in place of None, especially given # that scheme_functions is an internal cdef object. cdef object scheme_functions scheme_functions = { ('c2c', '64'): {'planner': 0, 'executor':0, 'generic_precision':0, 'validator': -1, 'fft_shape_lookup': -1}, ('c2c', '32'): {'planner':1, 'executor':1, 'generic_precision':1, 'validator': -1, 'fft_shape_lookup': -1}, ('c2c', 'ld'): {'planner':2, 'executor':2, 'generic_precision':2, 'validator': -1, 'fft_shape_lookup': -1}, ('r2c', '64'): {'planner':3, 'executor':3, 'generic_precision':0, 'validator': 0, 'fft_shape_lookup': _lookup_shape_r2c_arrays}, ('r2c', '32'): {'planner':4, 'executor':4, 'generic_precision':1, 'validator': 0, 'fft_shape_lookup': _lookup_shape_r2c_arrays}, ('r2c', 'ld'): {'planner':5, 'executor':5, 'generic_precision':2, 'validator': 0, 'fft_shape_lookup': _lookup_shape_r2c_arrays}, ('c2r', '64'): {'planner':6, 'executor':6, 'generic_precision':0, 'validator': 1, 'fft_shape_lookup': _lookup_shape_c2r_arrays}, ('c2r', '32'): {'planner':7, 'executor':7, 'generic_precision':1, 'validator': 1, 'fft_shape_lookup': _lookup_shape_c2r_arrays}, ('c2r', 'ld'): {'planner':8, 'executor':8, 'generic_precision':2, 'validator': 1, 'fft_shape_lookup': _lookup_shape_c2r_arrays}} # Initialize the module # Define the functions _build_planner_list() _build_destroyer_list() _build_executor_list() _build_nthreads_plan_setters_list() _build_validators_list() _build_set_timelimit_funcs_list() fftw_init_threads() fftwf_init_threads() fftwl_init_threads() # Set the cleanup routine cdef void _cleanup(): fftw_cleanup() fftwf_cleanup() fftwl_cleanup() fftw_cleanup_threads() fftwf_cleanup_threads() fftwl_cleanup_threads() Py_AtExit(_cleanup) # Helper functions cdef void make_axes_unique(int64_t *axes, int64_t axes_length, int64_t **unique_axes, int64_t **not_axes, int64_t dimensions, int64_t *unique_axes_length): ''' Takes an array of axes and makes that array unique, returning the unique array in unique_axes. It also creates and fills another array, not_axes, with those axes that are not included in unique_axes. unique_axes_length is updated with the length of unique_axes. dimensions is the number of dimensions to which the axes array might refer. It is the responsibility of the caller to free unique_axes and not_axes. ''' cdef int64_t unique_axes_count = 0 cdef int64_t holding_offset = 0 cdef int64_t *axes_holding = ( calloc(dimensions, sizeof(int64_t))) cdef int64_t *axes_holding_offset = ( calloc(dimensions, sizeof(int64_t))) for n in range(dimensions): axes_holding[n] = -1 # Iterate over all the axes and store each index if it hasn't already # been stored (this keeps one and only one and the first index to axes # i.e. storing the unique set of entries). # # axes_holding_offset holds the shift due to repeated axes for n in range(axes_length): if axes_holding[axes[n]] == -1: axes_holding[axes[n]] = n axes_holding_offset[axes[n]] = holding_offset unique_axes_count += 1 else: holding_offset += 1 unique_axes[0] = malloc( unique_axes_count * sizeof(int64_t)) not_axes[0] = malloc( (dimensions - unique_axes_count) * sizeof(int64_t)) # Now we need to write back the unique axes to a tmp axes cdef int64_t not_axes_count = 0 for n in range(dimensions): if axes_holding[n] != -1: unique_axes[0][axes_holding[n] - axes_holding_offset[n]] = ( axes[axes_holding[n]]) else: not_axes[0][not_axes_count] = n not_axes_count += 1 free(axes_holding) free(axes_holding_offset) unique_axes_length[0] = unique_axes_count return # The External Interface # ====================== # cdef class FFTW: ''' FFTW is a class for computing the complex N-Dimensional DFT or inverse DFT of an array using the FFTW library. The interface is designed to be somewhat pythonic, with the correct transform being inferred from the dtypes of the passed arrays. On instantiation, the dtypes and relative shapes of the input array and output arrays are compared to the set of valid (and implemented) :ref:`FFTW schemes `. If a match is found, the plan that corresponds to that scheme is created, operating on the arrays that are passed in. If no scheme can be created, then ``ValueError`` is raised. The actual FFT or iFFT is performed by calling the :meth:`~pyfftw.FFTW.execute` method. The arrays can be updated by calling the :meth:`~pyfftw.FFTW.update_arrays` method. The created instance of the class is itself callable, and can perform the execution of the FFT, both with or without array updates, returning the result of the FFT. Unlike calling the :meth:`~pyfftw.FFTW.execute` method, calling the class instance will also optionally normalise the output as necessary. Additionally, calling with an input array update will also coerce that array to be the correct dtype. See the documentation on the :meth:`~pyfftw.FFTW.__call__` method for more information. ''' # Each of these function pointers simply # points to a chosen fftw wrapper function cdef fftw_generic_plan_guru _fftw_planner cdef fftw_generic_execute _fftw_execute cdef fftw_generic_destroy_plan _fftw_destroy cdef fftw_generic_plan_with_nthreads _nthreads_plan_setter # The plan is typecast when it is created or used # within the wrapper functions cdef void *_plan cdef np.ndarray _input_array cdef np.ndarray _output_array cdef int _direction cdef unsigned _flags cdef bint _simd_allowed cdef int _input_array_alignment cdef int _output_array_alignment cdef object _input_item_strides cdef object _input_strides cdef object _output_item_strides cdef object _output_strides cdef object _input_shape cdef object _output_shape cdef object _input_dtype cdef object _output_dtype cdef object _flags_used cdef double _normalisation_scaling cdef int _rank cdef _fftw_iodim *_dims cdef int _howmany_rank cdef _fftw_iodim *_howmany_dims cdef int64_t *_axes cdef int64_t *_not_axes cdef int64_t _N def _get_N(self): ''' The product of the lengths of the DFT over all DFT axes. 1/N is the normalisation constant. For any input array A, and for any set of axes, 1/N * ifft(fft(A)) = A ''' return self._N N = property(_get_N) def _get_simd_aligned(self): ''' Return whether or not this FFTW object requires simd aligned input and output data. ''' return self._simd_allowed simd_aligned = property(_get_simd_aligned) def _get_input_alignment(self): ''' Returns the byte alignment of the input arrays for which the :class:`~pyfftw.FFTW` object was created. Input array updates with arrays that are not aligned on this byte boundary will result in a ValueError being raised, or a copy being made if the :meth:`~pyfftw.FFTW.__call__` interface is used. ''' return self._input_array_alignment input_alignment = property(_get_input_alignment) def _get_output_alignment(self): ''' Returns the byte alignment of the output arrays for which the :class:`~pyfftw.FFTW` object was created. Output array updates with arrays that are not aligned on this byte boundary will result in a ValueError being raised. ''' return self._output_array_alignment output_alignment = property(_get_output_alignment) def _get_flags_used(self): ''' Return which flags were used to construct the FFTW object. This includes flags that were added during initialisation. ''' return tuple(self._flags_used) flags = property(_get_flags_used) def _get_input_array(self): ''' Return the input array that is associated with the FFTW instance. ''' return self._input_array input_array = property(_get_input_array) def _get_output_array(self): ''' Return the output array that is associated with the FFTW instance. ''' return self._output_array output_array = property(_get_output_array) def _get_input_strides(self): ''' Return the strides of the input array for which the FFT is planned. ''' return self._input_strides input_strides = property(_get_input_strides) def _get_output_strides(self): ''' Return the strides of the output array for which the FFT is planned. ''' return self._output_strides output_strides = property(_get_output_strides) def _get_input_shape(self): ''' Return the shape of the input array for which the FFT is planned. ''' return self._input_shape input_shape = property(_get_input_shape) def _get_output_shape(self): ''' Return the shape of the output array for which the FFT is planned. ''' return self._output_shape output_shape = property(_get_output_shape) def _get_input_dtype(self): ''' Return the dtype of the input array for which the FFT is planned. ''' return self._input_dtype input_dtype = property(_get_input_dtype) def _get_output_dtype(self): ''' Return the shape of the output array for which the FFT is planned. ''' return self._output_dtype output_dtype = property(_get_output_dtype) def _get_direction(self): ''' Return the planned FFT direction. Either `'FFTW_FORWARD'` or `'FFTW_BACKWARD'`. ''' return directions_lookup[self._direction] direction = property(_get_direction) def _get_axes(self): ''' Return the axes for the planned FFT in canonical form. That is, as a tuple of positive integers. The order in which they were passed is maintained. ''' axes = [] for i in range(self._rank): axes.append(self._axes[i]) return tuple(axes) axes = property(_get_axes) def __cinit__(self, input_array, output_array, axes=(-1,), direction='FFTW_FORWARD', flags=('FFTW_MEASURE',), unsigned int threads=1, planning_timelimit=None, *args, **kwargs): # Initialise the pointers that need to be freed self._plan = NULL self._dims = NULL self._howmany_dims = NULL self._axes = NULL self._not_axes = NULL flags = list(flags) cdef double _planning_timelimit if planning_timelimit is None: _planning_timelimit = FFTW_NO_TIMELIMIT else: try: _planning_timelimit = planning_timelimit except TypeError: raise TypeError('Invalid planning timelimit: ' 'The planning timelimit needs to be a float.') if not isinstance(input_array, np.ndarray): raise ValueError('Invalid input array: ' 'The input array needs to be an instance ' 'of numpy.ndarray') if not isinstance(output_array, np.ndarray): raise ValueError('Invalid output array: ' 'The output array needs to be an instance ' 'of numpy.ndarray') try: input_dtype = input_array.dtype output_dtype = output_array.dtype scheme = fftw_schemes[(input_dtype, output_dtype)] except KeyError: raise ValueError('Invalid scheme: ' 'The output array and input array dtypes ' 'do not correspond to a valid fftw scheme.') self._input_dtype = input_dtype self._output_dtype = output_dtype functions = scheme_functions[scheme] self._fftw_planner = planners[functions['planner']] self._fftw_execute = executors[functions['executor']] self._fftw_destroy = destroyers[functions['generic_precision']] self._nthreads_plan_setter = ( nthreads_plan_setters[functions['generic_precision']]) cdef fftw_generic_set_timelimit set_timelimit_func = ( set_timelimit_funcs[functions['generic_precision']]) # We're interested in the natural alignment on the real type, not # necessarily on the complex type At least one bug was found where # numpy reported an alignment on a complex dtype that was different # to that on the real type. cdef int natural_input_alignment = input_array.real.dtype.alignment cdef int natural_output_alignment = output_array.real.dtype.alignment # If either of the arrays is not aligned on a 16-byte boundary, # we set the FFTW_UNALIGNED flag. This disables SIMD. # (16 bytes is assumed to be the minimal alignment) if 'FFTW_UNALIGNED' in flags: self._simd_allowed = False self._input_array_alignment = natural_input_alignment self._output_array_alignment = natural_output_alignment else: self._input_array_alignment = -1 self._output_array_alignment = -1 for each_alignment in _valid_simd_alignments: if (np.PyArray_DATA(input_array) % each_alignment == 0 and np.PyArray_DATA(output_array) % each_alignment == 0): self._simd_allowed = True self._input_array_alignment = each_alignment self._output_array_alignment = each_alignment break if (self._input_array_alignment == -1 or self._output_array_alignment == -1): self._simd_allowed = False self._input_array_alignment = ( natural_input_alignment) self._output_array_alignment = ( natural_output_alignment) flags.append('FFTW_UNALIGNED') if (not (np.PyArray_DATA(input_array) % self._input_array_alignment == 0)): raise ValueError('Invalid input alignment: ' 'The input array is expected to lie on a %d ' 'byte boundary.' % self._input_array_alignment) if (not (np.PyArray_DATA(output_array) % self._output_array_alignment == 0)): raise ValueError('Invalid output alignment: ' 'The output array is expected to lie on a %d ' 'byte boundary.' % self._output_array_alignment) if not direction in scheme_directions[scheme]: raise ValueError('Invalid direction: ' 'The direction is not valid for the scheme. ' 'Try setting it explicitly if it is not already.') self._direction = directions[direction] self._input_shape = input_array.shape self._output_shape = output_array.shape self._input_array = input_array self._output_array = output_array self._axes = malloc(len(axes)*sizeof(int64_t)) for n in range(len(axes)): self._axes[n] = axes[n] # Set the negative entries to their actual index (use the size # of the shape array for this) cdef int64_t array_dimension = len(self._input_shape) for n in range(len(axes)): if self._axes[n] < 0: self._axes[n] = self._axes[n] + array_dimension if self._axes[n] >= array_dimension or self._axes[n] < 0: raise IndexError('Invalid axes: ' 'The axes list cannot contain invalid axes.') cdef int64_t unique_axes_length cdef int64_t *unique_axes cdef int64_t *not_axes make_axes_unique(self._axes, len(axes), &unique_axes, ¬_axes, array_dimension, &unique_axes_length) # and assign axes and not_axes to the filled arrays free(self._axes) self._axes = unique_axes self._not_axes = not_axes total_N = 1 for n in range(unique_axes_length): if self._input_shape[self._axes[n]] == 0: raise ValueError('Zero length array: ' 'The input array should have no zero length' 'axes over which the FFT is to be taken') if self._direction == FFTW_FORWARD: total_N *= self._input_shape[self._axes[n]] else: total_N *= self._output_shape[self._axes[n]] self._N = total_N self._normalisation_scaling = 1/float(self.N) # Now we can validate the array shapes cdef validator _validator if functions['validator'] == -1: if not (output_array.shape == input_array.shape): raise ValueError('Invalid shapes: ' 'The output array should be the same shape as the ' 'input array for the given array dtypes.') else: _validator = validators[functions['validator']] if not _validator(input_array, output_array, self._axes, self._not_axes, unique_axes_length): raise ValueError('Invalid shapes: ' 'The input array and output array are invalid ' 'complementary shapes for their dtypes.') self._rank = unique_axes_length self._howmany_rank = self._input_array.ndim - unique_axes_length self._flags = 0 self._flags_used = [] for each_flag in flags: try: self._flags |= flag_dict[each_flag] self._flags_used.append(each_flag) except KeyError: raise ValueError('Invalid flag: ' + '\'' + each_flag + '\' is not a valid planner flag.') if ('FFTW_DESTROY_INPUT' not in flags) and ( (scheme[0] != 'c2r') or not self._rank > 1): # The default in all possible cases is to preserve the input # This is not possible for r2c arrays with rank > 1 self._flags |= FFTW_PRESERVE_INPUT # Set up the arrays of structs for holding the stride shape # information self._dims = <_fftw_iodim *>malloc( self._rank * sizeof(_fftw_iodim)) self._howmany_dims = <_fftw_iodim *>malloc( self._howmany_rank * sizeof(_fftw_iodim)) if self._dims == NULL or self._howmany_dims == NULL: # Not much else to do than raise an exception raise MemoryError # Find the strides for all the axes of both arrays in terms of the # number of items (as opposed to the number of bytes). self._input_strides = input_array.strides self._input_item_strides = tuple([stride/input_array.itemsize for stride in input_array.strides]) self._output_strides = output_array.strides self._output_item_strides = tuple([stride/output_array.itemsize for stride in output_array.strides]) # Make sure that the arrays are not too big for fftw # This is hard to test, so we cross our fingers and hope for the # best (any suggestions, please get in touch). cdef int i for i in range(0, len(self._input_shape)): if self._input_shape[i] >= limits.INT_MAX: raise ValueError('Dimensions of the input array must be ' + 'less than ', str(limits.INT_MAX)) if self._input_item_strides[i] >= limits.INT_MAX: raise ValueError('Strides of the input array must be ' + 'less than ', str(limits.INT_MAX)) for i in range(0, len(self._output_shape)): if self._output_shape[i] >= limits.INT_MAX: raise ValueError('Dimensions of the output array must be ' + 'less than ', str(limits.INT_MAX)) if self._output_item_strides[i] >= limits.INT_MAX: raise ValueError('Strides of the output array must be ' + 'less than ', str(limits.INT_MAX)) fft_shape_lookup = functions['fft_shape_lookup'] if fft_shape_lookup == -1: fft_shape = self._input_shape else: fft_shape = fft_shape_lookup(input_array, output_array) # Fill in the stride and shape information input_strides_array = self._input_item_strides output_strides_array = self._output_item_strides for i in range(0, self._rank): self._dims[i]._n = fft_shape[self._axes[i]] self._dims[i]._is = input_strides_array[self._axes[i]] self._dims[i]._os = output_strides_array[self._axes[i]] for i in range(0, self._howmany_rank): self._howmany_dims[i]._n = fft_shape[self._not_axes[i]] self._howmany_dims[i]._is = input_strides_array[self._not_axes[i]] self._howmany_dims[i]._os = output_strides_array[self._not_axes[i]] ## Point at which FFTW calls are made ## (and none should be made before this) self._nthreads_plan_setter(threads) # Set the timelimit set_timelimit_func(_planning_timelimit) # Finally, construct the plan, after acquiring the global planner lock # (so that only one python thread can plan at a time, as the FFTW # planning functions are not thread-safe) # no self-lookups allowed in nogil block, so must grab all these first cdef void *plan cdef fftw_generic_plan_guru fftw_planner = self._fftw_planner cdef int rank = self._rank cdef fftw_iodim *dims = self._dims cdef int howmany_rank = self._howmany_rank cdef fftw_iodim *howmany_dims = self._howmany_dims cdef void *_in = np.PyArray_DATA(self._input_array) cdef void *_out = np.PyArray_DATA(self._output_array) cdef int sign = self._direction cdef unsigned c_flags = self._flags with plan_lock, nogil: plan = fftw_planner(rank, dims, howmany_rank, howmany_dims, _in, _out, sign, c_flags) self._plan = plan if self._plan == NULL: if 'FFTW_WISDOM_ONLY' in flags: raise RuntimeError('No FFTW wisdom is known for this plan.') else: raise RuntimeError('The data has an uncaught error that led '+ 'to the planner returning NULL. This is a bug.') def __init__(self, input_array, output_array, axes=(-1,), direction='FFTW_FORWARD', flags=('FFTW_MEASURE',), int threads=1, planning_timelimit=None): ''' **Arguments**: * ``input_array`` and ``output_array`` should be numpy arrays. The contents of these arrays will be destroyed by the planning process during initialisation. Information on supported dtypes for the arrays is :ref:`given below `. * ``axes`` describes along which axes the DFT should be taken. This should be a valid list of axes. Repeated axes are only transformed once. Invalid axes will raise an ``IndexError`` exception. This argument is equivalent to the same argument in :func:`numpy.fft.fftn`, except for the fact that the behaviour of repeated axes is different (``numpy.fft`` will happily take the fft of the same axis if it is repeated in the ``axes`` argument). Rudimentary testing has suggested this is down to the underlying FFTW library and so unlikely to be fixed in these wrappers. * ``direction`` should be a string and one of ``'FFTW_FORWARD'`` or ``'FFTW_BACKWARD'``, which dictate whether to take the DFT (forwards) or the inverse DFT (backwards) respectively (specifically, it dictates the sign of the exponent in the DFT formulation). Note that only the Complex schemes allow a free choice for ``direction``. The direction *must* agree with the the :ref:`table below ` if a Real scheme is used, otherwise a ``ValueError`` is raised. .. _FFTW_flags: * ``flags`` is a list of strings and is a subset of the flags that FFTW allows for the planners: * ``'FFTW_ESTIMATE'``, ``'FFTW_MEASURE'``, ``'FFTW_PATIENT'`` and ``'FFTW_EXHAUSTIVE'`` are supported. These describe the increasing amount of effort spent during the planning stage to create the fastest possible transform. Usually ``'FFTW_MEASURE'`` is a good compromise. If no flag is passed, the default ``'FFTW_MEASURE'`` is used. * ``'FFTW_UNALIGNED'`` is supported. This tells FFTW not to assume anything about the alignment of the data and disabling any SIMD capability (see below). * ``'FFTW_DESTROY_INPUT'`` is supported. This tells FFTW that the input array can be destroyed during the transform, sometimes allowing a faster algorithm to be used. The default behaviour is, if possible, to preserve the input. In the case of the 1D Backwards Real transform, this may result in a performance hit. In the case of a backwards real transform for greater than one dimension, it is not possible to preserve the input, making this flag implicit in that case. A little more on this is given :ref:`below`. * ``'FFTW_WISDOM_ONLY'`` is supported. This tells FFTW to raise an error if no plan for this transform and data type is already in the wisdom. It thus provides a method to determine whether planning would require additional effor or the cached wisdom can be used. This flag should be combined with the various planning-effort flags (``'FFTW_ESTIMATE'``, ``'FFTW_MEASURE'``, etc.); if so, then an error will be raised if wisdom derived from that level of planning effort (or higher) is not present. If no planning-effort flag is used, the default of ``'FFTW_ESTIMATE'`` is assumed. Note that wisdom is specific to all the parameters, including the data alignment. That is, if wisdom was generated with input/output arrays with one specific alignment, using ``'FFTW_WISDOM_ONLY'`` to create a plan for arrays with any different alignment will cause the ``'FFTW_WISDOM_ONLY'`` planning to fail. Thus it is important to specifically control the data alignment to make the best use of ``'FFTW_WISDOM_ONLY'``. The `FFTW planner flags documentation `_ has more information about the various flags and their impact. Note that only the flags documented here are supported. * ``threads`` tells the wrapper how many threads to use when invoking FFTW, with a default of 1. * ``planning_timelimit`` is a floating point number that indicates to the underlying FFTW planner the maximum number of seconds it should spend planning the FFT. This is a rough estimate and corresponds to calling of ``fftw_set_timelimit()`` (or an equivalent dependent on type) in the underlying FFTW library. If ``None`` is set, the planner will run indefinitely until all the planning modes allowed by the flags have been tried. See the `FFTW planner flags page `_ for more information on this. .. _fftw_schemes: **Schemes** The currently supported schemes are as follows: .. _scheme_table: +----------------+-----------------------+------------------------+-----------+ | Type | ``input_array.dtype`` | ``output_array.dtype`` | Direction | +================+=======================+========================+===========+ | Complex | ``complex64`` | ``complex64`` | Both | +----------------+-----------------------+------------------------+-----------+ | Complex | ``complex128`` | ``complex128`` | Both | +----------------+-----------------------+------------------------+-----------+ | Complex | ``clongdouble`` | ``clongdouble`` | Both | +----------------+-----------------------+------------------------+-----------+ | Real | ``float32`` | ``complex64`` | Forwards | +----------------+-----------------------+------------------------+-----------+ | Real | ``float64`` | ``complex128`` | Forwards | +----------------+-----------------------+------------------------+-----------+ | Real | ``longdouble`` | ``clongdouble`` | Forwards | +----------------+-----------------------+------------------------+-----------+ | Real\ :sup:`1` | ``complex64`` | ``float32`` | Backwards | +----------------+-----------------------+------------------------+-----------+ | Real\ :sup:`1` | ``complex128`` | ``float64`` | Backwards | +----------------+-----------------------+------------------------+-----------+ | Real\ :sup:`1` | ``clongdouble`` | ``longdouble`` | Backwards | +----------------+-----------------------+------------------------+-----------+ \ :sup:`1` Note that the Backwards Real transform for the case in which the dimensionality of the transform is greater than 1 will destroy the input array. This is inherent to FFTW and the only general work-around for this is to copy the array prior to performing the transform. In the case where the dimensionality of the transform is 1, the default is to preserve the input array. This is different from the default in the underlying library, and some speed gain may be achieved by allowing the input array to be destroyed by passing the ``'FFTW_DESTROY_INPUT'`` :ref:`flag `. ``clongdouble`` typically maps directly to ``complex256`` or ``complex192``, and ``longdouble`` to ``float128`` or ``float96``, dependent on platform. The relative shapes of the arrays should be as follows: * For a Complex transform, ``output_array.shape == input_array.shape`` * For a Real transform in the Forwards direction, both the following should be true: * ``output_array.shape[axes][-1] == input_array.shape[axes][-1]//2 + 1`` * All the other axes should be equal in length. * For a Real transform in the Backwards direction, both the following should be true: * ``input_array.shape[axes][-1] == output_array.shape[axes][-1]//2 + 1`` * All the other axes should be equal in length. In the above expressions for the Real transform, the ``axes`` arguments denotes the unique set of axes on which we are taking the FFT, in the order passed. It is the last of these axes that is subject to the special case shown. The shapes for the real transforms corresponds to those stipulated by the FFTW library. Further information can be found in the FFTW documentation on the `real DFT `_. The actual arrangement in memory is arbitrary and the scheme can be planned for any set of strides on either the input or the output. The user should not have to worry about this and any valid numpy array should work just fine. What is calculated is exactly what FFTW calculates. Notably, this is an unnormalized transform so should be scaled as necessary (fft followed by ifft will scale the input by N, the product of the dimensions along which the DFT is taken). For further information, see the `FFTW documentation `_. The FFTW library benefits greatly from the beginning of each DFT axes being aligned on the correct byte boundary, enabling SIMD instructions. By default, if the data begins on such a boundary, then FFTW will be allowed to try and enable SIMD instructions. This means that all future changes to the data arrays will be checked for similar alignment. SIMD instructions can be explicitly disabled by setting the FFTW_UNALIGNED flags, to allow for updates with unaligned data. :func:`~pyfftw.byte_align` and :func:`~pyfftw.empty_aligned` are two methods included with this module for producing aligned arrays. The optimum alignment for the running platform is provided by :data:`pyfftw.simd_alignment`, though a different alignment may still result in some performance improvement. For example, if the processor supports AVX (requiring 32-byte alignment) as well as SSE (requiring 16-byte alignment), then if the array is 16-byte aligned, SSE will still be used. It's worth noting that just being aligned may not be sufficient to create the fastest possible transform. For example, if the array is not contiguous (i.e. certain axes are displaced in memory), it may be faster to plan a transform for a contiguous array, and then rely on the array being copied in before the transform (which :class:`pyfftw.FFTW` will handle for you when accessed through :meth:`~pyfftw.FFTW.__call__`). ''' pass def __dealloc__(self): if not self._axes == NULL: free(self._axes) if not self._not_axes == NULL: free(self._not_axes) if not self._plan == NULL: self._fftw_destroy(self._plan) if not self._dims == NULL: free(self._dims) if not self._howmany_dims == NULL: free(self._howmany_dims) def __call__(self, input_array=None, output_array=None, normalise_idft=True): '''__call__(input_array=None, output_array=None, normalise_idft=True) Calling the class instance (optionally) updates the arrays, then calls :meth:`~pyfftw.FFTW.execute`, before optionally normalising the output and returning the output array. It has some built-in helpers to make life simpler for the calling functions (as distinct from manually updating the arrays and calling :meth:`~pyfftw.FFTW.execute`). If ``normalise_idft`` is ``True`` (the default), then the output from an inverse DFT (i.e. when the direction flag is ``'FFTW_BACKWARD'``) is scaled by 1/N, where N is the product of the lengths of input array on which the FFT is taken. If the direction is ``'FFTW_FORWARD'``, this flag makes no difference to the output array. When ``input_array`` is something other than None, then the passed in array is coerced to be the same dtype as the input array used when the class was instantiated, the byte-alignment of the passed in array is made consistent with the expected byte-alignment and the striding is made consistent with the expected striding. All this may, but not necessarily, require a copy to be made. As noted in the :ref:`scheme table`, if the FFTW instance describes a backwards real transform of more than one dimension, the contents of the input array will be destroyed. It is up to the calling function to make a copy if it is necessary to maintain the input array. ``output_array`` is always used as-is if possible. If the dtype, the alignment or the striding is incorrect for the FFTW object, then a ``ValueError`` is raised. The coerced input array and the output array (as appropriate) are then passed as arguments to :meth:`~pyfftw.FFTW.update_arrays`, after which :meth:`~pyfftw.FFTW.execute` is called, and then normalisation is applied to the output array if that is desired. Note that it is possible to pass some data structure that can be converted to an array, such as a list, so long as it fits the data requirements of the class instance, such as array shape. Other than the dtype and the alignment of the passed in arrays, the rest of the requirements on the arrays mandated by :meth:`~pyfftw.FFTW.update_arrays` are enforced. A ``None`` argument to either keyword means that that array is not updated. The result of the FFT is returned. This is the same array that is used internally and will be overwritten again on subsequent calls. If you need the data to persist longer than a subsequent call, you should copy the returned array. ''' if input_array is not None or output_array is not None: if input_array is None: input_array = self._input_array if output_array is None: output_array = self._output_array if not isinstance(input_array, np.ndarray): copy_needed = True elif (not input_array.dtype == self._input_dtype): copy_needed = True elif (not input_array.strides == self._input_strides): copy_needed = True elif not (np.PyArray_DATA(input_array) % self.input_alignment == 0): copy_needed = True else: copy_needed = False if copy_needed: if not isinstance(input_array, np.ndarray): input_array = np.asanyarray(input_array) if not input_array.shape == self._input_shape: raise ValueError('Invalid input shape: ' 'The new input array should be the same shape ' 'as the input array used to instantiate the ' 'object.') self._input_array[:] = input_array if output_array is not None: # No point wasting time if no update is necessary # (which the copy above may have avoided) input_array = self._input_array self.update_arrays(input_array, output_array) else: self.update_arrays(input_array, output_array) self.execute() if self._direction == FFTW_BACKWARD and normalise_idft: self._output_array *= self._normalisation_scaling return self._output_array cpdef update_arrays(self, new_input_array, new_output_array): '''update_arrays(new_input_array, new_output_array) Update the arrays upon which the DFT is taken. The new arrays should be of the same dtypes as the originals, the same shapes as the originals and should have the same strides between axes. If the original data was aligned so as to allow SIMD instructions (e.g. by being aligned on a 16-byte boundary), then the new array must also be aligned so as to allow SIMD instructions (assuming, of course, that the ``FFTW_UNALIGNED`` flag was not enabled). The byte alignment requirement extends to requiring natural alignment in the non-SIMD cases as well, but this is much less stringent as it simply means avoiding arrays shifted by, say, a single byte (which invariably takes some effort to achieve!). If all these conditions are not met, a ``ValueError`` will be raised and the data will *not* be updated (though the object will still be in a sane state). ''' if not isinstance(new_input_array, np.ndarray): raise ValueError('Invalid input array: ' 'The new input array needs to be an instance ' 'of numpy.ndarray') if not isinstance(new_output_array, np.ndarray): raise ValueError('Invalid output array ' 'The new output array needs to be an instance ' 'of numpy.ndarray') if not (np.PyArray_DATA(new_input_array) % self.input_alignment == 0): raise ValueError('Invalid input alignment: ' 'The original arrays were %d-byte aligned. It is ' 'necessary that the update input array is similarly ' 'aligned.' % self.input_alignment) if not (np.PyArray_DATA(new_output_array) % self.output_alignment == 0): raise ValueError('Invalid output alignment: ' 'The original arrays were %d-byte aligned. It is ' 'necessary that the update output array is similarly ' 'aligned.' % self.output_alignment) if not new_input_array.dtype == self._input_dtype: raise ValueError('Invalid input dtype: ' 'The new input array is not of the same ' 'dtype as was originally planned for.') if not new_output_array.dtype == self._output_dtype: raise ValueError('Invalid output dtype: ' 'The new output array is not of the same ' 'dtype as was originally planned for.') new_input_shape = new_input_array.shape new_output_shape = new_output_array.shape new_input_strides = new_input_array.strides new_output_strides = new_output_array.strides if not new_input_shape == self._input_shape: raise ValueError('Invalid input shape: ' 'The new input array should be the same shape as ' 'the input array used to instantiate the object.') if not new_output_shape == self._output_shape: raise ValueError('Invalid output shape: ' 'The new output array should be the same shape as ' 'the output array used to instantiate the object.') if not new_input_strides == self._input_strides: raise ValueError('Invalid input striding: ' 'The strides should be identical for the new ' 'input array as for the old.') if not new_output_strides == self._output_strides: raise ValueError('Invalid output striding: ' 'The strides should be identical for the new ' 'output array as for the old.') self._update_arrays(new_input_array, new_output_array) cdef _update_arrays(self, np.ndarray new_input_array, np.ndarray new_output_array): ''' A C interface to the update_arrays method that does not perform any checks on strides being correct and so on. ''' self._input_array = new_input_array self._output_array = new_output_array def get_input_array(self): '''get_input_array() Return the input array that is associated with the FFTW instance. *Deprecated since 0.10. Consider using the* :attr:`FFTW.input_array` *property instead.* ''' warnings.warn('get_input_array is deprecated. ' 'Consider using the input_array property instead.', DeprecationWarning) return self._input_array def get_output_array(self): '''get_output_array() Return the output array that is associated with the FFTW instance. *Deprecated since 0.10. Consider using the* :attr:`FFTW.output_array` *property instead.* ''' warnings.warn('get_output_array is deprecated. ' 'Consider using the output_array property instead.', DeprecationWarning) return self._output_array cpdef execute(self): '''execute() Execute the planned operation, taking the correct kind of FFT of the input array (i.e. :attr:`FFTW.input_array`), and putting the result in the output array (i.e. :attr:`FFTW.output_array`). ''' cdef void *input_pointer = ( np.PyArray_DATA(self._input_array)) cdef void *output_pointer = ( np.PyArray_DATA(self._output_array)) cdef void *plan = self._plan cdef fftw_generic_execute fftw_execute = self._fftw_execute with nogil: fftw_execute(plan, input_pointer, output_pointer) cdef void count_char(char c, void *counter_ptr): ''' On every call, increment the derefenced counter_ptr. ''' (counter_ptr)[0] += 1 cdef void write_char_to_string(char c, void *string_location_ptr): ''' Write the passed character c to the memory location pointed to by the contents of string_location_ptr (i.e. a pointer to a pointer), then increment the contents of string_location_ptr (i.e. move to the next byte in memory). In other words, for every character that is passed, we write that to a string that is referenced by the dereferenced value of string_location_ptr. If the derefenced value of string_location points to an unallocated piece of memory, a segfault will likely occur. ''' cdef char *write_location = ((string_location_ptr)[0]) write_location[0] = c (string_location_ptr)[0] += 1 def export_wisdom(): '''export_wisdom() Return the FFTW wisdom as a tuple of strings. The first string in the tuple is the string for the double precision wisdom. The second string in the tuple is the string for the single precision wisdom. The third string in the tuple is the string for the long double precision wisdom. The tuple that is returned from this function can be used as the argument to :func:`~pyfftw.import_wisdom`. ''' cdef bytes py_wisdom cdef bytes py_wisdomf cdef bytes py_wisdoml cdef int counter = 0 cdef int counterf = 0 cdef int counterl = 0 fftw_export_wisdom(&count_char, &counter) fftwf_export_wisdom(&count_char, &counterf) fftwl_export_wisdom(&count_char, &counterl) cdef char* c_wisdom = malloc(sizeof(char)*(counter + 1)) cdef char* c_wisdomf = malloc(sizeof(char)*(counterf + 1)) cdef char* c_wisdoml = malloc(sizeof(char)*(counterl + 1)) if c_wisdom == NULL or c_wisdomf == NULL or c_wisdoml == NULL: raise MemoryError # Set the pointers to the string pointers cdef intptr_t c_wisdom_ptr = c_wisdom cdef intptr_t c_wisdomf_ptr = c_wisdomf cdef intptr_t c_wisdoml_ptr = c_wisdoml fftw_export_wisdom(&write_char_to_string, &c_wisdom_ptr) fftwf_export_wisdom(&write_char_to_string, &c_wisdomf_ptr) fftwl_export_wisdom(&write_char_to_string, &c_wisdoml_ptr) # Write the last byte as the null byte c_wisdom[counter] = 0 c_wisdomf[counterf] = 0 c_wisdoml[counterl] = 0 try: py_wisdom = c_wisdom py_wisdomf = c_wisdomf py_wisdoml = c_wisdoml finally: free(c_wisdom) free(c_wisdomf) free(c_wisdoml) return (py_wisdom, py_wisdomf, py_wisdoml) def import_wisdom(wisdom): '''import_wisdom(wisdom) Function that imports wisdom from the passed tuple of strings. The first string in the tuple is the string for the double precision wisdom. The second string in the tuple is the string for the single precision wisdom. The third string in the tuple is the string for the long double precision wisdom. The tuple that is returned from :func:`~pyfftw.export_wisdom` can be used as the argument to this function. This function returns a tuple of boolean values indicating the success of loading each of the wisdom types (double, float and long double, in that order). ''' cdef char* c_wisdom = wisdom[0] cdef char* c_wisdomf = wisdom[1] cdef char* c_wisdoml = wisdom[2] cdef bint success = fftw_import_wisdom_from_string(c_wisdom) cdef bint successf = fftwf_import_wisdom_from_string(c_wisdomf) cdef bint successl = fftwl_import_wisdom_from_string(c_wisdoml) return (success, successf, successl) #def export_wisdom_to_files( # double_wisdom_file=None, # single_wisdom_file=None, # long_double_wisdom_file=None): # '''export_wisdom_to_file(double_wisdom_file=None, single_wisdom_file=None, long_double_wisdom_file=None) # # Export the wisdom to the passed files. # # The double precision wisdom is written to double_wisdom_file. # The single precision wisdom is written to single_wisdom_file. # The long double precision wisdom is written to # long_double_wisdom_file. # # If any of the arguments are None, then nothing is done for that # file. # # This function returns a tuple of boolean values indicating # the success of storing each of the wisdom types (double, float # and long double, in that order). # ''' # cdef bint success = True # cdef bint successf = True # cdef bint successl = True # # cdef char *_double_wisdom_file # cdef char *_single_wisdom_file # cdef char *_long_double_wisdom_file # # # if double_wisdom_file is not None: # _double_wisdom_file = double_wisdom_file # success = fftw_export_wisdom_to_filename(_double_wisdom_file) # # if single_wisdom_file is not None: # _single_wisdom_file = single_wisdom_file # successf = fftwf_export_wisdom_to_filename(_single_wisdom_file) # # if long_double_wisdom_file is not None: # _long_double_wisdom_file = long_double_wisdom_file # successl = fftwl_export_wisdom_to_filename( # _long_double_wisdom_file) # # return (success, successf, successl) # #def import_wisdom_to_files( # double_wisdom_file=None, # single_wisdom_file=None, # long_double_wisdom_file=None): # '''import_wisdom_to_file(double_wisdom_file=None, single_wisdom_file=None, long_double_wisdom_file=None) # # import the wisdom to the passed files. # # The double precision wisdom is imported from double_wisdom_file. # The single precision wisdom is imported from single_wisdom_file. # The long double precision wisdom is imported from # long_double_wisdom_file. # # If any of the arguments are None, then nothing is done for that # file. # # This function returns a tuple of boolean values indicating # the success of loading each of the wisdom types (double, float # and long double, in that order). # ''' # cdef bint success = True # cdef bint successf = True # cdef bint successl = True # # cdef char *_double_wisdom_file # cdef char *_single_wisdom_file # cdef char *_long_double_wisdom_file # # if double_wisdom_file is not None: # _double_wisdom_file = double_wisdom_file # success = fftw_import_wisdom_from_filename(_double_wisdom_file) # # if single_wisdom_file is not None: # _single_wisdom_file = single_wisdom_file # successf = fftwf_import_wisdom_from_filename(_single_wisdom_file) # # if long_double_wisdom_file is not None: # _long_double_wisdom_file = long_double_wisdom_file # successl = fftwl_import_wisdom_from_filename( # _long_double_wisdom_file) # # return (success, successf, successl) def forget_wisdom(): '''forget_wisdom() Forget all the accumulated wisdom. ''' fftw_forget_wisdom() fftwf_forget_wisdom() fftwl_forget_wisdom() pyFFTW-0.10.1/pyfftw/version.py0000664000175000017500000000045012652703650015671 0ustar whgwhg00000000000000 # THIS FILE IS GENERATED FROM SETUP.PY short_version = '0.10.1' version = '0.10.1' full_version = '0.10.1' git_revision = '43edd862150b910c58744f804ecd5e3543d31ed4' release = True if not release: version = full_version if __name__ == "__main__": print(short_version) print(version) pyFFTW-0.10.1/pyfftw/pyfftw.c0000664000175000017500000360622512652700305015326 0ustar whgwhg00000000000000/* Generated by Cython 0.23.3 */ /* BEGIN: Cython Metadata { "distutils": { "depends": [ "/home/whg/Projects/github/pyFFTW/include/cpu.h", "/home/whg/Projects/github/pyFFTW/include/pyfftw_complex.h", "/usr/lib/python2.7/dist-packages/numpy/core/include/numpy/arrayobject.h", "/usr/lib/python2.7/dist-packages/numpy/core/include/numpy/ufuncobject.h" ], "include_dirs": [ "/home/whg/Projects/github/pyFFTW/include", "/home/whg/Projects/github/pyFFTW/pyfftw", "/usr/lib/python2.7/dist-packages/numpy/core/include" ], "libraries": [ "fftw3", "fftw3f", "fftw3l", "fftw3_threads", "fftw3f_threads", "fftw3l_threads" ] } } END: Cython Metadata */ #define PY_SSIZE_T_CLEAN #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) #error Cython requires Python 2.6+ or Python 3.2+. #else #define CYTHON_ABI "0_23_3" #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #ifdef PYPY_VERSION #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #endif #if !defined(CYTHON_USE_PYLONG_INTERNALS) && CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x02070000 #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) #define Py_OptimizeFlag 0 #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyClass_Type #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyType_Type #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #else #define CYTHON_PEP393_ENABLED 0 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) #endif #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t PyInt_AsLong #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #elif CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #define __Pyx_void_to_None(void_result) (void_result, Py_INCREF(Py_None), Py_None) #ifndef CYTHON_INLINE #if defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #if defined(WIN32) || defined(MS_WINDOWS) #define _USE_MATH_DEFINES #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif #ifndef __PYX_EXTERN_C #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__pyfftw__pyfftw #define __PYX_HAVE_API__pyfftw__pyfftw #include "string.h" #include "stdio.h" #include "stdlib.h" #include "numpy/arrayobject.h" #include "numpy/ufuncobject.h" #include "stdint.h" #include "pyfftw_complex.h" #include "fftw3.h" #include "limits.h" #include "cpu.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #ifdef PYREX_WITHOUT_ASSERTIONS #define CYTHON_WITHOUT_ASSERTIONS #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (_MSC_VER) && defined (_M_X64) #define __Pyx_sst_abs(value) _abs64(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #if PY_MAJOR_VERSION < 3 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { const Py_UNICODE *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #else #define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen #endif #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) #define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False)) static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); #if CYTHON_COMPILING_IN_CPYTHON #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static PyObject *__pyx_m; static PyObject *__pyx_d; static PyObject *__pyx_b; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm= __FILE__; static const char *__pyx_filename; #if !defined(CYTHON_CCOMPLEX) #if defined(__cplusplus) #define CYTHON_CCOMPLEX 1 #elif defined(_Complex_I) #define CYTHON_CCOMPLEX 1 #else #define CYTHON_CCOMPLEX 0 #endif #endif #if CYTHON_CCOMPLEX #ifdef __cplusplus #include #else #include #endif #endif #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__) #undef _Complex_I #define _Complex_I 1.0fj #endif static const char *__pyx_f[] = { "pyfftw/pyfftw.pyx", "pyfftw/utils.pxi", "__init__.pxd", "type.pxd", }; /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":725 * # in Cython to enable them only on the right systems. * * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<< * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t */ typedef npy_int8 __pyx_t_5numpy_int8_t; /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":726 * * ctypedef npy_int8 int8_t * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<< * ctypedef npy_int32 int32_t * ctypedef npy_int64 int64_t */ typedef npy_int16 __pyx_t_5numpy_int16_t; /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":727 * ctypedef npy_int8 int8_t * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<< * ctypedef npy_int64 int64_t * #ctypedef npy_int96 int96_t */ typedef npy_int32 __pyx_t_5numpy_int32_t; /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":728 * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<< * #ctypedef npy_int96 int96_t * #ctypedef npy_int128 int128_t */ typedef npy_int64 __pyx_t_5numpy_int64_t; /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":732 * #ctypedef npy_int128 int128_t * * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<< * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t */ typedef npy_uint8 __pyx_t_5numpy_uint8_t; /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":733 * * ctypedef npy_uint8 uint8_t * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<< * ctypedef npy_uint32 uint32_t * ctypedef npy_uint64 uint64_t */ typedef npy_uint16 __pyx_t_5numpy_uint16_t; /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":734 * ctypedef npy_uint8 uint8_t * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<< * ctypedef npy_uint64 uint64_t * #ctypedef npy_uint96 uint96_t */ typedef npy_uint32 __pyx_t_5numpy_uint32_t; /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":735 * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<< * #ctypedef npy_uint96 uint96_t * #ctypedef npy_uint128 uint128_t */ typedef npy_uint64 __pyx_t_5numpy_uint64_t; /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":739 * #ctypedef npy_uint128 uint128_t * * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<< * ctypedef npy_float64 float64_t * #ctypedef npy_float80 float80_t */ typedef npy_float32 __pyx_t_5numpy_float32_t; /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":740 * * ctypedef npy_float32 float32_t * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<< * #ctypedef npy_float80 float80_t * #ctypedef npy_float128 float128_t */ typedef npy_float64 __pyx_t_5numpy_float64_t; /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":749 * # The int types are mapped a bit surprising -- * # numpy.int corresponds to 'l' and numpy.long to 'q' * ctypedef npy_long int_t # <<<<<<<<<<<<<< * ctypedef npy_longlong long_t * ctypedef npy_longlong longlong_t */ typedef npy_long __pyx_t_5numpy_int_t; /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":750 * # numpy.int corresponds to 'l' and numpy.long to 'q' * ctypedef npy_long int_t * ctypedef npy_longlong long_t # <<<<<<<<<<<<<< * ctypedef npy_longlong longlong_t * */ typedef npy_longlong __pyx_t_5numpy_long_t; /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":751 * ctypedef npy_long int_t * ctypedef npy_longlong long_t * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<< * * ctypedef npy_ulong uint_t */ typedef npy_longlong __pyx_t_5numpy_longlong_t; /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":753 * ctypedef npy_longlong longlong_t * * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<< * ctypedef npy_ulonglong ulong_t * ctypedef npy_ulonglong ulonglong_t */ typedef npy_ulong __pyx_t_5numpy_uint_t; /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":754 * * ctypedef npy_ulong uint_t * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<< * ctypedef npy_ulonglong ulonglong_t * */ typedef npy_ulonglong __pyx_t_5numpy_ulong_t; /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":755 * ctypedef npy_ulong uint_t * ctypedef npy_ulonglong ulong_t * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<< * * ctypedef npy_intp intp_t */ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":757 * ctypedef npy_ulonglong ulonglong_t * * ctypedef npy_intp intp_t # <<<<<<<<<<<<<< * ctypedef npy_uintp uintp_t * */ typedef npy_intp __pyx_t_5numpy_intp_t; /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":758 * * ctypedef npy_intp intp_t * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<< * * ctypedef npy_double float_t */ typedef npy_uintp __pyx_t_5numpy_uintp_t; /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":760 * ctypedef npy_uintp uintp_t * * ctypedef npy_double float_t # <<<<<<<<<<<<<< * ctypedef npy_double double_t * ctypedef npy_longdouble longdouble_t */ typedef npy_double __pyx_t_5numpy_float_t; /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":761 * * ctypedef npy_double float_t * ctypedef npy_double double_t # <<<<<<<<<<<<<< * ctypedef npy_longdouble longdouble_t * */ typedef npy_double __pyx_t_5numpy_double_t; /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":762 * ctypedef npy_double float_t * ctypedef npy_double double_t * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<< * * ctypedef npy_cfloat cfloat_t */ typedef npy_longdouble __pyx_t_5numpy_longdouble_t; #if CYTHON_CCOMPLEX #ifdef __cplusplus typedef ::std::complex< float > __pyx_t_float_complex; #else typedef float _Complex __pyx_t_float_complex; #endif #else typedef struct { float real, imag; } __pyx_t_float_complex; #endif #if CYTHON_CCOMPLEX #ifdef __cplusplus typedef ::std::complex< double > __pyx_t_double_complex; #else typedef double _Complex __pyx_t_double_complex; #endif #else typedef struct { double real, imag; } __pyx_t_double_complex; #endif /*--- Type declarations ---*/ struct __pyx_obj_6pyfftw_6pyfftw_FFTW; /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":764 * ctypedef npy_longdouble longdouble_t * * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<< * ctypedef npy_cdouble cdouble_t * ctypedef npy_clongdouble clongdouble_t */ typedef npy_cfloat __pyx_t_5numpy_cfloat_t; /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":765 * * ctypedef npy_cfloat cfloat_t * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<< * ctypedef npy_clongdouble clongdouble_t * */ typedef npy_cdouble __pyx_t_5numpy_cdouble_t; /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":766 * ctypedef npy_cfloat cfloat_t * ctypedef npy_cdouble cdouble_t * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<< * * ctypedef npy_cdouble complex_t */ typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":768 * ctypedef npy_clongdouble clongdouble_t * * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<< * * cdef inline object PyArray_MultiIterNew1(a): */ typedef npy_cdouble __pyx_t_5numpy_complex_t; struct __pyx_t_6pyfftw_6pyfftw__fftw_iodim; typedef struct __pyx_t_6pyfftw_6pyfftw__fftw_iodim __pyx_t_6pyfftw_6pyfftw__fftw_iodim; struct __pyx_opt_args_6pyfftw_6pyfftw_n_byte_align_empty; struct __pyx_opt_args_6pyfftw_6pyfftw_n_byte_align; struct __pyx_opt_args_6pyfftw_6pyfftw_byte_align; struct __pyx_opt_args_6pyfftw_6pyfftw_is_byte_aligned; struct __pyx_opt_args_6pyfftw_6pyfftw_empty_aligned; struct __pyx_opt_args_6pyfftw_6pyfftw_zeros_aligned; struct __pyx_opt_args_6pyfftw_6pyfftw_ones_aligned; /* "pyfftw/pyfftw.pxd":263 * * # Direction enum * cdef enum: # <<<<<<<<<<<<<< * FFTW_FORWARD = -1 * FFTW_BACKWARD = 1 */ enum { __pyx_e_6pyfftw_6pyfftw_FFTW_FORWARD = -1L, __pyx_e_6pyfftw_6pyfftw_FFTW_BACKWARD = 1 }; /* "pyfftw/pyfftw.pxd":268 * * # Documented flags * cdef enum: # <<<<<<<<<<<<<< * FFTW_MEASURE = 0 * FFTW_DESTROY_INPUT = 1 */ enum { __pyx_e_6pyfftw_6pyfftw_FFTW_MEASURE = 0, __pyx_e_6pyfftw_6pyfftw_FFTW_DESTROY_INPUT = 1, __pyx_e_6pyfftw_6pyfftw_FFTW_UNALIGNED = 2, __pyx_e_6pyfftw_6pyfftw_FFTW_CONSERVE_MEMORY = 4, __pyx_e_6pyfftw_6pyfftw_FFTW_EXHAUSTIVE = 8, __pyx_e_6pyfftw_6pyfftw_FFTW_PRESERVE_INPUT = 16, __pyx_e_6pyfftw_6pyfftw_FFTW_PATIENT = 32, __pyx_e_6pyfftw_6pyfftw_FFTW_ESTIMATE = 64, __pyx_e_6pyfftw_6pyfftw_FFTW_WISDOM_ONLY = 0x200000 }; /* "pyfftw/pyfftw.pxd":38 * from libc.stdint cimport int64_t * * ctypedef struct _fftw_iodim: # <<<<<<<<<<<<<< * int _n * int _is */ struct __pyx_t_6pyfftw_6pyfftw__fftw_iodim { int _n; int _is; int _os; }; /* "pyfftw/pyfftw.pxd":242 * # has different function names and signatures for all the * # different precisions and dft types). * ctypedef void * (*fftw_generic_plan_guru)( # <<<<<<<<<<<<<< * int rank, fftw_iodim *dims, * int howmany_rank, fftw_iodim *howmany_dims, */ typedef void *(*__pyx_t_6pyfftw_6pyfftw_fftw_generic_plan_guru)(int, fftw_iodim *, int, fftw_iodim *, void *, void *, int, unsigned int); /* "pyfftw/pyfftw.pxd":248 * int sign, unsigned flags) nogil * * ctypedef void (*fftw_generic_execute)(void *_plan, void *_in, void *_out) nogil # <<<<<<<<<<<<<< * * ctypedef void (*fftw_generic_destroy_plan)(void *_plan) */ typedef void (*__pyx_t_6pyfftw_6pyfftw_fftw_generic_execute)(void *, void *, void *); /* "pyfftw/pyfftw.pxd":250 * ctypedef void (*fftw_generic_execute)(void *_plan, void *_in, void *_out) nogil * * ctypedef void (*fftw_generic_destroy_plan)(void *_plan) # <<<<<<<<<<<<<< * * ctypedef void (*fftw_generic_init_threads)() */ typedef void (*__pyx_t_6pyfftw_6pyfftw_fftw_generic_destroy_plan)(void *); /* "pyfftw/pyfftw.pxd":252 * ctypedef void (*fftw_generic_destroy_plan)(void *_plan) * * ctypedef void (*fftw_generic_init_threads)() # <<<<<<<<<<<<<< * * ctypedef void (*fftw_generic_plan_with_nthreads)(int n) */ typedef void (*__pyx_t_6pyfftw_6pyfftw_fftw_generic_init_threads)(void); /* "pyfftw/pyfftw.pxd":254 * ctypedef void (*fftw_generic_init_threads)() * * ctypedef void (*fftw_generic_plan_with_nthreads)(int n) # <<<<<<<<<<<<<< * * ctypedef void (*fftw_generic_set_timelimit)(double seconds) */ typedef void (*__pyx_t_6pyfftw_6pyfftw_fftw_generic_plan_with_nthreads)(int); /* "pyfftw/pyfftw.pxd":256 * ctypedef void (*fftw_generic_plan_with_nthreads)(int n) * * ctypedef void (*fftw_generic_set_timelimit)(double seconds) # <<<<<<<<<<<<<< * * ctypedef bint (*validator)(np.ndarray input_array, */ typedef void (*__pyx_t_6pyfftw_6pyfftw_fftw_generic_set_timelimit)(double); /* "pyfftw/pyfftw.pxd":258 * ctypedef void (*fftw_generic_set_timelimit)(double seconds) * * ctypedef bint (*validator)(np.ndarray input_array, # <<<<<<<<<<<<<< * np.ndarray output_array, int64_t *axes, int64_t *not_axes, * int64_t axes_length) */ typedef int (*__pyx_t_6pyfftw_6pyfftw_validator)(PyArrayObject *, PyArrayObject *, int64_t *, int64_t *, int64_t); /* "pyfftw/utils.pxi":59 * _valid_simd_alignments = () * * cpdef n_byte_align_empty(shape, n, dtype='float64', order='C'): # <<<<<<<<<<<<<< * '''n_byte_align_empty(shape, n, dtype='float64', order='C') * **This function is deprecated:** ``empty_aligned`` **should be used */ struct __pyx_opt_args_6pyfftw_6pyfftw_n_byte_align_empty { int __pyx_n; PyObject *dtype; PyObject *order; }; /* "pyfftw/utils.pxi":76 * * * cpdef n_byte_align(array, n, dtype=None): # <<<<<<<<<<<<<< * '''n_byte_align(array, n, dtype=None) * */ struct __pyx_opt_args_6pyfftw_6pyfftw_n_byte_align { int __pyx_n; PyObject *dtype; }; /* "pyfftw/utils.pxi":96 * * * cpdef byte_align(array, n=None, dtype=None): # <<<<<<<<<<<<<< * '''byte_align(array, n=None, dtype=None) * */ struct __pyx_opt_args_6pyfftw_6pyfftw_byte_align { int __pyx_n; PyObject *n; PyObject *dtype; }; /* "pyfftw/utils.pxi":139 * * * cpdef is_byte_aligned(array, n=None): # <<<<<<<<<<<<<< * ''' is_n_byte_aligned(array, n=None) * */ struct __pyx_opt_args_6pyfftw_6pyfftw_is_byte_aligned { int __pyx_n; PyObject *n; }; /* "pyfftw/utils.pxi":172 * * * cpdef empty_aligned(shape, dtype='float64', order='C', n=None): # <<<<<<<<<<<<<< * '''empty_aligned(shape, dtype='float64', order='C', n=None) * */ struct __pyx_opt_args_6pyfftw_6pyfftw_empty_aligned { int __pyx_n; PyObject *dtype; PyObject *order; PyObject *n; }; /* "pyfftw/utils.pxi":214 * * * cpdef zeros_aligned(shape, dtype='float64', order='C', n=None): # <<<<<<<<<<<<<< * '''zeros_aligned(shape, dtype='float64', order='C', n=None) * */ struct __pyx_opt_args_6pyfftw_6pyfftw_zeros_aligned { int __pyx_n; PyObject *dtype; PyObject *order; PyObject *n; }; /* "pyfftw/utils.pxi":231 * * * cpdef ones_aligned(shape, dtype='float64', order='C', n=None): # <<<<<<<<<<<<<< * '''ones_aligned(shape, dtype='float64', order='C', n=None) * */ struct __pyx_opt_args_6pyfftw_6pyfftw_ones_aligned { int __pyx_n; PyObject *dtype; PyObject *order; PyObject *n; }; /* "pyfftw/pyfftw.pyx":597 * # ====================== * # * cdef class FFTW: # <<<<<<<<<<<<<< * ''' * FFTW is a class for computing the complex N-Dimensional DFT or */ struct __pyx_obj_6pyfftw_6pyfftw_FFTW { PyObject_HEAD struct __pyx_vtabstruct_6pyfftw_6pyfftw_FFTW *__pyx_vtab; __pyx_t_6pyfftw_6pyfftw_fftw_generic_plan_guru _fftw_planner; __pyx_t_6pyfftw_6pyfftw_fftw_generic_execute _fftw_execute; __pyx_t_6pyfftw_6pyfftw_fftw_generic_destroy_plan _fftw_destroy; __pyx_t_6pyfftw_6pyfftw_fftw_generic_plan_with_nthreads _nthreads_plan_setter; void *_plan; PyArrayObject *_input_array; PyArrayObject *_output_array; int _direction; unsigned int _flags; int _simd_allowed; int _input_array_alignment; int _output_array_alignment; PyObject *_input_item_strides; PyObject *_input_strides; PyObject *_output_item_strides; PyObject *_output_strides; PyObject *_input_shape; PyObject *_output_shape; PyObject *_input_dtype; PyObject *_output_dtype; PyObject *_flags_used; double _normalisation_scaling; int _rank; __pyx_t_6pyfftw_6pyfftw__fftw_iodim *_dims; int _howmany_rank; __pyx_t_6pyfftw_6pyfftw__fftw_iodim *_howmany_dims; int64_t *_axes; int64_t *_not_axes; int64_t _N; }; struct __pyx_vtabstruct_6pyfftw_6pyfftw_FFTW { PyObject *(*update_arrays)(struct __pyx_obj_6pyfftw_6pyfftw_FFTW *, PyObject *, PyObject *, int __pyx_skip_dispatch); PyObject *(*_update_arrays)(struct __pyx_obj_6pyfftw_6pyfftw_FFTW *, PyArrayObject *, PyArrayObject *); PyObject *(*execute)(struct __pyx_obj_6pyfftw_6pyfftw_FFTW *, int __pyx_skip_dispatch); }; static struct __pyx_vtabstruct_6pyfftw_6pyfftw_FFTW *__pyx_vtabptr_6pyfftw_6pyfftw_FFTW; /* --- Runtime support code (head) --- */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, int); void (*DECREF)(void*, PyObject*, int); void (*GOTREF)(void*, PyObject*, int); void (*GIVEREF)(void*, PyObject*, int); void* (*SetupContext)(const char*, int, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) #endif #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif static PyObject *__Pyx_GetBuiltinName(PyObject *name); static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ const char* function_name); static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); #define __Pyx_PyObject_DelSlice(obj, cstart, cstop, py_start, py_stop, py_slice, has_cstart, has_cstop, wraparound)\ __Pyx_PyObject_SetSlice(obj, (PyObject*)NULL, cstart, cstop, py_start, py_stop, py_slice, has_cstart, has_cstop, wraparound) static CYTHON_INLINE int __Pyx_PyObject_SetSlice( PyObject* obj, PyObject* value, Py_ssize_t cstart, Py_ssize_t cstop, PyObject** py_start, PyObject** py_stop, PyObject** py_slice, int has_cstart, int has_cstop, int wraparound); static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice( PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop, PyObject** py_start, PyObject** py_stop, PyObject** py_slice, int has_cstart, int has_cstop, int wraparound); static CYTHON_INLINE long __Pyx_div_long(long, long); #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ __Pyx_GetItemInt_Generic(o, to_py_func(i)))) #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, int wraparound, int boundscheck); #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { PyListObject* L = (PyListObject*) list; Py_ssize_t len = Py_SIZE(list); if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { Py_INCREF(x); PyList_SET_ITEM(list, len, x); Py_SIZE(list) = len+1; return 0; } return PyList_Append(list, x); } #else #define __Pyx_PyList_Append(L,x) PyList_Append(L,x) #endif static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb); static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) { int result = PySequence_Contains(seq, item); return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); } #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, long intval, int inplace); #else #define __Pyx_PyInt_EqObjC(op1, op2, intval, inplace)\ PyObject_RichCompare(op1, op2, Py_EQ) #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg); static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x); static CYTHON_INLINE intptr_t __Pyx_mod_intptr_t(intptr_t, intptr_t); static double __Pyx__PyObject_AsDouble(PyObject* obj); #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyObject_AsDouble(obj)\ (likely(PyFloat_CheckExact(obj)) ? PyFloat_AS_DOUBLE(obj) :\ likely(PyInt_CheckExact(obj)) ?\ PyFloat_AsDouble(obj) : __Pyx__PyObject_AsDouble(obj)) #else #define __Pyx_PyObject_AsDouble(obj)\ ((likely(PyFloat_CheckExact(obj))) ?\ PyFloat_AS_DOUBLE(obj) : __Pyx__PyObject_AsDouble(obj)) #endif #include static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals #else #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) { PyListObject* L = (PyListObject*) list; Py_ssize_t len = Py_SIZE(list); if (likely(L->allocated > len)) { Py_INCREF(x); PyList_SET_ITEM(list, len, x); Py_SIZE(list) = len+1; return 0; } return PyList_Append(list, x); } #else #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x02070000 static CYTHON_INLINE PyObject* __Pyx_PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name) { PyObject *res; PyTypeObject *tp = Py_TYPE(obj); #if PY_MAJOR_VERSION < 3 if (unlikely(PyInstance_Check(obj))) return __Pyx_PyObject_GetAttrStr(obj, attr_name); #endif res = _PyType_Lookup(tp, attr_name); if (likely(res)) { descrgetfunc f = Py_TYPE(res)->tp_descr_get; if (!f) { Py_INCREF(res); } else { res = f(res, obj, (PyObject *)tp); } } else { PyErr_SetObject(PyExc_AttributeError, attr_name); } return res; } #else #define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n) #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); #else #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) #endif static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { PyObject *value; value = PyDict_GetItemWithError(d, key); if (unlikely(!value)) { if (!PyErr_Occurred()) { PyObject* args = PyTuple_Pack(1, key); if (likely(args)) PyErr_SetObject(PyExc_KeyError, args); Py_XDECREF(args); } return NULL; } Py_INCREF(value); return value; } #else #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key) #endif static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); static int __Pyx_SetVtable(PyObject *dict, void *vtable); static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); static PyObject *__Pyx_GetNameInClass(PyObject *nmspace, PyObject *name); typedef struct { int code_line; PyCodeObject* code_object; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); static CYTHON_INLINE unsigned int __Pyx_PyInt_As_unsigned_int(PyObject *); static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int64_t(int64_t value); static CYTHON_INLINE int64_t __Pyx_PyInt_As_int64_t(PyObject *); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); #ifndef __PYX_FORCE_INIT_THREADS #define __PYX_FORCE_INIT_THREADS 0 #endif static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_int(unsigned int value); #if CYTHON_CCOMPLEX #ifdef __cplusplus #define __Pyx_CREAL(z) ((z).real()) #define __Pyx_CIMAG(z) ((z).imag()) #else #define __Pyx_CREAL(z) (__real__(z)) #define __Pyx_CIMAG(z) (__imag__(z)) #endif #else #define __Pyx_CREAL(z) ((z).real) #define __Pyx_CIMAG(z) ((z).imag) #endif #if (defined(_WIN32) || defined(__clang__)) && defined(__cplusplus) && CYTHON_CCOMPLEX #define __Pyx_SET_CREAL(z,x) ((z).real(x)) #define __Pyx_SET_CIMAG(z,y) ((z).imag(y)) #else #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x) #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y) #endif static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float); #if CYTHON_CCOMPLEX #define __Pyx_c_eqf(a, b) ((a)==(b)) #define __Pyx_c_sumf(a, b) ((a)+(b)) #define __Pyx_c_difff(a, b) ((a)-(b)) #define __Pyx_c_prodf(a, b) ((a)*(b)) #define __Pyx_c_quotf(a, b) ((a)/(b)) #define __Pyx_c_negf(a) (-(a)) #ifdef __cplusplus #define __Pyx_c_is_zerof(z) ((z)==(float)0) #define __Pyx_c_conjf(z) (::std::conj(z)) #if 1 #define __Pyx_c_absf(z) (::std::abs(z)) #define __Pyx_c_powf(a, b) (::std::pow(a, b)) #endif #else #define __Pyx_c_is_zerof(z) ((z)==0) #define __Pyx_c_conjf(z) (conjf(z)) #if 1 #define __Pyx_c_absf(z) (cabsf(z)) #define __Pyx_c_powf(a, b) (cpowf(a, b)) #endif #endif #else static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex, __pyx_t_float_complex); static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex, __pyx_t_float_complex); static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex, __pyx_t_float_complex); static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex, __pyx_t_float_complex); static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex, __pyx_t_float_complex); static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex); static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex); static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex); #if 1 static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex); static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex, __pyx_t_float_complex); #endif #endif static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double); #if CYTHON_CCOMPLEX #define __Pyx_c_eq(a, b) ((a)==(b)) #define __Pyx_c_sum(a, b) ((a)+(b)) #define __Pyx_c_diff(a, b) ((a)-(b)) #define __Pyx_c_prod(a, b) ((a)*(b)) #define __Pyx_c_quot(a, b) ((a)/(b)) #define __Pyx_c_neg(a) (-(a)) #ifdef __cplusplus #define __Pyx_c_is_zero(z) ((z)==(double)0) #define __Pyx_c_conj(z) (::std::conj(z)) #if 1 #define __Pyx_c_abs(z) (::std::abs(z)) #define __Pyx_c_pow(a, b) (::std::pow(a, b)) #endif #else #define __Pyx_c_is_zero(z) ((z)==0) #define __Pyx_c_conj(z) (conj(z)) #if 1 #define __Pyx_c_abs(z) (cabs(z)) #define __Pyx_c_pow(a, b) (cpow(a, b)) #endif #endif #else static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex, __pyx_t_double_complex); static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex, __pyx_t_double_complex); static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex, __pyx_t_double_complex); static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex, __pyx_t_double_complex); static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex, __pyx_t_double_complex); static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex); static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex); static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex); #if 1 static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex); static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex, __pyx_t_double_complex); #endif #endif static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value); static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); static int __Pyx_check_binary_version(void); #if !defined(__Pyx_PyIdentifier_FromString) #if PY_MAJOR_VERSION < 3 #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s) #else #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s) #endif #endif static PyObject *__Pyx_ImportModule(const char *name); static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict); static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); static PyObject *__pyx_f_6pyfftw_6pyfftw_4FFTW_update_arrays(struct __pyx_obj_6pyfftw_6pyfftw_FFTW *__pyx_v_self, PyObject *__pyx_v_new_input_array, PyObject *__pyx_v_new_output_array, int __pyx_skip_dispatch); /* proto*/ static PyObject *__pyx_f_6pyfftw_6pyfftw_4FFTW__update_arrays(struct __pyx_obj_6pyfftw_6pyfftw_FFTW *__pyx_v_self, PyArrayObject *__pyx_v_new_input_array, PyArrayObject *__pyx_v_new_output_array); /* proto*/ static PyObject *__pyx_f_6pyfftw_6pyfftw_4FFTW_execute(struct __pyx_obj_6pyfftw_6pyfftw_FFTW *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/ /* Module declarations from 'cpython.buffer' */ /* Module declarations from 'libc.string' */ /* Module declarations from 'libc.stdio' */ /* Module declarations from '__builtin__' */ /* Module declarations from 'cpython.type' */ static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0; /* Module declarations from 'cpython' */ /* Module declarations from 'cpython.object' */ /* Module declarations from 'cpython.ref' */ /* Module declarations from 'libc.stdlib' */ /* Module declarations from 'numpy' */ /* Module declarations from 'numpy' */ static PyTypeObject *__pyx_ptype_5numpy_dtype = 0; static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0; static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0; static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0; static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0; static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/ /* Module declarations from 'libc.stdint' */ /* Module declarations from 'libc' */ /* Module declarations from 'libc.limits' */ /* Module declarations from 'pyfftw.cpu' */ /* Module declarations from 'pyfftw.pyfftw' */ static PyTypeObject *__pyx_ptype_6pyfftw_6pyfftw_FFTW = 0; static int __pyx_v_6pyfftw_6pyfftw__simd_alignment; static PyObject *__pyx_v_6pyfftw_6pyfftw_directions = 0; static PyObject *__pyx_v_6pyfftw_6pyfftw_directions_lookup = 0; static PyObject *__pyx_v_6pyfftw_6pyfftw_flag_dict = 0; static PyObject *__pyx_v_6pyfftw_6pyfftw_plan_lock = 0; static __pyx_t_6pyfftw_6pyfftw_fftw_generic_plan_guru __pyx_v_6pyfftw_6pyfftw_planners[9]; static __pyx_t_6pyfftw_6pyfftw_fftw_generic_execute __pyx_v_6pyfftw_6pyfftw_executors[9]; static __pyx_t_6pyfftw_6pyfftw_fftw_generic_destroy_plan __pyx_v_6pyfftw_6pyfftw_destroyers[3]; static __pyx_t_6pyfftw_6pyfftw_fftw_generic_plan_with_nthreads __pyx_v_6pyfftw_6pyfftw_nthreads_plan_setters[3]; static __pyx_t_6pyfftw_6pyfftw_fftw_generic_set_timelimit __pyx_v_6pyfftw_6pyfftw_set_timelimit_funcs[3]; static __pyx_t_6pyfftw_6pyfftw_validator __pyx_v_6pyfftw_6pyfftw_validators[2]; static PyObject *__pyx_v_6pyfftw_6pyfftw_fftw_schemes = 0; static PyObject *__pyx_v_6pyfftw_6pyfftw_scheme_directions = 0; static PyObject *__pyx_v_6pyfftw_6pyfftw_scheme_functions = 0; static PyObject *__pyx_f_6pyfftw_6pyfftw_n_byte_align_empty(PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_6pyfftw_6pyfftw_n_byte_align_empty *__pyx_optional_args); /*proto*/ static PyObject *__pyx_f_6pyfftw_6pyfftw_n_byte_align(PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_6pyfftw_6pyfftw_n_byte_align *__pyx_optional_args); /*proto*/ static PyObject *__pyx_f_6pyfftw_6pyfftw_byte_align(PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_6pyfftw_6pyfftw_byte_align *__pyx_optional_args); /*proto*/ static PyObject *__pyx_f_6pyfftw_6pyfftw_is_byte_aligned(PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_6pyfftw_6pyfftw_is_byte_aligned *__pyx_optional_args); /*proto*/ static PyObject *__pyx_f_6pyfftw_6pyfftw_is_n_byte_aligned(PyObject *, PyObject *, int __pyx_skip_dispatch); /*proto*/ static PyObject *__pyx_f_6pyfftw_6pyfftw_empty_aligned(PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_6pyfftw_6pyfftw_empty_aligned *__pyx_optional_args); /*proto*/ static PyObject *__pyx_f_6pyfftw_6pyfftw_zeros_aligned(PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_6pyfftw_6pyfftw_zeros_aligned *__pyx_optional_args); /*proto*/ static PyObject *__pyx_f_6pyfftw_6pyfftw_ones_aligned(PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_6pyfftw_6pyfftw_ones_aligned *__pyx_optional_args); /*proto*/ static void *__pyx_f_6pyfftw_6pyfftw__fftw_plan_guru_dft(int, fftw_iodim *, int, fftw_iodim *, void *, void *, int, unsigned int); /*proto*/ static void *__pyx_f_6pyfftw_6pyfftw__fftwf_plan_guru_dft(int, fftw_iodim *, int, fftw_iodim *, void *, void *, int, unsigned int); /*proto*/ static void *__pyx_f_6pyfftw_6pyfftw__fftwl_plan_guru_dft(int, fftw_iodim *, int, fftw_iodim *, void *, void *, int, unsigned int); /*proto*/ static void *__pyx_f_6pyfftw_6pyfftw__fftw_plan_guru_dft_r2c(int, fftw_iodim *, int, fftw_iodim *, void *, void *, int, unsigned int); /*proto*/ static void *__pyx_f_6pyfftw_6pyfftw__fftwf_plan_guru_dft_r2c(int, fftw_iodim *, int, fftw_iodim *, void *, void *, int, unsigned int); /*proto*/ static void *__pyx_f_6pyfftw_6pyfftw__fftwl_plan_guru_dft_r2c(int, fftw_iodim *, int, fftw_iodim *, void *, void *, int, unsigned int); /*proto*/ static void *__pyx_f_6pyfftw_6pyfftw__fftw_plan_guru_dft_c2r(int, fftw_iodim *, int, fftw_iodim *, void *, void *, int, unsigned int); /*proto*/ static void *__pyx_f_6pyfftw_6pyfftw__fftwf_plan_guru_dft_c2r(int, fftw_iodim *, int, fftw_iodim *, void *, void *, int, unsigned int); /*proto*/ static void *__pyx_f_6pyfftw_6pyfftw__fftwl_plan_guru_dft_c2r(int, fftw_iodim *, int, fftw_iodim *, void *, void *, int, unsigned int); /*proto*/ static void __pyx_f_6pyfftw_6pyfftw__fftw_execute_dft(void *, void *, void *); /*proto*/ static void __pyx_f_6pyfftw_6pyfftw__fftwf_execute_dft(void *, void *, void *); /*proto*/ static void __pyx_f_6pyfftw_6pyfftw__fftwl_execute_dft(void *, void *, void *); /*proto*/ static void __pyx_f_6pyfftw_6pyfftw__fftw_execute_dft_r2c(void *, void *, void *); /*proto*/ static void __pyx_f_6pyfftw_6pyfftw__fftwf_execute_dft_r2c(void *, void *, void *); /*proto*/ static void __pyx_f_6pyfftw_6pyfftw__fftwl_execute_dft_r2c(void *, void *, void *); /*proto*/ static void __pyx_f_6pyfftw_6pyfftw__fftw_execute_dft_c2r(void *, void *, void *); /*proto*/ static void __pyx_f_6pyfftw_6pyfftw__fftwf_execute_dft_c2r(void *, void *, void *); /*proto*/ static void __pyx_f_6pyfftw_6pyfftw__fftwl_execute_dft_c2r(void *, void *, void *); /*proto*/ static void __pyx_f_6pyfftw_6pyfftw__fftw_destroy_plan(void *); /*proto*/ static void __pyx_f_6pyfftw_6pyfftw__fftwf_destroy_plan(void *); /*proto*/ static void __pyx_f_6pyfftw_6pyfftw__fftwl_destroy_plan(void *); /*proto*/ static __pyx_t_6pyfftw_6pyfftw_fftw_generic_plan_guru *__pyx_f_6pyfftw_6pyfftw__build_planner_list(void); /*proto*/ static __pyx_t_6pyfftw_6pyfftw_fftw_generic_execute *__pyx_f_6pyfftw_6pyfftw__build_executor_list(void); /*proto*/ static __pyx_t_6pyfftw_6pyfftw_fftw_generic_destroy_plan *__pyx_f_6pyfftw_6pyfftw__build_destroyer_list(void); /*proto*/ static __pyx_t_6pyfftw_6pyfftw_fftw_generic_plan_with_nthreads *__pyx_f_6pyfftw_6pyfftw__build_nthreads_plan_setters_list(void); /*proto*/ static __pyx_t_6pyfftw_6pyfftw_fftw_generic_set_timelimit *__pyx_f_6pyfftw_6pyfftw__build_set_timelimit_funcs_list(void); /*proto*/ static __pyx_t_6pyfftw_6pyfftw_validator *__pyx_f_6pyfftw_6pyfftw__build_validators_list(void); /*proto*/ static int __pyx_f_6pyfftw_6pyfftw__validate_r2c_arrays(PyArrayObject *, PyArrayObject *, int64_t *, int64_t *, int64_t); /*proto*/ static int __pyx_f_6pyfftw_6pyfftw__validate_c2r_arrays(PyArrayObject *, PyArrayObject *, int64_t *, int64_t *, int64_t); /*proto*/ static void __pyx_f_6pyfftw_6pyfftw__cleanup(void); /*proto*/ static void __pyx_f_6pyfftw_6pyfftw_make_axes_unique(int64_t *, int64_t, int64_t **, int64_t **, int64_t, int64_t *); /*proto*/ static void __pyx_f_6pyfftw_6pyfftw_count_char(char, void *); /*proto*/ static void __pyx_f_6pyfftw_6pyfftw_write_char_to_string(char, void *); /*proto*/ #define __Pyx_MODULE_NAME "pyfftw.pyfftw" int __pyx_module_is_main_pyfftw__pyfftw = 0; /* Implementation of 'pyfftw.pyfftw' */ static PyObject *__pyx_builtin_property; static PyObject *__pyx_builtin_DeprecationWarning; static PyObject *__pyx_builtin_TypeError; static PyObject *__pyx_builtin_range; static PyObject *__pyx_builtin_ValueError; static PyObject *__pyx_builtin_KeyError; static PyObject *__pyx_builtin_IndexError; static PyObject *__pyx_builtin_MemoryError; static PyObject *__pyx_builtin_RuntimeError; static char __pyx_k_B[] = "B"; static char __pyx_k_C[] = "C"; static char __pyx_k_H[] = "H"; static char __pyx_k_I[] = "I"; static char __pyx_k_L[] = "L"; static char __pyx_k_N[] = "N"; static char __pyx_k_O[] = "O"; static char __pyx_k_Q[] = "Q"; static char __pyx_k_b[] = "b"; static char __pyx_k_d[] = "d"; static char __pyx_k_f[] = "f"; static char __pyx_k_g[] = "g"; static char __pyx_k_h[] = "h"; static char __pyx_k_i[] = "i"; static char __pyx_k_l[] = "l"; static char __pyx_k_n[] = "n"; static char __pyx_k_q[] = "q"; static char __pyx_k_32[] = "32"; static char __pyx_k_64[] = "64"; static char __pyx_k_Zd[] = "Zd"; static char __pyx_k_Zf[] = "Zf"; static char __pyx_k_Zg[] = "Zg"; static char __pyx_k_ld[] = "ld"; static char __pyx_k_np[] = "np"; static char __pyx_k__17[] = "'"; static char __pyx_k_c2c[] = "c2c"; static char __pyx_k_c2r[] = "c2r"; static char __pyx_k_r2c[] = "r2c"; static char __pyx_k_Lock[] = "Lock"; static char __pyx_k_axes[] = "axes"; static char __pyx_k_copy[] = "copy"; static char __pyx_k_data[] = "data"; static char __pyx_k_exit[] = "__exit__"; static char __pyx_k_fill[] = "fill"; static char __pyx_k_int8[] = "int8"; static char __pyx_k_main[] = "__main__"; static char __pyx_k_real[] = "real"; static char __pyx_k_test[] = "__test__"; static char __pyx_k_type[] = "type"; static char __pyx_k_view[] = "view"; static char __pyx_k_warn[] = "warn"; static char __pyx_k_array[] = "array"; static char __pyx_k_class[] = "__class__"; static char __pyx_k_dtype[] = "dtype"; static char __pyx_k_empty[] = "empty"; static char __pyx_k_enter[] = "__enter__"; static char __pyx_k_flags[] = "flags"; static char __pyx_k_get_N[] = "_get_N"; static char __pyx_k_numpy[] = "numpy"; static char __pyx_k_order[] = "order"; static char __pyx_k_range[] = "range"; static char __pyx_k_shape[] = "shape"; static char __pyx_k_append[] = "append"; static char __pyx_k_import[] = "__import__"; static char __pyx_k_update[] = "update"; static char __pyx_k_wisdom[] = "wisdom"; static char __pyx_k_counter[] = "counter"; static char __pyx_k_execute[] = "execute"; static char __pyx_k_float32[] = "float32"; static char __pyx_k_float64[] = "float64"; static char __pyx_k_integer[] = "integer"; static char __pyx_k_planner[] = "planner"; static char __pyx_k_reshape[] = "reshape"; static char __pyx_k_strides[] = "strides"; static char __pyx_k_success[] = "success"; static char __pyx_k_threads[] = "threads"; static char __pyx_k_KeyError[] = "KeyError"; static char __pyx_k_c_wisdom[] = "c_wisdom"; static char __pyx_k_counterf[] = "counterf"; static char __pyx_k_counterl[] = "counterl"; static char __pyx_k_executor[] = "executor"; static char __pyx_k_get_axes[] = "_get_axes"; static char __pyx_k_itemsize[] = "itemsize"; static char __pyx_k_property[] = "property"; static char __pyx_k_successf[] = "successf"; static char __pyx_k_successl[] = "successl"; static char __pyx_k_warnings[] = "warnings"; static char __pyx_k_TypeError[] = "TypeError"; static char __pyx_k_alignment[] = "alignment"; static char __pyx_k_c_wisdomf[] = "c_wisdomf"; static char __pyx_k_c_wisdoml[] = "c_wisdoml"; static char __pyx_k_complex64[] = "complex64"; static char __pyx_k_direction[] = "direction"; static char __pyx_k_flag_dict[] = "_flag_dict"; static char __pyx_k_less_than[] = "less than "; static char __pyx_k_py_wisdom[] = "py_wisdom"; static char __pyx_k_threading[] = "threading"; static char __pyx_k_validator[] = "validator"; static char __pyx_k_IndexError[] = "IndexError"; static char __pyx_k_ValueError[] = "ValueError"; static char __pyx_k_asanyarray[] = "asanyarray"; static char __pyx_k_complex128[] = "complex128"; static char __pyx_k_frombuffer[] = "frombuffer"; static char __pyx_k_longdouble[] = "longdouble"; static char __pyx_k_py_wisdomf[] = "py_wisdomf"; static char __pyx_k_py_wisdoml[] = "py_wisdoml"; static char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; static char __pyx_k_MemoryError[] = "MemoryError"; static char __pyx_k_clongdouble[] = "clongdouble"; static char __pyx_k_input_array[] = "input_array"; static char __pyx_k_input_dtype[] = "input_dtype"; static char __pyx_k_input_shape[] = "input_shape"; static char __pyx_k_FFTW_FORWARD[] = "FFTW_FORWARD"; static char __pyx_k_FFTW_MEASURE[] = "FFTW_MEASURE"; static char __pyx_k_FFTW_PATIENT[] = "FFTW_PATIENT"; static char __pyx_k_Invalid_flag[] = "Invalid flag: "; static char __pyx_k_RuntimeError[] = "RuntimeError"; static char __pyx_k_c_wisdom_ptr[] = "c_wisdom_ptr"; static char __pyx_k_output_array[] = "output_array"; static char __pyx_k_output_dtype[] = "output_dtype"; static char __pyx_k_output_shape[] = "output_shape"; static char __pyx_k_simd_aligned[] = "simd_aligned"; static char __pyx_k_FFTW_BACKWARD[] = "FFTW_BACKWARD"; static char __pyx_k_FFTW_ESTIMATE[] = "FFTW_ESTIMATE"; static char __pyx_k_c_wisdomf_ptr[] = "c_wisdomf_ptr"; static char __pyx_k_c_wisdoml_ptr[] = "c_wisdoml_ptr"; static char __pyx_k_empty_aligned[] = "empty_aligned"; static char __pyx_k_export_wisdom[] = "export_wisdom"; static char __pyx_k_forget_wisdom[] = "forget_wisdom"; static char __pyx_k_get_direction[] = "_get_direction"; static char __pyx_k_import_wisdom[] = "import_wisdom"; static char __pyx_k_input_strides[] = "input_strides"; static char __pyx_k_pyfftw_pyfftw[] = "pyfftw.pyfftw"; static char __pyx_k_update_arrays[] = "update_arrays"; static char __pyx_k_FFTW_UNALIGNED[] = "FFTW_UNALIGNED"; static char __pyx_k_get_flags_used[] = "_get_flags_used"; static char __pyx_k_normalise_idft[] = "normalise_idft"; static char __pyx_k_output_strides[] = "output_strides"; static char __pyx_k_simd_alignment[] = "simd_alignment"; static char __pyx_k_FFTW_EXHAUSTIVE[] = "FFTW_EXHAUSTIVE"; static char __pyx_k_get_input_array[] = "_get_input_array"; static char __pyx_k_get_input_dtype[] = "_get_input_dtype"; static char __pyx_k_get_input_shape[] = "_get_input_shape"; static char __pyx_k_input_alignment[] = "input_alignment"; static char __pyx_k_new_input_array[] = "new_input_array"; static char __pyx_k_FFTW_WISDOM_ONLY[] = "FFTW_WISDOM_ONLY"; static char __pyx_k_fft_shape_lookup[] = "fft_shape_lookup"; static char __pyx_k_get_output_array[] = "_get_output_array"; static char __pyx_k_get_output_dtype[] = "_get_output_dtype"; static char __pyx_k_get_output_shape[] = "_get_output_shape"; static char __pyx_k_get_simd_aligned[] = "_get_simd_aligned"; static char __pyx_k_new_output_array[] = "new_output_array"; static char __pyx_k_output_alignment[] = "output_alignment"; static char __pyx_k_generic_precision[] = "generic_precision"; static char __pyx_k_get_input_strides[] = "_get_input_strides"; static char __pyx_k_DeprecationWarning[] = "DeprecationWarning"; static char __pyx_k_FFTW_DESTROY_INPUT[] = "FFTW_DESTROY_INPUT"; static char __pyx_k_get_output_strides[] = "_get_output_strides"; static char __pyx_k_planning_timelimit[] = "planning_timelimit"; static char __pyx_k_get_input_alignment[] = "_get_input_alignment"; static char __pyx_k_get_output_alignment[] = "_get_output_alignment"; static char __pyx_k_valid_simd_alignments[] = "_valid_simd_alignments"; static char __pyx_k_lookup_shape_c2r_arrays[] = "_lookup_shape_c2r_arrays"; static char __pyx_k_lookup_shape_r2c_arrays[] = "_lookup_shape_r2c_arrays"; static char __pyx_k_is_not_a_valid_planner_flag[] = "' is not a valid planner flag."; static char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous"; static char __pyx_k_Invalid_array_is_n_byte_aligned[] = "Invalid array: is_n_byte_aligned requires a subclass of ndarray"; static char __pyx_k_Invalid_direction_The_direction[] = "Invalid direction: The direction is not valid for the scheme. Try setting it explicitly if it is not already."; static char __pyx_k_Invalid_output_array_The_output[] = "Invalid output array: The output array needs to be an instance of numpy.ndarray"; static char __pyx_k_Invalid_scheme_The_output_array[] = "Invalid scheme: The output array and input array dtypes do not correspond to a valid fftw scheme."; static char __pyx_k_Invalid_shapes_The_output_array[] = "Invalid shapes: The output array should be the same shape as the input array for the given array dtypes."; static char __pyx_k_Strides_of_the_input_array_must[] = "Strides of the input array must be "; static char __pyx_k_home_whg_Projects_github_pyFFTW[] = "/home/whg/Projects/github/pyFFTW/pyfftw/pyfftw.pyx"; static char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)"; static char __pyx_k_Dimensions_of_the_input_array_mu[] = "Dimensions of the input array must be "; static char __pyx_k_Dimensions_of_the_output_array_m[] = "Dimensions of the output array must be "; static char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd"; static char __pyx_k_Invalid_array_byte_align_require[] = "Invalid array: byte_align requires a subclass of ndarray"; static char __pyx_k_Invalid_axes_The_axes_list_canno[] = "Invalid axes: The axes list cannot contain invalid axes."; static char __pyx_k_Invalid_input_alignment_The_inpu[] = "Invalid input alignment: The input array is expected to lie on a %d byte boundary."; static char __pyx_k_Invalid_input_alignment_The_orig[] = "Invalid input alignment: The original arrays were %d-byte aligned. It is necessary that the update input array is similarly aligned."; static char __pyx_k_Invalid_input_array_The_input_ar[] = "Invalid input array: The input array needs to be an instance of numpy.ndarray"; static char __pyx_k_Invalid_input_array_The_new_inpu[] = "Invalid input array: The new input array needs to be an instance of numpy.ndarray"; static char __pyx_k_Invalid_input_dtype_The_new_inpu[] = "Invalid input dtype: The new input array is not of the same dtype as was originally planned for."; static char __pyx_k_Invalid_input_shape_The_new_inpu[] = "Invalid input shape: The new input array should be the same shape as the input array used to instantiate the object."; static char __pyx_k_Invalid_input_striding_The_strid[] = "Invalid input striding: The strides should be identical for the new input array as for the old."; static char __pyx_k_Invalid_output_alignment_The_ori[] = "Invalid output alignment: The original arrays were %d-byte aligned. It is necessary that the update output array is similarly aligned."; static char __pyx_k_Invalid_output_alignment_The_out[] = "Invalid output alignment: The output array is expected to lie on a %d byte boundary."; static char __pyx_k_Invalid_output_array_The_new_out[] = "Invalid output array The new output array needs to be an instance of numpy.ndarray"; static char __pyx_k_Invalid_output_dtype_The_new_out[] = "Invalid output dtype: The new output array is not of the same dtype as was originally planned for."; static char __pyx_k_Invalid_output_shape_The_new_out[] = "Invalid output shape: The new output array should be the same shape as the output array used to instantiate the object."; static char __pyx_k_Invalid_output_striding_The_stri[] = "Invalid output striding: The strides should be identical for the new output array as for the old."; static char __pyx_k_Invalid_planning_timelimit_The_p[] = "Invalid planning timelimit: The planning timelimit needs to be a float."; static char __pyx_k_Invalid_shapes_The_input_array_a[] = "Invalid shapes: The input array and output array are invalid complementary shapes for their dtypes."; static char __pyx_k_No_FFTW_wisdom_is_known_for_this[] = "No FFTW wisdom is known for this plan."; static char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported"; static char __pyx_k_Strides_of_the_output_array_must[] = "Strides of the output array must be "; static char __pyx_k_The_data_has_an_uncaught_error_t[] = "The data has an uncaught error that led "; static char __pyx_k_This_function_is_deprecated_in_f[] = "This function is deprecated in favour of``empty_aligned``."; static char __pyx_k_Zero_length_array_The_input_arra[] = "Zero length array: The input array should have no zero lengthaxes over which the FFT is to be taken"; static char __pyx_k_get_input_array_is_deprecated_Co[] = "get_input_array is deprecated. Consider using the input_array property instead."; static char __pyx_k_get_output_array_is_deprecated_C[] = "get_output_array is deprecated. Consider using the output_array property instead."; static char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous"; static char __pyx_k_to_the_planner_returning_NULL_Th[] = "to the planner returning NULL. This is a bug."; static char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short."; static char __pyx_k_This_function_is_deprecated_in_f_2[] = "This function is deprecated in favour of``byte_align``."; static PyObject *__pyx_kp_s_32; static PyObject *__pyx_kp_s_64; static PyObject *__pyx_n_s_C; static PyObject *__pyx_n_s_DeprecationWarning; static PyObject *__pyx_kp_s_Dimensions_of_the_input_array_mu; static PyObject *__pyx_kp_s_Dimensions_of_the_output_array_m; static PyObject *__pyx_n_s_FFTW_BACKWARD; static PyObject *__pyx_n_s_FFTW_DESTROY_INPUT; static PyObject *__pyx_n_s_FFTW_ESTIMATE; static PyObject *__pyx_n_s_FFTW_EXHAUSTIVE; static PyObject *__pyx_n_s_FFTW_FORWARD; static PyObject *__pyx_n_s_FFTW_MEASURE; static PyObject *__pyx_n_s_FFTW_PATIENT; static PyObject *__pyx_n_s_FFTW_UNALIGNED; static PyObject *__pyx_n_s_FFTW_WISDOM_ONLY; static PyObject *__pyx_kp_u_Format_string_allocated_too_shor; static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2; static PyObject *__pyx_n_s_IndexError; static PyObject *__pyx_kp_s_Invalid_array_byte_align_require; static PyObject *__pyx_kp_s_Invalid_array_is_n_byte_aligned; static PyObject *__pyx_kp_s_Invalid_axes_The_axes_list_canno; static PyObject *__pyx_kp_s_Invalid_direction_The_direction; static PyObject *__pyx_kp_s_Invalid_flag; static PyObject *__pyx_kp_s_Invalid_input_alignment_The_inpu; static PyObject *__pyx_kp_s_Invalid_input_alignment_The_orig; static PyObject *__pyx_kp_s_Invalid_input_array_The_input_ar; static PyObject *__pyx_kp_s_Invalid_input_array_The_new_inpu; static PyObject *__pyx_kp_s_Invalid_input_dtype_The_new_inpu; static PyObject *__pyx_kp_s_Invalid_input_shape_The_new_inpu; static PyObject *__pyx_kp_s_Invalid_input_striding_The_strid; static PyObject *__pyx_kp_s_Invalid_output_alignment_The_ori; static PyObject *__pyx_kp_s_Invalid_output_alignment_The_out; static PyObject *__pyx_kp_s_Invalid_output_array_The_new_out; static PyObject *__pyx_kp_s_Invalid_output_array_The_output; static PyObject *__pyx_kp_s_Invalid_output_dtype_The_new_out; static PyObject *__pyx_kp_s_Invalid_output_shape_The_new_out; static PyObject *__pyx_kp_s_Invalid_output_striding_The_stri; static PyObject *__pyx_kp_s_Invalid_planning_timelimit_The_p; static PyObject *__pyx_kp_s_Invalid_scheme_The_output_array; static PyObject *__pyx_kp_s_Invalid_shapes_The_input_array_a; static PyObject *__pyx_kp_s_Invalid_shapes_The_output_array; static PyObject *__pyx_n_s_KeyError; static PyObject *__pyx_n_s_Lock; static PyObject *__pyx_n_s_MemoryError; static PyObject *__pyx_n_s_N; static PyObject *__pyx_kp_s_No_FFTW_wisdom_is_known_for_this; static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor; static PyObject *__pyx_n_s_RuntimeError; static PyObject *__pyx_kp_s_Strides_of_the_input_array_must; static PyObject *__pyx_kp_s_Strides_of_the_output_array_must; static PyObject *__pyx_kp_s_The_data_has_an_uncaught_error_t; static PyObject *__pyx_kp_s_This_function_is_deprecated_in_f; static PyObject *__pyx_kp_s_This_function_is_deprecated_in_f_2; static PyObject *__pyx_n_s_TypeError; static PyObject *__pyx_n_s_ValueError; static PyObject *__pyx_kp_s_Zero_length_array_The_input_arra; static PyObject *__pyx_kp_s__17; static PyObject *__pyx_n_s_alignment; static PyObject *__pyx_n_s_append; static PyObject *__pyx_n_s_array; static PyObject *__pyx_n_s_asanyarray; static PyObject *__pyx_n_s_axes; static PyObject *__pyx_n_s_c2c; static PyObject *__pyx_n_s_c2r; static PyObject *__pyx_n_s_c_wisdom; static PyObject *__pyx_n_s_c_wisdom_ptr; static PyObject *__pyx_n_s_c_wisdomf; static PyObject *__pyx_n_s_c_wisdomf_ptr; static PyObject *__pyx_n_s_c_wisdoml; static PyObject *__pyx_n_s_c_wisdoml_ptr; static PyObject *__pyx_n_s_class; static PyObject *__pyx_n_s_clongdouble; static PyObject *__pyx_n_s_complex128; static PyObject *__pyx_n_s_complex64; static PyObject *__pyx_n_s_copy; static PyObject *__pyx_n_s_counter; static PyObject *__pyx_n_s_counterf; static PyObject *__pyx_n_s_counterl; static PyObject *__pyx_n_s_data; static PyObject *__pyx_n_s_direction; static PyObject *__pyx_n_s_dtype; static PyObject *__pyx_n_s_empty; static PyObject *__pyx_n_s_empty_aligned; static PyObject *__pyx_n_s_enter; static PyObject *__pyx_n_s_execute; static PyObject *__pyx_n_s_executor; static PyObject *__pyx_n_s_exit; static PyObject *__pyx_n_s_export_wisdom; static PyObject *__pyx_n_s_fft_shape_lookup; static PyObject *__pyx_n_s_fill; static PyObject *__pyx_n_s_flag_dict; static PyObject *__pyx_n_s_flags; static PyObject *__pyx_n_s_float32; static PyObject *__pyx_n_s_float64; static PyObject *__pyx_n_s_forget_wisdom; static PyObject *__pyx_n_s_frombuffer; static PyObject *__pyx_n_s_generic_precision; static PyObject *__pyx_n_s_get_N; static PyObject *__pyx_n_s_get_axes; static PyObject *__pyx_n_s_get_direction; static PyObject *__pyx_n_s_get_flags_used; static PyObject *__pyx_n_s_get_input_alignment; static PyObject *__pyx_n_s_get_input_array; static PyObject *__pyx_kp_s_get_input_array_is_deprecated_Co; static PyObject *__pyx_n_s_get_input_dtype; static PyObject *__pyx_n_s_get_input_shape; static PyObject *__pyx_n_s_get_input_strides; static PyObject *__pyx_n_s_get_output_alignment; static PyObject *__pyx_n_s_get_output_array; static PyObject *__pyx_kp_s_get_output_array_is_deprecated_C; static PyObject *__pyx_n_s_get_output_dtype; static PyObject *__pyx_n_s_get_output_shape; static PyObject *__pyx_n_s_get_output_strides; static PyObject *__pyx_n_s_get_simd_aligned; static PyObject *__pyx_kp_s_home_whg_Projects_github_pyFFTW; static PyObject *__pyx_n_s_import; static PyObject *__pyx_n_s_import_wisdom; static PyObject *__pyx_n_s_input_alignment; static PyObject *__pyx_n_s_input_array; static PyObject *__pyx_n_s_input_dtype; static PyObject *__pyx_n_s_input_shape; static PyObject *__pyx_n_s_input_strides; static PyObject *__pyx_n_s_int8; static PyObject *__pyx_n_s_integer; static PyObject *__pyx_kp_s_is_not_a_valid_planner_flag; static PyObject *__pyx_n_s_itemsize; static PyObject *__pyx_n_s_ld; static PyObject *__pyx_kp_s_less_than; static PyObject *__pyx_n_s_longdouble; static PyObject *__pyx_n_s_lookup_shape_c2r_arrays; static PyObject *__pyx_n_s_lookup_shape_r2c_arrays; static PyObject *__pyx_n_s_main; static PyObject *__pyx_n_s_n; static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous; static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou; static PyObject *__pyx_n_s_new_input_array; static PyObject *__pyx_n_s_new_output_array; static PyObject *__pyx_n_s_normalise_idft; static PyObject *__pyx_n_s_np; static PyObject *__pyx_n_s_numpy; static PyObject *__pyx_n_s_order; static PyObject *__pyx_n_s_output_alignment; static PyObject *__pyx_n_s_output_array; static PyObject *__pyx_n_s_output_dtype; static PyObject *__pyx_n_s_output_shape; static PyObject *__pyx_n_s_output_strides; static PyObject *__pyx_n_s_planner; static PyObject *__pyx_n_s_planning_timelimit; static PyObject *__pyx_n_s_property; static PyObject *__pyx_n_s_py_wisdom; static PyObject *__pyx_n_s_py_wisdomf; static PyObject *__pyx_n_s_py_wisdoml; static PyObject *__pyx_n_s_pyfftw_pyfftw; static PyObject *__pyx_n_s_pyx_vtable; static PyObject *__pyx_n_s_r2c; static PyObject *__pyx_n_s_range; static PyObject *__pyx_n_s_real; static PyObject *__pyx_n_s_reshape; static PyObject *__pyx_n_s_shape; static PyObject *__pyx_n_s_simd_aligned; static PyObject *__pyx_n_s_simd_alignment; static PyObject *__pyx_n_s_strides; static PyObject *__pyx_n_s_success; static PyObject *__pyx_n_s_successf; static PyObject *__pyx_n_s_successl; static PyObject *__pyx_n_s_test; static PyObject *__pyx_n_s_threading; static PyObject *__pyx_n_s_threads; static PyObject *__pyx_kp_s_to_the_planner_returning_NULL_Th; static PyObject *__pyx_n_s_type; static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd; static PyObject *__pyx_n_s_update; static PyObject *__pyx_n_s_update_arrays; static PyObject *__pyx_n_s_valid_simd_alignments; static PyObject *__pyx_n_s_validator; static PyObject *__pyx_n_s_view; static PyObject *__pyx_n_s_warn; static PyObject *__pyx_n_s_warnings; static PyObject *__pyx_n_s_wisdom; static PyObject *__pyx_pf_6pyfftw_6pyfftw_n_byte_align_empty(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_shape, PyObject *__pyx_v_n, PyObject *__pyx_v_dtype, PyObject *__pyx_v_order); /* proto */ static PyObject *__pyx_pf_6pyfftw_6pyfftw_2n_byte_align(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_array, PyObject *__pyx_v_n, PyObject *__pyx_v_dtype); /* proto */ static PyObject *__pyx_pf_6pyfftw_6pyfftw_4byte_align(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_array, PyObject *__pyx_v_n, PyObject *__pyx_v_dtype); /* proto */ static PyObject *__pyx_pf_6pyfftw_6pyfftw_6is_byte_aligned(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_array, PyObject *__pyx_v_n); /* proto */ static PyObject *__pyx_pf_6pyfftw_6pyfftw_8is_n_byte_aligned(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_array, PyObject *__pyx_v_n); /* proto */ static PyObject *__pyx_pf_6pyfftw_6pyfftw_10empty_aligned(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_shape, PyObject *__pyx_v_dtype, PyObject *__pyx_v_order, PyObject *__pyx_v_n); /* proto */ static PyObject *__pyx_pf_6pyfftw_6pyfftw_12zeros_aligned(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_shape, PyObject *__pyx_v_dtype, PyObject *__pyx_v_order, PyObject *__pyx_v_n); /* proto */ static PyObject *__pyx_pf_6pyfftw_6pyfftw_14ones_aligned(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_shape, PyObject *__pyx_v_dtype, PyObject *__pyx_v_order, PyObject *__pyx_v_n); /* proto */ static PyObject *__pyx_pf_6pyfftw_6pyfftw_16_lookup_shape_r2c_arrays(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input_array, CYTHON_UNUSED PyObject *__pyx_v_output_array); /* proto */ static PyObject *__pyx_pf_6pyfftw_6pyfftw_18_lookup_shape_c2r_arrays(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_input_array, PyObject *__pyx_v_output_array); /* proto */ static PyObject *__pyx_pf_6pyfftw_6pyfftw_4FFTW__get_N(struct __pyx_obj_6pyfftw_6pyfftw_FFTW *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_6pyfftw_6pyfftw_4FFTW_2_get_simd_aligned(struct __pyx_obj_6pyfftw_6pyfftw_FFTW *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_6pyfftw_6pyfftw_4FFTW_4_get_input_alignment(struct __pyx_obj_6pyfftw_6pyfftw_FFTW *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_6pyfftw_6pyfftw_4FFTW_6_get_output_alignment(struct __pyx_obj_6pyfftw_6pyfftw_FFTW *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_6pyfftw_6pyfftw_4FFTW_8_get_flags_used(struct __pyx_obj_6pyfftw_6pyfftw_FFTW *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_6pyfftw_6pyfftw_4FFTW_10_get_input_array(struct __pyx_obj_6pyfftw_6pyfftw_FFTW *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_6pyfftw_6pyfftw_4FFTW_12_get_output_array(struct __pyx_obj_6pyfftw_6pyfftw_FFTW *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_6pyfftw_6pyfftw_4FFTW_14_get_input_strides(struct __pyx_obj_6pyfftw_6pyfftw_FFTW *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_6pyfftw_6pyfftw_4FFTW_16_get_output_strides(struct __pyx_obj_6pyfftw_6pyfftw_FFTW *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_6pyfftw_6pyfftw_4FFTW_18_get_input_shape(struct __pyx_obj_6pyfftw_6pyfftw_FFTW *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_6pyfftw_6pyfftw_4FFTW_20_get_output_shape(struct __pyx_obj_6pyfftw_6pyfftw_FFTW *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_6pyfftw_6pyfftw_4FFTW_22_get_input_dtype(struct __pyx_obj_6pyfftw_6pyfftw_FFTW *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_6pyfftw_6pyfftw_4FFTW_24_get_output_dtype(struct __pyx_obj_6pyfftw_6pyfftw_FFTW *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_6pyfftw_6pyfftw_4FFTW_26_get_direction(struct __pyx_obj_6pyfftw_6pyfftw_FFTW *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_6pyfftw_6pyfftw_4FFTW_28_get_axes(struct __pyx_obj_6pyfftw_6pyfftw_FFTW *__pyx_v_self); /* proto */ static int __pyx_pf_6pyfftw_6pyfftw_4FFTW_30__cinit__(struct __pyx_obj_6pyfftw_6pyfftw_FFTW *__pyx_v_self, PyObject *__pyx_v_input_array, PyObject *__pyx_v_output_array, PyObject *__pyx_v_axes, PyObject *__pyx_v_direction, PyObject *__pyx_v_flags, unsigned int __pyx_v_threads, PyObject *__pyx_v_planning_timelimit, CYTHON_UNUSED PyObject *__pyx_v_args, CYTHON_UNUSED PyObject *__pyx_v_kwargs); /* proto */ static int __pyx_pf_6pyfftw_6pyfftw_4FFTW_32__init__(CYTHON_UNUSED struct __pyx_obj_6pyfftw_6pyfftw_FFTW *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_input_array, CYTHON_UNUSED PyObject *__pyx_v_output_array, CYTHON_UNUSED PyObject *__pyx_v_axes, CYTHON_UNUSED PyObject *__pyx_v_direction, CYTHON_UNUSED PyObject *__pyx_v_flags, CYTHON_UNUSED int __pyx_v_threads, CYTHON_UNUSED PyObject *__pyx_v_planning_timelimit); /* proto */ static void __pyx_pf_6pyfftw_6pyfftw_4FFTW_34__dealloc__(struct __pyx_obj_6pyfftw_6pyfftw_FFTW *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_6pyfftw_6pyfftw_4FFTW_36__call__(struct __pyx_obj_6pyfftw_6pyfftw_FFTW *__pyx_v_self, PyObject *__pyx_v_input_array, PyObject *__pyx_v_output_array, PyObject *__pyx_v_normalise_idft); /* proto */ static PyObject *__pyx_pf_6pyfftw_6pyfftw_4FFTW_38update_arrays(struct __pyx_obj_6pyfftw_6pyfftw_FFTW *__pyx_v_self, PyObject *__pyx_v_new_input_array, PyObject *__pyx_v_new_output_array); /* proto */ static PyObject *__pyx_pf_6pyfftw_6pyfftw_4FFTW_40get_input_array(struct __pyx_obj_6pyfftw_6pyfftw_FFTW *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_6pyfftw_6pyfftw_4FFTW_42get_output_array(struct __pyx_obj_6pyfftw_6pyfftw_FFTW *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_6pyfftw_6pyfftw_4FFTW_44execute(struct __pyx_obj_6pyfftw_6pyfftw_FFTW *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_6pyfftw_6pyfftw_20export_wisdom(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_6pyfftw_6pyfftw_22import_wisdom(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_wisdom); /* proto */ static PyObject *__pyx_pf_6pyfftw_6pyfftw_24forget_wisdom(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */ static PyObject *__pyx_tp_new_6pyfftw_6pyfftw_FFTW(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_int_0; static PyObject *__pyx_int_1; static PyObject *__pyx_int_2; static PyObject *__pyx_int_3; static PyObject *__pyx_int_4; static PyObject *__pyx_int_5; static PyObject *__pyx_int_6; static PyObject *__pyx_int_7; static PyObject *__pyx_int_8; static PyObject *__pyx_int_16; static PyObject *__pyx_int_32; static PyObject *__pyx_int_neg_1; static PyObject *__pyx_tuple_; static PyObject *__pyx_slice__2; static PyObject *__pyx_tuple__3; static PyObject *__pyx_tuple__4; static PyObject *__pyx_tuple__5; static PyObject *__pyx_tuple__6; static PyObject *__pyx_tuple__7; static PyObject *__pyx_tuple__8; static PyObject *__pyx_tuple__9; static PyObject *__pyx_slice__23; static PyObject *__pyx_tuple__10; static PyObject *__pyx_tuple__11; static PyObject *__pyx_tuple__12; static PyObject *__pyx_tuple__13; static PyObject *__pyx_tuple__14; static PyObject *__pyx_tuple__15; static PyObject *__pyx_tuple__16; static PyObject *__pyx_tuple__18; static PyObject *__pyx_tuple__19; static PyObject *__pyx_tuple__20; static PyObject *__pyx_tuple__21; static PyObject *__pyx_tuple__22; static PyObject *__pyx_tuple__24; static PyObject *__pyx_tuple__25; static PyObject *__pyx_tuple__26; static PyObject *__pyx_tuple__27; static PyObject *__pyx_tuple__28; static PyObject *__pyx_tuple__29; static PyObject *__pyx_tuple__30; static PyObject *__pyx_tuple__31; static PyObject *__pyx_tuple__32; static PyObject *__pyx_tuple__33; static PyObject *__pyx_tuple__34; static PyObject *__pyx_tuple__35; static PyObject *__pyx_tuple__36; static PyObject *__pyx_tuple__37; static PyObject *__pyx_tuple__38; static PyObject *__pyx_tuple__39; static PyObject *__pyx_tuple__40; static PyObject *__pyx_tuple__42; static PyObject *__pyx_tuple__44; static PyObject *__pyx_tuple__45; static PyObject *__pyx_tuple__46; static PyObject *__pyx_tuple__47; static PyObject *__pyx_tuple__48; static PyObject *__pyx_tuple__49; static PyObject *__pyx_tuple__50; static PyObject *__pyx_tuple__51; static PyObject *__pyx_tuple__52; static PyObject *__pyx_tuple__53; static PyObject *__pyx_tuple__54; static PyObject *__pyx_tuple__55; static PyObject *__pyx_tuple__56; static PyObject *__pyx_tuple__57; static PyObject *__pyx_tuple__58; static PyObject *__pyx_tuple__59; static PyObject *__pyx_tuple__60; static PyObject *__pyx_tuple__61; static PyObject *__pyx_tuple__62; static PyObject *__pyx_tuple__63; static PyObject *__pyx_tuple__64; static PyObject *__pyx_tuple__65; static PyObject *__pyx_tuple__66; static PyObject *__pyx_tuple__67; static PyObject *__pyx_tuple__68; static PyObject *__pyx_tuple__69; static PyObject *__pyx_tuple__70; static PyObject *__pyx_tuple__71; static PyObject *__pyx_tuple__72; static PyObject *__pyx_tuple__73; static PyObject *__pyx_tuple__74; static PyObject *__pyx_tuple__75; static PyObject *__pyx_tuple__76; static PyObject *__pyx_tuple__77; static PyObject *__pyx_tuple__78; static PyObject *__pyx_tuple__79; static PyObject *__pyx_tuple__80; static PyObject *__pyx_tuple__81; static PyObject *__pyx_tuple__82; static PyObject *__pyx_tuple__83; static PyObject *__pyx_tuple__84; static PyObject *__pyx_tuple__85; static PyObject *__pyx_tuple__86; static PyObject *__pyx_tuple__87; static PyObject *__pyx_tuple__88; static PyObject *__pyx_tuple__89; static PyObject *__pyx_tuple__90; static PyObject *__pyx_tuple__91; static PyObject *__pyx_tuple__93; static PyObject *__pyx_codeobj__41; static PyObject *__pyx_codeobj__43; static PyObject *__pyx_codeobj__92; static PyObject *__pyx_codeobj__94; static PyObject *__pyx_codeobj__95; /* "pyfftw/utils.pxi":59 * _valid_simd_alignments = () * * cpdef n_byte_align_empty(shape, n, dtype='float64', order='C'): # <<<<<<<<<<<<<< * '''n_byte_align_empty(shape, n, dtype='float64', order='C') * **This function is deprecated:** ``empty_aligned`` **should be used */ static PyObject *__pyx_pw_6pyfftw_6pyfftw_1n_byte_align_empty(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_f_6pyfftw_6pyfftw_n_byte_align_empty(PyObject *__pyx_v_shape, PyObject *__pyx_v_n, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_6pyfftw_6pyfftw_n_byte_align_empty *__pyx_optional_args) { PyObject *__pyx_v_dtype = ((PyObject *)__pyx_n_s_float64); PyObject *__pyx_v_order = ((PyObject *)__pyx_n_s_C); PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; struct __pyx_opt_args_6pyfftw_6pyfftw_empty_aligned __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("n_byte_align_empty", 0); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_dtype = __pyx_optional_args->dtype; if (__pyx_optional_args->__pyx_n > 1) { __pyx_v_order = __pyx_optional_args->order; } } } /* "pyfftw/utils.pxi":71 * :func:`numpy.empty`. * ''' * warnings.warn('This function is deprecated in favour of' # <<<<<<<<<<<<<< * '``empty_aligned``.', DeprecationWarning) * return empty_aligned(shape, dtype=dtype, order=order, n=n) */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_warnings); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_warn); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pyfftw/utils.pxi":72 * ''' * warnings.warn('This function is deprecated in favour of' * '``empty_aligned``.', DeprecationWarning) # <<<<<<<<<<<<<< * return empty_aligned(shape, dtype=dtype, order=order, n=n) * */ __pyx_t_2 = NULL; __pyx_t_4 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_2) { __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL; } __Pyx_INCREF(__pyx_kp_s_This_function_is_deprecated_in_f); __Pyx_GIVEREF(__pyx_kp_s_This_function_is_deprecated_in_f); PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_kp_s_This_function_is_deprecated_in_f); __Pyx_INCREF(__pyx_builtin_DeprecationWarning); __Pyx_GIVEREF(__pyx_builtin_DeprecationWarning); PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_builtin_DeprecationWarning); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pyfftw/utils.pxi":73 * warnings.warn('This function is deprecated in favour of' * '``empty_aligned``.', DeprecationWarning) * return empty_aligned(shape, dtype=dtype, order=order, n=n) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_6.__pyx_n = 3; __pyx_t_6.dtype = __pyx_v_dtype; __pyx_t_6.order = __pyx_v_order; __pyx_t_6.n = __pyx_v_n; __pyx_t_1 = __pyx_f_6pyfftw_6pyfftw_empty_aligned(__pyx_v_shape, 0, &__pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pyfftw/utils.pxi":59 * _valid_simd_alignments = () * * cpdef n_byte_align_empty(shape, n, dtype='float64', order='C'): # <<<<<<<<<<<<<< * '''n_byte_align_empty(shape, n, dtype='float64', order='C') * **This function is deprecated:** ``empty_aligned`` **should be used */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pyfftw.pyfftw.n_byte_align_empty", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6pyfftw_6pyfftw_1n_byte_align_empty(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_6pyfftw_6pyfftw_n_byte_align_empty[] = "n_byte_align_empty(shape, n, dtype='float64', order='C')\n **This function is deprecated:** ``empty_aligned`` **should be used\n instead.**\n\n Function that returns an empty numpy array that is n-byte aligned.\n\n The alignment is given by the first optional argument, ``n``. If\n ``n`` is not provided then this function will inspect the CPU to\n determine alignment. The rest of the arguments are as per\n :func:`numpy.empty`.\n "; static PyObject *__pyx_pw_6pyfftw_6pyfftw_1n_byte_align_empty(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_shape = 0; PyObject *__pyx_v_n = 0; PyObject *__pyx_v_dtype = 0; PyObject *__pyx_v_order = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("n_byte_align_empty (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_n,&__pyx_n_s_dtype,&__pyx_n_s_order,0}; PyObject* values[4] = {0,0,0,0}; values[2] = ((PyObject *)__pyx_n_s_float64); values[3] = ((PyObject *)__pyx_n_s_C); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("n_byte_align_empty", 0, 2, 4, 1); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dtype); if (value) { values[2] = value; kw_args--; } } case 3: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_order); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "n_byte_align_empty") < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_shape = values[0]; __pyx_v_n = values[1]; __pyx_v_dtype = values[2]; __pyx_v_order = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("n_byte_align_empty", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pyfftw.pyfftw.n_byte_align_empty", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_6pyfftw_6pyfftw_n_byte_align_empty(__pyx_self, __pyx_v_shape, __pyx_v_n, __pyx_v_dtype, __pyx_v_order); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6pyfftw_6pyfftw_n_byte_align_empty(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_shape, PyObject *__pyx_v_n, PyObject *__pyx_v_dtype, PyObject *__pyx_v_order) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; struct __pyx_opt_args_6pyfftw_6pyfftw_n_byte_align_empty __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("n_byte_align_empty", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_2.__pyx_n = 2; __pyx_t_2.dtype = __pyx_v_dtype; __pyx_t_2.order = __pyx_v_order; __pyx_t_1 = __pyx_f_6pyfftw_6pyfftw_n_byte_align_empty(__pyx_v_shape, __pyx_v_n, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pyfftw.pyfftw.n_byte_align_empty", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pyfftw/utils.pxi":76 * * * cpdef n_byte_align(array, n, dtype=None): # <<<<<<<<<<<<<< * '''n_byte_align(array, n, dtype=None) * */ static PyObject *__pyx_pw_6pyfftw_6pyfftw_3n_byte_align(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_f_6pyfftw_6pyfftw_n_byte_align(PyObject *__pyx_v_array, PyObject *__pyx_v_n, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_6pyfftw_6pyfftw_n_byte_align *__pyx_optional_args) { PyObject *__pyx_v_dtype = ((PyObject *)Py_None); PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; struct __pyx_opt_args_6pyfftw_6pyfftw_byte_align __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("n_byte_align", 0); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_dtype = __pyx_optional_args->dtype; } } /* "pyfftw/utils.pxi":91 * of that dtype. * ''' * warnings.warn('This function is deprecated in favour of' # <<<<<<<<<<<<<< * '``byte_align``.', DeprecationWarning) * return byte_align(array, n=n, dtype=dtype) */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_warnings); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_warn); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pyfftw/utils.pxi":92 * ''' * warnings.warn('This function is deprecated in favour of' * '``byte_align``.', DeprecationWarning) # <<<<<<<<<<<<<< * return byte_align(array, n=n, dtype=dtype) * */ __pyx_t_2 = NULL; __pyx_t_4 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_2) { __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL; } __Pyx_INCREF(__pyx_kp_s_This_function_is_deprecated_in_f_2); __Pyx_GIVEREF(__pyx_kp_s_This_function_is_deprecated_in_f_2); PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_kp_s_This_function_is_deprecated_in_f_2); __Pyx_INCREF(__pyx_builtin_DeprecationWarning); __Pyx_GIVEREF(__pyx_builtin_DeprecationWarning); PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_builtin_DeprecationWarning); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pyfftw/utils.pxi":93 * warnings.warn('This function is deprecated in favour of' * '``byte_align``.', DeprecationWarning) * return byte_align(array, n=n, dtype=dtype) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_6.__pyx_n = 2; __pyx_t_6.n = __pyx_v_n; __pyx_t_6.dtype = __pyx_v_dtype; __pyx_t_1 = __pyx_f_6pyfftw_6pyfftw_byte_align(__pyx_v_array, 0, &__pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pyfftw/utils.pxi":76 * * * cpdef n_byte_align(array, n, dtype=None): # <<<<<<<<<<<<<< * '''n_byte_align(array, n, dtype=None) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pyfftw.pyfftw.n_byte_align", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6pyfftw_6pyfftw_3n_byte_align(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_6pyfftw_6pyfftw_2n_byte_align[] = "n_byte_align(array, n, dtype=None)\n\n **This function is deprecated:** ``byte_align`` **should be used instead.**\n\n Function that takes a numpy array and checks it is aligned on an n-byte\n boundary, where ``n`` is an optional parameter. If ``n`` is not provided\n then this function will inspect the CPU to determine alignment. If the\n array is aligned then it is returned without further ado. If it is not\n aligned then a new array is created and the data copied in, but aligned\n on the n-byte boundary.\n\n ``dtype`` is an optional argument that forces the resultant array to be\n of that dtype.\n "; static PyObject *__pyx_pw_6pyfftw_6pyfftw_3n_byte_align(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_array = 0; PyObject *__pyx_v_n = 0; PyObject *__pyx_v_dtype = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("n_byte_align (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_array,&__pyx_n_s_n,&__pyx_n_s_dtype,0}; PyObject* values[3] = {0,0,0}; values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_array)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("n_byte_align", 0, 2, 3, 1); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dtype); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "n_byte_align") < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_array = values[0]; __pyx_v_n = values[1]; __pyx_v_dtype = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("n_byte_align", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pyfftw.pyfftw.n_byte_align", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_6pyfftw_6pyfftw_2n_byte_align(__pyx_self, __pyx_v_array, __pyx_v_n, __pyx_v_dtype); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6pyfftw_6pyfftw_2n_byte_align(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_array, PyObject *__pyx_v_n, PyObject *__pyx_v_dtype) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; struct __pyx_opt_args_6pyfftw_6pyfftw_n_byte_align __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("n_byte_align", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_2.__pyx_n = 1; __pyx_t_2.dtype = __pyx_v_dtype; __pyx_t_1 = __pyx_f_6pyfftw_6pyfftw_n_byte_align(__pyx_v_array, __pyx_v_n, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pyfftw.pyfftw.n_byte_align", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pyfftw/utils.pxi":96 * * * cpdef byte_align(array, n=None, dtype=None): # <<<<<<<<<<<<<< * '''byte_align(array, n=None, dtype=None) * */ static PyObject *__pyx_pw_6pyfftw_6pyfftw_5byte_align(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_f_6pyfftw_6pyfftw_byte_align(PyObject *__pyx_v_array, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_6pyfftw_6pyfftw_byte_align *__pyx_optional_args) { PyObject *__pyx_v_n = ((PyObject *)Py_None); PyObject *__pyx_v_dtype = ((PyObject *)Py_None); int __pyx_v_update_dtype; PyObject *__pyx_v_offset = NULL; PyObject *__pyx_v__array_aligned = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("byte_align", 0); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_n = __pyx_optional_args->n; if (__pyx_optional_args->__pyx_n > 1) { __pyx_v_dtype = __pyx_optional_args->dtype; } } } __Pyx_INCREF(__pyx_v_array); __Pyx_INCREF(__pyx_v_n); __Pyx_INCREF(__pyx_v_dtype); /* "pyfftw/utils.pxi":110 * ''' * * if not isinstance(array, np.ndarray): # <<<<<<<<<<<<<< * raise TypeError('Invalid array: byte_align requires a subclass ' * 'of ndarray') */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_array, __pyx_ptype_5numpy_ndarray); __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); if (__pyx_t_2) { /* "pyfftw/utils.pxi":111 * * if not isinstance(array, np.ndarray): * raise TypeError('Invalid array: byte_align requires a subclass ' # <<<<<<<<<<<<<< * 'of ndarray') * */ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[1]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pyfftw/utils.pxi":110 * ''' * * if not isinstance(array, np.ndarray): # <<<<<<<<<<<<<< * raise TypeError('Invalid array: byte_align requires a subclass ' * 'of ndarray') */ } /* "pyfftw/utils.pxi":114 * 'of ndarray') * * if n is None: # <<<<<<<<<<<<<< * n = _simd_alignment * */ __pyx_t_2 = (__pyx_v_n == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { /* "pyfftw/utils.pxi":115 * * if n is None: * n = _simd_alignment # <<<<<<<<<<<<<< * * if dtype is not None: */ __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_6pyfftw_6pyfftw__simd_alignment); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_n, __pyx_t_3); __pyx_t_3 = 0; /* "pyfftw/utils.pxi":114 * 'of ndarray') * * if n is None: # <<<<<<<<<<<<<< * n = _simd_alignment * */ } /* "pyfftw/utils.pxi":117 * n = _simd_alignment * * if dtype is not None: # <<<<<<<<<<<<<< * if not array.dtype == dtype: * update_dtype = True */ __pyx_t_1 = (__pyx_v_dtype != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "pyfftw/utils.pxi":118 * * if dtype is not None: * if not array.dtype == dtype: # <<<<<<<<<<<<<< * update_dtype = True * */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_array, __pyx_n_s_dtype); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_dtype, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_1 = ((!__pyx_t_2) != 0); if (__pyx_t_1) { /* "pyfftw/utils.pxi":119 * if dtype is not None: * if not array.dtype == dtype: * update_dtype = True # <<<<<<<<<<<<<< * * else: */ __pyx_v_update_dtype = 1; /* "pyfftw/utils.pxi":118 * * if dtype is not None: * if not array.dtype == dtype: # <<<<<<<<<<<<<< * update_dtype = True * */ } /* "pyfftw/utils.pxi":117 * n = _simd_alignment * * if dtype is not None: # <<<<<<<<<<<<<< * if not array.dtype == dtype: * update_dtype = True */ goto __pyx_L5; } /* "pyfftw/utils.pxi":122 * * else: * dtype = array.dtype # <<<<<<<<<<<<<< * update_dtype = False * */ /*else*/ { __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_array, __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_dtype, __pyx_t_4); __pyx_t_4 = 0; /* "pyfftw/utils.pxi":123 * else: * dtype = array.dtype * update_dtype = False # <<<<<<<<<<<<<< * * # See if we're already n byte aligned. If so, do nothing. */ __pyx_v_update_dtype = 0; } __pyx_L5:; /* "pyfftw/utils.pxi":126 * * # See if we're already n byte aligned. If so, do nothing. * offset = np.PyArray_DATA(array) %n # <<<<<<<<<<<<<< * * if offset is not 0 or update_dtype: */ if (!(likely(((__pyx_v_array) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_array, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = PyInt_FromSsize_t(((intptr_t)PyArray_DATA(((PyArrayObject *)__pyx_v_array)))); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = PyNumber_Remainder(__pyx_t_4, __pyx_v_n); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_offset = __pyx_t_3; __pyx_t_3 = 0; /* "pyfftw/utils.pxi":128 * offset = np.PyArray_DATA(array) %n * * if offset is not 0 or update_dtype: # <<<<<<<<<<<<<< * * _array_aligned = empty_aligned(array.shape, dtype, n=n) */ __pyx_t_2 = (__pyx_v_offset != __pyx_int_0); __pyx_t_5 = (__pyx_t_2 != 0); if (!__pyx_t_5) { } else { __pyx_t_1 = __pyx_t_5; goto __pyx_L8_bool_binop_done; } __pyx_t_5 = (__pyx_v_update_dtype != 0); __pyx_t_1 = __pyx_t_5; __pyx_L8_bool_binop_done:; if (__pyx_t_1) { /* "pyfftw/utils.pxi":130 * if offset is not 0 or update_dtype: * * _array_aligned = empty_aligned(array.shape, dtype, n=n) # <<<<<<<<<<<<<< * * _array_aligned[:] = array */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_empty_aligned); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_array, __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __Pyx_INCREF(__pyx_v_dtype); __Pyx_GIVEREF(__pyx_v_dtype); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_dtype); __pyx_t_4 = 0; __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_n, __pyx_v_n) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v__array_aligned = __pyx_t_7; __pyx_t_7 = 0; /* "pyfftw/utils.pxi":132 * _array_aligned = empty_aligned(array.shape, dtype, n=n) * * _array_aligned[:] = array # <<<<<<<<<<<<<< * * array = _array_aligned.view(type=array.__class__) */ if (__Pyx_PyObject_SetSlice(__pyx_v__array_aligned, __pyx_v_array, 0, 0, NULL, NULL, &__pyx_slice__2, 0, 0, 1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pyfftw/utils.pxi":134 * _array_aligned[:] = array * * array = _array_aligned.view(type=array.__class__) # <<<<<<<<<<<<<< * * return array */ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v__array_aligned, __pyx_n_s_view); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_array, __pyx_n_s_class); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_type, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_array, __pyx_t_6); __pyx_t_6 = 0; /* "pyfftw/utils.pxi":128 * offset = np.PyArray_DATA(array) %n * * if offset is not 0 or update_dtype: # <<<<<<<<<<<<<< * * _array_aligned = empty_aligned(array.shape, dtype, n=n) */ } /* "pyfftw/utils.pxi":136 * array = _array_aligned.view(type=array.__class__) * * return array # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_array); __pyx_r = __pyx_v_array; goto __pyx_L0; /* "pyfftw/utils.pxi":96 * * * cpdef byte_align(array, n=None, dtype=None): # <<<<<<<<<<<<<< * '''byte_align(array, n=None, dtype=None) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pyfftw.pyfftw.byte_align", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_offset); __Pyx_XDECREF(__pyx_v__array_aligned); __Pyx_XDECREF(__pyx_v_array); __Pyx_XDECREF(__pyx_v_n); __Pyx_XDECREF(__pyx_v_dtype); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6pyfftw_6pyfftw_5byte_align(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_6pyfftw_6pyfftw_4byte_align[] = "byte_align(array, n=None, dtype=None)\n\n Function that takes a numpy array and checks it is aligned on an n-byte\n boundary, where ``n`` is an optional parameter. If ``n`` is not provided\n then this function will inspect the CPU to determine alignment. If the\n array is aligned then it is returned without further ado. If it is not\n aligned then a new array is created and the data copied in, but aligned\n on the n-byte boundary.\n\n ``dtype`` is an optional argument that forces the resultant array to be\n of that dtype.\n "; static PyObject *__pyx_pw_6pyfftw_6pyfftw_5byte_align(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_array = 0; PyObject *__pyx_v_n = 0; PyObject *__pyx_v_dtype = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("byte_align (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_array,&__pyx_n_s_n,&__pyx_n_s_dtype,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_array)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_n); if (value) { values[1] = value; kw_args--; } } case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dtype); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "byte_align") < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_array = values[0]; __pyx_v_n = values[1]; __pyx_v_dtype = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("byte_align", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pyfftw.pyfftw.byte_align", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_6pyfftw_6pyfftw_4byte_align(__pyx_self, __pyx_v_array, __pyx_v_n, __pyx_v_dtype); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6pyfftw_6pyfftw_4byte_align(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_array, PyObject *__pyx_v_n, PyObject *__pyx_v_dtype) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; struct __pyx_opt_args_6pyfftw_6pyfftw_byte_align __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("byte_align", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_2.__pyx_n = 2; __pyx_t_2.n = __pyx_v_n; __pyx_t_2.dtype = __pyx_v_dtype; __pyx_t_1 = __pyx_f_6pyfftw_6pyfftw_byte_align(__pyx_v_array, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pyfftw.pyfftw.byte_align", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pyfftw/utils.pxi":139 * * * cpdef is_byte_aligned(array, n=None): # <<<<<<<<<<<<<< * ''' is_n_byte_aligned(array, n=None) * */ static PyObject *__pyx_pw_6pyfftw_6pyfftw_7is_byte_aligned(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_f_6pyfftw_6pyfftw_is_byte_aligned(PyObject *__pyx_v_array, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_6pyfftw_6pyfftw_is_byte_aligned *__pyx_optional_args) { PyObject *__pyx_v_n = ((PyObject *)Py_None); PyObject *__pyx_v_offset = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("is_byte_aligned", 0); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_n = __pyx_optional_args->n; } } __Pyx_INCREF(__pyx_v_n); /* "pyfftw/utils.pxi":147 * inspect the CPU to determine alignment. * ''' * if not isinstance(array, np.ndarray): # <<<<<<<<<<<<<< * raise TypeError('Invalid array: is_n_byte_aligned requires a subclass ' * 'of ndarray') */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_array, __pyx_ptype_5numpy_ndarray); __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); if (__pyx_t_2) { /* "pyfftw/utils.pxi":148 * ''' * if not isinstance(array, np.ndarray): * raise TypeError('Invalid array: is_n_byte_aligned requires a subclass ' # <<<<<<<<<<<<<< * 'of ndarray') * */ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[1]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pyfftw/utils.pxi":147 * inspect the CPU to determine alignment. * ''' * if not isinstance(array, np.ndarray): # <<<<<<<<<<<<<< * raise TypeError('Invalid array: is_n_byte_aligned requires a subclass ' * 'of ndarray') */ } /* "pyfftw/utils.pxi":151 * 'of ndarray') * * if n is None: # <<<<<<<<<<<<<< * n = _simd_alignment * */ __pyx_t_2 = (__pyx_v_n == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { /* "pyfftw/utils.pxi":152 * * if n is None: * n = _simd_alignment # <<<<<<<<<<<<<< * * # See if we're n byte aligned. */ __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_6pyfftw_6pyfftw__simd_alignment); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_n, __pyx_t_3); __pyx_t_3 = 0; /* "pyfftw/utils.pxi":151 * 'of ndarray') * * if n is None: # <<<<<<<<<<<<<< * n = _simd_alignment * */ } /* "pyfftw/utils.pxi":155 * * # See if we're n byte aligned. * offset = np.PyArray_DATA(array) %n # <<<<<<<<<<<<<< * * return not bool(offset) */ if (!(likely(((__pyx_v_array) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_array, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_3 = PyInt_FromSsize_t(((intptr_t)PyArray_DATA(((PyArrayObject *)__pyx_v_array)))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyNumber_Remainder(__pyx_t_3, __pyx_v_n); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_offset = __pyx_t_4; __pyx_t_4 = 0; /* "pyfftw/utils.pxi":157 * offset = np.PyArray_DATA(array) %n * * return not bool(offset) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_offset); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = __Pyx_PyBool_FromLong((!((!(!__pyx_t_1)) != 0))); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pyfftw/utils.pxi":139 * * * cpdef is_byte_aligned(array, n=None): # <<<<<<<<<<<<<< * ''' is_n_byte_aligned(array, n=None) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pyfftw.pyfftw.is_byte_aligned", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_offset); __Pyx_XDECREF(__pyx_v_n); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6pyfftw_6pyfftw_7is_byte_aligned(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_6pyfftw_6pyfftw_6is_byte_aligned[] = " is_n_byte_aligned(array, n=None)\n\n Function that takes a numpy array and checks it is aligned on an n-byte\n boundary, where ``n`` is an optional parameter, returning ``True`` if it is,\n and ``False`` if it is not. If ``n`` is not provided then this function will\n inspect the CPU to determine alignment.\n "; static PyObject *__pyx_pw_6pyfftw_6pyfftw_7is_byte_aligned(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_array = 0; PyObject *__pyx_v_n = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("is_byte_aligned (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_array,&__pyx_n_s_n,0}; PyObject* values[2] = {0,0}; values[1] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_array)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_n); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "is_byte_aligned") < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_array = values[0]; __pyx_v_n = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("is_byte_aligned", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pyfftw.pyfftw.is_byte_aligned", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_6pyfftw_6pyfftw_6is_byte_aligned(__pyx_self, __pyx_v_array, __pyx_v_n); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6pyfftw_6pyfftw_6is_byte_aligned(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_array, PyObject *__pyx_v_n) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; struct __pyx_opt_args_6pyfftw_6pyfftw_is_byte_aligned __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("is_byte_aligned", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_2.__pyx_n = 1; __pyx_t_2.n = __pyx_v_n; __pyx_t_1 = __pyx_f_6pyfftw_6pyfftw_is_byte_aligned(__pyx_v_array, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pyfftw.pyfftw.is_byte_aligned", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pyfftw/utils.pxi":160 * * * cpdef is_n_byte_aligned(array, n): # <<<<<<<<<<<<<< * ''' is_n_byte_aligned(array, n) * **This function is deprecated:** ``is_byte_aligned`` **should be used */ static PyObject *__pyx_pw_6pyfftw_6pyfftw_9is_n_byte_aligned(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_f_6pyfftw_6pyfftw_is_n_byte_aligned(PyObject *__pyx_v_array, PyObject *__pyx_v_n, CYTHON_UNUSED int __pyx_skip_dispatch) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; struct __pyx_opt_args_6pyfftw_6pyfftw_is_byte_aligned __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("is_n_byte_aligned", 0); /* "pyfftw/utils.pxi":169 * and ``False`` if it is not. * ''' * return is_byte_aligned(array, n=n) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_2.__pyx_n = 1; __pyx_t_2.n = __pyx_v_n; __pyx_t_1 = __pyx_f_6pyfftw_6pyfftw_is_byte_aligned(__pyx_v_array, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pyfftw/utils.pxi":160 * * * cpdef is_n_byte_aligned(array, n): # <<<<<<<<<<<<<< * ''' is_n_byte_aligned(array, n) * **This function is deprecated:** ``is_byte_aligned`` **should be used */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pyfftw.pyfftw.is_n_byte_aligned", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6pyfftw_6pyfftw_9is_n_byte_aligned(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_6pyfftw_6pyfftw_8is_n_byte_aligned[] = " is_n_byte_aligned(array, n)\n **This function is deprecated:** ``is_byte_aligned`` **should be used\n instead.**\n\n Function that takes a numpy array and checks it is aligned on an n-byte\n boundary, where ``n`` is a passed parameter, returning ``True`` if it is,\n and ``False`` if it is not.\n "; static PyObject *__pyx_pw_6pyfftw_6pyfftw_9is_n_byte_aligned(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_array = 0; PyObject *__pyx_v_n = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("is_n_byte_aligned (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_array,&__pyx_n_s_n,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_array)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("is_n_byte_aligned", 1, 2, 2, 1); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "is_n_byte_aligned") < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_array = values[0]; __pyx_v_n = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("is_n_byte_aligned", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pyfftw.pyfftw.is_n_byte_aligned", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_6pyfftw_6pyfftw_8is_n_byte_aligned(__pyx_self, __pyx_v_array, __pyx_v_n); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6pyfftw_6pyfftw_8is_n_byte_aligned(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_array, PyObject *__pyx_v_n) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("is_n_byte_aligned", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_6pyfftw_6pyfftw_is_n_byte_aligned(__pyx_v_array, __pyx_v_n, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pyfftw.pyfftw.is_n_byte_aligned", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pyfftw/utils.pxi":172 * * * cpdef empty_aligned(shape, dtype='float64', order='C', n=None): # <<<<<<<<<<<<<< * '''empty_aligned(shape, dtype='float64', order='C', n=None) * */ static PyObject *__pyx_pw_6pyfftw_6pyfftw_11empty_aligned(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_f_6pyfftw_6pyfftw_empty_aligned(PyObject *__pyx_v_shape, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_6pyfftw_6pyfftw_empty_aligned *__pyx_optional_args) { PyObject *__pyx_v_dtype = ((PyObject *)__pyx_n_s_float64); PyObject *__pyx_v_order = ((PyObject *)__pyx_n_s_C); PyObject *__pyx_v_n = ((PyObject *)Py_None); PyObject *__pyx_v_itemsize = NULL; PyObject *__pyx_v_array_length = NULL; PyObject *__pyx_v_each_dimension = NULL; PyObject *__pyx_v__array_aligned = NULL; PyObject *__pyx_v__array_aligned_offset = NULL; PyObject *__pyx_v_array = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; Py_ssize_t __pyx_t_6; PyObject *(*__pyx_t_7)(PyObject *); PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("empty_aligned", 0); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_dtype = __pyx_optional_args->dtype; if (__pyx_optional_args->__pyx_n > 1) { __pyx_v_order = __pyx_optional_args->order; if (__pyx_optional_args->__pyx_n > 2) { __pyx_v_n = __pyx_optional_args->n; } } } } __Pyx_INCREF(__pyx_v_n); /* "pyfftw/utils.pxi":184 * :func:`numpy.empty`. * ''' * if n is None: # <<<<<<<<<<<<<< * n = _simd_alignment * */ __pyx_t_1 = (__pyx_v_n == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "pyfftw/utils.pxi":185 * ''' * if n is None: * n = _simd_alignment # <<<<<<<<<<<<<< * * itemsize = np.dtype(dtype).itemsize */ __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_6pyfftw_6pyfftw__simd_alignment); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_n, __pyx_t_3); __pyx_t_3 = 0; /* "pyfftw/utils.pxi":184 * :func:`numpy.empty`. * ''' * if n is None: # <<<<<<<<<<<<<< * n = _simd_alignment * */ } /* "pyfftw/utils.pxi":187 * n = _simd_alignment * * itemsize = np.dtype(dtype).itemsize # <<<<<<<<<<<<<< * * # Apparently there is an issue with numpy.prod wrapping around on 32-bits */ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_dtype); __Pyx_GIVEREF(__pyx_v_dtype); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_dtype); __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyInt_From_int(((PyArray_Descr *)__pyx_t_4)->elsize); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_itemsize = __pyx_t_3; __pyx_t_3 = 0; /* "pyfftw/utils.pxi":192 * # on Windows 64-bit. This shouldn't happen, but the following code * # alleviates the problem. * if not isinstance(shape, (int, np.integer)): # <<<<<<<<<<<<<< * array_length = 1 * for each_dimension in shape: */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_integer); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_1 = PyInt_Check(__pyx_v_shape); __pyx_t_5 = (__pyx_t_1 != 0); if (!__pyx_t_5) { } else { __pyx_t_2 = __pyx_t_5; goto __pyx_L5_bool_binop_done; } __pyx_t_5 = PyObject_IsInstance(__pyx_v_shape, __pyx_t_4); __pyx_t_1 = (__pyx_t_5 != 0); __pyx_t_2 = __pyx_t_1; __pyx_L5_bool_binop_done:; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_1 = ((!(__pyx_t_2 != 0)) != 0); if (__pyx_t_1) { /* "pyfftw/utils.pxi":193 * # alleviates the problem. * if not isinstance(shape, (int, np.integer)): * array_length = 1 # <<<<<<<<<<<<<< * for each_dimension in shape: * array_length *= each_dimension */ __Pyx_INCREF(__pyx_int_1); __pyx_v_array_length = __pyx_int_1; /* "pyfftw/utils.pxi":194 * if not isinstance(shape, (int, np.integer)): * array_length = 1 * for each_dimension in shape: # <<<<<<<<<<<<<< * array_length *= each_dimension * */ if (likely(PyList_CheckExact(__pyx_v_shape)) || PyTuple_CheckExact(__pyx_v_shape)) { __pyx_t_4 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_4); __pyx_t_6 = 0; __pyx_t_7 = NULL; } else { __pyx_t_6 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_shape); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } for (;;) { if (likely(!__pyx_t_7)) { if (likely(PyList_CheckExact(__pyx_t_4))) { if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_4)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); #endif } else { if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_4)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); #endif } } else { __pyx_t_3 = __pyx_t_7(__pyx_t_4); if (unlikely(!__pyx_t_3)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[1]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } __Pyx_GOTREF(__pyx_t_3); } __Pyx_XDECREF_SET(__pyx_v_each_dimension, __pyx_t_3); __pyx_t_3 = 0; /* "pyfftw/utils.pxi":195 * array_length = 1 * for each_dimension in shape: * array_length *= each_dimension # <<<<<<<<<<<<<< * * else: */ __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_v_array_length, __pyx_v_each_dimension); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_array_length, __pyx_t_3); __pyx_t_3 = 0; /* "pyfftw/utils.pxi":194 * if not isinstance(shape, (int, np.integer)): * array_length = 1 * for each_dimension in shape: # <<<<<<<<<<<<<< * array_length *= each_dimension * */ } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyfftw/utils.pxi":192 * # on Windows 64-bit. This shouldn't happen, but the following code * # alleviates the problem. * if not isinstance(shape, (int, np.integer)): # <<<<<<<<<<<<<< * array_length = 1 * for each_dimension in shape: */ goto __pyx_L4; } /* "pyfftw/utils.pxi":198 * * else: * array_length = shape # <<<<<<<<<<<<<< * * # Allocate a new array that will contain the aligned data */ /*else*/ { __Pyx_INCREF(__pyx_v_shape); __pyx_v_array_length = __pyx_v_shape; } __pyx_L4:; /* "pyfftw/utils.pxi":201 * * # Allocate a new array that will contain the aligned data * _array_aligned = np.empty(array_length*itemsize+n, dtype='int8') # <<<<<<<<<<<<<< * * # We now need to know how to offset _array_aligned */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyNumber_Multiply(__pyx_v_array_length, __pyx_v_itemsize); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = PyNumber_Add(__pyx_t_4, __pyx_v_n); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_dtype, __pyx_n_s_int8) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_8); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_v__array_aligned = __pyx_t_9; __pyx_t_9 = 0; /* "pyfftw/utils.pxi":205 * # We now need to know how to offset _array_aligned * # so it is correctly aligned * _array_aligned_offset = (n-np.PyArray_DATA(_array_aligned))%n # <<<<<<<<<<<<<< * * array = np.frombuffer( */ if (!(likely(((__pyx_v__array_aligned) == Py_None) || likely(__Pyx_TypeTest(__pyx_v__array_aligned, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_9 = PyInt_FromSsize_t(((intptr_t)PyArray_DATA(((PyArrayObject *)__pyx_v__array_aligned)))); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __pyx_t_8 = PyNumber_Subtract(__pyx_v_n, __pyx_t_9); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = PyNumber_Remainder(__pyx_t_8, __pyx_v_n); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_v__array_aligned_offset = __pyx_t_9; __pyx_t_9 = 0; /* "pyfftw/utils.pxi":207 * _array_aligned_offset = (n-np.PyArray_DATA(_array_aligned))%n * * array = np.frombuffer( # <<<<<<<<<<<<<< * _array_aligned[_array_aligned_offset:_array_aligned_offset-n].data, * dtype=dtype).reshape(shape, order=order) */ __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_frombuffer); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "pyfftw/utils.pxi":208 * * array = np.frombuffer( * _array_aligned[_array_aligned_offset:_array_aligned_offset-n].data, # <<<<<<<<<<<<<< * dtype=dtype).reshape(shape, order=order) * */ __pyx_t_9 = PyNumber_Subtract(__pyx_v__array_aligned_offset, __pyx_v_n); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_v__array_aligned, 0, 0, &__pyx_v__array_aligned_offset, &__pyx_t_9, NULL, 0, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_data); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyfftw/utils.pxi":207 * _array_aligned_offset = (n-np.PyArray_DATA(_array_aligned))%n * * array = np.frombuffer( # <<<<<<<<<<<<<< * _array_aligned[_array_aligned_offset:_array_aligned_offset-n].data, * dtype=dtype).reshape(shape, order=order) */ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_9); __pyx_t_9 = 0; /* "pyfftw/utils.pxi":209 * array = np.frombuffer( * _array_aligned[_array_aligned_offset:_array_aligned_offset-n].data, * dtype=dtype).reshape(shape, order=order) # <<<<<<<<<<<<<< * * return array */ __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_dtype, __pyx_v_dtype) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pyfftw/utils.pxi":207 * _array_aligned_offset = (n-np.PyArray_DATA(_array_aligned))%n * * array = np.frombuffer( # <<<<<<<<<<<<<< * _array_aligned[_array_aligned_offset:_array_aligned_offset-n].data, * dtype=dtype).reshape(shape, order=order) */ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_4, __pyx_t_9); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "pyfftw/utils.pxi":209 * array = np.frombuffer( * _array_aligned[_array_aligned_offset:_array_aligned_offset-n].data, * dtype=dtype).reshape(shape, order=order) # <<<<<<<<<<<<<< * * return array */ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_reshape); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_shape); __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_order, __pyx_v_order) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_array = __pyx_t_8; __pyx_t_8 = 0; /* "pyfftw/utils.pxi":211 * dtype=dtype).reshape(shape, order=order) * * return array # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_array); __pyx_r = __pyx_v_array; goto __pyx_L0; /* "pyfftw/utils.pxi":172 * * * cpdef empty_aligned(shape, dtype='float64', order='C', n=None): # <<<<<<<<<<<<<< * '''empty_aligned(shape, dtype='float64', order='C', n=None) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("pyfftw.pyfftw.empty_aligned", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_itemsize); __Pyx_XDECREF(__pyx_v_array_length); __Pyx_XDECREF(__pyx_v_each_dimension); __Pyx_XDECREF(__pyx_v__array_aligned); __Pyx_XDECREF(__pyx_v__array_aligned_offset); __Pyx_XDECREF(__pyx_v_array); __Pyx_XDECREF(__pyx_v_n); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6pyfftw_6pyfftw_11empty_aligned(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_6pyfftw_6pyfftw_10empty_aligned[] = "empty_aligned(shape, dtype='float64', order='C', n=None)\n\n Function that returns an empty numpy array that is n-byte aligned,\n where ``n`` is determined by inspecting the CPU if it is not\n provided.\n\n The alignment is given by the final optional argument, ``n``. If\n ``n`` is not provided then this function will inspect the CPU to\n determine alignment. The rest of the arguments are as per\n :func:`numpy.empty`.\n "; static PyObject *__pyx_pw_6pyfftw_6pyfftw_11empty_aligned(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_shape = 0; PyObject *__pyx_v_dtype = 0; PyObject *__pyx_v_order = 0; PyObject *__pyx_v_n = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("empty_aligned (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_dtype,&__pyx_n_s_order,&__pyx_n_s_n,0}; PyObject* values[4] = {0,0,0,0}; values[1] = ((PyObject *)__pyx_n_s_float64); values[2] = ((PyObject *)__pyx_n_s_C); values[3] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dtype); if (value) { values[1] = value; kw_args--; } } case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_order); if (value) { values[2] = value; kw_args--; } } case 3: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_n); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "empty_aligned") < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_shape = values[0]; __pyx_v_dtype = values[1]; __pyx_v_order = values[2]; __pyx_v_n = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("empty_aligned", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pyfftw.pyfftw.empty_aligned", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_6pyfftw_6pyfftw_10empty_aligned(__pyx_self, __pyx_v_shape, __pyx_v_dtype, __pyx_v_order, __pyx_v_n); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6pyfftw_6pyfftw_10empty_aligned(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_shape, PyObject *__pyx_v_dtype, PyObject *__pyx_v_order, PyObject *__pyx_v_n) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; struct __pyx_opt_args_6pyfftw_6pyfftw_empty_aligned __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("empty_aligned", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_2.__pyx_n = 3; __pyx_t_2.dtype = __pyx_v_dtype; __pyx_t_2.order = __pyx_v_order; __pyx_t_2.n = __pyx_v_n; __pyx_t_1 = __pyx_f_6pyfftw_6pyfftw_empty_aligned(__pyx_v_shape, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pyfftw.pyfftw.empty_aligned", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pyfftw/utils.pxi":214 * * * cpdef zeros_aligned(shape, dtype='float64', order='C', n=None): # <<<<<<<<<<<<<< * '''zeros_aligned(shape, dtype='float64', order='C', n=None) * */ static PyObject *__pyx_pw_6pyfftw_6pyfftw_13zeros_aligned(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_f_6pyfftw_6pyfftw_zeros_aligned(PyObject *__pyx_v_shape, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_6pyfftw_6pyfftw_zeros_aligned *__pyx_optional_args) { PyObject *__pyx_v_dtype = ((PyObject *)__pyx_n_s_float64); PyObject *__pyx_v_order = ((PyObject *)__pyx_n_s_C); PyObject *__pyx_v_n = ((PyObject *)Py_None); PyObject *__pyx_v_array = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; struct __pyx_opt_args_6pyfftw_6pyfftw_empty_aligned __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("zeros_aligned", 0); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_dtype = __pyx_optional_args->dtype; if (__pyx_optional_args->__pyx_n > 1) { __pyx_v_order = __pyx_optional_args->order; if (__pyx_optional_args->__pyx_n > 2) { __pyx_v_n = __pyx_optional_args->n; } } } } /* "pyfftw/utils.pxi":226 * :func:`numpy.zeros`. * ''' * array = empty_aligned(shape, dtype=dtype, order=order, n=n) # <<<<<<<<<<<<<< * array.fill(0) * return array */ __pyx_t_2.__pyx_n = 3; __pyx_t_2.dtype = __pyx_v_dtype; __pyx_t_2.order = __pyx_v_order; __pyx_t_2.n = __pyx_v_n; __pyx_t_1 = __pyx_f_6pyfftw_6pyfftw_empty_aligned(__pyx_v_shape, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_array = __pyx_t_1; __pyx_t_1 = 0; /* "pyfftw/utils.pxi":227 * ''' * array = empty_aligned(shape, dtype=dtype, order=order, n=n) * array.fill(0) # <<<<<<<<<<<<<< * return array * */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_array, __pyx_n_s_fill); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pyfftw/utils.pxi":228 * array = empty_aligned(shape, dtype=dtype, order=order, n=n) * array.fill(0) * return array # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_array); __pyx_r = __pyx_v_array; goto __pyx_L0; /* "pyfftw/utils.pxi":214 * * * cpdef zeros_aligned(shape, dtype='float64', order='C', n=None): # <<<<<<<<<<<<<< * '''zeros_aligned(shape, dtype='float64', order='C', n=None) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pyfftw.pyfftw.zeros_aligned", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_array); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6pyfftw_6pyfftw_13zeros_aligned(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_6pyfftw_6pyfftw_12zeros_aligned[] = "zeros_aligned(shape, dtype='float64', order='C', n=None)\n\n Function that returns a numpy array of zeros that is n-byte aligned,\n where ``n`` is determined by inspecting the CPU if it is not\n provided.\n\n The alignment is given by the final optional argument, ``n``. If\n ``n`` is not provided then this function will inspect the CPU to\n determine alignment. The rest of the arguments are as per\n :func:`numpy.zeros`.\n "; static PyObject *__pyx_pw_6pyfftw_6pyfftw_13zeros_aligned(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_shape = 0; PyObject *__pyx_v_dtype = 0; PyObject *__pyx_v_order = 0; PyObject *__pyx_v_n = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("zeros_aligned (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_dtype,&__pyx_n_s_order,&__pyx_n_s_n,0}; PyObject* values[4] = {0,0,0,0}; values[1] = ((PyObject *)__pyx_n_s_float64); values[2] = ((PyObject *)__pyx_n_s_C); values[3] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dtype); if (value) { values[1] = value; kw_args--; } } case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_order); if (value) { values[2] = value; kw_args--; } } case 3: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_n); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "zeros_aligned") < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_shape = values[0]; __pyx_v_dtype = values[1]; __pyx_v_order = values[2]; __pyx_v_n = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("zeros_aligned", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pyfftw.pyfftw.zeros_aligned", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_6pyfftw_6pyfftw_12zeros_aligned(__pyx_self, __pyx_v_shape, __pyx_v_dtype, __pyx_v_order, __pyx_v_n); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6pyfftw_6pyfftw_12zeros_aligned(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_shape, PyObject *__pyx_v_dtype, PyObject *__pyx_v_order, PyObject *__pyx_v_n) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; struct __pyx_opt_args_6pyfftw_6pyfftw_zeros_aligned __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("zeros_aligned", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_2.__pyx_n = 3; __pyx_t_2.dtype = __pyx_v_dtype; __pyx_t_2.order = __pyx_v_order; __pyx_t_2.n = __pyx_v_n; __pyx_t_1 = __pyx_f_6pyfftw_6pyfftw_zeros_aligned(__pyx_v_shape, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pyfftw.pyfftw.zeros_aligned", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pyfftw/utils.pxi":231 * * * cpdef ones_aligned(shape, dtype='float64', order='C', n=None): # <<<<<<<<<<<<<< * '''ones_aligned(shape, dtype='float64', order='C', n=None) * */ static PyObject *__pyx_pw_6pyfftw_6pyfftw_15ones_aligned(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_f_6pyfftw_6pyfftw_ones_aligned(PyObject *__pyx_v_shape, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_6pyfftw_6pyfftw_ones_aligned *__pyx_optional_args) { PyObject *__pyx_v_dtype = ((PyObject *)__pyx_n_s_float64); PyObject *__pyx_v_order = ((PyObject *)__pyx_n_s_C); PyObject *__pyx_v_n = ((PyObject *)Py_None); PyObject *__pyx_v_array = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; struct __pyx_opt_args_6pyfftw_6pyfftw_empty_aligned __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("ones_aligned", 0); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_dtype = __pyx_optional_args->dtype; if (__pyx_optional_args->__pyx_n > 1) { __pyx_v_order = __pyx_optional_args->order; if (__pyx_optional_args->__pyx_n > 2) { __pyx_v_n = __pyx_optional_args->n; } } } } /* "pyfftw/utils.pxi":243 * :func:`numpy.ones`. * ''' * array = empty_aligned(shape, dtype=dtype, order=order, n=n) # <<<<<<<<<<<<<< * array.fill(1) * return array */ __pyx_t_2.__pyx_n = 3; __pyx_t_2.dtype = __pyx_v_dtype; __pyx_t_2.order = __pyx_v_order; __pyx_t_2.n = __pyx_v_n; __pyx_t_1 = __pyx_f_6pyfftw_6pyfftw_empty_aligned(__pyx_v_shape, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_array = __pyx_t_1; __pyx_t_1 = 0; /* "pyfftw/utils.pxi":244 * ''' * array = empty_aligned(shape, dtype=dtype, order=order, n=n) * array.fill(1) # <<<<<<<<<<<<<< * return array */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_array, __pyx_n_s_fill); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pyfftw/utils.pxi":245 * array = empty_aligned(shape, dtype=dtype, order=order, n=n) * array.fill(1) * return array # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_array); __pyx_r = __pyx_v_array; goto __pyx_L0; /* "pyfftw/utils.pxi":231 * * * cpdef ones_aligned(shape, dtype='float64', order='C', n=None): # <<<<<<<<<<<<<< * '''ones_aligned(shape, dtype='float64', order='C', n=None) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pyfftw.pyfftw.ones_aligned", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_array); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6pyfftw_6pyfftw_15ones_aligned(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_6pyfftw_6pyfftw_14ones_aligned[] = "ones_aligned(shape, dtype='float64', order='C', n=None)\n\n Function that returns a numpy array of ones that is n-byte aligned,\n where ``n`` is determined by inspecting the CPU if it is not\n provided.\n\n The alignment is given by the final optional argument, ``n``. If\n ``n`` is not provided then this function will inspect the CPU to\n determine alignment. The rest of the arguments are as per\n :func:`numpy.ones`.\n "; static PyObject *__pyx_pw_6pyfftw_6pyfftw_15ones_aligned(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_shape = 0; PyObject *__pyx_v_dtype = 0; PyObject *__pyx_v_order = 0; PyObject *__pyx_v_n = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("ones_aligned (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_dtype,&__pyx_n_s_order,&__pyx_n_s_n,0}; PyObject* values[4] = {0,0,0,0}; values[1] = ((PyObject *)__pyx_n_s_float64); values[2] = ((PyObject *)__pyx_n_s_C); values[3] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dtype); if (value) { values[1] = value; kw_args--; } } case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_order); if (value) { values[2] = value; kw_args--; } } case 3: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_n); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ones_aligned") < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_shape = values[0]; __pyx_v_dtype = values[1]; __pyx_v_order = values[2]; __pyx_v_n = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("ones_aligned", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pyfftw.pyfftw.ones_aligned", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_6pyfftw_6pyfftw_14ones_aligned(__pyx_self, __pyx_v_shape, __pyx_v_dtype, __pyx_v_order, __pyx_v_n); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6pyfftw_6pyfftw_14ones_aligned(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_shape, PyObject *__pyx_v_dtype, PyObject *__pyx_v_order, PyObject *__pyx_v_n) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; struct __pyx_opt_args_6pyfftw_6pyfftw_ones_aligned __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("ones_aligned", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_2.__pyx_n = 3; __pyx_t_2.dtype = __pyx_v_dtype; __pyx_t_2.order = __pyx_v_order; __pyx_t_2.n = __pyx_v_n; __pyx_t_1 = __pyx_f_6pyfftw_6pyfftw_ones_aligned(__pyx_v_shape, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pyfftw.pyfftw.ones_aligned", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pyfftw/pyfftw.pyx":85 * # * # Complex double precision * cdef void* _fftw_plan_guru_dft( # <<<<<<<<<<<<<< * int rank, fftw_iodim *dims, * int howmany_rank, fftw_iodim *howmany_dims, */ static void *__pyx_f_6pyfftw_6pyfftw__fftw_plan_guru_dft(int __pyx_v_rank, fftw_iodim *__pyx_v_dims, int __pyx_v_howmany_rank, fftw_iodim *__pyx_v_howmany_dims, void *__pyx_v__in, void *__pyx_v__out, int __pyx_v_sign, unsigned int __pyx_v_flags) { void *__pyx_r; /* "pyfftw/pyfftw.pyx":91 * int sign, unsigned flags) nogil: * * return fftw_plan_guru_dft(rank, dims, # <<<<<<<<<<<<<< * howmany_rank, howmany_dims, * _in, _out, */ __pyx_r = ((void *)fftw_plan_guru_dft(__pyx_v_rank, __pyx_v_dims, __pyx_v_howmany_rank, __pyx_v_howmany_dims, ((cdouble *)__pyx_v__in), ((cdouble *)__pyx_v__out), __pyx_v_sign, __pyx_v_flags)); goto __pyx_L0; /* "pyfftw/pyfftw.pyx":85 * # * # Complex double precision * cdef void* _fftw_plan_guru_dft( # <<<<<<<<<<<<<< * int rank, fftw_iodim *dims, * int howmany_rank, fftw_iodim *howmany_dims, */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "pyfftw/pyfftw.pyx":97 * * # Complex single precision * cdef void* _fftwf_plan_guru_dft( # <<<<<<<<<<<<<< * int rank, fftw_iodim *dims, * int howmany_rank, fftw_iodim *howmany_dims, */ static void *__pyx_f_6pyfftw_6pyfftw__fftwf_plan_guru_dft(int __pyx_v_rank, fftw_iodim *__pyx_v_dims, int __pyx_v_howmany_rank, fftw_iodim *__pyx_v_howmany_dims, void *__pyx_v__in, void *__pyx_v__out, int __pyx_v_sign, unsigned int __pyx_v_flags) { void *__pyx_r; /* "pyfftw/pyfftw.pyx":103 * int sign, unsigned flags) nogil: * * return fftwf_plan_guru_dft(rank, dims, # <<<<<<<<<<<<<< * howmany_rank, howmany_dims, * _in, _out, */ __pyx_r = ((void *)fftwf_plan_guru_dft(__pyx_v_rank, __pyx_v_dims, __pyx_v_howmany_rank, __pyx_v_howmany_dims, ((cfloat *)__pyx_v__in), ((cfloat *)__pyx_v__out), __pyx_v_sign, __pyx_v_flags)); goto __pyx_L0; /* "pyfftw/pyfftw.pyx":97 * * # Complex single precision * cdef void* _fftwf_plan_guru_dft( # <<<<<<<<<<<<<< * int rank, fftw_iodim *dims, * int howmany_rank, fftw_iodim *howmany_dims, */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "pyfftw/pyfftw.pyx":109 * * # Complex long double precision * cdef void* _fftwl_plan_guru_dft( # <<<<<<<<<<<<<< * int rank, fftw_iodim *dims, * int howmany_rank, fftw_iodim *howmany_dims, */ static void *__pyx_f_6pyfftw_6pyfftw__fftwl_plan_guru_dft(int __pyx_v_rank, fftw_iodim *__pyx_v_dims, int __pyx_v_howmany_rank, fftw_iodim *__pyx_v_howmany_dims, void *__pyx_v__in, void *__pyx_v__out, int __pyx_v_sign, unsigned int __pyx_v_flags) { void *__pyx_r; /* "pyfftw/pyfftw.pyx":115 * int sign, unsigned flags) nogil: * * return fftwl_plan_guru_dft(rank, dims, # <<<<<<<<<<<<<< * howmany_rank, howmany_dims, * _in, _out, */ __pyx_r = ((void *)fftwl_plan_guru_dft(__pyx_v_rank, __pyx_v_dims, __pyx_v_howmany_rank, __pyx_v_howmany_dims, ((clongdouble *)__pyx_v__in), ((clongdouble *)__pyx_v__out), __pyx_v_sign, __pyx_v_flags)); goto __pyx_L0; /* "pyfftw/pyfftw.pyx":109 * * # Complex long double precision * cdef void* _fftwl_plan_guru_dft( # <<<<<<<<<<<<<< * int rank, fftw_iodim *dims, * int howmany_rank, fftw_iodim *howmany_dims, */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "pyfftw/pyfftw.pyx":121 * * # real to complex double precision * cdef void* _fftw_plan_guru_dft_r2c( # <<<<<<<<<<<<<< * int rank, fftw_iodim *dims, * int howmany_rank, fftw_iodim *howmany_dims, */ static void *__pyx_f_6pyfftw_6pyfftw__fftw_plan_guru_dft_r2c(int __pyx_v_rank, fftw_iodim *__pyx_v_dims, int __pyx_v_howmany_rank, fftw_iodim *__pyx_v_howmany_dims, void *__pyx_v__in, void *__pyx_v__out, CYTHON_UNUSED int __pyx_v_sign, unsigned int __pyx_v_flags) { void *__pyx_r; /* "pyfftw/pyfftw.pyx":127 * int sign, unsigned flags) nogil: * * return fftw_plan_guru_dft_r2c(rank, dims, # <<<<<<<<<<<<<< * howmany_rank, howmany_dims, * _in, _out, */ __pyx_r = ((void *)fftw_plan_guru_dft_r2c(__pyx_v_rank, __pyx_v_dims, __pyx_v_howmany_rank, __pyx_v_howmany_dims, ((double *)__pyx_v__in), ((cdouble *)__pyx_v__out), __pyx_v_flags)); goto __pyx_L0; /* "pyfftw/pyfftw.pyx":121 * * # real to complex double precision * cdef void* _fftw_plan_guru_dft_r2c( # <<<<<<<<<<<<<< * int rank, fftw_iodim *dims, * int howmany_rank, fftw_iodim *howmany_dims, */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "pyfftw/pyfftw.pyx":133 * * # real to complex single precision * cdef void* _fftwf_plan_guru_dft_r2c( # <<<<<<<<<<<<<< * int rank, fftw_iodim *dims, * int howmany_rank, fftw_iodim *howmany_dims, */ static void *__pyx_f_6pyfftw_6pyfftw__fftwf_plan_guru_dft_r2c(int __pyx_v_rank, fftw_iodim *__pyx_v_dims, int __pyx_v_howmany_rank, fftw_iodim *__pyx_v_howmany_dims, void *__pyx_v__in, void *__pyx_v__out, CYTHON_UNUSED int __pyx_v_sign, unsigned int __pyx_v_flags) { void *__pyx_r; /* "pyfftw/pyfftw.pyx":139 * int sign, unsigned flags) nogil: * * return fftwf_plan_guru_dft_r2c(rank, dims, # <<<<<<<<<<<<<< * howmany_rank, howmany_dims, * _in, _out, */ __pyx_r = ((void *)fftwf_plan_guru_dft_r2c(__pyx_v_rank, __pyx_v_dims, __pyx_v_howmany_rank, __pyx_v_howmany_dims, ((float *)__pyx_v__in), ((cfloat *)__pyx_v__out), __pyx_v_flags)); goto __pyx_L0; /* "pyfftw/pyfftw.pyx":133 * * # real to complex single precision * cdef void* _fftwf_plan_guru_dft_r2c( # <<<<<<<<<<<<<< * int rank, fftw_iodim *dims, * int howmany_rank, fftw_iodim *howmany_dims, */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "pyfftw/pyfftw.pyx":145 * * # real to complex long double precision * cdef void* _fftwl_plan_guru_dft_r2c( # <<<<<<<<<<<<<< * int rank, fftw_iodim *dims, * int howmany_rank, fftw_iodim *howmany_dims, */ static void *__pyx_f_6pyfftw_6pyfftw__fftwl_plan_guru_dft_r2c(int __pyx_v_rank, fftw_iodim *__pyx_v_dims, int __pyx_v_howmany_rank, fftw_iodim *__pyx_v_howmany_dims, void *__pyx_v__in, void *__pyx_v__out, CYTHON_UNUSED int __pyx_v_sign, unsigned int __pyx_v_flags) { void *__pyx_r; /* "pyfftw/pyfftw.pyx":151 * int sign, unsigned flags) nogil: * * return fftwl_plan_guru_dft_r2c(rank, dims, # <<<<<<<<<<<<<< * howmany_rank, howmany_dims, * _in, _out, */ __pyx_r = ((void *)fftwl_plan_guru_dft_r2c(__pyx_v_rank, __pyx_v_dims, __pyx_v_howmany_rank, __pyx_v_howmany_dims, ((long double *)__pyx_v__in), ((clongdouble *)__pyx_v__out), __pyx_v_flags)); goto __pyx_L0; /* "pyfftw/pyfftw.pyx":145 * * # real to complex long double precision * cdef void* _fftwl_plan_guru_dft_r2c( # <<<<<<<<<<<<<< * int rank, fftw_iodim *dims, * int howmany_rank, fftw_iodim *howmany_dims, */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "pyfftw/pyfftw.pyx":157 * * # complex to real double precision * cdef void* _fftw_plan_guru_dft_c2r( # <<<<<<<<<<<<<< * int rank, fftw_iodim *dims, * int howmany_rank, fftw_iodim *howmany_dims, */ static void *__pyx_f_6pyfftw_6pyfftw__fftw_plan_guru_dft_c2r(int __pyx_v_rank, fftw_iodim *__pyx_v_dims, int __pyx_v_howmany_rank, fftw_iodim *__pyx_v_howmany_dims, void *__pyx_v__in, void *__pyx_v__out, CYTHON_UNUSED int __pyx_v_sign, unsigned int __pyx_v_flags) { void *__pyx_r; /* "pyfftw/pyfftw.pyx":163 * int sign, unsigned flags) nogil: * * return fftw_plan_guru_dft_c2r(rank, dims, # <<<<<<<<<<<<<< * howmany_rank, howmany_dims, * _in, _out, */ __pyx_r = ((void *)fftw_plan_guru_dft_c2r(__pyx_v_rank, __pyx_v_dims, __pyx_v_howmany_rank, __pyx_v_howmany_dims, ((cdouble *)__pyx_v__in), ((double *)__pyx_v__out), __pyx_v_flags)); goto __pyx_L0; /* "pyfftw/pyfftw.pyx":157 * * # complex to real double precision * cdef void* _fftw_plan_guru_dft_c2r( # <<<<<<<<<<<<<< * int rank, fftw_iodim *dims, * int howmany_rank, fftw_iodim *howmany_dims, */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "pyfftw/pyfftw.pyx":169 * * # complex to real single precision * cdef void* _fftwf_plan_guru_dft_c2r( # <<<<<<<<<<<<<< * int rank, fftw_iodim *dims, * int howmany_rank, fftw_iodim *howmany_dims, */ static void *__pyx_f_6pyfftw_6pyfftw__fftwf_plan_guru_dft_c2r(int __pyx_v_rank, fftw_iodim *__pyx_v_dims, int __pyx_v_howmany_rank, fftw_iodim *__pyx_v_howmany_dims, void *__pyx_v__in, void *__pyx_v__out, CYTHON_UNUSED int __pyx_v_sign, unsigned int __pyx_v_flags) { void *__pyx_r; /* "pyfftw/pyfftw.pyx":175 * int sign, unsigned flags) nogil: * * return fftwf_plan_guru_dft_c2r(rank, dims, # <<<<<<<<<<<<<< * howmany_rank, howmany_dims, * _in, _out, */ __pyx_r = ((void *)fftwf_plan_guru_dft_c2r(__pyx_v_rank, __pyx_v_dims, __pyx_v_howmany_rank, __pyx_v_howmany_dims, ((cfloat *)__pyx_v__in), ((float *)__pyx_v__out), __pyx_v_flags)); goto __pyx_L0; /* "pyfftw/pyfftw.pyx":169 * * # complex to real single precision * cdef void* _fftwf_plan_guru_dft_c2r( # <<<<<<<<<<<<<< * int rank, fftw_iodim *dims, * int howmany_rank, fftw_iodim *howmany_dims, */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "pyfftw/pyfftw.pyx":181 * * # complex to real long double precision * cdef void* _fftwl_plan_guru_dft_c2r( # <<<<<<<<<<<<<< * int rank, fftw_iodim *dims, * int howmany_rank, fftw_iodim *howmany_dims, */ static void *__pyx_f_6pyfftw_6pyfftw__fftwl_plan_guru_dft_c2r(int __pyx_v_rank, fftw_iodim *__pyx_v_dims, int __pyx_v_howmany_rank, fftw_iodim *__pyx_v_howmany_dims, void *__pyx_v__in, void *__pyx_v__out, CYTHON_UNUSED int __pyx_v_sign, unsigned int __pyx_v_flags) { void *__pyx_r; /* "pyfftw/pyfftw.pyx":187 * int sign, unsigned flags) nogil: * * return fftwl_plan_guru_dft_c2r(rank, dims, # <<<<<<<<<<<<<< * howmany_rank, howmany_dims, * _in, _out, */ __pyx_r = ((void *)fftwl_plan_guru_dft_c2r(__pyx_v_rank, __pyx_v_dims, __pyx_v_howmany_rank, __pyx_v_howmany_dims, ((clongdouble *)__pyx_v__in), ((long double *)__pyx_v__out), __pyx_v_flags)); goto __pyx_L0; /* "pyfftw/pyfftw.pyx":181 * * # complex to real long double precision * cdef void* _fftwl_plan_guru_dft_c2r( # <<<<<<<<<<<<<< * int rank, fftw_iodim *dims, * int howmany_rank, fftw_iodim *howmany_dims, */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "pyfftw/pyfftw.pyx":196 * # * # Complex double precision * cdef void _fftw_execute_dft(void *_plan, void *_in, void *_out) nogil: # <<<<<<<<<<<<<< * * fftw_execute_dft(_plan, */ static void __pyx_f_6pyfftw_6pyfftw__fftw_execute_dft(void *__pyx_v__plan, void *__pyx_v__in, void *__pyx_v__out) { /* "pyfftw/pyfftw.pyx":198 * cdef void _fftw_execute_dft(void *_plan, void *_in, void *_out) nogil: * * fftw_execute_dft(_plan, # <<<<<<<<<<<<<< * _in, _out) * */ fftw_execute_dft(((fftw_plan)__pyx_v__plan), ((cdouble *)__pyx_v__in), ((cdouble *)__pyx_v__out)); /* "pyfftw/pyfftw.pyx":196 * # * # Complex double precision * cdef void _fftw_execute_dft(void *_plan, void *_in, void *_out) nogil: # <<<<<<<<<<<<<< * * fftw_execute_dft(_plan, */ /* function exit code */ } /* "pyfftw/pyfftw.pyx":202 * * # Complex single precision * cdef void _fftwf_execute_dft(void *_plan, void *_in, void *_out) nogil: # <<<<<<<<<<<<<< * * fftwf_execute_dft(_plan, */ static void __pyx_f_6pyfftw_6pyfftw__fftwf_execute_dft(void *__pyx_v__plan, void *__pyx_v__in, void *__pyx_v__out) { /* "pyfftw/pyfftw.pyx":204 * cdef void _fftwf_execute_dft(void *_plan, void *_in, void *_out) nogil: * * fftwf_execute_dft(_plan, # <<<<<<<<<<<<<< * _in, _out) * */ fftwf_execute_dft(((fftwf_plan)__pyx_v__plan), ((cfloat *)__pyx_v__in), ((cfloat *)__pyx_v__out)); /* "pyfftw/pyfftw.pyx":202 * * # Complex single precision * cdef void _fftwf_execute_dft(void *_plan, void *_in, void *_out) nogil: # <<<<<<<<<<<<<< * * fftwf_execute_dft(_plan, */ /* function exit code */ } /* "pyfftw/pyfftw.pyx":208 * * # Complex long double precision * cdef void _fftwl_execute_dft(void *_plan, void *_in, void *_out) nogil: # <<<<<<<<<<<<<< * * fftwl_execute_dft(_plan, */ static void __pyx_f_6pyfftw_6pyfftw__fftwl_execute_dft(void *__pyx_v__plan, void *__pyx_v__in, void *__pyx_v__out) { /* "pyfftw/pyfftw.pyx":210 * cdef void _fftwl_execute_dft(void *_plan, void *_in, void *_out) nogil: * * fftwl_execute_dft(_plan, # <<<<<<<<<<<<<< * _in, _out) * */ fftwl_execute_dft(((fftwl_plan)__pyx_v__plan), ((clongdouble *)__pyx_v__in), ((clongdouble *)__pyx_v__out)); /* "pyfftw/pyfftw.pyx":208 * * # Complex long double precision * cdef void _fftwl_execute_dft(void *_plan, void *_in, void *_out) nogil: # <<<<<<<<<<<<<< * * fftwl_execute_dft(_plan, */ /* function exit code */ } /* "pyfftw/pyfftw.pyx":214 * * # real to complex double precision * cdef void _fftw_execute_dft_r2c(void *_plan, void *_in, void *_out) nogil: # <<<<<<<<<<<<<< * * fftw_execute_dft_r2c(_plan, */ static void __pyx_f_6pyfftw_6pyfftw__fftw_execute_dft_r2c(void *__pyx_v__plan, void *__pyx_v__in, void *__pyx_v__out) { /* "pyfftw/pyfftw.pyx":216 * cdef void _fftw_execute_dft_r2c(void *_plan, void *_in, void *_out) nogil: * * fftw_execute_dft_r2c(_plan, # <<<<<<<<<<<<<< * _in, _out) * */ fftw_execute_dft_r2c(((fftw_plan)__pyx_v__plan), ((double *)__pyx_v__in), ((cdouble *)__pyx_v__out)); /* "pyfftw/pyfftw.pyx":214 * * # real to complex double precision * cdef void _fftw_execute_dft_r2c(void *_plan, void *_in, void *_out) nogil: # <<<<<<<<<<<<<< * * fftw_execute_dft_r2c(_plan, */ /* function exit code */ } /* "pyfftw/pyfftw.pyx":220 * * # real to complex single precision * cdef void _fftwf_execute_dft_r2c(void *_plan, void *_in, void *_out) nogil: # <<<<<<<<<<<<<< * * fftwf_execute_dft_r2c(_plan, */ static void __pyx_f_6pyfftw_6pyfftw__fftwf_execute_dft_r2c(void *__pyx_v__plan, void *__pyx_v__in, void *__pyx_v__out) { /* "pyfftw/pyfftw.pyx":222 * cdef void _fftwf_execute_dft_r2c(void *_plan, void *_in, void *_out) nogil: * * fftwf_execute_dft_r2c(_plan, # <<<<<<<<<<<<<< * _in, _out) * */ fftwf_execute_dft_r2c(((fftwf_plan)__pyx_v__plan), ((float *)__pyx_v__in), ((cfloat *)__pyx_v__out)); /* "pyfftw/pyfftw.pyx":220 * * # real to complex single precision * cdef void _fftwf_execute_dft_r2c(void *_plan, void *_in, void *_out) nogil: # <<<<<<<<<<<<<< * * fftwf_execute_dft_r2c(_plan, */ /* function exit code */ } /* "pyfftw/pyfftw.pyx":226 * * # real to complex long double precision * cdef void _fftwl_execute_dft_r2c(void *_plan, void *_in, void *_out) nogil: # <<<<<<<<<<<<<< * * fftwl_execute_dft_r2c(_plan, */ static void __pyx_f_6pyfftw_6pyfftw__fftwl_execute_dft_r2c(void *__pyx_v__plan, void *__pyx_v__in, void *__pyx_v__out) { /* "pyfftw/pyfftw.pyx":228 * cdef void _fftwl_execute_dft_r2c(void *_plan, void *_in, void *_out) nogil: * * fftwl_execute_dft_r2c(_plan, # <<<<<<<<<<<<<< * _in, _out) * */ fftwl_execute_dft_r2c(((fftwl_plan)__pyx_v__plan), ((long double *)__pyx_v__in), ((clongdouble *)__pyx_v__out)); /* "pyfftw/pyfftw.pyx":226 * * # real to complex long double precision * cdef void _fftwl_execute_dft_r2c(void *_plan, void *_in, void *_out) nogil: # <<<<<<<<<<<<<< * * fftwl_execute_dft_r2c(_plan, */ /* function exit code */ } /* "pyfftw/pyfftw.pyx":232 * * # complex to real double precision * cdef void _fftw_execute_dft_c2r(void *_plan, void *_in, void *_out) nogil: # <<<<<<<<<<<<<< * * fftw_execute_dft_c2r(_plan, */ static void __pyx_f_6pyfftw_6pyfftw__fftw_execute_dft_c2r(void *__pyx_v__plan, void *__pyx_v__in, void *__pyx_v__out) { /* "pyfftw/pyfftw.pyx":234 * cdef void _fftw_execute_dft_c2r(void *_plan, void *_in, void *_out) nogil: * * fftw_execute_dft_c2r(_plan, # <<<<<<<<<<<<<< * _in, _out) * */ fftw_execute_dft_c2r(((fftw_plan)__pyx_v__plan), ((cdouble *)__pyx_v__in), ((double *)__pyx_v__out)); /* "pyfftw/pyfftw.pyx":232 * * # complex to real double precision * cdef void _fftw_execute_dft_c2r(void *_plan, void *_in, void *_out) nogil: # <<<<<<<<<<<<<< * * fftw_execute_dft_c2r(_plan, */ /* function exit code */ } /* "pyfftw/pyfftw.pyx":238 * * # complex to real single precision * cdef void _fftwf_execute_dft_c2r(void *_plan, void *_in, void *_out) nogil: # <<<<<<<<<<<<<< * * fftwf_execute_dft_c2r(_plan, */ static void __pyx_f_6pyfftw_6pyfftw__fftwf_execute_dft_c2r(void *__pyx_v__plan, void *__pyx_v__in, void *__pyx_v__out) { /* "pyfftw/pyfftw.pyx":240 * cdef void _fftwf_execute_dft_c2r(void *_plan, void *_in, void *_out) nogil: * * fftwf_execute_dft_c2r(_plan, # <<<<<<<<<<<<<< * _in, _out) * */ fftwf_execute_dft_c2r(((fftwf_plan)__pyx_v__plan), ((cfloat *)__pyx_v__in), ((float *)__pyx_v__out)); /* "pyfftw/pyfftw.pyx":238 * * # complex to real single precision * cdef void _fftwf_execute_dft_c2r(void *_plan, void *_in, void *_out) nogil: # <<<<<<<<<<<<<< * * fftwf_execute_dft_c2r(_plan, */ /* function exit code */ } /* "pyfftw/pyfftw.pyx":244 * * # complex to real long double precision * cdef void _fftwl_execute_dft_c2r(void *_plan, void *_in, void *_out) nogil: # <<<<<<<<<<<<<< * * fftwl_execute_dft_c2r(_plan, */ static void __pyx_f_6pyfftw_6pyfftw__fftwl_execute_dft_c2r(void *__pyx_v__plan, void *__pyx_v__in, void *__pyx_v__out) { /* "pyfftw/pyfftw.pyx":246 * cdef void _fftwl_execute_dft_c2r(void *_plan, void *_in, void *_out) nogil: * * fftwl_execute_dft_c2r(_plan, # <<<<<<<<<<<<<< * _in, _out) * */ fftwl_execute_dft_c2r(((fftwl_plan)__pyx_v__plan), ((clongdouble *)__pyx_v__in), ((long double *)__pyx_v__out)); /* "pyfftw/pyfftw.pyx":244 * * # complex to real long double precision * cdef void _fftwl_execute_dft_c2r(void *_plan, void *_in, void *_out) nogil: # <<<<<<<<<<<<<< * * fftwl_execute_dft_c2r(_plan, */ /* function exit code */ } /* "pyfftw/pyfftw.pyx":253 * # * # Double precision * cdef void _fftw_destroy_plan(void *_plan): # <<<<<<<<<<<<<< * * fftw_destroy_plan(_plan) */ static void __pyx_f_6pyfftw_6pyfftw__fftw_destroy_plan(void *__pyx_v__plan) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_fftw_destroy_plan", 0); /* "pyfftw/pyfftw.pyx":255 * cdef void _fftw_destroy_plan(void *_plan): * * fftw_destroy_plan(_plan) # <<<<<<<<<<<<<< * * # Single precision */ fftw_destroy_plan(((fftw_plan)__pyx_v__plan)); /* "pyfftw/pyfftw.pyx":253 * # * # Double precision * cdef void _fftw_destroy_plan(void *_plan): # <<<<<<<<<<<<<< * * fftw_destroy_plan(_plan) */ /* function exit code */ __Pyx_RefNannyFinishContext(); } /* "pyfftw/pyfftw.pyx":258 * * # Single precision * cdef void _fftwf_destroy_plan(void *_plan): # <<<<<<<<<<<<<< * * fftwf_destroy_plan(_plan) */ static void __pyx_f_6pyfftw_6pyfftw__fftwf_destroy_plan(void *__pyx_v__plan) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_fftwf_destroy_plan", 0); /* "pyfftw/pyfftw.pyx":260 * cdef void _fftwf_destroy_plan(void *_plan): * * fftwf_destroy_plan(_plan) # <<<<<<<<<<<<<< * * # Long double precision */ fftwf_destroy_plan(((fftwf_plan)__pyx_v__plan)); /* "pyfftw/pyfftw.pyx":258 * * # Single precision * cdef void _fftwf_destroy_plan(void *_plan): # <<<<<<<<<<<<<< * * fftwf_destroy_plan(_plan) */ /* function exit code */ __Pyx_RefNannyFinishContext(); } /* "pyfftw/pyfftw.pyx":263 * * # Long double precision * cdef void _fftwl_destroy_plan(void *_plan): # <<<<<<<<<<<<<< * * fftwl_destroy_plan(_plan) */ static void __pyx_f_6pyfftw_6pyfftw__fftwl_destroy_plan(void *__pyx_v__plan) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_fftwl_destroy_plan", 0); /* "pyfftw/pyfftw.pyx":265 * cdef void _fftwl_destroy_plan(void *_plan): * * fftwl_destroy_plan(_plan) # <<<<<<<<<<<<<< * * */ fftwl_destroy_plan(((fftwl_plan)__pyx_v__plan)); /* "pyfftw/pyfftw.pyx":263 * * # Long double precision * cdef void _fftwl_destroy_plan(void *_plan): # <<<<<<<<<<<<<< * * fftwl_destroy_plan(_plan) */ /* function exit code */ __Pyx_RefNannyFinishContext(); } /* "pyfftw/pyfftw.pyx":274 * cdef fftw_generic_plan_guru planners[9] * * cdef fftw_generic_plan_guru * _build_planner_list(): # <<<<<<<<<<<<<< * * planners[0] = &_fftw_plan_guru_dft */ static __pyx_t_6pyfftw_6pyfftw_fftw_generic_plan_guru *__pyx_f_6pyfftw_6pyfftw__build_planner_list(void) { __pyx_t_6pyfftw_6pyfftw_fftw_generic_plan_guru *__pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_build_planner_list", 0); /* "pyfftw/pyfftw.pyx":276 * cdef fftw_generic_plan_guru * _build_planner_list(): * * planners[0] = &_fftw_plan_guru_dft # <<<<<<<<<<<<<< * planners[1] = &_fftwf_plan_guru_dft * planners[2] = &_fftwl_plan_guru_dft */ (__pyx_v_6pyfftw_6pyfftw_planners[0]) = ((__pyx_t_6pyfftw_6pyfftw_fftw_generic_plan_guru)(&__pyx_f_6pyfftw_6pyfftw__fftw_plan_guru_dft)); /* "pyfftw/pyfftw.pyx":277 * * planners[0] = &_fftw_plan_guru_dft * planners[1] = &_fftwf_plan_guru_dft # <<<<<<<<<<<<<< * planners[2] = &_fftwl_plan_guru_dft * planners[3] = &_fftw_plan_guru_dft_r2c */ (__pyx_v_6pyfftw_6pyfftw_planners[1]) = ((__pyx_t_6pyfftw_6pyfftw_fftw_generic_plan_guru)(&__pyx_f_6pyfftw_6pyfftw__fftwf_plan_guru_dft)); /* "pyfftw/pyfftw.pyx":278 * planners[0] = &_fftw_plan_guru_dft * planners[1] = &_fftwf_plan_guru_dft * planners[2] = &_fftwl_plan_guru_dft # <<<<<<<<<<<<<< * planners[3] = &_fftw_plan_guru_dft_r2c * planners[4] = &_fftwf_plan_guru_dft_r2c */ (__pyx_v_6pyfftw_6pyfftw_planners[2]) = ((__pyx_t_6pyfftw_6pyfftw_fftw_generic_plan_guru)(&__pyx_f_6pyfftw_6pyfftw__fftwl_plan_guru_dft)); /* "pyfftw/pyfftw.pyx":279 * planners[1] = &_fftwf_plan_guru_dft * planners[2] = &_fftwl_plan_guru_dft * planners[3] = &_fftw_plan_guru_dft_r2c # <<<<<<<<<<<<<< * planners[4] = &_fftwf_plan_guru_dft_r2c * planners[5] = &_fftwl_plan_guru_dft_r2c */ (__pyx_v_6pyfftw_6pyfftw_planners[3]) = ((__pyx_t_6pyfftw_6pyfftw_fftw_generic_plan_guru)(&__pyx_f_6pyfftw_6pyfftw__fftw_plan_guru_dft_r2c)); /* "pyfftw/pyfftw.pyx":280 * planners[2] = &_fftwl_plan_guru_dft * planners[3] = &_fftw_plan_guru_dft_r2c * planners[4] = &_fftwf_plan_guru_dft_r2c # <<<<<<<<<<<<<< * planners[5] = &_fftwl_plan_guru_dft_r2c * planners[6] = &_fftw_plan_guru_dft_c2r */ (__pyx_v_6pyfftw_6pyfftw_planners[4]) = ((__pyx_t_6pyfftw_6pyfftw_fftw_generic_plan_guru)(&__pyx_f_6pyfftw_6pyfftw__fftwf_plan_guru_dft_r2c)); /* "pyfftw/pyfftw.pyx":281 * planners[3] = &_fftw_plan_guru_dft_r2c * planners[4] = &_fftwf_plan_guru_dft_r2c * planners[5] = &_fftwl_plan_guru_dft_r2c # <<<<<<<<<<<<<< * planners[6] = &_fftw_plan_guru_dft_c2r * planners[7] = &_fftwf_plan_guru_dft_c2r */ (__pyx_v_6pyfftw_6pyfftw_planners[5]) = ((__pyx_t_6pyfftw_6pyfftw_fftw_generic_plan_guru)(&__pyx_f_6pyfftw_6pyfftw__fftwl_plan_guru_dft_r2c)); /* "pyfftw/pyfftw.pyx":282 * planners[4] = &_fftwf_plan_guru_dft_r2c * planners[5] = &_fftwl_plan_guru_dft_r2c * planners[6] = &_fftw_plan_guru_dft_c2r # <<<<<<<<<<<<<< * planners[7] = &_fftwf_plan_guru_dft_c2r * planners[8] = &_fftwl_plan_guru_dft_c2r */ (__pyx_v_6pyfftw_6pyfftw_planners[6]) = ((__pyx_t_6pyfftw_6pyfftw_fftw_generic_plan_guru)(&__pyx_f_6pyfftw_6pyfftw__fftw_plan_guru_dft_c2r)); /* "pyfftw/pyfftw.pyx":283 * planners[5] = &_fftwl_plan_guru_dft_r2c * planners[6] = &_fftw_plan_guru_dft_c2r * planners[7] = &_fftwf_plan_guru_dft_c2r # <<<<<<<<<<<<<< * planners[8] = &_fftwl_plan_guru_dft_c2r * */ (__pyx_v_6pyfftw_6pyfftw_planners[7]) = ((__pyx_t_6pyfftw_6pyfftw_fftw_generic_plan_guru)(&__pyx_f_6pyfftw_6pyfftw__fftwf_plan_guru_dft_c2r)); /* "pyfftw/pyfftw.pyx":284 * planners[6] = &_fftw_plan_guru_dft_c2r * planners[7] = &_fftwf_plan_guru_dft_c2r * planners[8] = &_fftwl_plan_guru_dft_c2r # <<<<<<<<<<<<<< * * # Executor table (of size the number of executors) */ (__pyx_v_6pyfftw_6pyfftw_planners[8]) = ((__pyx_t_6pyfftw_6pyfftw_fftw_generic_plan_guru)(&__pyx_f_6pyfftw_6pyfftw__fftwl_plan_guru_dft_c2r)); /* "pyfftw/pyfftw.pyx":274 * cdef fftw_generic_plan_guru planners[9] * * cdef fftw_generic_plan_guru * _build_planner_list(): # <<<<<<<<<<<<<< * * planners[0] = &_fftw_plan_guru_dft */ /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pyfftw/pyfftw.pyx":289 * cdef fftw_generic_execute executors[9] * * cdef fftw_generic_execute * _build_executor_list(): # <<<<<<<<<<<<<< * * executors[0] = &_fftw_execute_dft */ static __pyx_t_6pyfftw_6pyfftw_fftw_generic_execute *__pyx_f_6pyfftw_6pyfftw__build_executor_list(void) { __pyx_t_6pyfftw_6pyfftw_fftw_generic_execute *__pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_build_executor_list", 0); /* "pyfftw/pyfftw.pyx":291 * cdef fftw_generic_execute * _build_executor_list(): * * executors[0] = &_fftw_execute_dft # <<<<<<<<<<<<<< * executors[1] = &_fftwf_execute_dft * executors[2] = &_fftwl_execute_dft */ (__pyx_v_6pyfftw_6pyfftw_executors[0]) = ((__pyx_t_6pyfftw_6pyfftw_fftw_generic_execute)(&__pyx_f_6pyfftw_6pyfftw__fftw_execute_dft)); /* "pyfftw/pyfftw.pyx":292 * * executors[0] = &_fftw_execute_dft * executors[1] = &_fftwf_execute_dft # <<<<<<<<<<<<<< * executors[2] = &_fftwl_execute_dft * executors[3] = &_fftw_execute_dft_r2c */ (__pyx_v_6pyfftw_6pyfftw_executors[1]) = ((__pyx_t_6pyfftw_6pyfftw_fftw_generic_execute)(&__pyx_f_6pyfftw_6pyfftw__fftwf_execute_dft)); /* "pyfftw/pyfftw.pyx":293 * executors[0] = &_fftw_execute_dft * executors[1] = &_fftwf_execute_dft * executors[2] = &_fftwl_execute_dft # <<<<<<<<<<<<<< * executors[3] = &_fftw_execute_dft_r2c * executors[4] = &_fftwf_execute_dft_r2c */ (__pyx_v_6pyfftw_6pyfftw_executors[2]) = ((__pyx_t_6pyfftw_6pyfftw_fftw_generic_execute)(&__pyx_f_6pyfftw_6pyfftw__fftwl_execute_dft)); /* "pyfftw/pyfftw.pyx":294 * executors[1] = &_fftwf_execute_dft * executors[2] = &_fftwl_execute_dft * executors[3] = &_fftw_execute_dft_r2c # <<<<<<<<<<<<<< * executors[4] = &_fftwf_execute_dft_r2c * executors[5] = &_fftwl_execute_dft_r2c */ (__pyx_v_6pyfftw_6pyfftw_executors[3]) = ((__pyx_t_6pyfftw_6pyfftw_fftw_generic_execute)(&__pyx_f_6pyfftw_6pyfftw__fftw_execute_dft_r2c)); /* "pyfftw/pyfftw.pyx":295 * executors[2] = &_fftwl_execute_dft * executors[3] = &_fftw_execute_dft_r2c * executors[4] = &_fftwf_execute_dft_r2c # <<<<<<<<<<<<<< * executors[5] = &_fftwl_execute_dft_r2c * executors[6] = &_fftw_execute_dft_c2r */ (__pyx_v_6pyfftw_6pyfftw_executors[4]) = ((__pyx_t_6pyfftw_6pyfftw_fftw_generic_execute)(&__pyx_f_6pyfftw_6pyfftw__fftwf_execute_dft_r2c)); /* "pyfftw/pyfftw.pyx":296 * executors[3] = &_fftw_execute_dft_r2c * executors[4] = &_fftwf_execute_dft_r2c * executors[5] = &_fftwl_execute_dft_r2c # <<<<<<<<<<<<<< * executors[6] = &_fftw_execute_dft_c2r * executors[7] = &_fftwf_execute_dft_c2r */ (__pyx_v_6pyfftw_6pyfftw_executors[5]) = ((__pyx_t_6pyfftw_6pyfftw_fftw_generic_execute)(&__pyx_f_6pyfftw_6pyfftw__fftwl_execute_dft_r2c)); /* "pyfftw/pyfftw.pyx":297 * executors[4] = &_fftwf_execute_dft_r2c * executors[5] = &_fftwl_execute_dft_r2c * executors[6] = &_fftw_execute_dft_c2r # <<<<<<<<<<<<<< * executors[7] = &_fftwf_execute_dft_c2r * executors[8] = &_fftwl_execute_dft_c2r */ (__pyx_v_6pyfftw_6pyfftw_executors[6]) = ((__pyx_t_6pyfftw_6pyfftw_fftw_generic_execute)(&__pyx_f_6pyfftw_6pyfftw__fftw_execute_dft_c2r)); /* "pyfftw/pyfftw.pyx":298 * executors[5] = &_fftwl_execute_dft_r2c * executors[6] = &_fftw_execute_dft_c2r * executors[7] = &_fftwf_execute_dft_c2r # <<<<<<<<<<<<<< * executors[8] = &_fftwl_execute_dft_c2r * */ (__pyx_v_6pyfftw_6pyfftw_executors[7]) = ((__pyx_t_6pyfftw_6pyfftw_fftw_generic_execute)(&__pyx_f_6pyfftw_6pyfftw__fftwf_execute_dft_c2r)); /* "pyfftw/pyfftw.pyx":299 * executors[6] = &_fftw_execute_dft_c2r * executors[7] = &_fftwf_execute_dft_c2r * executors[8] = &_fftwl_execute_dft_c2r # <<<<<<<<<<<<<< * * # Destroyer table (of size the number of destroyers) */ (__pyx_v_6pyfftw_6pyfftw_executors[8]) = ((__pyx_t_6pyfftw_6pyfftw_fftw_generic_execute)(&__pyx_f_6pyfftw_6pyfftw__fftwl_execute_dft_c2r)); /* "pyfftw/pyfftw.pyx":289 * cdef fftw_generic_execute executors[9] * * cdef fftw_generic_execute * _build_executor_list(): # <<<<<<<<<<<<<< * * executors[0] = &_fftw_execute_dft */ /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pyfftw/pyfftw.pyx":304 * cdef fftw_generic_destroy_plan destroyers[3] * * cdef fftw_generic_destroy_plan * _build_destroyer_list(): # <<<<<<<<<<<<<< * * destroyers[0] = &_fftw_destroy_plan */ static __pyx_t_6pyfftw_6pyfftw_fftw_generic_destroy_plan *__pyx_f_6pyfftw_6pyfftw__build_destroyer_list(void) { __pyx_t_6pyfftw_6pyfftw_fftw_generic_destroy_plan *__pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_build_destroyer_list", 0); /* "pyfftw/pyfftw.pyx":306 * cdef fftw_generic_destroy_plan * _build_destroyer_list(): * * destroyers[0] = &_fftw_destroy_plan # <<<<<<<<<<<<<< * destroyers[1] = &_fftwf_destroy_plan * destroyers[2] = &_fftwl_destroy_plan */ (__pyx_v_6pyfftw_6pyfftw_destroyers[0]) = ((__pyx_t_6pyfftw_6pyfftw_fftw_generic_destroy_plan)(&__pyx_f_6pyfftw_6pyfftw__fftw_destroy_plan)); /* "pyfftw/pyfftw.pyx":307 * * destroyers[0] = &_fftw_destroy_plan * destroyers[1] = &_fftwf_destroy_plan # <<<<<<<<<<<<<< * destroyers[2] = &_fftwl_destroy_plan * */ (__pyx_v_6pyfftw_6pyfftw_destroyers[1]) = ((__pyx_t_6pyfftw_6pyfftw_fftw_generic_destroy_plan)(&__pyx_f_6pyfftw_6pyfftw__fftwf_destroy_plan)); /* "pyfftw/pyfftw.pyx":308 * destroyers[0] = &_fftw_destroy_plan * destroyers[1] = &_fftwf_destroy_plan * destroyers[2] = &_fftwl_destroy_plan # <<<<<<<<<<<<<< * * */ (__pyx_v_6pyfftw_6pyfftw_destroyers[2]) = ((__pyx_t_6pyfftw_6pyfftw_fftw_generic_destroy_plan)(&__pyx_f_6pyfftw_6pyfftw__fftwl_destroy_plan)); /* "pyfftw/pyfftw.pyx":304 * cdef fftw_generic_destroy_plan destroyers[3] * * cdef fftw_generic_destroy_plan * _build_destroyer_list(): # <<<<<<<<<<<<<< * * destroyers[0] = &_fftw_destroy_plan */ /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pyfftw/pyfftw.pyx":314 * cdef fftw_generic_plan_with_nthreads nthreads_plan_setters[3] * * cdef fftw_generic_plan_with_nthreads * _build_nthreads_plan_setters_list(): # <<<<<<<<<<<<<< * nthreads_plan_setters[0] = ( * &fftw_plan_with_nthreads) */ static __pyx_t_6pyfftw_6pyfftw_fftw_generic_plan_with_nthreads *__pyx_f_6pyfftw_6pyfftw__build_nthreads_plan_setters_list(void) { __pyx_t_6pyfftw_6pyfftw_fftw_generic_plan_with_nthreads *__pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_build_nthreads_plan_setters_list", 0); /* "pyfftw/pyfftw.pyx":315 * * cdef fftw_generic_plan_with_nthreads * _build_nthreads_plan_setters_list(): * nthreads_plan_setters[0] = ( # <<<<<<<<<<<<<< * &fftw_plan_with_nthreads) * nthreads_plan_setters[1] = ( */ (__pyx_v_6pyfftw_6pyfftw_nthreads_plan_setters[0]) = ((__pyx_t_6pyfftw_6pyfftw_fftw_generic_plan_with_nthreads)(&fftw_plan_with_nthreads)); /* "pyfftw/pyfftw.pyx":317 * nthreads_plan_setters[0] = ( * &fftw_plan_with_nthreads) * nthreads_plan_setters[1] = ( # <<<<<<<<<<<<<< * &fftwf_plan_with_nthreads) * nthreads_plan_setters[2] = ( */ (__pyx_v_6pyfftw_6pyfftw_nthreads_plan_setters[1]) = ((__pyx_t_6pyfftw_6pyfftw_fftw_generic_plan_with_nthreads)(&fftwf_plan_with_nthreads)); /* "pyfftw/pyfftw.pyx":319 * nthreads_plan_setters[1] = ( * &fftwf_plan_with_nthreads) * nthreads_plan_setters[2] = ( # <<<<<<<<<<<<<< * &fftwl_plan_with_nthreads) * */ (__pyx_v_6pyfftw_6pyfftw_nthreads_plan_setters[2]) = ((__pyx_t_6pyfftw_6pyfftw_fftw_generic_plan_with_nthreads)(&fftwl_plan_with_nthreads)); /* "pyfftw/pyfftw.pyx":314 * cdef fftw_generic_plan_with_nthreads nthreads_plan_setters[3] * * cdef fftw_generic_plan_with_nthreads * _build_nthreads_plan_setters_list(): # <<<<<<<<<<<<<< * nthreads_plan_setters[0] = ( * &fftw_plan_with_nthreads) */ /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pyfftw/pyfftw.pyx":325 * cdef fftw_generic_set_timelimit set_timelimit_funcs[3] * * cdef fftw_generic_set_timelimit * _build_set_timelimit_funcs_list(): # <<<<<<<<<<<<<< * set_timelimit_funcs[0] = ( * &fftw_set_timelimit) */ static __pyx_t_6pyfftw_6pyfftw_fftw_generic_set_timelimit *__pyx_f_6pyfftw_6pyfftw__build_set_timelimit_funcs_list(void) { __pyx_t_6pyfftw_6pyfftw_fftw_generic_set_timelimit *__pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_build_set_timelimit_funcs_list", 0); /* "pyfftw/pyfftw.pyx":326 * * cdef fftw_generic_set_timelimit * _build_set_timelimit_funcs_list(): * set_timelimit_funcs[0] = ( # <<<<<<<<<<<<<< * &fftw_set_timelimit) * set_timelimit_funcs[1] = ( */ (__pyx_v_6pyfftw_6pyfftw_set_timelimit_funcs[0]) = ((__pyx_t_6pyfftw_6pyfftw_fftw_generic_set_timelimit)(&fftw_set_timelimit)); /* "pyfftw/pyfftw.pyx":328 * set_timelimit_funcs[0] = ( * &fftw_set_timelimit) * set_timelimit_funcs[1] = ( # <<<<<<<<<<<<<< * &fftwf_set_timelimit) * set_timelimit_funcs[2] = ( */ (__pyx_v_6pyfftw_6pyfftw_set_timelimit_funcs[1]) = ((__pyx_t_6pyfftw_6pyfftw_fftw_generic_set_timelimit)(&fftwf_set_timelimit)); /* "pyfftw/pyfftw.pyx":330 * set_timelimit_funcs[1] = ( * &fftwf_set_timelimit) * set_timelimit_funcs[2] = ( # <<<<<<<<<<<<<< * &fftwl_set_timelimit) * */ (__pyx_v_6pyfftw_6pyfftw_set_timelimit_funcs[2]) = ((__pyx_t_6pyfftw_6pyfftw_fftw_generic_set_timelimit)(&fftwl_set_timelimit)); /* "pyfftw/pyfftw.pyx":325 * cdef fftw_generic_set_timelimit set_timelimit_funcs[3] * * cdef fftw_generic_set_timelimit * _build_set_timelimit_funcs_list(): # <<<<<<<<<<<<<< * set_timelimit_funcs[0] = ( * &fftw_set_timelimit) */ /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pyfftw/pyfftw.pyx":337 * cdef validator validators[2] * * cdef validator * _build_validators_list(): # <<<<<<<<<<<<<< * validators[0] = &_validate_r2c_arrays * validators[1] = &_validate_c2r_arrays */ static __pyx_t_6pyfftw_6pyfftw_validator *__pyx_f_6pyfftw_6pyfftw__build_validators_list(void) { __pyx_t_6pyfftw_6pyfftw_validator *__pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_build_validators_list", 0); /* "pyfftw/pyfftw.pyx":338 * * cdef validator * _build_validators_list(): * validators[0] = &_validate_r2c_arrays # <<<<<<<<<<<<<< * validators[1] = &_validate_c2r_arrays * */ (__pyx_v_6pyfftw_6pyfftw_validators[0]) = (&__pyx_f_6pyfftw_6pyfftw__validate_r2c_arrays); /* "pyfftw/pyfftw.pyx":339 * cdef validator * _build_validators_list(): * validators[0] = &_validate_r2c_arrays * validators[1] = &_validate_c2r_arrays # <<<<<<<<<<<<<< * * # Validator functions */ (__pyx_v_6pyfftw_6pyfftw_validators[1]) = (&__pyx_f_6pyfftw_6pyfftw__validate_c2r_arrays); /* "pyfftw/pyfftw.pyx":337 * cdef validator validators[2] * * cdef validator * _build_validators_list(): # <<<<<<<<<<<<<< * validators[0] = &_validate_r2c_arrays * validators[1] = &_validate_c2r_arrays */ /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pyfftw/pyfftw.pyx":343 * # Validator functions * # =================== * cdef bint _validate_r2c_arrays(np.ndarray input_array, # <<<<<<<<<<<<<< * np.ndarray output_array, int64_t *axes, int64_t *not_axes, * int64_t axes_length): */ static int __pyx_f_6pyfftw_6pyfftw__validate_r2c_arrays(PyArrayObject *__pyx_v_input_array, PyArrayObject *__pyx_v_output_array, int64_t *__pyx_v_axes, int64_t *__pyx_v_not_axes, int64_t __pyx_v_axes_length) { npy_intp *__pyx_v_in_shape; npy_intp *__pyx_v_out_shape; int64_t __pyx_v_n; int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; npy_intp *__pyx_t_2; int64_t __pyx_t_3; int64_t __pyx_t_4; __Pyx_RefNannySetupContext("_validate_r2c_arrays", 0); /* "pyfftw/pyfftw.pyx":351 * # We firstly need to confirm that the dimenions of the arrays * # are the same * if not (input_array.ndim == output_array.ndim): # <<<<<<<<<<<<<< * return False * */ __pyx_t_1 = ((!((__pyx_v_input_array->nd == __pyx_v_output_array->nd) != 0)) != 0); if (__pyx_t_1) { /* "pyfftw/pyfftw.pyx":352 * # are the same * if not (input_array.ndim == output_array.ndim): * return False # <<<<<<<<<<<<<< * * in_shape = input_array.shape */ __pyx_r = 0; goto __pyx_L0; /* "pyfftw/pyfftw.pyx":351 * # We firstly need to confirm that the dimenions of the arrays * # are the same * if not (input_array.ndim == output_array.ndim): # <<<<<<<<<<<<<< * return False * */ } /* "pyfftw/pyfftw.pyx":354 * return False * * in_shape = input_array.shape # <<<<<<<<<<<<<< * out_shape = output_array.shape * */ __pyx_t_2 = __pyx_v_input_array->dimensions; __pyx_v_in_shape = __pyx_t_2; /* "pyfftw/pyfftw.pyx":355 * * in_shape = input_array.shape * out_shape = output_array.shape # <<<<<<<<<<<<<< * * for n in range(axes_length - 1): */ __pyx_t_2 = __pyx_v_output_array->dimensions; __pyx_v_out_shape = __pyx_t_2; /* "pyfftw/pyfftw.pyx":357 * out_shape = output_array.shape * * for n in range(axes_length - 1): # <<<<<<<<<<<<<< * if not out_shape[axes[n]] == in_shape[axes[n]]: * return False */ __pyx_t_3 = (__pyx_v_axes_length - 1); for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_n = __pyx_t_4; /* "pyfftw/pyfftw.pyx":358 * * for n in range(axes_length - 1): * if not out_shape[axes[n]] == in_shape[axes[n]]: # <<<<<<<<<<<<<< * return False * */ __pyx_t_1 = ((!(((__pyx_v_out_shape[(__pyx_v_axes[__pyx_v_n])]) == (__pyx_v_in_shape[(__pyx_v_axes[__pyx_v_n])])) != 0)) != 0); if (__pyx_t_1) { /* "pyfftw/pyfftw.pyx":359 * for n in range(axes_length - 1): * if not out_shape[axes[n]] == in_shape[axes[n]]: * return False # <<<<<<<<<<<<<< * * # The critical axis is the last of those over which the */ __pyx_r = 0; goto __pyx_L0; /* "pyfftw/pyfftw.pyx":358 * * for n in range(axes_length - 1): * if not out_shape[axes[n]] == in_shape[axes[n]]: # <<<<<<<<<<<<<< * return False * */ } } /* "pyfftw/pyfftw.pyx":363 * # The critical axis is the last of those over which the * # FFT is taken. * if not (out_shape[axes[axes_length-1]] # <<<<<<<<<<<<<< * == in_shape[axes[axes_length-1]]//2 + 1): * return False */ __pyx_t_1 = ((!(((__pyx_v_out_shape[(__pyx_v_axes[(__pyx_v_axes_length - 1)])]) == (__Pyx_div_long((__pyx_v_in_shape[(__pyx_v_axes[(__pyx_v_axes_length - 1)])]), 2) + 1)) != 0)) != 0); if (__pyx_t_1) { /* "pyfftw/pyfftw.pyx":365 * if not (out_shape[axes[axes_length-1]] * == in_shape[axes[axes_length-1]]//2 + 1): * return False # <<<<<<<<<<<<<< * * for n in range(input_array.ndim - axes_length): */ __pyx_r = 0; goto __pyx_L0; /* "pyfftw/pyfftw.pyx":363 * # The critical axis is the last of those over which the * # FFT is taken. * if not (out_shape[axes[axes_length-1]] # <<<<<<<<<<<<<< * == in_shape[axes[axes_length-1]]//2 + 1): * return False */ } /* "pyfftw/pyfftw.pyx":367 * return False * * for n in range(input_array.ndim - axes_length): # <<<<<<<<<<<<<< * if not out_shape[not_axes[n]] == in_shape[not_axes[n]]: * return False */ __pyx_t_3 = (__pyx_v_input_array->nd - __pyx_v_axes_length); for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_n = __pyx_t_4; /* "pyfftw/pyfftw.pyx":368 * * for n in range(input_array.ndim - axes_length): * if not out_shape[not_axes[n]] == in_shape[not_axes[n]]: # <<<<<<<<<<<<<< * return False * */ __pyx_t_1 = ((!(((__pyx_v_out_shape[(__pyx_v_not_axes[__pyx_v_n])]) == (__pyx_v_in_shape[(__pyx_v_not_axes[__pyx_v_n])])) != 0)) != 0); if (__pyx_t_1) { /* "pyfftw/pyfftw.pyx":369 * for n in range(input_array.ndim - axes_length): * if not out_shape[not_axes[n]] == in_shape[not_axes[n]]: * return False # <<<<<<<<<<<<<< * * return True */ __pyx_r = 0; goto __pyx_L0; /* "pyfftw/pyfftw.pyx":368 * * for n in range(input_array.ndim - axes_length): * if not out_shape[not_axes[n]] == in_shape[not_axes[n]]: # <<<<<<<<<<<<<< * return False * */ } } /* "pyfftw/pyfftw.pyx":371 * return False * * return True # <<<<<<<<<<<<<< * * */ __pyx_r = 1; goto __pyx_L0; /* "pyfftw/pyfftw.pyx":343 * # Validator functions * # =================== * cdef bint _validate_r2c_arrays(np.ndarray input_array, # <<<<<<<<<<<<<< * np.ndarray output_array, int64_t *axes, int64_t *not_axes, * int64_t axes_length): */ /* function exit code */ __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pyfftw/pyfftw.pyx":374 * * * cdef bint _validate_c2r_arrays(np.ndarray input_array, # <<<<<<<<<<<<<< * np.ndarray output_array, int64_t *axes, int64_t *not_axes, * int64_t axes_length): */ static int __pyx_f_6pyfftw_6pyfftw__validate_c2r_arrays(PyArrayObject *__pyx_v_input_array, PyArrayObject *__pyx_v_output_array, int64_t *__pyx_v_axes, int64_t *__pyx_v_not_axes, int64_t __pyx_v_axes_length) { npy_intp *__pyx_v_in_shape; npy_intp *__pyx_v_out_shape; int64_t __pyx_v_n; int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; npy_intp *__pyx_t_2; int64_t __pyx_t_3; int64_t __pyx_t_4; __Pyx_RefNannySetupContext("_validate_c2r_arrays", 0); /* "pyfftw/pyfftw.pyx":383 * # We firstly need to confirm that the dimenions of the arrays * # are the same * if not (input_array.ndim == output_array.ndim): # <<<<<<<<<<<<<< * return False * */ __pyx_t_1 = ((!((__pyx_v_input_array->nd == __pyx_v_output_array->nd) != 0)) != 0); if (__pyx_t_1) { /* "pyfftw/pyfftw.pyx":384 * # are the same * if not (input_array.ndim == output_array.ndim): * return False # <<<<<<<<<<<<<< * * in_shape = input_array.shape */ __pyx_r = 0; goto __pyx_L0; /* "pyfftw/pyfftw.pyx":383 * # We firstly need to confirm that the dimenions of the arrays * # are the same * if not (input_array.ndim == output_array.ndim): # <<<<<<<<<<<<<< * return False * */ } /* "pyfftw/pyfftw.pyx":386 * return False * * in_shape = input_array.shape # <<<<<<<<<<<<<< * out_shape = output_array.shape * */ __pyx_t_2 = __pyx_v_input_array->dimensions; __pyx_v_in_shape = __pyx_t_2; /* "pyfftw/pyfftw.pyx":387 * * in_shape = input_array.shape * out_shape = output_array.shape # <<<<<<<<<<<<<< * * for n in range(axes_length - 1): */ __pyx_t_2 = __pyx_v_output_array->dimensions; __pyx_v_out_shape = __pyx_t_2; /* "pyfftw/pyfftw.pyx":389 * out_shape = output_array.shape * * for n in range(axes_length - 1): # <<<<<<<<<<<<<< * if not in_shape[axes[n]] == out_shape[axes[n]]: * return False */ __pyx_t_3 = (__pyx_v_axes_length - 1); for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_n = __pyx_t_4; /* "pyfftw/pyfftw.pyx":390 * * for n in range(axes_length - 1): * if not in_shape[axes[n]] == out_shape[axes[n]]: # <<<<<<<<<<<<<< * return False * */ __pyx_t_1 = ((!(((__pyx_v_in_shape[(__pyx_v_axes[__pyx_v_n])]) == (__pyx_v_out_shape[(__pyx_v_axes[__pyx_v_n])])) != 0)) != 0); if (__pyx_t_1) { /* "pyfftw/pyfftw.pyx":391 * for n in range(axes_length - 1): * if not in_shape[axes[n]] == out_shape[axes[n]]: * return False # <<<<<<<<<<<<<< * * # The critical axis is the last of those over which the */ __pyx_r = 0; goto __pyx_L0; /* "pyfftw/pyfftw.pyx":390 * * for n in range(axes_length - 1): * if not in_shape[axes[n]] == out_shape[axes[n]]: # <<<<<<<<<<<<<< * return False * */ } } /* "pyfftw/pyfftw.pyx":395 * # The critical axis is the last of those over which the * # FFT is taken. * if not (in_shape[axes[axes_length-1]] # <<<<<<<<<<<<<< * == out_shape[axes[axes_length-1]]//2 + 1): * return False */ __pyx_t_1 = ((!(((__pyx_v_in_shape[(__pyx_v_axes[(__pyx_v_axes_length - 1)])]) == (__Pyx_div_long((__pyx_v_out_shape[(__pyx_v_axes[(__pyx_v_axes_length - 1)])]), 2) + 1)) != 0)) != 0); if (__pyx_t_1) { /* "pyfftw/pyfftw.pyx":397 * if not (in_shape[axes[axes_length-1]] * == out_shape[axes[axes_length-1]]//2 + 1): * return False # <<<<<<<<<<<<<< * * for n in range(input_array.ndim - axes_length): */ __pyx_r = 0; goto __pyx_L0; /* "pyfftw/pyfftw.pyx":395 * # The critical axis is the last of those over which the * # FFT is taken. * if not (in_shape[axes[axes_length-1]] # <<<<<<<<<<<<<< * == out_shape[axes[axes_length-1]]//2 + 1): * return False */ } /* "pyfftw/pyfftw.pyx":399 * return False * * for n in range(input_array.ndim - axes_length): # <<<<<<<<<<<<<< * if not in_shape[not_axes[n]] == out_shape[not_axes[n]]: * return False */ __pyx_t_3 = (__pyx_v_input_array->nd - __pyx_v_axes_length); for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_n = __pyx_t_4; /* "pyfftw/pyfftw.pyx":400 * * for n in range(input_array.ndim - axes_length): * if not in_shape[not_axes[n]] == out_shape[not_axes[n]]: # <<<<<<<<<<<<<< * return False * */ __pyx_t_1 = ((!(((__pyx_v_in_shape[(__pyx_v_not_axes[__pyx_v_n])]) == (__pyx_v_out_shape[(__pyx_v_not_axes[__pyx_v_n])])) != 0)) != 0); if (__pyx_t_1) { /* "pyfftw/pyfftw.pyx":401 * for n in range(input_array.ndim - axes_length): * if not in_shape[not_axes[n]] == out_shape[not_axes[n]]: * return False # <<<<<<<<<<<<<< * * return True */ __pyx_r = 0; goto __pyx_L0; /* "pyfftw/pyfftw.pyx":400 * * for n in range(input_array.ndim - axes_length): * if not in_shape[not_axes[n]] == out_shape[not_axes[n]]: # <<<<<<<<<<<<<< * return False * */ } } /* "pyfftw/pyfftw.pyx":403 * return False * * return True # <<<<<<<<<<<<<< * * */ __pyx_r = 1; goto __pyx_L0; /* "pyfftw/pyfftw.pyx":374 * * * cdef bint _validate_c2r_arrays(np.ndarray input_array, # <<<<<<<<<<<<<< * np.ndarray output_array, int64_t *axes, int64_t *not_axes, * int64_t axes_length): */ /* function exit code */ __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pyfftw/pyfftw.pyx":408 * # Shape lookup functions * # ====================== * def _lookup_shape_r2c_arrays(input_array, output_array): # <<<<<<<<<<<<<< * return input_array.shape * */ /* Python wrapper */ static PyObject *__pyx_pw_6pyfftw_6pyfftw_17_lookup_shape_r2c_arrays(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_6pyfftw_6pyfftw_17_lookup_shape_r2c_arrays = {"_lookup_shape_r2c_arrays", (PyCFunction)__pyx_pw_6pyfftw_6pyfftw_17_lookup_shape_r2c_arrays, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_6pyfftw_6pyfftw_17_lookup_shape_r2c_arrays(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_input_array = 0; CYTHON_UNUSED PyObject *__pyx_v_output_array = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_lookup_shape_r2c_arrays (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input_array,&__pyx_n_s_output_array,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_input_array)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_output_array)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("_lookup_shape_r2c_arrays", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_lookup_shape_r2c_arrays") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_input_array = values[0]; __pyx_v_output_array = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("_lookup_shape_r2c_arrays", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pyfftw.pyfftw._lookup_shape_r2c_arrays", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_6pyfftw_6pyfftw_16_lookup_shape_r2c_arrays(__pyx_self, __pyx_v_input_array, __pyx_v_output_array); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6pyfftw_6pyfftw_16_lookup_shape_r2c_arrays(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input_array, CYTHON_UNUSED PyObject *__pyx_v_output_array) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_lookup_shape_r2c_arrays", 0); /* "pyfftw/pyfftw.pyx":409 * # ====================== * def _lookup_shape_r2c_arrays(input_array, output_array): * return input_array.shape # <<<<<<<<<<<<<< * * def _lookup_shape_c2r_arrays(input_array, output_array): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_input_array, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pyfftw/pyfftw.pyx":408 * # Shape lookup functions * # ====================== * def _lookup_shape_r2c_arrays(input_array, output_array): # <<<<<<<<<<<<<< * return input_array.shape * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pyfftw.pyfftw._lookup_shape_r2c_arrays", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pyfftw/pyfftw.pyx":411 * return input_array.shape * * def _lookup_shape_c2r_arrays(input_array, output_array): # <<<<<<<<<<<<<< * return output_array.shape * */ /* Python wrapper */ static PyObject *__pyx_pw_6pyfftw_6pyfftw_19_lookup_shape_c2r_arrays(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_6pyfftw_6pyfftw_19_lookup_shape_c2r_arrays = {"_lookup_shape_c2r_arrays", (PyCFunction)__pyx_pw_6pyfftw_6pyfftw_19_lookup_shape_c2r_arrays, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_6pyfftw_6pyfftw_19_lookup_shape_c2r_arrays(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED PyObject *__pyx_v_input_array = 0; PyObject *__pyx_v_output_array = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_lookup_shape_c2r_arrays (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input_array,&__pyx_n_s_output_array,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_input_array)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_output_array)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("_lookup_shape_c2r_arrays", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_lookup_shape_c2r_arrays") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_input_array = values[0]; __pyx_v_output_array = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("_lookup_shape_c2r_arrays", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pyfftw.pyfftw._lookup_shape_c2r_arrays", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_6pyfftw_6pyfftw_18_lookup_shape_c2r_arrays(__pyx_self, __pyx_v_input_array, __pyx_v_output_array); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6pyfftw_6pyfftw_18_lookup_shape_c2r_arrays(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_input_array, PyObject *__pyx_v_output_array) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_lookup_shape_c2r_arrays", 0); /* "pyfftw/pyfftw.pyx":412 * * def _lookup_shape_c2r_arrays(input_array, output_array): * return output_array.shape # <<<<<<<<<<<<<< * * # fftw_schemes is a dictionary with a mapping from a keys, */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_output_array, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pyfftw/pyfftw.pyx":411 * return input_array.shape * * def _lookup_shape_c2r_arrays(input_array, output_array): # <<<<<<<<<<<<<< * return output_array.shape * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pyfftw.pyfftw._lookup_shape_c2r_arrays", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pyfftw/pyfftw.pyx":518 * * # Set the cleanup routine * cdef void _cleanup(): # <<<<<<<<<<<<<< * fftw_cleanup() * fftwf_cleanup() */ static void __pyx_f_6pyfftw_6pyfftw__cleanup(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_cleanup", 0); /* "pyfftw/pyfftw.pyx":519 * # Set the cleanup routine * cdef void _cleanup(): * fftw_cleanup() # <<<<<<<<<<<<<< * fftwf_cleanup() * fftwl_cleanup() */ fftw_cleanup(); /* "pyfftw/pyfftw.pyx":520 * cdef void _cleanup(): * fftw_cleanup() * fftwf_cleanup() # <<<<<<<<<<<<<< * fftwl_cleanup() * fftw_cleanup_threads() */ fftwf_cleanup(); /* "pyfftw/pyfftw.pyx":521 * fftw_cleanup() * fftwf_cleanup() * fftwl_cleanup() # <<<<<<<<<<<<<< * fftw_cleanup_threads() * fftwf_cleanup_threads() */ fftwl_cleanup(); /* "pyfftw/pyfftw.pyx":522 * fftwf_cleanup() * fftwl_cleanup() * fftw_cleanup_threads() # <<<<<<<<<<<<<< * fftwf_cleanup_threads() * fftwl_cleanup_threads() */ fftw_cleanup_threads(); /* "pyfftw/pyfftw.pyx":523 * fftwl_cleanup() * fftw_cleanup_threads() * fftwf_cleanup_threads() # <<<<<<<<<<<<<< * fftwl_cleanup_threads() * */ fftwf_cleanup_threads(); /* "pyfftw/pyfftw.pyx":524 * fftw_cleanup_threads() * fftwf_cleanup_threads() * fftwl_cleanup_threads() # <<<<<<<<<<<<<< * * Py_AtExit(_cleanup) */ fftwl_cleanup_threads(); /* "pyfftw/pyfftw.pyx":518 * * # Set the cleanup routine * cdef void _cleanup(): # <<<<<<<<<<<<<< * fftw_cleanup() * fftwf_cleanup() */ /* function exit code */ __Pyx_RefNannyFinishContext(); } /* "pyfftw/pyfftw.pyx":529 * * # Helper functions * cdef void make_axes_unique(int64_t *axes, int64_t axes_length, # <<<<<<<<<<<<<< * int64_t **unique_axes, int64_t **not_axes, int64_t dimensions, * int64_t *unique_axes_length): */ static void __pyx_f_6pyfftw_6pyfftw_make_axes_unique(int64_t *__pyx_v_axes, int64_t __pyx_v_axes_length, int64_t **__pyx_v_unique_axes, int64_t **__pyx_v_not_axes, int64_t __pyx_v_dimensions, int64_t *__pyx_v_unique_axes_length) { int64_t __pyx_v_unique_axes_count; int64_t __pyx_v_holding_offset; int64_t *__pyx_v_axes_holding; int64_t *__pyx_v_axes_holding_offset; int64_t __pyx_v_n; int64_t __pyx_v_not_axes_count; __Pyx_RefNannyDeclarations int64_t __pyx_t_1; int64_t __pyx_t_2; int __pyx_t_3; __Pyx_RefNannySetupContext("make_axes_unique", 0); /* "pyfftw/pyfftw.pyx":544 * ''' * * cdef int64_t unique_axes_count = 0 # <<<<<<<<<<<<<< * cdef int64_t holding_offset = 0 * */ __pyx_v_unique_axes_count = 0; /* "pyfftw/pyfftw.pyx":545 * * cdef int64_t unique_axes_count = 0 * cdef int64_t holding_offset = 0 # <<<<<<<<<<<<<< * * cdef int64_t *axes_holding = ( */ __pyx_v_holding_offset = 0; /* "pyfftw/pyfftw.pyx":548 * * cdef int64_t *axes_holding = ( * calloc(dimensions, sizeof(int64_t))) # <<<<<<<<<<<<<< * cdef int64_t *axes_holding_offset = ( * calloc(dimensions, sizeof(int64_t))) */ __pyx_v_axes_holding = ((int64_t *)calloc(__pyx_v_dimensions, (sizeof(int64_t)))); /* "pyfftw/pyfftw.pyx":550 * calloc(dimensions, sizeof(int64_t))) * cdef int64_t *axes_holding_offset = ( * calloc(dimensions, sizeof(int64_t))) # <<<<<<<<<<<<<< * * for n in range(dimensions): */ __pyx_v_axes_holding_offset = ((int64_t *)calloc(__pyx_v_dimensions, (sizeof(int64_t)))); /* "pyfftw/pyfftw.pyx":552 * calloc(dimensions, sizeof(int64_t))) * * for n in range(dimensions): # <<<<<<<<<<<<<< * axes_holding[n] = -1 * */ __pyx_t_1 = __pyx_v_dimensions; for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { __pyx_v_n = __pyx_t_2; /* "pyfftw/pyfftw.pyx":553 * * for n in range(dimensions): * axes_holding[n] = -1 # <<<<<<<<<<<<<< * * # Iterate over all the axes and store each index if it hasn't already */ (__pyx_v_axes_holding[__pyx_v_n]) = -1L; } /* "pyfftw/pyfftw.pyx":560 * # * # axes_holding_offset holds the shift due to repeated axes * for n in range(axes_length): # <<<<<<<<<<<<<< * if axes_holding[axes[n]] == -1: * axes_holding[axes[n]] = n */ __pyx_t_1 = __pyx_v_axes_length; for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { __pyx_v_n = __pyx_t_2; /* "pyfftw/pyfftw.pyx":561 * # axes_holding_offset holds the shift due to repeated axes * for n in range(axes_length): * if axes_holding[axes[n]] == -1: # <<<<<<<<<<<<<< * axes_holding[axes[n]] = n * axes_holding_offset[axes[n]] = holding_offset */ __pyx_t_3 = (((__pyx_v_axes_holding[(__pyx_v_axes[__pyx_v_n])]) == -1L) != 0); if (__pyx_t_3) { /* "pyfftw/pyfftw.pyx":562 * for n in range(axes_length): * if axes_holding[axes[n]] == -1: * axes_holding[axes[n]] = n # <<<<<<<<<<<<<< * axes_holding_offset[axes[n]] = holding_offset * unique_axes_count += 1 */ (__pyx_v_axes_holding[(__pyx_v_axes[__pyx_v_n])]) = __pyx_v_n; /* "pyfftw/pyfftw.pyx":563 * if axes_holding[axes[n]] == -1: * axes_holding[axes[n]] = n * axes_holding_offset[axes[n]] = holding_offset # <<<<<<<<<<<<<< * unique_axes_count += 1 * else: */ (__pyx_v_axes_holding_offset[(__pyx_v_axes[__pyx_v_n])]) = __pyx_v_holding_offset; /* "pyfftw/pyfftw.pyx":564 * axes_holding[axes[n]] = n * axes_holding_offset[axes[n]] = holding_offset * unique_axes_count += 1 # <<<<<<<<<<<<<< * else: * holding_offset += 1 */ __pyx_v_unique_axes_count = (__pyx_v_unique_axes_count + 1); /* "pyfftw/pyfftw.pyx":561 * # axes_holding_offset holds the shift due to repeated axes * for n in range(axes_length): * if axes_holding[axes[n]] == -1: # <<<<<<<<<<<<<< * axes_holding[axes[n]] = n * axes_holding_offset[axes[n]] = holding_offset */ goto __pyx_L7; } /* "pyfftw/pyfftw.pyx":566 * unique_axes_count += 1 * else: * holding_offset += 1 # <<<<<<<<<<<<<< * * unique_axes[0] = malloc( */ /*else*/ { __pyx_v_holding_offset = (__pyx_v_holding_offset + 1); } __pyx_L7:; } /* "pyfftw/pyfftw.pyx":568 * holding_offset += 1 * * unique_axes[0] = malloc( # <<<<<<<<<<<<<< * unique_axes_count * sizeof(int64_t)) * */ (__pyx_v_unique_axes[0]) = ((int64_t *)malloc((__pyx_v_unique_axes_count * (sizeof(int64_t))))); /* "pyfftw/pyfftw.pyx":571 * unique_axes_count * sizeof(int64_t)) * * not_axes[0] = malloc( # <<<<<<<<<<<<<< * (dimensions - unique_axes_count) * sizeof(int64_t)) * */ (__pyx_v_not_axes[0]) = ((int64_t *)malloc(((__pyx_v_dimensions - __pyx_v_unique_axes_count) * (sizeof(int64_t))))); /* "pyfftw/pyfftw.pyx":575 * * # Now we need to write back the unique axes to a tmp axes * cdef int64_t not_axes_count = 0 # <<<<<<<<<<<<<< * * for n in range(dimensions): */ __pyx_v_not_axes_count = 0; /* "pyfftw/pyfftw.pyx":577 * cdef int64_t not_axes_count = 0 * * for n in range(dimensions): # <<<<<<<<<<<<<< * if axes_holding[n] != -1: * unique_axes[0][axes_holding[n] - axes_holding_offset[n]] = ( */ __pyx_t_1 = __pyx_v_dimensions; for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { __pyx_v_n = __pyx_t_2; /* "pyfftw/pyfftw.pyx":578 * * for n in range(dimensions): * if axes_holding[n] != -1: # <<<<<<<<<<<<<< * unique_axes[0][axes_holding[n] - axes_holding_offset[n]] = ( * axes[axes_holding[n]]) */ __pyx_t_3 = (((__pyx_v_axes_holding[__pyx_v_n]) != -1L) != 0); if (__pyx_t_3) { /* "pyfftw/pyfftw.pyx":579 * for n in range(dimensions): * if axes_holding[n] != -1: * unique_axes[0][axes_holding[n] - axes_holding_offset[n]] = ( # <<<<<<<<<<<<<< * axes[axes_holding[n]]) * */ ((__pyx_v_unique_axes[0])[((__pyx_v_axes_holding[__pyx_v_n]) - (__pyx_v_axes_holding_offset[__pyx_v_n]))]) = (__pyx_v_axes[(__pyx_v_axes_holding[__pyx_v_n])]); /* "pyfftw/pyfftw.pyx":578 * * for n in range(dimensions): * if axes_holding[n] != -1: # <<<<<<<<<<<<<< * unique_axes[0][axes_holding[n] - axes_holding_offset[n]] = ( * axes[axes_holding[n]]) */ goto __pyx_L10; } /* "pyfftw/pyfftw.pyx":583 * * else: * not_axes[0][not_axes_count] = n # <<<<<<<<<<<<<< * not_axes_count += 1 * */ /*else*/ { ((__pyx_v_not_axes[0])[__pyx_v_not_axes_count]) = __pyx_v_n; /* "pyfftw/pyfftw.pyx":584 * else: * not_axes[0][not_axes_count] = n * not_axes_count += 1 # <<<<<<<<<<<<<< * * free(axes_holding) */ __pyx_v_not_axes_count = (__pyx_v_not_axes_count + 1); } __pyx_L10:; } /* "pyfftw/pyfftw.pyx":586 * not_axes_count += 1 * * free(axes_holding) # <<<<<<<<<<<<<< * free(axes_holding_offset) * */ free(__pyx_v_axes_holding); /* "pyfftw/pyfftw.pyx":587 * * free(axes_holding) * free(axes_holding_offset) # <<<<<<<<<<<<<< * * unique_axes_length[0] = unique_axes_count */ free(__pyx_v_axes_holding_offset); /* "pyfftw/pyfftw.pyx":589 * free(axes_holding_offset) * * unique_axes_length[0] = unique_axes_count # <<<<<<<<<<<<<< * * return */ (__pyx_v_unique_axes_length[0]) = __pyx_v_unique_axes_count; /* "pyfftw/pyfftw.pyx":591 * unique_axes_length[0] = unique_axes_count * * return # <<<<<<<<<<<<<< * * */ goto __pyx_L0; /* "pyfftw/pyfftw.pyx":529 * * # Helper functions * cdef void make_axes_unique(int64_t *axes, int64_t axes_length, # <<<<<<<<<<<<<< * int64_t **unique_axes, int64_t **not_axes, int64_t dimensions, * int64_t *unique_axes_length): */ /* function exit code */ __pyx_L0:; __Pyx_RefNannyFinishContext(); } /* "pyfftw/pyfftw.pyx":667 * * cdef int64_t _N * def _get_N(self): # <<<<<<<<<<<<<< * ''' * The product of the lengths of the DFT over all DFT axes. */ /* Python wrapper */ static PyObject *__pyx_pw_6pyfftw_6pyfftw_4FFTW_1_get_N(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_6pyfftw_6pyfftw_4FFTW__get_N[] = "\n The product of the lengths of the DFT over all DFT axes.\n 1/N is the normalisation constant. For any input array A, \n and for any set of axes, 1/N * ifft(fft(A)) = A\n "; static PyObject *__pyx_pw_6pyfftw_6pyfftw_4FFTW_1_get_N(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_get_N (wrapper)", 0); __pyx_r = __pyx_pf_6pyfftw_6pyfftw_4FFTW__get_N(((struct __pyx_obj_6pyfftw_6pyfftw_FFTW *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6pyfftw_6pyfftw_4FFTW__get_N(struct __pyx_obj_6pyfftw_6pyfftw_FFTW *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_get_N", 0); /* "pyfftw/pyfftw.pyx":673 * and for any set of axes, 1/N * ifft(fft(A)) = A * ''' * return self._N # <<<<<<<<<<<<<< * * N = property(_get_N) */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_self->_N); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pyfftw/pyfftw.pyx":667 * * cdef int64_t _N * def _get_N(self): # <<<<<<<<<<<<<< * ''' * The product of the lengths of the DFT over all DFT axes. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pyfftw.pyfftw.FFTW._get_N", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pyfftw/pyfftw.pyx":677 * N = property(_get_N) * * def _get_simd_aligned(self): # <<<<<<<<<<<<<< * ''' * Return whether or not this FFTW object requires simd aligned */ /* Python wrapper */ static PyObject *__pyx_pw_6pyfftw_6pyfftw_4FFTW_3_get_simd_aligned(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_6pyfftw_6pyfftw_4FFTW_2_get_simd_aligned[] = "\n Return whether or not this FFTW object requires simd aligned\n input and output data.\n "; static PyObject *__pyx_pw_6pyfftw_6pyfftw_4FFTW_3_get_simd_aligned(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_get_simd_aligned (wrapper)", 0); __pyx_r = __pyx_pf_6pyfftw_6pyfftw_4FFTW_2_get_simd_aligned(((struct __pyx_obj_6pyfftw_6pyfftw_FFTW *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6pyfftw_6pyfftw_4FFTW_2_get_simd_aligned(struct __pyx_obj_6pyfftw_6pyfftw_FFTW *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_get_simd_aligned", 0); /* "pyfftw/pyfftw.pyx":682 * input and output data. * ''' * return self._simd_allowed # <<<<<<<<<<<<<< * * simd_aligned = property(_get_simd_aligned) */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->_simd_allowed); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 682; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pyfftw/pyfftw.pyx":677 * N = property(_get_N) * * def _get_simd_aligned(self): # <<<<<<<<<<<<<< * ''' * Return whether or not this FFTW object requires simd aligned */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pyfftw.pyfftw.FFTW._get_simd_aligned", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pyfftw/pyfftw.pyx":686 * simd_aligned = property(_get_simd_aligned) * * def _get_input_alignment(self): # <<<<<<<<<<<<<< * ''' * Returns the byte alignment of the input arrays for which the */ /* Python wrapper */ static PyObject *__pyx_pw_6pyfftw_6pyfftw_4FFTW_5_get_input_alignment(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_6pyfftw_6pyfftw_4FFTW_4_get_input_alignment[] = "\n Returns the byte alignment of the input arrays for which the\n :class:`~pyfftw.FFTW` object was created.\n\n Input array updates with arrays that are not aligned on this\n byte boundary will result in a ValueError being raised, or\n a copy being made if the :meth:`~pyfftw.FFTW.__call__` \n interface is used.\n "; static PyObject *__pyx_pw_6pyfftw_6pyfftw_4FFTW_5_get_input_alignment(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_get_input_alignment (wrapper)", 0); __pyx_r = __pyx_pf_6pyfftw_6pyfftw_4FFTW_4_get_input_alignment(((struct __pyx_obj_6pyfftw_6pyfftw_FFTW *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6pyfftw_6pyfftw_4FFTW_4_get_input_alignment(struct __pyx_obj_6pyfftw_6pyfftw_FFTW *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_get_input_alignment", 0); /* "pyfftw/pyfftw.pyx":696 * interface is used. * ''' * return self._input_array_alignment # <<<<<<<<<<<<<< * * input_alignment = property(_get_input_alignment) */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_input_array_alignment); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pyfftw/pyfftw.pyx":686 * simd_aligned = property(_get_simd_aligned) * * def _get_input_alignment(self): # <<<<<<<<<<<<<< * ''' * Returns the byte alignment of the input arrays for which the */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pyfftw.pyfftw.FFTW._get_input_alignment", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pyfftw/pyfftw.pyx":700 * input_alignment = property(_get_input_alignment) * * def _get_output_alignment(self): # <<<<<<<<<<<<<< * ''' * Returns the byte alignment of the output arrays for which the */ /* Python wrapper */ static PyObject *__pyx_pw_6pyfftw_6pyfftw_4FFTW_7_get_output_alignment(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_6pyfftw_6pyfftw_4FFTW_6_get_output_alignment[] = "\n Returns the byte alignment of the output arrays for which the\n :class:`~pyfftw.FFTW` object was created.\n\n Output array updates with arrays that are not aligned on this\n byte boundary will result in a ValueError being raised.\n "; static PyObject *__pyx_pw_6pyfftw_6pyfftw_4FFTW_7_get_output_alignment(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_get_output_alignment (wrapper)", 0); __pyx_r = __pyx_pf_6pyfftw_6pyfftw_4FFTW_6_get_output_alignment(((struct __pyx_obj_6pyfftw_6pyfftw_FFTW *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6pyfftw_6pyfftw_4FFTW_6_get_output_alignment(struct __pyx_obj_6pyfftw_6pyfftw_FFTW *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_get_output_alignment", 0); /* "pyfftw/pyfftw.pyx":708 * byte boundary will result in a ValueError being raised. * ''' * return self._output_array_alignment # <<<<<<<<<<<<<< * * output_alignment = property(_get_output_alignment) */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_output_array_alignment); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pyfftw/pyfftw.pyx":700 * input_alignment = property(_get_input_alignment) * * def _get_output_alignment(self): # <<<<<<<<<<<<<< * ''' * Returns the byte alignment of the output arrays for which the */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pyfftw.pyfftw.FFTW._get_output_alignment", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pyfftw/pyfftw.pyx":712 * output_alignment = property(_get_output_alignment) * * def _get_flags_used(self): # <<<<<<<<<<<<<< * ''' * Return which flags were used to construct the FFTW object. */ /* Python wrapper */ static PyObject *__pyx_pw_6pyfftw_6pyfftw_4FFTW_9_get_flags_used(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_6pyfftw_6pyfftw_4FFTW_8_get_flags_used[] = "\n Return which flags were used to construct the FFTW object.\n \n This includes flags that were added during initialisation.\n "; static PyObject *__pyx_pw_6pyfftw_6pyfftw_4FFTW_9_get_flags_used(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_get_flags_used (wrapper)", 0); __pyx_r = __pyx_pf_6pyfftw_6pyfftw_4FFTW_8_get_flags_used(((struct __pyx_obj_6pyfftw_6pyfftw_FFTW *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6pyfftw_6pyfftw_4FFTW_8_get_flags_used(struct __pyx_obj_6pyfftw_6pyfftw_FFTW *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_get_flags_used", 0); /* "pyfftw/pyfftw.pyx":718 * This includes flags that were added during initialisation. * ''' * return tuple(self._flags_used) # <<<<<<<<<<<<<< * * flags = property(_get_flags_used) */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PySequence_Tuple(__pyx_v_self->_flags_used); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pyfftw/pyfftw.pyx":712 * output_alignment = property(_get_output_alignment) * * def _get_flags_used(self): # <<<<<<<<<<<<<< * ''' * Return which flags were used to construct the FFTW object. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pyfftw.pyfftw.FFTW._get_flags_used", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pyfftw/pyfftw.pyx":722 * flags = property(_get_flags_used) * * def _get_input_array(self): # <<<<<<<<<<<<<< * ''' * Return the input array that is associated with the FFTW */ /* Python wrapper */ static PyObject *__pyx_pw_6pyfftw_6pyfftw_4FFTW_11_get_input_array(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_6pyfftw_6pyfftw_4FFTW_10_get_input_array[] = "\n Return the input array that is associated with the FFTW \n instance.\n "; static PyObject *__pyx_pw_6pyfftw_6pyfftw_4FFTW_11_get_input_array(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_get_input_array (wrapper)", 0); __pyx_r = __pyx_pf_6pyfftw_6pyfftw_4FFTW_10_get_input_array(((struct __pyx_obj_6pyfftw_6pyfftw_FFTW *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6pyfftw_6pyfftw_4FFTW_10_get_input_array(struct __pyx_obj_6pyfftw_6pyfftw_FFTW *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_get_input_array", 0); /* "pyfftw/pyfftw.pyx":727 * instance. * ''' * return self._input_array # <<<<<<<<<<<<<< * * input_array = property(_get_input_array) */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self->_input_array)); __pyx_r = ((PyObject *)__pyx_v_self->_input_array); goto __pyx_L0; /* "pyfftw/pyfftw.pyx":722 * flags = property(_get_flags_used) * * def _get_input_array(self): # <<<<<<<<<<<<<< * ''' * Return the input array that is associated with the FFTW */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pyfftw/pyfftw.pyx":731 * input_array = property(_get_input_array) * * def _get_output_array(self): # <<<<<<<<<<<<<< * ''' * Return the output array that is associated with the FFTW */ /* Python wrapper */ static PyObject *__pyx_pw_6pyfftw_6pyfftw_4FFTW_13_get_output_array(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_6pyfftw_6pyfftw_4FFTW_12_get_output_array[] = "\n Return the output array that is associated with the FFTW \n instance.\n "; static PyObject *__pyx_pw_6pyfftw_6pyfftw_4FFTW_13_get_output_array(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_get_output_array (wrapper)", 0); __pyx_r = __pyx_pf_6pyfftw_6pyfftw_4FFTW_12_get_output_array(((struct __pyx_obj_6pyfftw_6pyfftw_FFTW *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6pyfftw_6pyfftw_4FFTW_12_get_output_array(struct __pyx_obj_6pyfftw_6pyfftw_FFTW *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_get_output_array", 0); /* "pyfftw/pyfftw.pyx":736 * instance. * ''' * return self._output_array # <<<<<<<<<<<<<< * * output_array = property(_get_output_array) */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self->_output_array)); __pyx_r = ((PyObject *)__pyx_v_self->_output_array); goto __pyx_L0; /* "pyfftw/pyfftw.pyx":731 * input_array = property(_get_input_array) * * def _get_output_array(self): # <<<<<<<<<<<<<< * ''' * Return the output array that is associated with the FFTW */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pyfftw/pyfftw.pyx":740 * output_array = property(_get_output_array) * * def _get_input_strides(self): # <<<<<<<<<<<<<< * ''' * Return the strides of the input array for which the FFT is planned. */ /* Python wrapper */ static PyObject *__pyx_pw_6pyfftw_6pyfftw_4FFTW_15_get_input_strides(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_6pyfftw_6pyfftw_4FFTW_14_get_input_strides[] = "\n Return the strides of the input array for which the FFT is planned.\n "; static PyObject *__pyx_pw_6pyfftw_6pyfftw_4FFTW_15_get_input_strides(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_get_input_strides (wrapper)", 0); __pyx_r = __pyx_pf_6pyfftw_6pyfftw_4FFTW_14_get_input_strides(((struct __pyx_obj_6pyfftw_6pyfftw_FFTW *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6pyfftw_6pyfftw_4FFTW_14_get_input_strides(struct __pyx_obj_6pyfftw_6pyfftw_FFTW *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_get_input_strides", 0); /* "pyfftw/pyfftw.pyx":744 * Return the strides of the input array for which the FFT is planned. * ''' * return self._input_strides # <<<<<<<<<<<<<< * * input_strides = property(_get_input_strides) */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->_input_strides); __pyx_r = __pyx_v_self->_input_strides; goto __pyx_L0; /* "pyfftw/pyfftw.pyx":740 * output_array = property(_get_output_array) * * def _get_input_strides(self): # <<<<<<<<<<<<<< * ''' * Return the strides of the input array for which the FFT is planned. */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pyfftw/pyfftw.pyx":748 * input_strides = property(_get_input_strides) * * def _get_output_strides(self): # <<<<<<<<<<<<<< * ''' * Return the strides of the output array for which the FFT is planned. */ /* Python wrapper */ static PyObject *__pyx_pw_6pyfftw_6pyfftw_4FFTW_17_get_output_strides(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_6pyfftw_6pyfftw_4FFTW_16_get_output_strides[] = "\n Return the strides of the output array for which the FFT is planned.\n "; static PyObject *__pyx_pw_6pyfftw_6pyfftw_4FFTW_17_get_output_strides(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_get_output_strides (wrapper)", 0); __pyx_r = __pyx_pf_6pyfftw_6pyfftw_4FFTW_16_get_output_strides(((struct __pyx_obj_6pyfftw_6pyfftw_FFTW *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6pyfftw_6pyfftw_4FFTW_16_get_output_strides(struct __pyx_obj_6pyfftw_6pyfftw_FFTW *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_get_output_strides", 0); /* "pyfftw/pyfftw.pyx":752 * Return the strides of the output array for which the FFT is planned. * ''' * return self._output_strides # <<<<<<<<<<<<<< * * output_strides = property(_get_output_strides) */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->_output_strides); __pyx_r = __pyx_v_self->_output_strides; goto __pyx_L0; /* "pyfftw/pyfftw.pyx":748 * input_strides = property(_get_input_strides) * * def _get_output_strides(self): # <<<<<<<<<<<<<< * ''' * Return the strides of the output array for which the FFT is planned. */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pyfftw/pyfftw.pyx":756 * output_strides = property(_get_output_strides) * * def _get_input_shape(self): # <<<<<<<<<<<<<< * ''' * Return the shape of the input array for which the FFT is planned. */ /* Python wrapper */ static PyObject *__pyx_pw_6pyfftw_6pyfftw_4FFTW_19_get_input_shape(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_6pyfftw_6pyfftw_4FFTW_18_get_input_shape[] = "\n Return the shape of the input array for which the FFT is planned.\n "; static PyObject *__pyx_pw_6pyfftw_6pyfftw_4FFTW_19_get_input_shape(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_get_input_shape (wrapper)", 0); __pyx_r = __pyx_pf_6pyfftw_6pyfftw_4FFTW_18_get_input_shape(((struct __pyx_obj_6pyfftw_6pyfftw_FFTW *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6pyfftw_6pyfftw_4FFTW_18_get_input_shape(struct __pyx_obj_6pyfftw_6pyfftw_FFTW *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_get_input_shape", 0); /* "pyfftw/pyfftw.pyx":760 * Return the shape of the input array for which the FFT is planned. * ''' * return self._input_shape # <<<<<<<<<<<<<< * * input_shape = property(_get_input_shape) */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->_input_shape); __pyx_r = __pyx_v_self->_input_shape; goto __pyx_L0; /* "pyfftw/pyfftw.pyx":756 * output_strides = property(_get_output_strides) * * def _get_input_shape(self): # <<<<<<<<<<<<<< * ''' * Return the shape of the input array for which the FFT is planned. */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pyfftw/pyfftw.pyx":764 * input_shape = property(_get_input_shape) * * def _get_output_shape(self): # <<<<<<<<<<<<<< * ''' * Return the shape of the output array for which the FFT is planned. */ /* Python wrapper */ static PyObject *__pyx_pw_6pyfftw_6pyfftw_4FFTW_21_get_output_shape(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_6pyfftw_6pyfftw_4FFTW_20_get_output_shape[] = "\n Return the shape of the output array for which the FFT is planned.\n "; static PyObject *__pyx_pw_6pyfftw_6pyfftw_4FFTW_21_get_output_shape(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_get_output_shape (wrapper)", 0); __pyx_r = __pyx_pf_6pyfftw_6pyfftw_4FFTW_20_get_output_shape(((struct __pyx_obj_6pyfftw_6pyfftw_FFTW *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6pyfftw_6pyfftw_4FFTW_20_get_output_shape(struct __pyx_obj_6pyfftw_6pyfftw_FFTW *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_get_output_shape", 0); /* "pyfftw/pyfftw.pyx":768 * Return the shape of the output array for which the FFT is planned. * ''' * return self._output_shape # <<<<<<<<<<<<<< * * output_shape = property(_get_output_shape) */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->_output_shape); __pyx_r = __pyx_v_self->_output_shape; goto __pyx_L0; /* "pyfftw/pyfftw.pyx":764 * input_shape = property(_get_input_shape) * * def _get_output_shape(self): # <<<<<<<<<<<<<< * ''' * Return the shape of the output array for which the FFT is planned. */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pyfftw/pyfftw.pyx":772 * output_shape = property(_get_output_shape) * * def _get_input_dtype(self): # <<<<<<<<<<<<<< * ''' * Return the dtype of the input array for which the FFT is planned. */ /* Python wrapper */ static PyObject *__pyx_pw_6pyfftw_6pyfftw_4FFTW_23_get_input_dtype(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_6pyfftw_6pyfftw_4FFTW_22_get_input_dtype[] = "\n Return the dtype of the input array for which the FFT is planned.\n "; static PyObject *__pyx_pw_6pyfftw_6pyfftw_4FFTW_23_get_input_dtype(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_get_input_dtype (wrapper)", 0); __pyx_r = __pyx_pf_6pyfftw_6pyfftw_4FFTW_22_get_input_dtype(((struct __pyx_obj_6pyfftw_6pyfftw_FFTW *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6pyfftw_6pyfftw_4FFTW_22_get_input_dtype(struct __pyx_obj_6pyfftw_6pyfftw_FFTW *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_get_input_dtype", 0); /* "pyfftw/pyfftw.pyx":776 * Return the dtype of the input array for which the FFT is planned. * ''' * return self._input_dtype # <<<<<<<<<<<<<< * * input_dtype = property(_get_input_dtype) */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->_input_dtype); __pyx_r = __pyx_v_self->_input_dtype; goto __pyx_L0; /* "pyfftw/pyfftw.pyx":772 * output_shape = property(_get_output_shape) * * def _get_input_dtype(self): # <<<<<<<<<<<<<< * ''' * Return the dtype of the input array for which the FFT is planned. */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pyfftw/pyfftw.pyx":780 * input_dtype = property(_get_input_dtype) * * def _get_output_dtype(self): # <<<<<<<<<<<<<< * ''' * Return the shape of the output array for which the FFT is planned. */ /* Python wrapper */ static PyObject *__pyx_pw_6pyfftw_6pyfftw_4FFTW_25_get_output_dtype(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_6pyfftw_6pyfftw_4FFTW_24_get_output_dtype[] = "\n Return the shape of the output array for which the FFT is planned.\n "; static PyObject *__pyx_pw_6pyfftw_6pyfftw_4FFTW_25_get_output_dtype(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_get_output_dtype (wrapper)", 0); __pyx_r = __pyx_pf_6pyfftw_6pyfftw_4FFTW_24_get_output_dtype(((struct __pyx_obj_6pyfftw_6pyfftw_FFTW *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6pyfftw_6pyfftw_4FFTW_24_get_output_dtype(struct __pyx_obj_6pyfftw_6pyfftw_FFTW *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_get_output_dtype", 0); /* "pyfftw/pyfftw.pyx":784 * Return the shape of the output array for which the FFT is planned. * ''' * return self._output_dtype # <<<<<<<<<<<<<< * * output_dtype = property(_get_output_dtype) */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->_output_dtype); __pyx_r = __pyx_v_self->_output_dtype; goto __pyx_L0; /* "pyfftw/pyfftw.pyx":780 * input_dtype = property(_get_input_dtype) * * def _get_output_dtype(self): # <<<<<<<<<<<<<< * ''' * Return the shape of the output array for which the FFT is planned. */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pyfftw/pyfftw.pyx":788 * output_dtype = property(_get_output_dtype) * * def _get_direction(self): # <<<<<<<<<<<<<< * ''' * Return the planned FFT direction. Either `'FFTW_FORWARD'` or */ /* Python wrapper */ static PyObject *__pyx_pw_6pyfftw_6pyfftw_4FFTW_27_get_direction(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_6pyfftw_6pyfftw_4FFTW_26_get_direction[] = "\n Return the planned FFT direction. Either `'FFTW_FORWARD'` or \n `'FFTW_BACKWARD'`.\n "; static PyObject *__pyx_pw_6pyfftw_6pyfftw_4FFTW_27_get_direction(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_get_direction (wrapper)", 0); __pyx_r = __pyx_pf_6pyfftw_6pyfftw_4FFTW_26_get_direction(((struct __pyx_obj_6pyfftw_6pyfftw_FFTW *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6pyfftw_6pyfftw_4FFTW_26_get_direction(struct __pyx_obj_6pyfftw_6pyfftw_FFTW *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_get_direction", 0); /* "pyfftw/pyfftw.pyx":793 * `'FFTW_BACKWARD'`. * ''' * return directions_lookup[self._direction] # <<<<<<<<<<<<<< * * direction = property(_get_direction) */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_6pyfftw_6pyfftw_directions_lookup, __pyx_v_self->_direction, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 793; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pyfftw/pyfftw.pyx":788 * output_dtype = property(_get_output_dtype) * * def _get_direction(self): # <<<<<<<<<<<<<< * ''' * Return the planned FFT direction. Either `'FFTW_FORWARD'` or */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pyfftw.pyfftw.FFTW._get_direction", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pyfftw/pyfftw.pyx":797 * direction = property(_get_direction) * * def _get_axes(self): # <<<<<<<<<<<<<< * ''' * Return the axes for the planned FFT in canonical form. That is, as */ /* Python wrapper */ static PyObject *__pyx_pw_6pyfftw_6pyfftw_4FFTW_29_get_axes(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_6pyfftw_6pyfftw_4FFTW_28_get_axes[] = "\n Return the axes for the planned FFT in canonical form. That is, as\n a tuple of positive integers. The order in which they were passed\n is maintained.\n "; static PyObject *__pyx_pw_6pyfftw_6pyfftw_4FFTW_29_get_axes(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_get_axes (wrapper)", 0); __pyx_r = __pyx_pf_6pyfftw_6pyfftw_4FFTW_28_get_axes(((struct __pyx_obj_6pyfftw_6pyfftw_FFTW *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6pyfftw_6pyfftw_4FFTW_28_get_axes(struct __pyx_obj_6pyfftw_6pyfftw_FFTW *__pyx_v_self) { PyObject *__pyx_v_axes = NULL; int __pyx_v_i; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_get_axes", 0); /* "pyfftw/pyfftw.pyx":803 * is maintained. * ''' * axes = [] # <<<<<<<<<<<<<< * for i in range(self._rank): * axes.append(self._axes[i]) */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_axes = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pyfftw/pyfftw.pyx":804 * ''' * axes = [] * for i in range(self._rank): # <<<<<<<<<<<<<< * axes.append(self._axes[i]) * */ __pyx_t_2 = __pyx_v_self->_rank; for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { __pyx_v_i = __pyx_t_3; /* "pyfftw/pyfftw.pyx":805 * axes = [] * for i in range(self._rank): * axes.append(self._axes[i]) # <<<<<<<<<<<<<< * * return tuple(axes) */ __pyx_t_1 = __Pyx_PyInt_From_int64_t((__pyx_v_self->_axes[__pyx_v_i])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 805; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_axes, __pyx_t_1); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 805; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } /* "pyfftw/pyfftw.pyx":807 * axes.append(self._axes[i]) * * return tuple(axes) # <<<<<<<<<<<<<< * * axes = property(_get_axes) */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyList_AsTuple(__pyx_v_axes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pyfftw/pyfftw.pyx":797 * direction = property(_get_direction) * * def _get_axes(self): # <<<<<<<<<<<<<< * ''' * Return the axes for the planned FFT in canonical form. That is, as */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pyfftw.pyfftw.FFTW._get_axes", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_axes); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pyfftw/pyfftw.pyx":811 * axes = property(_get_axes) * * def __cinit__(self, input_array, output_array, axes=(-1,), # <<<<<<<<<<<<<< * direction='FFTW_FORWARD', flags=('FFTW_MEASURE',), * unsigned int threads=1, planning_timelimit=None, */ /* Python wrapper */ static int __pyx_pw_6pyfftw_6pyfftw_4FFTW_31__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_6pyfftw_6pyfftw_4FFTW_31__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_input_array = 0; PyObject *__pyx_v_output_array = 0; PyObject *__pyx_v_axes = 0; PyObject *__pyx_v_direction = 0; PyObject *__pyx_v_flags = 0; unsigned int __pyx_v_threads; PyObject *__pyx_v_planning_timelimit = 0; CYTHON_UNUSED PyObject *__pyx_v_args = 0; CYTHON_UNUSED PyObject *__pyx_v_kwargs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1; __Pyx_GOTREF(__pyx_v_kwargs); if (PyTuple_GET_SIZE(__pyx_args) > 7) { __pyx_v_args = PyTuple_GetSlice(__pyx_args, 7, PyTuple_GET_SIZE(__pyx_args)); if (unlikely(!__pyx_v_args)) { __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; __Pyx_RefNannyFinishContext(); return -1; } __Pyx_GOTREF(__pyx_v_args); } else { __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple); } { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input_array,&__pyx_n_s_output_array,&__pyx_n_s_axes,&__pyx_n_s_direction,&__pyx_n_s_flags,&__pyx_n_s_threads,&__pyx_n_s_planning_timelimit,0}; PyObject* values[7] = {0,0,0,0,0,0,0}; values[2] = ((PyObject *)__pyx_tuple__6); values[3] = ((PyObject *)__pyx_n_s_FFTW_FORWARD); /* "pyfftw/pyfftw.pyx":812 * * def __cinit__(self, input_array, output_array, axes=(-1,), * direction='FFTW_FORWARD', flags=('FFTW_MEASURE',), # <<<<<<<<<<<<<< * unsigned int threads=1, planning_timelimit=None, * *args, **kwargs): */ values[4] = ((PyObject *)__pyx_tuple__7); /* "pyfftw/pyfftw.pyx":813 * def __cinit__(self, input_array, output_array, axes=(-1,), * direction='FFTW_FORWARD', flags=('FFTW_MEASURE',), * unsigned int threads=1, planning_timelimit=None, # <<<<<<<<<<<<<< * *args, **kwargs): * */ values[6] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { default: case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_input_array)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_output_array)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 7, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_axes); if (value) { values[2] = value; kw_args--; } } case 3: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_direction); if (value) { values[3] = value; kw_args--; } } case 4: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flags); if (value) { values[4] = value; kw_args--; } } case 5: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_threads); if (value) { values[5] = value; kw_args--; } } case 6: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_planning_timelimit); if (value) { values[6] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { const Py_ssize_t used_pos_args = (pos_args < 7) ? pos_args : 7; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, used_pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { default: case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; case 1: case 0: goto __pyx_L5_argtuple_error; } } __pyx_v_input_array = values[0]; __pyx_v_output_array = values[1]; __pyx_v_axes = values[2]; __pyx_v_direction = values[3]; __pyx_v_flags = values[4]; if (values[5]) { __pyx_v_threads = __Pyx_PyInt_As_unsigned_int(values[5]); if (unlikely((__pyx_v_threads == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { __pyx_v_threads = ((unsigned int)1); } __pyx_v_planning_timelimit = values[6]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 7, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0; __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; __Pyx_AddTraceback("pyfftw.pyfftw.FFTW.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_6pyfftw_6pyfftw_4FFTW_30__cinit__(((struct __pyx_obj_6pyfftw_6pyfftw_FFTW *)__pyx_v_self), __pyx_v_input_array, __pyx_v_output_array, __pyx_v_axes, __pyx_v_direction, __pyx_v_flags, __pyx_v_threads, __pyx_v_planning_timelimit, __pyx_v_args, __pyx_v_kwargs); /* "pyfftw/pyfftw.pyx":811 * axes = property(_get_axes) * * def __cinit__(self, input_array, output_array, axes=(-1,), # <<<<<<<<<<<<<< * direction='FFTW_FORWARD', flags=('FFTW_MEASURE',), * unsigned int threads=1, planning_timelimit=None, */ /* function exit code */ __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kwargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_6pyfftw_6pyfftw_4FFTW_30__cinit__(struct __pyx_obj_6pyfftw_6pyfftw_FFTW *__pyx_v_self, PyObject *__pyx_v_input_array, PyObject *__pyx_v_output_array, PyObject *__pyx_v_axes, PyObject *__pyx_v_direction, PyObject *__pyx_v_flags, unsigned int __pyx_v_threads, PyObject *__pyx_v_planning_timelimit, CYTHON_UNUSED PyObject *__pyx_v_args, CYTHON_UNUSED PyObject *__pyx_v_kwargs) { double __pyx_v__planning_timelimit; PyObject *__pyx_v_input_dtype = NULL; PyObject *__pyx_v_output_dtype = NULL; PyObject *__pyx_v_scheme = NULL; PyObject *__pyx_v_functions = NULL; __pyx_t_6pyfftw_6pyfftw_fftw_generic_set_timelimit __pyx_v_set_timelimit_func; int __pyx_v_natural_input_alignment; int __pyx_v_natural_output_alignment; PyObject *__pyx_v_each_alignment = NULL; Py_ssize_t __pyx_v_n; int64_t __pyx_v_array_dimension; int64_t __pyx_v_unique_axes_length; int64_t *__pyx_v_unique_axes; int64_t *__pyx_v_not_axes; PyObject *__pyx_v_total_N = NULL; __pyx_t_6pyfftw_6pyfftw_validator __pyx_v__validator; PyObject *__pyx_v_each_flag = NULL; int __pyx_v_i; PyObject *__pyx_v_fft_shape_lookup = NULL; PyObject *__pyx_v_fft_shape = NULL; PyObject *__pyx_v_input_strides_array = NULL; PyObject *__pyx_v_output_strides_array = NULL; void *__pyx_v_plan; __pyx_t_6pyfftw_6pyfftw_fftw_generic_plan_guru __pyx_v_fftw_planner; int __pyx_v_rank; fftw_iodim *__pyx_v_dims; int __pyx_v_howmany_rank; fftw_iodim *__pyx_v_howmany_dims; void *__pyx_v__in; void *__pyx_v__out; int __pyx_v_sign; unsigned int __pyx_v_c_flags; PyObject *__pyx_v_stride = NULL; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; double __pyx_t_7; int __pyx_t_8; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; Py_ssize_t __pyx_t_12; PyObject *(*__pyx_t_13)(PyObject *); int __pyx_t_14; intptr_t __pyx_t_15; Py_ssize_t __pyx_t_16; int64_t __pyx_t_17; unsigned int __pyx_t_18; PyObject *__pyx_t_19 = NULL; PyObject *__pyx_t_20 = NULL; int __pyx_t_21; int __pyx_t_22; int __pyx_t_23; __pyx_t_6pyfftw_6pyfftw_fftw_generic_plan_guru __pyx_t_24; PyObject *__pyx_t_25 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 0); __Pyx_INCREF(__pyx_v_flags); /* "pyfftw/pyfftw.pyx":817 * * # Initialise the pointers that need to be freed * self._plan = NULL # <<<<<<<<<<<<<< * self._dims = NULL * self._howmany_dims = NULL */ __pyx_v_self->_plan = NULL; /* "pyfftw/pyfftw.pyx":818 * # Initialise the pointers that need to be freed * self._plan = NULL * self._dims = NULL # <<<<<<<<<<<<<< * self._howmany_dims = NULL * */ __pyx_v_self->_dims = NULL; /* "pyfftw/pyfftw.pyx":819 * self._plan = NULL * self._dims = NULL * self._howmany_dims = NULL # <<<<<<<<<<<<<< * * self._axes = NULL */ __pyx_v_self->_howmany_dims = NULL; /* "pyfftw/pyfftw.pyx":821 * self._howmany_dims = NULL * * self._axes = NULL # <<<<<<<<<<<<<< * self._not_axes = NULL * */ __pyx_v_self->_axes = NULL; /* "pyfftw/pyfftw.pyx":822 * * self._axes = NULL * self._not_axes = NULL # <<<<<<<<<<<<<< * * flags = list(flags) */ __pyx_v_self->_not_axes = NULL; /* "pyfftw/pyfftw.pyx":824 * self._not_axes = NULL * * flags = list(flags) # <<<<<<<<<<<<<< * * cdef double _planning_timelimit */ __pyx_t_1 = PySequence_List(__pyx_v_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_flags, __pyx_t_1); __pyx_t_1 = 0; /* "pyfftw/pyfftw.pyx":827 * * cdef double _planning_timelimit * if planning_timelimit is None: # <<<<<<<<<<<<<< * _planning_timelimit = FFTW_NO_TIMELIMIT * else: */ __pyx_t_2 = (__pyx_v_planning_timelimit == Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "pyfftw/pyfftw.pyx":828 * cdef double _planning_timelimit * if planning_timelimit is None: * _planning_timelimit = FFTW_NO_TIMELIMIT # <<<<<<<<<<<<<< * else: * try: */ __pyx_v__planning_timelimit = FFTW_NO_TIMELIMIT; /* "pyfftw/pyfftw.pyx":827 * * cdef double _planning_timelimit * if planning_timelimit is None: # <<<<<<<<<<<<<< * _planning_timelimit = FFTW_NO_TIMELIMIT * else: */ goto __pyx_L3; } /* "pyfftw/pyfftw.pyx":830 * _planning_timelimit = FFTW_NO_TIMELIMIT * else: * try: # <<<<<<<<<<<<<< * _planning_timelimit = planning_timelimit * except TypeError: */ /*else*/ { { __Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6); __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_6); /*try:*/ { /* "pyfftw/pyfftw.pyx":831 * else: * try: * _planning_timelimit = planning_timelimit # <<<<<<<<<<<<<< * except TypeError: * raise TypeError('Invalid planning timelimit: ' */ __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_v_planning_timelimit); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L4_error;} __pyx_v__planning_timelimit = __pyx_t_7; /* "pyfftw/pyfftw.pyx":830 * _planning_timelimit = FFTW_NO_TIMELIMIT * else: * try: # <<<<<<<<<<<<<< * _planning_timelimit = planning_timelimit * except TypeError: */ } __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L11_try_end; __pyx_L4_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pyfftw/pyfftw.pyx":832 * try: * _planning_timelimit = planning_timelimit * except TypeError: # <<<<<<<<<<<<<< * raise TypeError('Invalid planning timelimit: ' * 'The planning timelimit needs to be a float.') */ __pyx_t_8 = PyErr_ExceptionMatches(__pyx_builtin_TypeError); if (__pyx_t_8) { __Pyx_AddTraceback("pyfftw.pyfftw.FFTW.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_9, &__pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_9); __Pyx_GOTREF(__pyx_t_10); /* "pyfftw/pyfftw.pyx":833 * _planning_timelimit = planning_timelimit * except TypeError: * raise TypeError('Invalid planning timelimit: ' # <<<<<<<<<<<<<< * 'The planning timelimit needs to be a float.') * */ __pyx_t_11 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_Raise(__pyx_t_11, 0, 0, 0); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;} } goto __pyx_L6_except_error; __pyx_L6_except_error:; /* "pyfftw/pyfftw.pyx":830 * _planning_timelimit = FFTW_NO_TIMELIMIT * else: * try: # <<<<<<<<<<<<<< * _planning_timelimit = planning_timelimit * except TypeError: */ __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_XGIVEREF(__pyx_t_6); __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); goto __pyx_L1_error; __pyx_L11_try_end:; } } __pyx_L3:; /* "pyfftw/pyfftw.pyx":836 * 'The planning timelimit needs to be a float.') * * if not isinstance(input_array, np.ndarray): # <<<<<<<<<<<<<< * raise ValueError('Invalid input array: ' * 'The input array needs to be an instance ' */ __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_input_array, __pyx_ptype_5numpy_ndarray); __pyx_t_2 = ((!(__pyx_t_3 != 0)) != 0); if (__pyx_t_2) { /* "pyfftw/pyfftw.pyx":837 * * if not isinstance(input_array, np.ndarray): * raise ValueError('Invalid input array: ' # <<<<<<<<<<<<<< * 'The input array needs to be an instance ' * 'of numpy.ndarray') */ __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_Raise(__pyx_t_10, 0, 0, 0); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pyfftw/pyfftw.pyx":836 * 'The planning timelimit needs to be a float.') * * if not isinstance(input_array, np.ndarray): # <<<<<<<<<<<<<< * raise ValueError('Invalid input array: ' * 'The input array needs to be an instance ' */ } /* "pyfftw/pyfftw.pyx":841 * 'of numpy.ndarray') * * if not isinstance(output_array, np.ndarray): # <<<<<<<<<<<<<< * raise ValueError('Invalid output array: ' * 'The output array needs to be an instance ' */ __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_output_array, __pyx_ptype_5numpy_ndarray); __pyx_t_3 = ((!(__pyx_t_2 != 0)) != 0); if (__pyx_t_3) { /* "pyfftw/pyfftw.pyx":842 * * if not isinstance(output_array, np.ndarray): * raise ValueError('Invalid output array: ' # <<<<<<<<<<<<<< * 'The output array needs to be an instance ' * 'of numpy.ndarray') */ __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_Raise(__pyx_t_10, 0, 0, 0); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pyfftw/pyfftw.pyx":841 * 'of numpy.ndarray') * * if not isinstance(output_array, np.ndarray): # <<<<<<<<<<<<<< * raise ValueError('Invalid output array: ' * 'The output array needs to be an instance ' */ } /* "pyfftw/pyfftw.pyx":846 * 'of numpy.ndarray') * * try: # <<<<<<<<<<<<<< * input_dtype = input_array.dtype * output_dtype = output_array.dtype */ { __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_4); /*try:*/ { /* "pyfftw/pyfftw.pyx":847 * * try: * input_dtype = input_array.dtype # <<<<<<<<<<<<<< * output_dtype = output_array.dtype * scheme = fftw_schemes[(input_dtype, output_dtype)] */ __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_input_array, __pyx_n_s_dtype); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 847; __pyx_clineno = __LINE__; goto __pyx_L16_error;} __Pyx_GOTREF(__pyx_t_10); __pyx_v_input_dtype = __pyx_t_10; __pyx_t_10 = 0; /* "pyfftw/pyfftw.pyx":848 * try: * input_dtype = input_array.dtype * output_dtype = output_array.dtype # <<<<<<<<<<<<<< * scheme = fftw_schemes[(input_dtype, output_dtype)] * except KeyError: */ __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_output_array, __pyx_n_s_dtype); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L16_error;} __Pyx_GOTREF(__pyx_t_10); __pyx_v_output_dtype = __pyx_t_10; __pyx_t_10 = 0; /* "pyfftw/pyfftw.pyx":849 * input_dtype = input_array.dtype * output_dtype = output_array.dtype * scheme = fftw_schemes[(input_dtype, output_dtype)] # <<<<<<<<<<<<<< * except KeyError: * raise ValueError('Invalid scheme: ' */ __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L16_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_INCREF(__pyx_v_input_dtype); __Pyx_GIVEREF(__pyx_v_input_dtype); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_input_dtype); __Pyx_INCREF(__pyx_v_output_dtype); __Pyx_GIVEREF(__pyx_v_output_dtype); PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_v_output_dtype); __pyx_t_9 = PyObject_GetItem(__pyx_v_6pyfftw_6pyfftw_fftw_schemes, __pyx_t_10); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L16_error;}; __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_v_scheme = __pyx_t_9; __pyx_t_9 = 0; /* "pyfftw/pyfftw.pyx":846 * 'of numpy.ndarray') * * try: # <<<<<<<<<<<<<< * input_dtype = input_array.dtype * output_dtype = output_array.dtype */ } __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L23_try_end; __pyx_L16_error:; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; /* "pyfftw/pyfftw.pyx":850 * output_dtype = output_array.dtype * scheme = fftw_schemes[(input_dtype, output_dtype)] * except KeyError: # <<<<<<<<<<<<<< * raise ValueError('Invalid scheme: ' * 'The output array and input array dtypes ' */ __pyx_t_8 = PyErr_ExceptionMatches(__pyx_builtin_KeyError); if (__pyx_t_8) { __Pyx_AddTraceback("pyfftw.pyfftw.FFTW.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_10, &__pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 850; __pyx_clineno = __LINE__; goto __pyx_L18_except_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_GOTREF(__pyx_t_10); __Pyx_GOTREF(__pyx_t_1); /* "pyfftw/pyfftw.pyx":851 * scheme = fftw_schemes[(input_dtype, output_dtype)] * except KeyError: * raise ValueError('Invalid scheme: ' # <<<<<<<<<<<<<< * 'The output array and input array dtypes ' * 'do not correspond to a valid fftw scheme.') */ __pyx_t_11 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 851; __pyx_clineno = __LINE__; goto __pyx_L18_except_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_Raise(__pyx_t_11, 0, 0, 0); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 851; __pyx_clineno = __LINE__; goto __pyx_L18_except_error;} } goto __pyx_L18_except_error; __pyx_L18_except_error:; /* "pyfftw/pyfftw.pyx":846 * 'of numpy.ndarray') * * try: # <<<<<<<<<<<<<< * input_dtype = input_array.dtype * output_dtype = output_array.dtype */ __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_5, __pyx_t_4); goto __pyx_L1_error; __pyx_L23_try_end:; } /* "pyfftw/pyfftw.pyx":855 * 'do not correspond to a valid fftw scheme.') * * self._input_dtype = input_dtype # <<<<<<<<<<<<<< * self._output_dtype = output_dtype * */ __Pyx_INCREF(__pyx_v_input_dtype); __Pyx_GIVEREF(__pyx_v_input_dtype); __Pyx_GOTREF(__pyx_v_self->_input_dtype); __Pyx_DECREF(__pyx_v_self->_input_dtype); __pyx_v_self->_input_dtype = __pyx_v_input_dtype; /* "pyfftw/pyfftw.pyx":856 * * self._input_dtype = input_dtype * self._output_dtype = output_dtype # <<<<<<<<<<<<<< * * functions = scheme_functions[scheme] */ __Pyx_INCREF(__pyx_v_output_dtype); __Pyx_GIVEREF(__pyx_v_output_dtype); __Pyx_GOTREF(__pyx_v_self->_output_dtype); __Pyx_DECREF(__pyx_v_self->_output_dtype); __pyx_v_self->_output_dtype = __pyx_v_output_dtype; /* "pyfftw/pyfftw.pyx":858 * self._output_dtype = output_dtype * * functions = scheme_functions[scheme] # <<<<<<<<<<<<<< * * self._fftw_planner = planners[functions['planner']] */ __pyx_t_1 = PyObject_GetItem(__pyx_v_6pyfftw_6pyfftw_scheme_functions, __pyx_v_scheme); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); __pyx_v_functions = __pyx_t_1; __pyx_t_1 = 0; /* "pyfftw/pyfftw.pyx":860 * functions = scheme_functions[scheme] * * self._fftw_planner = planners[functions['planner']] # <<<<<<<<<<<<<< * self._fftw_execute = executors[functions['executor']] * self._fftw_destroy = destroyers[functions['generic_precision']] */ __pyx_t_1 = PyObject_GetItem(__pyx_v_functions, __pyx_n_s_planner); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_self->_fftw_planner = (__pyx_v_6pyfftw_6pyfftw_planners[__pyx_t_12]); /* "pyfftw/pyfftw.pyx":861 * * self._fftw_planner = planners[functions['planner']] * self._fftw_execute = executors[functions['executor']] # <<<<<<<<<<<<<< * self._fftw_destroy = destroyers[functions['generic_precision']] * */ __pyx_t_1 = PyObject_GetItem(__pyx_v_functions, __pyx_n_s_executor); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_self->_fftw_execute = (__pyx_v_6pyfftw_6pyfftw_executors[__pyx_t_12]); /* "pyfftw/pyfftw.pyx":862 * self._fftw_planner = planners[functions['planner']] * self._fftw_execute = executors[functions['executor']] * self._fftw_destroy = destroyers[functions['generic_precision']] # <<<<<<<<<<<<<< * * self._nthreads_plan_setter = ( */ __pyx_t_1 = PyObject_GetItem(__pyx_v_functions, __pyx_n_s_generic_precision); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_self->_fftw_destroy = (__pyx_v_6pyfftw_6pyfftw_destroyers[__pyx_t_12]); /* "pyfftw/pyfftw.pyx":865 * * self._nthreads_plan_setter = ( * nthreads_plan_setters[functions['generic_precision']]) # <<<<<<<<<<<<<< * * cdef fftw_generic_set_timelimit set_timelimit_func = ( */ __pyx_t_1 = PyObject_GetItem(__pyx_v_functions, __pyx_n_s_generic_precision); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pyfftw/pyfftw.pyx":864 * self._fftw_destroy = destroyers[functions['generic_precision']] * * self._nthreads_plan_setter = ( # <<<<<<<<<<<<<< * nthreads_plan_setters[functions['generic_precision']]) * */ __pyx_v_self->_nthreads_plan_setter = (__pyx_v_6pyfftw_6pyfftw_nthreads_plan_setters[__pyx_t_12]); /* "pyfftw/pyfftw.pyx":868 * * cdef fftw_generic_set_timelimit set_timelimit_func = ( * set_timelimit_funcs[functions['generic_precision']]) # <<<<<<<<<<<<<< * * # We're interested in the natural alignment on the real type, not */ __pyx_t_1 = PyObject_GetItem(__pyx_v_functions, __pyx_n_s_generic_precision); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_set_timelimit_func = (__pyx_v_6pyfftw_6pyfftw_set_timelimit_funcs[__pyx_t_12]); /* "pyfftw/pyfftw.pyx":874 * # numpy reported an alignment on a complex dtype that was different * # to that on the real type. * cdef int natural_input_alignment = input_array.real.dtype.alignment # <<<<<<<<<<<<<< * cdef int natural_output_alignment = output_array.real.dtype.alignment * */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_input_array, __pyx_n_s_real); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_dtype); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_alignment); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_natural_input_alignment = __pyx_t_8; /* "pyfftw/pyfftw.pyx":875 * # to that on the real type. * cdef int natural_input_alignment = input_array.real.dtype.alignment * cdef int natural_output_alignment = output_array.real.dtype.alignment # <<<<<<<<<<<<<< * * # If either of the arrays is not aligned on a 16-byte boundary, */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_output_array, __pyx_n_s_real); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_dtype); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_alignment); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_natural_output_alignment = __pyx_t_8; /* "pyfftw/pyfftw.pyx":880 * # we set the FFTW_UNALIGNED flag. This disables SIMD. * # (16 bytes is assumed to be the minimal alignment) * if 'FFTW_UNALIGNED' in flags: # <<<<<<<<<<<<<< * self._simd_allowed = False * self._input_array_alignment = natural_input_alignment */ __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_n_s_FFTW_UNALIGNED, __pyx_v_flags, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 880; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { /* "pyfftw/pyfftw.pyx":881 * # (16 bytes is assumed to be the minimal alignment) * if 'FFTW_UNALIGNED' in flags: * self._simd_allowed = False # <<<<<<<<<<<<<< * self._input_array_alignment = natural_input_alignment * self._output_array_alignment = natural_output_alignment */ __pyx_v_self->_simd_allowed = 0; /* "pyfftw/pyfftw.pyx":882 * if 'FFTW_UNALIGNED' in flags: * self._simd_allowed = False * self._input_array_alignment = natural_input_alignment # <<<<<<<<<<<<<< * self._output_array_alignment = natural_output_alignment * */ __pyx_v_self->_input_array_alignment = __pyx_v_natural_input_alignment; /* "pyfftw/pyfftw.pyx":883 * self._simd_allowed = False * self._input_array_alignment = natural_input_alignment * self._output_array_alignment = natural_output_alignment # <<<<<<<<<<<<<< * * else: */ __pyx_v_self->_output_array_alignment = __pyx_v_natural_output_alignment; /* "pyfftw/pyfftw.pyx":880 * # we set the FFTW_UNALIGNED flag. This disables SIMD. * # (16 bytes is assumed to be the minimal alignment) * if 'FFTW_UNALIGNED' in flags: # <<<<<<<<<<<<<< * self._simd_allowed = False * self._input_array_alignment = natural_input_alignment */ goto __pyx_L26; } /* "pyfftw/pyfftw.pyx":887 * else: * * self._input_array_alignment = -1 # <<<<<<<<<<<<<< * self._output_array_alignment = -1 * */ /*else*/ { __pyx_v_self->_input_array_alignment = -1; /* "pyfftw/pyfftw.pyx":888 * * self._input_array_alignment = -1 * self._output_array_alignment = -1 # <<<<<<<<<<<<<< * * for each_alignment in _valid_simd_alignments: */ __pyx_v_self->_output_array_alignment = -1; /* "pyfftw/pyfftw.pyx":890 * self._output_array_alignment = -1 * * for each_alignment in _valid_simd_alignments: # <<<<<<<<<<<<<< * if (np.PyArray_DATA(input_array) % * each_alignment == 0 and */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_valid_simd_alignments); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_10 = __pyx_t_1; __Pyx_INCREF(__pyx_t_10); __pyx_t_12 = 0; __pyx_t_13 = NULL; } else { __pyx_t_12 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __pyx_t_13 = Py_TYPE(__pyx_t_10)->tp_iternext; if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { if (likely(!__pyx_t_13)) { if (likely(PyList_CheckExact(__pyx_t_10))) { if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_10)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_1 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_12); __Pyx_INCREF(__pyx_t_1); __pyx_t_12++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_1 = PySequence_ITEM(__pyx_t_10, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); #endif } else { if (__pyx_t_12 >= PyTuple_GET_SIZE(__pyx_t_10)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_12); __Pyx_INCREF(__pyx_t_1); __pyx_t_12++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_1 = PySequence_ITEM(__pyx_t_10, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); #endif } } else { __pyx_t_1 = __pyx_t_13(__pyx_t_10); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } __Pyx_GOTREF(__pyx_t_1); } __Pyx_XDECREF_SET(__pyx_v_each_alignment, __pyx_t_1); __pyx_t_1 = 0; /* "pyfftw/pyfftw.pyx":891 * * for each_alignment in _valid_simd_alignments: * if (np.PyArray_DATA(input_array) % # <<<<<<<<<<<<<< * each_alignment == 0 and * np.PyArray_DATA(output_array) % */ if (!(likely(((__pyx_v_input_array) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_input_array, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_1 = PyInt_FromSsize_t(((intptr_t)PyArray_DATA(((PyArrayObject *)__pyx_v_input_array)))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); /* "pyfftw/pyfftw.pyx":892 * for each_alignment in _valid_simd_alignments: * if (np.PyArray_DATA(input_array) % * each_alignment == 0 and # <<<<<<<<<<<<<< * np.PyArray_DATA(output_array) % * each_alignment == 0): */ __pyx_t_9 = PyNumber_Remainder(__pyx_t_1, __pyx_v_each_alignment); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_t_9, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 892; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 892; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L30_bool_binop_done; } /* "pyfftw/pyfftw.pyx":893 * if (np.PyArray_DATA(input_array) % * each_alignment == 0 and * np.PyArray_DATA(output_array) % # <<<<<<<<<<<<<< * each_alignment == 0): * */ if (!(likely(((__pyx_v_output_array) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_output_array, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_1 = PyInt_FromSsize_t(((intptr_t)PyArray_DATA(((PyArrayObject *)__pyx_v_output_array)))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); /* "pyfftw/pyfftw.pyx":894 * each_alignment == 0 and * np.PyArray_DATA(output_array) % * each_alignment == 0): # <<<<<<<<<<<<<< * * self._simd_allowed = True */ __pyx_t_9 = PyNumber_Remainder(__pyx_t_1, __pyx_v_each_alignment); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_t_9, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_2 = __pyx_t_3; __pyx_L30_bool_binop_done:; /* "pyfftw/pyfftw.pyx":891 * * for each_alignment in _valid_simd_alignments: * if (np.PyArray_DATA(input_array) % # <<<<<<<<<<<<<< * each_alignment == 0 and * np.PyArray_DATA(output_array) % */ if (__pyx_t_2) { /* "pyfftw/pyfftw.pyx":896 * each_alignment == 0): * * self._simd_allowed = True # <<<<<<<<<<<<<< * * self._input_array_alignment = each_alignment */ __pyx_v_self->_simd_allowed = 1; /* "pyfftw/pyfftw.pyx":898 * self._simd_allowed = True * * self._input_array_alignment = each_alignment # <<<<<<<<<<<<<< * self._output_array_alignment = each_alignment * */ __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_v_each_alignment); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 898; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->_input_array_alignment = __pyx_t_8; /* "pyfftw/pyfftw.pyx":899 * * self._input_array_alignment = each_alignment * self._output_array_alignment = each_alignment # <<<<<<<<<<<<<< * * break */ __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_v_each_alignment); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 899; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->_output_array_alignment = __pyx_t_8; /* "pyfftw/pyfftw.pyx":901 * self._output_array_alignment = each_alignment * * break # <<<<<<<<<<<<<< * * if (self._input_array_alignment == -1 or */ goto __pyx_L28_break; /* "pyfftw/pyfftw.pyx":891 * * for each_alignment in _valid_simd_alignments: * if (np.PyArray_DATA(input_array) % # <<<<<<<<<<<<<< * each_alignment == 0 and * np.PyArray_DATA(output_array) % */ } /* "pyfftw/pyfftw.pyx":890 * self._output_array_alignment = -1 * * for each_alignment in _valid_simd_alignments: # <<<<<<<<<<<<<< * if (np.PyArray_DATA(input_array) % * each_alignment == 0 and */ } __pyx_L28_break:; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "pyfftw/pyfftw.pyx":903 * break * * if (self._input_array_alignment == -1 or # <<<<<<<<<<<<<< * self._output_array_alignment == -1): * */ __pyx_t_3 = ((__pyx_v_self->_input_array_alignment == -1L) != 0); if (!__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L33_bool_binop_done; } /* "pyfftw/pyfftw.pyx":904 * * if (self._input_array_alignment == -1 or * self._output_array_alignment == -1): # <<<<<<<<<<<<<< * * self._simd_allowed = False */ __pyx_t_3 = ((__pyx_v_self->_output_array_alignment == -1L) != 0); __pyx_t_2 = __pyx_t_3; __pyx_L33_bool_binop_done:; /* "pyfftw/pyfftw.pyx":903 * break * * if (self._input_array_alignment == -1 or # <<<<<<<<<<<<<< * self._output_array_alignment == -1): * */ if (__pyx_t_2) { /* "pyfftw/pyfftw.pyx":906 * self._output_array_alignment == -1): * * self._simd_allowed = False # <<<<<<<<<<<<<< * * self._input_array_alignment = ( */ __pyx_v_self->_simd_allowed = 0; /* "pyfftw/pyfftw.pyx":908 * self._simd_allowed = False * * self._input_array_alignment = ( # <<<<<<<<<<<<<< * natural_input_alignment) * self._output_array_alignment = ( */ __pyx_v_self->_input_array_alignment = __pyx_v_natural_input_alignment; /* "pyfftw/pyfftw.pyx":910 * self._input_array_alignment = ( * natural_input_alignment) * self._output_array_alignment = ( # <<<<<<<<<<<<<< * natural_output_alignment) * flags.append('FFTW_UNALIGNED') */ __pyx_v_self->_output_array_alignment = __pyx_v_natural_output_alignment; /* "pyfftw/pyfftw.pyx":912 * self._output_array_alignment = ( * natural_output_alignment) * flags.append('FFTW_UNALIGNED') # <<<<<<<<<<<<<< * * if (not (np.PyArray_DATA(input_array) */ __pyx_t_14 = __Pyx_PyObject_Append(__pyx_v_flags, __pyx_n_s_FFTW_UNALIGNED); if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pyfftw/pyfftw.pyx":903 * break * * if (self._input_array_alignment == -1 or # <<<<<<<<<<<<<< * self._output_array_alignment == -1): * */ } } __pyx_L26:; /* "pyfftw/pyfftw.pyx":914 * flags.append('FFTW_UNALIGNED') * * if (not (np.PyArray_DATA(input_array) # <<<<<<<<<<<<<< * % self._input_array_alignment == 0)): * raise ValueError('Invalid input alignment: ' */ if (!(likely(((__pyx_v_input_array) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_input_array, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_15 = ((intptr_t)PyArray_DATA(((PyArrayObject *)__pyx_v_input_array))); /* "pyfftw/pyfftw.pyx":915 * * if (not (np.PyArray_DATA(input_array) * % self._input_array_alignment == 0)): # <<<<<<<<<<<<<< * raise ValueError('Invalid input alignment: ' * 'The input array is expected to lie on a %d ' */ if (unlikely(__pyx_v_self->_input_array_alignment == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 915; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } /* "pyfftw/pyfftw.pyx":914 * flags.append('FFTW_UNALIGNED') * * if (not (np.PyArray_DATA(input_array) # <<<<<<<<<<<<<< * % self._input_array_alignment == 0)): * raise ValueError('Invalid input alignment: ' */ __pyx_t_2 = ((!((__Pyx_mod_intptr_t(__pyx_t_15, __pyx_v_self->_input_array_alignment) == 0) != 0)) != 0); if (__pyx_t_2) { /* "pyfftw/pyfftw.pyx":918 * raise ValueError('Invalid input alignment: ' * 'The input array is expected to lie on a %d ' * 'byte boundary.' % self._input_array_alignment) # <<<<<<<<<<<<<< * * if (not (np.PyArray_DATA(output_array) */ __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_self->_input_array_alignment); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_input_alignment_The_inpu, __pyx_t_10); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "pyfftw/pyfftw.pyx":916 * if (not (np.PyArray_DATA(input_array) * % self._input_array_alignment == 0)): * raise ValueError('Invalid input alignment: ' # <<<<<<<<<<<<<< * 'The input array is expected to lie on a %d ' * 'byte boundary.' % self._input_array_alignment) */ __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pyfftw/pyfftw.pyx":914 * flags.append('FFTW_UNALIGNED') * * if (not (np.PyArray_DATA(input_array) # <<<<<<<<<<<<<< * % self._input_array_alignment == 0)): * raise ValueError('Invalid input alignment: ' */ } /* "pyfftw/pyfftw.pyx":920 * 'byte boundary.' % self._input_array_alignment) * * if (not (np.PyArray_DATA(output_array) # <<<<<<<<<<<<<< * % self._output_array_alignment == 0)): * raise ValueError('Invalid output alignment: ' */ if (!(likely(((__pyx_v_output_array) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_output_array, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_15 = ((intptr_t)PyArray_DATA(((PyArrayObject *)__pyx_v_output_array))); /* "pyfftw/pyfftw.pyx":921 * * if (not (np.PyArray_DATA(output_array) * % self._output_array_alignment == 0)): # <<<<<<<<<<<<<< * raise ValueError('Invalid output alignment: ' * 'The output array is expected to lie on a %d ' */ if (unlikely(__pyx_v_self->_output_array_alignment == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } /* "pyfftw/pyfftw.pyx":920 * 'byte boundary.' % self._input_array_alignment) * * if (not (np.PyArray_DATA(output_array) # <<<<<<<<<<<<<< * % self._output_array_alignment == 0)): * raise ValueError('Invalid output alignment: ' */ __pyx_t_2 = ((!((__Pyx_mod_intptr_t(__pyx_t_15, __pyx_v_self->_output_array_alignment) == 0) != 0)) != 0); if (__pyx_t_2) { /* "pyfftw/pyfftw.pyx":924 * raise ValueError('Invalid output alignment: ' * 'The output array is expected to lie on a %d ' * 'byte boundary.' % self._output_array_alignment) # <<<<<<<<<<<<<< * * if not direction in scheme_directions[scheme]: */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_output_array_alignment); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_10 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_output_alignment_The_out, __pyx_t_1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pyfftw/pyfftw.pyx":922 * if (not (np.PyArray_DATA(output_array) * % self._output_array_alignment == 0)): * raise ValueError('Invalid output alignment: ' # <<<<<<<<<<<<<< * 'The output array is expected to lie on a %d ' * 'byte boundary.' % self._output_array_alignment) */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_10, 0, 0, 0); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pyfftw/pyfftw.pyx":920 * 'byte boundary.' % self._input_array_alignment) * * if (not (np.PyArray_DATA(output_array) # <<<<<<<<<<<<<< * % self._output_array_alignment == 0)): * raise ValueError('Invalid output alignment: ' */ } /* "pyfftw/pyfftw.pyx":926 * 'byte boundary.' % self._output_array_alignment) * * if not direction in scheme_directions[scheme]: # <<<<<<<<<<<<<< * raise ValueError('Invalid direction: ' * 'The direction is not valid for the scheme. ' */ __pyx_t_10 = PyObject_GetItem(__pyx_v_6pyfftw_6pyfftw_scheme_directions, __pyx_v_scheme); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_10); __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_direction, __pyx_t_10, Py_NE)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "pyfftw/pyfftw.pyx":927 * * if not direction in scheme_directions[scheme]: * raise ValueError('Invalid direction: ' # <<<<<<<<<<<<<< * 'The direction is not valid for the scheme. ' * 'Try setting it explicitly if it is not already.') */ __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_Raise(__pyx_t_10, 0, 0, 0); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pyfftw/pyfftw.pyx":926 * 'byte boundary.' % self._output_array_alignment) * * if not direction in scheme_directions[scheme]: # <<<<<<<<<<<<<< * raise ValueError('Invalid direction: ' * 'The direction is not valid for the scheme. ' */ } /* "pyfftw/pyfftw.pyx":931 * 'Try setting it explicitly if it is not already.') * * self._direction = directions[direction] # <<<<<<<<<<<<<< * self._input_shape = input_array.shape * self._output_shape = output_array.shape */ __pyx_t_10 = PyObject_GetItem(__pyx_v_6pyfftw_6pyfftw_directions, __pyx_v_direction); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_10); __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_10); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_v_self->_direction = __pyx_t_8; /* "pyfftw/pyfftw.pyx":932 * * self._direction = directions[direction] * self._input_shape = input_array.shape # <<<<<<<<<<<<<< * self._output_shape = output_array.shape * */ __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_input_array, __pyx_n_s_shape); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_10); __Pyx_GOTREF(__pyx_v_self->_input_shape); __Pyx_DECREF(__pyx_v_self->_input_shape); __pyx_v_self->_input_shape = __pyx_t_10; __pyx_t_10 = 0; /* "pyfftw/pyfftw.pyx":933 * self._direction = directions[direction] * self._input_shape = input_array.shape * self._output_shape = output_array.shape # <<<<<<<<<<<<<< * * self._input_array = input_array */ __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_output_array, __pyx_n_s_shape); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_10); __Pyx_GOTREF(__pyx_v_self->_output_shape); __Pyx_DECREF(__pyx_v_self->_output_shape); __pyx_v_self->_output_shape = __pyx_t_10; __pyx_t_10 = 0; /* "pyfftw/pyfftw.pyx":935 * self._output_shape = output_array.shape * * self._input_array = input_array # <<<<<<<<<<<<<< * self._output_array = output_array * */ if (!(likely(((__pyx_v_input_array) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_input_array, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_10 = __pyx_v_input_array; __Pyx_INCREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_10); __Pyx_GOTREF(__pyx_v_self->_input_array); __Pyx_DECREF(((PyObject *)__pyx_v_self->_input_array)); __pyx_v_self->_input_array = ((PyArrayObject *)__pyx_t_10); __pyx_t_10 = 0; /* "pyfftw/pyfftw.pyx":936 * * self._input_array = input_array * self._output_array = output_array # <<<<<<<<<<<<<< * * self._axes = malloc(len(axes)*sizeof(int64_t)) */ if (!(likely(((__pyx_v_output_array) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_output_array, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_10 = __pyx_v_output_array; __Pyx_INCREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_10); __Pyx_GOTREF(__pyx_v_self->_output_array); __Pyx_DECREF(((PyObject *)__pyx_v_self->_output_array)); __pyx_v_self->_output_array = ((PyArrayObject *)__pyx_t_10); __pyx_t_10 = 0; /* "pyfftw/pyfftw.pyx":938 * self._output_array = output_array * * self._axes = malloc(len(axes)*sizeof(int64_t)) # <<<<<<<<<<<<<< * for n in range(len(axes)): * self._axes[n] = axes[n] */ __pyx_t_12 = PyObject_Length(__pyx_v_axes); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 938; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->_axes = ((int64_t *)malloc((__pyx_t_12 * (sizeof(int64_t))))); /* "pyfftw/pyfftw.pyx":939 * * self._axes = malloc(len(axes)*sizeof(int64_t)) * for n in range(len(axes)): # <<<<<<<<<<<<<< * self._axes[n] = axes[n] * */ __pyx_t_12 = PyObject_Length(__pyx_v_axes); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; __pyx_clineno = __LINE__; goto __pyx_L1_error;} for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_12; __pyx_t_16+=1) { __pyx_v_n = __pyx_t_16; /* "pyfftw/pyfftw.pyx":940 * self._axes = malloc(len(axes)*sizeof(int64_t)) * for n in range(len(axes)): * self._axes[n] = axes[n] # <<<<<<<<<<<<<< * * # Set the negative entries to their actual index (use the size */ __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_axes, __pyx_v_n, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_10); __pyx_t_17 = __Pyx_PyInt_As_int64_t(__pyx_t_10); if (unlikely((__pyx_t_17 == (int64_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; (__pyx_v_self->_axes[__pyx_v_n]) = __pyx_t_17; } /* "pyfftw/pyfftw.pyx":944 * # Set the negative entries to their actual index (use the size * # of the shape array for this) * cdef int64_t array_dimension = len(self._input_shape) # <<<<<<<<<<<<<< * * for n in range(len(axes)): */ __pyx_t_10 = __pyx_v_self->_input_shape; __Pyx_INCREF(__pyx_t_10); __pyx_t_12 = PyObject_Length(__pyx_t_10); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_v_array_dimension = __pyx_t_12; /* "pyfftw/pyfftw.pyx":946 * cdef int64_t array_dimension = len(self._input_shape) * * for n in range(len(axes)): # <<<<<<<<<<<<<< * if self._axes[n] < 0: * self._axes[n] = self._axes[n] + array_dimension */ __pyx_t_12 = PyObject_Length(__pyx_v_axes); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;} for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_12; __pyx_t_16+=1) { __pyx_v_n = __pyx_t_16; /* "pyfftw/pyfftw.pyx":947 * * for n in range(len(axes)): * if self._axes[n] < 0: # <<<<<<<<<<<<<< * self._axes[n] = self._axes[n] + array_dimension * */ __pyx_t_3 = (((__pyx_v_self->_axes[__pyx_v_n]) < 0) != 0); if (__pyx_t_3) { /* "pyfftw/pyfftw.pyx":948 * for n in range(len(axes)): * if self._axes[n] < 0: * self._axes[n] = self._axes[n] + array_dimension # <<<<<<<<<<<<<< * * if self._axes[n] >= array_dimension or self._axes[n] < 0: */ (__pyx_v_self->_axes[__pyx_v_n]) = ((__pyx_v_self->_axes[__pyx_v_n]) + __pyx_v_array_dimension); /* "pyfftw/pyfftw.pyx":947 * * for n in range(len(axes)): * if self._axes[n] < 0: # <<<<<<<<<<<<<< * self._axes[n] = self._axes[n] + array_dimension * */ } /* "pyfftw/pyfftw.pyx":950 * self._axes[n] = self._axes[n] + array_dimension * * if self._axes[n] >= array_dimension or self._axes[n] < 0: # <<<<<<<<<<<<<< * raise IndexError('Invalid axes: ' * 'The axes list cannot contain invalid axes.') */ __pyx_t_2 = (((__pyx_v_self->_axes[__pyx_v_n]) >= __pyx_v_array_dimension) != 0); if (!__pyx_t_2) { } else { __pyx_t_3 = __pyx_t_2; goto __pyx_L44_bool_binop_done; } __pyx_t_2 = (((__pyx_v_self->_axes[__pyx_v_n]) < 0) != 0); __pyx_t_3 = __pyx_t_2; __pyx_L44_bool_binop_done:; if (__pyx_t_3) { /* "pyfftw/pyfftw.pyx":951 * * if self._axes[n] >= array_dimension or self._axes[n] < 0: * raise IndexError('Invalid axes: ' # <<<<<<<<<<<<<< * 'The axes list cannot contain invalid axes.') * */ __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 951; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_Raise(__pyx_t_10, 0, 0, 0); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 951; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pyfftw/pyfftw.pyx":950 * self._axes[n] = self._axes[n] + array_dimension * * if self._axes[n] >= array_dimension or self._axes[n] < 0: # <<<<<<<<<<<<<< * raise IndexError('Invalid axes: ' * 'The axes list cannot contain invalid axes.') */ } } /* "pyfftw/pyfftw.pyx":958 * cdef int64_t *not_axes * * make_axes_unique(self._axes, len(axes), &unique_axes, # <<<<<<<<<<<<<< * ¬_axes, array_dimension, &unique_axes_length) * */ __pyx_t_12 = PyObject_Length(__pyx_v_axes); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pyfftw/pyfftw.pyx":959 * * make_axes_unique(self._axes, len(axes), &unique_axes, * ¬_axes, array_dimension, &unique_axes_length) # <<<<<<<<<<<<<< * * # and assign axes and not_axes to the filled arrays */ __pyx_f_6pyfftw_6pyfftw_make_axes_unique(__pyx_v_self->_axes, __pyx_t_12, (&__pyx_v_unique_axes), (&__pyx_v_not_axes), __pyx_v_array_dimension, (&__pyx_v_unique_axes_length)); /* "pyfftw/pyfftw.pyx":962 * * # and assign axes and not_axes to the filled arrays * free(self._axes) # <<<<<<<<<<<<<< * self._axes = unique_axes * self._not_axes = not_axes */ free(__pyx_v_self->_axes); /* "pyfftw/pyfftw.pyx":963 * # and assign axes and not_axes to the filled arrays * free(self._axes) * self._axes = unique_axes # <<<<<<<<<<<<<< * self._not_axes = not_axes * */ __pyx_v_self->_axes = __pyx_v_unique_axes; /* "pyfftw/pyfftw.pyx":964 * free(self._axes) * self._axes = unique_axes * self._not_axes = not_axes # <<<<<<<<<<<<<< * * total_N = 1 */ __pyx_v_self->_not_axes = __pyx_v_not_axes; /* "pyfftw/pyfftw.pyx":966 * self._not_axes = not_axes * * total_N = 1 # <<<<<<<<<<<<<< * for n in range(unique_axes_length): * if self._input_shape[self._axes[n]] == 0: */ __Pyx_INCREF(__pyx_int_1); __pyx_v_total_N = __pyx_int_1; /* "pyfftw/pyfftw.pyx":967 * * total_N = 1 * for n in range(unique_axes_length): # <<<<<<<<<<<<<< * if self._input_shape[self._axes[n]] == 0: * raise ValueError('Zero length array: ' */ __pyx_t_17 = __pyx_v_unique_axes_length; for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_17; __pyx_t_12+=1) { __pyx_v_n = __pyx_t_12; /* "pyfftw/pyfftw.pyx":968 * total_N = 1 * for n in range(unique_axes_length): * if self._input_shape[self._axes[n]] == 0: # <<<<<<<<<<<<<< * raise ValueError('Zero length array: ' * 'The input array should have no zero length' */ __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_self->_input_shape, (__pyx_v_self->_axes[__pyx_v_n]), int64_t, 1, __Pyx_PyInt_From_int64_t, 0, 1, 1); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_10); __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_t_10, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { /* "pyfftw/pyfftw.pyx":969 * for n in range(unique_axes_length): * if self._input_shape[self._axes[n]] == 0: * raise ValueError('Zero length array: ' # <<<<<<<<<<<<<< * 'The input array should have no zero length' * 'axes over which the FFT is to be taken') */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pyfftw/pyfftw.pyx":968 * total_N = 1 * for n in range(unique_axes_length): * if self._input_shape[self._axes[n]] == 0: # <<<<<<<<<<<<<< * raise ValueError('Zero length array: ' * 'The input array should have no zero length' */ } /* "pyfftw/pyfftw.pyx":973 * 'axes over which the FFT is to be taken') * * if self._direction == FFTW_FORWARD: # <<<<<<<<<<<<<< * total_N *= self._input_shape[self._axes[n]] * else: */ __pyx_t_3 = ((__pyx_v_self->_direction == __pyx_e_6pyfftw_6pyfftw_FFTW_FORWARD) != 0); if (__pyx_t_3) { /* "pyfftw/pyfftw.pyx":974 * * if self._direction == FFTW_FORWARD: * total_N *= self._input_shape[self._axes[n]] # <<<<<<<<<<<<<< * else: * total_N *= self._output_shape[self._axes[n]] */ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_self->_input_shape, (__pyx_v_self->_axes[__pyx_v_n]), int64_t, 1, __Pyx_PyInt_From_int64_t, 0, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 974; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); __pyx_t_10 = PyNumber_InPlaceMultiply(__pyx_v_total_N, __pyx_t_1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 974; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_total_N, __pyx_t_10); __pyx_t_10 = 0; /* "pyfftw/pyfftw.pyx":973 * 'axes over which the FFT is to be taken') * * if self._direction == FFTW_FORWARD: # <<<<<<<<<<<<<< * total_N *= self._input_shape[self._axes[n]] * else: */ goto __pyx_L49; } /* "pyfftw/pyfftw.pyx":976 * total_N *= self._input_shape[self._axes[n]] * else: * total_N *= self._output_shape[self._axes[n]] # <<<<<<<<<<<<<< * * self._N = total_N */ /*else*/ { __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_self->_output_shape, (__pyx_v_self->_axes[__pyx_v_n]), int64_t, 1, __Pyx_PyInt_From_int64_t, 0, 1, 1); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 976; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_10); __pyx_t_1 = PyNumber_InPlaceMultiply(__pyx_v_total_N, __pyx_t_10); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 976; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF_SET(__pyx_v_total_N, __pyx_t_1); __pyx_t_1 = 0; } __pyx_L49:; } /* "pyfftw/pyfftw.pyx":978 * total_N *= self._output_shape[self._axes[n]] * * self._N = total_N # <<<<<<<<<<<<<< * self._normalisation_scaling = 1/float(self.N) * */ __pyx_t_17 = __Pyx_PyInt_As_int64_t(__pyx_v_total_N); if (unlikely((__pyx_t_17 == (int64_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->_N = __pyx_t_17; /* "pyfftw/pyfftw.pyx":979 * * self._N = total_N * self._normalisation_scaling = 1/float(self.N) # <<<<<<<<<<<<<< * * # Now we can validate the array shapes */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_N); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 979; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __Pyx_PyObject_AsDouble(__pyx_t_1); if (unlikely(__pyx_t_7 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 979; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_t_7 == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "float division"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 979; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_v_self->_normalisation_scaling = (1.0 / __pyx_t_7); /* "pyfftw/pyfftw.pyx":984 * cdef validator _validator * * if functions['validator'] == -1: # <<<<<<<<<<<<<< * if not (output_array.shape == input_array.shape): * raise ValueError('Invalid shapes: ' */ __pyx_t_1 = PyObject_GetItem(__pyx_v_functions, __pyx_n_s_validator); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 984; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); __pyx_t_10 = __Pyx_PyInt_EqObjC(__pyx_t_1, __pyx_int_neg_1, -1L, 0); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 984; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 984; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (__pyx_t_3) { /* "pyfftw/pyfftw.pyx":985 * * if functions['validator'] == -1: * if not (output_array.shape == input_array.shape): # <<<<<<<<<<<<<< * raise ValueError('Invalid shapes: ' * 'The output array should be the same shape as the ' */ __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_output_array, __pyx_n_s_shape); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 985; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_input_array, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 985; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_9 = PyObject_RichCompare(__pyx_t_10, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 985; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 985; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_2 = ((!__pyx_t_3) != 0); if (__pyx_t_2) { /* "pyfftw/pyfftw.pyx":986 * if functions['validator'] == -1: * if not (output_array.shape == input_array.shape): * raise ValueError('Invalid shapes: ' # <<<<<<<<<<<<<< * 'The output array should be the same shape as the ' * 'input array for the given array dtypes.') */ __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 986; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_Raise(__pyx_t_9, 0, 0, 0); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 986; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pyfftw/pyfftw.pyx":985 * * if functions['validator'] == -1: * if not (output_array.shape == input_array.shape): # <<<<<<<<<<<<<< * raise ValueError('Invalid shapes: ' * 'The output array should be the same shape as the ' */ } /* "pyfftw/pyfftw.pyx":984 * cdef validator _validator * * if functions['validator'] == -1: # <<<<<<<<<<<<<< * if not (output_array.shape == input_array.shape): * raise ValueError('Invalid shapes: ' */ goto __pyx_L50; } /* "pyfftw/pyfftw.pyx":990 * 'input array for the given array dtypes.') * else: * _validator = validators[functions['validator']] # <<<<<<<<<<<<<< * if not _validator(input_array, output_array, * self._axes, self._not_axes, unique_axes_length): */ /*else*/ { __pyx_t_9 = PyObject_GetItem(__pyx_v_functions, __pyx_n_s_validator); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 990; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_9); __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 990; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_v__validator = (__pyx_v_6pyfftw_6pyfftw_validators[__pyx_t_12]); /* "pyfftw/pyfftw.pyx":991 * else: * _validator = validators[functions['validator']] * if not _validator(input_array, output_array, # <<<<<<<<<<<<<< * self._axes, self._not_axes, unique_axes_length): * raise ValueError('Invalid shapes: ' */ if (!(likely(((__pyx_v_input_array) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_input_array, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 991; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (!(likely(((__pyx_v_output_array) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_output_array, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 991; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pyfftw/pyfftw.pyx":992 * _validator = validators[functions['validator']] * if not _validator(input_array, output_array, * self._axes, self._not_axes, unique_axes_length): # <<<<<<<<<<<<<< * raise ValueError('Invalid shapes: ' * 'The input array and output array are invalid ' */ __pyx_t_2 = ((!(__pyx_v__validator(((PyArrayObject *)__pyx_v_input_array), ((PyArrayObject *)__pyx_v_output_array), __pyx_v_self->_axes, __pyx_v_self->_not_axes, __pyx_v_unique_axes_length) != 0)) != 0); /* "pyfftw/pyfftw.pyx":991 * else: * _validator = validators[functions['validator']] * if not _validator(input_array, output_array, # <<<<<<<<<<<<<< * self._axes, self._not_axes, unique_axes_length): * raise ValueError('Invalid shapes: ' */ if (__pyx_t_2) { /* "pyfftw/pyfftw.pyx":993 * if not _validator(input_array, output_array, * self._axes, self._not_axes, unique_axes_length): * raise ValueError('Invalid shapes: ' # <<<<<<<<<<<<<< * 'The input array and output array are invalid ' * 'complementary shapes for their dtypes.') */ __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 993; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_Raise(__pyx_t_9, 0, 0, 0); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 993; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pyfftw/pyfftw.pyx":991 * else: * _validator = validators[functions['validator']] * if not _validator(input_array, output_array, # <<<<<<<<<<<<<< * self._axes, self._not_axes, unique_axes_length): * raise ValueError('Invalid shapes: ' */ } } __pyx_L50:; /* "pyfftw/pyfftw.pyx":997 * 'complementary shapes for their dtypes.') * * self._rank = unique_axes_length # <<<<<<<<<<<<<< * self._howmany_rank = self._input_array.ndim - unique_axes_length * */ __pyx_v_self->_rank = __pyx_v_unique_axes_length; /* "pyfftw/pyfftw.pyx":998 * * self._rank = unique_axes_length * self._howmany_rank = self._input_array.ndim - unique_axes_length # <<<<<<<<<<<<<< * * self._flags = 0 */ __pyx_v_self->_howmany_rank = (__pyx_v_self->_input_array->nd - __pyx_v_unique_axes_length); /* "pyfftw/pyfftw.pyx":1000 * self._howmany_rank = self._input_array.ndim - unique_axes_length * * self._flags = 0 # <<<<<<<<<<<<<< * self._flags_used = [] * for each_flag in flags: */ __pyx_v_self->_flags = 0; /* "pyfftw/pyfftw.pyx":1001 * * self._flags = 0 * self._flags_used = [] # <<<<<<<<<<<<<< * for each_flag in flags: * try: */ __pyx_t_9 = PyList_New(0); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1001; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_9); __Pyx_GOTREF(__pyx_v_self->_flags_used); __Pyx_DECREF(__pyx_v_self->_flags_used); __pyx_v_self->_flags_used = __pyx_t_9; __pyx_t_9 = 0; /* "pyfftw/pyfftw.pyx":1002 * self._flags = 0 * self._flags_used = [] * for each_flag in flags: # <<<<<<<<<<<<<< * try: * self._flags |= flag_dict[each_flag] */ if (likely(PyList_CheckExact(__pyx_v_flags)) || PyTuple_CheckExact(__pyx_v_flags)) { __pyx_t_9 = __pyx_v_flags; __Pyx_INCREF(__pyx_t_9); __pyx_t_12 = 0; __pyx_t_13 = NULL; } else { __pyx_t_12 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_v_flags); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1002; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __pyx_t_13 = Py_TYPE(__pyx_t_9)->tp_iternext; if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1002; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } for (;;) { if (likely(!__pyx_t_13)) { if (likely(PyList_CheckExact(__pyx_t_9))) { if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_9)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_1 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_12); __Pyx_INCREF(__pyx_t_1); __pyx_t_12++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1002; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_1 = PySequence_ITEM(__pyx_t_9, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1002; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); #endif } else { if (__pyx_t_12 >= PyTuple_GET_SIZE(__pyx_t_9)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_12); __Pyx_INCREF(__pyx_t_1); __pyx_t_12++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1002; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_1 = PySequence_ITEM(__pyx_t_9, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1002; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); #endif } } else { __pyx_t_1 = __pyx_t_13(__pyx_t_9); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1002; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } __Pyx_GOTREF(__pyx_t_1); } __Pyx_XDECREF_SET(__pyx_v_each_flag, __pyx_t_1); __pyx_t_1 = 0; /* "pyfftw/pyfftw.pyx":1003 * self._flags_used = [] * for each_flag in flags: * try: # <<<<<<<<<<<<<< * self._flags |= flag_dict[each_flag] * self._flags_used.append(each_flag) */ { __Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6); __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_6); /*try:*/ { /* "pyfftw/pyfftw.pyx":1004 * for each_flag in flags: * try: * self._flags |= flag_dict[each_flag] # <<<<<<<<<<<<<< * self._flags_used.append(each_flag) * except KeyError: */ __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(__pyx_v_self->_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1004; __pyx_clineno = __LINE__; goto __pyx_L55_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_10 = PyObject_GetItem(__pyx_v_6pyfftw_6pyfftw_flag_dict, __pyx_v_each_flag); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1004; __pyx_clineno = __LINE__; goto __pyx_L55_error;}; __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = PyNumber_InPlaceOr(__pyx_t_1, __pyx_t_10); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1004; __pyx_clineno = __LINE__; goto __pyx_L55_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_18 = __Pyx_PyInt_As_unsigned_int(__pyx_t_11); if (unlikely((__pyx_t_18 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1004; __pyx_clineno = __LINE__; goto __pyx_L55_error;} __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_v_self->_flags = __pyx_t_18; /* "pyfftw/pyfftw.pyx":1005 * try: * self._flags |= flag_dict[each_flag] * self._flags_used.append(each_flag) # <<<<<<<<<<<<<< * except KeyError: * raise ValueError('Invalid flag: ' + '\'' + */ __pyx_t_14 = __Pyx_PyObject_Append(__pyx_v_self->_flags_used, __pyx_v_each_flag); if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1005; __pyx_clineno = __LINE__; goto __pyx_L55_error;} /* "pyfftw/pyfftw.pyx":1003 * self._flags_used = [] * for each_flag in flags: * try: # <<<<<<<<<<<<<< * self._flags |= flag_dict[each_flag] * self._flags_used.append(each_flag) */ } __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L62_try_end; __pyx_L55_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; /* "pyfftw/pyfftw.pyx":1006 * self._flags |= flag_dict[each_flag] * self._flags_used.append(each_flag) * except KeyError: # <<<<<<<<<<<<<< * raise ValueError('Invalid flag: ' + '\'' + * each_flag + '\' is not a valid planner flag.') */ __pyx_t_8 = PyErr_ExceptionMatches(__pyx_builtin_KeyError); if (__pyx_t_8) { __Pyx_AddTraceback("pyfftw.pyfftw.FFTW.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_11, &__pyx_t_10, &__pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L57_except_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_GOTREF(__pyx_t_10); __Pyx_GOTREF(__pyx_t_1); /* "pyfftw/pyfftw.pyx":1007 * self._flags_used.append(each_flag) * except KeyError: * raise ValueError('Invalid flag: ' + '\'' + # <<<<<<<<<<<<<< * each_flag + '\' is not a valid planner flag.') * */ __pyx_t_19 = PyNumber_Add(__pyx_kp_s_Invalid_flag, __pyx_kp_s__17); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1007; __pyx_clineno = __LINE__; goto __pyx_L57_except_error;} __Pyx_GOTREF(__pyx_t_19); /* "pyfftw/pyfftw.pyx":1008 * except KeyError: * raise ValueError('Invalid flag: ' + '\'' + * each_flag + '\' is not a valid planner flag.') # <<<<<<<<<<<<<< * * */ __pyx_t_20 = PyNumber_Add(__pyx_t_19, __pyx_v_each_flag); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1007; __pyx_clineno = __LINE__; goto __pyx_L57_except_error;} __Pyx_GOTREF(__pyx_t_20); __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; __pyx_t_19 = PyNumber_Add(__pyx_t_20, __pyx_kp_s_is_not_a_valid_planner_flag); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1008; __pyx_clineno = __LINE__; goto __pyx_L57_except_error;} __Pyx_GOTREF(__pyx_t_19); __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; /* "pyfftw/pyfftw.pyx":1007 * self._flags_used.append(each_flag) * except KeyError: * raise ValueError('Invalid flag: ' + '\'' + # <<<<<<<<<<<<<< * each_flag + '\' is not a valid planner flag.') * */ __pyx_t_20 = PyTuple_New(1); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1007; __pyx_clineno = __LINE__; goto __pyx_L57_except_error;} __Pyx_GOTREF(__pyx_t_20); __Pyx_GIVEREF(__pyx_t_19); PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_19); __pyx_t_19 = 0; __pyx_t_19 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_20, NULL); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1007; __pyx_clineno = __LINE__; goto __pyx_L57_except_error;} __Pyx_GOTREF(__pyx_t_19); __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; __Pyx_Raise(__pyx_t_19, 0, 0, 0); __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1007; __pyx_clineno = __LINE__; goto __pyx_L57_except_error;} } goto __pyx_L57_except_error; __pyx_L57_except_error:; /* "pyfftw/pyfftw.pyx":1003 * self._flags_used = [] * for each_flag in flags: * try: # <<<<<<<<<<<<<< * self._flags |= flag_dict[each_flag] * self._flags_used.append(each_flag) */ __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_XGIVEREF(__pyx_t_6); __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); goto __pyx_L1_error; __pyx_L62_try_end:; } /* "pyfftw/pyfftw.pyx":1002 * self._flags = 0 * self._flags_used = [] * for each_flag in flags: # <<<<<<<<<<<<<< * try: * self._flags |= flag_dict[each_flag] */ } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "pyfftw/pyfftw.pyx":1011 * * * if ('FFTW_DESTROY_INPUT' not in flags) and ( # <<<<<<<<<<<<<< * (scheme[0] != 'c2r') or not self._rank > 1): * # The default in all possible cases is to preserve the input */ __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_n_s_FFTW_DESTROY_INPUT, __pyx_v_flags, Py_NE)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_21 = (__pyx_t_3 != 0); if (__pyx_t_21) { } else { __pyx_t_2 = __pyx_t_21; goto __pyx_L66_bool_binop_done; } /* "pyfftw/pyfftw.pyx":1012 * * if ('FFTW_DESTROY_INPUT' not in flags) and ( * (scheme[0] != 'c2r') or not self._rank > 1): # <<<<<<<<<<<<<< * # The default in all possible cases is to preserve the input * # This is not possible for r2c arrays with rank > 1 */ __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_scheme, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_9); __pyx_t_21 = (__Pyx_PyString_Equals(__pyx_t_9, __pyx_n_s_c2r, Py_NE)); if (unlikely(__pyx_t_21 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (!__pyx_t_21) { } else { __pyx_t_2 = __pyx_t_21; goto __pyx_L66_bool_binop_done; } __pyx_t_21 = ((!((__pyx_v_self->_rank > 1) != 0)) != 0); __pyx_t_2 = __pyx_t_21; __pyx_L66_bool_binop_done:; /* "pyfftw/pyfftw.pyx":1011 * * * if ('FFTW_DESTROY_INPUT' not in flags) and ( # <<<<<<<<<<<<<< * (scheme[0] != 'c2r') or not self._rank > 1): * # The default in all possible cases is to preserve the input */ if (__pyx_t_2) { /* "pyfftw/pyfftw.pyx":1015 * # The default in all possible cases is to preserve the input * # This is not possible for r2c arrays with rank > 1 * self._flags |= FFTW_PRESERVE_INPUT # <<<<<<<<<<<<<< * * # Set up the arrays of structs for holding the stride shape */ __pyx_v_self->_flags = (__pyx_v_self->_flags | __pyx_e_6pyfftw_6pyfftw_FFTW_PRESERVE_INPUT); /* "pyfftw/pyfftw.pyx":1011 * * * if ('FFTW_DESTROY_INPUT' not in flags) and ( # <<<<<<<<<<<<<< * (scheme[0] != 'c2r') or not self._rank > 1): * # The default in all possible cases is to preserve the input */ } /* "pyfftw/pyfftw.pyx":1019 * # Set up the arrays of structs for holding the stride shape * # information * self._dims = <_fftw_iodim *>malloc( # <<<<<<<<<<<<<< * self._rank * sizeof(_fftw_iodim)) * self._howmany_dims = <_fftw_iodim *>malloc( */ __pyx_v_self->_dims = ((__pyx_t_6pyfftw_6pyfftw__fftw_iodim *)malloc((__pyx_v_self->_rank * (sizeof(__pyx_t_6pyfftw_6pyfftw__fftw_iodim))))); /* "pyfftw/pyfftw.pyx":1021 * self._dims = <_fftw_iodim *>malloc( * self._rank * sizeof(_fftw_iodim)) * self._howmany_dims = <_fftw_iodim *>malloc( # <<<<<<<<<<<<<< * self._howmany_rank * sizeof(_fftw_iodim)) * */ __pyx_v_self->_howmany_dims = ((__pyx_t_6pyfftw_6pyfftw__fftw_iodim *)malloc((__pyx_v_self->_howmany_rank * (sizeof(__pyx_t_6pyfftw_6pyfftw__fftw_iodim))))); /* "pyfftw/pyfftw.pyx":1024 * self._howmany_rank * sizeof(_fftw_iodim)) * * if self._dims == NULL or self._howmany_dims == NULL: # <<<<<<<<<<<<<< * # Not much else to do than raise an exception * raise MemoryError */ __pyx_t_21 = ((__pyx_v_self->_dims == NULL) != 0); if (!__pyx_t_21) { } else { __pyx_t_2 = __pyx_t_21; goto __pyx_L70_bool_binop_done; } __pyx_t_21 = ((__pyx_v_self->_howmany_dims == NULL) != 0); __pyx_t_2 = __pyx_t_21; __pyx_L70_bool_binop_done:; if (__pyx_t_2) { /* "pyfftw/pyfftw.pyx":1026 * if self._dims == NULL or self._howmany_dims == NULL: * # Not much else to do than raise an exception * raise MemoryError # <<<<<<<<<<<<<< * * # Find the strides for all the axes of both arrays in terms of the */ PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1026; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pyfftw/pyfftw.pyx":1024 * self._howmany_rank * sizeof(_fftw_iodim)) * * if self._dims == NULL or self._howmany_dims == NULL: # <<<<<<<<<<<<<< * # Not much else to do than raise an exception * raise MemoryError */ } /* "pyfftw/pyfftw.pyx":1030 * # Find the strides for all the axes of both arrays in terms of the * # number of items (as opposed to the number of bytes). * self._input_strides = input_array.strides # <<<<<<<<<<<<<< * self._input_item_strides = tuple([stride/input_array.itemsize * for stride in input_array.strides]) */ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_input_array, __pyx_n_s_strides); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1030; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_9); __Pyx_GOTREF(__pyx_v_self->_input_strides); __Pyx_DECREF(__pyx_v_self->_input_strides); __pyx_v_self->_input_strides = __pyx_t_9; __pyx_t_9 = 0; /* "pyfftw/pyfftw.pyx":1031 * # number of items (as opposed to the number of bytes). * self._input_strides = input_array.strides * self._input_item_strides = tuple([stride/input_array.itemsize # <<<<<<<<<<<<<< * for stride in input_array.strides]) * self._output_strides = output_array.strides */ __pyx_t_9 = PyList_New(0); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); /* "pyfftw/pyfftw.pyx":1032 * self._input_strides = input_array.strides * self._input_item_strides = tuple([stride/input_array.itemsize * for stride in input_array.strides]) # <<<<<<<<<<<<<< * self._output_strides = output_array.strides * self._output_item_strides = tuple([stride/output_array.itemsize */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_input_array, __pyx_n_s_strides); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_10 = __pyx_t_1; __Pyx_INCREF(__pyx_t_10); __pyx_t_12 = 0; __pyx_t_13 = NULL; } else { __pyx_t_12 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __pyx_t_13 = Py_TYPE(__pyx_t_10)->tp_iternext; if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { if (likely(!__pyx_t_13)) { if (likely(PyList_CheckExact(__pyx_t_10))) { if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_10)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_1 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_12); __Pyx_INCREF(__pyx_t_1); __pyx_t_12++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_1 = PySequence_ITEM(__pyx_t_10, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); #endif } else { if (__pyx_t_12 >= PyTuple_GET_SIZE(__pyx_t_10)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_12); __Pyx_INCREF(__pyx_t_1); __pyx_t_12++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_1 = PySequence_ITEM(__pyx_t_10, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); #endif } } else { __pyx_t_1 = __pyx_t_13(__pyx_t_10); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } __Pyx_GOTREF(__pyx_t_1); } __Pyx_XDECREF_SET(__pyx_v_stride, __pyx_t_1); __pyx_t_1 = 0; /* "pyfftw/pyfftw.pyx":1031 * # number of items (as opposed to the number of bytes). * self._input_strides = input_array.strides * self._input_item_strides = tuple([stride/input_array.itemsize # <<<<<<<<<<<<<< * for stride in input_array.strides]) * self._output_strides = output_array.strides */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_input_array, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_11 = __Pyx_PyNumber_Divide(__pyx_v_stride, __pyx_t_1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__Pyx_ListComp_Append(__pyx_t_9, (PyObject*)__pyx_t_11))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "pyfftw/pyfftw.pyx":1032 * self._input_strides = input_array.strides * self._input_item_strides = tuple([stride/input_array.itemsize * for stride in input_array.strides]) # <<<<<<<<<<<<<< * self._output_strides = output_array.strides * self._output_item_strides = tuple([stride/output_array.itemsize */ } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "pyfftw/pyfftw.pyx":1031 * # number of items (as opposed to the number of bytes). * self._input_strides = input_array.strides * self._input_item_strides = tuple([stride/input_array.itemsize # <<<<<<<<<<<<<< * for stride in input_array.strides]) * self._output_strides = output_array.strides */ __pyx_t_10 = PyList_AsTuple(((PyObject*)__pyx_t_9)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GIVEREF(__pyx_t_10); __Pyx_GOTREF(__pyx_v_self->_input_item_strides); __Pyx_DECREF(__pyx_v_self->_input_item_strides); __pyx_v_self->_input_item_strides = __pyx_t_10; __pyx_t_10 = 0; /* "pyfftw/pyfftw.pyx":1033 * self._input_item_strides = tuple([stride/input_array.itemsize * for stride in input_array.strides]) * self._output_strides = output_array.strides # <<<<<<<<<<<<<< * self._output_item_strides = tuple([stride/output_array.itemsize * for stride in output_array.strides]) */ __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_output_array, __pyx_n_s_strides); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_10); __Pyx_GOTREF(__pyx_v_self->_output_strides); __Pyx_DECREF(__pyx_v_self->_output_strides); __pyx_v_self->_output_strides = __pyx_t_10; __pyx_t_10 = 0; /* "pyfftw/pyfftw.pyx":1034 * for stride in input_array.strides]) * self._output_strides = output_array.strides * self._output_item_strides = tuple([stride/output_array.itemsize # <<<<<<<<<<<<<< * for stride in output_array.strides]) * */ __pyx_t_10 = PyList_New(0); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); /* "pyfftw/pyfftw.pyx":1035 * self._output_strides = output_array.strides * self._output_item_strides = tuple([stride/output_array.itemsize * for stride in output_array.strides]) # <<<<<<<<<<<<<< * * # Make sure that the arrays are not too big for fftw */ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_output_array, __pyx_n_s_strides); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1035; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); if (likely(PyList_CheckExact(__pyx_t_9)) || PyTuple_CheckExact(__pyx_t_9)) { __pyx_t_11 = __pyx_t_9; __Pyx_INCREF(__pyx_t_11); __pyx_t_12 = 0; __pyx_t_13 = NULL; } else { __pyx_t_12 = -1; __pyx_t_11 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1035; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __pyx_t_13 = Py_TYPE(__pyx_t_11)->tp_iternext; if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1035; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; for (;;) { if (likely(!__pyx_t_13)) { if (likely(PyList_CheckExact(__pyx_t_11))) { if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_11)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_9 = PyList_GET_ITEM(__pyx_t_11, __pyx_t_12); __Pyx_INCREF(__pyx_t_9); __pyx_t_12++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1035; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_9 = PySequence_ITEM(__pyx_t_11, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1035; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); #endif } else { if (__pyx_t_12 >= PyTuple_GET_SIZE(__pyx_t_11)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_11, __pyx_t_12); __Pyx_INCREF(__pyx_t_9); __pyx_t_12++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1035; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_9 = PySequence_ITEM(__pyx_t_11, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1035; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); #endif } } else { __pyx_t_9 = __pyx_t_13(__pyx_t_11); if (unlikely(!__pyx_t_9)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1035; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } __Pyx_GOTREF(__pyx_t_9); } __Pyx_XDECREF_SET(__pyx_v_stride, __pyx_t_9); __pyx_t_9 = 0; /* "pyfftw/pyfftw.pyx":1034 * for stride in input_array.strides]) * self._output_strides = output_array.strides * self._output_item_strides = tuple([stride/output_array.itemsize # <<<<<<<<<<<<<< * for stride in output_array.strides]) * */ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_output_array, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_v_stride, __pyx_t_9); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(__Pyx_ListComp_Append(__pyx_t_10, (PyObject*)__pyx_t_1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pyfftw/pyfftw.pyx":1035 * self._output_strides = output_array.strides * self._output_item_strides = tuple([stride/output_array.itemsize * for stride in output_array.strides]) # <<<<<<<<<<<<<< * * # Make sure that the arrays are not too big for fftw */ } __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "pyfftw/pyfftw.pyx":1034 * for stride in input_array.strides]) * self._output_strides = output_array.strides * self._output_item_strides = tuple([stride/output_array.itemsize # <<<<<<<<<<<<<< * for stride in output_array.strides]) * */ __pyx_t_11 = PyList_AsTuple(((PyObject*)__pyx_t_10)); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_GIVEREF(__pyx_t_11); __Pyx_GOTREF(__pyx_v_self->_output_item_strides); __Pyx_DECREF(__pyx_v_self->_output_item_strides); __pyx_v_self->_output_item_strides = __pyx_t_11; __pyx_t_11 = 0; /* "pyfftw/pyfftw.pyx":1041 * # best (any suggestions, please get in touch). * cdef int i * for i in range(0, len(self._input_shape)): # <<<<<<<<<<<<<< * if self._input_shape[i] >= limits.INT_MAX: * raise ValueError('Dimensions of the input array must be ' + */ __pyx_t_11 = __pyx_v_self->_input_shape; __Pyx_INCREF(__pyx_t_11); __pyx_t_12 = PyObject_Length(__pyx_t_11); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1041; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_12; __pyx_t_8+=1) { __pyx_v_i = __pyx_t_8; /* "pyfftw/pyfftw.pyx":1042 * cdef int i * for i in range(0, len(self._input_shape)): * if self._input_shape[i] >= limits.INT_MAX: # <<<<<<<<<<<<<< * raise ValueError('Dimensions of the input array must be ' + * 'less than ', str(limits.INT_MAX)) */ __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_self->_input_shape, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(__pyx_t_11 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1042; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_11); __pyx_t_10 = PyInt_FromSsize_t(((Py_ssize_t)INT_MAX)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1042; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __pyx_t_1 = PyObject_RichCompare(__pyx_t_11, __pyx_t_10, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1042; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1042; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "pyfftw/pyfftw.pyx":1043 * for i in range(0, len(self._input_shape)): * if self._input_shape[i] >= limits.INT_MAX: * raise ValueError('Dimensions of the input array must be ' + # <<<<<<<<<<<<<< * 'less than ', str(limits.INT_MAX)) * */ __pyx_t_1 = PyNumber_Add(__pyx_kp_s_Dimensions_of_the_input_array_mu, __pyx_kp_s_less_than); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1043; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); /* "pyfftw/pyfftw.pyx":1044 * if self._input_shape[i] >= limits.INT_MAX: * raise ValueError('Dimensions of the input array must be ' + * 'less than ', str(limits.INT_MAX)) # <<<<<<<<<<<<<< * * if self._input_item_strides[i] >= limits.INT_MAX: */ __pyx_t_10 = __Pyx_PyInt_From_int(INT_MAX); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_11, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "pyfftw/pyfftw.pyx":1043 * for i in range(0, len(self._input_shape)): * if self._input_shape[i] >= limits.INT_MAX: * raise ValueError('Dimensions of the input array must be ' + # <<<<<<<<<<<<<< * 'less than ', str(limits.INT_MAX)) * */ __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1043; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_10); __pyx_t_1 = 0; __pyx_t_10 = 0; __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_11, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1043; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_Raise(__pyx_t_10, 0, 0, 0); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1043; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pyfftw/pyfftw.pyx":1042 * cdef int i * for i in range(0, len(self._input_shape)): * if self._input_shape[i] >= limits.INT_MAX: # <<<<<<<<<<<<<< * raise ValueError('Dimensions of the input array must be ' + * 'less than ', str(limits.INT_MAX)) */ } /* "pyfftw/pyfftw.pyx":1046 * 'less than ', str(limits.INT_MAX)) * * if self._input_item_strides[i] >= limits.INT_MAX: # <<<<<<<<<<<<<< * raise ValueError('Strides of the input array must be ' + * 'less than ', str(limits.INT_MAX)) */ __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_self->_input_item_strides, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = PyInt_FromSsize_t(((Py_ssize_t)INT_MAX)); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __pyx_t_1 = PyObject_RichCompare(__pyx_t_10, __pyx_t_11, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "pyfftw/pyfftw.pyx":1047 * * if self._input_item_strides[i] >= limits.INT_MAX: * raise ValueError('Strides of the input array must be ' + # <<<<<<<<<<<<<< * 'less than ', str(limits.INT_MAX)) * */ __pyx_t_1 = PyNumber_Add(__pyx_kp_s_Strides_of_the_input_array_must, __pyx_kp_s_less_than); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1047; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); /* "pyfftw/pyfftw.pyx":1048 * if self._input_item_strides[i] >= limits.INT_MAX: * raise ValueError('Strides of the input array must be ' + * 'less than ', str(limits.INT_MAX)) # <<<<<<<<<<<<<< * * for i in range(0, len(self._output_shape)): */ __pyx_t_11 = __Pyx_PyInt_From_int(INT_MAX); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_11); __pyx_t_11 = 0; __pyx_t_11 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_10, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "pyfftw/pyfftw.pyx":1047 * * if self._input_item_strides[i] >= limits.INT_MAX: * raise ValueError('Strides of the input array must be ' + # <<<<<<<<<<<<<< * 'less than ', str(limits.INT_MAX)) * */ __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1047; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_11); __pyx_t_1 = 0; __pyx_t_11 = 0; __pyx_t_11 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_10, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1047; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_Raise(__pyx_t_11, 0, 0, 0); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1047; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pyfftw/pyfftw.pyx":1046 * 'less than ', str(limits.INT_MAX)) * * if self._input_item_strides[i] >= limits.INT_MAX: # <<<<<<<<<<<<<< * raise ValueError('Strides of the input array must be ' + * 'less than ', str(limits.INT_MAX)) */ } } /* "pyfftw/pyfftw.pyx":1050 * 'less than ', str(limits.INT_MAX)) * * for i in range(0, len(self._output_shape)): # <<<<<<<<<<<<<< * if self._output_shape[i] >= limits.INT_MAX: * raise ValueError('Dimensions of the output array must be ' + */ __pyx_t_11 = __pyx_v_self->_output_shape; __Pyx_INCREF(__pyx_t_11); __pyx_t_12 = PyObject_Length(__pyx_t_11); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1050; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_12; __pyx_t_8+=1) { __pyx_v_i = __pyx_t_8; /* "pyfftw/pyfftw.pyx":1051 * * for i in range(0, len(self._output_shape)): * if self._output_shape[i] >= limits.INT_MAX: # <<<<<<<<<<<<<< * raise ValueError('Dimensions of the output array must be ' + * 'less than ', str(limits.INT_MAX)) */ __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_self->_output_shape, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(__pyx_t_11 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1051; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_11); __pyx_t_10 = PyInt_FromSsize_t(((Py_ssize_t)INT_MAX)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1051; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __pyx_t_1 = PyObject_RichCompare(__pyx_t_11, __pyx_t_10, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1051; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1051; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "pyfftw/pyfftw.pyx":1052 * for i in range(0, len(self._output_shape)): * if self._output_shape[i] >= limits.INT_MAX: * raise ValueError('Dimensions of the output array must be ' + # <<<<<<<<<<<<<< * 'less than ', str(limits.INT_MAX)) * */ __pyx_t_1 = PyNumber_Add(__pyx_kp_s_Dimensions_of_the_output_array_m, __pyx_kp_s_less_than); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); /* "pyfftw/pyfftw.pyx":1053 * if self._output_shape[i] >= limits.INT_MAX: * raise ValueError('Dimensions of the output array must be ' + * 'less than ', str(limits.INT_MAX)) # <<<<<<<<<<<<<< * * if self._output_item_strides[i] >= limits.INT_MAX: */ __pyx_t_10 = __Pyx_PyInt_From_int(INT_MAX); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1053; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1053; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_11, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1053; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "pyfftw/pyfftw.pyx":1052 * for i in range(0, len(self._output_shape)): * if self._output_shape[i] >= limits.INT_MAX: * raise ValueError('Dimensions of the output array must be ' + # <<<<<<<<<<<<<< * 'less than ', str(limits.INT_MAX)) * */ __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_10); __pyx_t_1 = 0; __pyx_t_10 = 0; __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_11, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_Raise(__pyx_t_10, 0, 0, 0); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pyfftw/pyfftw.pyx":1051 * * for i in range(0, len(self._output_shape)): * if self._output_shape[i] >= limits.INT_MAX: # <<<<<<<<<<<<<< * raise ValueError('Dimensions of the output array must be ' + * 'less than ', str(limits.INT_MAX)) */ } /* "pyfftw/pyfftw.pyx":1055 * 'less than ', str(limits.INT_MAX)) * * if self._output_item_strides[i] >= limits.INT_MAX: # <<<<<<<<<<<<<< * raise ValueError('Strides of the output array must be ' + * 'less than ', str(limits.INT_MAX)) */ __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_self->_output_item_strides, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = PyInt_FromSsize_t(((Py_ssize_t)INT_MAX)); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1055; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __pyx_t_1 = PyObject_RichCompare(__pyx_t_10, __pyx_t_11, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1055; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1055; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "pyfftw/pyfftw.pyx":1056 * * if self._output_item_strides[i] >= limits.INT_MAX: * raise ValueError('Strides of the output array must be ' + # <<<<<<<<<<<<<< * 'less than ', str(limits.INT_MAX)) * */ __pyx_t_1 = PyNumber_Add(__pyx_kp_s_Strides_of_the_output_array_must, __pyx_kp_s_less_than); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1056; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); /* "pyfftw/pyfftw.pyx":1057 * if self._output_item_strides[i] >= limits.INT_MAX: * raise ValueError('Strides of the output array must be ' + * 'less than ', str(limits.INT_MAX)) # <<<<<<<<<<<<<< * * fft_shape_lookup = functions['fft_shape_lookup'] */ __pyx_t_11 = __Pyx_PyInt_From_int(INT_MAX); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_11); __pyx_t_11 = 0; __pyx_t_11 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_10, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "pyfftw/pyfftw.pyx":1056 * * if self._output_item_strides[i] >= limits.INT_MAX: * raise ValueError('Strides of the output array must be ' + # <<<<<<<<<<<<<< * 'less than ', str(limits.INT_MAX)) * */ __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1056; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_11); __pyx_t_1 = 0; __pyx_t_11 = 0; __pyx_t_11 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_10, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1056; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_Raise(__pyx_t_11, 0, 0, 0); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1056; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pyfftw/pyfftw.pyx":1055 * 'less than ', str(limits.INT_MAX)) * * if self._output_item_strides[i] >= limits.INT_MAX: # <<<<<<<<<<<<<< * raise ValueError('Strides of the output array must be ' + * 'less than ', str(limits.INT_MAX)) */ } } /* "pyfftw/pyfftw.pyx":1059 * 'less than ', str(limits.INT_MAX)) * * fft_shape_lookup = functions['fft_shape_lookup'] # <<<<<<<<<<<<<< * if fft_shape_lookup == -1: * fft_shape = self._input_shape */ __pyx_t_11 = PyObject_GetItem(__pyx_v_functions, __pyx_n_s_fft_shape_lookup); if (unlikely(__pyx_t_11 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_11); __pyx_v_fft_shape_lookup = __pyx_t_11; __pyx_t_11 = 0; /* "pyfftw/pyfftw.pyx":1060 * * fft_shape_lookup = functions['fft_shape_lookup'] * if fft_shape_lookup == -1: # <<<<<<<<<<<<<< * fft_shape = self._input_shape * else: */ __pyx_t_11 = __Pyx_PyInt_EqObjC(__pyx_v_fft_shape_lookup, __pyx_int_neg_1, -1L, 0); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1060; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1060; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (__pyx_t_2) { /* "pyfftw/pyfftw.pyx":1061 * fft_shape_lookup = functions['fft_shape_lookup'] * if fft_shape_lookup == -1: * fft_shape = self._input_shape # <<<<<<<<<<<<<< * else: * fft_shape = fft_shape_lookup(input_array, output_array) */ __pyx_t_11 = __pyx_v_self->_input_shape; __Pyx_INCREF(__pyx_t_11); __pyx_v_fft_shape = __pyx_t_11; __pyx_t_11 = 0; /* "pyfftw/pyfftw.pyx":1060 * * fft_shape_lookup = functions['fft_shape_lookup'] * if fft_shape_lookup == -1: # <<<<<<<<<<<<<< * fft_shape = self._input_shape * else: */ goto __pyx_L84; } /* "pyfftw/pyfftw.pyx":1063 * fft_shape = self._input_shape * else: * fft_shape = fft_shape_lookup(input_array, output_array) # <<<<<<<<<<<<<< * * # Fill in the stride and shape information */ /*else*/ { __Pyx_INCREF(__pyx_v_fft_shape_lookup); __pyx_t_10 = __pyx_v_fft_shape_lookup; __pyx_t_1 = NULL; __pyx_t_12 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_10))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_10); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_10, function); __pyx_t_12 = 1; } } __pyx_t_9 = PyTuple_New(2+__pyx_t_12); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1063; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); if (__pyx_t_1) { __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1); __pyx_t_1 = NULL; } __Pyx_INCREF(__pyx_v_input_array); __Pyx_GIVEREF(__pyx_v_input_array); PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_12, __pyx_v_input_array); __Pyx_INCREF(__pyx_v_output_array); __Pyx_GIVEREF(__pyx_v_output_array); PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_12, __pyx_v_output_array); __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_9, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1063; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_v_fft_shape = __pyx_t_11; __pyx_t_11 = 0; } __pyx_L84:; /* "pyfftw/pyfftw.pyx":1066 * * # Fill in the stride and shape information * input_strides_array = self._input_item_strides # <<<<<<<<<<<<<< * output_strides_array = self._output_item_strides * for i in range(0, self._rank): */ __pyx_t_11 = __pyx_v_self->_input_item_strides; __Pyx_INCREF(__pyx_t_11); __pyx_v_input_strides_array = __pyx_t_11; __pyx_t_11 = 0; /* "pyfftw/pyfftw.pyx":1067 * # Fill in the stride and shape information * input_strides_array = self._input_item_strides * output_strides_array = self._output_item_strides # <<<<<<<<<<<<<< * for i in range(0, self._rank): * self._dims[i]._n = fft_shape[self._axes[i]] */ __pyx_t_11 = __pyx_v_self->_output_item_strides; __Pyx_INCREF(__pyx_t_11); __pyx_v_output_strides_array = __pyx_t_11; __pyx_t_11 = 0; /* "pyfftw/pyfftw.pyx":1068 * input_strides_array = self._input_item_strides * output_strides_array = self._output_item_strides * for i in range(0, self._rank): # <<<<<<<<<<<<<< * self._dims[i]._n = fft_shape[self._axes[i]] * self._dims[i]._is = input_strides_array[self._axes[i]] */ __pyx_t_8 = __pyx_v_self->_rank; for (__pyx_t_22 = 0; __pyx_t_22 < __pyx_t_8; __pyx_t_22+=1) { __pyx_v_i = __pyx_t_22; /* "pyfftw/pyfftw.pyx":1069 * output_strides_array = self._output_item_strides * for i in range(0, self._rank): * self._dims[i]._n = fft_shape[self._axes[i]] # <<<<<<<<<<<<<< * self._dims[i]._is = input_strides_array[self._axes[i]] * self._dims[i]._os = output_strides_array[self._axes[i]] */ __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_fft_shape, (__pyx_v_self->_axes[__pyx_v_i]), int64_t, 1, __Pyx_PyInt_From_int64_t, 0, 1, 1); if (unlikely(__pyx_t_11 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1069; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_11); __pyx_t_23 = __Pyx_PyInt_As_int(__pyx_t_11); if (unlikely((__pyx_t_23 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; (__pyx_v_self->_dims[__pyx_v_i])._n = __pyx_t_23; /* "pyfftw/pyfftw.pyx":1070 * for i in range(0, self._rank): * self._dims[i]._n = fft_shape[self._axes[i]] * self._dims[i]._is = input_strides_array[self._axes[i]] # <<<<<<<<<<<<<< * self._dims[i]._os = output_strides_array[self._axes[i]] * */ __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_input_strides_array, (__pyx_v_self->_axes[__pyx_v_i]), int64_t, 1, __Pyx_PyInt_From_int64_t, 0, 1, 1); if (unlikely(__pyx_t_11 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_11); __pyx_t_23 = __Pyx_PyInt_As_int(__pyx_t_11); if (unlikely((__pyx_t_23 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; (__pyx_v_self->_dims[__pyx_v_i])._is = __pyx_t_23; /* "pyfftw/pyfftw.pyx":1071 * self._dims[i]._n = fft_shape[self._axes[i]] * self._dims[i]._is = input_strides_array[self._axes[i]] * self._dims[i]._os = output_strides_array[self._axes[i]] # <<<<<<<<<<<<<< * * for i in range(0, self._howmany_rank): */ __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_output_strides_array, (__pyx_v_self->_axes[__pyx_v_i]), int64_t, 1, __Pyx_PyInt_From_int64_t, 0, 1, 1); if (unlikely(__pyx_t_11 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_11); __pyx_t_23 = __Pyx_PyInt_As_int(__pyx_t_11); if (unlikely((__pyx_t_23 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; (__pyx_v_self->_dims[__pyx_v_i])._os = __pyx_t_23; } /* "pyfftw/pyfftw.pyx":1073 * self._dims[i]._os = output_strides_array[self._axes[i]] * * for i in range(0, self._howmany_rank): # <<<<<<<<<<<<<< * self._howmany_dims[i]._n = fft_shape[self._not_axes[i]] * self._howmany_dims[i]._is = input_strides_array[self._not_axes[i]] */ __pyx_t_8 = __pyx_v_self->_howmany_rank; for (__pyx_t_22 = 0; __pyx_t_22 < __pyx_t_8; __pyx_t_22+=1) { __pyx_v_i = __pyx_t_22; /* "pyfftw/pyfftw.pyx":1074 * * for i in range(0, self._howmany_rank): * self._howmany_dims[i]._n = fft_shape[self._not_axes[i]] # <<<<<<<<<<<<<< * self._howmany_dims[i]._is = input_strides_array[self._not_axes[i]] * self._howmany_dims[i]._os = output_strides_array[self._not_axes[i]] */ __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_fft_shape, (__pyx_v_self->_not_axes[__pyx_v_i]), int64_t, 1, __Pyx_PyInt_From_int64_t, 0, 1, 1); if (unlikely(__pyx_t_11 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_11); __pyx_t_23 = __Pyx_PyInt_As_int(__pyx_t_11); if (unlikely((__pyx_t_23 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; (__pyx_v_self->_howmany_dims[__pyx_v_i])._n = __pyx_t_23; /* "pyfftw/pyfftw.pyx":1075 * for i in range(0, self._howmany_rank): * self._howmany_dims[i]._n = fft_shape[self._not_axes[i]] * self._howmany_dims[i]._is = input_strides_array[self._not_axes[i]] # <<<<<<<<<<<<<< * self._howmany_dims[i]._os = output_strides_array[self._not_axes[i]] * */ __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_input_strides_array, (__pyx_v_self->_not_axes[__pyx_v_i]), int64_t, 1, __Pyx_PyInt_From_int64_t, 0, 1, 1); if (unlikely(__pyx_t_11 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_11); __pyx_t_23 = __Pyx_PyInt_As_int(__pyx_t_11); if (unlikely((__pyx_t_23 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1075; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; (__pyx_v_self->_howmany_dims[__pyx_v_i])._is = __pyx_t_23; /* "pyfftw/pyfftw.pyx":1076 * self._howmany_dims[i]._n = fft_shape[self._not_axes[i]] * self._howmany_dims[i]._is = input_strides_array[self._not_axes[i]] * self._howmany_dims[i]._os = output_strides_array[self._not_axes[i]] # <<<<<<<<<<<<<< * * ## Point at which FFTW calls are made */ __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_output_strides_array, (__pyx_v_self->_not_axes[__pyx_v_i]), int64_t, 1, __Pyx_PyInt_From_int64_t, 0, 1, 1); if (unlikely(__pyx_t_11 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1076; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_11); __pyx_t_23 = __Pyx_PyInt_As_int(__pyx_t_11); if (unlikely((__pyx_t_23 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1076; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; (__pyx_v_self->_howmany_dims[__pyx_v_i])._os = __pyx_t_23; } /* "pyfftw/pyfftw.pyx":1080 * ## Point at which FFTW calls are made * ## (and none should be made before this) * self._nthreads_plan_setter(threads) # <<<<<<<<<<<<<< * * # Set the timelimit */ __pyx_v_self->_nthreads_plan_setter(__pyx_v_threads); /* "pyfftw/pyfftw.pyx":1083 * * # Set the timelimit * set_timelimit_func(_planning_timelimit) # <<<<<<<<<<<<<< * * # Finally, construct the plan, after acquiring the global planner lock */ __pyx_v_set_timelimit_func(__pyx_v__planning_timelimit); /* "pyfftw/pyfftw.pyx":1091 * # no self-lookups allowed in nogil block, so must grab all these first * cdef void *plan * cdef fftw_generic_plan_guru fftw_planner = self._fftw_planner # <<<<<<<<<<<<<< * cdef int rank = self._rank * cdef fftw_iodim *dims = self._dims */ __pyx_t_24 = __pyx_v_self->_fftw_planner; __pyx_v_fftw_planner = __pyx_t_24; /* "pyfftw/pyfftw.pyx":1092 * cdef void *plan * cdef fftw_generic_plan_guru fftw_planner = self._fftw_planner * cdef int rank = self._rank # <<<<<<<<<<<<<< * cdef fftw_iodim *dims = self._dims * cdef int howmany_rank = self._howmany_rank */ __pyx_t_8 = __pyx_v_self->_rank; __pyx_v_rank = __pyx_t_8; /* "pyfftw/pyfftw.pyx":1093 * cdef fftw_generic_plan_guru fftw_planner = self._fftw_planner * cdef int rank = self._rank * cdef fftw_iodim *dims = self._dims # <<<<<<<<<<<<<< * cdef int howmany_rank = self._howmany_rank * cdef fftw_iodim *howmany_dims = self._howmany_dims */ __pyx_v_dims = ((fftw_iodim *)__pyx_v_self->_dims); /* "pyfftw/pyfftw.pyx":1094 * cdef int rank = self._rank * cdef fftw_iodim *dims = self._dims * cdef int howmany_rank = self._howmany_rank # <<<<<<<<<<<<<< * cdef fftw_iodim *howmany_dims = self._howmany_dims * cdef void *_in = np.PyArray_DATA(self._input_array) */ __pyx_t_8 = __pyx_v_self->_howmany_rank; __pyx_v_howmany_rank = __pyx_t_8; /* "pyfftw/pyfftw.pyx":1095 * cdef fftw_iodim *dims = self._dims * cdef int howmany_rank = self._howmany_rank * cdef fftw_iodim *howmany_dims = self._howmany_dims # <<<<<<<<<<<<<< * cdef void *_in = np.PyArray_DATA(self._input_array) * cdef void *_out = np.PyArray_DATA(self._output_array) */ __pyx_v_howmany_dims = ((fftw_iodim *)__pyx_v_self->_howmany_dims); /* "pyfftw/pyfftw.pyx":1096 * cdef int howmany_rank = self._howmany_rank * cdef fftw_iodim *howmany_dims = self._howmany_dims * cdef void *_in = np.PyArray_DATA(self._input_array) # <<<<<<<<<<<<<< * cdef void *_out = np.PyArray_DATA(self._output_array) * cdef int sign = self._direction */ __pyx_t_11 = ((PyObject *)__pyx_v_self->_input_array); __Pyx_INCREF(__pyx_t_11); __pyx_v__in = ((void *)PyArray_DATA(((PyArrayObject *)__pyx_t_11))); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "pyfftw/pyfftw.pyx":1097 * cdef fftw_iodim *howmany_dims = self._howmany_dims * cdef void *_in = np.PyArray_DATA(self._input_array) * cdef void *_out = np.PyArray_DATA(self._output_array) # <<<<<<<<<<<<<< * cdef int sign = self._direction * cdef unsigned c_flags = self._flags */ __pyx_t_11 = ((PyObject *)__pyx_v_self->_output_array); __Pyx_INCREF(__pyx_t_11); __pyx_v__out = ((void *)PyArray_DATA(((PyArrayObject *)__pyx_t_11))); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "pyfftw/pyfftw.pyx":1098 * cdef void *_in = np.PyArray_DATA(self._input_array) * cdef void *_out = np.PyArray_DATA(self._output_array) * cdef int sign = self._direction # <<<<<<<<<<<<<< * cdef unsigned c_flags = self._flags * */ __pyx_t_8 = __pyx_v_self->_direction; __pyx_v_sign = __pyx_t_8; /* "pyfftw/pyfftw.pyx":1099 * cdef void *_out = np.PyArray_DATA(self._output_array) * cdef int sign = self._direction * cdef unsigned c_flags = self._flags # <<<<<<<<<<<<<< * * with plan_lock, nogil: */ __pyx_t_18 = __pyx_v_self->_flags; __pyx_v_c_flags = __pyx_t_18; /* "pyfftw/pyfftw.pyx":1101 * cdef unsigned c_flags = self._flags * * with plan_lock, nogil: # <<<<<<<<<<<<<< * plan = fftw_planner(rank, dims, howmany_rank, howmany_dims, * _in, _out, sign, c_flags) */ /*with:*/ { __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_v_6pyfftw_6pyfftw_plan_lock, __pyx_n_s_exit); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_10 = __Pyx_PyObject_LookupSpecial(__pyx_v_6pyfftw_6pyfftw_plan_lock, __pyx_n_s_enter); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1101; __pyx_clineno = __LINE__; goto __pyx_L89_error;} __Pyx_GOTREF(__pyx_t_10); __pyx_t_9 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_10))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_10); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_10, function); } } if (__pyx_t_9) { __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_9); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1101; __pyx_clineno = __LINE__; goto __pyx_L89_error;} __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else { __pyx_t_11 = __Pyx_PyObject_CallNoArg(__pyx_t_10); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1101; __pyx_clineno = __LINE__; goto __pyx_L89_error;} } __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /*try:*/ { { if (__pyx_t_5||__pyx_t_4||__pyx_t_25); else {/*mark used*/} /*try:*/ { { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "pyfftw/pyfftw.pyx":1102 * * with plan_lock, nogil: * plan = fftw_planner(rank, dims, howmany_rank, howmany_dims, # <<<<<<<<<<<<<< * _in, _out, sign, c_flags) * self._plan = plan */ __pyx_v_plan = __pyx_v_fftw_planner(__pyx_v_rank, __pyx_v_dims, __pyx_v_howmany_rank, __pyx_v_howmany_dims, __pyx_v__in, __pyx_v__out, __pyx_v_sign, __pyx_v_c_flags); } /* "pyfftw/pyfftw.pyx":1101 * cdef unsigned c_flags = self._flags * * with plan_lock, nogil: # <<<<<<<<<<<<<< * plan = fftw_planner(rank, dims, howmany_rank, howmany_dims, * _in, _out, sign, c_flags) */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L105; } __pyx_L105:; } } } } } /*finally:*/ { /*normal exit:*/{ if (__pyx_t_6) { __pyx_t_25 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__18, NULL); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_25); __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0; } goto __pyx_L92; } __pyx_L92:; } goto __pyx_L106; __pyx_L89_error:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L1_error; __pyx_L106:; } /* "pyfftw/pyfftw.pyx":1104 * plan = fftw_planner(rank, dims, howmany_rank, howmany_dims, * _in, _out, sign, c_flags) * self._plan = plan # <<<<<<<<<<<<<< * * if self._plan == NULL: */ __pyx_v_self->_plan = __pyx_v_plan; /* "pyfftw/pyfftw.pyx":1106 * self._plan = plan * * if self._plan == NULL: # <<<<<<<<<<<<<< * if 'FFTW_WISDOM_ONLY' in flags: * raise RuntimeError('No FFTW wisdom is known for this plan.') */ __pyx_t_2 = ((__pyx_v_self->_plan == NULL) != 0); if (__pyx_t_2) { /* "pyfftw/pyfftw.pyx":1107 * * if self._plan == NULL: * if 'FFTW_WISDOM_ONLY' in flags: # <<<<<<<<<<<<<< * raise RuntimeError('No FFTW wisdom is known for this plan.') * else: */ __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_n_s_FFTW_WISDOM_ONLY, __pyx_v_flags, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_21 = (__pyx_t_2 != 0); if (__pyx_t_21) { /* "pyfftw/pyfftw.pyx":1108 * if self._plan == NULL: * if 'FFTW_WISDOM_ONLY' in flags: * raise RuntimeError('No FFTW wisdom is known for this plan.') # <<<<<<<<<<<<<< * else: * raise RuntimeError('The data has an uncaught error that led '+ */ __pyx_t_11 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_Raise(__pyx_t_11, 0, 0, 0); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pyfftw/pyfftw.pyx":1107 * * if self._plan == NULL: * if 'FFTW_WISDOM_ONLY' in flags: # <<<<<<<<<<<<<< * raise RuntimeError('No FFTW wisdom is known for this plan.') * else: */ } /* "pyfftw/pyfftw.pyx":1110 * raise RuntimeError('No FFTW wisdom is known for this plan.') * else: * raise RuntimeError('The data has an uncaught error that led '+ # <<<<<<<<<<<<<< * 'to the planner returning NULL. This is a bug.') * */ /*else*/ { __pyx_t_11 = PyNumber_Add(__pyx_kp_s_The_data_has_an_uncaught_error_t, __pyx_kp_s_to_the_planner_returning_NULL_Th); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_11); __pyx_t_11 = 0; __pyx_t_11 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_10, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_Raise(__pyx_t_11, 0, 0, 0); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } /* "pyfftw/pyfftw.pyx":1106 * self._plan = plan * * if self._plan == NULL: # <<<<<<<<<<<<<< * if 'FFTW_WISDOM_ONLY' in flags: * raise RuntimeError('No FFTW wisdom is known for this plan.') */ } /* "pyfftw/pyfftw.pyx":811 * axes = property(_get_axes) * * def __cinit__(self, input_array, output_array, axes=(-1,), # <<<<<<<<<<<<<< * direction='FFTW_FORWARD', flags=('FFTW_MEASURE',), * unsigned int threads=1, planning_timelimit=None, */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_19); __Pyx_XDECREF(__pyx_t_20); __Pyx_AddTraceback("pyfftw.pyfftw.FFTW.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_input_dtype); __Pyx_XDECREF(__pyx_v_output_dtype); __Pyx_XDECREF(__pyx_v_scheme); __Pyx_XDECREF(__pyx_v_functions); __Pyx_XDECREF(__pyx_v_each_alignment); __Pyx_XDECREF(__pyx_v_total_N); __Pyx_XDECREF(__pyx_v_each_flag); __Pyx_XDECREF(__pyx_v_fft_shape_lookup); __Pyx_XDECREF(__pyx_v_fft_shape); __Pyx_XDECREF(__pyx_v_input_strides_array); __Pyx_XDECREF(__pyx_v_output_strides_array); __Pyx_XDECREF(__pyx_v_stride); __Pyx_XDECREF(__pyx_v_flags); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pyfftw/pyfftw.pyx":1113 * 'to the planner returning NULL. This is a bug.') * * def __init__(self, input_array, output_array, axes=(-1,), # <<<<<<<<<<<<<< * direction='FFTW_FORWARD', flags=('FFTW_MEASURE',), * int threads=1, planning_timelimit=None): */ /* Python wrapper */ static int __pyx_pw_6pyfftw_6pyfftw_4FFTW_33__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_6pyfftw_6pyfftw_4FFTW_32__init__[] = "\n **Arguments**:\n\n * ``input_array`` and ``output_array`` should be numpy arrays.\n The contents of these arrays will be destroyed by the planning \n process during initialisation. Information on supported \n dtypes for the arrays is :ref:`given below `.\n \n * ``axes`` describes along which axes the DFT should be taken.\n This should be a valid list of axes. Repeated axes are \n only transformed once. Invalid axes will raise an ``IndexError`` \n exception. This argument is equivalent to the same\n argument in :func:`numpy.fft.fftn`, except for the fact that\n the behaviour of repeated axes is different (``numpy.fft``\n will happily take the fft of the same axis if it is repeated\n in the ``axes`` argument). Rudimentary testing has suggested\n this is down to the underlying FFTW library and so unlikely \n to be fixed in these wrappers.\n\n * ``direction`` should be a string and one of ``'FFTW_FORWARD'`` \n or ``'FFTW_BACKWARD'``, which dictate whether to take the\n DFT (forwards) or the inverse DFT (backwards) respectively \n (specifically, it dictates the sign of the exponent in the \n DFT formulation).\n\n Note that only the Complex schemes allow a free choice\n for ``direction``. The direction *must* agree with the \n the :ref:`table below ` if a Real scheme \n is used, otherwise a ``ValueError`` is raised.\n\n .. _FFTW_flags:\n\n * ``flags`` is a list of strings and is a subset of the \n flags that FFTW allows for the planners:\n\n * ``'FFTW_ESTIMATE'``, ``'FFTW_MEASURE'``, ``'FFTW_PATIENT'`` and \n ``'FFTW_EXHAUSTIVE'`` are supported. These describe the \n increasing amount of effort spent during the planning \n stage to create the fastest possible transfo""rm. \n Usually ``'FFTW_MEASURE'`` is a good compromise. If no flag\n is passed, the default ``'FFTW_MEASURE'`` is used.\n * ``'FFTW_UNALIGNED'`` is supported. \n This tells FFTW not to assume anything about the \n alignment of the data and disabling any SIMD capability \n (see below).\n * ``'FFTW_DESTROY_INPUT'`` is supported.\n This tells FFTW that the input array can be destroyed during\n the transform, sometimes allowing a faster algorithm to be\n used. The default behaviour is, if possible, to preserve the\n input. In the case of the 1D Backwards Real transform, this \n may result in a performance hit. In the case of a backwards\n real transform for greater than one dimension, it is not\n possible to preserve the input, making this flag implicit\n in that case. A little more on this is given \n :ref:`below`.\n * ``'FFTW_WISDOM_ONLY'`` is supported.\n This tells FFTW to raise an error if no plan for this transform\n and data type is already in the wisdom. It thus provides a method\n to determine whether planning would require additional effor or the\n cached wisdom can be used. This flag should be combined with the\n various planning-effort flags (``'FFTW_ESTIMATE'``,\n ``'FFTW_MEASURE'``, etc.); if so, then an error will be raised if\n wisdom derived from that level of planning effort (or higher) is \n not present. If no planning-effort flag is used, the default of\n ``'FFTW_ESTIMATE'`` is assumed.\n Note that wisdom is specific to all the parameters, including the\n data alignment. That is, if wisdom was generated with input/output\n arrays with one specific alignment, using ``'FFTW_WISDOM_ONLY'``\n to create a plan for arrays wi""th any different alignment will \n cause the ``'FFTW_WISDOM_ONLY'`` planning to fail. Thus it is\n important to specifically control the data alignment to make the\n best use of ``'FFTW_WISDOM_ONLY'``.\n\n The `FFTW planner flags documentation \n `_\n has more information about the various flags and their impact.\n Note that only the flags documented here are supported.\n\n * ``threads`` tells the wrapper how many threads to use\n when invoking FFTW, with a default of 1.\n\n * ``planning_timelimit`` is a floating point number that \n indicates to the underlying FFTW planner the maximum number of\n seconds it should spend planning the FFT. This is a rough\n estimate and corresponds to calling of ``fftw_set_timelimit()``\n (or an equivalent dependent on type) in the underlying FFTW\n library. If ``None`` is set, the planner will run indefinitely\n until all the planning modes allowed by the flags have been\n tried. See the `FFTW planner flags page\n `_\n for more information on this.\n\n .. _fftw_schemes:\n\n **Schemes**\n\n The currently supported schemes are as follows:\n\n .. _scheme_table:\n\n +----------------+-----------------------+------------------------+-----------+\n | Type | ``input_array.dtype`` | ``output_array.dtype`` | Direction |\n +================+=======================+========================+===========+\n | Complex | ``complex64`` | ``complex64`` | Both |\n +----------------+-----------------------+------------------------+-----------+\n | Complex | ``complex128`` | ``complex128`` | Both |\n +----------------""+-----------------------+------------------------+-----------+\n | Complex | ``clongdouble`` | ``clongdouble`` | Both |\n +----------------+-----------------------+------------------------+-----------+\n | Real | ``float32`` | ``complex64`` | Forwards |\n +----------------+-----------------------+------------------------+-----------+\n | Real | ``float64`` | ``complex128`` | Forwards |\n +----------------+-----------------------+------------------------+-----------+\n | Real | ``longdouble`` | ``clongdouble`` | Forwards |\n +----------------+-----------------------+------------------------+-----------+\n | Real\\ :sup:`1` | ``complex64`` | ``float32`` | Backwards |\n +----------------+-----------------------+------------------------+-----------+\n | Real\\ :sup:`1` | ``complex128`` | ``float64`` | Backwards |\n +----------------+-----------------------+------------------------+-----------+\n | Real\\ :sup:`1` | ``clongdouble`` | ``longdouble`` | Backwards |\n +----------------+-----------------------+------------------------+-----------+\n\n \\ :sup:`1` Note that the Backwards Real transform for the case\n in which the dimensionality of the transform is greater than 1\n will destroy the input array. This is inherent to FFTW and the only\n general work-around for this is to copy the array prior to\n performing the transform. In the case where the dimensionality\n of the transform is 1, the default is to preserve the input array.\n This is different from the default in the underlying library, and\n some speed gain may be achieved by allowing the input array to\n be destroyed by passing the ``'FFTW_DESTROY_INPUT'`` \n :ref:`flag `.""\n\n ``clongdouble`` typically maps directly to ``complex256``\n or ``complex192``, and ``longdouble`` to ``float128`` or\n ``float96``, dependent on platform.\n\n The relative shapes of the arrays should be as follows:\n\n * For a Complex transform, ``output_array.shape == input_array.shape``\n * For a Real transform in the Forwards direction, both the following \n should be true:\n\n * ``output_array.shape[axes][-1] == input_array.shape[axes][-1]//2 + 1``\n * All the other axes should be equal in length.\n\n * For a Real transform in the Backwards direction, both the following \n should be true:\n\n * ``input_array.shape[axes][-1] == output_array.shape[axes][-1]//2 + 1``\n * All the other axes should be equal in length.\n\n In the above expressions for the Real transform, the ``axes`` \n arguments denotes the unique set of axes on which we are taking\n the FFT, in the order passed. It is the last of these axes that \n is subject to the special case shown.\n\n The shapes for the real transforms corresponds to those\n stipulated by the FFTW library. Further information can be\n found in the FFTW documentation on the `real DFT\n `_.\n\n The actual arrangement in memory is arbitrary and the scheme\n can be planned for any set of strides on either the input\n or the output. The user should not have to worry about this\n and any valid numpy array should work just fine.\n\n What is calculated is exactly what FFTW calculates. \n Notably, this is an unnormalized transform so should \n be scaled as necessary (fft followed by ifft will scale \n the input by N, the product of the dimensions along which\n the DFT is taken). For further information, see the \n `FFTW documentation\n `_.\n\n The FFTW library benefits greatly from the beginning of each\n DFT axes being aligned on the correct byte boundary, enabling\n SIMD instructions. By default, if the data begins on such a\n boundary, then FFTW will be allowed to try and enable\n SIMD instructions. This means that all future changes to\n the data arrays will be checked for similar alignment. SIMD\n instructions can be explicitly disabled by setting the\n FFTW_UNALIGNED flags, to allow for updates with unaligned\n data.\n\n :func:`~pyfftw.byte_align` and\n :func:`~pyfftw.empty_aligned` are two methods\n included with this module for producing aligned arrays.\n\n The optimum alignment for the running platform is provided\n by :data:`pyfftw.simd_alignment`, though a different alignment\n may still result in some performance improvement. For example,\n if the processor supports AVX (requiring 32-byte alignment) as\n well as SSE (requiring 16-byte alignment), then if the array\n is 16-byte aligned, SSE will still be used.\n\n It's worth noting that just being aligned may not be sufficient\n to create the fastest possible transform. For example, if the\n array is not contiguous (i.e. certain axes are displaced in\n memory), it may be faster to plan a transform for a contiguous\n array, and then rely on the array being copied in before the\n transform (which :class:`pyfftw.FFTW` will handle for you when\n accessed through :meth:`~pyfftw.FFTW.__call__`).\n "; #if CYTHON_COMPILING_IN_CPYTHON struct wrapperbase __pyx_wrapperbase_6pyfftw_6pyfftw_4FFTW_32__init__; #endif static int __pyx_pw_6pyfftw_6pyfftw_4FFTW_33__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED PyObject *__pyx_v_input_array = 0; CYTHON_UNUSED PyObject *__pyx_v_output_array = 0; CYTHON_UNUSED PyObject *__pyx_v_axes = 0; CYTHON_UNUSED PyObject *__pyx_v_direction = 0; CYTHON_UNUSED PyObject *__pyx_v_flags = 0; CYTHON_UNUSED int __pyx_v_threads; CYTHON_UNUSED PyObject *__pyx_v_planning_timelimit = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input_array,&__pyx_n_s_output_array,&__pyx_n_s_axes,&__pyx_n_s_direction,&__pyx_n_s_flags,&__pyx_n_s_threads,&__pyx_n_s_planning_timelimit,0}; PyObject* values[7] = {0,0,0,0,0,0,0}; values[2] = ((PyObject *)__pyx_tuple__20); values[3] = ((PyObject *)__pyx_n_s_FFTW_FORWARD); /* "pyfftw/pyfftw.pyx":1114 * * def __init__(self, input_array, output_array, axes=(-1,), * direction='FFTW_FORWARD', flags=('FFTW_MEASURE',), # <<<<<<<<<<<<<< * int threads=1, planning_timelimit=None): * ''' */ values[4] = ((PyObject *)__pyx_tuple__21); /* "pyfftw/pyfftw.pyx":1115 * def __init__(self, input_array, output_array, axes=(-1,), * direction='FFTW_FORWARD', flags=('FFTW_MEASURE',), * int threads=1, planning_timelimit=None): # <<<<<<<<<<<<<< * ''' * **Arguments**: */ values[6] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_input_array)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_output_array)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 7, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_axes); if (value) { values[2] = value; kw_args--; } } case 3: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_direction); if (value) { values[3] = value; kw_args--; } } case 4: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flags); if (value) { values[4] = value; kw_args--; } } case 5: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_threads); if (value) { values[5] = value; kw_args--; } } case 6: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_planning_timelimit); if (value) { values[6] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_input_array = values[0]; __pyx_v_output_array = values[1]; __pyx_v_axes = values[2]; __pyx_v_direction = values[3]; __pyx_v_flags = values[4]; if (values[5]) { __pyx_v_threads = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_threads == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { __pyx_v_threads = ((int)1); } __pyx_v_planning_timelimit = values[6]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 7, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pyfftw.pyfftw.FFTW.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_6pyfftw_6pyfftw_4FFTW_32__init__(((struct __pyx_obj_6pyfftw_6pyfftw_FFTW *)__pyx_v_self), __pyx_v_input_array, __pyx_v_output_array, __pyx_v_axes, __pyx_v_direction, __pyx_v_flags, __pyx_v_threads, __pyx_v_planning_timelimit); /* "pyfftw/pyfftw.pyx":1113 * 'to the planner returning NULL. This is a bug.') * * def __init__(self, input_array, output_array, axes=(-1,), # <<<<<<<<<<<<<< * direction='FFTW_FORWARD', flags=('FFTW_MEASURE',), * int threads=1, planning_timelimit=None): */ /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_6pyfftw_6pyfftw_4FFTW_32__init__(CYTHON_UNUSED struct __pyx_obj_6pyfftw_6pyfftw_FFTW *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_input_array, CYTHON_UNUSED PyObject *__pyx_v_output_array, CYTHON_UNUSED PyObject *__pyx_v_axes, CYTHON_UNUSED PyObject *__pyx_v_direction, CYTHON_UNUSED PyObject *__pyx_v_flags, CYTHON_UNUSED int __pyx_v_threads, CYTHON_UNUSED PyObject *__pyx_v_planning_timelimit) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__", 0); /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pyfftw/pyfftw.pyx":1322 * pass * * def __dealloc__(self): # <<<<<<<<<<<<<< * * if not self._axes == NULL: */ /* Python wrapper */ static void __pyx_pw_6pyfftw_6pyfftw_4FFTW_35__dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_pw_6pyfftw_6pyfftw_4FFTW_35__dealloc__(PyObject *__pyx_v_self) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); __pyx_pf_6pyfftw_6pyfftw_4FFTW_34__dealloc__(((struct __pyx_obj_6pyfftw_6pyfftw_FFTW *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); } static void __pyx_pf_6pyfftw_6pyfftw_4FFTW_34__dealloc__(struct __pyx_obj_6pyfftw_6pyfftw_FFTW *__pyx_v_self) { __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("__dealloc__", 0); /* "pyfftw/pyfftw.pyx":1324 * def __dealloc__(self): * * if not self._axes == NULL: # <<<<<<<<<<<<<< * free(self._axes) * */ __pyx_t_1 = ((!((__pyx_v_self->_axes == NULL) != 0)) != 0); if (__pyx_t_1) { /* "pyfftw/pyfftw.pyx":1325 * * if not self._axes == NULL: * free(self._axes) # <<<<<<<<<<<<<< * * if not self._not_axes == NULL: */ free(__pyx_v_self->_axes); /* "pyfftw/pyfftw.pyx":1324 * def __dealloc__(self): * * if not self._axes == NULL: # <<<<<<<<<<<<<< * free(self._axes) * */ } /* "pyfftw/pyfftw.pyx":1327 * free(self._axes) * * if not self._not_axes == NULL: # <<<<<<<<<<<<<< * free(self._not_axes) * */ __pyx_t_1 = ((!((__pyx_v_self->_not_axes == NULL) != 0)) != 0); if (__pyx_t_1) { /* "pyfftw/pyfftw.pyx":1328 * * if not self._not_axes == NULL: * free(self._not_axes) # <<<<<<<<<<<<<< * * if not self._plan == NULL: */ free(__pyx_v_self->_not_axes); /* "pyfftw/pyfftw.pyx":1327 * free(self._axes) * * if not self._not_axes == NULL: # <<<<<<<<<<<<<< * free(self._not_axes) * */ } /* "pyfftw/pyfftw.pyx":1330 * free(self._not_axes) * * if not self._plan == NULL: # <<<<<<<<<<<<<< * self._fftw_destroy(self._plan) * */ __pyx_t_1 = ((!((__pyx_v_self->_plan == NULL) != 0)) != 0); if (__pyx_t_1) { /* "pyfftw/pyfftw.pyx":1331 * * if not self._plan == NULL: * self._fftw_destroy(self._plan) # <<<<<<<<<<<<<< * * if not self._dims == NULL: */ __pyx_v_self->_fftw_destroy(__pyx_v_self->_plan); /* "pyfftw/pyfftw.pyx":1330 * free(self._not_axes) * * if not self._plan == NULL: # <<<<<<<<<<<<<< * self._fftw_destroy(self._plan) * */ } /* "pyfftw/pyfftw.pyx":1333 * self._fftw_destroy(self._plan) * * if not self._dims == NULL: # <<<<<<<<<<<<<< * free(self._dims) * */ __pyx_t_1 = ((!((__pyx_v_self->_dims == NULL) != 0)) != 0); if (__pyx_t_1) { /* "pyfftw/pyfftw.pyx":1334 * * if not self._dims == NULL: * free(self._dims) # <<<<<<<<<<<<<< * * if not self._howmany_dims == NULL: */ free(__pyx_v_self->_dims); /* "pyfftw/pyfftw.pyx":1333 * self._fftw_destroy(self._plan) * * if not self._dims == NULL: # <<<<<<<<<<<<<< * free(self._dims) * */ } /* "pyfftw/pyfftw.pyx":1336 * free(self._dims) * * if not self._howmany_dims == NULL: # <<<<<<<<<<<<<< * free(self._howmany_dims) * */ __pyx_t_1 = ((!((__pyx_v_self->_howmany_dims == NULL) != 0)) != 0); if (__pyx_t_1) { /* "pyfftw/pyfftw.pyx":1337 * * if not self._howmany_dims == NULL: * free(self._howmany_dims) # <<<<<<<<<<<<<< * * def __call__(self, input_array=None, output_array=None, */ free(__pyx_v_self->_howmany_dims); /* "pyfftw/pyfftw.pyx":1336 * free(self._dims) * * if not self._howmany_dims == NULL: # <<<<<<<<<<<<<< * free(self._howmany_dims) * */ } /* "pyfftw/pyfftw.pyx":1322 * pass * * def __dealloc__(self): # <<<<<<<<<<<<<< * * if not self._axes == NULL: */ /* function exit code */ __Pyx_RefNannyFinishContext(); } /* "pyfftw/pyfftw.pyx":1339 * free(self._howmany_dims) * * def __call__(self, input_array=None, output_array=None, # <<<<<<<<<<<<<< * normalise_idft=True): * '''__call__(input_array=None, output_array=None, normalise_idft=True) */ /* Python wrapper */ static PyObject *__pyx_pw_6pyfftw_6pyfftw_4FFTW_37__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_6pyfftw_6pyfftw_4FFTW_36__call__[] = "__call__(input_array=None, output_array=None, normalise_idft=True)\n\n Calling the class instance (optionally) updates the arrays, then\n calls :meth:`~pyfftw.FFTW.execute`, before optionally normalising \n the output and returning the output array.\n\n It has some built-in helpers to make life simpler for the calling\n functions (as distinct from manually updating the arrays and\n calling :meth:`~pyfftw.FFTW.execute`).\n\n If ``normalise_idft`` is ``True`` (the default), then the output from \n an inverse DFT (i.e. when the direction flag is ``'FFTW_BACKWARD'``) is\n scaled by 1/N, where N is the product of the lengths of input array on\n which the FFT is taken. If the direction is ``'FFTW_FORWARD'``, this\n flag makes no difference to the output array.\n \n When ``input_array`` is something other than None, then the passed in\n array is coerced to be the same dtype as the input array used when the\n class was instantiated, the byte-alignment of the passed in array is\n made consistent with the expected byte-alignment and the striding is \n made consistent with the expected striding. All this may, but not \n necessarily, require a copy to be made.\n\n As noted in the :ref:`scheme table`, if the FFTW \n instance describes a backwards real transform of more than one\n dimension, the contents of the input array will be destroyed. It is\n up to the calling function to make a copy if it is necessary to\n maintain the input array.\n\n ``output_array`` is always used as-is if possible. If the dtype, the \n alignment or the striding is incorrect for the FFTW object, then a\n ``ValueError`` is raised.\n \n The coerced input array and the output array (as appropriate) are \n then passed as arguments to\n :meth:`~pyfftw.FFTW.update_arrays`, after which""\n :meth:`~pyfftw.FFTW.execute` is called, and then normalisation\n is applied to the output array if that is desired.\n \n Note that it is possible to pass some data structure that can be\n converted to an array, such as a list, so long as it fits the data\n requirements of the class instance, such as array shape.\n\n Other than the dtype and the alignment of the passed in arrays, the \n rest of the requirements on the arrays mandated by\n :meth:`~pyfftw.FFTW.update_arrays` are enforced.\n\n A ``None`` argument to either keyword means that that array is not \n updated.\n\n The result of the FFT is returned. This is the same array that is used\n internally and will be overwritten again on subsequent calls. If you\n need the data to persist longer than a subsequent call, you should\n copy the returned array.\n "; #if CYTHON_COMPILING_IN_CPYTHON struct wrapperbase __pyx_wrapperbase_6pyfftw_6pyfftw_4FFTW_36__call__; #endif static PyObject *__pyx_pw_6pyfftw_6pyfftw_4FFTW_37__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_input_array = 0; PyObject *__pyx_v_output_array = 0; PyObject *__pyx_v_normalise_idft = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__call__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input_array,&__pyx_n_s_output_array,&__pyx_n_s_normalise_idft,0}; PyObject* values[3] = {0,0,0}; values[0] = ((PyObject *)Py_None); values[1] = ((PyObject *)Py_None); /* "pyfftw/pyfftw.pyx":1340 * * def __call__(self, input_array=None, output_array=None, * normalise_idft=True): # <<<<<<<<<<<<<< * '''__call__(input_array=None, output_array=None, normalise_idft=True) * */ values[2] = ((PyObject *)Py_True); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_input_array); if (value) { values[0] = value; kw_args--; } } case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_output_array); if (value) { values[1] = value; kw_args--; } } case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_normalise_idft); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__call__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1339; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_input_array = values[0]; __pyx_v_output_array = values[1]; __pyx_v_normalise_idft = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__call__", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1339; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pyfftw.pyfftw.FFTW.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_6pyfftw_6pyfftw_4FFTW_36__call__(((struct __pyx_obj_6pyfftw_6pyfftw_FFTW *)__pyx_v_self), __pyx_v_input_array, __pyx_v_output_array, __pyx_v_normalise_idft); /* "pyfftw/pyfftw.pyx":1339 * free(self._howmany_dims) * * def __call__(self, input_array=None, output_array=None, # <<<<<<<<<<<<<< * normalise_idft=True): * '''__call__(input_array=None, output_array=None, normalise_idft=True) */ /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6pyfftw_6pyfftw_4FFTW_36__call__(struct __pyx_obj_6pyfftw_6pyfftw_FFTW *__pyx_v_self, PyObject *__pyx_v_input_array, PyObject *__pyx_v_output_array, PyObject *__pyx_v_normalise_idft) { int __pyx_v_copy_needed; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); __Pyx_INCREF(__pyx_v_input_array); __Pyx_INCREF(__pyx_v_output_array); /* "pyfftw/pyfftw.pyx":1397 * ''' * * if input_array is not None or output_array is not None: # <<<<<<<<<<<<<< * * if input_array is None: */ __pyx_t_2 = (__pyx_v_input_array != Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (!__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_3 = (__pyx_v_output_array != Py_None); __pyx_t_2 = (__pyx_t_3 != 0); __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "pyfftw/pyfftw.pyx":1399 * if input_array is not None or output_array is not None: * * if input_array is None: # <<<<<<<<<<<<<< * input_array = self._input_array * */ __pyx_t_1 = (__pyx_v_input_array == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "pyfftw/pyfftw.pyx":1400 * * if input_array is None: * input_array = self._input_array # <<<<<<<<<<<<<< * * if output_array is None: */ __pyx_t_4 = ((PyObject *)__pyx_v_self->_input_array); __Pyx_INCREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_input_array, __pyx_t_4); __pyx_t_4 = 0; /* "pyfftw/pyfftw.pyx":1399 * if input_array is not None or output_array is not None: * * if input_array is None: # <<<<<<<<<<<<<< * input_array = self._input_array * */ } /* "pyfftw/pyfftw.pyx":1402 * input_array = self._input_array * * if output_array is None: # <<<<<<<<<<<<<< * output_array = self._output_array * */ __pyx_t_2 = (__pyx_v_output_array == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { /* "pyfftw/pyfftw.pyx":1403 * * if output_array is None: * output_array = self._output_array # <<<<<<<<<<<<<< * * if not isinstance(input_array, np.ndarray): */ __pyx_t_4 = ((PyObject *)__pyx_v_self->_output_array); __Pyx_INCREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_output_array, __pyx_t_4); __pyx_t_4 = 0; /* "pyfftw/pyfftw.pyx":1402 * input_array = self._input_array * * if output_array is None: # <<<<<<<<<<<<<< * output_array = self._output_array * */ } /* "pyfftw/pyfftw.pyx":1405 * output_array = self._output_array * * if not isinstance(input_array, np.ndarray): # <<<<<<<<<<<<<< * copy_needed = True * elif (not input_array.dtype == self._input_dtype): */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_input_array, __pyx_ptype_5numpy_ndarray); __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); if (__pyx_t_2) { /* "pyfftw/pyfftw.pyx":1406 * * if not isinstance(input_array, np.ndarray): * copy_needed = True # <<<<<<<<<<<<<< * elif (not input_array.dtype == self._input_dtype): * copy_needed = True */ __pyx_v_copy_needed = 1; /* "pyfftw/pyfftw.pyx":1405 * output_array = self._output_array * * if not isinstance(input_array, np.ndarray): # <<<<<<<<<<<<<< * copy_needed = True * elif (not input_array.dtype == self._input_dtype): */ goto __pyx_L8; } /* "pyfftw/pyfftw.pyx":1407 * if not isinstance(input_array, np.ndarray): * copy_needed = True * elif (not input_array.dtype == self._input_dtype): # <<<<<<<<<<<<<< * copy_needed = True * elif (not input_array.strides == self._input_strides): */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_input_array, __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_v_self->_input_dtype, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_1 = ((!__pyx_t_2) != 0); if (__pyx_t_1) { /* "pyfftw/pyfftw.pyx":1408 * copy_needed = True * elif (not input_array.dtype == self._input_dtype): * copy_needed = True # <<<<<<<<<<<<<< * elif (not input_array.strides == self._input_strides): * copy_needed = True */ __pyx_v_copy_needed = 1; /* "pyfftw/pyfftw.pyx":1407 * if not isinstance(input_array, np.ndarray): * copy_needed = True * elif (not input_array.dtype == self._input_dtype): # <<<<<<<<<<<<<< * copy_needed = True * elif (not input_array.strides == self._input_strides): */ goto __pyx_L8; } /* "pyfftw/pyfftw.pyx":1409 * elif (not input_array.dtype == self._input_dtype): * copy_needed = True * elif (not input_array.strides == self._input_strides): # <<<<<<<<<<<<<< * copy_needed = True * elif not (np.PyArray_DATA(input_array) */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_input_array, __pyx_n_s_strides); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1409; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = PyObject_RichCompare(__pyx_t_5, __pyx_v_self->_input_strides, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1409; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1409; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_2 = ((!__pyx_t_1) != 0); if (__pyx_t_2) { /* "pyfftw/pyfftw.pyx":1410 * copy_needed = True * elif (not input_array.strides == self._input_strides): * copy_needed = True # <<<<<<<<<<<<<< * elif not (np.PyArray_DATA(input_array) * % self.input_alignment == 0): */ __pyx_v_copy_needed = 1; /* "pyfftw/pyfftw.pyx":1409 * elif (not input_array.dtype == self._input_dtype): * copy_needed = True * elif (not input_array.strides == self._input_strides): # <<<<<<<<<<<<<< * copy_needed = True * elif not (np.PyArray_DATA(input_array) */ goto __pyx_L8; } /* "pyfftw/pyfftw.pyx":1411 * elif (not input_array.strides == self._input_strides): * copy_needed = True * elif not (np.PyArray_DATA(input_array) # <<<<<<<<<<<<<< * % self.input_alignment == 0): * copy_needed = True */ if (!(likely(((__pyx_v_input_array) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_input_array, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1411; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = PyInt_FromSsize_t(((intptr_t)PyArray_DATA(((PyArrayObject *)__pyx_v_input_array)))); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1411; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); /* "pyfftw/pyfftw.pyx":1412 * copy_needed = True * elif not (np.PyArray_DATA(input_array) * % self.input_alignment == 0): # <<<<<<<<<<<<<< * copy_needed = True * else: */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_input_alignment); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyNumber_Remainder(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyInt_EqObjC(__pyx_t_6, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pyfftw/pyfftw.pyx":1411 * elif (not input_array.strides == self._input_strides): * copy_needed = True * elif not (np.PyArray_DATA(input_array) # <<<<<<<<<<<<<< * % self.input_alignment == 0): * copy_needed = True */ __pyx_t_1 = ((!__pyx_t_2) != 0); if (__pyx_t_1) { /* "pyfftw/pyfftw.pyx":1413 * elif not (np.PyArray_DATA(input_array) * % self.input_alignment == 0): * copy_needed = True # <<<<<<<<<<<<<< * else: * copy_needed = False */ __pyx_v_copy_needed = 1; /* "pyfftw/pyfftw.pyx":1411 * elif (not input_array.strides == self._input_strides): * copy_needed = True * elif not (np.PyArray_DATA(input_array) # <<<<<<<<<<<<<< * % self.input_alignment == 0): * copy_needed = True */ goto __pyx_L8; } /* "pyfftw/pyfftw.pyx":1415 * copy_needed = True * else: * copy_needed = False # <<<<<<<<<<<<<< * * if copy_needed: */ /*else*/ { __pyx_v_copy_needed = 0; } __pyx_L8:; /* "pyfftw/pyfftw.pyx":1417 * copy_needed = False * * if copy_needed: # <<<<<<<<<<<<<< * * if not isinstance(input_array, np.ndarray): */ __pyx_t_1 = (__pyx_v_copy_needed != 0); if (__pyx_t_1) { /* "pyfftw/pyfftw.pyx":1419 * if copy_needed: * * if not isinstance(input_array, np.ndarray): # <<<<<<<<<<<<<< * input_array = np.asanyarray(input_array) * */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_input_array, __pyx_ptype_5numpy_ndarray); __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); if (__pyx_t_2) { /* "pyfftw/pyfftw.pyx":1420 * * if not isinstance(input_array, np.ndarray): * input_array = np.asanyarray(input_array) # <<<<<<<<<<<<<< * * if not input_array.shape == self._input_shape: */ __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_asanyarray); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (!__pyx_t_6) { __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_input_array); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); } else { __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL; __Pyx_INCREF(__pyx_v_input_array); __Pyx_GIVEREF(__pyx_v_input_array); PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_input_array); __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_input_array, __pyx_t_5); __pyx_t_5 = 0; /* "pyfftw/pyfftw.pyx":1419 * if copy_needed: * * if not isinstance(input_array, np.ndarray): # <<<<<<<<<<<<<< * input_array = np.asanyarray(input_array) * */ } /* "pyfftw/pyfftw.pyx":1422 * input_array = np.asanyarray(input_array) * * if not input_array.shape == self._input_shape: # <<<<<<<<<<<<<< * raise ValueError('Invalid input shape: ' * 'The new input array should be the same shape ' */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_input_array, __pyx_n_s_shape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1422; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = PyObject_RichCompare(__pyx_t_5, __pyx_v_self->_input_shape, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1422; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1422; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_1 = ((!__pyx_t_2) != 0); if (__pyx_t_1) { /* "pyfftw/pyfftw.pyx":1423 * * if not input_array.shape == self._input_shape: * raise ValueError('Invalid input shape: ' # <<<<<<<<<<<<<< * 'The new input array should be the same shape ' * 'as the input array used to instantiate the ' */ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1423; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1423; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pyfftw/pyfftw.pyx":1422 * input_array = np.asanyarray(input_array) * * if not input_array.shape == self._input_shape: # <<<<<<<<<<<<<< * raise ValueError('Invalid input shape: ' * 'The new input array should be the same shape ' */ } /* "pyfftw/pyfftw.pyx":1428 * 'object.') * * self._input_array[:] = input_array # <<<<<<<<<<<<<< * * if output_array is not None: */ if (__Pyx_PyObject_SetSlice(((PyObject *)__pyx_v_self->_input_array), __pyx_v_input_array, 0, 0, NULL, NULL, &__pyx_slice__23, 0, 0, 1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1428; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pyfftw/pyfftw.pyx":1430 * self._input_array[:] = input_array * * if output_array is not None: # <<<<<<<<<<<<<< * # No point wasting time if no update is necessary * # (which the copy above may have avoided) */ __pyx_t_1 = (__pyx_v_output_array != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "pyfftw/pyfftw.pyx":1433 * # No point wasting time if no update is necessary * # (which the copy above may have avoided) * input_array = self._input_array # <<<<<<<<<<<<<< * self.update_arrays(input_array, output_array) * */ __pyx_t_4 = ((PyObject *)__pyx_v_self->_input_array); __Pyx_INCREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_input_array, __pyx_t_4); __pyx_t_4 = 0; /* "pyfftw/pyfftw.pyx":1434 * # (which the copy above may have avoided) * input_array = self._input_array * self.update_arrays(input_array, output_array) # <<<<<<<<<<<<<< * * else: */ __pyx_t_4 = ((struct __pyx_vtabstruct_6pyfftw_6pyfftw_FFTW *)__pyx_v_self->__pyx_vtab)->update_arrays(__pyx_v_self, __pyx_v_input_array, __pyx_v_output_array, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyfftw/pyfftw.pyx":1430 * self._input_array[:] = input_array * * if output_array is not None: # <<<<<<<<<<<<<< * # No point wasting time if no update is necessary * # (which the copy above may have avoided) */ } /* "pyfftw/pyfftw.pyx":1417 * copy_needed = False * * if copy_needed: # <<<<<<<<<<<<<< * * if not isinstance(input_array, np.ndarray): */ goto __pyx_L9; } /* "pyfftw/pyfftw.pyx":1437 * * else: * self.update_arrays(input_array, output_array) # <<<<<<<<<<<<<< * * self.execute() */ /*else*/ { __pyx_t_4 = ((struct __pyx_vtabstruct_6pyfftw_6pyfftw_FFTW *)__pyx_v_self->__pyx_vtab)->update_arrays(__pyx_v_self, __pyx_v_input_array, __pyx_v_output_array, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_L9:; /* "pyfftw/pyfftw.pyx":1397 * ''' * * if input_array is not None or output_array is not None: # <<<<<<<<<<<<<< * * if input_array is None: */ } /* "pyfftw/pyfftw.pyx":1439 * self.update_arrays(input_array, output_array) * * self.execute() # <<<<<<<<<<<<<< * * if self._direction == FFTW_BACKWARD and normalise_idft: */ __pyx_t_4 = ((struct __pyx_vtabstruct_6pyfftw_6pyfftw_FFTW *)__pyx_v_self->__pyx_vtab)->execute(__pyx_v_self, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1439; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyfftw/pyfftw.pyx":1441 * self.execute() * * if self._direction == FFTW_BACKWARD and normalise_idft: # <<<<<<<<<<<<<< * self._output_array *= self._normalisation_scaling * */ __pyx_t_1 = ((__pyx_v_self->_direction == __pyx_e_6pyfftw_6pyfftw_FFTW_BACKWARD) != 0); if (__pyx_t_1) { } else { __pyx_t_2 = __pyx_t_1; goto __pyx_L14_bool_binop_done; } __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_normalise_idft); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = __pyx_t_1; __pyx_L14_bool_binop_done:; if (__pyx_t_2) { /* "pyfftw/pyfftw.pyx":1442 * * if self._direction == FFTW_BACKWARD and normalise_idft: * self._output_array *= self._normalisation_scaling # <<<<<<<<<<<<<< * * return self._output_array */ __pyx_t_4 = PyFloat_FromDouble(__pyx_v_self->_normalisation_scaling); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1442; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyNumber_InPlaceMultiply(((PyObject *)__pyx_v_self->_output_array), __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1442; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1442; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GIVEREF(__pyx_t_5); __Pyx_GOTREF(__pyx_v_self->_output_array); __Pyx_DECREF(((PyObject *)__pyx_v_self->_output_array)); __pyx_v_self->_output_array = ((PyArrayObject *)__pyx_t_5); __pyx_t_5 = 0; /* "pyfftw/pyfftw.pyx":1441 * self.execute() * * if self._direction == FFTW_BACKWARD and normalise_idft: # <<<<<<<<<<<<<< * self._output_array *= self._normalisation_scaling * */ } /* "pyfftw/pyfftw.pyx":1444 * self._output_array *= self._normalisation_scaling * * return self._output_array # <<<<<<<<<<<<<< * * cpdef update_arrays(self, */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self->_output_array)); __pyx_r = ((PyObject *)__pyx_v_self->_output_array); goto __pyx_L0; /* "pyfftw/pyfftw.pyx":1339 * free(self._howmany_dims) * * def __call__(self, input_array=None, output_array=None, # <<<<<<<<<<<<<< * normalise_idft=True): * '''__call__(input_array=None, output_array=None, normalise_idft=True) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pyfftw.pyfftw.FFTW.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_input_array); __Pyx_XDECREF(__pyx_v_output_array); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pyfftw/pyfftw.pyx":1446 * return self._output_array * * cpdef update_arrays(self, # <<<<<<<<<<<<<< * new_input_array, new_output_array): * '''update_arrays(new_input_array, new_output_array) */ static PyObject *__pyx_pw_6pyfftw_6pyfftw_4FFTW_39update_arrays(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_f_6pyfftw_6pyfftw_4FFTW_update_arrays(struct __pyx_obj_6pyfftw_6pyfftw_FFTW *__pyx_v_self, PyObject *__pyx_v_new_input_array, PyObject *__pyx_v_new_output_array, int __pyx_skip_dispatch) { PyObject *__pyx_v_new_input_shape = NULL; PyObject *__pyx_v_new_output_shape = NULL; PyObject *__pyx_v_new_input_strides = NULL; PyObject *__pyx_v_new_output_strides = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; Py_ssize_t __pyx_t_5; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("update_arrays", 0); /* Check if called by wrapper */ if (unlikely(__pyx_skip_dispatch)) ; /* Check if overridden in Python */ else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_update_arrays); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6pyfftw_6pyfftw_4FFTW_39update_arrays)) { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; __pyx_t_5 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; } __Pyx_INCREF(__pyx_v_new_input_array); __Pyx_GIVEREF(__pyx_v_new_input_array); PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_new_input_array); __Pyx_INCREF(__pyx_v_new_output_array); __Pyx_GIVEREF(__pyx_v_new_output_array); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_new_output_array); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } /* "pyfftw/pyfftw.pyx":1469 * object will still be in a sane state). * ''' * if not isinstance(new_input_array, np.ndarray): # <<<<<<<<<<<<<< * raise ValueError('Invalid input array: ' * 'The new input array needs to be an instance ' */ __pyx_t_7 = __Pyx_TypeCheck(__pyx_v_new_input_array, __pyx_ptype_5numpy_ndarray); __pyx_t_8 = ((!(__pyx_t_7 != 0)) != 0); if (__pyx_t_8) { /* "pyfftw/pyfftw.pyx":1470 * ''' * if not isinstance(new_input_array, np.ndarray): * raise ValueError('Invalid input array: ' # <<<<<<<<<<<<<< * 'The new input array needs to be an instance ' * 'of numpy.ndarray') */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pyfftw/pyfftw.pyx":1469 * object will still be in a sane state). * ''' * if not isinstance(new_input_array, np.ndarray): # <<<<<<<<<<<<<< * raise ValueError('Invalid input array: ' * 'The new input array needs to be an instance ' */ } /* "pyfftw/pyfftw.pyx":1474 * 'of numpy.ndarray') * * if not isinstance(new_output_array, np.ndarray): # <<<<<<<<<<<<<< * raise ValueError('Invalid output array ' * 'The new output array needs to be an instance ' */ __pyx_t_8 = __Pyx_TypeCheck(__pyx_v_new_output_array, __pyx_ptype_5numpy_ndarray); __pyx_t_7 = ((!(__pyx_t_8 != 0)) != 0); if (__pyx_t_7) { /* "pyfftw/pyfftw.pyx":1475 * * if not isinstance(new_output_array, np.ndarray): * raise ValueError('Invalid output array ' # <<<<<<<<<<<<<< * 'The new output array needs to be an instance ' * 'of numpy.ndarray') */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1475; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1475; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pyfftw/pyfftw.pyx":1474 * 'of numpy.ndarray') * * if not isinstance(new_output_array, np.ndarray): # <<<<<<<<<<<<<< * raise ValueError('Invalid output array ' * 'The new output array needs to be an instance ' */ } /* "pyfftw/pyfftw.pyx":1479 * 'of numpy.ndarray') * * if not (np.PyArray_DATA(new_input_array) % # <<<<<<<<<<<<<< * self.input_alignment == 0): * raise ValueError('Invalid input alignment: ' */ if (!(likely(((__pyx_v_new_input_array) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_new_input_array, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1479; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_1 = PyInt_FromSsize_t(((intptr_t)PyArray_DATA(((PyArrayObject *)__pyx_v_new_input_array)))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1479; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); /* "pyfftw/pyfftw.pyx":1480 * * if not (np.PyArray_DATA(new_input_array) % * self.input_alignment == 0): # <<<<<<<<<<<<<< * raise ValueError('Invalid input alignment: ' * 'The original arrays were %d-byte aligned. It is ' */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_input_alignment); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); /* "pyfftw/pyfftw.pyx":1479 * 'of numpy.ndarray') * * if not (np.PyArray_DATA(new_input_array) % # <<<<<<<<<<<<<< * self.input_alignment == 0): * raise ValueError('Invalid input alignment: ' */ __pyx_t_3 = PyNumber_Remainder(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1479; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pyfftw/pyfftw.pyx":1480 * * if not (np.PyArray_DATA(new_input_array) % * self.input_alignment == 0): # <<<<<<<<<<<<<< * raise ValueError('Invalid input alignment: ' * 'The original arrays were %d-byte aligned. It is ' */ __pyx_t_2 = __Pyx_PyInt_EqObjC(__pyx_t_3, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pyfftw/pyfftw.pyx":1479 * 'of numpy.ndarray') * * if not (np.PyArray_DATA(new_input_array) % # <<<<<<<<<<<<<< * self.input_alignment == 0): * raise ValueError('Invalid input alignment: ' */ __pyx_t_8 = ((!__pyx_t_7) != 0); if (__pyx_t_8) { /* "pyfftw/pyfftw.pyx":1484 * 'The original arrays were %d-byte aligned. It is ' * 'necessary that the update input array is similarly ' * 'aligned.' % self.input_alignment) # <<<<<<<<<<<<<< * * if not (np.PyArray_DATA(new_output_array) % */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_input_alignment); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_input_alignment_The_orig, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pyfftw/pyfftw.pyx":1481 * if not (np.PyArray_DATA(new_input_array) % * self.input_alignment == 0): * raise ValueError('Invalid input alignment: ' # <<<<<<<<<<<<<< * 'The original arrays were %d-byte aligned. It is ' * 'necessary that the update input array is similarly ' */ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1481; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1481; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1481; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pyfftw/pyfftw.pyx":1479 * 'of numpy.ndarray') * * if not (np.PyArray_DATA(new_input_array) % # <<<<<<<<<<<<<< * self.input_alignment == 0): * raise ValueError('Invalid input alignment: ' */ } /* "pyfftw/pyfftw.pyx":1486 * 'aligned.' % self.input_alignment) * * if not (np.PyArray_DATA(new_output_array) % # <<<<<<<<<<<<<< * self.output_alignment == 0): * raise ValueError('Invalid output alignment: ' */ if (!(likely(((__pyx_v_new_output_array) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_new_output_array, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1486; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_3 = PyInt_FromSsize_t(((intptr_t)PyArray_DATA(((PyArrayObject *)__pyx_v_new_output_array)))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1486; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); /* "pyfftw/pyfftw.pyx":1487 * * if not (np.PyArray_DATA(new_output_array) % * self.output_alignment == 0): # <<<<<<<<<<<<<< * raise ValueError('Invalid output alignment: ' * 'The original arrays were %d-byte aligned. It is ' */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_output_alignment); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1487; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); /* "pyfftw/pyfftw.pyx":1486 * 'aligned.' % self.input_alignment) * * if not (np.PyArray_DATA(new_output_array) % # <<<<<<<<<<<<<< * self.output_alignment == 0): * raise ValueError('Invalid output alignment: ' */ __pyx_t_1 = PyNumber_Remainder(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1486; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pyfftw/pyfftw.pyx":1487 * * if not (np.PyArray_DATA(new_output_array) % * self.output_alignment == 0): # <<<<<<<<<<<<<< * raise ValueError('Invalid output alignment: ' * 'The original arrays were %d-byte aligned. It is ' */ __pyx_t_2 = __Pyx_PyInt_EqObjC(__pyx_t_1, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1487; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1487; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pyfftw/pyfftw.pyx":1486 * 'aligned.' % self.input_alignment) * * if not (np.PyArray_DATA(new_output_array) % # <<<<<<<<<<<<<< * self.output_alignment == 0): * raise ValueError('Invalid output alignment: ' */ __pyx_t_7 = ((!__pyx_t_8) != 0); if (__pyx_t_7) { /* "pyfftw/pyfftw.pyx":1491 * 'The original arrays were %d-byte aligned. It is ' * 'necessary that the update output array is similarly ' * 'aligned.' % self.output_alignment) # <<<<<<<<<<<<<< * * if not new_input_array.dtype == self._input_dtype: */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_output_alignment); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_output_alignment_The_ori, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pyfftw/pyfftw.pyx":1488 * if not (np.PyArray_DATA(new_output_array) % * self.output_alignment == 0): * raise ValueError('Invalid output alignment: ' # <<<<<<<<<<<<<< * 'The original arrays were %d-byte aligned. It is ' * 'necessary that the update output array is similarly ' */ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pyfftw/pyfftw.pyx":1486 * 'aligned.' % self.input_alignment) * * if not (np.PyArray_DATA(new_output_array) % # <<<<<<<<<<<<<< * self.output_alignment == 0): * raise ValueError('Invalid output alignment: ' */ } /* "pyfftw/pyfftw.pyx":1493 * 'aligned.' % self.output_alignment) * * if not new_input_array.dtype == self._input_dtype: # <<<<<<<<<<<<<< * raise ValueError('Invalid input dtype: ' * 'The new input array is not of the same ' */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_new_input_array, __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_v_self->_input_dtype, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_8 = ((!__pyx_t_7) != 0); if (__pyx_t_8) { /* "pyfftw/pyfftw.pyx":1494 * * if not new_input_array.dtype == self._input_dtype: * raise ValueError('Invalid input dtype: ' # <<<<<<<<<<<<<< * 'The new input array is not of the same ' * 'dtype as was originally planned for.') */ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pyfftw/pyfftw.pyx":1493 * 'aligned.' % self.output_alignment) * * if not new_input_array.dtype == self._input_dtype: # <<<<<<<<<<<<<< * raise ValueError('Invalid input dtype: ' * 'The new input array is not of the same ' */ } /* "pyfftw/pyfftw.pyx":1498 * 'dtype as was originally planned for.') * * if not new_output_array.dtype == self._output_dtype: # <<<<<<<<<<<<<< * raise ValueError('Invalid output dtype: ' * 'The new output array is not of the same ' */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_new_output_array, __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1498; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_v_self->_output_dtype, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1498; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1498; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_7 = ((!__pyx_t_8) != 0); if (__pyx_t_7) { /* "pyfftw/pyfftw.pyx":1499 * * if not new_output_array.dtype == self._output_dtype: * raise ValueError('Invalid output dtype: ' # <<<<<<<<<<<<<< * 'The new output array is not of the same ' * 'dtype as was originally planned for.') */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pyfftw/pyfftw.pyx":1498 * 'dtype as was originally planned for.') * * if not new_output_array.dtype == self._output_dtype: # <<<<<<<<<<<<<< * raise ValueError('Invalid output dtype: ' * 'The new output array is not of the same ' */ } /* "pyfftw/pyfftw.pyx":1503 * 'dtype as was originally planned for.') * * new_input_shape = new_input_array.shape # <<<<<<<<<<<<<< * new_output_shape = new_output_array.shape * */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_new_input_array, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_new_input_shape = __pyx_t_1; __pyx_t_1 = 0; /* "pyfftw/pyfftw.pyx":1504 * * new_input_shape = new_input_array.shape * new_output_shape = new_output_array.shape # <<<<<<<<<<<<<< * * new_input_strides = new_input_array.strides */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_new_output_array, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1504; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_new_output_shape = __pyx_t_1; __pyx_t_1 = 0; /* "pyfftw/pyfftw.pyx":1506 * new_output_shape = new_output_array.shape * * new_input_strides = new_input_array.strides # <<<<<<<<<<<<<< * new_output_strides = new_output_array.strides * */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_new_input_array, __pyx_n_s_strides); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1506; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_new_input_strides = __pyx_t_1; __pyx_t_1 = 0; /* "pyfftw/pyfftw.pyx":1507 * * new_input_strides = new_input_array.strides * new_output_strides = new_output_array.strides # <<<<<<<<<<<<<< * * if not new_input_shape == self._input_shape: */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_new_output_array, __pyx_n_s_strides); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1507; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_new_output_strides = __pyx_t_1; __pyx_t_1 = 0; /* "pyfftw/pyfftw.pyx":1509 * new_output_strides = new_output_array.strides * * if not new_input_shape == self._input_shape: # <<<<<<<<<<<<<< * raise ValueError('Invalid input shape: ' * 'The new input array should be the same shape as ' */ __pyx_t_1 = PyObject_RichCompare(__pyx_v_new_input_shape, __pyx_v_self->_input_shape, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1509; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1509; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_8 = ((!__pyx_t_7) != 0); if (__pyx_t_8) { /* "pyfftw/pyfftw.pyx":1510 * * if not new_input_shape == self._input_shape: * raise ValueError('Invalid input shape: ' # <<<<<<<<<<<<<< * 'The new input array should be the same shape as ' * 'the input array used to instantiate the object.') */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1510; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1510; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pyfftw/pyfftw.pyx":1509 * new_output_strides = new_output_array.strides * * if not new_input_shape == self._input_shape: # <<<<<<<<<<<<<< * raise ValueError('Invalid input shape: ' * 'The new input array should be the same shape as ' */ } /* "pyfftw/pyfftw.pyx":1514 * 'the input array used to instantiate the object.') * * if not new_output_shape == self._output_shape: # <<<<<<<<<<<<<< * raise ValueError('Invalid output shape: ' * 'The new output array should be the same shape as ' */ __pyx_t_1 = PyObject_RichCompare(__pyx_v_new_output_shape, __pyx_v_self->_output_shape, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1514; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1514; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_7 = ((!__pyx_t_8) != 0); if (__pyx_t_7) { /* "pyfftw/pyfftw.pyx":1515 * * if not new_output_shape == self._output_shape: * raise ValueError('Invalid output shape: ' # <<<<<<<<<<<<<< * 'The new output array should be the same shape as ' * 'the output array used to instantiate the object.') */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1515; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1515; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pyfftw/pyfftw.pyx":1514 * 'the input array used to instantiate the object.') * * if not new_output_shape == self._output_shape: # <<<<<<<<<<<<<< * raise ValueError('Invalid output shape: ' * 'The new output array should be the same shape as ' */ } /* "pyfftw/pyfftw.pyx":1519 * 'the output array used to instantiate the object.') * * if not new_input_strides == self._input_strides: # <<<<<<<<<<<<<< * raise ValueError('Invalid input striding: ' * 'The strides should be identical for the new ' */ __pyx_t_1 = PyObject_RichCompare(__pyx_v_new_input_strides, __pyx_v_self->_input_strides, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1519; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1519; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_8 = ((!__pyx_t_7) != 0); if (__pyx_t_8) { /* "pyfftw/pyfftw.pyx":1520 * * if not new_input_strides == self._input_strides: * raise ValueError('Invalid input striding: ' # <<<<<<<<<<<<<< * 'The strides should be identical for the new ' * 'input array as for the old.') */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1520; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1520; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pyfftw/pyfftw.pyx":1519 * 'the output array used to instantiate the object.') * * if not new_input_strides == self._input_strides: # <<<<<<<<<<<<<< * raise ValueError('Invalid input striding: ' * 'The strides should be identical for the new ' */ } /* "pyfftw/pyfftw.pyx":1524 * 'input array as for the old.') * * if not new_output_strides == self._output_strides: # <<<<<<<<<<<<<< * raise ValueError('Invalid output striding: ' * 'The strides should be identical for the new ' */ __pyx_t_1 = PyObject_RichCompare(__pyx_v_new_output_strides, __pyx_v_self->_output_strides, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_7 = ((!__pyx_t_8) != 0); if (__pyx_t_7) { /* "pyfftw/pyfftw.pyx":1525 * * if not new_output_strides == self._output_strides: * raise ValueError('Invalid output striding: ' # <<<<<<<<<<<<<< * 'The strides should be identical for the new ' * 'output array as for the old.') */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1525; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1525; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pyfftw/pyfftw.pyx":1524 * 'input array as for the old.') * * if not new_output_strides == self._output_strides: # <<<<<<<<<<<<<< * raise ValueError('Invalid output striding: ' * 'The strides should be identical for the new ' */ } /* "pyfftw/pyfftw.pyx":1529 * 'output array as for the old.') * * self._update_arrays(new_input_array, new_output_array) # <<<<<<<<<<<<<< * * cdef _update_arrays(self, */ if (!(likely(((__pyx_v_new_input_array) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_new_input_array, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1529; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (!(likely(((__pyx_v_new_output_array) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_new_output_array, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1529; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_1 = ((struct __pyx_vtabstruct_6pyfftw_6pyfftw_FFTW *)__pyx_v_self->__pyx_vtab)->_update_arrays(__pyx_v_self, ((PyArrayObject *)__pyx_v_new_input_array), ((PyArrayObject *)__pyx_v_new_output_array)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1529; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pyfftw/pyfftw.pyx":1446 * return self._output_array * * cpdef update_arrays(self, # <<<<<<<<<<<<<< * new_input_array, new_output_array): * '''update_arrays(new_input_array, new_output_array) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pyfftw.pyfftw.FFTW.update_arrays", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_new_input_shape); __Pyx_XDECREF(__pyx_v_new_output_shape); __Pyx_XDECREF(__pyx_v_new_input_strides); __Pyx_XDECREF(__pyx_v_new_output_strides); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6pyfftw_6pyfftw_4FFTW_39update_arrays(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_6pyfftw_6pyfftw_4FFTW_38update_arrays[] = "update_arrays(new_input_array, new_output_array)\n\n Update the arrays upon which the DFT is taken.\n\n The new arrays should be of the same dtypes as the originals, the same\n shapes as the originals and should have the same strides between axes.\n If the original data was aligned so as to allow SIMD instructions\n (e.g. by being aligned on a 16-byte boundary), then the new array must\n also be aligned so as to allow SIMD instructions (assuming, of\n course, that the ``FFTW_UNALIGNED`` flag was not enabled).\n \n The byte alignment requirement extends to requiring natural\n alignment in the non-SIMD cases as well, but this is much less\n stringent as it simply means avoiding arrays shifted by, say,\n a single byte (which invariably takes some effort to\n achieve!).\n\n If all these conditions are not met, a ``ValueError`` will\n be raised and the data will *not* be updated (though the \n object will still be in a sane state).\n "; static PyObject *__pyx_pw_6pyfftw_6pyfftw_4FFTW_39update_arrays(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_new_input_array = 0; PyObject *__pyx_v_new_output_array = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("update_arrays (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_new_input_array,&__pyx_n_s_new_output_array,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_new_input_array)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_new_output_array)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("update_arrays", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1446; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "update_arrays") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1446; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_new_input_array = values[0]; __pyx_v_new_output_array = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("update_arrays", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1446; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("pyfftw.pyfftw.FFTW.update_arrays", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_6pyfftw_6pyfftw_4FFTW_38update_arrays(((struct __pyx_obj_6pyfftw_6pyfftw_FFTW *)__pyx_v_self), __pyx_v_new_input_array, __pyx_v_new_output_array); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6pyfftw_6pyfftw_4FFTW_38update_arrays(struct __pyx_obj_6pyfftw_6pyfftw_FFTW *__pyx_v_self, PyObject *__pyx_v_new_input_array, PyObject *__pyx_v_new_output_array) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("update_arrays", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_6pyfftw_6pyfftw_4FFTW_update_arrays(__pyx_v_self, __pyx_v_new_input_array, __pyx_v_new_output_array, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pyfftw.pyfftw.FFTW.update_arrays", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pyfftw/pyfftw.pyx":1531 * self._update_arrays(new_input_array, new_output_array) * * cdef _update_arrays(self, # <<<<<<<<<<<<<< * np.ndarray new_input_array, np.ndarray new_output_array): * ''' A C interface to the update_arrays method that does not */ static PyObject *__pyx_f_6pyfftw_6pyfftw_4FFTW__update_arrays(struct __pyx_obj_6pyfftw_6pyfftw_FFTW *__pyx_v_self, PyArrayObject *__pyx_v_new_input_array, PyArrayObject *__pyx_v_new_output_array) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_update_arrays", 0); /* "pyfftw/pyfftw.pyx":1536 * perform any checks on strides being correct and so on. * ''' * self._input_array = new_input_array # <<<<<<<<<<<<<< * self._output_array = new_output_array * */ __Pyx_INCREF(((PyObject *)__pyx_v_new_input_array)); __Pyx_GIVEREF(((PyObject *)__pyx_v_new_input_array)); __Pyx_GOTREF(__pyx_v_self->_input_array); __Pyx_DECREF(((PyObject *)__pyx_v_self->_input_array)); __pyx_v_self->_input_array = __pyx_v_new_input_array; /* "pyfftw/pyfftw.pyx":1537 * ''' * self._input_array = new_input_array * self._output_array = new_output_array # <<<<<<<<<<<<<< * * def get_input_array(self): */ __Pyx_INCREF(((PyObject *)__pyx_v_new_output_array)); __Pyx_GIVEREF(((PyObject *)__pyx_v_new_output_array)); __Pyx_GOTREF(__pyx_v_self->_output_array); __Pyx_DECREF(((PyObject *)__pyx_v_self->_output_array)); __pyx_v_self->_output_array = __pyx_v_new_output_array; /* "pyfftw/pyfftw.pyx":1531 * self._update_arrays(new_input_array, new_output_array) * * cdef _update_arrays(self, # <<<<<<<<<<<<<< * np.ndarray new_input_array, np.ndarray new_output_array): * ''' A C interface to the update_arrays method that does not */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pyfftw/pyfftw.pyx":1539 * self._output_array = new_output_array * * def get_input_array(self): # <<<<<<<<<<<<<< * '''get_input_array() * */ /* Python wrapper */ static PyObject *__pyx_pw_6pyfftw_6pyfftw_4FFTW_41get_input_array(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_6pyfftw_6pyfftw_4FFTW_40get_input_array[] = "get_input_array()\n\n Return the input array that is associated with the FFTW \n instance.\n\n *Deprecated since 0.10. Consider using the* :attr:`FFTW.input_array` \n *property instead.*\n "; static PyObject *__pyx_pw_6pyfftw_6pyfftw_4FFTW_41get_input_array(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_input_array (wrapper)", 0); __pyx_r = __pyx_pf_6pyfftw_6pyfftw_4FFTW_40get_input_array(((struct __pyx_obj_6pyfftw_6pyfftw_FFTW *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6pyfftw_6pyfftw_4FFTW_40get_input_array(struct __pyx_obj_6pyfftw_6pyfftw_FFTW *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_input_array", 0); /* "pyfftw/pyfftw.pyx":1548 * *property instead.* * ''' * warnings.warn('get_input_array is deprecated. ' # <<<<<<<<<<<<<< * 'Consider using the input_array property instead.', * DeprecationWarning) */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_warnings); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1548; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_warn); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1548; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pyfftw/pyfftw.pyx":1550 * warnings.warn('get_input_array is deprecated. ' * 'Consider using the input_array property instead.', * DeprecationWarning) # <<<<<<<<<<<<<< * * return self._input_array */ __pyx_t_2 = NULL; __pyx_t_4 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1548; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_2) { __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL; } __Pyx_INCREF(__pyx_kp_s_get_input_array_is_deprecated_Co); __Pyx_GIVEREF(__pyx_kp_s_get_input_array_is_deprecated_Co); PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_kp_s_get_input_array_is_deprecated_Co); __Pyx_INCREF(__pyx_builtin_DeprecationWarning); __Pyx_GIVEREF(__pyx_builtin_DeprecationWarning); PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_builtin_DeprecationWarning); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1548; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pyfftw/pyfftw.pyx":1552 * DeprecationWarning) * * return self._input_array # <<<<<<<<<<<<<< * * def get_output_array(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self->_input_array)); __pyx_r = ((PyObject *)__pyx_v_self->_input_array); goto __pyx_L0; /* "pyfftw/pyfftw.pyx":1539 * self._output_array = new_output_array * * def get_input_array(self): # <<<<<<<<<<<<<< * '''get_input_array() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pyfftw.pyfftw.FFTW.get_input_array", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pyfftw/pyfftw.pyx":1554 * return self._input_array * * def get_output_array(self): # <<<<<<<<<<<<<< * '''get_output_array() * */ /* Python wrapper */ static PyObject *__pyx_pw_6pyfftw_6pyfftw_4FFTW_43get_output_array(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_6pyfftw_6pyfftw_4FFTW_42get_output_array[] = "get_output_array()\n\n Return the output array that is associated with the FFTW\n instance.\n\n *Deprecated since 0.10. Consider using the* :attr:`FFTW.output_array` \n *property instead.*\n "; static PyObject *__pyx_pw_6pyfftw_6pyfftw_4FFTW_43get_output_array(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_output_array (wrapper)", 0); __pyx_r = __pyx_pf_6pyfftw_6pyfftw_4FFTW_42get_output_array(((struct __pyx_obj_6pyfftw_6pyfftw_FFTW *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6pyfftw_6pyfftw_4FFTW_42get_output_array(struct __pyx_obj_6pyfftw_6pyfftw_FFTW *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_output_array", 0); /* "pyfftw/pyfftw.pyx":1563 * *property instead.* * ''' * warnings.warn('get_output_array is deprecated. ' # <<<<<<<<<<<<<< * 'Consider using the output_array property instead.', * DeprecationWarning) */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_warnings); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1563; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_warn); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1563; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pyfftw/pyfftw.pyx":1565 * warnings.warn('get_output_array is deprecated. ' * 'Consider using the output_array property instead.', * DeprecationWarning) # <<<<<<<<<<<<<< * * return self._output_array */ __pyx_t_2 = NULL; __pyx_t_4 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1563; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_2) { __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL; } __Pyx_INCREF(__pyx_kp_s_get_output_array_is_deprecated_C); __Pyx_GIVEREF(__pyx_kp_s_get_output_array_is_deprecated_C); PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_kp_s_get_output_array_is_deprecated_C); __Pyx_INCREF(__pyx_builtin_DeprecationWarning); __Pyx_GIVEREF(__pyx_builtin_DeprecationWarning); PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_builtin_DeprecationWarning); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1563; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pyfftw/pyfftw.pyx":1567 * DeprecationWarning) * * return self._output_array # <<<<<<<<<<<<<< * * cpdef execute(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self->_output_array)); __pyx_r = ((PyObject *)__pyx_v_self->_output_array); goto __pyx_L0; /* "pyfftw/pyfftw.pyx":1554 * return self._input_array * * def get_output_array(self): # <<<<<<<<<<<<<< * '''get_output_array() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pyfftw.pyfftw.FFTW.get_output_array", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pyfftw/pyfftw.pyx":1569 * return self._output_array * * cpdef execute(self): # <<<<<<<<<<<<<< * '''execute() * */ static PyObject *__pyx_pw_6pyfftw_6pyfftw_4FFTW_45execute(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_f_6pyfftw_6pyfftw_4FFTW_execute(struct __pyx_obj_6pyfftw_6pyfftw_FFTW *__pyx_v_self, int __pyx_skip_dispatch) { void *__pyx_v_input_pointer; void *__pyx_v_output_pointer; void *__pyx_v_plan; __pyx_t_6pyfftw_6pyfftw_fftw_generic_execute __pyx_v_fftw_execute; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; void *__pyx_t_5; __pyx_t_6pyfftw_6pyfftw_fftw_generic_execute __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("execute", 0); /* Check if called by wrapper */ if (unlikely(__pyx_skip_dispatch)) ; /* Check if overridden in Python */ else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_execute); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6pyfftw_6pyfftw_4FFTW_45execute)) { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } /* "pyfftw/pyfftw.pyx":1578 * ''' * cdef void *input_pointer = ( * np.PyArray_DATA(self._input_array)) # <<<<<<<<<<<<<< * cdef void *output_pointer = ( * np.PyArray_DATA(self._output_array)) */ __pyx_t_1 = ((PyObject *)__pyx_v_self->_input_array); __Pyx_INCREF(__pyx_t_1); __pyx_v_input_pointer = ((void *)PyArray_DATA(((PyArrayObject *)__pyx_t_1))); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pyfftw/pyfftw.pyx":1580 * np.PyArray_DATA(self._input_array)) * cdef void *output_pointer = ( * np.PyArray_DATA(self._output_array)) # <<<<<<<<<<<<<< * * cdef void *plan = self._plan */ __pyx_t_1 = ((PyObject *)__pyx_v_self->_output_array); __Pyx_INCREF(__pyx_t_1); __pyx_v_output_pointer = ((void *)PyArray_DATA(((PyArrayObject *)__pyx_t_1))); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pyfftw/pyfftw.pyx":1582 * np.PyArray_DATA(self._output_array)) * * cdef void *plan = self._plan # <<<<<<<<<<<<<< * cdef fftw_generic_execute fftw_execute = self._fftw_execute * with nogil: */ __pyx_t_5 = __pyx_v_self->_plan; __pyx_v_plan = __pyx_t_5; /* "pyfftw/pyfftw.pyx":1583 * * cdef void *plan = self._plan * cdef fftw_generic_execute fftw_execute = self._fftw_execute # <<<<<<<<<<<<<< * with nogil: * fftw_execute(plan, input_pointer, output_pointer) */ __pyx_t_6 = __pyx_v_self->_fftw_execute; __pyx_v_fftw_execute = __pyx_t_6; /* "pyfftw/pyfftw.pyx":1584 * cdef void *plan = self._plan * cdef fftw_generic_execute fftw_execute = self._fftw_execute * with nogil: # <<<<<<<<<<<<<< * fftw_execute(plan, input_pointer, output_pointer) * */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "pyfftw/pyfftw.pyx":1585 * cdef fftw_generic_execute fftw_execute = self._fftw_execute * with nogil: * fftw_execute(plan, input_pointer, output_pointer) # <<<<<<<<<<<<<< * * cdef void count_char(char c, void *counter_ptr): */ __pyx_v_fftw_execute(__pyx_v_plan, __pyx_v_input_pointer, __pyx_v_output_pointer); } /* "pyfftw/pyfftw.pyx":1584 * cdef void *plan = self._plan * cdef fftw_generic_execute fftw_execute = self._fftw_execute * with nogil: # <<<<<<<<<<<<<< * fftw_execute(plan, input_pointer, output_pointer) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L5; } __pyx_L5:; } } /* "pyfftw/pyfftw.pyx":1569 * return self._output_array * * cpdef execute(self): # <<<<<<<<<<<<<< * '''execute() * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pyfftw.pyfftw.FFTW.execute", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_6pyfftw_6pyfftw_4FFTW_45execute(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_6pyfftw_6pyfftw_4FFTW_44execute[] = "execute()\n\n Execute the planned operation, taking the correct kind of FFT of\n the input array (i.e. :attr:`FFTW.input_array`), \n and putting the result in the output array (i.e.\n :attr:`FFTW.output_array`).\n "; static PyObject *__pyx_pw_6pyfftw_6pyfftw_4FFTW_45execute(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("execute (wrapper)", 0); __pyx_r = __pyx_pf_6pyfftw_6pyfftw_4FFTW_44execute(((struct __pyx_obj_6pyfftw_6pyfftw_FFTW *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6pyfftw_6pyfftw_4FFTW_44execute(struct __pyx_obj_6pyfftw_6pyfftw_FFTW *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("execute", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_6pyfftw_6pyfftw_4FFTW_execute(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pyfftw.pyfftw.FFTW.execute", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pyfftw/pyfftw.pyx":1587 * fftw_execute(plan, input_pointer, output_pointer) * * cdef void count_char(char c, void *counter_ptr): # <<<<<<<<<<<<<< * ''' * On every call, increment the derefenced counter_ptr. */ static void __pyx_f_6pyfftw_6pyfftw_count_char(CYTHON_UNUSED char __pyx_v_c, void *__pyx_v_counter_ptr) { __Pyx_RefNannyDeclarations int *__pyx_t_1; long __pyx_t_2; __Pyx_RefNannySetupContext("count_char", 0); /* "pyfftw/pyfftw.pyx":1591 * On every call, increment the derefenced counter_ptr. * ''' * (counter_ptr)[0] += 1 # <<<<<<<<<<<<<< * * */ __pyx_t_1 = ((int *)__pyx_v_counter_ptr); __pyx_t_2 = 0; (__pyx_t_1[__pyx_t_2]) = ((__pyx_t_1[__pyx_t_2]) + 1); /* "pyfftw/pyfftw.pyx":1587 * fftw_execute(plan, input_pointer, output_pointer) * * cdef void count_char(char c, void *counter_ptr): # <<<<<<<<<<<<<< * ''' * On every call, increment the derefenced counter_ptr. */ /* function exit code */ __Pyx_RefNannyFinishContext(); } /* "pyfftw/pyfftw.pyx":1594 * * * cdef void write_char_to_string(char c, void *string_location_ptr): # <<<<<<<<<<<<<< * ''' * Write the passed character c to the memory location */ static void __pyx_f_6pyfftw_6pyfftw_write_char_to_string(char __pyx_v_c, void *__pyx_v_string_location_ptr) { char *__pyx_v_write_location; __Pyx_RefNannyDeclarations intptr_t *__pyx_t_1; long __pyx_t_2; __Pyx_RefNannySetupContext("write_char_to_string", 0); /* "pyfftw/pyfftw.pyx":1608 * unallocated piece of memory, a segfault will likely occur. * ''' * cdef char *write_location = ((string_location_ptr)[0]) # <<<<<<<<<<<<<< * write_location[0] = c * */ __pyx_v_write_location = ((char *)(((intptr_t *)__pyx_v_string_location_ptr)[0])); /* "pyfftw/pyfftw.pyx":1609 * ''' * cdef char *write_location = ((string_location_ptr)[0]) * write_location[0] = c # <<<<<<<<<<<<<< * * (string_location_ptr)[0] += 1 */ (__pyx_v_write_location[0]) = __pyx_v_c; /* "pyfftw/pyfftw.pyx":1611 * write_location[0] = c * * (string_location_ptr)[0] += 1 # <<<<<<<<<<<<<< * * */ __pyx_t_1 = ((intptr_t *)__pyx_v_string_location_ptr); __pyx_t_2 = 0; (__pyx_t_1[__pyx_t_2]) = ((__pyx_t_1[__pyx_t_2]) + 1); /* "pyfftw/pyfftw.pyx":1594 * * * cdef void write_char_to_string(char c, void *string_location_ptr): # <<<<<<<<<<<<<< * ''' * Write the passed character c to the memory location */ /* function exit code */ __Pyx_RefNannyFinishContext(); } /* "pyfftw/pyfftw.pyx":1614 * * * def export_wisdom(): # <<<<<<<<<<<<<< * '''export_wisdom() * */ /* Python wrapper */ static PyObject *__pyx_pw_6pyfftw_6pyfftw_21export_wisdom(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_6pyfftw_6pyfftw_20export_wisdom[] = "export_wisdom()\n\n Return the FFTW wisdom as a tuple of strings.\n\n The first string in the tuple is the string for the double\n precision wisdom. The second string in the tuple is the string \n for the single precision wisdom. The third string in the tuple \n is the string for the long double precision wisdom.\n\n The tuple that is returned from this function can be used as the\n argument to :func:`~pyfftw.import_wisdom`.\n "; static PyMethodDef __pyx_mdef_6pyfftw_6pyfftw_21export_wisdom = {"export_wisdom", (PyCFunction)__pyx_pw_6pyfftw_6pyfftw_21export_wisdom, METH_NOARGS, __pyx_doc_6pyfftw_6pyfftw_20export_wisdom}; static PyObject *__pyx_pw_6pyfftw_6pyfftw_21export_wisdom(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("export_wisdom (wrapper)", 0); __pyx_r = __pyx_pf_6pyfftw_6pyfftw_20export_wisdom(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6pyfftw_6pyfftw_20export_wisdom(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_v_py_wisdom = 0; PyObject *__pyx_v_py_wisdomf = 0; PyObject *__pyx_v_py_wisdoml = 0; int __pyx_v_counter; int __pyx_v_counterf; int __pyx_v_counterl; char *__pyx_v_c_wisdom; char *__pyx_v_c_wisdomf; char *__pyx_v_c_wisdoml; intptr_t __pyx_v_c_wisdom_ptr; intptr_t __pyx_v_c_wisdomf_ptr; intptr_t __pyx_v_c_wisdoml_ptr; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_t_5; char const *__pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("export_wisdom", 0); /* "pyfftw/pyfftw.pyx":1632 * cdef bytes py_wisdoml * * cdef int counter = 0 # <<<<<<<<<<<<<< * cdef int counterf = 0 * cdef int counterl = 0 */ __pyx_v_counter = 0; /* "pyfftw/pyfftw.pyx":1633 * * cdef int counter = 0 * cdef int counterf = 0 # <<<<<<<<<<<<<< * cdef int counterl = 0 * */ __pyx_v_counterf = 0; /* "pyfftw/pyfftw.pyx":1634 * cdef int counter = 0 * cdef int counterf = 0 * cdef int counterl = 0 # <<<<<<<<<<<<<< * * fftw_export_wisdom(&count_char, &counter) */ __pyx_v_counterl = 0; /* "pyfftw/pyfftw.pyx":1636 * cdef int counterl = 0 * * fftw_export_wisdom(&count_char, &counter) # <<<<<<<<<<<<<< * fftwf_export_wisdom(&count_char, &counterf) * fftwl_export_wisdom(&count_char, &counterl) */ fftw_export_wisdom((&__pyx_f_6pyfftw_6pyfftw_count_char), ((void *)(&__pyx_v_counter))); /* "pyfftw/pyfftw.pyx":1637 * * fftw_export_wisdom(&count_char, &counter) * fftwf_export_wisdom(&count_char, &counterf) # <<<<<<<<<<<<<< * fftwl_export_wisdom(&count_char, &counterl) * */ fftwf_export_wisdom((&__pyx_f_6pyfftw_6pyfftw_count_char), ((void *)(&__pyx_v_counterf))); /* "pyfftw/pyfftw.pyx":1638 * fftw_export_wisdom(&count_char, &counter) * fftwf_export_wisdom(&count_char, &counterf) * fftwl_export_wisdom(&count_char, &counterl) # <<<<<<<<<<<<<< * * cdef char* c_wisdom = malloc(sizeof(char)*(counter + 1)) */ fftwl_export_wisdom((&__pyx_f_6pyfftw_6pyfftw_count_char), ((void *)(&__pyx_v_counterl))); /* "pyfftw/pyfftw.pyx":1640 * fftwl_export_wisdom(&count_char, &counterl) * * cdef char* c_wisdom = malloc(sizeof(char)*(counter + 1)) # <<<<<<<<<<<<<< * cdef char* c_wisdomf = malloc(sizeof(char)*(counterf + 1)) * cdef char* c_wisdoml = malloc(sizeof(char)*(counterl + 1)) */ __pyx_v_c_wisdom = ((char *)malloc(((sizeof(char)) * (__pyx_v_counter + 1)))); /* "pyfftw/pyfftw.pyx":1641 * * cdef char* c_wisdom = malloc(sizeof(char)*(counter + 1)) * cdef char* c_wisdomf = malloc(sizeof(char)*(counterf + 1)) # <<<<<<<<<<<<<< * cdef char* c_wisdoml = malloc(sizeof(char)*(counterl + 1)) * */ __pyx_v_c_wisdomf = ((char *)malloc(((sizeof(char)) * (__pyx_v_counterf + 1)))); /* "pyfftw/pyfftw.pyx":1642 * cdef char* c_wisdom = malloc(sizeof(char)*(counter + 1)) * cdef char* c_wisdomf = malloc(sizeof(char)*(counterf + 1)) * cdef char* c_wisdoml = malloc(sizeof(char)*(counterl + 1)) # <<<<<<<<<<<<<< * * if c_wisdom == NULL or c_wisdomf == NULL or c_wisdoml == NULL: */ __pyx_v_c_wisdoml = ((char *)malloc(((sizeof(char)) * (__pyx_v_counterl + 1)))); /* "pyfftw/pyfftw.pyx":1644 * cdef char* c_wisdoml = malloc(sizeof(char)*(counterl + 1)) * * if c_wisdom == NULL or c_wisdomf == NULL or c_wisdoml == NULL: # <<<<<<<<<<<<<< * raise MemoryError * */ __pyx_t_2 = ((__pyx_v_c_wisdom == NULL) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L4_bool_binop_done; } __pyx_t_2 = ((__pyx_v_c_wisdomf == NULL) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L4_bool_binop_done; } __pyx_t_2 = ((__pyx_v_c_wisdoml == NULL) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "pyfftw/pyfftw.pyx":1645 * * if c_wisdom == NULL or c_wisdomf == NULL or c_wisdoml == NULL: * raise MemoryError # <<<<<<<<<<<<<< * * # Set the pointers to the string pointers */ PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1645; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pyfftw/pyfftw.pyx":1644 * cdef char* c_wisdoml = malloc(sizeof(char)*(counterl + 1)) * * if c_wisdom == NULL or c_wisdomf == NULL or c_wisdoml == NULL: # <<<<<<<<<<<<<< * raise MemoryError * */ } /* "pyfftw/pyfftw.pyx":1648 * * # Set the pointers to the string pointers * cdef intptr_t c_wisdom_ptr = c_wisdom # <<<<<<<<<<<<<< * cdef intptr_t c_wisdomf_ptr = c_wisdomf * cdef intptr_t c_wisdoml_ptr = c_wisdoml */ __pyx_v_c_wisdom_ptr = ((intptr_t)__pyx_v_c_wisdom); /* "pyfftw/pyfftw.pyx":1649 * # Set the pointers to the string pointers * cdef intptr_t c_wisdom_ptr = c_wisdom * cdef intptr_t c_wisdomf_ptr = c_wisdomf # <<<<<<<<<<<<<< * cdef intptr_t c_wisdoml_ptr = c_wisdoml * */ __pyx_v_c_wisdomf_ptr = ((intptr_t)__pyx_v_c_wisdomf); /* "pyfftw/pyfftw.pyx":1650 * cdef intptr_t c_wisdom_ptr = c_wisdom * cdef intptr_t c_wisdomf_ptr = c_wisdomf * cdef intptr_t c_wisdoml_ptr = c_wisdoml # <<<<<<<<<<<<<< * * fftw_export_wisdom(&write_char_to_string, &c_wisdom_ptr) */ __pyx_v_c_wisdoml_ptr = ((intptr_t)__pyx_v_c_wisdoml); /* "pyfftw/pyfftw.pyx":1652 * cdef intptr_t c_wisdoml_ptr = c_wisdoml * * fftw_export_wisdom(&write_char_to_string, &c_wisdom_ptr) # <<<<<<<<<<<<<< * fftwf_export_wisdom(&write_char_to_string, &c_wisdomf_ptr) * fftwl_export_wisdom(&write_char_to_string, &c_wisdoml_ptr) */ fftw_export_wisdom((&__pyx_f_6pyfftw_6pyfftw_write_char_to_string), ((void *)(&__pyx_v_c_wisdom_ptr))); /* "pyfftw/pyfftw.pyx":1653 * * fftw_export_wisdom(&write_char_to_string, &c_wisdom_ptr) * fftwf_export_wisdom(&write_char_to_string, &c_wisdomf_ptr) # <<<<<<<<<<<<<< * fftwl_export_wisdom(&write_char_to_string, &c_wisdoml_ptr) * */ fftwf_export_wisdom((&__pyx_f_6pyfftw_6pyfftw_write_char_to_string), ((void *)(&__pyx_v_c_wisdomf_ptr))); /* "pyfftw/pyfftw.pyx":1654 * fftw_export_wisdom(&write_char_to_string, &c_wisdom_ptr) * fftwf_export_wisdom(&write_char_to_string, &c_wisdomf_ptr) * fftwl_export_wisdom(&write_char_to_string, &c_wisdoml_ptr) # <<<<<<<<<<<<<< * * # Write the last byte as the null byte */ fftwl_export_wisdom((&__pyx_f_6pyfftw_6pyfftw_write_char_to_string), ((void *)(&__pyx_v_c_wisdoml_ptr))); /* "pyfftw/pyfftw.pyx":1657 * * # Write the last byte as the null byte * c_wisdom[counter] = 0 # <<<<<<<<<<<<<< * c_wisdomf[counterf] = 0 * c_wisdoml[counterl] = 0 */ (__pyx_v_c_wisdom[__pyx_v_counter]) = 0; /* "pyfftw/pyfftw.pyx":1658 * # Write the last byte as the null byte * c_wisdom[counter] = 0 * c_wisdomf[counterf] = 0 # <<<<<<<<<<<<<< * c_wisdoml[counterl] = 0 * */ (__pyx_v_c_wisdomf[__pyx_v_counterf]) = 0; /* "pyfftw/pyfftw.pyx":1659 * c_wisdom[counter] = 0 * c_wisdomf[counterf] = 0 * c_wisdoml[counterl] = 0 # <<<<<<<<<<<<<< * * try: */ (__pyx_v_c_wisdoml[__pyx_v_counterl]) = 0; /* "pyfftw/pyfftw.pyx":1661 * c_wisdoml[counterl] = 0 * * try: # <<<<<<<<<<<<<< * py_wisdom = c_wisdom * py_wisdomf = c_wisdomf */ /*try:*/ { /* "pyfftw/pyfftw.pyx":1662 * * try: * py_wisdom = c_wisdom # <<<<<<<<<<<<<< * py_wisdomf = c_wisdomf * py_wisdoml = c_wisdoml */ __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_c_wisdom); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1662; __pyx_clineno = __LINE__; goto __pyx_L8_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_v_py_wisdom = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "pyfftw/pyfftw.pyx":1663 * try: * py_wisdom = c_wisdom * py_wisdomf = c_wisdomf # <<<<<<<<<<<<<< * py_wisdoml = c_wisdoml * */ __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_c_wisdomf); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1663; __pyx_clineno = __LINE__; goto __pyx_L8_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_v_py_wisdomf = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "pyfftw/pyfftw.pyx":1664 * py_wisdom = c_wisdom * py_wisdomf = c_wisdomf * py_wisdoml = c_wisdoml # <<<<<<<<<<<<<< * * finally: */ __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_c_wisdoml); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1664; __pyx_clineno = __LINE__; goto __pyx_L8_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_v_py_wisdoml = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; } /* "pyfftw/pyfftw.pyx":1667 * * finally: * free(c_wisdom) # <<<<<<<<<<<<<< * free(c_wisdomf) * free(c_wisdoml) */ /*finally:*/ { /*normal exit:*/{ free(__pyx_v_c_wisdom); /* "pyfftw/pyfftw.pyx":1668 * finally: * free(c_wisdom) * free(c_wisdomf) # <<<<<<<<<<<<<< * free(c_wisdoml) * */ free(__pyx_v_c_wisdomf); /* "pyfftw/pyfftw.pyx":1669 * free(c_wisdom) * free(c_wisdomf) * free(c_wisdoml) # <<<<<<<<<<<<<< * * return (py_wisdom, py_wisdomf, py_wisdoml) */ free(__pyx_v_c_wisdoml); goto __pyx_L9; } /*exception exit:*/{ __pyx_L8_error:; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_12); __pyx_t_4 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename; { /* "pyfftw/pyfftw.pyx":1667 * * finally: * free(c_wisdom) # <<<<<<<<<<<<<< * free(c_wisdomf) * free(c_wisdoml) */ free(__pyx_v_c_wisdom); /* "pyfftw/pyfftw.pyx":1668 * finally: * free(c_wisdom) * free(c_wisdomf) # <<<<<<<<<<<<<< * free(c_wisdoml) * */ free(__pyx_v_c_wisdomf); /* "pyfftw/pyfftw.pyx":1669 * free(c_wisdom) * free(c_wisdomf) * free(c_wisdoml) # <<<<<<<<<<<<<< * * return (py_wisdom, py_wisdomf, py_wisdoml) */ free(__pyx_v_c_wisdoml); } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12); } __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9); __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6; goto __pyx_L1_error; } __pyx_L9:; } /* "pyfftw/pyfftw.pyx":1671 * free(c_wisdoml) * * return (py_wisdom, py_wisdomf, py_wisdoml) # <<<<<<<<<<<<<< * * def import_wisdom(wisdom): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1671; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_py_wisdom); __Pyx_GIVEREF(__pyx_v_py_wisdom); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_py_wisdom); __Pyx_INCREF(__pyx_v_py_wisdomf); __Pyx_GIVEREF(__pyx_v_py_wisdomf); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_py_wisdomf); __Pyx_INCREF(__pyx_v_py_wisdoml); __Pyx_GIVEREF(__pyx_v_py_wisdoml); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_py_wisdoml); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pyfftw/pyfftw.pyx":1614 * * * def export_wisdom(): # <<<<<<<<<<<<<< * '''export_wisdom() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pyfftw.pyfftw.export_wisdom", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_py_wisdom); __Pyx_XDECREF(__pyx_v_py_wisdomf); __Pyx_XDECREF(__pyx_v_py_wisdoml); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pyfftw/pyfftw.pyx":1673 * return (py_wisdom, py_wisdomf, py_wisdoml) * * def import_wisdom(wisdom): # <<<<<<<<<<<<<< * '''import_wisdom(wisdom) * */ /* Python wrapper */ static PyObject *__pyx_pw_6pyfftw_6pyfftw_23import_wisdom(PyObject *__pyx_self, PyObject *__pyx_v_wisdom); /*proto*/ static char __pyx_doc_6pyfftw_6pyfftw_22import_wisdom[] = "import_wisdom(wisdom)\n\n Function that imports wisdom from the passed tuple\n of strings.\n\n The first string in the tuple is the string for the double\n precision wisdom. The second string in the tuple is the string \n for the single precision wisdom. The third string in the tuple \n is the string for the long double precision wisdom.\n\n The tuple that is returned from :func:`~pyfftw.export_wisdom`\n can be used as the argument to this function.\n\n This function returns a tuple of boolean values indicating\n the success of loading each of the wisdom types (double, float \n and long double, in that order).\n "; static PyMethodDef __pyx_mdef_6pyfftw_6pyfftw_23import_wisdom = {"import_wisdom", (PyCFunction)__pyx_pw_6pyfftw_6pyfftw_23import_wisdom, METH_O, __pyx_doc_6pyfftw_6pyfftw_22import_wisdom}; static PyObject *__pyx_pw_6pyfftw_6pyfftw_23import_wisdom(PyObject *__pyx_self, PyObject *__pyx_v_wisdom) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("import_wisdom (wrapper)", 0); __pyx_r = __pyx_pf_6pyfftw_6pyfftw_22import_wisdom(__pyx_self, ((PyObject *)__pyx_v_wisdom)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6pyfftw_6pyfftw_22import_wisdom(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_wisdom) { char *__pyx_v_c_wisdom; char *__pyx_v_c_wisdomf; char *__pyx_v_c_wisdoml; int __pyx_v_success; int __pyx_v_successf; int __pyx_v_successl; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; char *__pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("import_wisdom", 0); /* "pyfftw/pyfftw.pyx":1692 * ''' * * cdef char* c_wisdom = wisdom[0] # <<<<<<<<<<<<<< * cdef char* c_wisdomf = wisdom[1] * cdef char* c_wisdoml = wisdom[2] */ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_wisdom, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1692; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_AsString(__pyx_t_1); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1692; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_c_wisdom = __pyx_t_2; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pyfftw/pyfftw.pyx":1693 * * cdef char* c_wisdom = wisdom[0] * cdef char* c_wisdomf = wisdom[1] # <<<<<<<<<<<<<< * cdef char* c_wisdoml = wisdom[2] * */ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_wisdom, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1693; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_AsString(__pyx_t_1); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1693; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_c_wisdomf = __pyx_t_2; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pyfftw/pyfftw.pyx":1694 * cdef char* c_wisdom = wisdom[0] * cdef char* c_wisdomf = wisdom[1] * cdef char* c_wisdoml = wisdom[2] # <<<<<<<<<<<<<< * * cdef bint success = fftw_import_wisdom_from_string(c_wisdom) */ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_wisdom, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1694; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_AsString(__pyx_t_1); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1694; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_c_wisdoml = __pyx_t_2; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pyfftw/pyfftw.pyx":1696 * cdef char* c_wisdoml = wisdom[2] * * cdef bint success = fftw_import_wisdom_from_string(c_wisdom) # <<<<<<<<<<<<<< * cdef bint successf = fftwf_import_wisdom_from_string(c_wisdomf) * cdef bint successl = fftwl_import_wisdom_from_string(c_wisdoml) */ __pyx_v_success = fftw_import_wisdom_from_string(__pyx_v_c_wisdom); /* "pyfftw/pyfftw.pyx":1697 * * cdef bint success = fftw_import_wisdom_from_string(c_wisdom) * cdef bint successf = fftwf_import_wisdom_from_string(c_wisdomf) # <<<<<<<<<<<<<< * cdef bint successl = fftwl_import_wisdom_from_string(c_wisdoml) * */ __pyx_v_successf = fftwf_import_wisdom_from_string(__pyx_v_c_wisdomf); /* "pyfftw/pyfftw.pyx":1698 * cdef bint success = fftw_import_wisdom_from_string(c_wisdom) * cdef bint successf = fftwf_import_wisdom_from_string(c_wisdomf) * cdef bint successl = fftwl_import_wisdom_from_string(c_wisdoml) # <<<<<<<<<<<<<< * * return (success, successf, successl) */ __pyx_v_successl = fftwl_import_wisdom_from_string(__pyx_v_c_wisdoml); /* "pyfftw/pyfftw.pyx":1700 * cdef bint successl = fftwl_import_wisdom_from_string(c_wisdoml) * * return (success, successf, successl) # <<<<<<<<<<<<<< * * #def export_wisdom_to_files( */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_success); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1700; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_successf); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1700; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_successl); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1700; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1700; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4); __pyx_t_1 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "pyfftw/pyfftw.pyx":1673 * return (py_wisdom, py_wisdomf, py_wisdoml) * * def import_wisdom(wisdom): # <<<<<<<<<<<<<< * '''import_wisdom(wisdom) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pyfftw.pyfftw.import_wisdom", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pyfftw/pyfftw.pyx":1789 * # return (success, successf, successl) * * def forget_wisdom(): # <<<<<<<<<<<<<< * '''forget_wisdom() * */ /* Python wrapper */ static PyObject *__pyx_pw_6pyfftw_6pyfftw_25forget_wisdom(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_6pyfftw_6pyfftw_24forget_wisdom[] = "forget_wisdom()\n\n Forget all the accumulated wisdom.\n "; static PyMethodDef __pyx_mdef_6pyfftw_6pyfftw_25forget_wisdom = {"forget_wisdom", (PyCFunction)__pyx_pw_6pyfftw_6pyfftw_25forget_wisdom, METH_NOARGS, __pyx_doc_6pyfftw_6pyfftw_24forget_wisdom}; static PyObject *__pyx_pw_6pyfftw_6pyfftw_25forget_wisdom(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("forget_wisdom (wrapper)", 0); __pyx_r = __pyx_pf_6pyfftw_6pyfftw_24forget_wisdom(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6pyfftw_6pyfftw_24forget_wisdom(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("forget_wisdom", 0); /* "pyfftw/pyfftw.pyx":1794 * Forget all the accumulated wisdom. * ''' * fftw_forget_wisdom() # <<<<<<<<<<<<<< * fftwf_forget_wisdom() * fftwl_forget_wisdom() */ fftw_forget_wisdom(); /* "pyfftw/pyfftw.pyx":1795 * ''' * fftw_forget_wisdom() * fftwf_forget_wisdom() # <<<<<<<<<<<<<< * fftwl_forget_wisdom() * */ fftwf_forget_wisdom(); /* "pyfftw/pyfftw.pyx":1796 * fftw_forget_wisdom() * fftwf_forget_wisdom() * fftwl_forget_wisdom() # <<<<<<<<<<<<<< * * */ fftwl_forget_wisdom(); /* "pyfftw/pyfftw.pyx":1789 * # return (success, successf, successl) * * def forget_wisdom(): # <<<<<<<<<<<<<< * '''forget_wisdom() * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":197 * # experimental exception made for __getbuffer__ and __releasebuffer__ * # -- the details of this may change. * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< * # This implementation of getbuffer is geared towards Cython * # requirements, and does not yet fullfill the PEP. */ /* Python wrapper */ static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { int __pyx_v_copy_shape; int __pyx_v_i; int __pyx_v_ndim; int __pyx_v_endian_detector; int __pyx_v_little_endian; int __pyx_v_t; char *__pyx_v_f; PyArray_Descr *__pyx_v_descr = 0; int __pyx_v_offset; int __pyx_v_hasfields; int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; char *__pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getbuffer__", 0); if (__pyx_v_info != NULL) { __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); __Pyx_GIVEREF(__pyx_v_info->obj); } /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":203 * # of flags * * if info == NULL: return # <<<<<<<<<<<<<< * * cdef int copy_shape, i, ndim */ __pyx_t_1 = ((__pyx_v_info == NULL) != 0); if (__pyx_t_1) { __pyx_r = 0; goto __pyx_L0; } /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":206 * * cdef int copy_shape, i, ndim * cdef int endian_detector = 1 # <<<<<<<<<<<<<< * cdef bint little_endian = ((&endian_detector)[0] != 0) * */ __pyx_v_endian_detector = 1; /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":207 * cdef int copy_shape, i, ndim * cdef int endian_detector = 1 * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< * * ndim = PyArray_NDIM(self) */ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":209 * cdef bint little_endian = ((&endian_detector)[0] != 0) * * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< * * if sizeof(npy_intp) != sizeof(Py_ssize_t): */ __pyx_v_ndim = PyArray_NDIM(__pyx_v_self); /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":211 * ndim = PyArray_NDIM(self) * * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< * copy_shape = 1 * else: */ __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); if (__pyx_t_1) { /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":212 * * if sizeof(npy_intp) != sizeof(Py_ssize_t): * copy_shape = 1 # <<<<<<<<<<<<<< * else: * copy_shape = 0 */ __pyx_v_copy_shape = 1; /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":211 * ndim = PyArray_NDIM(self) * * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< * copy_shape = 1 * else: */ goto __pyx_L4; } /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":214 * copy_shape = 1 * else: * copy_shape = 0 # <<<<<<<<<<<<<< * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) */ /*else*/ { __pyx_v_copy_shape = 0; } __pyx_L4:; /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":216 * copy_shape = 0 * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): * raise ValueError(u"ndarray is not C contiguous") */ __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0); if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L6_bool_binop_done; } /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":217 * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<< * raise ValueError(u"ndarray is not C contiguous") * */ __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L6_bool_binop_done:; /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":216 * copy_shape = 0 * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): * raise ValueError(u"ndarray is not C contiguous") */ if (__pyx_t_1) { /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":218 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) */ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[2]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":216 * copy_shape = 0 * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): * raise ValueError(u"ndarray is not C contiguous") */ } /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":220 * raise ValueError(u"ndarray is not C contiguous") * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): * raise ValueError(u"ndarray is not Fortran contiguous") */ __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0); if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L9_bool_binop_done; } /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":221 * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<< * raise ValueError(u"ndarray is not Fortran contiguous") * */ __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L9_bool_binop_done:; /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":220 * raise ValueError(u"ndarray is not C contiguous") * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): * raise ValueError(u"ndarray is not Fortran contiguous") */ if (__pyx_t_1) { /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":222 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< * * info.buf = PyArray_DATA(self) */ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[2]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":220 * raise ValueError(u"ndarray is not C contiguous") * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): * raise ValueError(u"ndarray is not Fortran contiguous") */ } /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":224 * raise ValueError(u"ndarray is not Fortran contiguous") * * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< * info.ndim = ndim * if copy_shape: */ __pyx_v_info->buf = PyArray_DATA(__pyx_v_self); /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":225 * * info.buf = PyArray_DATA(self) * info.ndim = ndim # <<<<<<<<<<<<<< * if copy_shape: * # Allocate new buffer for strides and shape info. */ __pyx_v_info->ndim = __pyx_v_ndim; /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":226 * info.buf = PyArray_DATA(self) * info.ndim = ndim * if copy_shape: # <<<<<<<<<<<<<< * # Allocate new buffer for strides and shape info. * # This is allocated as one block, strides first. */ __pyx_t_1 = (__pyx_v_copy_shape != 0); if (__pyx_t_1) { /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":229 * # Allocate new buffer for strides and shape info. * # This is allocated as one block, strides first. * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) # <<<<<<<<<<<<<< * info.shape = info.strides + ndim * for i in range(ndim): */ __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2))); /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":230 * # This is allocated as one block, strides first. * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) * info.shape = info.strides + ndim # <<<<<<<<<<<<<< * for i in range(ndim): * info.strides[i] = PyArray_STRIDES(self)[i] */ __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":231 * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) * info.shape = info.strides + ndim * for i in range(ndim): # <<<<<<<<<<<<<< * info.strides[i] = PyArray_STRIDES(self)[i] * info.shape[i] = PyArray_DIMS(self)[i] */ __pyx_t_4 = __pyx_v_ndim; for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { __pyx_v_i = __pyx_t_5; /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":232 * info.shape = info.strides + ndim * for i in range(ndim): * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<< * info.shape[i] = PyArray_DIMS(self)[i] * else: */ (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]); /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":233 * for i in range(ndim): * info.strides[i] = PyArray_STRIDES(self)[i] * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< * else: * info.strides = PyArray_STRIDES(self) */ (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]); } /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":226 * info.buf = PyArray_DATA(self) * info.ndim = ndim * if copy_shape: # <<<<<<<<<<<<<< * # Allocate new buffer for strides and shape info. * # This is allocated as one block, strides first. */ goto __pyx_L11; } /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":235 * info.shape[i] = PyArray_DIMS(self)[i] * else: * info.strides = PyArray_STRIDES(self) # <<<<<<<<<<<<<< * info.shape = PyArray_DIMS(self) * info.suboffsets = NULL */ /*else*/ { __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self)); /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":236 * else: * info.strides = PyArray_STRIDES(self) * info.shape = PyArray_DIMS(self) # <<<<<<<<<<<<<< * info.suboffsets = NULL * info.itemsize = PyArray_ITEMSIZE(self) */ __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self)); } __pyx_L11:; /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":237 * info.strides = PyArray_STRIDES(self) * info.shape = PyArray_DIMS(self) * info.suboffsets = NULL # <<<<<<<<<<<<<< * info.itemsize = PyArray_ITEMSIZE(self) * info.readonly = not PyArray_ISWRITEABLE(self) */ __pyx_v_info->suboffsets = NULL; /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":238 * info.shape = PyArray_DIMS(self) * info.suboffsets = NULL * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< * info.readonly = not PyArray_ISWRITEABLE(self) * */ __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self); /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":239 * info.suboffsets = NULL * info.itemsize = PyArray_ITEMSIZE(self) * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< * * cdef int t */ __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0)); /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":242 * * cdef int t * cdef char* f = NULL # <<<<<<<<<<<<<< * cdef dtype descr = self.descr * cdef int offset */ __pyx_v_f = NULL; /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":243 * cdef int t * cdef char* f = NULL * cdef dtype descr = self.descr # <<<<<<<<<<<<<< * cdef int offset * */ __pyx_t_3 = ((PyObject *)__pyx_v_self->descr); __Pyx_INCREF(__pyx_t_3); __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3); __pyx_t_3 = 0; /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":246 * cdef int offset * * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< * * if not hasfields and not copy_shape: */ __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":248 * cdef bint hasfields = PyDataType_HASFIELDS(descr) * * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< * # do not call releasebuffer * info.obj = None */ __pyx_t_2 = ((!(__pyx_v_hasfields != 0)) != 0); if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L15_bool_binop_done; } __pyx_t_2 = ((!(__pyx_v_copy_shape != 0)) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L15_bool_binop_done:; if (__pyx_t_1) { /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":250 * if not hasfields and not copy_shape: * # do not call releasebuffer * info.obj = None # <<<<<<<<<<<<<< * else: * # need to call releasebuffer */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_info->obj); __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = Py_None; /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":248 * cdef bint hasfields = PyDataType_HASFIELDS(descr) * * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< * # do not call releasebuffer * info.obj = None */ goto __pyx_L14; } /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":253 * else: * # need to call releasebuffer * info.obj = self # <<<<<<<<<<<<<< * * if not hasfields: */ /*else*/ { __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); __Pyx_GOTREF(__pyx_v_info->obj); __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = ((PyObject *)__pyx_v_self); } __pyx_L14:; /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":255 * info.obj = self * * if not hasfields: # <<<<<<<<<<<<<< * t = descr.type_num * if ((descr.byteorder == c'>' and little_endian) or */ __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0); if (__pyx_t_1) { /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":256 * * if not hasfields: * t = descr.type_num # <<<<<<<<<<<<<< * if ((descr.byteorder == c'>' and little_endian) or * (descr.byteorder == c'<' and not little_endian)): */ __pyx_t_4 = __pyx_v_descr->type_num; __pyx_v_t = __pyx_t_4; /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":257 * if not hasfields: * t = descr.type_num * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< * (descr.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") */ __pyx_t_2 = ((__pyx_v_descr->byteorder == '>') != 0); if (!__pyx_t_2) { goto __pyx_L20_next_or; } else { } __pyx_t_2 = (__pyx_v_little_endian != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L19_bool_binop_done; } __pyx_L20_next_or:; /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":258 * t = descr.type_num * if ((descr.byteorder == c'>' and little_endian) or * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< * raise ValueError(u"Non-native byte order not supported") * if t == NPY_BYTE: f = "b" */ __pyx_t_2 = ((__pyx_v_descr->byteorder == '<') != 0); if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L19_bool_binop_done; } __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L19_bool_binop_done:; /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":257 * if not hasfields: * t = descr.type_num * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< * (descr.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") */ if (__pyx_t_1) { /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":259 * if ((descr.byteorder == c'>' and little_endian) or * (descr.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" */ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[2]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":257 * if not hasfields: * t = descr.type_num * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< * (descr.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") */ } /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":260 * (descr.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< * elif t == NPY_UBYTE: f = "B" * elif t == NPY_SHORT: f = "h" */ switch (__pyx_v_t) { case NPY_BYTE: __pyx_v_f = __pyx_k_b; break; /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":261 * raise ValueError(u"Non-native byte order not supported") * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< * elif t == NPY_SHORT: f = "h" * elif t == NPY_USHORT: f = "H" */ case NPY_UBYTE: __pyx_v_f = __pyx_k_B; break; /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":262 * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< * elif t == NPY_USHORT: f = "H" * elif t == NPY_INT: f = "i" */ case NPY_SHORT: __pyx_v_f = __pyx_k_h; break; /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":263 * elif t == NPY_UBYTE: f = "B" * elif t == NPY_SHORT: f = "h" * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< * elif t == NPY_INT: f = "i" * elif t == NPY_UINT: f = "I" */ case NPY_USHORT: __pyx_v_f = __pyx_k_H; break; /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":264 * elif t == NPY_SHORT: f = "h" * elif t == NPY_USHORT: f = "H" * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< * elif t == NPY_UINT: f = "I" * elif t == NPY_LONG: f = "l" */ case NPY_INT: __pyx_v_f = __pyx_k_i; break; /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":265 * elif t == NPY_USHORT: f = "H" * elif t == NPY_INT: f = "i" * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< * elif t == NPY_LONG: f = "l" * elif t == NPY_ULONG: f = "L" */ case NPY_UINT: __pyx_v_f = __pyx_k_I; break; /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":266 * elif t == NPY_INT: f = "i" * elif t == NPY_UINT: f = "I" * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< * elif t == NPY_ULONG: f = "L" * elif t == NPY_LONGLONG: f = "q" */ case NPY_LONG: __pyx_v_f = __pyx_k_l; break; /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":267 * elif t == NPY_UINT: f = "I" * elif t == NPY_LONG: f = "l" * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< * elif t == NPY_LONGLONG: f = "q" * elif t == NPY_ULONGLONG: f = "Q" */ case NPY_ULONG: __pyx_v_f = __pyx_k_L; break; /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":268 * elif t == NPY_LONG: f = "l" * elif t == NPY_ULONG: f = "L" * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< * elif t == NPY_ULONGLONG: f = "Q" * elif t == NPY_FLOAT: f = "f" */ case NPY_LONGLONG: __pyx_v_f = __pyx_k_q; break; /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":269 * elif t == NPY_ULONG: f = "L" * elif t == NPY_LONGLONG: f = "q" * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< * elif t == NPY_FLOAT: f = "f" * elif t == NPY_DOUBLE: f = "d" */ case NPY_ULONGLONG: __pyx_v_f = __pyx_k_Q; break; /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":270 * elif t == NPY_LONGLONG: f = "q" * elif t == NPY_ULONGLONG: f = "Q" * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< * elif t == NPY_DOUBLE: f = "d" * elif t == NPY_LONGDOUBLE: f = "g" */ case NPY_FLOAT: __pyx_v_f = __pyx_k_f; break; /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":271 * elif t == NPY_ULONGLONG: f = "Q" * elif t == NPY_FLOAT: f = "f" * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< * elif t == NPY_LONGDOUBLE: f = "g" * elif t == NPY_CFLOAT: f = "Zf" */ case NPY_DOUBLE: __pyx_v_f = __pyx_k_d; break; /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":272 * elif t == NPY_FLOAT: f = "f" * elif t == NPY_DOUBLE: f = "d" * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< * elif t == NPY_CFLOAT: f = "Zf" * elif t == NPY_CDOUBLE: f = "Zd" */ case NPY_LONGDOUBLE: __pyx_v_f = __pyx_k_g; break; /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":273 * elif t == NPY_DOUBLE: f = "d" * elif t == NPY_LONGDOUBLE: f = "g" * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< * elif t == NPY_CDOUBLE: f = "Zd" * elif t == NPY_CLONGDOUBLE: f = "Zg" */ case NPY_CFLOAT: __pyx_v_f = __pyx_k_Zf; break; /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":274 * elif t == NPY_LONGDOUBLE: f = "g" * elif t == NPY_CFLOAT: f = "Zf" * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< * elif t == NPY_CLONGDOUBLE: f = "Zg" * elif t == NPY_OBJECT: f = "O" */ case NPY_CDOUBLE: __pyx_v_f = __pyx_k_Zd; break; /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":275 * elif t == NPY_CFLOAT: f = "Zf" * elif t == NPY_CDOUBLE: f = "Zd" * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< * elif t == NPY_OBJECT: f = "O" * else: */ case NPY_CLONGDOUBLE: __pyx_v_f = __pyx_k_Zg; break; /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":276 * elif t == NPY_CDOUBLE: f = "Zd" * elif t == NPY_CLONGDOUBLE: f = "Zg" * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) */ case NPY_OBJECT: __pyx_v_f = __pyx_k_O; break; default: /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":278 * elif t == NPY_OBJECT: f = "O" * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< * info.format = f * return */ __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; {__pyx_filename = __pyx_f[2]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} break; } /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":279 * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * info.format = f # <<<<<<<<<<<<<< * return * else: */ __pyx_v_info->format = __pyx_v_f; /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":280 * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * info.format = f * return # <<<<<<<<<<<<<< * else: * info.format = stdlib.malloc(_buffer_format_string_len) */ __pyx_r = 0; goto __pyx_L0; /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":255 * info.obj = self * * if not hasfields: # <<<<<<<<<<<<<< * t = descr.type_num * if ((descr.byteorder == c'>' and little_endian) or */ } /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":282 * return * else: * info.format = stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< * info.format[0] = c'^' # Native data types, manual alignment * offset = 0 */ /*else*/ { __pyx_v_info->format = ((char *)malloc(0xFF)); /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":283 * else: * info.format = stdlib.malloc(_buffer_format_string_len) * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<< * offset = 0 * f = _util_dtypestring(descr, info.format + 1, */ (__pyx_v_info->format[0]) = '^'; /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":284 * info.format = stdlib.malloc(_buffer_format_string_len) * info.format[0] = c'^' # Native data types, manual alignment * offset = 0 # <<<<<<<<<<<<<< * f = _util_dtypestring(descr, info.format + 1, * info.format + _buffer_format_string_len, */ __pyx_v_offset = 0; /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":285 * info.format[0] = c'^' # Native data types, manual alignment * offset = 0 * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<< * info.format + _buffer_format_string_len, * &offset) */ __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_f = __pyx_t_7; /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":288 * info.format + _buffer_format_string_len, * &offset) * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<< * * def __releasebuffer__(ndarray self, Py_buffer* info): */ (__pyx_v_f[0]) = '\x00'; } /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":197 * # experimental exception made for __getbuffer__ and __releasebuffer__ * # -- the details of this may change. * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< * # This implementation of getbuffer is geared towards Cython * # requirements, and does not yet fullfill the PEP. */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) { __Pyx_GOTREF(__pyx_v_info->obj); __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL; } goto __pyx_L2; __pyx_L0:; if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) { __Pyx_GOTREF(Py_None); __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; } __pyx_L2:; __Pyx_XDECREF((PyObject *)__pyx_v_descr); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":290 * f[0] = c'\0' # Terminate format string * * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< * if PyArray_HASFIELDS(self): * stdlib.free(info.format) */ /* Python wrapper */ static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/ static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0); __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info)); /* function exit code */ __Pyx_RefNannyFinishContext(); } static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) { __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("__releasebuffer__", 0); /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":291 * * def __releasebuffer__(ndarray self, Py_buffer* info): * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< * stdlib.free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): */ __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0); if (__pyx_t_1) { /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":292 * def __releasebuffer__(ndarray self, Py_buffer* info): * if PyArray_HASFIELDS(self): * stdlib.free(info.format) # <<<<<<<<<<<<<< * if sizeof(npy_intp) != sizeof(Py_ssize_t): * stdlib.free(info.strides) */ free(__pyx_v_info->format); /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":291 * * def __releasebuffer__(ndarray self, Py_buffer* info): * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< * stdlib.free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): */ } /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":293 * if PyArray_HASFIELDS(self): * stdlib.free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< * stdlib.free(info.strides) * # info.shape was stored after info.strides in the same block */ __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); if (__pyx_t_1) { /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":294 * stdlib.free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): * stdlib.free(info.strides) # <<<<<<<<<<<<<< * # info.shape was stored after info.strides in the same block * */ free(__pyx_v_info->strides); /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":293 * if PyArray_HASFIELDS(self): * stdlib.free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< * stdlib.free(info.strides) * # info.shape was stored after info.strides in the same block */ } /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":290 * f[0] = c'\0' # Terminate format string * * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< * if PyArray_HASFIELDS(self): * stdlib.free(info.format) */ /* function exit code */ __Pyx_RefNannyFinishContext(); } /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":770 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< * return PyArray_MultiIterNew(1, a) * */ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0); /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":771 * * cdef inline object PyArray_MultiIterNew1(a): * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< * * cdef inline object PyArray_MultiIterNew2(a, b): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":770 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< * return PyArray_MultiIterNew(1, a) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":773 * return PyArray_MultiIterNew(1, a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< * return PyArray_MultiIterNew(2, a, b) * */ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0); /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":774 * * cdef inline object PyArray_MultiIterNew2(a, b): * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< * * cdef inline object PyArray_MultiIterNew3(a, b, c): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":773 * return PyArray_MultiIterNew(1, a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< * return PyArray_MultiIterNew(2, a, b) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":776 * return PyArray_MultiIterNew(2, a, b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< * return PyArray_MultiIterNew(3, a, b, c) * */ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0); /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":777 * * cdef inline object PyArray_MultiIterNew3(a, b, c): * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":776 * return PyArray_MultiIterNew(2, a, b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< * return PyArray_MultiIterNew(3, a, b, c) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":779 * return PyArray_MultiIterNew(3, a, b, c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< * return PyArray_MultiIterNew(4, a, b, c, d) * */ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0); /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":780 * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":779 * return PyArray_MultiIterNew(3, a, b, c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< * return PyArray_MultiIterNew(4, a, b, c, d) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":782 * return PyArray_MultiIterNew(4, a, b, c, d) * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< * return PyArray_MultiIterNew(5, a, b, c, d, e) * */ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0); /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":783 * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< * * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":782 * return PyArray_MultiIterNew(4, a, b, c, d) * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< * return PyArray_MultiIterNew(5, a, b, c, d, e) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":785 * return PyArray_MultiIterNew(5, a, b, c, d, e) * * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< * # Recursive utility function used in __getbuffer__ to get format * # string. The new location in the format string is returned. */ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr, char *__pyx_v_f, char *__pyx_v_end, int *__pyx_v_offset) { PyArray_Descr *__pyx_v_child = 0; int __pyx_v_endian_detector; int __pyx_v_little_endian; PyObject *__pyx_v_fields = 0; PyObject *__pyx_v_childname = NULL; PyObject *__pyx_v_new_offset = NULL; PyObject *__pyx_v_t = NULL; char *__pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_t_6; int __pyx_t_7; long __pyx_t_8; char *__pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_util_dtypestring", 0); /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":790 * * cdef dtype child * cdef int endian_detector = 1 # <<<<<<<<<<<<<< * cdef bint little_endian = ((&endian_detector)[0] != 0) * cdef tuple fields */ __pyx_v_endian_detector = 1; /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":791 * cdef dtype child * cdef int endian_detector = 1 * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< * cdef tuple fields * */ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":794 * cdef tuple fields * * for childname in descr.names: # <<<<<<<<<<<<<< * fields = descr.fields[childname] * child, new_offset = fields */ if (unlikely(__pyx_v_descr->names == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; for (;;) { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3); __pyx_t_3 = 0; /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":795 * * for childname in descr.names: * fields = descr.fields[childname] # <<<<<<<<<<<<<< * child, new_offset = fields * */ if (unlikely(__pyx_v_descr->fields == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_3); if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3)); __pyx_t_3 = 0; /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":796 * for childname in descr.names: * fields = descr.fields[childname] * child, new_offset = fields # <<<<<<<<<<<<<< * * if (end - f) - (new_offset - offset[0]) < 15: */ if (likely(__pyx_v_fields != Py_None)) { PyObject* sequence = __pyx_v_fields; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); #else __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); #endif } else { __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3)); __pyx_t_3 = 0; __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4); __pyx_t_4 = 0; /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":798 * child, new_offset = fields * * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * */ __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0); if (__pyx_t_6) { /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":799 * * if (end - f) - (new_offset - offset[0]) < 15: * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< * * if ((child.byteorder == c'>' and little_endian) or */ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[2]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":798 * child, new_offset = fields * * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * */ } /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":801 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< * (child.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") */ __pyx_t_7 = ((__pyx_v_child->byteorder == '>') != 0); if (!__pyx_t_7) { goto __pyx_L8_next_or; } else { } __pyx_t_7 = (__pyx_v_little_endian != 0); if (!__pyx_t_7) { } else { __pyx_t_6 = __pyx_t_7; goto __pyx_L7_bool_binop_done; } __pyx_L8_next_or:; /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":802 * * if ((child.byteorder == c'>' and little_endian) or * (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< * raise ValueError(u"Non-native byte order not supported") * # One could encode it in the format string and have Cython */ __pyx_t_7 = ((__pyx_v_child->byteorder == '<') != 0); if (__pyx_t_7) { } else { __pyx_t_6 = __pyx_t_7; goto __pyx_L7_bool_binop_done; } __pyx_t_7 = ((!(__pyx_v_little_endian != 0)) != 0); __pyx_t_6 = __pyx_t_7; __pyx_L7_bool_binop_done:; /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":801 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< * (child.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") */ if (__pyx_t_6) { /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":803 * if ((child.byteorder == c'>' and little_endian) or * (child.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< * # One could encode it in the format string and have Cython * # complain instead, BUT: < and > in format strings also imply */ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[2]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":801 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< * (child.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") */ } /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":813 * * # Output padding bytes * while offset[0] < new_offset: # <<<<<<<<<<<<<< * f[0] = 120 # "x"; pad byte * f += 1 */ while (1) { __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (!__pyx_t_6) break; /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":814 * # Output padding bytes * while offset[0] < new_offset: * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< * f += 1 * offset[0] += 1 */ (__pyx_v_f[0]) = 0x78; /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":815 * while offset[0] < new_offset: * f[0] = 120 # "x"; pad byte * f += 1 # <<<<<<<<<<<<<< * offset[0] += 1 * */ __pyx_v_f = (__pyx_v_f + 1); /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":816 * f[0] = 120 # "x"; pad byte * f += 1 * offset[0] += 1 # <<<<<<<<<<<<<< * * offset[0] += child.itemsize */ __pyx_t_8 = 0; (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1); } /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":818 * offset[0] += 1 * * offset[0] += child.itemsize # <<<<<<<<<<<<<< * * if not PyDataType_HASFIELDS(child): */ __pyx_t_8 = 0; (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize); /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":820 * offset[0] += child.itemsize * * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< * t = child.type_num * if end - f < 5: */ __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0); if (__pyx_t_6) { /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":821 * * if not PyDataType_HASFIELDS(child): * t = child.type_num # <<<<<<<<<<<<<< * if end - f < 5: * raise RuntimeError(u"Format string allocated too short.") */ __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4); __pyx_t_4 = 0; /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":822 * if not PyDataType_HASFIELDS(child): * t = child.type_num * if end - f < 5: # <<<<<<<<<<<<<< * raise RuntimeError(u"Format string allocated too short.") * */ __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0); if (__pyx_t_6) { /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":823 * t = child.type_num * if end - f < 5: * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< * * # Until ticket #99 is fixed, use integers to avoid warnings */ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__37, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; {__pyx_filename = __pyx_f[2]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":822 * if not PyDataType_HASFIELDS(child): * t = child.type_num * if end - f < 5: # <<<<<<<<<<<<<< * raise RuntimeError(u"Format string allocated too short.") * */ } /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":826 * * # Until ticket #99 is fixed, use integers to avoid warnings * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<< * elif t == NPY_UBYTE: f[0] = 66 #"B" * elif t == NPY_SHORT: f[0] = 104 #"h" */ __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 98; goto __pyx_L15; } /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":827 * # Until ticket #99 is fixed, use integers to avoid warnings * if t == NPY_BYTE: f[0] = 98 #"b" * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<< * elif t == NPY_SHORT: f[0] = 104 #"h" * elif t == NPY_USHORT: f[0] = 72 #"H" */ __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 66; goto __pyx_L15; } /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":828 * if t == NPY_BYTE: f[0] = 98 #"b" * elif t == NPY_UBYTE: f[0] = 66 #"B" * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<< * elif t == NPY_USHORT: f[0] = 72 #"H" * elif t == NPY_INT: f[0] = 105 #"i" */ __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x68; goto __pyx_L15; } /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":829 * elif t == NPY_UBYTE: f[0] = 66 #"B" * elif t == NPY_SHORT: f[0] = 104 #"h" * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<< * elif t == NPY_INT: f[0] = 105 #"i" * elif t == NPY_UINT: f[0] = 73 #"I" */ __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 72; goto __pyx_L15; } /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":830 * elif t == NPY_SHORT: f[0] = 104 #"h" * elif t == NPY_USHORT: f[0] = 72 #"H" * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<< * elif t == NPY_UINT: f[0] = 73 #"I" * elif t == NPY_LONG: f[0] = 108 #"l" */ __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x69; goto __pyx_L15; } /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":831 * elif t == NPY_USHORT: f[0] = 72 #"H" * elif t == NPY_INT: f[0] = 105 #"i" * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<< * elif t == NPY_LONG: f[0] = 108 #"l" * elif t == NPY_ULONG: f[0] = 76 #"L" */ __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 73; goto __pyx_L15; } /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":832 * elif t == NPY_INT: f[0] = 105 #"i" * elif t == NPY_UINT: f[0] = 73 #"I" * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<< * elif t == NPY_ULONG: f[0] = 76 #"L" * elif t == NPY_LONGLONG: f[0] = 113 #"q" */ __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x6C; goto __pyx_L15; } /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":833 * elif t == NPY_UINT: f[0] = 73 #"I" * elif t == NPY_LONG: f[0] = 108 #"l" * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<< * elif t == NPY_LONGLONG: f[0] = 113 #"q" * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" */ __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 76; goto __pyx_L15; } /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":834 * elif t == NPY_LONG: f[0] = 108 #"l" * elif t == NPY_ULONG: f[0] = 76 #"L" * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<< * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" * elif t == NPY_FLOAT: f[0] = 102 #"f" */ __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x71; goto __pyx_L15; } /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":835 * elif t == NPY_ULONG: f[0] = 76 #"L" * elif t == NPY_LONGLONG: f[0] = 113 #"q" * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<< * elif t == NPY_FLOAT: f[0] = 102 #"f" * elif t == NPY_DOUBLE: f[0] = 100 #"d" */ __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 81; goto __pyx_L15; } /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":836 * elif t == NPY_LONGLONG: f[0] = 113 #"q" * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<< * elif t == NPY_DOUBLE: f[0] = 100 #"d" * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" */ __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x66; goto __pyx_L15; } /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":837 * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" * elif t == NPY_FLOAT: f[0] = 102 #"f" * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<< * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf */ __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x64; goto __pyx_L15; } /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":838 * elif t == NPY_FLOAT: f[0] = 102 #"f" * elif t == NPY_DOUBLE: f[0] = 100 #"d" * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<< * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd */ __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 0x67; goto __pyx_L15; } /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":839 * elif t == NPY_DOUBLE: f[0] = 100 #"d" * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<< * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg */ __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; (__pyx_v_f[1]) = 0x66; __pyx_v_f = (__pyx_v_f + 1); goto __pyx_L15; } /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":840 * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<< * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg * elif t == NPY_OBJECT: f[0] = 79 #"O" */ __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; (__pyx_v_f[1]) = 0x64; __pyx_v_f = (__pyx_v_f + 1); goto __pyx_L15; } /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":841 * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<< * elif t == NPY_OBJECT: f[0] = 79 #"O" * else: */ __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; (__pyx_v_f[1]) = 0x67; __pyx_v_f = (__pyx_v_f + 1); goto __pyx_L15; } /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":842 * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<< * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) */ __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 79; goto __pyx_L15; } /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":844 * elif t == NPY_OBJECT: f[0] = 79 #"O" * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< * f += 1 * else: */ /*else*/ { __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[2]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_L15:; /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":845 * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * f += 1 # <<<<<<<<<<<<<< * else: * # Cython ignores struct boundary information ("T{...}"), */ __pyx_v_f = (__pyx_v_f + 1); /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":820 * offset[0] += child.itemsize * * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< * t = child.type_num * if end - f < 5: */ goto __pyx_L13; } /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":849 * # Cython ignores struct boundary information ("T{...}"), * # so don't output it * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<< * return f * */ /*else*/ { __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_f = __pyx_t_9; } __pyx_L13:; /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":794 * cdef tuple fields * * for childname in descr.names: # <<<<<<<<<<<<<< * fields = descr.fields[childname] * child, new_offset = fields */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":850 * # so don't output it * f = _util_dtypestring(child, f, end, offset) * return f # <<<<<<<<<<<<<< * * */ __pyx_r = __pyx_v_f; goto __pyx_L0; /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":785 * return PyArray_MultiIterNew(5, a, b, c, d, e) * * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< * # Recursive utility function used in __getbuffer__ to get format * # string. The new location in the format string is returned. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_child); __Pyx_XDECREF(__pyx_v_fields); __Pyx_XDECREF(__pyx_v_childname); __Pyx_XDECREF(__pyx_v_new_offset); __Pyx_XDECREF(__pyx_v_t); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":966 * * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< * cdef PyObject* baseptr * if base is None: */ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) { PyObject *__pyx_v_baseptr; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; __Pyx_RefNannySetupContext("set_array_base", 0); /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":968 * cdef inline void set_array_base(ndarray arr, object base): * cdef PyObject* baseptr * if base is None: # <<<<<<<<<<<<<< * baseptr = NULL * else: */ __pyx_t_1 = (__pyx_v_base == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":969 * cdef PyObject* baseptr * if base is None: * baseptr = NULL # <<<<<<<<<<<<<< * else: * Py_INCREF(base) # important to do this before decref below! */ __pyx_v_baseptr = NULL; /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":968 * cdef inline void set_array_base(ndarray arr, object base): * cdef PyObject* baseptr * if base is None: # <<<<<<<<<<<<<< * baseptr = NULL * else: */ goto __pyx_L3; } /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":971 * baseptr = NULL * else: * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<< * baseptr = base * Py_XDECREF(arr.base) */ /*else*/ { Py_INCREF(__pyx_v_base); /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":972 * else: * Py_INCREF(base) # important to do this before decref below! * baseptr = base # <<<<<<<<<<<<<< * Py_XDECREF(arr.base) * arr.base = baseptr */ __pyx_v_baseptr = ((PyObject *)__pyx_v_base); } __pyx_L3:; /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":973 * Py_INCREF(base) # important to do this before decref below! * baseptr = base * Py_XDECREF(arr.base) # <<<<<<<<<<<<<< * arr.base = baseptr * */ Py_XDECREF(__pyx_v_arr->base); /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":974 * baseptr = base * Py_XDECREF(arr.base) * arr.base = baseptr # <<<<<<<<<<<<<< * * cdef inline object get_array_base(ndarray arr): */ __pyx_v_arr->base = __pyx_v_baseptr; /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":966 * * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< * cdef PyObject* baseptr * if base is None: */ /* function exit code */ __Pyx_RefNannyFinishContext(); } /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":976 * arr.base = baseptr * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< * if arr.base is NULL: * return None */ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("get_array_base", 0); /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":977 * * cdef inline object get_array_base(ndarray arr): * if arr.base is NULL: # <<<<<<<<<<<<<< * return None * else: */ __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0); if (__pyx_t_1) { /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":978 * cdef inline object get_array_base(ndarray arr): * if arr.base is NULL: * return None # <<<<<<<<<<<<<< * else: * return arr.base */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_None); __pyx_r = Py_None; goto __pyx_L0; /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":977 * * cdef inline object get_array_base(ndarray arr): * if arr.base is NULL: # <<<<<<<<<<<<<< * return None * else: */ } /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":980 * return None * else: * return arr.base # <<<<<<<<<<<<<< */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_arr->base)); __pyx_r = ((PyObject *)__pyx_v_arr->base); goto __pyx_L0; } /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":976 * arr.base = baseptr * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< * if arr.base is NULL: * return None */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static struct __pyx_vtabstruct_6pyfftw_6pyfftw_FFTW __pyx_vtable_6pyfftw_6pyfftw_FFTW; static PyObject *__pyx_tp_new_6pyfftw_6pyfftw_FFTW(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_6pyfftw_6pyfftw_FFTW *p; PyObject *o; if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; p = ((struct __pyx_obj_6pyfftw_6pyfftw_FFTW *)o); p->__pyx_vtab = __pyx_vtabptr_6pyfftw_6pyfftw_FFTW; p->_input_array = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); p->_output_array = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); p->_input_item_strides = Py_None; Py_INCREF(Py_None); p->_input_strides = Py_None; Py_INCREF(Py_None); p->_output_item_strides = Py_None; Py_INCREF(Py_None); p->_output_strides = Py_None; Py_INCREF(Py_None); p->_input_shape = Py_None; Py_INCREF(Py_None); p->_output_shape = Py_None; Py_INCREF(Py_None); p->_input_dtype = Py_None; Py_INCREF(Py_None); p->_output_dtype = Py_None; Py_INCREF(Py_None); p->_flags_used = Py_None; Py_INCREF(Py_None); if (unlikely(__pyx_pw_6pyfftw_6pyfftw_4FFTW_31__cinit__(o, a, k) < 0)) { Py_DECREF(o); o = 0; } return o; } static void __pyx_tp_dealloc_6pyfftw_6pyfftw_FFTW(PyObject *o) { struct __pyx_obj_6pyfftw_6pyfftw_FFTW *p = (struct __pyx_obj_6pyfftw_6pyfftw_FFTW *)o; #if PY_VERSION_HEX >= 0x030400a1 if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif PyObject_GC_UnTrack(o); { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); ++Py_REFCNT(o); __pyx_pw_6pyfftw_6pyfftw_4FFTW_35__dealloc__(o); --Py_REFCNT(o); PyErr_Restore(etype, eval, etb); } Py_CLEAR(p->_input_array); Py_CLEAR(p->_output_array); Py_CLEAR(p->_input_item_strides); Py_CLEAR(p->_input_strides); Py_CLEAR(p->_output_item_strides); Py_CLEAR(p->_output_strides); Py_CLEAR(p->_input_shape); Py_CLEAR(p->_output_shape); Py_CLEAR(p->_input_dtype); Py_CLEAR(p->_output_dtype); Py_CLEAR(p->_flags_used); (*Py_TYPE(o)->tp_free)(o); } static int __pyx_tp_traverse_6pyfftw_6pyfftw_FFTW(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_6pyfftw_6pyfftw_FFTW *p = (struct __pyx_obj_6pyfftw_6pyfftw_FFTW *)o; if (p->_input_array) { e = (*v)(((PyObject*)p->_input_array), a); if (e) return e; } if (p->_output_array) { e = (*v)(((PyObject*)p->_output_array), a); if (e) return e; } if (p->_input_item_strides) { e = (*v)(p->_input_item_strides, a); if (e) return e; } if (p->_input_strides) { e = (*v)(p->_input_strides, a); if (e) return e; } if (p->_output_item_strides) { e = (*v)(p->_output_item_strides, a); if (e) return e; } if (p->_output_strides) { e = (*v)(p->_output_strides, a); if (e) return e; } if (p->_input_shape) { e = (*v)(p->_input_shape, a); if (e) return e; } if (p->_output_shape) { e = (*v)(p->_output_shape, a); if (e) return e; } if (p->_input_dtype) { e = (*v)(p->_input_dtype, a); if (e) return e; } if (p->_output_dtype) { e = (*v)(p->_output_dtype, a); if (e) return e; } if (p->_flags_used) { e = (*v)(p->_flags_used, a); if (e) return e; } return 0; } static int __pyx_tp_clear_6pyfftw_6pyfftw_FFTW(PyObject *o) { PyObject* tmp; struct __pyx_obj_6pyfftw_6pyfftw_FFTW *p = (struct __pyx_obj_6pyfftw_6pyfftw_FFTW *)o; tmp = ((PyObject*)p->_input_array); p->_input_array = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->_output_array); p->_output_array = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->_input_item_strides); p->_input_item_strides = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->_input_strides); p->_input_strides = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->_output_item_strides); p->_output_item_strides = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->_output_strides); p->_output_strides = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->_input_shape); p->_input_shape = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->_output_shape); p->_output_shape = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->_input_dtype); p->_input_dtype = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->_output_dtype); p->_output_dtype = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->_flags_used); p->_flags_used = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyMethodDef __pyx_methods_6pyfftw_6pyfftw_FFTW[] = { {"_get_N", (PyCFunction)__pyx_pw_6pyfftw_6pyfftw_4FFTW_1_get_N, METH_NOARGS, __pyx_doc_6pyfftw_6pyfftw_4FFTW__get_N}, {"_get_simd_aligned", (PyCFunction)__pyx_pw_6pyfftw_6pyfftw_4FFTW_3_get_simd_aligned, METH_NOARGS, __pyx_doc_6pyfftw_6pyfftw_4FFTW_2_get_simd_aligned}, {"_get_input_alignment", (PyCFunction)__pyx_pw_6pyfftw_6pyfftw_4FFTW_5_get_input_alignment, METH_NOARGS, __pyx_doc_6pyfftw_6pyfftw_4FFTW_4_get_input_alignment}, {"_get_output_alignment", (PyCFunction)__pyx_pw_6pyfftw_6pyfftw_4FFTW_7_get_output_alignment, METH_NOARGS, __pyx_doc_6pyfftw_6pyfftw_4FFTW_6_get_output_alignment}, {"_get_flags_used", (PyCFunction)__pyx_pw_6pyfftw_6pyfftw_4FFTW_9_get_flags_used, METH_NOARGS, __pyx_doc_6pyfftw_6pyfftw_4FFTW_8_get_flags_used}, {"_get_input_array", (PyCFunction)__pyx_pw_6pyfftw_6pyfftw_4FFTW_11_get_input_array, METH_NOARGS, __pyx_doc_6pyfftw_6pyfftw_4FFTW_10_get_input_array}, {"_get_output_array", (PyCFunction)__pyx_pw_6pyfftw_6pyfftw_4FFTW_13_get_output_array, METH_NOARGS, __pyx_doc_6pyfftw_6pyfftw_4FFTW_12_get_output_array}, {"_get_input_strides", (PyCFunction)__pyx_pw_6pyfftw_6pyfftw_4FFTW_15_get_input_strides, METH_NOARGS, __pyx_doc_6pyfftw_6pyfftw_4FFTW_14_get_input_strides}, {"_get_output_strides", (PyCFunction)__pyx_pw_6pyfftw_6pyfftw_4FFTW_17_get_output_strides, METH_NOARGS, __pyx_doc_6pyfftw_6pyfftw_4FFTW_16_get_output_strides}, {"_get_input_shape", (PyCFunction)__pyx_pw_6pyfftw_6pyfftw_4FFTW_19_get_input_shape, METH_NOARGS, __pyx_doc_6pyfftw_6pyfftw_4FFTW_18_get_input_shape}, {"_get_output_shape", (PyCFunction)__pyx_pw_6pyfftw_6pyfftw_4FFTW_21_get_output_shape, METH_NOARGS, __pyx_doc_6pyfftw_6pyfftw_4FFTW_20_get_output_shape}, {"_get_input_dtype", (PyCFunction)__pyx_pw_6pyfftw_6pyfftw_4FFTW_23_get_input_dtype, METH_NOARGS, __pyx_doc_6pyfftw_6pyfftw_4FFTW_22_get_input_dtype}, {"_get_output_dtype", (PyCFunction)__pyx_pw_6pyfftw_6pyfftw_4FFTW_25_get_output_dtype, METH_NOARGS, __pyx_doc_6pyfftw_6pyfftw_4FFTW_24_get_output_dtype}, {"_get_direction", (PyCFunction)__pyx_pw_6pyfftw_6pyfftw_4FFTW_27_get_direction, METH_NOARGS, __pyx_doc_6pyfftw_6pyfftw_4FFTW_26_get_direction}, {"_get_axes", (PyCFunction)__pyx_pw_6pyfftw_6pyfftw_4FFTW_29_get_axes, METH_NOARGS, __pyx_doc_6pyfftw_6pyfftw_4FFTW_28_get_axes}, {"update_arrays", (PyCFunction)__pyx_pw_6pyfftw_6pyfftw_4FFTW_39update_arrays, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pyfftw_6pyfftw_4FFTW_38update_arrays}, {"get_input_array", (PyCFunction)__pyx_pw_6pyfftw_6pyfftw_4FFTW_41get_input_array, METH_NOARGS, __pyx_doc_6pyfftw_6pyfftw_4FFTW_40get_input_array}, {"get_output_array", (PyCFunction)__pyx_pw_6pyfftw_6pyfftw_4FFTW_43get_output_array, METH_NOARGS, __pyx_doc_6pyfftw_6pyfftw_4FFTW_42get_output_array}, {"execute", (PyCFunction)__pyx_pw_6pyfftw_6pyfftw_4FFTW_45execute, METH_NOARGS, __pyx_doc_6pyfftw_6pyfftw_4FFTW_44execute}, {0, 0, 0, 0} }; static PyTypeObject __pyx_type_6pyfftw_6pyfftw_FFTW = { PyVarObject_HEAD_INIT(0, 0) "pyfftw.pyfftw.FFTW", /*tp_name*/ sizeof(struct __pyx_obj_6pyfftw_6pyfftw_FFTW), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_6pyfftw_6pyfftw_FFTW, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ __pyx_pw_6pyfftw_6pyfftw_4FFTW_37__call__, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ "\n FFTW is a class for computing the complex N-Dimensional DFT or\n inverse DFT of an array using the FFTW library. The interface is \n designed to be somewhat pythonic, with the correct transform being \n inferred from the dtypes of the passed arrays.\n\n On instantiation, the dtypes and relative shapes of the input array and\n output arrays are compared to the set of valid (and implemented)\n :ref:`FFTW schemes `. If a match is found, the plan that\n corresponds to that scheme is created, operating on the arrays that are\n passed in. If no scheme can be created, then ``ValueError`` is raised.\n\n The actual FFT or iFFT is performed by calling the \n :meth:`~pyfftw.FFTW.execute` method.\n \n The arrays can be updated by calling the \n :meth:`~pyfftw.FFTW.update_arrays` method.\n\n The created instance of the class is itself callable, and can perform\n the execution of the FFT, both with or without array updates, returning\n the result of the FFT. Unlike calling the :meth:`~pyfftw.FFTW.execute`\n method, calling the class instance will also optionally normalise the\n output as necessary. Additionally, calling with an input array update\n will also coerce that array to be the correct dtype. \n \n See the documentation on the :meth:`~pyfftw.FFTW.__call__` method \n for more information.\n ", /*tp_doc*/ __pyx_tp_traverse_6pyfftw_6pyfftw_FFTW, /*tp_traverse*/ __pyx_tp_clear_6pyfftw_6pyfftw_FFTW, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_6pyfftw_6pyfftw_FFTW, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ __pyx_pw_6pyfftw_6pyfftw_4FFTW_33__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_6pyfftw_6pyfftw_FFTW, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; static PyMethodDef __pyx_methods[] = { {"n_byte_align_empty", (PyCFunction)__pyx_pw_6pyfftw_6pyfftw_1n_byte_align_empty, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pyfftw_6pyfftw_n_byte_align_empty}, {"n_byte_align", (PyCFunction)__pyx_pw_6pyfftw_6pyfftw_3n_byte_align, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pyfftw_6pyfftw_2n_byte_align}, {"byte_align", (PyCFunction)__pyx_pw_6pyfftw_6pyfftw_5byte_align, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pyfftw_6pyfftw_4byte_align}, {"is_byte_aligned", (PyCFunction)__pyx_pw_6pyfftw_6pyfftw_7is_byte_aligned, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pyfftw_6pyfftw_6is_byte_aligned}, {"is_n_byte_aligned", (PyCFunction)__pyx_pw_6pyfftw_6pyfftw_9is_n_byte_aligned, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pyfftw_6pyfftw_8is_n_byte_aligned}, {"empty_aligned", (PyCFunction)__pyx_pw_6pyfftw_6pyfftw_11empty_aligned, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pyfftw_6pyfftw_10empty_aligned}, {"zeros_aligned", (PyCFunction)__pyx_pw_6pyfftw_6pyfftw_13zeros_aligned, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pyfftw_6pyfftw_12zeros_aligned}, {"ones_aligned", (PyCFunction)__pyx_pw_6pyfftw_6pyfftw_15ones_aligned, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6pyfftw_6pyfftw_14ones_aligned}, {0, 0, 0, 0} }; #if PY_MAJOR_VERSION >= 3 static struct PyModuleDef __pyx_moduledef = { #if PY_VERSION_HEX < 0x03020000 { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, #else PyModuleDef_HEAD_INIT, #endif "pyfftw", 0, /* m_doc */ -1, /* m_size */ __pyx_methods /* m_methods */, NULL, /* m_reload */ NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ }; #endif static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_s_32, __pyx_k_32, sizeof(__pyx_k_32), 0, 0, 1, 0}, {&__pyx_kp_s_64, __pyx_k_64, sizeof(__pyx_k_64), 0, 0, 1, 0}, {&__pyx_n_s_C, __pyx_k_C, sizeof(__pyx_k_C), 0, 0, 1, 1}, {&__pyx_n_s_DeprecationWarning, __pyx_k_DeprecationWarning, sizeof(__pyx_k_DeprecationWarning), 0, 0, 1, 1}, {&__pyx_kp_s_Dimensions_of_the_input_array_mu, __pyx_k_Dimensions_of_the_input_array_mu, sizeof(__pyx_k_Dimensions_of_the_input_array_mu), 0, 0, 1, 0}, {&__pyx_kp_s_Dimensions_of_the_output_array_m, __pyx_k_Dimensions_of_the_output_array_m, sizeof(__pyx_k_Dimensions_of_the_output_array_m), 0, 0, 1, 0}, {&__pyx_n_s_FFTW_BACKWARD, __pyx_k_FFTW_BACKWARD, sizeof(__pyx_k_FFTW_BACKWARD), 0, 0, 1, 1}, {&__pyx_n_s_FFTW_DESTROY_INPUT, __pyx_k_FFTW_DESTROY_INPUT, sizeof(__pyx_k_FFTW_DESTROY_INPUT), 0, 0, 1, 1}, {&__pyx_n_s_FFTW_ESTIMATE, __pyx_k_FFTW_ESTIMATE, sizeof(__pyx_k_FFTW_ESTIMATE), 0, 0, 1, 1}, {&__pyx_n_s_FFTW_EXHAUSTIVE, __pyx_k_FFTW_EXHAUSTIVE, sizeof(__pyx_k_FFTW_EXHAUSTIVE), 0, 0, 1, 1}, {&__pyx_n_s_FFTW_FORWARD, __pyx_k_FFTW_FORWARD, sizeof(__pyx_k_FFTW_FORWARD), 0, 0, 1, 1}, {&__pyx_n_s_FFTW_MEASURE, __pyx_k_FFTW_MEASURE, sizeof(__pyx_k_FFTW_MEASURE), 0, 0, 1, 1}, {&__pyx_n_s_FFTW_PATIENT, __pyx_k_FFTW_PATIENT, sizeof(__pyx_k_FFTW_PATIENT), 0, 0, 1, 1}, {&__pyx_n_s_FFTW_UNALIGNED, __pyx_k_FFTW_UNALIGNED, sizeof(__pyx_k_FFTW_UNALIGNED), 0, 0, 1, 1}, {&__pyx_n_s_FFTW_WISDOM_ONLY, __pyx_k_FFTW_WISDOM_ONLY, sizeof(__pyx_k_FFTW_WISDOM_ONLY), 0, 0, 1, 1}, {&__pyx_kp_u_Format_string_allocated_too_shor, __pyx_k_Format_string_allocated_too_shor, sizeof(__pyx_k_Format_string_allocated_too_shor), 0, 1, 0, 0}, {&__pyx_kp_u_Format_string_allocated_too_shor_2, __pyx_k_Format_string_allocated_too_shor_2, sizeof(__pyx_k_Format_string_allocated_too_shor_2), 0, 1, 0, 0}, {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1}, {&__pyx_kp_s_Invalid_array_byte_align_require, __pyx_k_Invalid_array_byte_align_require, sizeof(__pyx_k_Invalid_array_byte_align_require), 0, 0, 1, 0}, {&__pyx_kp_s_Invalid_array_is_n_byte_aligned, __pyx_k_Invalid_array_is_n_byte_aligned, sizeof(__pyx_k_Invalid_array_is_n_byte_aligned), 0, 0, 1, 0}, {&__pyx_kp_s_Invalid_axes_The_axes_list_canno, __pyx_k_Invalid_axes_The_axes_list_canno, sizeof(__pyx_k_Invalid_axes_The_axes_list_canno), 0, 0, 1, 0}, {&__pyx_kp_s_Invalid_direction_The_direction, __pyx_k_Invalid_direction_The_direction, sizeof(__pyx_k_Invalid_direction_The_direction), 0, 0, 1, 0}, {&__pyx_kp_s_Invalid_flag, __pyx_k_Invalid_flag, sizeof(__pyx_k_Invalid_flag), 0, 0, 1, 0}, {&__pyx_kp_s_Invalid_input_alignment_The_inpu, __pyx_k_Invalid_input_alignment_The_inpu, sizeof(__pyx_k_Invalid_input_alignment_The_inpu), 0, 0, 1, 0}, {&__pyx_kp_s_Invalid_input_alignment_The_orig, __pyx_k_Invalid_input_alignment_The_orig, sizeof(__pyx_k_Invalid_input_alignment_The_orig), 0, 0, 1, 0}, {&__pyx_kp_s_Invalid_input_array_The_input_ar, __pyx_k_Invalid_input_array_The_input_ar, sizeof(__pyx_k_Invalid_input_array_The_input_ar), 0, 0, 1, 0}, {&__pyx_kp_s_Invalid_input_array_The_new_inpu, __pyx_k_Invalid_input_array_The_new_inpu, sizeof(__pyx_k_Invalid_input_array_The_new_inpu), 0, 0, 1, 0}, {&__pyx_kp_s_Invalid_input_dtype_The_new_inpu, __pyx_k_Invalid_input_dtype_The_new_inpu, sizeof(__pyx_k_Invalid_input_dtype_The_new_inpu), 0, 0, 1, 0}, {&__pyx_kp_s_Invalid_input_shape_The_new_inpu, __pyx_k_Invalid_input_shape_The_new_inpu, sizeof(__pyx_k_Invalid_input_shape_The_new_inpu), 0, 0, 1, 0}, {&__pyx_kp_s_Invalid_input_striding_The_strid, __pyx_k_Invalid_input_striding_The_strid, sizeof(__pyx_k_Invalid_input_striding_The_strid), 0, 0, 1, 0}, {&__pyx_kp_s_Invalid_output_alignment_The_ori, __pyx_k_Invalid_output_alignment_The_ori, sizeof(__pyx_k_Invalid_output_alignment_The_ori), 0, 0, 1, 0}, {&__pyx_kp_s_Invalid_output_alignment_The_out, __pyx_k_Invalid_output_alignment_The_out, sizeof(__pyx_k_Invalid_output_alignment_The_out), 0, 0, 1, 0}, {&__pyx_kp_s_Invalid_output_array_The_new_out, __pyx_k_Invalid_output_array_The_new_out, sizeof(__pyx_k_Invalid_output_array_The_new_out), 0, 0, 1, 0}, {&__pyx_kp_s_Invalid_output_array_The_output, __pyx_k_Invalid_output_array_The_output, sizeof(__pyx_k_Invalid_output_array_The_output), 0, 0, 1, 0}, {&__pyx_kp_s_Invalid_output_dtype_The_new_out, __pyx_k_Invalid_output_dtype_The_new_out, sizeof(__pyx_k_Invalid_output_dtype_The_new_out), 0, 0, 1, 0}, {&__pyx_kp_s_Invalid_output_shape_The_new_out, __pyx_k_Invalid_output_shape_The_new_out, sizeof(__pyx_k_Invalid_output_shape_The_new_out), 0, 0, 1, 0}, {&__pyx_kp_s_Invalid_output_striding_The_stri, __pyx_k_Invalid_output_striding_The_stri, sizeof(__pyx_k_Invalid_output_striding_The_stri), 0, 0, 1, 0}, {&__pyx_kp_s_Invalid_planning_timelimit_The_p, __pyx_k_Invalid_planning_timelimit_The_p, sizeof(__pyx_k_Invalid_planning_timelimit_The_p), 0, 0, 1, 0}, {&__pyx_kp_s_Invalid_scheme_The_output_array, __pyx_k_Invalid_scheme_The_output_array, sizeof(__pyx_k_Invalid_scheme_The_output_array), 0, 0, 1, 0}, {&__pyx_kp_s_Invalid_shapes_The_input_array_a, __pyx_k_Invalid_shapes_The_input_array_a, sizeof(__pyx_k_Invalid_shapes_The_input_array_a), 0, 0, 1, 0}, {&__pyx_kp_s_Invalid_shapes_The_output_array, __pyx_k_Invalid_shapes_The_output_array, sizeof(__pyx_k_Invalid_shapes_The_output_array), 0, 0, 1, 0}, {&__pyx_n_s_KeyError, __pyx_k_KeyError, sizeof(__pyx_k_KeyError), 0, 0, 1, 1}, {&__pyx_n_s_Lock, __pyx_k_Lock, sizeof(__pyx_k_Lock), 0, 0, 1, 1}, {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1}, {&__pyx_n_s_N, __pyx_k_N, sizeof(__pyx_k_N), 0, 0, 1, 1}, {&__pyx_kp_s_No_FFTW_wisdom_is_known_for_this, __pyx_k_No_FFTW_wisdom_is_known_for_this, sizeof(__pyx_k_No_FFTW_wisdom_is_known_for_this), 0, 0, 1, 0}, {&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor, sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0}, {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1}, {&__pyx_kp_s_Strides_of_the_input_array_must, __pyx_k_Strides_of_the_input_array_must, sizeof(__pyx_k_Strides_of_the_input_array_must), 0, 0, 1, 0}, {&__pyx_kp_s_Strides_of_the_output_array_must, __pyx_k_Strides_of_the_output_array_must, sizeof(__pyx_k_Strides_of_the_output_array_must), 0, 0, 1, 0}, {&__pyx_kp_s_The_data_has_an_uncaught_error_t, __pyx_k_The_data_has_an_uncaught_error_t, sizeof(__pyx_k_The_data_has_an_uncaught_error_t), 0, 0, 1, 0}, {&__pyx_kp_s_This_function_is_deprecated_in_f, __pyx_k_This_function_is_deprecated_in_f, sizeof(__pyx_k_This_function_is_deprecated_in_f), 0, 0, 1, 0}, {&__pyx_kp_s_This_function_is_deprecated_in_f_2, __pyx_k_This_function_is_deprecated_in_f_2, sizeof(__pyx_k_This_function_is_deprecated_in_f_2), 0, 0, 1, 0}, {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, {&__pyx_kp_s_Zero_length_array_The_input_arra, __pyx_k_Zero_length_array_The_input_arra, sizeof(__pyx_k_Zero_length_array_The_input_arra), 0, 0, 1, 0}, {&__pyx_kp_s__17, __pyx_k__17, sizeof(__pyx_k__17), 0, 0, 1, 0}, {&__pyx_n_s_alignment, __pyx_k_alignment, sizeof(__pyx_k_alignment), 0, 0, 1, 1}, {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1}, {&__pyx_n_s_array, __pyx_k_array, sizeof(__pyx_k_array), 0, 0, 1, 1}, {&__pyx_n_s_asanyarray, __pyx_k_asanyarray, sizeof(__pyx_k_asanyarray), 0, 0, 1, 1}, {&__pyx_n_s_axes, __pyx_k_axes, sizeof(__pyx_k_axes), 0, 0, 1, 1}, {&__pyx_n_s_c2c, __pyx_k_c2c, sizeof(__pyx_k_c2c), 0, 0, 1, 1}, {&__pyx_n_s_c2r, __pyx_k_c2r, sizeof(__pyx_k_c2r), 0, 0, 1, 1}, {&__pyx_n_s_c_wisdom, __pyx_k_c_wisdom, sizeof(__pyx_k_c_wisdom), 0, 0, 1, 1}, {&__pyx_n_s_c_wisdom_ptr, __pyx_k_c_wisdom_ptr, sizeof(__pyx_k_c_wisdom_ptr), 0, 0, 1, 1}, {&__pyx_n_s_c_wisdomf, __pyx_k_c_wisdomf, sizeof(__pyx_k_c_wisdomf), 0, 0, 1, 1}, {&__pyx_n_s_c_wisdomf_ptr, __pyx_k_c_wisdomf_ptr, sizeof(__pyx_k_c_wisdomf_ptr), 0, 0, 1, 1}, {&__pyx_n_s_c_wisdoml, __pyx_k_c_wisdoml, sizeof(__pyx_k_c_wisdoml), 0, 0, 1, 1}, {&__pyx_n_s_c_wisdoml_ptr, __pyx_k_c_wisdoml_ptr, sizeof(__pyx_k_c_wisdoml_ptr), 0, 0, 1, 1}, {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1}, {&__pyx_n_s_clongdouble, __pyx_k_clongdouble, sizeof(__pyx_k_clongdouble), 0, 0, 1, 1}, {&__pyx_n_s_complex128, __pyx_k_complex128, sizeof(__pyx_k_complex128), 0, 0, 1, 1}, {&__pyx_n_s_complex64, __pyx_k_complex64, sizeof(__pyx_k_complex64), 0, 0, 1, 1}, {&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1}, {&__pyx_n_s_counter, __pyx_k_counter, sizeof(__pyx_k_counter), 0, 0, 1, 1}, {&__pyx_n_s_counterf, __pyx_k_counterf, sizeof(__pyx_k_counterf), 0, 0, 1, 1}, {&__pyx_n_s_counterl, __pyx_k_counterl, sizeof(__pyx_k_counterl), 0, 0, 1, 1}, {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1}, {&__pyx_n_s_direction, __pyx_k_direction, sizeof(__pyx_k_direction), 0, 0, 1, 1}, {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1}, {&__pyx_n_s_empty, __pyx_k_empty, sizeof(__pyx_k_empty), 0, 0, 1, 1}, {&__pyx_n_s_empty_aligned, __pyx_k_empty_aligned, sizeof(__pyx_k_empty_aligned), 0, 0, 1, 1}, {&__pyx_n_s_enter, __pyx_k_enter, sizeof(__pyx_k_enter), 0, 0, 1, 1}, {&__pyx_n_s_execute, __pyx_k_execute, sizeof(__pyx_k_execute), 0, 0, 1, 1}, {&__pyx_n_s_executor, __pyx_k_executor, sizeof(__pyx_k_executor), 0, 0, 1, 1}, {&__pyx_n_s_exit, __pyx_k_exit, sizeof(__pyx_k_exit), 0, 0, 1, 1}, {&__pyx_n_s_export_wisdom, __pyx_k_export_wisdom, sizeof(__pyx_k_export_wisdom), 0, 0, 1, 1}, {&__pyx_n_s_fft_shape_lookup, __pyx_k_fft_shape_lookup, sizeof(__pyx_k_fft_shape_lookup), 0, 0, 1, 1}, {&__pyx_n_s_fill, __pyx_k_fill, sizeof(__pyx_k_fill), 0, 0, 1, 1}, {&__pyx_n_s_flag_dict, __pyx_k_flag_dict, sizeof(__pyx_k_flag_dict), 0, 0, 1, 1}, {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1}, {&__pyx_n_s_float32, __pyx_k_float32, sizeof(__pyx_k_float32), 0, 0, 1, 1}, {&__pyx_n_s_float64, __pyx_k_float64, sizeof(__pyx_k_float64), 0, 0, 1, 1}, {&__pyx_n_s_forget_wisdom, __pyx_k_forget_wisdom, sizeof(__pyx_k_forget_wisdom), 0, 0, 1, 1}, {&__pyx_n_s_frombuffer, __pyx_k_frombuffer, sizeof(__pyx_k_frombuffer), 0, 0, 1, 1}, {&__pyx_n_s_generic_precision, __pyx_k_generic_precision, sizeof(__pyx_k_generic_precision), 0, 0, 1, 1}, {&__pyx_n_s_get_N, __pyx_k_get_N, sizeof(__pyx_k_get_N), 0, 0, 1, 1}, {&__pyx_n_s_get_axes, __pyx_k_get_axes, sizeof(__pyx_k_get_axes), 0, 0, 1, 1}, {&__pyx_n_s_get_direction, __pyx_k_get_direction, sizeof(__pyx_k_get_direction), 0, 0, 1, 1}, {&__pyx_n_s_get_flags_used, __pyx_k_get_flags_used, sizeof(__pyx_k_get_flags_used), 0, 0, 1, 1}, {&__pyx_n_s_get_input_alignment, __pyx_k_get_input_alignment, sizeof(__pyx_k_get_input_alignment), 0, 0, 1, 1}, {&__pyx_n_s_get_input_array, __pyx_k_get_input_array, sizeof(__pyx_k_get_input_array), 0, 0, 1, 1}, {&__pyx_kp_s_get_input_array_is_deprecated_Co, __pyx_k_get_input_array_is_deprecated_Co, sizeof(__pyx_k_get_input_array_is_deprecated_Co), 0, 0, 1, 0}, {&__pyx_n_s_get_input_dtype, __pyx_k_get_input_dtype, sizeof(__pyx_k_get_input_dtype), 0, 0, 1, 1}, {&__pyx_n_s_get_input_shape, __pyx_k_get_input_shape, sizeof(__pyx_k_get_input_shape), 0, 0, 1, 1}, {&__pyx_n_s_get_input_strides, __pyx_k_get_input_strides, sizeof(__pyx_k_get_input_strides), 0, 0, 1, 1}, {&__pyx_n_s_get_output_alignment, __pyx_k_get_output_alignment, sizeof(__pyx_k_get_output_alignment), 0, 0, 1, 1}, {&__pyx_n_s_get_output_array, __pyx_k_get_output_array, sizeof(__pyx_k_get_output_array), 0, 0, 1, 1}, {&__pyx_kp_s_get_output_array_is_deprecated_C, __pyx_k_get_output_array_is_deprecated_C, sizeof(__pyx_k_get_output_array_is_deprecated_C), 0, 0, 1, 0}, {&__pyx_n_s_get_output_dtype, __pyx_k_get_output_dtype, sizeof(__pyx_k_get_output_dtype), 0, 0, 1, 1}, {&__pyx_n_s_get_output_shape, __pyx_k_get_output_shape, sizeof(__pyx_k_get_output_shape), 0, 0, 1, 1}, {&__pyx_n_s_get_output_strides, __pyx_k_get_output_strides, sizeof(__pyx_k_get_output_strides), 0, 0, 1, 1}, {&__pyx_n_s_get_simd_aligned, __pyx_k_get_simd_aligned, sizeof(__pyx_k_get_simd_aligned), 0, 0, 1, 1}, {&__pyx_kp_s_home_whg_Projects_github_pyFFTW, __pyx_k_home_whg_Projects_github_pyFFTW, sizeof(__pyx_k_home_whg_Projects_github_pyFFTW), 0, 0, 1, 0}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_import_wisdom, __pyx_k_import_wisdom, sizeof(__pyx_k_import_wisdom), 0, 0, 1, 1}, {&__pyx_n_s_input_alignment, __pyx_k_input_alignment, sizeof(__pyx_k_input_alignment), 0, 0, 1, 1}, {&__pyx_n_s_input_array, __pyx_k_input_array, sizeof(__pyx_k_input_array), 0, 0, 1, 1}, {&__pyx_n_s_input_dtype, __pyx_k_input_dtype, sizeof(__pyx_k_input_dtype), 0, 0, 1, 1}, {&__pyx_n_s_input_shape, __pyx_k_input_shape, sizeof(__pyx_k_input_shape), 0, 0, 1, 1}, {&__pyx_n_s_input_strides, __pyx_k_input_strides, sizeof(__pyx_k_input_strides), 0, 0, 1, 1}, {&__pyx_n_s_int8, __pyx_k_int8, sizeof(__pyx_k_int8), 0, 0, 1, 1}, {&__pyx_n_s_integer, __pyx_k_integer, sizeof(__pyx_k_integer), 0, 0, 1, 1}, {&__pyx_kp_s_is_not_a_valid_planner_flag, __pyx_k_is_not_a_valid_planner_flag, sizeof(__pyx_k_is_not_a_valid_planner_flag), 0, 0, 1, 0}, {&__pyx_n_s_itemsize, __pyx_k_itemsize, sizeof(__pyx_k_itemsize), 0, 0, 1, 1}, {&__pyx_n_s_ld, __pyx_k_ld, sizeof(__pyx_k_ld), 0, 0, 1, 1}, {&__pyx_kp_s_less_than, __pyx_k_less_than, sizeof(__pyx_k_less_than), 0, 0, 1, 0}, {&__pyx_n_s_longdouble, __pyx_k_longdouble, sizeof(__pyx_k_longdouble), 0, 0, 1, 1}, {&__pyx_n_s_lookup_shape_c2r_arrays, __pyx_k_lookup_shape_c2r_arrays, sizeof(__pyx_k_lookup_shape_c2r_arrays), 0, 0, 1, 1}, {&__pyx_n_s_lookup_shape_r2c_arrays, __pyx_k_lookup_shape_r2c_arrays, sizeof(__pyx_k_lookup_shape_r2c_arrays), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1}, {&__pyx_kp_u_ndarray_is_not_C_contiguous, __pyx_k_ndarray_is_not_C_contiguous, sizeof(__pyx_k_ndarray_is_not_C_contiguous), 0, 1, 0, 0}, {&__pyx_kp_u_ndarray_is_not_Fortran_contiguou, __pyx_k_ndarray_is_not_Fortran_contiguou, sizeof(__pyx_k_ndarray_is_not_Fortran_contiguou), 0, 1, 0, 0}, {&__pyx_n_s_new_input_array, __pyx_k_new_input_array, sizeof(__pyx_k_new_input_array), 0, 0, 1, 1}, {&__pyx_n_s_new_output_array, __pyx_k_new_output_array, sizeof(__pyx_k_new_output_array), 0, 0, 1, 1}, {&__pyx_n_s_normalise_idft, __pyx_k_normalise_idft, sizeof(__pyx_k_normalise_idft), 0, 0, 1, 1}, {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1}, {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1}, {&__pyx_n_s_order, __pyx_k_order, sizeof(__pyx_k_order), 0, 0, 1, 1}, {&__pyx_n_s_output_alignment, __pyx_k_output_alignment, sizeof(__pyx_k_output_alignment), 0, 0, 1, 1}, {&__pyx_n_s_output_array, __pyx_k_output_array, sizeof(__pyx_k_output_array), 0, 0, 1, 1}, {&__pyx_n_s_output_dtype, __pyx_k_output_dtype, sizeof(__pyx_k_output_dtype), 0, 0, 1, 1}, {&__pyx_n_s_output_shape, __pyx_k_output_shape, sizeof(__pyx_k_output_shape), 0, 0, 1, 1}, {&__pyx_n_s_output_strides, __pyx_k_output_strides, sizeof(__pyx_k_output_strides), 0, 0, 1, 1}, {&__pyx_n_s_planner, __pyx_k_planner, sizeof(__pyx_k_planner), 0, 0, 1, 1}, {&__pyx_n_s_planning_timelimit, __pyx_k_planning_timelimit, sizeof(__pyx_k_planning_timelimit), 0, 0, 1, 1}, {&__pyx_n_s_property, __pyx_k_property, sizeof(__pyx_k_property), 0, 0, 1, 1}, {&__pyx_n_s_py_wisdom, __pyx_k_py_wisdom, sizeof(__pyx_k_py_wisdom), 0, 0, 1, 1}, {&__pyx_n_s_py_wisdomf, __pyx_k_py_wisdomf, sizeof(__pyx_k_py_wisdomf), 0, 0, 1, 1}, {&__pyx_n_s_py_wisdoml, __pyx_k_py_wisdoml, sizeof(__pyx_k_py_wisdoml), 0, 0, 1, 1}, {&__pyx_n_s_pyfftw_pyfftw, __pyx_k_pyfftw_pyfftw, sizeof(__pyx_k_pyfftw_pyfftw), 0, 0, 1, 1}, {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, {&__pyx_n_s_r2c, __pyx_k_r2c, sizeof(__pyx_k_r2c), 0, 0, 1, 1}, {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, {&__pyx_n_s_real, __pyx_k_real, sizeof(__pyx_k_real), 0, 0, 1, 1}, {&__pyx_n_s_reshape, __pyx_k_reshape, sizeof(__pyx_k_reshape), 0, 0, 1, 1}, {&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1}, {&__pyx_n_s_simd_aligned, __pyx_k_simd_aligned, sizeof(__pyx_k_simd_aligned), 0, 0, 1, 1}, {&__pyx_n_s_simd_alignment, __pyx_k_simd_alignment, sizeof(__pyx_k_simd_alignment), 0, 0, 1, 1}, {&__pyx_n_s_strides, __pyx_k_strides, sizeof(__pyx_k_strides), 0, 0, 1, 1}, {&__pyx_n_s_success, __pyx_k_success, sizeof(__pyx_k_success), 0, 0, 1, 1}, {&__pyx_n_s_successf, __pyx_k_successf, sizeof(__pyx_k_successf), 0, 0, 1, 1}, {&__pyx_n_s_successl, __pyx_k_successl, sizeof(__pyx_k_successl), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_n_s_threading, __pyx_k_threading, sizeof(__pyx_k_threading), 0, 0, 1, 1}, {&__pyx_n_s_threads, __pyx_k_threads, sizeof(__pyx_k_threads), 0, 0, 1, 1}, {&__pyx_kp_s_to_the_planner_returning_NULL_Th, __pyx_k_to_the_planner_returning_NULL_Th, sizeof(__pyx_k_to_the_planner_returning_NULL_Th), 0, 0, 1, 0}, {&__pyx_n_s_type, __pyx_k_type, sizeof(__pyx_k_type), 0, 0, 1, 1}, {&__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_k_unknown_dtype_code_in_numpy_pxd, sizeof(__pyx_k_unknown_dtype_code_in_numpy_pxd), 0, 1, 0, 0}, {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1}, {&__pyx_n_s_update_arrays, __pyx_k_update_arrays, sizeof(__pyx_k_update_arrays), 0, 0, 1, 1}, {&__pyx_n_s_valid_simd_alignments, __pyx_k_valid_simd_alignments, sizeof(__pyx_k_valid_simd_alignments), 0, 0, 1, 1}, {&__pyx_n_s_validator, __pyx_k_validator, sizeof(__pyx_k_validator), 0, 0, 1, 1}, {&__pyx_n_s_view, __pyx_k_view, sizeof(__pyx_k_view), 0, 0, 1, 1}, {&__pyx_n_s_warn, __pyx_k_warn, sizeof(__pyx_k_warn), 0, 0, 1, 1}, {&__pyx_n_s_warnings, __pyx_k_warnings, sizeof(__pyx_k_warnings), 0, 0, 1, 1}, {&__pyx_n_s_wisdom, __pyx_k_wisdom, sizeof(__pyx_k_wisdom), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; static int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_property = __Pyx_GetBuiltinName(__pyx_n_s_property); if (!__pyx_builtin_property) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 675; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_builtin_DeprecationWarning = __Pyx_GetBuiltinName(__pyx_n_s_DeprecationWarning); if (!__pyx_builtin_DeprecationWarning) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 850; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 951; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1026; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} return 0; __pyx_L1_error:; return -1; } static int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "pyfftw/utils.pxi":111 * * if not isinstance(array, np.ndarray): * raise TypeError('Invalid array: byte_align requires a subclass ' # <<<<<<<<<<<<<< * 'of ndarray') * */ __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_Invalid_array_byte_align_require); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); /* "pyfftw/utils.pxi":132 * _array_aligned = empty_aligned(array.shape, dtype, n=n) * * _array_aligned[:] = array # <<<<<<<<<<<<<< * * array = _array_aligned.view(type=array.__class__) */ __pyx_slice__2 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_slice__2); __Pyx_GIVEREF(__pyx_slice__2); /* "pyfftw/utils.pxi":148 * ''' * if not isinstance(array, np.ndarray): * raise TypeError('Invalid array: is_n_byte_aligned requires a subclass ' # <<<<<<<<<<<<<< * 'of ndarray') * */ __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_Invalid_array_is_n_byte_aligned); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); /* "pyfftw/utils.pxi":227 * ''' * array = empty_aligned(shape, dtype=dtype, order=order, n=n) * array.fill(0) # <<<<<<<<<<<<<< * return array * */ __pyx_tuple__4 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); /* "pyfftw/utils.pxi":244 * ''' * array = empty_aligned(shape, dtype=dtype, order=order, n=n) * array.fill(1) # <<<<<<<<<<<<<< * return array */ __pyx_tuple__5 = PyTuple_Pack(1, __pyx_int_1); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__5); __Pyx_GIVEREF(__pyx_tuple__5); /* "pyfftw/pyfftw.pyx":811 * axes = property(_get_axes) * * def __cinit__(self, input_array, output_array, axes=(-1,), # <<<<<<<<<<<<<< * direction='FFTW_FORWARD', flags=('FFTW_MEASURE',), * unsigned int threads=1, planning_timelimit=None, */ __pyx_tuple__6 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__6); __Pyx_GIVEREF(__pyx_tuple__6); /* "pyfftw/pyfftw.pyx":812 * * def __cinit__(self, input_array, output_array, axes=(-1,), * direction='FFTW_FORWARD', flags=('FFTW_MEASURE',), # <<<<<<<<<<<<<< * unsigned int threads=1, planning_timelimit=None, * *args, **kwargs): */ __pyx_tuple__7 = PyTuple_Pack(1, __pyx_n_s_FFTW_MEASURE); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7); /* "pyfftw/pyfftw.pyx":833 * _planning_timelimit = planning_timelimit * except TypeError: * raise TypeError('Invalid planning timelimit: ' # <<<<<<<<<<<<<< * 'The planning timelimit needs to be a float.') * */ __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_Invalid_planning_timelimit_The_p); if (unlikely(!__pyx_tuple__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__8); __Pyx_GIVEREF(__pyx_tuple__8); /* "pyfftw/pyfftw.pyx":837 * * if not isinstance(input_array, np.ndarray): * raise ValueError('Invalid input array: ' # <<<<<<<<<<<<<< * 'The input array needs to be an instance ' * 'of numpy.ndarray') */ __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_Invalid_input_array_The_input_ar); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__9); __Pyx_GIVEREF(__pyx_tuple__9); /* "pyfftw/pyfftw.pyx":842 * * if not isinstance(output_array, np.ndarray): * raise ValueError('Invalid output array: ' # <<<<<<<<<<<<<< * 'The output array needs to be an instance ' * 'of numpy.ndarray') */ __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_Invalid_output_array_The_output); if (unlikely(!__pyx_tuple__10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__10); __Pyx_GIVEREF(__pyx_tuple__10); /* "pyfftw/pyfftw.pyx":851 * scheme = fftw_schemes[(input_dtype, output_dtype)] * except KeyError: * raise ValueError('Invalid scheme: ' # <<<<<<<<<<<<<< * 'The output array and input array dtypes ' * 'do not correspond to a valid fftw scheme.') */ __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_Invalid_scheme_The_output_array); if (unlikely(!__pyx_tuple__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 851; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__11); __Pyx_GIVEREF(__pyx_tuple__11); /* "pyfftw/pyfftw.pyx":927 * * if not direction in scheme_directions[scheme]: * raise ValueError('Invalid direction: ' # <<<<<<<<<<<<<< * 'The direction is not valid for the scheme. ' * 'Try setting it explicitly if it is not already.') */ __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_Invalid_direction_The_direction); if (unlikely(!__pyx_tuple__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__12); __Pyx_GIVEREF(__pyx_tuple__12); /* "pyfftw/pyfftw.pyx":951 * * if self._axes[n] >= array_dimension or self._axes[n] < 0: * raise IndexError('Invalid axes: ' # <<<<<<<<<<<<<< * 'The axes list cannot contain invalid axes.') * */ __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_Invalid_axes_The_axes_list_canno); if (unlikely(!__pyx_tuple__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 951; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__13); __Pyx_GIVEREF(__pyx_tuple__13); /* "pyfftw/pyfftw.pyx":969 * for n in range(unique_axes_length): * if self._input_shape[self._axes[n]] == 0: * raise ValueError('Zero length array: ' # <<<<<<<<<<<<<< * 'The input array should have no zero length' * 'axes over which the FFT is to be taken') */ __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_Zero_length_array_The_input_arra); if (unlikely(!__pyx_tuple__14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__14); __Pyx_GIVEREF(__pyx_tuple__14); /* "pyfftw/pyfftw.pyx":986 * if functions['validator'] == -1: * if not (output_array.shape == input_array.shape): * raise ValueError('Invalid shapes: ' # <<<<<<<<<<<<<< * 'The output array should be the same shape as the ' * 'input array for the given array dtypes.') */ __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_Invalid_shapes_The_output_array); if (unlikely(!__pyx_tuple__15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 986; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__15); __Pyx_GIVEREF(__pyx_tuple__15); /* "pyfftw/pyfftw.pyx":993 * if not _validator(input_array, output_array, * self._axes, self._not_axes, unique_axes_length): * raise ValueError('Invalid shapes: ' # <<<<<<<<<<<<<< * 'The input array and output array are invalid ' * 'complementary shapes for their dtypes.') */ __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_Invalid_shapes_The_input_array_a); if (unlikely(!__pyx_tuple__16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 993; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__16); __Pyx_GIVEREF(__pyx_tuple__16); /* "pyfftw/pyfftw.pyx":1101 * cdef unsigned c_flags = self._flags * * with plan_lock, nogil: # <<<<<<<<<<<<<< * plan = fftw_planner(rank, dims, howmany_rank, howmany_dims, * _in, _out, sign, c_flags) */ __pyx_tuple__18 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__18); __Pyx_GIVEREF(__pyx_tuple__18); /* "pyfftw/pyfftw.pyx":1108 * if self._plan == NULL: * if 'FFTW_WISDOM_ONLY' in flags: * raise RuntimeError('No FFTW wisdom is known for this plan.') # <<<<<<<<<<<<<< * else: * raise RuntimeError('The data has an uncaught error that led '+ */ __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_No_FFTW_wisdom_is_known_for_this); if (unlikely(!__pyx_tuple__19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__19); __Pyx_GIVEREF(__pyx_tuple__19); /* "pyfftw/pyfftw.pyx":1113 * 'to the planner returning NULL. This is a bug.') * * def __init__(self, input_array, output_array, axes=(-1,), # <<<<<<<<<<<<<< * direction='FFTW_FORWARD', flags=('FFTW_MEASURE',), * int threads=1, planning_timelimit=None): */ __pyx_tuple__20 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__20); __Pyx_GIVEREF(__pyx_tuple__20); /* "pyfftw/pyfftw.pyx":1114 * * def __init__(self, input_array, output_array, axes=(-1,), * direction='FFTW_FORWARD', flags=('FFTW_MEASURE',), # <<<<<<<<<<<<<< * int threads=1, planning_timelimit=None): * ''' */ __pyx_tuple__21 = PyTuple_Pack(1, __pyx_n_s_FFTW_MEASURE); if (unlikely(!__pyx_tuple__21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__21); __Pyx_GIVEREF(__pyx_tuple__21); /* "pyfftw/pyfftw.pyx":1423 * * if not input_array.shape == self._input_shape: * raise ValueError('Invalid input shape: ' # <<<<<<<<<<<<<< * 'The new input array should be the same shape ' * 'as the input array used to instantiate the ' */ __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_Invalid_input_shape_The_new_inpu); if (unlikely(!__pyx_tuple__22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1423; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__22); __Pyx_GIVEREF(__pyx_tuple__22); /* "pyfftw/pyfftw.pyx":1428 * 'object.') * * self._input_array[:] = input_array # <<<<<<<<<<<<<< * * if output_array is not None: */ __pyx_slice__23 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1428; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_slice__23); __Pyx_GIVEREF(__pyx_slice__23); /* "pyfftw/pyfftw.pyx":1470 * ''' * if not isinstance(new_input_array, np.ndarray): * raise ValueError('Invalid input array: ' # <<<<<<<<<<<<<< * 'The new input array needs to be an instance ' * 'of numpy.ndarray') */ __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_Invalid_input_array_The_new_inpu); if (unlikely(!__pyx_tuple__24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__24); __Pyx_GIVEREF(__pyx_tuple__24); /* "pyfftw/pyfftw.pyx":1475 * * if not isinstance(new_output_array, np.ndarray): * raise ValueError('Invalid output array ' # <<<<<<<<<<<<<< * 'The new output array needs to be an instance ' * 'of numpy.ndarray') */ __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_Invalid_output_array_The_new_out); if (unlikely(!__pyx_tuple__25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1475; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__25); __Pyx_GIVEREF(__pyx_tuple__25); /* "pyfftw/pyfftw.pyx":1494 * * if not new_input_array.dtype == self._input_dtype: * raise ValueError('Invalid input dtype: ' # <<<<<<<<<<<<<< * 'The new input array is not of the same ' * 'dtype as was originally planned for.') */ __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_Invalid_input_dtype_The_new_inpu); if (unlikely(!__pyx_tuple__26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__26); __Pyx_GIVEREF(__pyx_tuple__26); /* "pyfftw/pyfftw.pyx":1499 * * if not new_output_array.dtype == self._output_dtype: * raise ValueError('Invalid output dtype: ' # <<<<<<<<<<<<<< * 'The new output array is not of the same ' * 'dtype as was originally planned for.') */ __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_Invalid_output_dtype_The_new_out); if (unlikely(!__pyx_tuple__27)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__27); __Pyx_GIVEREF(__pyx_tuple__27); /* "pyfftw/pyfftw.pyx":1510 * * if not new_input_shape == self._input_shape: * raise ValueError('Invalid input shape: ' # <<<<<<<<<<<<<< * 'The new input array should be the same shape as ' * 'the input array used to instantiate the object.') */ __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_Invalid_input_shape_The_new_inpu); if (unlikely(!__pyx_tuple__28)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1510; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__28); __Pyx_GIVEREF(__pyx_tuple__28); /* "pyfftw/pyfftw.pyx":1515 * * if not new_output_shape == self._output_shape: * raise ValueError('Invalid output shape: ' # <<<<<<<<<<<<<< * 'The new output array should be the same shape as ' * 'the output array used to instantiate the object.') */ __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_Invalid_output_shape_The_new_out); if (unlikely(!__pyx_tuple__29)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1515; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__29); __Pyx_GIVEREF(__pyx_tuple__29); /* "pyfftw/pyfftw.pyx":1520 * * if not new_input_strides == self._input_strides: * raise ValueError('Invalid input striding: ' # <<<<<<<<<<<<<< * 'The strides should be identical for the new ' * 'input array as for the old.') */ __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_Invalid_input_striding_The_strid); if (unlikely(!__pyx_tuple__30)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1520; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__30); __Pyx_GIVEREF(__pyx_tuple__30); /* "pyfftw/pyfftw.pyx":1525 * * if not new_output_strides == self._output_strides: * raise ValueError('Invalid output striding: ' # <<<<<<<<<<<<<< * 'The strides should be identical for the new ' * 'output array as for the old.') */ __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_Invalid_output_striding_The_stri); if (unlikely(!__pyx_tuple__31)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1525; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__31); __Pyx_GIVEREF(__pyx_tuple__31); /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":218 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) */ __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__32)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__32); __Pyx_GIVEREF(__pyx_tuple__32); /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":222 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< * * info.buf = PyArray_DATA(self) */ __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__33)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__33); __Pyx_GIVEREF(__pyx_tuple__33); /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":259 * if ((descr.byteorder == c'>' and little_endian) or * (descr.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" */ __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__34)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__34); __Pyx_GIVEREF(__pyx_tuple__34); /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":799 * * if (end - f) - (new_offset - offset[0]) < 15: * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< * * if ((child.byteorder == c'>' and little_endian) or */ __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__35)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__35); __Pyx_GIVEREF(__pyx_tuple__35); /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":803 * if ((child.byteorder == c'>' and little_endian) or * (child.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< * # One could encode it in the format string and have Cython * # complain instead, BUT: < and > in format strings also imply */ __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__36)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__36); __Pyx_GIVEREF(__pyx_tuple__36); /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":823 * t = child.type_num * if end - f < 5: * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< * * # Until ticket #99 is fixed, use integers to avoid warnings */ __pyx_tuple__37 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__37)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__37); __Pyx_GIVEREF(__pyx_tuple__37); /* "pyfftw/utils.pxi":51 * #: A tuple of simd alignments that make sense for this cpu * if _simd_alignment == 16: * _valid_simd_alignments = (16,) # <<<<<<<<<<<<<< * * elif _simd_alignment == 32: */ __pyx_tuple__38 = PyTuple_Pack(1, __pyx_int_16); if (unlikely(!__pyx_tuple__38)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__38); __Pyx_GIVEREF(__pyx_tuple__38); /* "pyfftw/utils.pxi":54 * * elif _simd_alignment == 32: * _valid_simd_alignments = (16, 32) # <<<<<<<<<<<<<< * * else: */ __pyx_tuple__39 = PyTuple_Pack(2, __pyx_int_16, __pyx_int_32); if (unlikely(!__pyx_tuple__39)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__39); __Pyx_GIVEREF(__pyx_tuple__39); /* "pyfftw/pyfftw.pyx":408 * # Shape lookup functions * # ====================== * def _lookup_shape_r2c_arrays(input_array, output_array): # <<<<<<<<<<<<<< * return input_array.shape * */ __pyx_tuple__40 = PyTuple_Pack(2, __pyx_n_s_input_array, __pyx_n_s_output_array); if (unlikely(!__pyx_tuple__40)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__40); __Pyx_GIVEREF(__pyx_tuple__40); __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_whg_Projects_github_pyFFTW, __pyx_n_s_lookup_shape_r2c_arrays, 408, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pyfftw/pyfftw.pyx":411 * return input_array.shape * * def _lookup_shape_c2r_arrays(input_array, output_array): # <<<<<<<<<<<<<< * return output_array.shape * */ __pyx_tuple__42 = PyTuple_Pack(2, __pyx_n_s_input_array, __pyx_n_s_output_array); if (unlikely(!__pyx_tuple__42)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__42); __Pyx_GIVEREF(__pyx_tuple__42); __pyx_codeobj__43 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_whg_Projects_github_pyFFTW, __pyx_n_s_lookup_shape_c2r_arrays, 411, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__43)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pyfftw/pyfftw.pyx":446 * cdef object fftw_schemes * fftw_schemes = { * (np.dtype('complex128'), np.dtype('complex128')): ('c2c', '64'), # <<<<<<<<<<<<<< * (np.dtype('complex64'), np.dtype('complex64')): ('c2c', '32'), * (np.dtype('float64'), np.dtype('complex128')): ('r2c', '64'), */ __pyx_tuple__44 = PyTuple_Pack(1, __pyx_n_s_complex128); if (unlikely(!__pyx_tuple__44)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__44); __Pyx_GIVEREF(__pyx_tuple__44); __pyx_tuple__45 = PyTuple_Pack(1, __pyx_n_s_complex128); if (unlikely(!__pyx_tuple__45)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__45); __Pyx_GIVEREF(__pyx_tuple__45); __pyx_tuple__46 = PyTuple_Pack(2, __pyx_n_s_c2c, __pyx_kp_s_64); if (unlikely(!__pyx_tuple__46)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__46); __Pyx_GIVEREF(__pyx_tuple__46); /* "pyfftw/pyfftw.pyx":447 * fftw_schemes = { * (np.dtype('complex128'), np.dtype('complex128')): ('c2c', '64'), * (np.dtype('complex64'), np.dtype('complex64')): ('c2c', '32'), # <<<<<<<<<<<<<< * (np.dtype('float64'), np.dtype('complex128')): ('r2c', '64'), * (np.dtype('float32'), np.dtype('complex64')): ('r2c', '32'), */ __pyx_tuple__47 = PyTuple_Pack(1, __pyx_n_s_complex64); if (unlikely(!__pyx_tuple__47)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__47); __Pyx_GIVEREF(__pyx_tuple__47); __pyx_tuple__48 = PyTuple_Pack(1, __pyx_n_s_complex64); if (unlikely(!__pyx_tuple__48)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__48); __Pyx_GIVEREF(__pyx_tuple__48); __pyx_tuple__49 = PyTuple_Pack(2, __pyx_n_s_c2c, __pyx_kp_s_32); if (unlikely(!__pyx_tuple__49)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__49); __Pyx_GIVEREF(__pyx_tuple__49); /* "pyfftw/pyfftw.pyx":448 * (np.dtype('complex128'), np.dtype('complex128')): ('c2c', '64'), * (np.dtype('complex64'), np.dtype('complex64')): ('c2c', '32'), * (np.dtype('float64'), np.dtype('complex128')): ('r2c', '64'), # <<<<<<<<<<<<<< * (np.dtype('float32'), np.dtype('complex64')): ('r2c', '32'), * (np.dtype('complex128'), np.dtype('float64')): ('c2r', '64'), */ __pyx_tuple__50 = PyTuple_Pack(1, __pyx_n_s_float64); if (unlikely(!__pyx_tuple__50)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__50); __Pyx_GIVEREF(__pyx_tuple__50); __pyx_tuple__51 = PyTuple_Pack(1, __pyx_n_s_complex128); if (unlikely(!__pyx_tuple__51)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__51); __Pyx_GIVEREF(__pyx_tuple__51); __pyx_tuple__52 = PyTuple_Pack(2, __pyx_n_s_r2c, __pyx_kp_s_64); if (unlikely(!__pyx_tuple__52)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__52); __Pyx_GIVEREF(__pyx_tuple__52); /* "pyfftw/pyfftw.pyx":449 * (np.dtype('complex64'), np.dtype('complex64')): ('c2c', '32'), * (np.dtype('float64'), np.dtype('complex128')): ('r2c', '64'), * (np.dtype('float32'), np.dtype('complex64')): ('r2c', '32'), # <<<<<<<<<<<<<< * (np.dtype('complex128'), np.dtype('float64')): ('c2r', '64'), * (np.dtype('complex64'), np.dtype('float32')): ('c2r', '32')} */ __pyx_tuple__53 = PyTuple_Pack(1, __pyx_n_s_float32); if (unlikely(!__pyx_tuple__53)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__53); __Pyx_GIVEREF(__pyx_tuple__53); __pyx_tuple__54 = PyTuple_Pack(1, __pyx_n_s_complex64); if (unlikely(!__pyx_tuple__54)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__54); __Pyx_GIVEREF(__pyx_tuple__54); __pyx_tuple__55 = PyTuple_Pack(2, __pyx_n_s_r2c, __pyx_kp_s_32); if (unlikely(!__pyx_tuple__55)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__55); __Pyx_GIVEREF(__pyx_tuple__55); /* "pyfftw/pyfftw.pyx":450 * (np.dtype('float64'), np.dtype('complex128')): ('r2c', '64'), * (np.dtype('float32'), np.dtype('complex64')): ('r2c', '32'), * (np.dtype('complex128'), np.dtype('float64')): ('c2r', '64'), # <<<<<<<<<<<<<< * (np.dtype('complex64'), np.dtype('float32')): ('c2r', '32')} * */ __pyx_tuple__56 = PyTuple_Pack(1, __pyx_n_s_complex128); if (unlikely(!__pyx_tuple__56)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__56); __Pyx_GIVEREF(__pyx_tuple__56); __pyx_tuple__57 = PyTuple_Pack(1, __pyx_n_s_float64); if (unlikely(!__pyx_tuple__57)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__57); __Pyx_GIVEREF(__pyx_tuple__57); __pyx_tuple__58 = PyTuple_Pack(2, __pyx_n_s_c2r, __pyx_kp_s_64); if (unlikely(!__pyx_tuple__58)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__58); __Pyx_GIVEREF(__pyx_tuple__58); /* "pyfftw/pyfftw.pyx":451 * (np.dtype('float32'), np.dtype('complex64')): ('r2c', '32'), * (np.dtype('complex128'), np.dtype('float64')): ('c2r', '64'), * (np.dtype('complex64'), np.dtype('float32')): ('c2r', '32')} # <<<<<<<<<<<<<< * * if np.dtype('longdouble') != np.dtype('float64'): */ __pyx_tuple__59 = PyTuple_Pack(1, __pyx_n_s_complex64); if (unlikely(!__pyx_tuple__59)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__59); __Pyx_GIVEREF(__pyx_tuple__59); __pyx_tuple__60 = PyTuple_Pack(1, __pyx_n_s_float32); if (unlikely(!__pyx_tuple__60)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__60); __Pyx_GIVEREF(__pyx_tuple__60); __pyx_tuple__61 = PyTuple_Pack(2, __pyx_n_s_c2r, __pyx_kp_s_32); if (unlikely(!__pyx_tuple__61)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__61); __Pyx_GIVEREF(__pyx_tuple__61); /* "pyfftw/pyfftw.pyx":453 * (np.dtype('complex64'), np.dtype('float32')): ('c2r', '32')} * * if np.dtype('longdouble') != np.dtype('float64'): # <<<<<<<<<<<<<< * fftw_schemes.update({ * (np.dtype('clongdouble'), np.dtype('clongdouble')): ('c2c', 'ld'), */ __pyx_tuple__62 = PyTuple_Pack(1, __pyx_n_s_longdouble); if (unlikely(!__pyx_tuple__62)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__62); __Pyx_GIVEREF(__pyx_tuple__62); __pyx_tuple__63 = PyTuple_Pack(1, __pyx_n_s_float64); if (unlikely(!__pyx_tuple__63)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__63); __Pyx_GIVEREF(__pyx_tuple__63); /* "pyfftw/pyfftw.pyx":455 * if np.dtype('longdouble') != np.dtype('float64'): * fftw_schemes.update({ * (np.dtype('clongdouble'), np.dtype('clongdouble')): ('c2c', 'ld'), # <<<<<<<<<<<<<< * (np.dtype('longdouble'), np.dtype('clongdouble')): ('r2c', 'ld'), * (np.dtype('clongdouble'), np.dtype('longdouble')): ('c2r', 'ld')}) */ __pyx_tuple__64 = PyTuple_Pack(1, __pyx_n_s_clongdouble); if (unlikely(!__pyx_tuple__64)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__64); __Pyx_GIVEREF(__pyx_tuple__64); __pyx_tuple__65 = PyTuple_Pack(1, __pyx_n_s_clongdouble); if (unlikely(!__pyx_tuple__65)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__65); __Pyx_GIVEREF(__pyx_tuple__65); __pyx_tuple__66 = PyTuple_Pack(2, __pyx_n_s_c2c, __pyx_n_s_ld); if (unlikely(!__pyx_tuple__66)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__66); __Pyx_GIVEREF(__pyx_tuple__66); /* "pyfftw/pyfftw.pyx":456 * fftw_schemes.update({ * (np.dtype('clongdouble'), np.dtype('clongdouble')): ('c2c', 'ld'), * (np.dtype('longdouble'), np.dtype('clongdouble')): ('r2c', 'ld'), # <<<<<<<<<<<<<< * (np.dtype('clongdouble'), np.dtype('longdouble')): ('c2r', 'ld')}) * */ __pyx_tuple__67 = PyTuple_Pack(1, __pyx_n_s_longdouble); if (unlikely(!__pyx_tuple__67)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__67); __Pyx_GIVEREF(__pyx_tuple__67); __pyx_tuple__68 = PyTuple_Pack(1, __pyx_n_s_clongdouble); if (unlikely(!__pyx_tuple__68)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__68); __Pyx_GIVEREF(__pyx_tuple__68); __pyx_tuple__69 = PyTuple_Pack(2, __pyx_n_s_r2c, __pyx_n_s_ld); if (unlikely(!__pyx_tuple__69)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__69); __Pyx_GIVEREF(__pyx_tuple__69); /* "pyfftw/pyfftw.pyx":457 * (np.dtype('clongdouble'), np.dtype('clongdouble')): ('c2c', 'ld'), * (np.dtype('longdouble'), np.dtype('clongdouble')): ('r2c', 'ld'), * (np.dtype('clongdouble'), np.dtype('longdouble')): ('c2r', 'ld')}) # <<<<<<<<<<<<<< * * */ __pyx_tuple__70 = PyTuple_Pack(1, __pyx_n_s_clongdouble); if (unlikely(!__pyx_tuple__70)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__70); __Pyx_GIVEREF(__pyx_tuple__70); __pyx_tuple__71 = PyTuple_Pack(1, __pyx_n_s_longdouble); if (unlikely(!__pyx_tuple__71)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__71); __Pyx_GIVEREF(__pyx_tuple__71); __pyx_tuple__72 = PyTuple_Pack(2, __pyx_n_s_c2r, __pyx_n_s_ld); if (unlikely(!__pyx_tuple__72)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__72); __Pyx_GIVEREF(__pyx_tuple__72); /* "pyfftw/pyfftw.pyx":462 * cdef object scheme_directions * scheme_directions = { * ('c2c', '64'): ['FFTW_FORWARD', 'FFTW_BACKWARD'], # <<<<<<<<<<<<<< * ('c2c', '32'): ['FFTW_FORWARD', 'FFTW_BACKWARD'], * ('c2c', 'ld'): ['FFTW_FORWARD', 'FFTW_BACKWARD'], */ __pyx_tuple__73 = PyTuple_Pack(2, __pyx_n_s_c2c, __pyx_kp_s_64); if (unlikely(!__pyx_tuple__73)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__73); __Pyx_GIVEREF(__pyx_tuple__73); /* "pyfftw/pyfftw.pyx":463 * scheme_directions = { * ('c2c', '64'): ['FFTW_FORWARD', 'FFTW_BACKWARD'], * ('c2c', '32'): ['FFTW_FORWARD', 'FFTW_BACKWARD'], # <<<<<<<<<<<<<< * ('c2c', 'ld'): ['FFTW_FORWARD', 'FFTW_BACKWARD'], * ('r2c', '64'): ['FFTW_FORWARD'], */ __pyx_tuple__74 = PyTuple_Pack(2, __pyx_n_s_c2c, __pyx_kp_s_32); if (unlikely(!__pyx_tuple__74)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__74); __Pyx_GIVEREF(__pyx_tuple__74); /* "pyfftw/pyfftw.pyx":464 * ('c2c', '64'): ['FFTW_FORWARD', 'FFTW_BACKWARD'], * ('c2c', '32'): ['FFTW_FORWARD', 'FFTW_BACKWARD'], * ('c2c', 'ld'): ['FFTW_FORWARD', 'FFTW_BACKWARD'], # <<<<<<<<<<<<<< * ('r2c', '64'): ['FFTW_FORWARD'], * ('r2c', '32'): ['FFTW_FORWARD'], */ __pyx_tuple__75 = PyTuple_Pack(2, __pyx_n_s_c2c, __pyx_n_s_ld); if (unlikely(!__pyx_tuple__75)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__75); __Pyx_GIVEREF(__pyx_tuple__75); /* "pyfftw/pyfftw.pyx":465 * ('c2c', '32'): ['FFTW_FORWARD', 'FFTW_BACKWARD'], * ('c2c', 'ld'): ['FFTW_FORWARD', 'FFTW_BACKWARD'], * ('r2c', '64'): ['FFTW_FORWARD'], # <<<<<<<<<<<<<< * ('r2c', '32'): ['FFTW_FORWARD'], * ('r2c', 'ld'): ['FFTW_FORWARD'], */ __pyx_tuple__76 = PyTuple_Pack(2, __pyx_n_s_r2c, __pyx_kp_s_64); if (unlikely(!__pyx_tuple__76)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__76); __Pyx_GIVEREF(__pyx_tuple__76); /* "pyfftw/pyfftw.pyx":466 * ('c2c', 'ld'): ['FFTW_FORWARD', 'FFTW_BACKWARD'], * ('r2c', '64'): ['FFTW_FORWARD'], * ('r2c', '32'): ['FFTW_FORWARD'], # <<<<<<<<<<<<<< * ('r2c', 'ld'): ['FFTW_FORWARD'], * ('c2r', '64'): ['FFTW_BACKWARD'], */ __pyx_tuple__77 = PyTuple_Pack(2, __pyx_n_s_r2c, __pyx_kp_s_32); if (unlikely(!__pyx_tuple__77)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__77); __Pyx_GIVEREF(__pyx_tuple__77); /* "pyfftw/pyfftw.pyx":467 * ('r2c', '64'): ['FFTW_FORWARD'], * ('r2c', '32'): ['FFTW_FORWARD'], * ('r2c', 'ld'): ['FFTW_FORWARD'], # <<<<<<<<<<<<<< * ('c2r', '64'): ['FFTW_BACKWARD'], * ('c2r', '32'): ['FFTW_BACKWARD'], */ __pyx_tuple__78 = PyTuple_Pack(2, __pyx_n_s_r2c, __pyx_n_s_ld); if (unlikely(!__pyx_tuple__78)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__78); __Pyx_GIVEREF(__pyx_tuple__78); /* "pyfftw/pyfftw.pyx":468 * ('r2c', '32'): ['FFTW_FORWARD'], * ('r2c', 'ld'): ['FFTW_FORWARD'], * ('c2r', '64'): ['FFTW_BACKWARD'], # <<<<<<<<<<<<<< * ('c2r', '32'): ['FFTW_BACKWARD'], * ('c2r', 'ld'): ['FFTW_BACKWARD']} */ __pyx_tuple__79 = PyTuple_Pack(2, __pyx_n_s_c2r, __pyx_kp_s_64); if (unlikely(!__pyx_tuple__79)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__79); __Pyx_GIVEREF(__pyx_tuple__79); /* "pyfftw/pyfftw.pyx":469 * ('r2c', 'ld'): ['FFTW_FORWARD'], * ('c2r', '64'): ['FFTW_BACKWARD'], * ('c2r', '32'): ['FFTW_BACKWARD'], # <<<<<<<<<<<<<< * ('c2r', 'ld'): ['FFTW_BACKWARD']} * */ __pyx_tuple__80 = PyTuple_Pack(2, __pyx_n_s_c2r, __pyx_kp_s_32); if (unlikely(!__pyx_tuple__80)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__80); __Pyx_GIVEREF(__pyx_tuple__80); /* "pyfftw/pyfftw.pyx":470 * ('c2r', '64'): ['FFTW_BACKWARD'], * ('c2r', '32'): ['FFTW_BACKWARD'], * ('c2r', 'ld'): ['FFTW_BACKWARD']} # <<<<<<<<<<<<<< * * # In the following, -1 denotes using the default. A segfault has been */ __pyx_tuple__81 = PyTuple_Pack(2, __pyx_n_s_c2r, __pyx_n_s_ld); if (unlikely(!__pyx_tuple__81)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__81); __Pyx_GIVEREF(__pyx_tuple__81); /* "pyfftw/pyfftw.pyx":478 * cdef object scheme_functions * scheme_functions = { * ('c2c', '64'): {'planner': 0, 'executor':0, 'generic_precision':0, # <<<<<<<<<<<<<< * 'validator': -1, 'fft_shape_lookup': -1}, * ('c2c', '32'): {'planner':1, 'executor':1, 'generic_precision':1, */ __pyx_tuple__82 = PyTuple_Pack(2, __pyx_n_s_c2c, __pyx_kp_s_64); if (unlikely(!__pyx_tuple__82)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__82); __Pyx_GIVEREF(__pyx_tuple__82); /* "pyfftw/pyfftw.pyx":480 * ('c2c', '64'): {'planner': 0, 'executor':0, 'generic_precision':0, * 'validator': -1, 'fft_shape_lookup': -1}, * ('c2c', '32'): {'planner':1, 'executor':1, 'generic_precision':1, # <<<<<<<<<<<<<< * 'validator': -1, 'fft_shape_lookup': -1}, * ('c2c', 'ld'): {'planner':2, 'executor':2, 'generic_precision':2, */ __pyx_tuple__83 = PyTuple_Pack(2, __pyx_n_s_c2c, __pyx_kp_s_32); if (unlikely(!__pyx_tuple__83)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__83); __Pyx_GIVEREF(__pyx_tuple__83); /* "pyfftw/pyfftw.pyx":482 * ('c2c', '32'): {'planner':1, 'executor':1, 'generic_precision':1, * 'validator': -1, 'fft_shape_lookup': -1}, * ('c2c', 'ld'): {'planner':2, 'executor':2, 'generic_precision':2, # <<<<<<<<<<<<<< * 'validator': -1, 'fft_shape_lookup': -1}, * ('r2c', '64'): {'planner':3, 'executor':3, 'generic_precision':0, */ __pyx_tuple__84 = PyTuple_Pack(2, __pyx_n_s_c2c, __pyx_n_s_ld); if (unlikely(!__pyx_tuple__84)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__84); __Pyx_GIVEREF(__pyx_tuple__84); /* "pyfftw/pyfftw.pyx":484 * ('c2c', 'ld'): {'planner':2, 'executor':2, 'generic_precision':2, * 'validator': -1, 'fft_shape_lookup': -1}, * ('r2c', '64'): {'planner':3, 'executor':3, 'generic_precision':0, # <<<<<<<<<<<<<< * 'validator': 0, * 'fft_shape_lookup': _lookup_shape_r2c_arrays}, */ __pyx_tuple__85 = PyTuple_Pack(2, __pyx_n_s_r2c, __pyx_kp_s_64); if (unlikely(!__pyx_tuple__85)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__85); __Pyx_GIVEREF(__pyx_tuple__85); /* "pyfftw/pyfftw.pyx":487 * 'validator': 0, * 'fft_shape_lookup': _lookup_shape_r2c_arrays}, * ('r2c', '32'): {'planner':4, 'executor':4, 'generic_precision':1, # <<<<<<<<<<<<<< * 'validator': 0, * 'fft_shape_lookup': _lookup_shape_r2c_arrays}, */ __pyx_tuple__86 = PyTuple_Pack(2, __pyx_n_s_r2c, __pyx_kp_s_32); if (unlikely(!__pyx_tuple__86)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__86); __Pyx_GIVEREF(__pyx_tuple__86); /* "pyfftw/pyfftw.pyx":490 * 'validator': 0, * 'fft_shape_lookup': _lookup_shape_r2c_arrays}, * ('r2c', 'ld'): {'planner':5, 'executor':5, 'generic_precision':2, # <<<<<<<<<<<<<< * 'validator': 0, * 'fft_shape_lookup': _lookup_shape_r2c_arrays}, */ __pyx_tuple__87 = PyTuple_Pack(2, __pyx_n_s_r2c, __pyx_n_s_ld); if (unlikely(!__pyx_tuple__87)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__87); __Pyx_GIVEREF(__pyx_tuple__87); /* "pyfftw/pyfftw.pyx":493 * 'validator': 0, * 'fft_shape_lookup': _lookup_shape_r2c_arrays}, * ('c2r', '64'): {'planner':6, 'executor':6, 'generic_precision':0, # <<<<<<<<<<<<<< * 'validator': 1, * 'fft_shape_lookup': _lookup_shape_c2r_arrays}, */ __pyx_tuple__88 = PyTuple_Pack(2, __pyx_n_s_c2r, __pyx_kp_s_64); if (unlikely(!__pyx_tuple__88)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__88); __Pyx_GIVEREF(__pyx_tuple__88); /* "pyfftw/pyfftw.pyx":496 * 'validator': 1, * 'fft_shape_lookup': _lookup_shape_c2r_arrays}, * ('c2r', '32'): {'planner':7, 'executor':7, 'generic_precision':1, # <<<<<<<<<<<<<< * 'validator': 1, * 'fft_shape_lookup': _lookup_shape_c2r_arrays}, */ __pyx_tuple__89 = PyTuple_Pack(2, __pyx_n_s_c2r, __pyx_kp_s_32); if (unlikely(!__pyx_tuple__89)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__89); __Pyx_GIVEREF(__pyx_tuple__89); /* "pyfftw/pyfftw.pyx":499 * 'validator': 1, * 'fft_shape_lookup': _lookup_shape_c2r_arrays}, * ('c2r', 'ld'): {'planner':8, 'executor':8, 'generic_precision':2, # <<<<<<<<<<<<<< * 'validator': 1, * 'fft_shape_lookup': _lookup_shape_c2r_arrays}} */ __pyx_tuple__90 = PyTuple_Pack(2, __pyx_n_s_c2r, __pyx_n_s_ld); if (unlikely(!__pyx_tuple__90)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__90); __Pyx_GIVEREF(__pyx_tuple__90); /* "pyfftw/pyfftw.pyx":1614 * * * def export_wisdom(): # <<<<<<<<<<<<<< * '''export_wisdom() * */ __pyx_tuple__91 = PyTuple_Pack(12, __pyx_n_s_py_wisdom, __pyx_n_s_py_wisdomf, __pyx_n_s_py_wisdoml, __pyx_n_s_counter, __pyx_n_s_counterf, __pyx_n_s_counterl, __pyx_n_s_c_wisdom, __pyx_n_s_c_wisdomf, __pyx_n_s_c_wisdoml, __pyx_n_s_c_wisdom_ptr, __pyx_n_s_c_wisdomf_ptr, __pyx_n_s_c_wisdoml_ptr); if (unlikely(!__pyx_tuple__91)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__91); __Pyx_GIVEREF(__pyx_tuple__91); __pyx_codeobj__92 = (PyObject*)__Pyx_PyCode_New(0, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__91, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_whg_Projects_github_pyFFTW, __pyx_n_s_export_wisdom, 1614, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__92)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pyfftw/pyfftw.pyx":1673 * return (py_wisdom, py_wisdomf, py_wisdoml) * * def import_wisdom(wisdom): # <<<<<<<<<<<<<< * '''import_wisdom(wisdom) * */ __pyx_tuple__93 = PyTuple_Pack(7, __pyx_n_s_wisdom, __pyx_n_s_c_wisdom, __pyx_n_s_c_wisdomf, __pyx_n_s_c_wisdoml, __pyx_n_s_success, __pyx_n_s_successf, __pyx_n_s_successl); if (unlikely(!__pyx_tuple__93)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1673; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__93); __Pyx_GIVEREF(__pyx_tuple__93); __pyx_codeobj__94 = (PyObject*)__Pyx_PyCode_New(1, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__93, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_whg_Projects_github_pyFFTW, __pyx_n_s_import_wisdom, 1673, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__94)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1673; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pyfftw/pyfftw.pyx":1789 * # return (success, successf, successl) * * def forget_wisdom(): # <<<<<<<<<<<<<< * '''forget_wisdom() * */ __pyx_codeobj__95 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_whg_Projects_github_pyFFTW, __pyx_n_s_forget_wisdom, 1789, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__95)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1789; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_InitGlobals(void) { if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_5 = PyInt_FromLong(5); if (unlikely(!__pyx_int_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_6 = PyInt_FromLong(6); if (unlikely(!__pyx_int_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_7 = PyInt_FromLong(7); if (unlikely(!__pyx_int_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_8 = PyInt_FromLong(8); if (unlikely(!__pyx_int_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_16 = PyInt_FromLong(16); if (unlikely(!__pyx_int_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_32 = PyInt_FromLong(32); if (unlikely(!__pyx_int_32)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} return 0; __pyx_L1_error:; return -1; } #if PY_MAJOR_VERSION < 3 PyMODINIT_FUNC initpyfftw(void); /*proto*/ PyMODINIT_FUNC initpyfftw(void) #else PyMODINIT_FUNC PyInit_pyfftw(void); /*proto*/ PyMODINIT_FUNC PyInit_pyfftw(void) #endif { PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_pyfftw(void)", 0); if (__Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS #ifdef WITH_THREAD /* Python build with threading support? */ PyEval_InitThreads(); #endif #endif /*--- Module creation code ---*/ #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("pyfftw", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); #else __pyx_m = PyModule_Create(&__pyx_moduledef); #endif if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} Py_INCREF(__pyx_d); __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #if CYTHON_COMPILING_IN_PYPY Py_INCREF(__pyx_b); #endif if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitGlobals() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif if (__pyx_module_is_main_pyfftw__pyfftw) { if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (!PyDict_GetItemString(modules, "pyfftw.pyfftw")) { if (unlikely(PyDict_SetItemString(modules, "pyfftw.pyfftw", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Global init code ---*/ __pyx_v_6pyfftw_6pyfftw_directions = Py_None; Py_INCREF(Py_None); __pyx_v_6pyfftw_6pyfftw_directions_lookup = Py_None; Py_INCREF(Py_None); __pyx_v_6pyfftw_6pyfftw_flag_dict = Py_None; Py_INCREF(Py_None); __pyx_v_6pyfftw_6pyfftw_plan_lock = Py_None; Py_INCREF(Py_None); __pyx_v_6pyfftw_6pyfftw_fftw_schemes = Py_None; Py_INCREF(Py_None); __pyx_v_6pyfftw_6pyfftw_scheme_directions = Py_None; Py_INCREF(Py_None); __pyx_v_6pyfftw_6pyfftw_scheme_functions = Py_None; Py_INCREF(Py_None); /*--- Variable export code ---*/ /*--- Function export code ---*/ /*--- Type init code ---*/ __pyx_vtabptr_6pyfftw_6pyfftw_FFTW = &__pyx_vtable_6pyfftw_6pyfftw_FFTW; __pyx_vtable_6pyfftw_6pyfftw_FFTW.update_arrays = (PyObject *(*)(struct __pyx_obj_6pyfftw_6pyfftw_FFTW *, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6pyfftw_6pyfftw_4FFTW_update_arrays; __pyx_vtable_6pyfftw_6pyfftw_FFTW._update_arrays = (PyObject *(*)(struct __pyx_obj_6pyfftw_6pyfftw_FFTW *, PyArrayObject *, PyArrayObject *))__pyx_f_6pyfftw_6pyfftw_4FFTW__update_arrays; __pyx_vtable_6pyfftw_6pyfftw_FFTW.execute = (PyObject *(*)(struct __pyx_obj_6pyfftw_6pyfftw_FFTW *, int __pyx_skip_dispatch))__pyx_f_6pyfftw_6pyfftw_4FFTW_execute; if (PyType_Ready(&__pyx_type_6pyfftw_6pyfftw_FFTW) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_type_6pyfftw_6pyfftw_FFTW.tp_print = 0; #if CYTHON_COMPILING_IN_CPYTHON { PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_6pyfftw_6pyfftw_FFTW, "__init__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) { __pyx_wrapperbase_6pyfftw_6pyfftw_4FFTW_32__init__ = *((PyWrapperDescrObject *)wrapper)->d_base; __pyx_wrapperbase_6pyfftw_6pyfftw_4FFTW_32__init__.doc = __pyx_doc_6pyfftw_6pyfftw_4FFTW_32__init__; ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_6pyfftw_6pyfftw_4FFTW_32__init__; } } #endif #if CYTHON_COMPILING_IN_CPYTHON { PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_6pyfftw_6pyfftw_FFTW, "__call__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) { __pyx_wrapperbase_6pyfftw_6pyfftw_4FFTW_36__call__ = *((PyWrapperDescrObject *)wrapper)->d_base; __pyx_wrapperbase_6pyfftw_6pyfftw_4FFTW_36__call__.doc = __pyx_doc_6pyfftw_6pyfftw_4FFTW_36__call__; ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_6pyfftw_6pyfftw_4FFTW_36__call__; } } #endif if (__Pyx_SetVtable(__pyx_type_6pyfftw_6pyfftw_FFTW.tp_dict, __pyx_vtabptr_6pyfftw_6pyfftw_FFTW) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (PyObject_SetAttrString(__pyx_m, "FFTW", (PyObject *)&__pyx_type_6pyfftw_6pyfftw_FFTW) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_6pyfftw_6pyfftw_FFTW = &__pyx_type_6pyfftw_6pyfftw_FFTW; /*--- Type import code ---*/ __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", #if CYTHON_COMPILING_IN_PYPY sizeof(PyTypeObject), #else sizeof(PyHeapTypeObject), #endif 0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Variable import code ---*/ /*--- Function import code ---*/ /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif /* "pyfftw/pyfftw.pyx":35 * # * * import numpy as np # <<<<<<<<<<<<<< * cimport numpy as np * from libc.stdlib cimport calloc, malloc, free */ __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pyfftw/pyfftw.pyx":41 * from libc cimport limits * * import warnings # <<<<<<<<<<<<<< * import threading * */ __pyx_t_1 = __Pyx_Import(__pyx_n_s_warnings, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_warnings, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pyfftw/pyfftw.pyx":42 * * import warnings * import threading # <<<<<<<<<<<<<< * * include 'utils.pxi' */ __pyx_t_1 = __Pyx_Import(__pyx_n_s_threading, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_threading, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pyfftw/utils.pxi":41 * cimport cpu * from libc.stdint cimport intptr_t * import warnings # <<<<<<<<<<<<<< * * */ __pyx_t_1 = __Pyx_Import(__pyx_n_s_warnings, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_warnings, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pyfftw/utils.pxi":44 * * * cdef int _simd_alignment = cpu.simd_alignment() # <<<<<<<<<<<<<< * * #: The optimum SIMD alignment in bytes, found by inspecting the CPU. */ __pyx_v_6pyfftw_6pyfftw__simd_alignment = simd_alignment(); /* "pyfftw/utils.pxi":47 * * #: The optimum SIMD alignment in bytes, found by inspecting the CPU. * simd_alignment = _simd_alignment # <<<<<<<<<<<<<< * * #: A tuple of simd alignments that make sense for this cpu */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_6pyfftw_6pyfftw__simd_alignment); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_simd_alignment, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pyfftw/utils.pxi":50 * * #: A tuple of simd alignments that make sense for this cpu * if _simd_alignment == 16: # <<<<<<<<<<<<<< * _valid_simd_alignments = (16,) * */ switch (__pyx_v_6pyfftw_6pyfftw__simd_alignment) { case 16: /* "pyfftw/utils.pxi":51 * #: A tuple of simd alignments that make sense for this cpu * if _simd_alignment == 16: * _valid_simd_alignments = (16,) # <<<<<<<<<<<<<< * * elif _simd_alignment == 32: */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_valid_simd_alignments, __pyx_tuple__38) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pyfftw/utils.pxi":50 * * #: A tuple of simd alignments that make sense for this cpu * if _simd_alignment == 16: # <<<<<<<<<<<<<< * _valid_simd_alignments = (16,) * */ break; /* "pyfftw/utils.pxi":53 * _valid_simd_alignments = (16,) * * elif _simd_alignment == 32: # <<<<<<<<<<<<<< * _valid_simd_alignments = (16, 32) * */ case 32: /* "pyfftw/utils.pxi":54 * * elif _simd_alignment == 32: * _valid_simd_alignments = (16, 32) # <<<<<<<<<<<<<< * * else: */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_valid_simd_alignments, __pyx_tuple__39) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pyfftw/utils.pxi":53 * _valid_simd_alignments = (16,) * * elif _simd_alignment == 32: # <<<<<<<<<<<<<< * _valid_simd_alignments = (16, 32) * */ break; default: /* "pyfftw/utils.pxi":57 * * else: * _valid_simd_alignments = () # <<<<<<<<<<<<<< * * cpdef n_byte_align_empty(shape, n, dtype='float64', order='C'): */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_valid_simd_alignments, __pyx_empty_tuple) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} break; } /* "pyfftw/pyfftw.pyx":50 * * cdef object directions * directions = {'FFTW_FORWARD': FFTW_FORWARD, # <<<<<<<<<<<<<< * 'FFTW_BACKWARD': FFTW_BACKWARD} * */ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_e_6pyfftw_6pyfftw_FFTW_FORWARD); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_FFTW_FORWARD, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pyfftw/pyfftw.pyx":51 * cdef object directions * directions = {'FFTW_FORWARD': FFTW_FORWARD, * 'FFTW_BACKWARD': FFTW_BACKWARD} # <<<<<<<<<<<<<< * * cdef object directions_lookup */ __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_e_6pyfftw_6pyfftw_FFTW_BACKWARD); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_FFTW_BACKWARD, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_v_6pyfftw_6pyfftw_directions); __Pyx_DECREF_SET(__pyx_v_6pyfftw_6pyfftw_directions, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; /* "pyfftw/pyfftw.pyx":54 * * cdef object directions_lookup * directions_lookup = {FFTW_FORWARD: 'FFTW_FORWARD', # <<<<<<<<<<<<<< * FFTW_BACKWARD: 'FFTW_BACKWARD'} * */ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_e_6pyfftw_6pyfftw_FFTW_FORWARD); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, __pyx_n_s_FFTW_FORWARD) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pyfftw/pyfftw.pyx":55 * cdef object directions_lookup * directions_lookup = {FFTW_FORWARD: 'FFTW_FORWARD', * FFTW_BACKWARD: 'FFTW_BACKWARD'} # <<<<<<<<<<<<<< * * cdef object flag_dict */ __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_e_6pyfftw_6pyfftw_FFTW_BACKWARD); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, __pyx_n_s_FFTW_BACKWARD) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_v_6pyfftw_6pyfftw_directions_lookup); __Pyx_DECREF_SET(__pyx_v_6pyfftw_6pyfftw_directions_lookup, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; /* "pyfftw/pyfftw.pyx":58 * * cdef object flag_dict * flag_dict = {'FFTW_MEASURE': FFTW_MEASURE, # <<<<<<<<<<<<<< * 'FFTW_EXHAUSTIVE': FFTW_EXHAUSTIVE, * 'FFTW_PATIENT': FFTW_PATIENT, */ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_e_6pyfftw_6pyfftw_FFTW_MEASURE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_FFTW_MEASURE, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pyfftw/pyfftw.pyx":59 * cdef object flag_dict * flag_dict = {'FFTW_MEASURE': FFTW_MEASURE, * 'FFTW_EXHAUSTIVE': FFTW_EXHAUSTIVE, # <<<<<<<<<<<<<< * 'FFTW_PATIENT': FFTW_PATIENT, * 'FFTW_ESTIMATE': FFTW_ESTIMATE, */ __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_e_6pyfftw_6pyfftw_FFTW_EXHAUSTIVE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_FFTW_EXHAUSTIVE, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pyfftw/pyfftw.pyx":60 * flag_dict = {'FFTW_MEASURE': FFTW_MEASURE, * 'FFTW_EXHAUSTIVE': FFTW_EXHAUSTIVE, * 'FFTW_PATIENT': FFTW_PATIENT, # <<<<<<<<<<<<<< * 'FFTW_ESTIMATE': FFTW_ESTIMATE, * 'FFTW_UNALIGNED': FFTW_UNALIGNED, */ __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_e_6pyfftw_6pyfftw_FFTW_PATIENT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_FFTW_PATIENT, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pyfftw/pyfftw.pyx":61 * 'FFTW_EXHAUSTIVE': FFTW_EXHAUSTIVE, * 'FFTW_PATIENT': FFTW_PATIENT, * 'FFTW_ESTIMATE': FFTW_ESTIMATE, # <<<<<<<<<<<<<< * 'FFTW_UNALIGNED': FFTW_UNALIGNED, * 'FFTW_DESTROY_INPUT': FFTW_DESTROY_INPUT, */ __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_e_6pyfftw_6pyfftw_FFTW_ESTIMATE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_FFTW_ESTIMATE, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pyfftw/pyfftw.pyx":62 * 'FFTW_PATIENT': FFTW_PATIENT, * 'FFTW_ESTIMATE': FFTW_ESTIMATE, * 'FFTW_UNALIGNED': FFTW_UNALIGNED, # <<<<<<<<<<<<<< * 'FFTW_DESTROY_INPUT': FFTW_DESTROY_INPUT, * 'FFTW_WISDOM_ONLY': FFTW_WISDOM_ONLY} */ __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_e_6pyfftw_6pyfftw_FFTW_UNALIGNED); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_FFTW_UNALIGNED, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pyfftw/pyfftw.pyx":63 * 'FFTW_ESTIMATE': FFTW_ESTIMATE, * 'FFTW_UNALIGNED': FFTW_UNALIGNED, * 'FFTW_DESTROY_INPUT': FFTW_DESTROY_INPUT, # <<<<<<<<<<<<<< * 'FFTW_WISDOM_ONLY': FFTW_WISDOM_ONLY} * */ __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_e_6pyfftw_6pyfftw_FFTW_DESTROY_INPUT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_FFTW_DESTROY_INPUT, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pyfftw/pyfftw.pyx":64 * 'FFTW_UNALIGNED': FFTW_UNALIGNED, * 'FFTW_DESTROY_INPUT': FFTW_DESTROY_INPUT, * 'FFTW_WISDOM_ONLY': FFTW_WISDOM_ONLY} # <<<<<<<<<<<<<< * * _flag_dict = flag_dict.copy() */ __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_e_6pyfftw_6pyfftw_FFTW_WISDOM_ONLY); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_FFTW_WISDOM_ONLY, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_v_6pyfftw_6pyfftw_flag_dict); __Pyx_DECREF_SET(__pyx_v_6pyfftw_6pyfftw_flag_dict, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; /* "pyfftw/pyfftw.pyx":66 * 'FFTW_WISDOM_ONLY': FFTW_WISDOM_ONLY} * * _flag_dict = flag_dict.copy() # <<<<<<<<<<<<<< * * # Need a global lock to protect FFTW planning so that multiple Python threads */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_6pyfftw_6pyfftw_flag_dict, __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_flag_dict, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pyfftw/pyfftw.pyx":70 * # Need a global lock to protect FFTW planning so that multiple Python threads * # do not attempt to plan simultaneously. * cdef object plan_lock = threading.Lock() # <<<<<<<<<<<<<< * * # Function wrappers */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_threading); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_Lock); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_2) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XGOTREF(__pyx_v_6pyfftw_6pyfftw_plan_lock); __Pyx_DECREF_SET(__pyx_v_6pyfftw_6pyfftw_plan_lock, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; /* "pyfftw/pyfftw.pyx":408 * # Shape lookup functions * # ====================== * def _lookup_shape_r2c_arrays(input_array, output_array): # <<<<<<<<<<<<<< * return input_array.shape * */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6pyfftw_6pyfftw_17_lookup_shape_r2c_arrays, NULL, __pyx_n_s_pyfftw_pyfftw); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_lookup_shape_r2c_arrays, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pyfftw/pyfftw.pyx":411 * return input_array.shape * * def _lookup_shape_c2r_arrays(input_array, output_array): # <<<<<<<<<<<<<< * return output_array.shape * */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6pyfftw_6pyfftw_19_lookup_shape_c2r_arrays, NULL, __pyx_n_s_pyfftw_pyfftw); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_lookup_shape_c2r_arrays, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pyfftw/pyfftw.pyx":446 * cdef object fftw_schemes * fftw_schemes = { * (np.dtype('complex128'), np.dtype('complex128')): ('c2c', '64'), # <<<<<<<<<<<<<< * (np.dtype('complex64'), np.dtype('complex64')): ('c2c', '32'), * (np.dtype('float64'), np.dtype('complex128')): ('r2c', '64'), */ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_tuple__44, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); __pyx_t_3 = 0; __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_t_1, __pyx_t_4, __pyx_tuple__46) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyfftw/pyfftw.pyx":447 * fftw_schemes = { * (np.dtype('complex128'), np.dtype('complex128')): ('c2c', '64'), * (np.dtype('complex64'), np.dtype('complex64')): ('c2c', '32'), # <<<<<<<<<<<<<< * (np.dtype('float64'), np.dtype('complex128')): ('r2c', '64'), * (np.dtype('float32'), np.dtype('complex64')): ('r2c', '32'), */ __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_tuple__47, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_tuple__48, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); __pyx_t_4 = 0; __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, __pyx_tuple__49) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pyfftw/pyfftw.pyx":448 * (np.dtype('complex128'), np.dtype('complex128')): ('c2c', '64'), * (np.dtype('complex64'), np.dtype('complex64')): ('c2c', '32'), * (np.dtype('float64'), np.dtype('complex128')): ('r2c', '64'), # <<<<<<<<<<<<<< * (np.dtype('float32'), np.dtype('complex64')): ('r2c', '32'), * (np.dtype('complex128'), np.dtype('float64')): ('c2r', '64'), */ __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_tuple__50, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_tuple__51, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); __pyx_t_3 = 0; __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_t_1, __pyx_t_4, __pyx_tuple__52) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyfftw/pyfftw.pyx":449 * (np.dtype('complex64'), np.dtype('complex64')): ('c2c', '32'), * (np.dtype('float64'), np.dtype('complex128')): ('r2c', '64'), * (np.dtype('float32'), np.dtype('complex64')): ('r2c', '32'), # <<<<<<<<<<<<<< * (np.dtype('complex128'), np.dtype('float64')): ('c2r', '64'), * (np.dtype('complex64'), np.dtype('float32')): ('c2r', '32')} */ __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_tuple__53, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_tuple__54, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); __pyx_t_4 = 0; __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, __pyx_tuple__55) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pyfftw/pyfftw.pyx":450 * (np.dtype('float64'), np.dtype('complex128')): ('r2c', '64'), * (np.dtype('float32'), np.dtype('complex64')): ('r2c', '32'), * (np.dtype('complex128'), np.dtype('float64')): ('c2r', '64'), # <<<<<<<<<<<<<< * (np.dtype('complex64'), np.dtype('float32')): ('c2r', '32')} * */ __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_tuple__56, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_tuple__57, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); __pyx_t_3 = 0; __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_t_1, __pyx_t_4, __pyx_tuple__58) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyfftw/pyfftw.pyx":451 * (np.dtype('float32'), np.dtype('complex64')): ('r2c', '32'), * (np.dtype('complex128'), np.dtype('float64')): ('c2r', '64'), * (np.dtype('complex64'), np.dtype('float32')): ('c2r', '32')} # <<<<<<<<<<<<<< * * if np.dtype('longdouble') != np.dtype('float64'): */ __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_tuple__59, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_tuple__60, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); __pyx_t_4 = 0; __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_t_1, __pyx_t_3, __pyx_tuple__61) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XGOTREF(__pyx_v_6pyfftw_6pyfftw_fftw_schemes); __Pyx_DECREF_SET(__pyx_v_6pyfftw_6pyfftw_fftw_schemes, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; /* "pyfftw/pyfftw.pyx":453 * (np.dtype('complex64'), np.dtype('float32')): ('c2r', '32')} * * if np.dtype('longdouble') != np.dtype('float64'): # <<<<<<<<<<<<<< * fftw_schemes.update({ * (np.dtype('clongdouble'), np.dtype('clongdouble')): ('c2c', 'ld'), */ __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_tuple__62, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_tuple__63, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_5) { /* "pyfftw/pyfftw.pyx":454 * * if np.dtype('longdouble') != np.dtype('float64'): * fftw_schemes.update({ # <<<<<<<<<<<<<< * (np.dtype('clongdouble'), np.dtype('clongdouble')): ('c2c', 'ld'), * (np.dtype('longdouble'), np.dtype('clongdouble')): ('r2c', 'ld'), */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_6pyfftw_6pyfftw_fftw_schemes, __pyx_n_s_update); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); /* "pyfftw/pyfftw.pyx":455 * if np.dtype('longdouble') != np.dtype('float64'): * fftw_schemes.update({ * (np.dtype('clongdouble'), np.dtype('clongdouble')): ('c2c', 'ld'), # <<<<<<<<<<<<<< * (np.dtype('longdouble'), np.dtype('clongdouble')): ('r2c', 'ld'), * (np.dtype('clongdouble'), np.dtype('longdouble')): ('c2r', 'ld')}) */ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_tuple__64, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_tuple__65, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6); __pyx_t_4 = 0; __pyx_t_6 = 0; if (PyDict_SetItem(__pyx_t_1, __pyx_t_7, __pyx_tuple__66) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "pyfftw/pyfftw.pyx":456 * fftw_schemes.update({ * (np.dtype('clongdouble'), np.dtype('clongdouble')): ('c2c', 'ld'), * (np.dtype('longdouble'), np.dtype('clongdouble')): ('r2c', 'ld'), # <<<<<<<<<<<<<< * (np.dtype('clongdouble'), np.dtype('longdouble')): ('c2r', 'ld')}) * */ __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_tuple__67, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_tuple__68, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_6); __pyx_t_7 = 0; __pyx_t_6 = 0; if (PyDict_SetItem(__pyx_t_1, __pyx_t_4, __pyx_tuple__69) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyfftw/pyfftw.pyx":457 * (np.dtype('clongdouble'), np.dtype('clongdouble')): ('c2c', 'ld'), * (np.dtype('longdouble'), np.dtype('clongdouble')): ('r2c', 'ld'), * (np.dtype('clongdouble'), np.dtype('longdouble')): ('c2r', 'ld')}) # <<<<<<<<<<<<<< * * */ __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_tuple__70, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_tuple__71, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6); __pyx_t_4 = 0; __pyx_t_6 = 0; if (PyDict_SetItem(__pyx_t_1, __pyx_t_7, __pyx_tuple__72) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (!__pyx_t_7) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_2); } else { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); __pyx_t_7 = NULL; __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_1); __pyx_t_1 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pyfftw/pyfftw.pyx":453 * (np.dtype('complex64'), np.dtype('float32')): ('c2r', '32')} * * if np.dtype('longdouble') != np.dtype('float64'): # <<<<<<<<<<<<<< * fftw_schemes.update({ * (np.dtype('clongdouble'), np.dtype('clongdouble')): ('c2c', 'ld'), */ } /* "pyfftw/pyfftw.pyx":462 * cdef object scheme_directions * scheme_directions = { * ('c2c', '64'): ['FFTW_FORWARD', 'FFTW_BACKWARD'], # <<<<<<<<<<<<<< * ('c2c', '32'): ['FFTW_FORWARD', 'FFTW_BACKWARD'], * ('c2c', 'ld'): ['FFTW_FORWARD', 'FFTW_BACKWARD'], */ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_n_s_FFTW_FORWARD); __Pyx_GIVEREF(__pyx_n_s_FFTW_FORWARD); PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_FFTW_FORWARD); __Pyx_INCREF(__pyx_n_s_FFTW_BACKWARD); __Pyx_GIVEREF(__pyx_n_s_FFTW_BACKWARD); PyList_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_FFTW_BACKWARD); if (PyDict_SetItem(__pyx_t_2, __pyx_tuple__73, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pyfftw/pyfftw.pyx":463 * scheme_directions = { * ('c2c', '64'): ['FFTW_FORWARD', 'FFTW_BACKWARD'], * ('c2c', '32'): ['FFTW_FORWARD', 'FFTW_BACKWARD'], # <<<<<<<<<<<<<< * ('c2c', 'ld'): ['FFTW_FORWARD', 'FFTW_BACKWARD'], * ('r2c', '64'): ['FFTW_FORWARD'], */ __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_n_s_FFTW_FORWARD); __Pyx_GIVEREF(__pyx_n_s_FFTW_FORWARD); PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_FFTW_FORWARD); __Pyx_INCREF(__pyx_n_s_FFTW_BACKWARD); __Pyx_GIVEREF(__pyx_n_s_FFTW_BACKWARD); PyList_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_FFTW_BACKWARD); if (PyDict_SetItem(__pyx_t_2, __pyx_tuple__74, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pyfftw/pyfftw.pyx":464 * ('c2c', '64'): ['FFTW_FORWARD', 'FFTW_BACKWARD'], * ('c2c', '32'): ['FFTW_FORWARD', 'FFTW_BACKWARD'], * ('c2c', 'ld'): ['FFTW_FORWARD', 'FFTW_BACKWARD'], # <<<<<<<<<<<<<< * ('r2c', '64'): ['FFTW_FORWARD'], * ('r2c', '32'): ['FFTW_FORWARD'], */ __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_n_s_FFTW_FORWARD); __Pyx_GIVEREF(__pyx_n_s_FFTW_FORWARD); PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_FFTW_FORWARD); __Pyx_INCREF(__pyx_n_s_FFTW_BACKWARD); __Pyx_GIVEREF(__pyx_n_s_FFTW_BACKWARD); PyList_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_FFTW_BACKWARD); if (PyDict_SetItem(__pyx_t_2, __pyx_tuple__75, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pyfftw/pyfftw.pyx":465 * ('c2c', '32'): ['FFTW_FORWARD', 'FFTW_BACKWARD'], * ('c2c', 'ld'): ['FFTW_FORWARD', 'FFTW_BACKWARD'], * ('r2c', '64'): ['FFTW_FORWARD'], # <<<<<<<<<<<<<< * ('r2c', '32'): ['FFTW_FORWARD'], * ('r2c', 'ld'): ['FFTW_FORWARD'], */ __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_n_s_FFTW_FORWARD); __Pyx_GIVEREF(__pyx_n_s_FFTW_FORWARD); PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_FFTW_FORWARD); if (PyDict_SetItem(__pyx_t_2, __pyx_tuple__76, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pyfftw/pyfftw.pyx":466 * ('c2c', 'ld'): ['FFTW_FORWARD', 'FFTW_BACKWARD'], * ('r2c', '64'): ['FFTW_FORWARD'], * ('r2c', '32'): ['FFTW_FORWARD'], # <<<<<<<<<<<<<< * ('r2c', 'ld'): ['FFTW_FORWARD'], * ('c2r', '64'): ['FFTW_BACKWARD'], */ __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_n_s_FFTW_FORWARD); __Pyx_GIVEREF(__pyx_n_s_FFTW_FORWARD); PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_FFTW_FORWARD); if (PyDict_SetItem(__pyx_t_2, __pyx_tuple__77, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pyfftw/pyfftw.pyx":467 * ('r2c', '64'): ['FFTW_FORWARD'], * ('r2c', '32'): ['FFTW_FORWARD'], * ('r2c', 'ld'): ['FFTW_FORWARD'], # <<<<<<<<<<<<<< * ('c2r', '64'): ['FFTW_BACKWARD'], * ('c2r', '32'): ['FFTW_BACKWARD'], */ __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_n_s_FFTW_FORWARD); __Pyx_GIVEREF(__pyx_n_s_FFTW_FORWARD); PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_FFTW_FORWARD); if (PyDict_SetItem(__pyx_t_2, __pyx_tuple__78, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pyfftw/pyfftw.pyx":468 * ('r2c', '32'): ['FFTW_FORWARD'], * ('r2c', 'ld'): ['FFTW_FORWARD'], * ('c2r', '64'): ['FFTW_BACKWARD'], # <<<<<<<<<<<<<< * ('c2r', '32'): ['FFTW_BACKWARD'], * ('c2r', 'ld'): ['FFTW_BACKWARD']} */ __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_n_s_FFTW_BACKWARD); __Pyx_GIVEREF(__pyx_n_s_FFTW_BACKWARD); PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_FFTW_BACKWARD); if (PyDict_SetItem(__pyx_t_2, __pyx_tuple__79, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pyfftw/pyfftw.pyx":469 * ('r2c', 'ld'): ['FFTW_FORWARD'], * ('c2r', '64'): ['FFTW_BACKWARD'], * ('c2r', '32'): ['FFTW_BACKWARD'], # <<<<<<<<<<<<<< * ('c2r', 'ld'): ['FFTW_BACKWARD']} * */ __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_n_s_FFTW_BACKWARD); __Pyx_GIVEREF(__pyx_n_s_FFTW_BACKWARD); PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_FFTW_BACKWARD); if (PyDict_SetItem(__pyx_t_2, __pyx_tuple__80, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pyfftw/pyfftw.pyx":470 * ('c2r', '64'): ['FFTW_BACKWARD'], * ('c2r', '32'): ['FFTW_BACKWARD'], * ('c2r', 'ld'): ['FFTW_BACKWARD']} # <<<<<<<<<<<<<< * * # In the following, -1 denotes using the default. A segfault has been */ __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_n_s_FFTW_BACKWARD); __Pyx_GIVEREF(__pyx_n_s_FFTW_BACKWARD); PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_FFTW_BACKWARD); if (PyDict_SetItem(__pyx_t_2, __pyx_tuple__81, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XGOTREF(__pyx_v_6pyfftw_6pyfftw_scheme_directions); __Pyx_DECREF_SET(__pyx_v_6pyfftw_6pyfftw_scheme_directions, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; /* "pyfftw/pyfftw.pyx":478 * cdef object scheme_functions * scheme_functions = { * ('c2c', '64'): {'planner': 0, 'executor':0, 'generic_precision':0, # <<<<<<<<<<<<<< * 'validator': -1, 'fft_shape_lookup': -1}, * ('c2c', '32'): {'planner':1, 'executor':1, 'generic_precision':1, */ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_planner, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_executor, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_generic_precision, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_validator, __pyx_int_neg_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_fft_shape_lookup, __pyx_int_neg_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (PyDict_SetItem(__pyx_t_2, __pyx_tuple__82, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pyfftw/pyfftw.pyx":480 * ('c2c', '64'): {'planner': 0, 'executor':0, 'generic_precision':0, * 'validator': -1, 'fft_shape_lookup': -1}, * ('c2c', '32'): {'planner':1, 'executor':1, 'generic_precision':1, # <<<<<<<<<<<<<< * 'validator': -1, 'fft_shape_lookup': -1}, * ('c2c', 'ld'): {'planner':2, 'executor':2, 'generic_precision':2, */ __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_planner, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_executor, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_generic_precision, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_validator, __pyx_int_neg_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_fft_shape_lookup, __pyx_int_neg_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (PyDict_SetItem(__pyx_t_2, __pyx_tuple__83, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pyfftw/pyfftw.pyx":482 * ('c2c', '32'): {'planner':1, 'executor':1, 'generic_precision':1, * 'validator': -1, 'fft_shape_lookup': -1}, * ('c2c', 'ld'): {'planner':2, 'executor':2, 'generic_precision':2, # <<<<<<<<<<<<<< * 'validator': -1, 'fft_shape_lookup': -1}, * ('r2c', '64'): {'planner':3, 'executor':3, 'generic_precision':0, */ __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_planner, __pyx_int_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_executor, __pyx_int_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_generic_precision, __pyx_int_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_validator, __pyx_int_neg_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_fft_shape_lookup, __pyx_int_neg_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (PyDict_SetItem(__pyx_t_2, __pyx_tuple__84, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pyfftw/pyfftw.pyx":484 * ('c2c', 'ld'): {'planner':2, 'executor':2, 'generic_precision':2, * 'validator': -1, 'fft_shape_lookup': -1}, * ('r2c', '64'): {'planner':3, 'executor':3, 'generic_precision':0, # <<<<<<<<<<<<<< * 'validator': 0, * 'fft_shape_lookup': _lookup_shape_r2c_arrays}, */ __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_planner, __pyx_int_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_executor, __pyx_int_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_generic_precision, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_validator, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pyfftw/pyfftw.pyx":486 * ('r2c', '64'): {'planner':3, 'executor':3, 'generic_precision':0, * 'validator': 0, * 'fft_shape_lookup': _lookup_shape_r2c_arrays}, # <<<<<<<<<<<<<< * ('r2c', '32'): {'planner':4, 'executor':4, 'generic_precision':1, * 'validator': 0, */ __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_lookup_shape_r2c_arrays); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_fft_shape_lookup, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (PyDict_SetItem(__pyx_t_2, __pyx_tuple__85, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pyfftw/pyfftw.pyx":487 * 'validator': 0, * 'fft_shape_lookup': _lookup_shape_r2c_arrays}, * ('r2c', '32'): {'planner':4, 'executor':4, 'generic_precision':1, # <<<<<<<<<<<<<< * 'validator': 0, * 'fft_shape_lookup': _lookup_shape_r2c_arrays}, */ __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_planner, __pyx_int_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_executor, __pyx_int_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_generic_precision, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_validator, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pyfftw/pyfftw.pyx":489 * ('r2c', '32'): {'planner':4, 'executor':4, 'generic_precision':1, * 'validator': 0, * 'fft_shape_lookup': _lookup_shape_r2c_arrays}, # <<<<<<<<<<<<<< * ('r2c', 'ld'): {'planner':5, 'executor':5, 'generic_precision':2, * 'validator': 0, */ __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_lookup_shape_r2c_arrays); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_fft_shape_lookup, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (PyDict_SetItem(__pyx_t_2, __pyx_tuple__86, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pyfftw/pyfftw.pyx":490 * 'validator': 0, * 'fft_shape_lookup': _lookup_shape_r2c_arrays}, * ('r2c', 'ld'): {'planner':5, 'executor':5, 'generic_precision':2, # <<<<<<<<<<<<<< * 'validator': 0, * 'fft_shape_lookup': _lookup_shape_r2c_arrays}, */ __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_planner, __pyx_int_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_executor, __pyx_int_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_generic_precision, __pyx_int_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_validator, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pyfftw/pyfftw.pyx":492 * ('r2c', 'ld'): {'planner':5, 'executor':5, 'generic_precision':2, * 'validator': 0, * 'fft_shape_lookup': _lookup_shape_r2c_arrays}, # <<<<<<<<<<<<<< * ('c2r', '64'): {'planner':6, 'executor':6, 'generic_precision':0, * 'validator': 1, */ __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_lookup_shape_r2c_arrays); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_fft_shape_lookup, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (PyDict_SetItem(__pyx_t_2, __pyx_tuple__87, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pyfftw/pyfftw.pyx":493 * 'validator': 0, * 'fft_shape_lookup': _lookup_shape_r2c_arrays}, * ('c2r', '64'): {'planner':6, 'executor':6, 'generic_precision':0, # <<<<<<<<<<<<<< * 'validator': 1, * 'fft_shape_lookup': _lookup_shape_c2r_arrays}, */ __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_planner, __pyx_int_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_executor, __pyx_int_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_generic_precision, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_validator, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pyfftw/pyfftw.pyx":495 * ('c2r', '64'): {'planner':6, 'executor':6, 'generic_precision':0, * 'validator': 1, * 'fft_shape_lookup': _lookup_shape_c2r_arrays}, # <<<<<<<<<<<<<< * ('c2r', '32'): {'planner':7, 'executor':7, 'generic_precision':1, * 'validator': 1, */ __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_lookup_shape_c2r_arrays); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_fft_shape_lookup, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (PyDict_SetItem(__pyx_t_2, __pyx_tuple__88, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pyfftw/pyfftw.pyx":496 * 'validator': 1, * 'fft_shape_lookup': _lookup_shape_c2r_arrays}, * ('c2r', '32'): {'planner':7, 'executor':7, 'generic_precision':1, # <<<<<<<<<<<<<< * 'validator': 1, * 'fft_shape_lookup': _lookup_shape_c2r_arrays}, */ __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_planner, __pyx_int_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_executor, __pyx_int_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_generic_precision, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_validator, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pyfftw/pyfftw.pyx":498 * ('c2r', '32'): {'planner':7, 'executor':7, 'generic_precision':1, * 'validator': 1, * 'fft_shape_lookup': _lookup_shape_c2r_arrays}, # <<<<<<<<<<<<<< * ('c2r', 'ld'): {'planner':8, 'executor':8, 'generic_precision':2, * 'validator': 1, */ __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_lookup_shape_c2r_arrays); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_fft_shape_lookup, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (PyDict_SetItem(__pyx_t_2, __pyx_tuple__89, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pyfftw/pyfftw.pyx":499 * 'validator': 1, * 'fft_shape_lookup': _lookup_shape_c2r_arrays}, * ('c2r', 'ld'): {'planner':8, 'executor':8, 'generic_precision':2, # <<<<<<<<<<<<<< * 'validator': 1, * 'fft_shape_lookup': _lookup_shape_c2r_arrays}} */ __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_planner, __pyx_int_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_executor, __pyx_int_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_generic_precision, __pyx_int_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_validator, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "pyfftw/pyfftw.pyx":501 * ('c2r', 'ld'): {'planner':8, 'executor':8, 'generic_precision':2, * 'validator': 1, * 'fft_shape_lookup': _lookup_shape_c2r_arrays}} # <<<<<<<<<<<<<< * * # Initialize the module */ __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_lookup_shape_c2r_arrays); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_fft_shape_lookup, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (PyDict_SetItem(__pyx_t_2, __pyx_tuple__90, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XGOTREF(__pyx_v_6pyfftw_6pyfftw_scheme_functions); __Pyx_DECREF_SET(__pyx_v_6pyfftw_6pyfftw_scheme_functions, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; /* "pyfftw/pyfftw.pyx":506 * * # Define the functions * _build_planner_list() # <<<<<<<<<<<<<< * _build_destroyer_list() * _build_executor_list() */ __pyx_f_6pyfftw_6pyfftw__build_planner_list(); /* "pyfftw/pyfftw.pyx":507 * # Define the functions * _build_planner_list() * _build_destroyer_list() # <<<<<<<<<<<<<< * _build_executor_list() * _build_nthreads_plan_setters_list() */ __pyx_f_6pyfftw_6pyfftw__build_destroyer_list(); /* "pyfftw/pyfftw.pyx":508 * _build_planner_list() * _build_destroyer_list() * _build_executor_list() # <<<<<<<<<<<<<< * _build_nthreads_plan_setters_list() * _build_validators_list() */ __pyx_f_6pyfftw_6pyfftw__build_executor_list(); /* "pyfftw/pyfftw.pyx":509 * _build_destroyer_list() * _build_executor_list() * _build_nthreads_plan_setters_list() # <<<<<<<<<<<<<< * _build_validators_list() * _build_set_timelimit_funcs_list() */ __pyx_f_6pyfftw_6pyfftw__build_nthreads_plan_setters_list(); /* "pyfftw/pyfftw.pyx":510 * _build_executor_list() * _build_nthreads_plan_setters_list() * _build_validators_list() # <<<<<<<<<<<<<< * _build_set_timelimit_funcs_list() * */ __pyx_f_6pyfftw_6pyfftw__build_validators_list(); /* "pyfftw/pyfftw.pyx":511 * _build_nthreads_plan_setters_list() * _build_validators_list() * _build_set_timelimit_funcs_list() # <<<<<<<<<<<<<< * * fftw_init_threads() */ __pyx_f_6pyfftw_6pyfftw__build_set_timelimit_funcs_list(); /* "pyfftw/pyfftw.pyx":513 * _build_set_timelimit_funcs_list() * * fftw_init_threads() # <<<<<<<<<<<<<< * fftwf_init_threads() * fftwl_init_threads() */ fftw_init_threads(); /* "pyfftw/pyfftw.pyx":514 * * fftw_init_threads() * fftwf_init_threads() # <<<<<<<<<<<<<< * fftwl_init_threads() * */ fftwf_init_threads(); /* "pyfftw/pyfftw.pyx":515 * fftw_init_threads() * fftwf_init_threads() * fftwl_init_threads() # <<<<<<<<<<<<<< * * # Set the cleanup routine */ fftwl_init_threads(); /* "pyfftw/pyfftw.pyx":526 * fftwl_cleanup_threads() * * Py_AtExit(_cleanup) # <<<<<<<<<<<<<< * * # Helper functions */ Py_AtExit(__pyx_f_6pyfftw_6pyfftw__cleanup); /* "pyfftw/pyfftw.pyx":675 * return self._N * * N = property(_get_N) # <<<<<<<<<<<<<< * * def _get_simd_aligned(self): */ __pyx_t_2 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_6pyfftw_6pyfftw_FFTW, __pyx_n_s_get_N); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 675; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 675; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 675; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem((PyObject *)__pyx_ptype_6pyfftw_6pyfftw_FFTW->tp_dict, __pyx_n_s_N, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 675; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_6pyfftw_6pyfftw_FFTW); /* "pyfftw/pyfftw.pyx":684 * return self._simd_allowed * * simd_aligned = property(_get_simd_aligned) # <<<<<<<<<<<<<< * * def _get_input_alignment(self): */ __pyx_t_2 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_6pyfftw_6pyfftw_FFTW, __pyx_n_s_get_simd_aligned); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 684; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 684; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 684; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem((PyObject *)__pyx_ptype_6pyfftw_6pyfftw_FFTW->tp_dict, __pyx_n_s_simd_aligned, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 684; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_6pyfftw_6pyfftw_FFTW); /* "pyfftw/pyfftw.pyx":698 * return self._input_array_alignment * * input_alignment = property(_get_input_alignment) # <<<<<<<<<<<<<< * * def _get_output_alignment(self): */ __pyx_t_2 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_6pyfftw_6pyfftw_FFTW, __pyx_n_s_get_input_alignment); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem((PyObject *)__pyx_ptype_6pyfftw_6pyfftw_FFTW->tp_dict, __pyx_n_s_input_alignment, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_6pyfftw_6pyfftw_FFTW); /* "pyfftw/pyfftw.pyx":710 * return self._output_array_alignment * * output_alignment = property(_get_output_alignment) # <<<<<<<<<<<<<< * * def _get_flags_used(self): */ __pyx_t_2 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_6pyfftw_6pyfftw_FFTW, __pyx_n_s_get_output_alignment); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 710; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 710; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 710; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem((PyObject *)__pyx_ptype_6pyfftw_6pyfftw_FFTW->tp_dict, __pyx_n_s_output_alignment, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 710; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_6pyfftw_6pyfftw_FFTW); /* "pyfftw/pyfftw.pyx":720 * return tuple(self._flags_used) * * flags = property(_get_flags_used) # <<<<<<<<<<<<<< * * def _get_input_array(self): */ __pyx_t_2 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_6pyfftw_6pyfftw_FFTW, __pyx_n_s_get_flags_used); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 720; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 720; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 720; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem((PyObject *)__pyx_ptype_6pyfftw_6pyfftw_FFTW->tp_dict, __pyx_n_s_flags, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 720; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_6pyfftw_6pyfftw_FFTW); /* "pyfftw/pyfftw.pyx":729 * return self._input_array * * input_array = property(_get_input_array) # <<<<<<<<<<<<<< * * def _get_output_array(self): */ __pyx_t_2 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_6pyfftw_6pyfftw_FFTW, __pyx_n_s_get_input_array); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 729; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 729; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 729; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem((PyObject *)__pyx_ptype_6pyfftw_6pyfftw_FFTW->tp_dict, __pyx_n_s_input_array, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 729; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_6pyfftw_6pyfftw_FFTW); /* "pyfftw/pyfftw.pyx":738 * return self._output_array * * output_array = property(_get_output_array) # <<<<<<<<<<<<<< * * def _get_input_strides(self): */ __pyx_t_2 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_6pyfftw_6pyfftw_FFTW, __pyx_n_s_get_output_array); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem((PyObject *)__pyx_ptype_6pyfftw_6pyfftw_FFTW->tp_dict, __pyx_n_s_output_array, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_6pyfftw_6pyfftw_FFTW); /* "pyfftw/pyfftw.pyx":746 * return self._input_strides * * input_strides = property(_get_input_strides) # <<<<<<<<<<<<<< * * def _get_output_strides(self): */ __pyx_t_2 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_6pyfftw_6pyfftw_FFTW, __pyx_n_s_get_input_strides); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem((PyObject *)__pyx_ptype_6pyfftw_6pyfftw_FFTW->tp_dict, __pyx_n_s_input_strides, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_6pyfftw_6pyfftw_FFTW); /* "pyfftw/pyfftw.pyx":754 * return self._output_strides * * output_strides = property(_get_output_strides) # <<<<<<<<<<<<<< * * def _get_input_shape(self): */ __pyx_t_2 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_6pyfftw_6pyfftw_FFTW, __pyx_n_s_get_output_strides); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem((PyObject *)__pyx_ptype_6pyfftw_6pyfftw_FFTW->tp_dict, __pyx_n_s_output_strides, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_6pyfftw_6pyfftw_FFTW); /* "pyfftw/pyfftw.pyx":762 * return self._input_shape * * input_shape = property(_get_input_shape) # <<<<<<<<<<<<<< * * def _get_output_shape(self): */ __pyx_t_2 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_6pyfftw_6pyfftw_FFTW, __pyx_n_s_get_input_shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem((PyObject *)__pyx_ptype_6pyfftw_6pyfftw_FFTW->tp_dict, __pyx_n_s_input_shape, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_6pyfftw_6pyfftw_FFTW); /* "pyfftw/pyfftw.pyx":770 * return self._output_shape * * output_shape = property(_get_output_shape) # <<<<<<<<<<<<<< * * def _get_input_dtype(self): */ __pyx_t_2 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_6pyfftw_6pyfftw_FFTW, __pyx_n_s_get_output_shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem((PyObject *)__pyx_ptype_6pyfftw_6pyfftw_FFTW->tp_dict, __pyx_n_s_output_shape, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_6pyfftw_6pyfftw_FFTW); /* "pyfftw/pyfftw.pyx":778 * return self._input_dtype * * input_dtype = property(_get_input_dtype) # <<<<<<<<<<<<<< * * def _get_output_dtype(self): */ __pyx_t_2 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_6pyfftw_6pyfftw_FFTW, __pyx_n_s_get_input_dtype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem((PyObject *)__pyx_ptype_6pyfftw_6pyfftw_FFTW->tp_dict, __pyx_n_s_input_dtype, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_6pyfftw_6pyfftw_FFTW); /* "pyfftw/pyfftw.pyx":786 * return self._output_dtype * * output_dtype = property(_get_output_dtype) # <<<<<<<<<<<<<< * * def _get_direction(self): */ __pyx_t_2 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_6pyfftw_6pyfftw_FFTW, __pyx_n_s_get_output_dtype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem((PyObject *)__pyx_ptype_6pyfftw_6pyfftw_FFTW->tp_dict, __pyx_n_s_output_dtype, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_6pyfftw_6pyfftw_FFTW); /* "pyfftw/pyfftw.pyx":795 * return directions_lookup[self._direction] * * direction = property(_get_direction) # <<<<<<<<<<<<<< * * def _get_axes(self): */ __pyx_t_2 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_6pyfftw_6pyfftw_FFTW, __pyx_n_s_get_direction); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem((PyObject *)__pyx_ptype_6pyfftw_6pyfftw_FFTW->tp_dict, __pyx_n_s_direction, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_6pyfftw_6pyfftw_FFTW); /* "pyfftw/pyfftw.pyx":809 * return tuple(axes) * * axes = property(_get_axes) # <<<<<<<<<<<<<< * * def __cinit__(self, input_array, output_array, axes=(-1,), */ __pyx_t_2 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_6pyfftw_6pyfftw_FFTW, __pyx_n_s_get_axes); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem((PyObject *)__pyx_ptype_6pyfftw_6pyfftw_FFTW->tp_dict, __pyx_n_s_axes, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_6pyfftw_6pyfftw_FFTW); /* "pyfftw/pyfftw.pyx":1614 * * * def export_wisdom(): # <<<<<<<<<<<<<< * '''export_wisdom() * */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pyfftw_6pyfftw_21export_wisdom, NULL, __pyx_n_s_pyfftw_pyfftw); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_export_wisdom, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pyfftw/pyfftw.pyx":1673 * return (py_wisdom, py_wisdomf, py_wisdoml) * * def import_wisdom(wisdom): # <<<<<<<<<<<<<< * '''import_wisdom(wisdom) * */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pyfftw_6pyfftw_23import_wisdom, NULL, __pyx_n_s_pyfftw_pyfftw); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1673; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_import_wisdom, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1673; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pyfftw/pyfftw.pyx":1789 * # return (success, successf, successl) * * def forget_wisdom(): # <<<<<<<<<<<<<< * '''forget_wisdom() * */ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pyfftw_6pyfftw_25forget_wisdom, NULL, __pyx_n_s_pyfftw_pyfftw); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1789; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_forget_wisdom, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1789; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pyfftw/pyfftw.pyx":1 * # Copyright 2015 Knowledge Economy Developments Ltd # <<<<<<<<<<<<<< * # * # Henry Gomersall */ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":976 * arr.base = baseptr * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< * if arr.base is NULL: * return None */ /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); if (__pyx_m) { if (__pyx_d) { __Pyx_AddTraceback("init pyfftw.pyfftw", __pyx_clineno, __pyx_lineno, __pyx_filename); } Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init pyfftw.pyfftw"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if PY_MAJOR_VERSION < 3 return; #else return __pyx_m; #endif } /* --- Runtime support code --- */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule((char *)modname); if (!m) goto end; p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); if (unlikely(!result)) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { PyObject *result; #if CYTHON_COMPILING_IN_CPYTHON result = PyDict_GetItem(__pyx_d, name); if (likely(result)) { Py_INCREF(result); } else { #else result = PyObject_GetItem(__pyx_d, name); if (!result) { PyErr_Clear(); #endif result = __Pyx_GetBuiltinName(name); } return result; } #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = func->ob_type->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif static void __Pyx_RaiseArgtupleInvalid( const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found) { Py_ssize_t num_expected; const char *more_or_less; if (num_found < num_min) { num_expected = num_min; more_or_less = "at least"; } else { num_expected = num_max; more_or_less = "at most"; } if (exact) { more_or_less = "exactly"; } PyErr_Format(PyExc_TypeError, "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", func_name, more_or_less, num_expected, (num_expected == 1) ? "" : "s", num_found); } static void __Pyx_RaiseDoubleKeywordsError( const char* func_name, PyObject* kw_name) { PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION >= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; while (PyDict_Next(kwds, &pos, &key, &value)) { name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; continue; } name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = (**name == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : #endif PyUnicode_Compare(**name, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION < 3 "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: return -1; } static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { #if CYTHON_COMPILING_IN_CPYTHON PyObject *tmp_type, *tmp_value, *tmp_tb; PyThreadState *tstate = PyThreadState_GET(); tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #else PyErr_Restore(type, value, tb); #endif } static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { #if CYTHON_COMPILING_IN_CPYTHON PyThreadState *tstate = PyThreadState_GET(); *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #else PyErr_Fetch(type, value, tb); #endif } #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, CYTHON_UNUSED PyObject *cause) { Py_XINCREF(type); if (!value || value == Py_None) value = NULL; else Py_INCREF(value); if (!tb || tb == Py_None) tb = NULL; else { Py_INCREF(tb); if (!PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } } if (PyType_Check(type)) { #if CYTHON_COMPILING_IN_PYPY if (!value) { Py_INCREF(Py_None); value = Py_None; } #endif PyErr_NormalizeException(&type, &value, &tb); } else { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } value = type; type = (PyObject*) Py_TYPE(type); Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto raise_error; } } __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto bad; } if (value == Py_None) value = 0; if (PyExceptionInstance_Check(type)) { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto bad; } value = type; type = (PyObject*) Py_TYPE(value); } else if (PyExceptionClass_Check(type)) { PyObject *instance_class = NULL; if (value && PyExceptionInstance_Check(value)) { instance_class = (PyObject*) Py_TYPE(value); if (instance_class != type) { int is_subclass = PyObject_IsSubclass(instance_class, type); if (!is_subclass) { instance_class = NULL; } else if (unlikely(is_subclass == -1)) { goto bad; } else { type = instance_class; } } } if (!instance_class) { PyObject *args; if (!value) args = PyTuple_New(0); else if (PyTuple_Check(value)) { Py_INCREF(value); args = value; } else args = PyTuple_Pack(1, value); if (!args) goto bad; owned_instance = PyObject_Call(type, args, NULL); Py_DECREF(args); if (!owned_instance) goto bad; value = owned_instance; if (!PyExceptionInstance_Check(value)) { PyErr_Format(PyExc_TypeError, "calling %R should have returned an instance of " "BaseException, not %R", type, Py_TYPE(value)); goto bad; } } } else { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto bad; } #if PY_VERSION_HEX >= 0x03030000 if (cause) { #else if (cause && cause != Py_None) { #endif PyObject *fixed_cause; if (cause == Py_None) { fixed_cause = NULL; } else if (PyExceptionClass_Check(cause)) { fixed_cause = PyObject_CallObject(cause, NULL); if (fixed_cause == NULL) goto bad; } else if (PyExceptionInstance_Check(cause)) { fixed_cause = cause; Py_INCREF(fixed_cause); } else { PyErr_SetString(PyExc_TypeError, "exception causes must derive from " "BaseException"); goto bad; } PyException_SetCause(value, fixed_cause); } PyErr_SetObject(type, value); if (tb) { #if CYTHON_COMPILING_IN_PYPY PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); #else PyThreadState *tstate = PyThreadState_GET(); PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } #endif } bad: Py_XDECREF(owned_instance); return; } #endif static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } if (likely(PyObject_TypeCheck(obj, type))) return 1; PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s", Py_TYPE(obj)->tp_name, type->tp_name); return 0; } static CYTHON_INLINE int __Pyx_PyObject_SetSlice(PyObject* obj, PyObject* value, Py_ssize_t cstart, Py_ssize_t cstop, PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice, int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) { #if CYTHON_COMPILING_IN_CPYTHON PyMappingMethods* mp; #if PY_MAJOR_VERSION < 3 PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence; if (likely(ms && ms->sq_ass_slice)) { if (!has_cstart) { if (_py_start && (*_py_start != Py_None)) { cstart = __Pyx_PyIndex_AsSsize_t(*_py_start); if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; } else cstart = 0; } if (!has_cstop) { if (_py_stop && (*_py_stop != Py_None)) { cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop); if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; } else cstop = PY_SSIZE_T_MAX; } if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) { Py_ssize_t l = ms->sq_length(obj); if (likely(l >= 0)) { if (cstop < 0) { cstop += l; if (cstop < 0) cstop = 0; } if (cstart < 0) { cstart += l; if (cstart < 0) cstart = 0; } } else { if (PyErr_ExceptionMatches(PyExc_OverflowError)) PyErr_Clear(); else goto bad; } } return ms->sq_ass_slice(obj, cstart, cstop, value); } #endif mp = Py_TYPE(obj)->tp_as_mapping; if (likely(mp && mp->mp_ass_subscript)) #endif { int result; PyObject *py_slice, *py_start, *py_stop; if (_py_slice) { py_slice = *_py_slice; } else { PyObject* owned_start = NULL; PyObject* owned_stop = NULL; if (_py_start) { py_start = *_py_start; } else { if (has_cstart) { owned_start = py_start = PyInt_FromSsize_t(cstart); if (unlikely(!py_start)) goto bad; } else py_start = Py_None; } if (_py_stop) { py_stop = *_py_stop; } else { if (has_cstop) { owned_stop = py_stop = PyInt_FromSsize_t(cstop); if (unlikely(!py_stop)) { Py_XDECREF(owned_start); goto bad; } } else py_stop = Py_None; } py_slice = PySlice_New(py_start, py_stop, Py_None); Py_XDECREF(owned_start); Py_XDECREF(owned_stop); if (unlikely(!py_slice)) goto bad; } #if CYTHON_COMPILING_IN_CPYTHON result = mp->mp_ass_subscript(obj, py_slice, value); #else result = value ? PyObject_SetItem(obj, py_slice, value) : PyObject_DelItem(obj, py_slice); #endif if (!_py_slice) { Py_DECREF(py_slice); } return result; } PyErr_Format(PyExc_TypeError, "'%.200s' object does not support slice %.10s", Py_TYPE(obj)->tp_name, value ? "assignment" : "deletion"); bad: return -1; } static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop, PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice, int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) { #if CYTHON_COMPILING_IN_CPYTHON PyMappingMethods* mp; #if PY_MAJOR_VERSION < 3 PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence; if (likely(ms && ms->sq_slice)) { if (!has_cstart) { if (_py_start && (*_py_start != Py_None)) { cstart = __Pyx_PyIndex_AsSsize_t(*_py_start); if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; } else cstart = 0; } if (!has_cstop) { if (_py_stop && (*_py_stop != Py_None)) { cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop); if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; } else cstop = PY_SSIZE_T_MAX; } if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) { Py_ssize_t l = ms->sq_length(obj); if (likely(l >= 0)) { if (cstop < 0) { cstop += l; if (cstop < 0) cstop = 0; } if (cstart < 0) { cstart += l; if (cstart < 0) cstart = 0; } } else { if (PyErr_ExceptionMatches(PyExc_OverflowError)) PyErr_Clear(); else goto bad; } } return ms->sq_slice(obj, cstart, cstop); } #endif mp = Py_TYPE(obj)->tp_as_mapping; if (likely(mp && mp->mp_subscript)) #endif { PyObject* result; PyObject *py_slice, *py_start, *py_stop; if (_py_slice) { py_slice = *_py_slice; } else { PyObject* owned_start = NULL; PyObject* owned_stop = NULL; if (_py_start) { py_start = *_py_start; } else { if (has_cstart) { owned_start = py_start = PyInt_FromSsize_t(cstart); if (unlikely(!py_start)) goto bad; } else py_start = Py_None; } if (_py_stop) { py_stop = *_py_stop; } else { if (has_cstop) { owned_stop = py_stop = PyInt_FromSsize_t(cstop); if (unlikely(!py_stop)) { Py_XDECREF(owned_start); goto bad; } } else py_stop = Py_None; } py_slice = PySlice_New(py_start, py_stop, Py_None); Py_XDECREF(owned_start); Py_XDECREF(owned_stop); if (unlikely(!py_slice)) goto bad; } #if CYTHON_COMPILING_IN_CPYTHON result = mp->mp_subscript(obj, py_slice); #else result = PyObject_GetItem(obj, py_slice); #endif if (!_py_slice) { Py_DECREF(py_slice); } return result; } PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", Py_TYPE(obj)->tp_name); bad: return NULL; } static CYTHON_INLINE long __Pyx_div_long(long a, long b) { long q = a / b; long r = a - q*b; q -= ((r != 0) & ((r ^ b) < 0)); return q; } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { PyObject *r; if (!j) return NULL; r = PyObject_GetItem(o, j); Py_DECREF(j); return r; } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_COMPILING_IN_CPYTHON if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o); if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { PyObject *r = PyList_GET_ITEM(o, i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_COMPILING_IN_CPYTHON if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o); if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_COMPILING_IN_CPYTHON if (is_list || PyList_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) { PyObject *r = PyList_GET_ITEM(o, n); Py_INCREF(r); return r; } } else if (PyTuple_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, n); Py_INCREF(r); return r; } } else { PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; if (likely(m && m->sq_item)) { if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { Py_ssize_t l = m->sq_length(o); if (likely(l >= 0)) { i += l; } else { if (PyErr_ExceptionMatches(PyExc_OverflowError)) PyErr_Clear(); else return NULL; } } return m->sq_item(o, i); } } #else if (is_list || PySequence_Check(o)) { return PySequence_GetItem(o, i); } #endif return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); } static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) { #if CYTHON_COMPILING_IN_CPYTHON PyThreadState *tstate = PyThreadState_GET(); *type = tstate->exc_type; *value = tstate->exc_value; *tb = tstate->exc_traceback; Py_XINCREF(*type); Py_XINCREF(*value); Py_XINCREF(*tb); #else PyErr_GetExcInfo(type, value, tb); #endif } static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) { #if CYTHON_COMPILING_IN_CPYTHON PyObject *tmp_type, *tmp_value, *tmp_tb; PyThreadState *tstate = PyThreadState_GET(); tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = type; tstate->exc_value = value; tstate->exc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #else PyErr_SetExcInfo(type, value, tb); #endif } static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) { PyObject *local_type, *local_value, *local_tb; #if CYTHON_COMPILING_IN_CPYTHON PyObject *tmp_type, *tmp_value, *tmp_tb; PyThreadState *tstate = PyThreadState_GET(); local_type = tstate->curexc_type; local_value = tstate->curexc_value; local_tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #else PyErr_Fetch(&local_type, &local_value, &local_tb); #endif PyErr_NormalizeException(&local_type, &local_value, &local_tb); #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(tstate->curexc_type)) #else if (unlikely(PyErr_Occurred())) #endif goto bad; #if PY_MAJOR_VERSION >= 3 if (local_tb) { if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) goto bad; } #endif Py_XINCREF(local_tb); Py_XINCREF(local_type); Py_XINCREF(local_value); *type = local_type; *value = local_value; *tb = local_tb; #if CYTHON_COMPILING_IN_CPYTHON tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = local_type; tstate->exc_value = local_value; tstate->exc_traceback = local_tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #else PyErr_SetExcInfo(local_type, local_value, local_tb); #endif return 0; bad: *type = 0; *value = 0; *tb = 0; Py_XDECREF(local_type); Py_XDECREF(local_value); Py_XDECREF(local_tb); return -1; } #if CYTHON_USE_PYLONG_INTERNALS #include "longintrepr.h" #endif #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) { if (op1 == op2) { Py_RETURN_TRUE; } #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op1))) { const long b = intval; long a = PyInt_AS_LONG(op1); if (a == b) { Py_RETURN_TRUE; } else { Py_RETURN_FALSE; } } #endif #if CYTHON_USE_PYLONG_INTERNALS && PY_MAJOR_VERSION >= 3 if (likely(PyLong_CheckExact(op1))) { const long b = intval; long a; const digit* digits = ((PyLongObject*)op1)->ob_digit; const Py_ssize_t size = Py_SIZE(op1); if (likely(__Pyx_sst_abs(size) <= 1)) { a = likely(size) ? digits[0] : 0; if (size == -1) a = -a; } else { switch (size) { case -2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } case 2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } case -3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } case 3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } case -4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } case 4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; } #if PyLong_SHIFT < 30 && PyLong_SHIFT != 15 default: return PyLong_Type.tp_richcompare(op1, op2, Py_EQ); #else default: Py_RETURN_FALSE; #endif } } if (a == b) { Py_RETURN_TRUE; } else { Py_RETURN_FALSE; } } #endif if (PyFloat_CheckExact(op1)) { const long b = intval; double a = PyFloat_AS_DOUBLE(op1); if ((double)a == (double)b) { Py_RETURN_TRUE; } else { Py_RETURN_FALSE; } } return PyObject_RichCompare(op1, op2, Py_EQ); } #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = PyCFunction_GET_FUNCTION(func); self = PyCFunction_GET_SELF(func); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *result; PyObject *args = PyTuple_New(1); if (unlikely(!args)) return NULL; Py_INCREF(arg); PyTuple_SET_ITEM(args, 0, arg); result = __Pyx_PyObject_Call(func, args, NULL); Py_DECREF(args); return result; } static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { #ifdef __Pyx_CyFunction_USED if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { #else if (likely(PyCFunction_Check(func))) { #endif if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { return __Pyx_PyObject_CallMethO(func, arg); } } return __Pyx__PyObject_CallOneArg(func, arg); } #else static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject* args = PyTuple_Pack(1, arg); return (likely(args)) ? __Pyx_PyObject_Call(func, args, NULL) : NULL; } #endif static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) { PyObject *method, *result = NULL; method = __Pyx_PyObject_GetAttrStr(obj, method_name); if (unlikely(!method)) goto bad; #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyMethod_Check(method))) { PyObject *self = PyMethod_GET_SELF(method); if (likely(self)) { PyObject *args; PyObject *function = PyMethod_GET_FUNCTION(method); args = PyTuple_New(2); if (unlikely(!args)) goto bad; Py_INCREF(self); PyTuple_SET_ITEM(args, 0, self); Py_INCREF(arg); PyTuple_SET_ITEM(args, 1, arg); Py_INCREF(function); Py_DECREF(method); method = NULL; result = __Pyx_PyObject_Call(function, args, NULL); Py_DECREF(args); Py_DECREF(function); return result; } } #endif result = __Pyx_PyObject_CallOneArg(method, arg); bad: Py_XDECREF(method); return result; } static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) { if (likely(PyList_CheckExact(L))) { if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return -1; } else { PyObject* retval = __Pyx_PyObject_CallMethod1(L, __pyx_n_s_append, x); if (unlikely(!retval)) return -1; Py_DECREF(retval); } return 0; } static CYTHON_INLINE intptr_t __Pyx_mod_intptr_t(intptr_t a, intptr_t b) { intptr_t r = a % b; r += ((r != 0) & ((r ^ b) < 0)) * b; return r; } static double __Pyx__PyObject_AsDouble(PyObject* obj) { PyObject* float_value; #if CYTHON_COMPILING_IN_PYPY float_value = PyNumber_Float(obj); if (0) goto bad; #else PyNumberMethods *nb = Py_TYPE(obj)->tp_as_number; if (likely(nb) && likely(nb->nb_float)) { float_value = nb->nb_float(obj); if (likely(float_value) && unlikely(!PyFloat_Check(float_value))) { PyErr_Format(PyExc_TypeError, "__float__ returned non-float (type %.200s)", Py_TYPE(float_value)->tp_name); Py_DECREF(float_value); goto bad; } } else if (PyUnicode_CheckExact(obj) || PyBytes_CheckExact(obj)) { #if PY_MAJOR_VERSION >= 3 float_value = PyFloat_FromString(obj); #else float_value = PyFloat_FromString(obj, 0); #endif } else { PyObject* args = PyTuple_New(1); if (unlikely(!args)) goto bad; PyTuple_SET_ITEM(args, 0, obj); float_value = PyObject_Call((PyObject*)&PyFloat_Type, args, 0); PyTuple_SET_ITEM(args, 0, 0); Py_DECREF(args); } #endif if (likely(float_value)) { double value = PyFloat_AS_DOUBLE(float_value); Py_DECREF(float_value); return value; } bad: return (double)-1; } static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY return PyObject_RichCompareBool(s1, s2, equals); #else if (s1 == s2) { return (equals == Py_EQ); } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { const char *ps1, *ps2; Py_ssize_t length = PyBytes_GET_SIZE(s1); if (length != PyBytes_GET_SIZE(s2)) return (equals == Py_NE); ps1 = PyBytes_AS_STRING(s1); ps2 = PyBytes_AS_STRING(s2); if (ps1[0] != ps2[0]) { return (equals == Py_NE); } else if (length == 1) { return (equals == Py_EQ); } else { int result = memcmp(ps1, ps2, (size_t)length); return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { return (equals == Py_NE); } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { return (equals == Py_NE); } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } #endif } static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY return PyObject_RichCompareBool(s1, s2, equals); #else #if PY_MAJOR_VERSION < 3 PyObject* owned_ref = NULL; #endif int s1_is_unicode, s2_is_unicode; if (s1 == s2) { goto return_eq; } s1_is_unicode = PyUnicode_CheckExact(s1); s2_is_unicode = PyUnicode_CheckExact(s2); #if PY_MAJOR_VERSION < 3 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { owned_ref = PyUnicode_FromObject(s2); if (unlikely(!owned_ref)) return -1; s2 = owned_ref; s2_is_unicode = 1; } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { owned_ref = PyUnicode_FromObject(s1); if (unlikely(!owned_ref)) return -1; s1 = owned_ref; s1_is_unicode = 1; } else if (((!s2_is_unicode) & (!s1_is_unicode))) { return __Pyx_PyBytes_Equals(s1, s2, equals); } #endif if (s1_is_unicode & s2_is_unicode) { Py_ssize_t length; int kind; void *data1, *data2; if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) return -1; length = __Pyx_PyUnicode_GET_LENGTH(s1); if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { goto return_ne; } kind = __Pyx_PyUnicode_KIND(s1); if (kind != __Pyx_PyUnicode_KIND(s2)) { goto return_ne; } data1 = __Pyx_PyUnicode_DATA(s1); data2 = __Pyx_PyUnicode_DATA(s2); if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { goto return_ne; } else if (length == 1) { goto return_eq; } else { int result = memcmp(data1, data2, (size_t)(length * kind)); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & s2_is_unicode) { goto return_ne; } else if ((s2 == Py_None) & s1_is_unicode) { goto return_ne; } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } return_eq: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ); return_ne: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_NE); #endif } #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { #ifdef __Pyx_CyFunction_USED if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { #else if (likely(PyCFunction_Check(func))) { #endif if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { return __Pyx_PyObject_CallMethO(func, NULL); } } return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); } #endif static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; #if CYTHON_COMPILING_IN_CPYTHON PyThreadState *tstate = PyThreadState_GET(); tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = *type; tstate->exc_value = *value; tstate->exc_traceback = *tb; #else PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb); PyErr_SetExcInfo(*type, *value, *tb); #endif *type = tmp_type; *value = tmp_value; *tb = tmp_tb; } static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { PyErr_Format(PyExc_ValueError, "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); } static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { PyErr_Format(PyExc_ValueError, "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", index, (index == 1) ? "" : "s"); } static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); } static int __Pyx_SetVtable(PyObject *dict, void *vtable) { #if PY_VERSION_HEX >= 0x02070000 PyObject *ob = PyCapsule_New(vtable, 0, 0); #else PyObject *ob = PyCObject_FromVoidPtr(vtable, 0); #endif if (!ob) goto bad; if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0) goto bad; Py_DECREF(ob); return 0; bad: Py_XDECREF(ob); return -1; } static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *empty_list = 0; PyObject *module = 0; PyObject *global_dict = 0; PyObject *empty_dict = 0; PyObject *list; #if PY_VERSION_HEX < 0x03030000 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (!py_import) goto bad; #endif if (from_list) list = from_list; else { empty_list = PyList_New(0); if (!empty_list) goto bad; list = empty_list; } global_dict = PyModule_GetDict(__pyx_m); if (!global_dict) goto bad; empty_dict = PyDict_New(); if (!empty_dict) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.')) { #if PY_VERSION_HEX < 0x03030000 PyObject *py_level = PyInt_FromLong(1); if (!py_level) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, py_level, NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, 1); #endif if (!module) { if (!PyErr_ExceptionMatches(PyExc_ImportError)) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_VERSION_HEX < 0x03030000 PyObject *py_level = PyInt_FromLong(level); if (!py_level) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, py_level, NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, level); #endif } } bad: #if PY_VERSION_HEX < 0x03030000 Py_XDECREF(py_import); #endif Py_XDECREF(empty_list); Py_XDECREF(empty_dict); return module; } static PyObject *__Pyx_GetNameInClass(PyObject *nmspace, PyObject *name) { PyObject *result; result = __Pyx_PyObject_GetAttrStr(nmspace, name); if (!result) result = __Pyx_GetModuleGlobalName(name); return result; } static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #include "compile.h" #include "frameobject.h" #include "traceback.h" static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyObject *py_srcfile = 0; PyObject *py_funcname = 0; #if PY_MAJOR_VERSION < 3 py_srcfile = PyString_FromString(filename); #else py_srcfile = PyUnicode_FromString(filename); #endif if (!py_srcfile) goto bad; if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); #else py_funcname = PyUnicode_FromString(funcname); #endif } if (!py_funcname) goto bad; py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); Py_DECREF(py_funcname); return py_code; bad: Py_XDECREF(py_srcfile); Py_XDECREF(py_funcname); return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; py_code = __pyx_find_code_object(c_line ? c_line : py_line); if (!py_code) { py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) goto bad; __pyx_insert_code_object(c_line ? c_line : py_line, py_code); } py_frame = PyFrame_New( PyThreadState_GET(), /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; py_frame->f_lineno = py_line; PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { const int neg_one = (int) -1, const_zero = (int) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(int) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); } } #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } static CYTHON_INLINE unsigned int __Pyx_PyInt_As_unsigned_int(PyObject *x) { const unsigned int neg_one = (unsigned int) -1, const_zero = (unsigned int) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(unsigned int) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(unsigned int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (unsigned int) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (unsigned int) 0; case 1: __PYX_VERIFY_RETURN_INT(unsigned int, digit, digits[0]) case 2: if (8 * sizeof(unsigned int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(unsigned int) >= 2 * PyLong_SHIFT) { return (unsigned int) (((((unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])); } } break; case 3: if (8 * sizeof(unsigned int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(unsigned int) >= 3 * PyLong_SHIFT) { return (unsigned int) (((((((unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])); } } break; case 4: if (8 * sizeof(unsigned int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(unsigned int) >= 4 * PyLong_SHIFT) { return (unsigned int) (((((((((unsigned int)digits[3]) << PyLong_SHIFT) | (unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (unsigned int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(unsigned int) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(unsigned int, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(unsigned int) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(unsigned int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (unsigned int) 0; case -1: __PYX_VERIFY_RETURN_INT(unsigned int, sdigit, -(sdigit) digits[0]) case 1: __PYX_VERIFY_RETURN_INT(unsigned int, digit, +digits[0]) case -2: if (8 * sizeof(unsigned int) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(unsigned int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(unsigned int) - 1 > 2 * PyLong_SHIFT) { return (unsigned int) (((unsigned int)-1)*(((((unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]))); } } break; case 2: if (8 * sizeof(unsigned int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(unsigned int) - 1 > 2 * PyLong_SHIFT) { return (unsigned int) ((((((unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]))); } } break; case -3: if (8 * sizeof(unsigned int) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(unsigned int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(unsigned int) - 1 > 3 * PyLong_SHIFT) { return (unsigned int) (((unsigned int)-1)*(((((((unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]))); } } break; case 3: if (8 * sizeof(unsigned int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(unsigned int) - 1 > 3 * PyLong_SHIFT) { return (unsigned int) ((((((((unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]))); } } break; case -4: if (8 * sizeof(unsigned int) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(unsigned int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(unsigned int) - 1 > 4 * PyLong_SHIFT) { return (unsigned int) (((unsigned int)-1)*(((((((((unsigned int)digits[3]) << PyLong_SHIFT) | (unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]))); } } break; case 4: if (8 * sizeof(unsigned int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(unsigned int) - 1 > 4 * PyLong_SHIFT) { return (unsigned int) ((((((((((unsigned int)digits[3]) << PyLong_SHIFT) | (unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]))); } } break; } #endif if (sizeof(unsigned int) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(unsigned int, long, PyLong_AsLong(x)) } else if (sizeof(unsigned int) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(unsigned int, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else unsigned int val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (unsigned int) -1; } } else { unsigned int val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (unsigned int) -1; val = __Pyx_PyInt_As_unsigned_int(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to unsigned int"); return (unsigned int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to unsigned int"); return (unsigned int) -1; } static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { const int neg_one = (int) -1, const_zero = (int) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(int) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(int) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, -(sdigit) digits[0]) case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) case -2: if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } #endif if (sizeof(int) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else int val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (int) -1; } } else { int val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int64_t(int64_t value) { const int64_t neg_one = (int64_t) -1, const_zero = (int64_t) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int64_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int64_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(int64_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(int64_t) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int64_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(int64_t), little, !is_unsigned); } } static CYTHON_INLINE int64_t __Pyx_PyInt_As_int64_t(PyObject *x) { const int64_t neg_one = (int64_t) -1, const_zero = (int64_t) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(int64_t) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(int64_t, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int64_t) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int64_t) 0; case 1: __PYX_VERIFY_RETURN_INT(int64_t, digit, digits[0]) case 2: if (8 * sizeof(int64_t) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int64_t) >= 2 * PyLong_SHIFT) { return (int64_t) (((((int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0])); } } break; case 3: if (8 * sizeof(int64_t) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int64_t) >= 3 * PyLong_SHIFT) { return (int64_t) (((((((int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0])); } } break; case 4: if (8 * sizeof(int64_t) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int64_t) >= 4 * PyLong_SHIFT) { return (int64_t) (((((((((int64_t)digits[3]) << PyLong_SHIFT) | (int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int64_t) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(int64_t) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(int64_t, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(int64_t) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int64_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int64_t) 0; case -1: __PYX_VERIFY_RETURN_INT(int64_t, sdigit, -(sdigit) digits[0]) case 1: __PYX_VERIFY_RETURN_INT(int64_t, digit, +digits[0]) case -2: if (8 * sizeof(int64_t) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int64_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int64_t) - 1 > 2 * PyLong_SHIFT) { return (int64_t) (((int64_t)-1)*(((((int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]))); } } break; case 2: if (8 * sizeof(int64_t) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int64_t) - 1 > 2 * PyLong_SHIFT) { return (int64_t) ((((((int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]))); } } break; case -3: if (8 * sizeof(int64_t) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int64_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int64_t) - 1 > 3 * PyLong_SHIFT) { return (int64_t) (((int64_t)-1)*(((((((int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]))); } } break; case 3: if (8 * sizeof(int64_t) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int64_t) - 1 > 3 * PyLong_SHIFT) { return (int64_t) ((((((((int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]))); } } break; case -4: if (8 * sizeof(int64_t) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int64_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int64_t) - 1 > 4 * PyLong_SHIFT) { return (int64_t) (((int64_t)-1)*(((((((((int64_t)digits[3]) << PyLong_SHIFT) | (int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]))); } } break; case 4: if (8 * sizeof(int64_t) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int64_t) - 1 > 4 * PyLong_SHIFT) { return (int64_t) ((((((((((int64_t)digits[3]) << PyLong_SHIFT) | (int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]))); } } break; } #endif if (sizeof(int64_t) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(int64_t, long, PyLong_AsLong(x)) } else if (sizeof(int64_t) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int64_t, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else int64_t val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (int64_t) -1; } } else { int64_t val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (int64_t) -1; val = __Pyx_PyInt_As_int64_t(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int64_t"); return (int64_t) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int64_t"); return (int64_t) -1; } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); } } static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_int(unsigned int value) { const unsigned int neg_one = (unsigned int) -1, const_zero = (unsigned int) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(unsigned int) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(unsigned int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(unsigned int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(unsigned int) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(unsigned int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(unsigned int), little, !is_unsigned); } } #if CYTHON_CCOMPLEX #ifdef __cplusplus static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { return ::std::complex< float >(x, y); } #else static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { return x + y*(__pyx_t_float_complex)_Complex_I; } #endif #else static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { __pyx_t_float_complex z; z.real = x; z.imag = y; return z; } #endif #if CYTHON_CCOMPLEX #else static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex a, __pyx_t_float_complex b) { return (a.real == b.real) && (a.imag == b.imag); } static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex a, __pyx_t_float_complex b) { __pyx_t_float_complex z; z.real = a.real + b.real; z.imag = a.imag + b.imag; return z; } static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex a, __pyx_t_float_complex b) { __pyx_t_float_complex z; z.real = a.real - b.real; z.imag = a.imag - b.imag; return z; } static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex a, __pyx_t_float_complex b) { __pyx_t_float_complex z; z.real = a.real * b.real - a.imag * b.imag; z.imag = a.real * b.imag + a.imag * b.real; return z; } static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex a, __pyx_t_float_complex b) { __pyx_t_float_complex z; float denom = b.real * b.real + b.imag * b.imag; z.real = (a.real * b.real + a.imag * b.imag) / denom; z.imag = (a.imag * b.real - a.real * b.imag) / denom; return z; } static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex a) { __pyx_t_float_complex z; z.real = -a.real; z.imag = -a.imag; return z; } static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex a) { return (a.real == 0) && (a.imag == 0); } static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex a) { __pyx_t_float_complex z; z.real = a.real; z.imag = -a.imag; return z; } #if 1 static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex z) { #if !defined(HAVE_HYPOT) || defined(_MSC_VER) return sqrtf(z.real*z.real + z.imag*z.imag); #else return hypotf(z.real, z.imag); #endif } static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex a, __pyx_t_float_complex b) { __pyx_t_float_complex z; float r, lnr, theta, z_r, z_theta; if (b.imag == 0 && b.real == (int)b.real) { if (b.real < 0) { float denom = a.real * a.real + a.imag * a.imag; a.real = a.real / denom; a.imag = -a.imag / denom; b.real = -b.real; } switch ((int)b.real) { case 0: z.real = 1; z.imag = 0; return z; case 1: return a; case 2: z = __Pyx_c_prodf(a, a); return __Pyx_c_prodf(a, a); case 3: z = __Pyx_c_prodf(a, a); return __Pyx_c_prodf(z, a); case 4: z = __Pyx_c_prodf(a, a); return __Pyx_c_prodf(z, z); } } if (a.imag == 0) { if (a.real == 0) { return a; } r = a.real; theta = 0; } else { r = __Pyx_c_absf(a); theta = atan2f(a.imag, a.real); } lnr = logf(r); z_r = expf(lnr * b.real - theta * b.imag); z_theta = theta * b.real + lnr * b.imag; z.real = z_r * cosf(z_theta); z.imag = z_r * sinf(z_theta); return z; } #endif #endif #if CYTHON_CCOMPLEX #ifdef __cplusplus static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { return ::std::complex< double >(x, y); } #else static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { return x + y*(__pyx_t_double_complex)_Complex_I; } #endif #else static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { __pyx_t_double_complex z; z.real = x; z.imag = y; return z; } #endif #if CYTHON_CCOMPLEX #else static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex a, __pyx_t_double_complex b) { return (a.real == b.real) && (a.imag == b.imag); } static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex a, __pyx_t_double_complex b) { __pyx_t_double_complex z; z.real = a.real + b.real; z.imag = a.imag + b.imag; return z; } static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex a, __pyx_t_double_complex b) { __pyx_t_double_complex z; z.real = a.real - b.real; z.imag = a.imag - b.imag; return z; } static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex a, __pyx_t_double_complex b) { __pyx_t_double_complex z; z.real = a.real * b.real - a.imag * b.imag; z.imag = a.real * b.imag + a.imag * b.real; return z; } static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex a, __pyx_t_double_complex b) { __pyx_t_double_complex z; double denom = b.real * b.real + b.imag * b.imag; z.real = (a.real * b.real + a.imag * b.imag) / denom; z.imag = (a.imag * b.real - a.real * b.imag) / denom; return z; } static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex a) { __pyx_t_double_complex z; z.real = -a.real; z.imag = -a.imag; return z; } static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex a) { return (a.real == 0) && (a.imag == 0); } static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex a) { __pyx_t_double_complex z; z.real = a.real; z.imag = -a.imag; return z; } #if 1 static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex z) { #if !defined(HAVE_HYPOT) || defined(_MSC_VER) return sqrt(z.real*z.real + z.imag*z.imag); #else return hypot(z.real, z.imag); #endif } static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex a, __pyx_t_double_complex b) { __pyx_t_double_complex z; double r, lnr, theta, z_r, z_theta; if (b.imag == 0 && b.real == (int)b.real) { if (b.real < 0) { double denom = a.real * a.real + a.imag * a.imag; a.real = a.real / denom; a.imag = -a.imag / denom; b.real = -b.real; } switch ((int)b.real) { case 0: z.real = 1; z.imag = 0; return z; case 1: return a; case 2: z = __Pyx_c_prod(a, a); return __Pyx_c_prod(a, a); case 3: z = __Pyx_c_prod(a, a); return __Pyx_c_prod(z, a); case 4: z = __Pyx_c_prod(a, a); return __Pyx_c_prod(z, z); } } if (a.imag == 0) { if (a.real == 0) { return a; } r = a.real; theta = 0; } else { r = __Pyx_c_abs(a); theta = atan2(a.imag, a.real); } lnr = log(r); z_r = exp(lnr * b.real - theta * b.imag); z_theta = theta * b.real + lnr * b.imag; z.real = z_r * cos(z_theta); z.imag = z_r * sin(z_theta); return z; } #endif #endif static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value) { const enum NPY_TYPES neg_one = (enum NPY_TYPES) -1, const_zero = (enum NPY_TYPES) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(enum NPY_TYPES) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); } } else { if (sizeof(enum NPY_TYPES) <= sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(enum NPY_TYPES) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(enum NPY_TYPES), little, !is_unsigned); } } static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(long) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(long) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, -(sdigit) digits[0]) case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) case -2: if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } #endif if (sizeof(long) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else long val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (long) -1; } } else { long val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } static int __Pyx_check_binary_version(void) { char ctversion[4], rtversion[4]; PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { char message[200]; PyOS_snprintf(message, sizeof(message), "compiletime version %s of module '%.100s' " "does not match runtime version %s", ctversion, __Pyx_MODULE_NAME, rtversion); return PyErr_WarnEx(NULL, message, 1); } return 0; } #ifndef __PYX_HAVE_RT_ImportModule #define __PYX_HAVE_RT_ImportModule static PyObject *__Pyx_ImportModule(const char *name) { PyObject *py_name = 0; PyObject *py_module = 0; py_name = __Pyx_PyIdentifier_FromString(name); if (!py_name) goto bad; py_module = PyImport_Import(py_name); Py_DECREF(py_name); return py_module; bad: Py_XDECREF(py_name); return 0; } #endif #ifndef __PYX_HAVE_RT_ImportType #define __PYX_HAVE_RT_ImportType static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict) { PyObject *py_module = 0; PyObject *result = 0; PyObject *py_name = 0; char warning[200]; Py_ssize_t basicsize; #ifdef Py_LIMITED_API PyObject *py_basicsize; #endif py_module = __Pyx_ImportModule(module_name); if (!py_module) goto bad; py_name = __Pyx_PyIdentifier_FromString(class_name); if (!py_name) goto bad; result = PyObject_GetAttr(py_module, py_name); Py_DECREF(py_name); py_name = 0; Py_DECREF(py_module); py_module = 0; if (!result) goto bad; if (!PyType_Check(result)) { PyErr_Format(PyExc_TypeError, "%.200s.%.200s is not a type object", module_name, class_name); goto bad; } #ifndef Py_LIMITED_API basicsize = ((PyTypeObject *)result)->tp_basicsize; #else py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); if (!py_basicsize) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; #endif if (!strict && (size_t)basicsize > size) { PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility", module_name, class_name); if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; } else if ((size_t)basicsize != size) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s has the wrong size, try recompiling", module_name, class_name); goto bad; } return (PyTypeObject *)result; bad: Py_XDECREF(py_module); Py_XDECREF(result); return NULL; } #endif static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION < 3 if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } #else if (t->is_unicode | t->is_str) { if (t->intern) { *t->p = PyUnicode_InternFromString(t->s); } else if (t->encoding) { *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); } else { *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); } } else { *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); } #endif if (!*t->p) return -1; ++t; } return 0; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); } static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { #if PY_VERSION_HEX < 0x03030000 char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; #else if (__Pyx_PyUnicode_READY(o) == -1) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (PyUnicode_IS_ASCII(o)) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif #endif } else #endif #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { PyNumberMethods *m; const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (PyInt_Check(x) || PyLong_Check(x)) #else if (PyLong_Check(x)) #endif return __Pyx_NewRef(x); m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = PyNumber_Int(x); } else if (m && m->nb_long) { name = "long"; res = PyNumber_Long(x); } #else if (m && m->nb_int) { name = "int"; res = PyNumber_Long(x); } #endif if (res) { #if PY_MAJOR_VERSION < 3 if (!PyInt_Check(res) && !PyLong_Check(res)) { #else if (!PyLong_Check(res)) { #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type %.200s)", name, name, Py_TYPE(res)->tp_name); Py_DECREF(res); return NULL; } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(x); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)b)->ob_digit; const Py_ssize_t size = Py_SIZE(b); if (likely(__Pyx_sst_abs(size) <= 1)) { ival = likely(size) ? digits[0] : 0; if (size == -1) ival = -ival; return ival; } else { switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } #endif /* Py_PYTHON_H */ pyFFTW-0.10.1/pyfftw/builders/0000775000175000017500000000000012652703650015444 5ustar whgwhg00000000000000pyFFTW-0.10.1/pyfftw/builders/_utils.py0000664000175000017500000003261112570060606017314 0ustar whgwhg00000000000000#!/usr/bin/env python # # Copyright 2014 Knowledge Economy Developments Ltd # Copyright 2014 David Wells # # Henry Gomersall # heng@kedevelopments.co.uk # David Wells # drwells vt.edu # # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, this # list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright notice, # this list of conditions and the following disclaimer in the documentation # and/or other materials provided with the distribution. # # * Neither the name of the copyright holder nor the names of its contributors # may be used to endorse or promote products derived from this software without # specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. # ''' A set of utility functions for use with the builders. Users should not need to use the functions directly, but they are included here for completeness and to aid with understanding of what is happening behind the scenes. Certainly, users may encounter instances of :class:`~pyfftw.builders._utils._FFTWWrapper`. These everything documented in this module is *not* part of the public API and may change in future versions. ''' import pyfftw import numpy __all__ = ['_FFTWWrapper', '_rc_dtype_pairs', '_default_dtype', '_Xfftn', '_setup_input_slicers', '_compute_array_shapes', '_precook_1d_args', '_cook_nd_args'] _valid_efforts = ('FFTW_ESTIMATE', 'FFTW_MEASURE', 'FFTW_PATIENT', 'FFTW_EXHAUSTIVE') # Looking up a dtype in here returns the complex complement of the same # precision. # It is necessary to use .char as the keys due to MSVC mapping long # double to double and the way that numpy handles this. _rc_dtype_pairs = {numpy.dtype('float32').char: numpy.dtype('complex64'), numpy.dtype('float64').char: numpy.dtype('complex128'), numpy.dtype('longdouble').char: numpy.dtype('clongdouble'), numpy.dtype('complex64').char: numpy.dtype('float32'), numpy.dtype('complex128').char: numpy.dtype('float64'), numpy.dtype('clongdouble').char: numpy.dtype('longdouble')} _default_dtype = numpy.dtype('float64') def _Xfftn(a, s, axes, overwrite_input, planner_effort, threads, auto_align_input, auto_contiguous, avoid_copy, inverse, real): '''Generic transform interface for all the transforms. No defaults exist. The transform must be specified exactly. ''' a_orig = a invreal = inverse and real if inverse: direction = 'FFTW_BACKWARD' else: direction = 'FFTW_FORWARD' if planner_effort not in _valid_efforts: raise ValueError('Invalid planner effort: ', planner_effort) s, axes = _cook_nd_args(a, s, axes, invreal) input_shape, output_shape = _compute_array_shapes( a, s, axes, inverse, real) a_is_complex = numpy.iscomplexobj(a) # Make the input dtype correct if a.dtype.char not in _rc_dtype_pairs: # We make it the default dtype if not real or inverse: # It's going to be complex a = numpy.asarray(a, dtype=_rc_dtype_pairs[_default_dtype.char]) else: a = numpy.asarray(a, dtype=_default_dtype) elif not (real and not inverse) and not a_is_complex: # We need to make it a complex dtype a = numpy.asarray(a, dtype=_rc_dtype_pairs[a.dtype.char]) elif (real and not inverse) and a_is_complex: # It should be real a = numpy.asarray(a, dtype=_rc_dtype_pairs[a.dtype.char]) # Make the output dtype correct if not real: output_dtype = a.dtype else: output_dtype = _rc_dtype_pairs[a.dtype.char] if not avoid_copy: a_copy = a.copy() output_array = pyfftw.empty_aligned(output_shape, output_dtype) flags = [planner_effort] if not auto_align_input: flags.append('FFTW_UNALIGNED') if overwrite_input: flags.append('FFTW_DESTROY_INPUT') if not a.shape == input_shape: if avoid_copy: raise ValueError('Cannot avoid copy: ' 'The transform shape is not the same as the array size. ' '(from avoid_copy flag)') # This means we need to use an _FFTWWrapper object # and so need to create slicers. update_input_array_slicer, FFTW_array_slicer = ( _setup_input_slicers(a.shape, input_shape)) # Also, the input array will be a different shape to the shape of # `a`, so we need to create a new array. input_array = pyfftw.empty_aligned(input_shape, a.dtype) FFTW_object = _FFTWWrapper(input_array, output_array, axes, direction, flags, threads, input_array_slicer=update_input_array_slicer, FFTW_array_slicer=FFTW_array_slicer) # We copy the data back into the internal FFTW object array internal_array = FFTW_object.input_array internal_array[:] = 0 internal_array[FFTW_array_slicer] = ( a_copy[update_input_array_slicer]) else: # Otherwise we can use `a` as-is input_array = a if auto_contiguous: # We only need to create a new array if it's not already # contiguous if not (a.flags['C_CONTIGUOUS'] or a.flags['F_CONTIGUOUS']): if avoid_copy: raise ValueError('Cannot avoid copy: ' 'The input array is not contiguous and ' 'auto_contiguous is set. (from avoid_copy flag)') input_array = pyfftw.empty_aligned(a.shape, a.dtype) if (auto_align_input and not pyfftw.is_byte_aligned(input_array)): if avoid_copy: raise ValueError('Cannot avoid copy: ' 'The input array is not aligned and ' 'auto_align is set. (from avoid_copy flag)') input_array = pyfftw.byte_align(input_array) FFTW_object = pyfftw.FFTW(input_array, output_array, axes, direction, flags, threads) if not avoid_copy: # Copy the data back into the (likely) destroyed array FFTW_object.input_array[:] = a_copy return FFTW_object class _FFTWWrapper(pyfftw.FFTW): ''' A class that wraps :class:`pyfftw.FFTW`, providing a slicer on the input stage during calls to :meth:`~pyfftw.builders._utils._FFTWWrapper.__call__`. ''' def __init__(self, input_array, output_array, axes=[-1], direction='FFTW_FORWARD', flags=['FFTW_MEASURE'], threads=1, input_array_slicer=None, FFTW_array_slicer=None): '''The arguments are as per :class:`pyfftw.FFTW`, but with the addition of 2 keyword arguments: ``input_array_slicer`` and ``FFTW_array_slicer``. These arguments represent 2 slicers: ``input_array_slicer`` slices the input array that is passed in during a call to instances of this class, and ``FFTW_array_slicer`` slices the internal array. The arrays that are returned from both of these slicing operations should be the same size. The data is then copied from the sliced input array into the sliced internal array. ''' self._input_array_slicer = input_array_slicer self._FFTW_array_slicer = FFTW_array_slicer if 'FFTW_DESTROY_INPUT' in flags: self._input_destroyed = True else: self._input_destroyed = False pyfftw.FFTW.__init__(self, input_array, output_array, axes, direction, flags, threads) def __call__(self, input_array=None, output_array=None, normalise_idft=True): '''Wrap :meth:`pyfftw.FFTW.__call__` by firstly slicing the passed-in input array and then copying it into a sliced version of the internal array. These slicers are set at instantiation. When input array is not ``None``, this method always results in a copy. Consequently, the alignment and dtype are maintained in the internal array. ``output_array`` and ``normalise_idft`` are passed through to :meth:`pyfftw.FFTW.__call__` untouched. ''' if input_array is not None: # Do the update here (which is a copy, so it's alignment # safe etc). internal_input_array = self.input_array input_array = numpy.asanyarray(input_array) if self._input_destroyed: internal_input_array[:] = 0 sliced_internal = internal_input_array[self._FFTW_array_slicer] sliced_input = input_array[self._input_array_slicer] if sliced_internal.shape != sliced_input.shape: raise ValueError('Invalid input shape: ' 'The new input array should be the same shape ' 'as the input array used to instantiate the ' 'object.') sliced_internal[:] = sliced_input output = super(_FFTWWrapper, self).__call__(input_array=None, output_array=output_array, normalise_idft=normalise_idft) return output def _setup_input_slicers(a_shape, input_shape): ''' This function returns two slicers that are to be used to copy the data from the input array to the FFTW object internal array, which can then be passed to _FFTWWrapper: ``(update_input_array_slicer, FFTW_array_slicer)`` On calls to :class:`~pyfftw.builders._utils._FFTWWrapper` objects, the input array is copied in as: ``FFTW_array[FFTW_array_slicer] = input_array[update_input_array_slicer]`` ''' # default the slicers to include everything update_input_array_slicer = ( [slice(None)]*len(a_shape)) FFTW_array_slicer = [slice(None)]*len(a_shape) # iterate over each dimension and modify the slicer and FFTW dimension for axis in range(len(a_shape)): if a_shape[axis] > input_shape[axis]: update_input_array_slicer[axis] = ( slice(0, input_shape[axis])) elif a_shape[axis] < input_shape[axis]: FFTW_array_slicer[axis] = ( slice(0, a_shape[axis])) update_input_array_slicer[axis] = ( slice(0, a_shape[axis])) else: # If neither of these, we use the whole dimension. update_input_array_slicer[axis] = ( slice(0, a_shape[axis])) return update_input_array_slicer, FFTW_array_slicer def _compute_array_shapes(a, s, axes, inverse, real): '''Given a passed in array ``a``, and the rest of the arguments (that have been fleshed out with :func:`~pyfftw.builders._utils._cook_nd_args`), compute the shape the input and output arrays need to be in order to satisfy all the requirements for the transform. The input shape *may* be different to the shape of a. returns: ``(input_shape, output_shape)`` ''' # Start with the shape of a orig_domain_shape = list(a.shape) fft_domain_shape = list(a.shape) try: for n, axis in enumerate(axes): orig_domain_shape[axis] = s[n] fft_domain_shape[axis] = s[n] if real: fft_domain_shape[axes[-1]] = s[-1]//2 + 1 except IndexError: raise IndexError('Invalid axes: ' 'At least one of the passed axes is invalid.') if inverse: input_shape = fft_domain_shape output_shape = orig_domain_shape else: input_shape = orig_domain_shape output_shape = fft_domain_shape return tuple(input_shape), tuple(output_shape) def _precook_1d_args(a, n, axis): '''Turn ``*(n, axis)`` into ``(s, axes)`` ''' if n is not None: s = [int(n)] else: s = None # Force an error with an invalid axis a.shape[axis] return s, (axis,) def _cook_nd_args(a, s=None, axes=None, invreal=False): '''Similar to :func:`numpy.fft.fftpack._cook_nd_args`. ''' if axes is None: if s is None: len_s = len(a.shape) else: len_s = len(s) axes = list(range(-len_s, 0)) if s is None: s = list(numpy.take(a.shape, axes)) if invreal: s[-1] = (a.shape[axes[-1]] - 1) * 2 if len(s) != len(axes): raise ValueError('Shape error: ' 'Shape and axes have different lengths.') if len(s) > len(a.shape): raise ValueError('Shape error: ' 'The length of s or axes cannot exceed the dimensionality ' 'of the input array, a.') return tuple(s), tuple(axes) pyFFTW-0.10.1/pyfftw/builders/__init__.py0000664000175000017500000000017312570060606017552 0ustar whgwhg00000000000000#!/usr/bin/env python from .builders import * from . import _utils __doc__ = builders.__doc__ __all__ = builders.__all__ pyFFTW-0.10.1/pyfftw/builders/builders.py0000664000175000017500000004567312570060606017642 0ustar whgwhg00000000000000#!/usr/bin/env python # # Copyright 2014 Knowledge Economy Developments Ltd # Copyright 2014 David Wells # # Henry Gomersall # heng@kedevelopments.co.uk # David Wells # drwells vt.edu # # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, this # list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright notice, # this list of conditions and the following disclaimer in the documentation # and/or other materials provided with the distribution. # # * Neither the name of the copyright holder nor the names of its contributors # may be used to endorse or promote products derived from this software without # specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. # ''' Overview """""""" This module contains a set of functions that return :class:`pyfftw.FFTW` objects. The interface to create these objects is mostly the same as :mod:`numpy.fft`, only instead of the call returning the result of the FFT, a :class:`pyfftw.FFTW` object is returned that performs that FFT operation when it is called. Users should be familiar with :mod:`!numpy.fft` before reading on. In the case where the shape argument, ``s`` (or ``n`` in the 1-dimensional case), dictates that the passed-in input array be copied into a different processing array, the returned object is an instance of a child class of :class:`pyfftw.FFTW`, :class:`~pyfftw.builders._utils._FFTWWrapper`, which wraps the call method in order to correctly perform that copying. That is, subsequent calls to the object (i.e. through :meth:`~pyfftw.builders._utils._FFTWWrapper.__call__`) should occur with an input array that can be sliced to the same size as the expected internal array. Note that a side effect of this is that subsequent calls to the object can be made with an array that is *bigger* than the original (but not smaller). Only the call method is wrapped; :meth:`~pyfftw.FFTW.update_arrays` still expects an array with the correct size, alignment, dtype etc for the :class:`pyfftw.FFTW` object. When the internal input array is bigger along any axis than the input array that is passed in (due to ``s`` dictating a larger size), then the extra entries are padded with zeros. This is a one time action. If the internal input array is then extracted using :attr:`pyfftw.FFTW.input_array`, it is possible to persistently fill the padding space with whatever the user desires, so subsequent calls with a new input only overwrite the values that aren't padding (even if the array that is used for the call is bigger than the original - see the point above about bigger arrays being sliced to fit). The precision of the FFT operation is acquired from the input array. If an array is passed in that is not of float type, or is of an unknown float type, an attempt is made to convert the array to a double precision array. This results in a copy being made. If an array of the incorrect complexity is passed in (e.g. a complex array is passed to a real transform routine, or vice-versa), then an attempt is made to convert the array to an array of the correct complexity. This results in a copy being made. Although the array that is internal to the :class:`pyfftw.FFTW` object will be correctly loaded with the values within the input array, it is not necessarily the case that the internal array *is* the input array. The actual internal input array can always be retrieved with :attr:`pyfftw.FFTW.input_array`. **Example:** .. doctest:: >>> import pyfftw >>> a = pyfftw.empty_aligned(4, dtype='complex128') >>> fft = pyfftw.builders.fft(a) >>> a[:] = [1, 2, 3, 4] >>> fft() # returns the output array([ 10.+0.j, -2.+2.j, -2.+0.j, -2.-2.j]) More examples can be found in the :doc:`tutorial `. Supported Functions and Caveats """"""""""""""""""""""""""""""" The following functions are supported. They can be used with the same calling signature as their respective functions in :mod:`numpy.fft`. **Standard FFTs** * :func:`~pyfftw.builders.fft` * :func:`~pyfftw.builders.ifft` * :func:`~pyfftw.builders.fft2` * :func:`~pyfftw.builders.ifft2` * :func:`~pyfftw.builders.fftn` * :func:`~pyfftw.builders.ifftn` **Real FFTs** * :func:`~pyfftw.builders.rfft` * :func:`~pyfftw.builders.irfft` * :func:`~pyfftw.builders.rfft2` * :func:`~pyfftw.builders.irfft2` * :func:`~pyfftw.builders.rfftn` * :func:`~pyfftw.builders.irfftn` The first caveat is that the dtype of the input array must match the transform. For example, for ``fft`` and ``ifft``, the dtype must be complex, for ``rfft`` it must be real, and so on. The other point to note from this is that the precision of the transform matches the precision of the input array. So, if a single precision input array is passed in, then a single precision transform will be used. The second caveat is that repeated axes are handled differently; with the returned :class:`pyfftw.FFTW` object, axes that are repeated in the axes argument are considered only once, as compared to :mod:`numpy.fft` in which repeated axes results in the DFT being taken along that axes as many times as the axis occurs (this is down to the underlying library). Note that unless the ``auto_align_input`` argument to the function is set to ``True``, the ``'FFTW_UNALIGNED'`` :ref:`flag ` is set in the returned :class:`pyfftw.FFTW` object. This disables some of the FFTW optimisations that rely on aligned arrays. Also worth noting is that the ``auto_align_input`` flag only results in a copy when calling the resultant :class:`pyfftw.FFTW` object if the input array is not already aligned correctly. .. _builders_args: Additional Arguments """""""""""""""""""" In addition to the arguments that are present with their complementary functions in :mod:`numpy.fft`, each of these functions also offers the following additional keyword arguments: * ``overwrite_input``: Whether or not the input array can be overwritten during the transform. This sometimes results in a faster algorithm being made available. It causes the ``'FFTW_DESTROY_INPUT'`` flag to be passed to the :class:`pyfftw.FFTW` object. This flag is not offered for the multi-dimensional inverse real transforms, as FFTW is unable to not overwrite the input in that case. * ``planner_effort``: A string dictating how much effort is spent in planning the FFTW routines. This is passed to the creation of the :class:`pyfftw.FFTW` object as an entry in the flags list. They correspond to flags passed to the :class:`pyfftw.FFTW` object. The valid strings, in order of their increasing impact on the time to compute are: ``'FFTW_ESTIMATE'``, ``'FFTW_MEASURE'`` (default), ``'FFTW_PATIENT'`` and ``'FFTW_EXHAUSTIVE'``. The `Wisdom `_ that FFTW has accumulated or has loaded (through :func:`pyfftw.import_wisdom`) is used during the creation of :class:`pyfftw.FFTW` objects. * ``threads``: The number of threads used to perform the FFT. * ``auto_align_input``: Correctly byte align the input array for optimal usage of vector instructions. This can lead to a substantial speedup. Setting this argument to ``True`` makes sure that the input array is correctly aligned. It is possible to correctly byte align the array prior to calling this function (using, for example, :func:`pyfftw.byte_align`). If and only if a realignment is necessary is a new array created. If a new array *is* created, it is up to the calling code to acquire that new input array using :attr:`pyfftw.FFTW.input_array`. The resultant :class:`pyfftw.FFTW` object that is created will be designed to operate on arrays that are aligned. If the object is called with an unaligned array, this would result in a copy. Despite this, it may still be faster to set the ``auto_align_input`` flag and incur a copy with unaligned arrays than to set up an object that uses aligned arrays. It's worth noting that just being aligned may not be sufficient to create the fastest possible transform. For example, if the array is not contiguous (i.e. certain axes have gaps in memory between slices), it may be faster to plan a transform for a contiguous array, and then rely on the array being copied in before the transform (which :class:`pyfftw.FFTW` will handle for you). The ``auto_contiguous`` argument controls whether this function also takes care of making sure the array is contiguous or not. * ``auto_contiguous``: Make sure the input array is contiguous in memory before performing the transform on it. If the array is not contiguous, it is copied into an interim array. This is because it is often faster to copy the data before the transform and then transform a contiguous array than it is to try to take the transform of a non-contiguous array. This is particularly true in conjunction with the ``auto_align_input`` argument which is used to make sure that the transform is taken of an aligned array. Like ``auto_align_input``, If a new array is created, it is up to the calling code to acquire that new input array using :attr:`pyfftw.FFTW.input_array`. * ``avoid_copy``: By default, these functions will always create a copy (and sometimes more than one) of the passed in input array. This is because the creation of the :class:`pyfftw.FFTW` object generally destroys the contents of the input array. Setting this argument to ``True`` will try not to create a copy of the input array, likely resulting in the input array being destroyed. If it is not possible to create the object without a copy being made, a ``ValueError`` is raised. Example situations that require a copy, and so cause the exception to be raised when this flag is set: * The shape of the FFT input as dictated by ``s`` is necessarily different from the shape of the passed-in array. * The dtypes are incompatible with the FFT routine. * The ``auto_contiguous`` or ``auto_align`` flags are True and the input array is not already contiguous or aligned. This argument is distinct from ``overwrite_input`` in that it only influences a copy during the creation of the object. It changes no flags in the :class:`pyfftw.FFTW` object. The exceptions raised by each of these functions are as per their equivalents in :mod:`numpy.fft`, or as documented above. ''' from ._utils import _precook_1d_args, _Xfftn __all__ = ['fft','ifft', 'fft2', 'ifft2', 'fftn', 'ifftn', 'rfft', 'irfft', 'rfft2', 'irfft2', 'rfftn', 'irfftn'] def fft(a, n=None, axis=-1, overwrite_input=False, planner_effort='FFTW_MEASURE', threads=1, auto_align_input=True, auto_contiguous=True, avoid_copy=False): '''Return a :class:`pyfftw.FFTW` object representing a 1D FFT. The first three arguments are as per :func:`numpy.fft.fft`; the rest of the arguments are documented :ref:`in the module docs `. ''' inverse = False real = False s, axes = _precook_1d_args(a, n, axis) return _Xfftn(a, s, axes, overwrite_input, planner_effort, threads, auto_align_input, auto_contiguous, avoid_copy, inverse, real) def ifft(a, n=None, axis=-1, overwrite_input=False, planner_effort='FFTW_MEASURE', threads=1, auto_align_input=True, auto_contiguous=True, avoid_copy=False): '''Return a :class:`pyfftw.FFTW` object representing a 1D inverse FFT. The first three arguments are as per :func:`numpy.fft.ifft`; the rest of the arguments are documented :ref:`in the module docs `. ''' inverse = True real = False s, axes = _precook_1d_args(a, n, axis) return _Xfftn(a, s, axes, overwrite_input, planner_effort, threads, auto_align_input, auto_contiguous, avoid_copy, inverse, real) def fft2(a, s=None, axes=(-2,-1), overwrite_input=False, planner_effort='FFTW_MEASURE', threads=1, auto_align_input=True, auto_contiguous=True, avoid_copy=False): '''Return a :class:`pyfftw.FFTW` object representing a 2D FFT. The first three arguments are as per :func:`numpy.fft.fft2`; the rest of the arguments are documented :ref:`in the module docs `. ''' inverse = False real = False return _Xfftn(a, s, axes, overwrite_input, planner_effort, threads, auto_align_input, auto_contiguous, avoid_copy, inverse, real) def ifft2(a, s=None, axes=(-2,-1), overwrite_input=False, planner_effort='FFTW_MEASURE', threads=1, auto_align_input=True, auto_contiguous=True, avoid_copy=False): '''Return a :class:`pyfftw.FFTW` object representing a 2D inverse FFT. The first three arguments are as per :func:`numpy.fft.ifft2`; the rest of the arguments are documented :ref:`in the module docs `. ''' inverse = True real = False return _Xfftn(a, s, axes, overwrite_input, planner_effort, threads, auto_align_input, auto_contiguous, avoid_copy, inverse, real) def fftn(a, s=None, axes=None, overwrite_input=False, planner_effort='FFTW_MEASURE', threads=1, auto_align_input=True, auto_contiguous=True, avoid_copy=False): '''Return a :class:`pyfftw.FFTW` object representing a n-D FFT. The first three arguments are as per :func:`numpy.fft.fftn`; the rest of the arguments are documented :ref:`in the module docs `. ''' inverse = False real = False return _Xfftn(a, s, axes, overwrite_input, planner_effort, threads, auto_align_input, auto_contiguous, avoid_copy, inverse, real) def ifftn(a, s=None, axes=None, overwrite_input=False, planner_effort='FFTW_MEASURE', threads=1, auto_align_input=True, auto_contiguous=True, avoid_copy=False): '''Return a :class:`pyfftw.FFTW` object representing an n-D inverse FFT. The first three arguments are as per :func:`numpy.fft.ifftn`; the rest of the arguments are documented :ref:`in the module docs `. ''' inverse = True real = False return _Xfftn(a, s, axes, overwrite_input, planner_effort, threads, auto_align_input, auto_contiguous, avoid_copy, inverse, real) def rfft(a, n=None, axis=-1, overwrite_input=False, planner_effort='FFTW_MEASURE', threads=1, auto_align_input=True, auto_contiguous=True, avoid_copy=False): '''Return a :class:`pyfftw.FFTW` object representing a 1D real FFT. The first three arguments are as per :func:`numpy.fft.rfft`; the rest of the arguments are documented :ref:`in the module docs `. ''' inverse = False real = True s, axes = _precook_1d_args(a, n, axis) return _Xfftn(a, s, axes, overwrite_input, planner_effort, threads, auto_align_input, auto_contiguous, avoid_copy, inverse, real) def irfft(a, n=None, axis=-1, overwrite_input=False, planner_effort='FFTW_MEASURE', threads=1, auto_align_input=True, auto_contiguous=True, avoid_copy=False): '''Return a :class:`pyfftw.FFTW` object representing a 1D real inverse FFT. The first three arguments are as per :func:`numpy.fft.irfft`; the rest of the arguments are documented :ref:`in the module docs `. ''' inverse = True real = True s, axes = _precook_1d_args(a, n, axis) return _Xfftn(a, s, axes, overwrite_input, planner_effort, threads, auto_align_input, auto_contiguous, avoid_copy, inverse, real) def rfft2(a, s=None, axes=(-2,-1), overwrite_input=False, planner_effort='FFTW_MEASURE', threads=1, auto_align_input=True, auto_contiguous=True, avoid_copy=False): '''Return a :class:`pyfftw.FFTW` object representing a 2D real FFT. The first three arguments are as per :func:`numpy.fft.rfft2`; the rest of the arguments are documented :ref:`in the module docs `. ''' inverse = False real = True return _Xfftn(a, s, axes, overwrite_input, planner_effort, threads, auto_align_input, auto_contiguous, avoid_copy, inverse, real) def irfft2(a, s=None, axes=(-2,-1), planner_effort='FFTW_MEASURE', threads=1, auto_align_input=True, auto_contiguous=True, avoid_copy=False): '''Return a :class:`pyfftw.FFTW` object representing a 2D real inverse FFT. The first three arguments are as per :func:`numpy.fft.irfft2`; the rest of the arguments are documented :ref:`in the module docs `. ''' inverse = True real = True overwrite_input = True return _Xfftn(a, s, axes, overwrite_input, planner_effort, threads, auto_align_input, auto_contiguous, avoid_copy, inverse, real) def rfftn(a, s=None, axes=None, overwrite_input=False, planner_effort='FFTW_MEASURE', threads=1, auto_align_input=True, auto_contiguous=True, avoid_copy=False): '''Return a :class:`pyfftw.FFTW` object representing an n-D real FFT. The first three arguments are as per :func:`numpy.fft.rfftn`; the rest of the arguments are documented :ref:`in the module docs `. ''' inverse = False real = True return _Xfftn(a, s, axes, overwrite_input, planner_effort, threads, auto_align_input, auto_contiguous, avoid_copy, inverse, real) def irfftn(a, s=None, axes=None, planner_effort='FFTW_MEASURE', threads=1, auto_align_input=True, auto_contiguous=True, avoid_copy=False): '''Return a :class:`pyfftw.FFTW` object representing an n-D real inverse FFT. The first three arguments are as per :func:`numpy.fft.rfftn`; the rest of the arguments are documented :ref:`in the module docs `. ''' inverse = True real = True overwrite_input = True return _Xfftn(a, s, axes, overwrite_input, planner_effort, threads, auto_align_input, auto_contiguous, avoid_copy, inverse, real) pyFFTW-0.10.1/pyfftw/cpu.pxd0000664000175000017500000000316612570060606015141 0ustar whgwhg00000000000000# Copyright 2014 Knowledge Economy Developments Ltd # # Henry Gomersall # heng@kedevelopments.co.uk # # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, this # list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright notice, # this list of conditions and the following disclaimer in the documentation # and/or other materials provided with the distribution. # # * Neither the name of the copyright holder nor the names of its contributors # may be used to endorse or promote products derived from this software without # specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. # cdef extern from "cpu.h": int simd_alignment() pyFFTW-0.10.1/pyfftw/__init__.py0000664000175000017500000000162212600741613015737 0ustar whgwhg00000000000000#!/usr/bin/env python # The pyfftw namespace ''' The core of ``pyfftw`` consists of the :class:`FFTW` class, :ref:`wisdom functions ` and a couple of :ref:`utility functions ` for dealing with aligned arrays. This module represents the full interface to the underlying `FFTW library `_. However, users may find it easier to use the helper routines provided in :mod:`pyfftw.builders`. ''' from .version import version as __version__ from .pyfftw import ( FFTW, export_wisdom, import_wisdom, forget_wisdom, simd_alignment, n_byte_align_empty, n_byte_align, is_n_byte_aligned, byte_align, is_byte_aligned, empty_aligned, ones_aligned, zeros_aligned, ) from . import builders from . import interfaces # clean up the namespace del builders.builders pyFFTW-0.10.1/pyfftw/pyfftw.pxd0000664000175000017500000002231712652630355015675 0ustar whgwhg00000000000000# Copyright 2014 Knowledge Economy Developments Ltd # # Henry Gomersall # heng@kedevelopments.co.uk # # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, this # list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright notice, # this list of conditions and the following disclaimer in the documentation # and/or other materials provided with the distribution. # # * Neither the name of the copyright holder nor the names of its contributors # may be used to endorse or promote products derived from this software without # specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. # cimport numpy as np from libc.stdint cimport int64_t ctypedef struct _fftw_iodim: int _n int _is int _os cdef extern from 'pyfftw_complex.h': ctypedef float cfloat[2] ctypedef double cdouble[2] ctypedef long double clongdouble[2] cdef extern from 'fftw3.h': # Double precision plans ctypedef struct fftw_plan_struct: pass ctypedef fftw_plan_struct *fftw_plan # Single precision plans ctypedef struct fftwf_plan_struct: pass ctypedef fftwf_plan_struct *fftwf_plan # Long double precision plans ctypedef struct fftwl_plan_struct: pass ctypedef fftwl_plan_struct *fftwl_plan # The stride info structure. I think that strictly # speaking, this should be defined with a type suffix # on fftw (ie fftw, fftwf or fftwl), but since the # definition is transparent and is defined as _fftw_iodim, # we ignore the distinction in order to simplify the code. ctypedef struct fftw_iodim: pass # Double precision complex planner fftw_plan fftw_plan_guru_dft( int rank, fftw_iodim *dims, int howmany_rank, fftw_iodim *howmany_dims, cdouble *_in, cdouble *_out, int sign, unsigned flags) nogil # Single precision complex planner fftwf_plan fftwf_plan_guru_dft( int rank, fftw_iodim *dims, int howmany_rank, fftw_iodim *howmany_dims, cfloat *_in, cfloat *_out, int sign, unsigned flags) nogil # Single precision complex planner fftwl_plan fftwl_plan_guru_dft( int rank, fftw_iodim *dims, int howmany_rank, fftw_iodim *howmany_dims, clongdouble *_in, clongdouble *_out, int sign, unsigned flags) nogil # Double precision real to complex planner fftw_plan fftw_plan_guru_dft_r2c( int rank, fftw_iodim *dims, int howmany_rank, fftw_iodim *howmany_dims, double *_in, cdouble *_out, unsigned flags) nogil # Single precision real to complex planner fftwf_plan fftwf_plan_guru_dft_r2c( int rank, fftw_iodim *dims, int howmany_rank, fftw_iodim *howmany_dims, float *_in, cfloat *_out, unsigned flags) nogil # Single precision real to complex planner fftwl_plan fftwl_plan_guru_dft_r2c( int rank, fftw_iodim *dims, int howmany_rank, fftw_iodim *howmany_dims, long double *_in, clongdouble *_out, unsigned flags) nogil # Double precision complex to real planner fftw_plan fftw_plan_guru_dft_c2r( int rank, fftw_iodim *dims, int howmany_rank, fftw_iodim *howmany_dims, cdouble *_in, double *_out, unsigned flags) nogil # Single precision complex to real planner fftwf_plan fftwf_plan_guru_dft_c2r( int rank, fftw_iodim *dims, int howmany_rank, fftw_iodim *howmany_dims, cfloat *_in, float *_out, unsigned flags) nogil # Single precision complex to real planner fftwl_plan fftwl_plan_guru_dft_c2r( int rank, fftw_iodim *dims, int howmany_rank, fftw_iodim *howmany_dims, clongdouble *_in, long double *_out, unsigned flags) nogil # Double precision complex new array execute void fftw_execute_dft(fftw_plan, cdouble *_in, cdouble *_out) nogil # Single precision complex new array execute void fftwf_execute_dft(fftwf_plan, cfloat *_in, cfloat *_out) nogil # Long double precision complex new array execute void fftwl_execute_dft(fftwl_plan, clongdouble *_in, clongdouble *_out) nogil # Double precision real to complex new array execute void fftw_execute_dft_r2c(fftw_plan, double *_in, cdouble *_out) nogil # Single precision real to complex new array execute void fftwf_execute_dft_r2c(fftwf_plan, float *_in, cfloat *_out) nogil # Long double precision real to complex new array execute void fftwl_execute_dft_r2c(fftwl_plan, long double *_in, clongdouble *_out) nogil # Double precision complex to real new array execute void fftw_execute_dft_c2r(fftw_plan, cdouble *_in, double *_out) nogil # Single precision complex to real new array execute void fftwf_execute_dft_c2r(fftwf_plan, cfloat *_in, float *_out) nogil # Long double precision complex to real new array execute void fftwl_execute_dft_c2r(fftwl_plan, clongdouble *_in, long double *_out) nogil # Double precision plan destroyer void fftw_destroy_plan(fftw_plan) # Single precision plan destroyer void fftwf_destroy_plan(fftwf_plan) # Long double precision plan destroyer void fftwl_destroy_plan(fftwl_plan) # Double precision set timelimit void fftw_set_timelimit(double seconds) # Single precision set timelimit void fftwf_set_timelimit(double seconds) # Long double precision set timelimit void fftwl_set_timelimit(double seconds) # Threading routines # Double precision void fftw_init_threads() void fftw_plan_with_nthreads(int n) # Single precision void fftwf_init_threads() void fftwf_plan_with_nthreads(int n) # Long double precision void fftwl_init_threads() void fftwl_plan_with_nthreads(int n) # cleanup routines void fftw_cleanup() void fftwf_cleanup() void fftwl_cleanup() void fftw_cleanup_threads() void fftwf_cleanup_threads() void fftwl_cleanup_threads() # wisdom functions void fftw_export_wisdom(void (*write_char)(char c, void *), void *data) void fftwf_export_wisdom(void (*write_char)(char c, void *), void *data) void fftwl_export_wisdom(void (*write_char)(char c, void *), void *data) int fftw_import_wisdom_from_string(char *input_string) int fftwf_import_wisdom_from_string(char *input_string) int fftwl_import_wisdom_from_string(char *input_string) #int fftw_export_wisdom_to_filename(char *filename) #int fftwf_export_wisdom_to_filename(char *filename) #int fftwl_export_wisdom_to_filename(char *filename) # #int fftw_import_wisdom_from_filename(char *filename) #int fftwf_import_wisdom_from_filename(char *filename) #int fftwl_import_wisdom_from_filename(char *filename) void fftw_forget_wisdom() void fftwf_forget_wisdom() void fftwl_forget_wisdom() double FFTW_NO_TIMELIMIT # Define function pointers that can act as a placeholder # for whichever dtype is used (the problem being that fftw # has different function names and signatures for all the # different precisions and dft types). ctypedef void * (*fftw_generic_plan_guru)( int rank, fftw_iodim *dims, int howmany_rank, fftw_iodim *howmany_dims, void *_in, void *_out, int sign, unsigned flags) nogil ctypedef void (*fftw_generic_execute)(void *_plan, void *_in, void *_out) nogil ctypedef void (*fftw_generic_destroy_plan)(void *_plan) ctypedef void (*fftw_generic_init_threads)() ctypedef void (*fftw_generic_plan_with_nthreads)(int n) ctypedef void (*fftw_generic_set_timelimit)(double seconds) ctypedef bint (*validator)(np.ndarray input_array, np.ndarray output_array, int64_t *axes, int64_t *not_axes, int64_t axes_length) # Direction enum cdef enum: FFTW_FORWARD = -1 FFTW_BACKWARD = 1 # Documented flags cdef enum: FFTW_MEASURE = 0 FFTW_DESTROY_INPUT = 1 FFTW_UNALIGNED = 2 FFTW_CONSERVE_MEMORY = 4 FFTW_EXHAUSTIVE = 8 FFTW_PRESERVE_INPUT = 16 FFTW_PATIENT = 32 FFTW_ESTIMATE = 64 FFTW_WISDOM_ONLY = 2097152 pyFFTW-0.10.1/include/0000775000175000017500000000000012652703650013737 5ustar whgwhg00000000000000pyFFTW-0.10.1/include/msvc_2008/0000775000175000017500000000000012652703650015360 5ustar whgwhg00000000000000pyFFTW-0.10.1/include/msvc_2008/stdint.h0000664000175000017500000001764512570060606017047 0ustar whgwhg00000000000000// ISO C9x compliant stdint.h for Microsoft Visual Studio // Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124 // // Copyright (c) 2006-2013 Alexander Chemeris // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // // 1. Redistributions of source code must retain the above copyright notice, // this list of conditions and the following disclaimer. // // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // // 3. Neither the name of the product nor the names of its contributors may // be used to endorse or promote products derived from this software // without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO // EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////////// #ifndef _MSC_VER // [ #error "Use this header only with Microsoft Visual C++ compilers!" #endif // _MSC_VER ] #ifndef _MSC_STDINT_H_ // [ #define _MSC_STDINT_H_ #if _MSC_VER > 1000 #pragma once #endif #if _MSC_VER >= 1600 // [ #include #else // ] _MSC_VER >= 1600 [ #include // For Visual Studio 6 in C++ mode and for many Visual Studio versions when // compiling for ARM we should wrap include with 'extern "C++" {}' // or compiler give many errors like this: // error C2733: second C linkage of overloaded function 'wmemchr' not allowed #ifdef __cplusplus extern "C" { #endif # include #ifdef __cplusplus } #endif // Define _W64 macros to mark types changing their size, like intptr_t. #ifndef _W64 # if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300 # define _W64 __w64 # else # define _W64 # endif #endif // 7.18.1 Integer types // 7.18.1.1 Exact-width integer types // Visual Studio 6 and Embedded Visual C++ 4 doesn't // realize that, e.g. char has the same size as __int8 // so we give up on __intX for them. #if (_MSC_VER < 1300) typedef signed char int8_t; typedef signed short int16_t; typedef signed int int32_t; typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; #else typedef signed __int8 int8_t; typedef signed __int16 int16_t; typedef signed __int32 int32_t; typedef unsigned __int8 uint8_t; typedef unsigned __int16 uint16_t; typedef unsigned __int32 uint32_t; #endif typedef signed __int64 int64_t; typedef unsigned __int64 uint64_t; // 7.18.1.2 Minimum-width integer types typedef int8_t int_least8_t; typedef int16_t int_least16_t; typedef int32_t int_least32_t; typedef int64_t int_least64_t; typedef uint8_t uint_least8_t; typedef uint16_t uint_least16_t; typedef uint32_t uint_least32_t; typedef uint64_t uint_least64_t; // 7.18.1.3 Fastest minimum-width integer types typedef int8_t int_fast8_t; typedef int16_t int_fast16_t; typedef int32_t int_fast32_t; typedef int64_t int_fast64_t; typedef uint8_t uint_fast8_t; typedef uint16_t uint_fast16_t; typedef uint32_t uint_fast32_t; typedef uint64_t uint_fast64_t; // 7.18.1.4 Integer types capable of holding object pointers #ifdef _WIN64 // [ typedef signed __int64 intptr_t; typedef unsigned __int64 uintptr_t; #else // _WIN64 ][ typedef _W64 signed int intptr_t; typedef _W64 unsigned int uintptr_t; #endif // _WIN64 ] // 7.18.1.5 Greatest-width integer types typedef int64_t intmax_t; typedef uint64_t uintmax_t; // 7.18.2 Limits of specified-width integer types #if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) // [ See footnote 220 at page 257 and footnote 221 at page 259 // 7.18.2.1 Limits of exact-width integer types #define INT8_MIN ((int8_t)_I8_MIN) #define INT8_MAX _I8_MAX #define INT16_MIN ((int16_t)_I16_MIN) #define INT16_MAX _I16_MAX #define INT32_MIN ((int32_t)_I32_MIN) #define INT32_MAX _I32_MAX #define INT64_MIN ((int64_t)_I64_MIN) #define INT64_MAX _I64_MAX #define UINT8_MAX _UI8_MAX #define UINT16_MAX _UI16_MAX #define UINT32_MAX _UI32_MAX #define UINT64_MAX _UI64_MAX // 7.18.2.2 Limits of minimum-width integer types #define INT_LEAST8_MIN INT8_MIN #define INT_LEAST8_MAX INT8_MAX #define INT_LEAST16_MIN INT16_MIN #define INT_LEAST16_MAX INT16_MAX #define INT_LEAST32_MIN INT32_MIN #define INT_LEAST32_MAX INT32_MAX #define INT_LEAST64_MIN INT64_MIN #define INT_LEAST64_MAX INT64_MAX #define UINT_LEAST8_MAX UINT8_MAX #define UINT_LEAST16_MAX UINT16_MAX #define UINT_LEAST32_MAX UINT32_MAX #define UINT_LEAST64_MAX UINT64_MAX // 7.18.2.3 Limits of fastest minimum-width integer types #define INT_FAST8_MIN INT8_MIN #define INT_FAST8_MAX INT8_MAX #define INT_FAST16_MIN INT16_MIN #define INT_FAST16_MAX INT16_MAX #define INT_FAST32_MIN INT32_MIN #define INT_FAST32_MAX INT32_MAX #define INT_FAST64_MIN INT64_MIN #define INT_FAST64_MAX INT64_MAX #define UINT_FAST8_MAX UINT8_MAX #define UINT_FAST16_MAX UINT16_MAX #define UINT_FAST32_MAX UINT32_MAX #define UINT_FAST64_MAX UINT64_MAX // 7.18.2.4 Limits of integer types capable of holding object pointers #ifdef _WIN64 // [ # define INTPTR_MIN INT64_MIN # define INTPTR_MAX INT64_MAX # define UINTPTR_MAX UINT64_MAX #else // _WIN64 ][ # define INTPTR_MIN INT32_MIN # define INTPTR_MAX INT32_MAX # define UINTPTR_MAX UINT32_MAX #endif // _WIN64 ] // 7.18.2.5 Limits of greatest-width integer types #define INTMAX_MIN INT64_MIN #define INTMAX_MAX INT64_MAX #define UINTMAX_MAX UINT64_MAX // 7.18.3 Limits of other integer types #ifdef _WIN64 // [ # define PTRDIFF_MIN _I64_MIN # define PTRDIFF_MAX _I64_MAX #else // _WIN64 ][ # define PTRDIFF_MIN _I32_MIN # define PTRDIFF_MAX _I32_MAX #endif // _WIN64 ] #define SIG_ATOMIC_MIN INT_MIN #define SIG_ATOMIC_MAX INT_MAX #ifndef SIZE_MAX // [ # ifdef _WIN64 // [ # define SIZE_MAX _UI64_MAX # else // _WIN64 ][ # define SIZE_MAX _UI32_MAX # endif // _WIN64 ] #endif // SIZE_MAX ] // WCHAR_MIN and WCHAR_MAX are also defined in #ifndef WCHAR_MIN // [ # define WCHAR_MIN 0 #endif // WCHAR_MIN ] #ifndef WCHAR_MAX // [ # define WCHAR_MAX _UI16_MAX #endif // WCHAR_MAX ] #define WINT_MIN 0 #define WINT_MAX _UI16_MAX #endif // __STDC_LIMIT_MACROS ] // 7.18.4 Limits of other integer types #if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) // [ See footnote 224 at page 260 // 7.18.4.1 Macros for minimum-width integer constants #define INT8_C(val) val##i8 #define INT16_C(val) val##i16 #define INT32_C(val) val##i32 #define INT64_C(val) val##i64 #define UINT8_C(val) val##ui8 #define UINT16_C(val) val##ui16 #define UINT32_C(val) val##ui32 #define UINT64_C(val) val##ui64 // 7.18.4.2 Macros for greatest-width integer constants // These #ifndef's are needed to prevent collisions with . // Check out Issue 9 for the details. #ifndef INTMAX_C // [ # define INTMAX_C INT64_C #endif // INTMAX_C ] #ifndef UINTMAX_C // [ # define UINTMAX_C UINT64_C #endif // UINTMAX_C ] #endif // __STDC_CONSTANT_MACROS ] #endif // _MSC_VER >= 1600 ] #endif // _MSC_STDINT_H_ ] pyFFTW-0.10.1/include/pyfftw_complex.h0000664000175000017500000000421512570060606017154 0ustar whgwhg00000000000000/* * Copyright 2014 Knowledge Economy Developments Ltd * * Henry Gomersall * heng@kedevelopments.co.uk * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, this * list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * * Neither the name of the copyright holder nor the names of its contributors * may be used to endorse or promote products derived from this software without * specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ /* Defines complex types that are bit compatible with C99's complex.h * and (crucially) the same type as expected by fftw3.h. * Note, don't use this with complex.h. fftw3.h checks to see whether * complex.h is included and then uses that to set the interface. * Since MSVC doesn't support C99, by using the following types we * have a cross platform/compiler solution. * * */ #ifndef PYFFTW_COMPLEX_H #define PYFFTW_COMPLEX_H typedef float cfloat[2]; typedef double cdouble[2]; typedef long double clongdouble[2]; #endif /* Header guard */ pyFFTW-0.10.1/include/msvc_2010/0000775000175000017500000000000012652703650015351 5ustar whgwhg00000000000000pyFFTW-0.10.1/include/msvc_2010/stdint.h0000664000175000017500000002025512640763213017031 0ustar whgwhg00000000000000// ISO C9x compliant stdint.h for Microsoft Visual Studio // Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124 // // Copyright (c) 2006-2013 Alexander Chemeris // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // // 1. Redistributions of source code must retain the above copyright notice, // this list of conditions and the following disclaimer. // // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // // 3. Neither the name of the product nor the names of its contributors may // be used to endorse or promote products derived from this software // without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO // EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////////// #ifndef _MSC_VER // [ #error "Use this header only with Microsoft Visual C++ compilers!" #endif // _MSC_VER ] #ifndef _MSC_STDINT_H_ // [ #define _MSC_STDINT_H_ #if _MSC_VER > 1000 #pragma once #endif // We comment out the restriction to use the default stdint.h // This fix is to make sure the stdint we define here is used by appveyor // for msvc 2010. This shouldn't need to be done, but it does. It's // probably safe regardless. //#if _MSC_VER >= 1600 // [ //#if _MSC_VER >= 1600 //#include //#else // ] _MSC_VER >= 1600 [ #include // For Visual Studio 6 in C++ mode and for many Visual Studio versions when // compiling for ARM we should wrap include with 'extern "C++" {}' // or compiler give many errors like this: // error C2733: second C linkage of overloaded function 'wmemchr' not allowed #ifdef __cplusplus extern "C" { #endif # include #ifdef __cplusplus } #endif // Define _W64 macros to mark types changing their size, like intptr_t. #ifndef _W64 # if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300 # define _W64 __w64 # else # define _W64 # endif #endif // 7.18.1 Integer types // 7.18.1.1 Exact-width integer types // Visual Studio 6 and Embedded Visual C++ 4 doesn't // realize that, e.g. char has the same size as __int8 // so we give up on __intX for them. #if (_MSC_VER < 1300) typedef signed char int8_t; typedef signed short int16_t; typedef signed int int32_t; typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; #else typedef signed __int8 int8_t; typedef signed __int16 int16_t; typedef signed __int32 int32_t; typedef unsigned __int8 uint8_t; typedef unsigned __int16 uint16_t; typedef unsigned __int32 uint32_t; #endif typedef signed __int64 int64_t; typedef unsigned __int64 uint64_t; // 7.18.1.2 Minimum-width integer types typedef int8_t int_least8_t; typedef int16_t int_least16_t; typedef int32_t int_least32_t; typedef int64_t int_least64_t; typedef uint8_t uint_least8_t; typedef uint16_t uint_least16_t; typedef uint32_t uint_least32_t; typedef uint64_t uint_least64_t; // 7.18.1.3 Fastest minimum-width integer types typedef int8_t int_fast8_t; typedef int16_t int_fast16_t; typedef int32_t int_fast32_t; typedef int64_t int_fast64_t; typedef uint8_t uint_fast8_t; typedef uint16_t uint_fast16_t; typedef uint32_t uint_fast32_t; typedef uint64_t uint_fast64_t; // 7.18.1.4 Integer types capable of holding object pointers #ifdef _WIN64 // [ typedef signed __int64 intptr_t; typedef unsigned __int64 uintptr_t; #else // _WIN64 ][ typedef _W64 signed int intptr_t; typedef _W64 unsigned int uintptr_t; #endif // _WIN64 ] // 7.18.1.5 Greatest-width integer types typedef int64_t intmax_t; typedef uint64_t uintmax_t; // 7.18.2 Limits of specified-width integer types #if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) // [ See footnote 220 at page 257 and footnote 221 at page 259 // 7.18.2.1 Limits of exact-width integer types #define INT8_MIN ((int8_t)_I8_MIN) #define INT8_MAX _I8_MAX #define INT16_MIN ((int16_t)_I16_MIN) #define INT16_MAX _I16_MAX #define INT32_MIN ((int32_t)_I32_MIN) #define INT32_MAX _I32_MAX #define INT64_MIN ((int64_t)_I64_MIN) #define INT64_MAX _I64_MAX #define UINT8_MAX _UI8_MAX #define UINT16_MAX _UI16_MAX #define UINT32_MAX _UI32_MAX #define UINT64_MAX _UI64_MAX // 7.18.2.2 Limits of minimum-width integer types #define INT_LEAST8_MIN INT8_MIN #define INT_LEAST8_MAX INT8_MAX #define INT_LEAST16_MIN INT16_MIN #define INT_LEAST16_MAX INT16_MAX #define INT_LEAST32_MIN INT32_MIN #define INT_LEAST32_MAX INT32_MAX #define INT_LEAST64_MIN INT64_MIN #define INT_LEAST64_MAX INT64_MAX #define UINT_LEAST8_MAX UINT8_MAX #define UINT_LEAST16_MAX UINT16_MAX #define UINT_LEAST32_MAX UINT32_MAX #define UINT_LEAST64_MAX UINT64_MAX // 7.18.2.3 Limits of fastest minimum-width integer types #define INT_FAST8_MIN INT8_MIN #define INT_FAST8_MAX INT8_MAX #define INT_FAST16_MIN INT16_MIN #define INT_FAST16_MAX INT16_MAX #define INT_FAST32_MIN INT32_MIN #define INT_FAST32_MAX INT32_MAX #define INT_FAST64_MIN INT64_MIN #define INT_FAST64_MAX INT64_MAX #define UINT_FAST8_MAX UINT8_MAX #define UINT_FAST16_MAX UINT16_MAX #define UINT_FAST32_MAX UINT32_MAX #define UINT_FAST64_MAX UINT64_MAX // 7.18.2.4 Limits of integer types capable of holding object pointers #ifdef _WIN64 // [ # define INTPTR_MIN INT64_MIN # define INTPTR_MAX INT64_MAX # define UINTPTR_MAX UINT64_MAX #else // _WIN64 ][ # define INTPTR_MIN INT32_MIN # define INTPTR_MAX INT32_MAX # define UINTPTR_MAX UINT32_MAX #endif // _WIN64 ] // 7.18.2.5 Limits of greatest-width integer types #define INTMAX_MIN INT64_MIN #define INTMAX_MAX INT64_MAX #define UINTMAX_MAX UINT64_MAX // 7.18.3 Limits of other integer types #ifdef _WIN64 // [ # define PTRDIFF_MIN _I64_MIN # define PTRDIFF_MAX _I64_MAX #else // _WIN64 ][ # define PTRDIFF_MIN _I32_MIN # define PTRDIFF_MAX _I32_MAX #endif // _WIN64 ] #define SIG_ATOMIC_MIN INT_MIN #define SIG_ATOMIC_MAX INT_MAX #ifndef SIZE_MAX // [ # ifdef _WIN64 // [ # define SIZE_MAX _UI64_MAX # else // _WIN64 ][ # define SIZE_MAX _UI32_MAX # endif // _WIN64 ] #endif // SIZE_MAX ] // WCHAR_MIN and WCHAR_MAX are also defined in #ifndef WCHAR_MIN // [ # define WCHAR_MIN 0 #endif // WCHAR_MIN ] #ifndef WCHAR_MAX // [ # define WCHAR_MAX _UI16_MAX #endif // WCHAR_MAX ] #define WINT_MIN 0 #define WINT_MAX _UI16_MAX #endif // __STDC_LIMIT_MACROS ] // 7.18.4 Limits of other integer types #if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) // [ See footnote 224 at page 260 // 7.18.4.1 Macros for minimum-width integer constants #define INT8_C(val) val##i8 #define INT16_C(val) val##i16 #define INT32_C(val) val##i32 #define INT64_C(val) val##i64 #define UINT8_C(val) val##ui8 #define UINT16_C(val) val##ui16 #define UINT32_C(val) val##ui32 #define UINT64_C(val) val##ui64 // 7.18.4.2 Macros for greatest-width integer constants // These #ifndef's are needed to prevent collisions with . // Check out Issue 9 for the details. #ifndef INTMAX_C // [ # define INTMAX_C INT64_C #endif // INTMAX_C ] #ifndef UINTMAX_C // [ # define UINTMAX_C UINT64_C #endif // UINTMAX_C ] #endif // __STDC_CONSTANT_MACROS ] //#endif // _MSC_VER >= 1600 ] #endif // _MSC_STDINT_H_ ] pyFFTW-0.10.1/include/cpu.h0000664000175000017500000000626412570060606014703 0ustar whgwhg00000000000000/* * Copyright 2014 Knowledge Economy Developments Ltd * * Henry Gomersall * heng@kedevelopments.co.uk * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, this * list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * * Neither the name of the copyright holder nor the names of its contributors * may be used to endorse or promote products derived from this software without * specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ /* Small utilities for inspecting the CPU */ #ifndef CPU_H #define CPU_H #if __STDC_VERSION__ >= 199901L /* "inline" is a keyword */ #else # define inline static #endif #if defined(__amd64__) || defined (_M_X64) || defined(__i386__) || defined(_M_IX86) || defined(_X86_) #define AVX_WORD 2 #define AVX_BIT 28 #define SSE_WORD 3 #define SSE_BIT 25 #ifdef _MSC_VER /* Visual Studio Code */ #include #define cpuid(func, cpuinfo)\ __cpuid(cpuinfo, func); #else /* generic x86 Assembly code (based on wikipedia example) * Firstly it's necessary to move ebx into an interim * register to protect it (cpuid clobbers eax, ebx ecx and edx) * */ #define cpuid(func, cpuinfo)\ cpuinfo[0] = func; /* Load the first entry with the func id */\ __asm__ __volatile__ \ ("mov %%ebx, %%edi;" /* 32bit PIC: don't clobber ebx */ \ "cpuid;" \ "mov %%ebx, %%esi;" \ "mov %%edi, %%ebx;" \ :"+a" (cpuinfo[0]), "=S" (cpuinfo[1]), /* eax rw, esi read */ \ "=c" (cpuinfo[2]), "=d" (cpuinfo[3]) /* ecx read, edx read */\ : :"edi") #endif /* Returns the byte alignment for optimum simd operations */ inline int simd_alignment(void){ int cpuinfo[4]; /* This gets the cpuinfo (set by 1)*/ cpuid(1, cpuinfo); if (cpuinfo[AVX_WORD] & (1< #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /* If is included, use the C99 complex type. Otherwise define a type bit-compatible with C99 complex */ #if !defined(FFTW_NO_Complex) && defined(_Complex_I) && defined(complex) && defined(I) # define FFTW_DEFINE_COMPLEX(R, C) typedef R _Complex C #else # define FFTW_DEFINE_COMPLEX(R, C) typedef R C[2] #endif #define FFTW_CONCAT(prefix, name) prefix ## name #define FFTW_MANGLE_DOUBLE(name) FFTW_CONCAT(fftw_, name) #define FFTW_MANGLE_FLOAT(name) FFTW_CONCAT(fftwf_, name) #define FFTW_MANGLE_LONG_DOUBLE(name) FFTW_CONCAT(fftwl_, name) #define FFTW_MANGLE_QUAD(name) FFTW_CONCAT(fftwq_, name) /* IMPORTANT: for Windows compilers, you should add a line */ #define FFTW_DLL /* here and in kernel/ifftw.h if you are compiling/using FFTW as a DLL, in order to do the proper importing/exporting, or alternatively compile with -DFFTW_DLL or the equivalent command-line flag. This is not necessary under MinGW/Cygwin, where libtool does the imports/exports automatically. */ #if defined(FFTW_DLL) && (defined(_WIN32) || defined(__WIN32__)) /* annoying Windows syntax for shared-library declarations */ # if defined(COMPILING_FFTW) /* defined in api.h when compiling FFTW */ # define FFTW_EXTERN extern __declspec(dllexport) # else /* user is calling FFTW; import symbol */ # define FFTW_EXTERN extern __declspec(dllimport) # endif #else # define FFTW_EXTERN extern #endif enum fftw_r2r_kind_do_not_use_me { FFTW_R2HC=0, FFTW_HC2R=1, FFTW_DHT=2, FFTW_REDFT00=3, FFTW_REDFT01=4, FFTW_REDFT10=5, FFTW_REDFT11=6, FFTW_RODFT00=7, FFTW_RODFT01=8, FFTW_RODFT10=9, FFTW_RODFT11=10 }; struct fftw_iodim_do_not_use_me { int n; /* dimension size */ int is; /* input stride */ int os; /* output stride */ }; #include /* for ptrdiff_t */ struct fftw_iodim64_do_not_use_me { ptrdiff_t n; /* dimension size */ ptrdiff_t is; /* input stride */ ptrdiff_t os; /* output stride */ }; typedef void (*fftw_write_char_func_do_not_use_me)(char c, void *); typedef int (*fftw_read_char_func_do_not_use_me)(void *); /* huge second-order macro that defines prototypes for all API functions. We expand this macro for each supported precision X: name-mangling macro R: real data type C: complex data type */ #define FFTW_DEFINE_API(X, R, C) \ \ FFTW_DEFINE_COMPLEX(R, C); \ \ typedef struct X(plan_s) *X(plan); \ \ typedef struct fftw_iodim_do_not_use_me X(iodim); \ typedef struct fftw_iodim64_do_not_use_me X(iodim64); \ \ typedef enum fftw_r2r_kind_do_not_use_me X(r2r_kind); \ \ typedef fftw_write_char_func_do_not_use_me X(write_char_func); \ typedef fftw_read_char_func_do_not_use_me X(read_char_func); \ \ FFTW_EXTERN void X(execute)(const X(plan) p); \ \ FFTW_EXTERN X(plan) X(plan_dft)(int rank, const int *n, \ C *in, C *out, int sign, unsigned flags); \ \ FFTW_EXTERN X(plan) X(plan_dft_1d)(int n, C *in, C *out, int sign, \ unsigned flags); \ FFTW_EXTERN X(plan) X(plan_dft_2d)(int n0, int n1, \ C *in, C *out, int sign, unsigned flags); \ FFTW_EXTERN X(plan) X(plan_dft_3d)(int n0, int n1, int n2, \ C *in, C *out, int sign, unsigned flags); \ \ FFTW_EXTERN X(plan) X(plan_many_dft)(int rank, const int *n, \ int howmany, \ C *in, const int *inembed, \ int istride, int idist, \ C *out, const int *onembed, \ int ostride, int odist, \ int sign, unsigned flags); \ \ FFTW_EXTERN X(plan) X(plan_guru_dft)(int rank, const X(iodim) *dims, \ int howmany_rank, \ const X(iodim) *howmany_dims, \ C *in, C *out, \ int sign, unsigned flags); \ FFTW_EXTERN X(plan) X(plan_guru_split_dft)(int rank, const X(iodim) *dims, \ int howmany_rank, \ const X(iodim) *howmany_dims, \ R *ri, R *ii, R *ro, R *io, \ unsigned flags); \ \ FFTW_EXTERN X(plan) X(plan_guru64_dft)(int rank, \ const X(iodim64) *dims, \ int howmany_rank, \ const X(iodim64) *howmany_dims, \ C *in, C *out, \ int sign, unsigned flags); \ FFTW_EXTERN X(plan) X(plan_guru64_split_dft)(int rank, \ const X(iodim64) *dims, \ int howmany_rank, \ const X(iodim64) *howmany_dims, \ R *ri, R *ii, R *ro, R *io, \ unsigned flags); \ \ FFTW_EXTERN void X(execute_dft)(const X(plan) p, C *in, C *out); \ FFTW_EXTERN void X(execute_split_dft)(const X(plan) p, R *ri, R *ii, \ R *ro, R *io); \ \ FFTW_EXTERN X(plan) X(plan_many_dft_r2c)(int rank, const int *n, \ int howmany, \ R *in, const int *inembed, \ int istride, int idist, \ C *out, const int *onembed, \ int ostride, int odist, \ unsigned flags); \ \ FFTW_EXTERN X(plan) X(plan_dft_r2c)(int rank, const int *n, \ R *in, C *out, unsigned flags); \ \ FFTW_EXTERN X(plan) X(plan_dft_r2c_1d)(int n,R *in,C *out,unsigned flags); \ FFTW_EXTERN X(plan) X(plan_dft_r2c_2d)(int n0, int n1, \ R *in, C *out, unsigned flags); \ FFTW_EXTERN X(plan) X(plan_dft_r2c_3d)(int n0, int n1, \ int n2, \ R *in, C *out, unsigned flags); \ \ \ FFTW_EXTERN X(plan) X(plan_many_dft_c2r)(int rank, const int *n, \ int howmany, \ C *in, const int *inembed, \ int istride, int idist, \ R *out, const int *onembed, \ int ostride, int odist, \ unsigned flags); \ \ FFTW_EXTERN X(plan) X(plan_dft_c2r)(int rank, const int *n, \ C *in, R *out, unsigned flags); \ \ FFTW_EXTERN X(plan) X(plan_dft_c2r_1d)(int n,C *in,R *out,unsigned flags); \ FFTW_EXTERN X(plan) X(plan_dft_c2r_2d)(int n0, int n1, \ C *in, R *out, unsigned flags); \ FFTW_EXTERN X(plan) X(plan_dft_c2r_3d)(int n0, int n1, \ int n2, \ C *in, R *out, unsigned flags); \ \ FFTW_EXTERN X(plan) X(plan_guru_dft_r2c)(int rank, const X(iodim) *dims, \ int howmany_rank, \ const X(iodim) *howmany_dims, \ R *in, C *out, \ unsigned flags); \ FFTW_EXTERN X(plan) X(plan_guru_dft_c2r)(int rank, const X(iodim) *dims, \ int howmany_rank, \ const X(iodim) *howmany_dims, \ C *in, R *out, \ unsigned flags); \ \ FFTW_EXTERN X(plan) X(plan_guru_split_dft_r2c)( \ int rank, const X(iodim) *dims, \ int howmany_rank, \ const X(iodim) *howmany_dims, \ R *in, R *ro, R *io, \ unsigned flags); \ FFTW_EXTERN X(plan) X(plan_guru_split_dft_c2r)( \ int rank, const X(iodim) *dims, \ int howmany_rank, \ const X(iodim) *howmany_dims, \ R *ri, R *ii, R *out, \ unsigned flags); \ \ FFTW_EXTERN X(plan) X(plan_guru64_dft_r2c)(int rank, \ const X(iodim64) *dims, \ int howmany_rank, \ const X(iodim64) *howmany_dims, \ R *in, C *out, \ unsigned flags); \ FFTW_EXTERN X(plan) X(plan_guru64_dft_c2r)(int rank, \ const X(iodim64) *dims, \ int howmany_rank, \ const X(iodim64) *howmany_dims, \ C *in, R *out, \ unsigned flags); \ \ FFTW_EXTERN X(plan) X(plan_guru64_split_dft_r2c)( \ int rank, const X(iodim64) *dims, \ int howmany_rank, \ const X(iodim64) *howmany_dims, \ R *in, R *ro, R *io, \ unsigned flags); \ FFTW_EXTERN X(plan) X(plan_guru64_split_dft_c2r)( \ int rank, const X(iodim64) *dims, \ int howmany_rank, \ const X(iodim64) *howmany_dims, \ R *ri, R *ii, R *out, \ unsigned flags); \ \ FFTW_EXTERN void X(execute_dft_r2c)(const X(plan) p, R *in, C *out); \ FFTW_EXTERN void X(execute_dft_c2r)(const X(plan) p, C *in, R *out); \ \ FFTW_EXTERN void X(execute_split_dft_r2c)(const X(plan) p, \ R *in, R *ro, R *io); \ FFTW_EXTERN void X(execute_split_dft_c2r)(const X(plan) p, \ R *ri, R *ii, R *out); \ \ FFTW_EXTERN X(plan) X(plan_many_r2r)(int rank, const int *n, \ int howmany, \ R *in, const int *inembed, \ int istride, int idist, \ R *out, const int *onembed, \ int ostride, int odist, \ const X(r2r_kind) *kind, unsigned flags); \ \ FFTW_EXTERN X(plan) X(plan_r2r)(int rank, const int *n, R *in, R *out, \ const X(r2r_kind) *kind, unsigned flags); \ \ FFTW_EXTERN X(plan) X(plan_r2r_1d)(int n, R *in, R *out, \ X(r2r_kind) kind, unsigned flags); \ FFTW_EXTERN X(plan) X(plan_r2r_2d)(int n0, int n1, R *in, R *out, \ X(r2r_kind) kind0, X(r2r_kind) kind1, \ unsigned flags); \ FFTW_EXTERN X(plan) X(plan_r2r_3d)(int n0, int n1, int n2, \ R *in, R *out, X(r2r_kind) kind0, \ X(r2r_kind) kind1, X(r2r_kind) kind2, \ unsigned flags); \ \ FFTW_EXTERN X(plan) X(plan_guru_r2r)(int rank, const X(iodim) *dims, \ int howmany_rank, \ const X(iodim) *howmany_dims, \ R *in, R *out, \ const X(r2r_kind) *kind, unsigned flags); \ \ FFTW_EXTERN X(plan) X(plan_guru64_r2r)(int rank, const X(iodim64) *dims, \ int howmany_rank, \ const X(iodim64) *howmany_dims, \ R *in, R *out, \ const X(r2r_kind) *kind, unsigned flags); \ \ FFTW_EXTERN void X(execute_r2r)(const X(plan) p, R *in, R *out); \ \ FFTW_EXTERN void X(destroy_plan)(X(plan) p); \ FFTW_EXTERN void X(forget_wisdom)(void); \ FFTW_EXTERN void X(cleanup)(void); \ \ FFTW_EXTERN void X(set_timelimit)(double t); \ \ FFTW_EXTERN void X(plan_with_nthreads)(int nthreads); \ FFTW_EXTERN int X(init_threads)(void); \ FFTW_EXTERN void X(cleanup_threads)(void); \ \ FFTW_EXTERN int X(export_wisdom_to_filename)(const char *filename); \ FFTW_EXTERN void X(export_wisdom_to_file)(FILE *output_file); \ FFTW_EXTERN char *X(export_wisdom_to_string)(void); \ FFTW_EXTERN void X(export_wisdom)(X(write_char_func) write_char, \ void *data); \ FFTW_EXTERN int X(import_system_wisdom)(void); \ FFTW_EXTERN int X(import_wisdom_from_filename)(const char *filename); \ FFTW_EXTERN int X(import_wisdom_from_file)(FILE *input_file); \ FFTW_EXTERN int X(import_wisdom_from_string)(const char *input_string); \ FFTW_EXTERN int X(import_wisdom)(X(read_char_func) read_char, void *data); \ \ FFTW_EXTERN void X(fprint_plan)(const X(plan) p, FILE *output_file); \ FFTW_EXTERN void X(print_plan)(const X(plan) p); \ \ FFTW_EXTERN void *X(malloc)(size_t n); \ FFTW_EXTERN R *X(alloc_real)(size_t n); \ FFTW_EXTERN C *X(alloc_complex)(size_t n); \ FFTW_EXTERN void X(free)(void *p); \ \ FFTW_EXTERN void X(flops)(const X(plan) p, \ double *add, double *mul, double *fmas); \ FFTW_EXTERN double X(estimate_cost)(const X(plan) p); \ FFTW_EXTERN double X(cost)(const X(plan) p); \ \ FFTW_EXTERN const char X(version)[]; \ FFTW_EXTERN const char X(cc)[]; \ FFTW_EXTERN const char X(codelet_optim)[]; /* end of FFTW_DEFINE_API macro */ FFTW_DEFINE_API(FFTW_MANGLE_DOUBLE, double, fftw_complex) FFTW_DEFINE_API(FFTW_MANGLE_FLOAT, float, fftwf_complex) FFTW_DEFINE_API(FFTW_MANGLE_LONG_DOUBLE, long double, fftwl_complex) /* __float128 (quad precision) is a gcc extension on i386, x86_64, and ia64 for gcc >= 4.6 (compiled in FFTW with --enable-quad-precision) */ #if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) \ && !(defined(__ICC) || defined(__INTEL_COMPILER)) \ && (defined(__i386__) || defined(__x86_64__) || defined(__ia64__)) # if !defined(FFTW_NO_Complex) && defined(_Complex_I) && defined(complex) && defined(I) /* note: __float128 is a typedef, which is not supported with the _Complex keyword in gcc, so instead we use this ugly __attribute__ version. However, we can't simply pass the __attribute__ version to FFTW_DEFINE_API because the __attribute__ confuses gcc in pointer types. Hence redefining FFTW_DEFINE_COMPLEX. Ugh. */ # undef FFTW_DEFINE_COMPLEX # define FFTW_DEFINE_COMPLEX(R, C) typedef _Complex float __attribute__((mode(TC))) C # endif FFTW_DEFINE_API(FFTW_MANGLE_QUAD, __float128, fftwq_complex) #endif #define FFTW_FORWARD (-1) #define FFTW_BACKWARD (+1) #define FFTW_NO_TIMELIMIT (-1.0) /* documented flags */ #define FFTW_MEASURE (0U) #define FFTW_DESTROY_INPUT (1U << 0) #define FFTW_UNALIGNED (1U << 1) #define FFTW_CONSERVE_MEMORY (1U << 2) #define FFTW_EXHAUSTIVE (1U << 3) /* NO_EXHAUSTIVE is default */ #define FFTW_PRESERVE_INPUT (1U << 4) /* cancels FFTW_DESTROY_INPUT */ #define FFTW_PATIENT (1U << 5) /* IMPATIENT is default */ #define FFTW_ESTIMATE (1U << 6) #define FFTW_WISDOM_ONLY (1U << 21) /* undocumented beyond-guru flags */ #define FFTW_ESTIMATE_PATIENT (1U << 7) #define FFTW_BELIEVE_PCOST (1U << 8) #define FFTW_NO_DFT_R2HC (1U << 9) #define FFTW_NO_NONTHREADED (1U << 10) #define FFTW_NO_BUFFERING (1U << 11) #define FFTW_NO_INDIRECT_OP (1U << 12) #define FFTW_ALLOW_LARGE_GENERIC (1U << 13) /* NO_LARGE_GENERIC is default */ #define FFTW_NO_RANK_SPLITS (1U << 14) #define FFTW_NO_VRANK_SPLITS (1U << 15) #define FFTW_NO_VRECURSE (1U << 16) #define FFTW_NO_SIMD (1U << 17) #define FFTW_NO_SLOW (1U << 18) #define FFTW_NO_FIXED_RADIX_LARGE_N (1U << 19) #define FFTW_ALLOW_PRUNING (1U << 20) #ifdef __cplusplus } /* extern "C" */ #endif /* __cplusplus */ #endif /* FFTW3_H */ pyFFTW-0.10.1/pyFFTW.egg-info/0000775000175000017500000000000012652703650015125 5ustar whgwhg00000000000000pyFFTW-0.10.1/pyFFTW.egg-info/PKG-INFO0000664000175000017500000000437512652703650016233 0ustar whgwhg00000000000000Metadata-Version: 1.1 Name: pyFFTW Version: 0.10.1 Summary: A pythonic wrapper around FFTW, the FFT library, presenting a unified interface for all the supported transforms. Home-page: http://hgomersall.github.com/pyFFTW/ Author: Henry Gomersall Author-email: heng@kedevelopments.co.uk License: UNKNOWN Description: pyFFTW is a pythonic wrapper around `FFTW `_, the speedy FFT library. The ultimate aim is to present a unified interface for all the possible transforms that FFTW can perform. Both the complex DFT and the real DFT are supported, as well as arbitrary axes of abitrary shaped and strided arrays, which makes it almost feature equivalent to standard and real FFT functions of ``numpy.fft`` (indeed, it supports the ``clongdouble`` dtype which ``numpy.fft`` does not). Operating FFTW in multithreaded mode is supported. A comprehensive unittest suite can be found with the source on the github repository. To build for windows from source, download the fftw dlls for your system and the header file from here (they're in a zip file): http://www.fftw.org/install/windows.html and place them in the pyfftw directory. The files are libfftw3-3.dll, libfftw3l-3.dll, libfftw3f-3.dll and libfftw3.h. Under linux, to build from source, the FFTW library must be installed already. This should probably work for OSX, though I've not tried it. Numpy is a dependency for both. The documentation can be found `here `_, and the source is on `github `_. Platform: UNKNOWN Classifier: Programming Language :: Python Classifier: Programming Language :: Python :: 3 Classifier: Development Status :: 4 - Beta Classifier: License :: OSI Approved :: BSD License Classifier: Operating System :: OS Independent Classifier: Intended Audience :: Developers Classifier: Intended Audience :: Science/Research Classifier: Topic :: Scientific/Engineering Classifier: Topic :: Scientific/Engineering :: Mathematics Classifier: Topic :: Multimedia :: Sound/Audio :: Analysis pyFFTW-0.10.1/pyFFTW.egg-info/top_level.txt0000664000175000017500000000000712652703650017654 0ustar whgwhg00000000000000pyfftw pyFFTW-0.10.1/pyFFTW.egg-info/SOURCES.txt0000664000175000017500000000440512652703650017014 0ustar whgwhg00000000000000CHANGELOG.md LICENSE.txt MANIFEST.in README.rst requirements.txt setup.py /home/whg/Projects/github/pyFFTW/pyfftw/pyfftw.c /home/whg/Projects/github/pyFFTW/pyfftw/pyfftw.pyx /home/whg21/Projects/github/pyFFTW/pyfftw/pyfftw.c /home/whg21/Projects/github/pyFFTW/pyfftw/pyfftw.pyx docs/html/genindex.html docs/html/index.html docs/html/py-modindex.html docs/html/search.html docs/html/searchindex.js docs/html/_static/basic.css docs/html/_static/comment-bright.png docs/html/_static/comment-close.png docs/html/_static/comment.png docs/html/_static/default.css docs/html/_static/doctools.js docs/html/_static/down-pressed.png docs/html/_static/down.png docs/html/_static/file.png docs/html/_static/jquery.js docs/html/_static/minus.png docs/html/_static/plus.png docs/html/_static/pygments.css docs/html/_static/searchtools.js docs/html/_static/sidebar.js docs/html/_static/underscore.js docs/html/_static/up-pressed.png docs/html/_static/up.png docs/html/_static/websupport.js docs/html/pyfftw/pyfftw.html docs/html/pyfftw/builders/_utils.html docs/html/pyfftw/builders/builders.html docs/html/pyfftw/interfaces/interfaces.html docs/html/pyfftw/interfaces/numpy_fft.html docs/html/pyfftw/interfaces/scipy_fftpack.html docs/html/sphinx/api.html docs/html/sphinx/tutorial.html include/cpu.h include/pyfftw_complex.h include/msvc_2008/stdint.h include/msvc_2010/stdint.h include/win/fftw3.h pyFFTW.egg-info/PKG-INFO pyFFTW.egg-info/SOURCES.txt pyFFTW.egg-info/dependency_links.txt pyFFTW.egg-info/top_level.txt pyfftw/__init__.py pyfftw/cpu.pxd pyfftw/pyfftw.c pyfftw/pyfftw.pxd pyfftw/pyfftw.pyx pyfftw/utils.pxi pyfftw/version.py pyfftw/builders/__init__.py pyfftw/builders/_utils.py pyfftw/builders/builders.py pyfftw/interfaces/__init__.py pyfftw/interfaces/_utils.py pyfftw/interfaces/cache.py pyfftw/interfaces/numpy_fft.py pyfftw/interfaces/scipy_fftpack.py test/__init__.py test/test_pyfftw_base.py test/test_pyfftw_builders.py test/test_pyfftw_call.py test/test_pyfftw_class_misc.py test/test_pyfftw_complex.py test/test_pyfftw_interfaces_cache.py test/test_pyfftw_multithreaded.py test/test_pyfftw_nbyte_align.py test/test_pyfftw_numpy_interface.py test/test_pyfftw_real_backward.py test/test_pyfftw_real_forward.py test/test_pyfftw_scipy_interface.py test/test_pyfftw_utils.py test/test_pyfftw_wisdom.pypyFFTW-0.10.1/pyFFTW.egg-info/dependency_links.txt0000664000175000017500000000000112652703650021173 0ustar whgwhg00000000000000 pyFFTW-0.10.1/setup.cfg0000664000175000017500000000007312652703650014135 0ustar whgwhg00000000000000[egg_info] tag_build = tag_date = 0 tag_svn_revision = 0 pyFFTW-0.10.1/README.rst0000664000175000017500000001502212643723063014003 0ustar whgwhg00000000000000+----------+---------------+ | CI | Master branch | +==========+===============+ | Travis | |travis_ci| | +----------+---------------+ | Appveyor | |appveyor_ci| | +----------+---------------+ .. |travis_ci| image:: https://travis-ci.org/hgomersall/pyFFTW.png?branch=master :align: middle :target: https://travis-ci.org/hgomersall/pyFFTW .. |appveyor_ci| image:: https://ci.appveyor.com/api/projects/status/uf854abck4x1qsjj/branch/master?svg=true :align: middle :target: https://ci.appveyor.com/project/hgomersall/pyfftw PyFFTW ====== pyFFTW is a pythonic wrapper around `FFTW 3 `_, the speedy FFT library. The ultimate aim is to present a unified interface for all the possible transforms that FFTW can perform. Both the complex DFT and the real DFT are supported, as well as on arbitrary axes of abitrary shaped and strided arrays, which makes it almost feature equivalent to standard and real FFT functions of ``numpy.fft`` (indeed, it supports the ``clongdouble`` dtype which ``numpy.fft`` does not). Wisdom import and export now works fairly reliably. Operating FFTW in multithreaded mode is supported. pyFFTW implements the numpy and scipy fft interfaces in order for users to take advantage of the speed of FFTW with minimal code modifications. A comprehensive unittest suite can be found with the source on the github repository or with the source distribution on PyPI. The documentation can be found on `github pages `_, the source is on `github `_ and the python package index page is `here `_. Requirements (i.e. what it was designed for) -------------------------------------------- - Python 2.7 or greater (Python 3 is supported) - Numpy 1.6 - FFTW 3.3 or higher (lower versions *may* work) - Cython 0.15 or higher (though the source release on PyPI loses this dependency) (install these as much as possible with your preferred package manager). Installation ------------ We recommend *not* building from github, but using the release on the python package index with tools such as easy_install or pip:: pip install pyfftw or:: easy_install pyfftw Installers are on the PyPI page for both 32- and 64-bit Windows, which include all the necessary DLLs. With FFTW installed, the PyPI release should install fine on Linux and Mac OSX. It doesn't mean it won't work anywhere else, just we don't have any information on it. Windows development builds are also automatically uploaded to `bintray `_ as wheels (which are built against numpy 1.9), from where they can be downloaded and installed with something like:: pip install pyFFTW-0.10.0.dev0+79ec589-cp35-none-win_amd64.whl where the version and the revision hash are set accordingly. Read on if you do want to build from source... Building -------- To build in place:: python setup.py build_ext --inplace That cythons the python extension and builds it into a shared library which is placed in ``pyfftw/``. The directory can then be treated as a python package. After you've run ``setup.py`` with cython available, you then have a normal C extension in the ``pyfftw`` directory. Further building does not depend on cython (as long as the .c file remains). For more ways of building and installing, see the `distutils documentation `_ and `setuptools documentation `_. Platform specific build info ---------------------------- Windows ~~~~~~~ To build for windows from source, download the fftw dlls for your system and the header file from `here `_ (they're in a zip file) and place them in the pyfftw directory. The files are ``libfftw3-3.dll``, ``libfftw3l-3.dll``, ``libfftw3f-3.dll``. If you're using a version of FFTW other than 3.3, it may be necessary to copy ``fftw3.h`` into ``include\win``. The builds on PyPI use mingw for the 32-bit release and the Windows SDK C++ compiler for the 64-bit release. The scripts should handle this automatically. If you want to compile for 64-bit Windows, you have to use the MS Visual C++ compiler. Set up your environment as described `here `_ and then run `setup.py` with the version of python you wish to target and a suitable build command. For using the MS Visual C++ compiler, you'll need to create a set of suitable `.lib` files as described on the `FFTW page `_. Mac OSX ~~~~~~~ Install FFTW from `homebrew `_:: brew install fftw Set temporary environmental variables, such that pyfftw finds fftw:: export DYLD_LIBRARY_PATH=/usr/local/lib export LDFLAGS="-L/usr/local/include" export CFLAGS="-I/usr/local/include" Now install pyfftw from pip:: pip install pyfftw Notes: `pkgin `_ fftw package does not contain the long or float implementations of fftw and so installation will fail. It has been suggested that `macports `_ might also work fine. You should then replace the LD environmental variables above with the right ones. - DYLD - path for libfftw3.dylib etc - ``find /usr -name libfftw3.dylib`` - LDFLAGS - path for fftw3.h - ``find /usr -name fftw3.h`` Contributions ------------- Contributions are always welcome and valued. The primary restriction on accepting contributions is that they are exhaustively tested. The bulk of pyFFTW has been developed in a test-driven way (i.e. the test to be satisfied is written before the code). I strongly encourage potential contributors to adopt such an approach. See some of my philosophy on testing in development `here `_. If you want to argue with the philosophy, there is probably a good place to do it. New contributions should adhere to pep-8, but this is only weakly enforced (there is loads of legacy stuff that breaks it, and things like a single trailing whitespace is not a big deal). The best place to start with contributing is by raising an issue detailing the specifics of what you wish to achieve (there should be a clear use-case for any new functionality). I tend to respond pretty quickly and am happy to help where I can with any conceptual issues. I suggest reading the issues already open in order that you know where things might be heading, or what others are working on. pyFFTW-0.10.1/setup.py0000664000175000017500000003442212652703411014026 0ustar whgwhg00000000000000# Copyright 2015 Knowledge Economy Developments Ltd # # Henry Gomersall # heng@kedevelopments.co.uk # # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, this # list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright notice, # this list of conditions and the following disclaimer in the documentation # and/or other materials provided with the distribution. # # * Neither the name of the copyright holder nor the names of its contributors # may be used to endorse or promote products derived from this software without # specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. # try: # use setuptools if we can from setuptools import setup, Command, Extension from setuptools.command.build_ext import build_ext using_setuptools = True except ImportError: from distutils.core import setup, Command, Extension from distutils.command.build_ext import build_ext using_setuptools = False from distutils.ccompiler import get_default_compiler import os import sys MAJOR = 0 MINOR = 10 MICRO = 1 ISRELEASED = True VERSION = '%d.%d.%d' % (MAJOR, MINOR, MICRO) def get_package_data(): from pkg_resources import get_build_platform package_data = {} if get_build_platform() in ('win32', 'win-amd64'): package_data['pyfftw'] = [ 'libfftw3-3.dll', 'libfftw3l-3.dll', 'libfftw3f-3.dll'] return package_data def get_include_dirs(): import numpy from pkg_resources import get_build_platform include_dirs = [os.path.join(os.getcwd(), 'include'), os.path.join(os.getcwd(), 'pyfftw'), numpy.get_include()] if get_build_platform() in ('win32', 'win-amd64'): include_dirs.append(os.path.join(os.getcwd(), 'include', 'win')) return include_dirs def get_library_dirs(): from pkg_resources import get_build_platform library_dirs = [] if get_build_platform() in ('win32', 'win-amd64'): library_dirs.append(os.path.join(os.getcwd(), 'pyfftw')) return library_dirs def get_libraries(): from pkg_resources import get_build_platform if get_build_platform() in ('win32', 'win-amd64'): libraries = ['libfftw3-3', 'libfftw3f-3', 'libfftw3l-3'] else: libraries = ['fftw3', 'fftw3f', 'fftw3l', 'fftw3_threads', 'fftw3f_threads', 'fftw3l_threads'] return libraries def get_extensions(): from distutils.extension import Extension common_extension_args = { 'include_dirs': get_include_dirs(), 'library_dirs': get_library_dirs(), 'libraries': get_libraries()} try: from Cython.Build import cythonize sources = [os.path.join(os.getcwd(), 'pyfftw', 'pyfftw.pyx')] have_cython = True except ImportError as e: # no cython sources = [os.path.join(os.getcwd(), 'pyfftw', 'pyfftw.c')] if not os.path.exists(sources[0]): raise ImportError( str(e) + '. ' + 'Cython is required to build the initial .c file.') have_cython = False ext_modules = [ Extension('pyfftw.pyfftw', sources=sources, **common_extension_args)] if have_cython: return cythonize(ext_modules) else: return ext_modules long_description = ''' pyFFTW is a pythonic wrapper around `FFTW `_, the speedy FFT library. The ultimate aim is to present a unified interface for all the possible transforms that FFTW can perform. Both the complex DFT and the real DFT are supported, as well as arbitrary axes of abitrary shaped and strided arrays, which makes it almost feature equivalent to standard and real FFT functions of ``numpy.fft`` (indeed, it supports the ``clongdouble`` dtype which ``numpy.fft`` does not). Operating FFTW in multithreaded mode is supported. A comprehensive unittest suite can be found with the source on the github repository. To build for windows from source, download the fftw dlls for your system and the header file from here (they're in a zip file): http://www.fftw.org/install/windows.html and place them in the pyfftw directory. The files are libfftw3-3.dll, libfftw3l-3.dll, libfftw3f-3.dll and libfftw3.h. Under linux, to build from source, the FFTW library must be installed already. This should probably work for OSX, though I've not tried it. Numpy is a dependency for both. The documentation can be found `here `_, and the source is on `github `_. ''' class custom_build_ext(build_ext): def finalize_options(self): build_ext.finalize_options(self) if self.compiler is None: compiler = get_default_compiler() else: compiler = self.compiler if compiler == 'msvc': # Add msvc specific hacks if (sys.version_info.major, sys.version_info.minor) < (3, 3): # The check above is a nasty hack. We're using the python # version as a proxy for the MSVC version. 2008 doesn't # have stdint.h, so is needed. 2010 does. # # We need to add the path to msvc includes msvc_2008_path = ( os.path.join(os.getcwd(), 'include', 'msvc_2008')) if self.include_dirs is not None: self.include_dirs.append(msvc_2008_path) else: self.include_dirs = [msvc_2008_path] elif (sys.version_info.major, sys.version_info.minor) < (3, 5): # Actually, it seems that appveyor doesn't have a stdint that # works, so even for 2010 we use our own (hacked) version # of stdint. # This should be pretty safe in whatever case. msvc_2010_path = ( os.path.join(os.getcwd(), 'include', 'msvc_2010')) if self.include_dirs is not None: self.include_dirs.append(msvc_2010_path) else: self.include_dirs = [msvc_2010_path] # We need to prepend lib to all the library names _libraries = [] for each_lib in self.libraries: _libraries.append('lib' + each_lib) self.libraries = _libraries class CreateChangelogCommand(Command): '''Depends on the ruby program github_changelog_generator. Install with gem install gihub_changelog_generator. ''' user_options = [] def initialize_options(self): pass def finalize_options(self): pass def run(self): import subprocess github_token_file = 'github_changelog_generator_token' with open(github_token_file) as f: github_token = f.readline().strip() subprocess.call(['github_changelog_generator', '-t', github_token]) class TestCommand(Command): user_options = [] def initialize_options(self): pass def finalize_options(self): pass def run(self): import subprocess errno = subprocess.call([sys.executable, '-m', 'unittest', 'discover']) raise SystemExit(errno) class QuickTestCommand(Command): '''Runs a set of test cases that covers a limited set of the functionality. It is intended that this class be used as a sanity check that everything is loaded and basically working as expected. It is not meant to replace the comprehensive test suite. ''' user_options = [] def initialize_options(self): pass def finalize_options(self): pass def run(self): quick_test_cases = [ 'test.test_pyfftw_complex.Complex64FFTWTest', 'test.test_pyfftw_complex.Complex128FFTWTest.test_2d', 'test.test_pyfftw_complex.ComplexLongDoubleFFTWTest.test_2d', 'test.test_pyfftw_real_forward.RealForwardSingleFFTWTest', 'test.test_pyfftw_real_forward.RealForwardDoubleFFTWTest.test_2d', 'test.test_pyfftw_real_forward.RealForwardLongDoubleFFTWTest.test_2d', 'test.test_pyfftw_real_backward.RealBackwardSingleFFTWTest', 'test.test_pyfftw_real_backward.RealBackwardDoubleFFTWTest.test_2d', 'test.test_pyfftw_real_backward.RealBackwardLongDoubleFFTWTest.test_2d', 'test.test_pyfftw_wisdom', 'test.test_pyfftw_utils', 'test.test_pyfftw_call', 'test.test_pyfftw_class_misc', 'test.test_pyfftw_nbyte_align', 'test.test_pyfftw_interfaces_cache', 'test.test_pyfftw_multithreaded', 'test.test_pyfftw_numpy_interface.InterfacesNumpyFFTTestModule', 'test.test_pyfftw_numpy_interface.InterfacesNumpyFFTTestFFT2', 'test.test_pyfftw_numpy_interface.InterfacesNumpyFFTTestIFFT2', 'test.test_pyfftw_builders.BuildersTestFFTWWrapper', 'test.test_pyfftw_builders.BuildersTestFFT2', 'test.test_pyfftw_builders.BuildersTestIRFFT2', ] import subprocess errno = subprocess.call([sys.executable, '-m', 'unittest'] + quick_test_cases) raise SystemExit(errno) # borrowed from scipy via pyNFFT def git_version(): import subprocess def _minimal_ext_cmd(cmd): # construct minimal environment env = {} for k in ['SYSTEMROOT', 'PATH']: v = os.environ.get(k) if v is not None: env[k] = v # LANGUAGE is used on win32 env['LANGUAGE'] = 'C' env['LANG'] = 'C' env['LC_ALL'] = 'C' out = subprocess.Popen(cmd, stdout = subprocess.PIPE, env=env).communicate()[0] return out try: out = _minimal_ext_cmd(['git', 'rev-parse', 'HEAD']) GIT_REVISION = out.strip().decode('ascii') except OSError: GIT_REVISION = "Unknown" return GIT_REVISION # borrowed from scipy via pyNFFT def get_version_info(): FULLVERSION = VERSION if os.path.exists('.git'): GIT_REVISION = git_version() elif os.path.exists('pyfftw/version.py'): # must be a source distribution, use existing version file # load it as a separate module in order not to load __init__.py import imp version = imp.load_source('pyfftw.version', 'pyfftw/version.py') GIT_REVISION = version.git_revision else: GIT_REVISION = "Unknown" if not ISRELEASED: FULLVERSION += '.dev0+' + GIT_REVISION[:7] return FULLVERSION, GIT_REVISION # borrowed from scipy via pyNFFT def write_version_py(filename='pyfftw/version.py'): cnt = """ # THIS FILE IS GENERATED FROM SETUP.PY short_version = '%(version)s' version = '%(version)s' full_version = '%(full_version)s' git_revision = '%(git_revision)s' release = %(isrelease)s if not release: version = full_version if __name__ == "__main__": print(short_version) print(version) """ FULLVERSION, GIT_REVISION = get_version_info() f = open(filename, 'w') try: f.write(cnt % {'version': VERSION, 'full_version' : FULLVERSION, 'git_revision' : GIT_REVISION, 'isrelease': str(ISRELEASED)}) finally: f.close() def setup_package(): # Get current version FULLVERSION, GIT_REVISION = get_version_info() # Refresh version file write_version_py() # Figure out whether to add ``*_requires = ['numpy']``. build_requires = [] try: import numpy except ImportError: build_requires = ['numpy>=1.6, <2.0'] setup_args = { 'name': 'pyFFTW', 'version': FULLVERSION, 'author': 'Henry Gomersall', 'author_email': 'heng@kedevelopments.co.uk', 'description': ( 'A pythonic wrapper around FFTW, the FFT library, presenting a ' 'unified interface for all the supported transforms.'), 'url': 'http://hgomersall.github.com/pyFFTW/', 'long_description': long_description, 'classifiers': [ 'Programming Language :: Python', 'Programming Language :: Python :: 3', 'Development Status :: 4 - Beta', 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', 'Intended Audience :: Developers', 'Intended Audience :: Science/Research', 'Topic :: Scientific/Engineering', 'Topic :: Scientific/Engineering :: Mathematics', 'Topic :: Multimedia :: Sound/Audio :: Analysis'], 'cmdclass': {'test': TestCommand, 'quick_test': QuickTestCommand, 'build_ext': custom_build_ext, 'create_changelog': CreateChangelogCommand} } if using_setuptools: setup_args['setup_requires'] = build_requires setup_args['install_requires'] = build_requires if len(sys.argv) >= 2 and ( '--help' in sys.argv[1:] or sys.argv[1] in ('--help-commands', 'egg_info', '--version', 'clean')): # For these actions, NumPy is not required. pass else: setup_args['packages'] = [ 'pyfftw', 'pyfftw.builders', 'pyfftw.interfaces'] setup_args['ext_modules'] = get_extensions() setup_args['package_data'] = get_package_data() setup(**setup_args) if __name__ == '__main__': setup_package() pyFFTW-0.10.1/requirements.txt0000664000175000017500000000003112570060606015566 0ustar whgwhg00000000000000numpy>=1.6 scipy>=0.12.0