File: Fix-compatibility-with-NFFT-3.3.patch

package info (click to toggle)
pynfft 1.3.2-2
  • links: PTS, VCS
  • area: main
  • in suites: buster, stretch
  • size: 1,444 kB
  • ctags: 2,436
  • sloc: python: 348; makefile: 134; sh: 20
file content (121 lines) | stat: -rw-r--r-- 4,352 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
From: Ghislain Antony Vaillant <ghisvail@gmail.com>
Date: Thu, 11 Feb 2016 09:59:02 +0000
Subject: Fix compatibility with NFFT 3.3.

---
 pynfft/cnfft3.pxd     |  9 +++++++++
 pynfft/cnfft3util.pxd | 34 ----------------------------------
 pynfft/util.pyx       | 35 +----------------------------------
 3 files changed, 10 insertions(+), 68 deletions(-)
 delete mode 100644 pynfft/cnfft3util.pxd

diff --git a/pynfft/cnfft3.pxd b/pynfft/cnfft3.pxd
index 3e2424d..89da296 100644
--- a/pynfft/cnfft3.pxd
+++ b/pynfft/cnfft3.pxd
@@ -142,6 +142,15 @@ cdef extern from "nfft3.h":
         # Destroys the plan for the inverse transform.
 
 
+    # Utilities
+    void nfft_vrand_unit_complex (fftw_complex *x, int n)
+        # Inits a vector of random complex numbers in \
+        # $[0,1]\times[0,1]{\rm i}$ .
+
+    void nfft_vrand_shifted_unit_double (double *x, int n)
+        # Inits a vector of random double numbers in $[-1/2,1/2]$ .
+
+
 cdef extern from "fftw3.h":
     
     void fftw_cleanup()
diff --git a/pynfft/cnfft3util.pxd b/pynfft/cnfft3util.pxd
deleted file mode 100644
index 5dbdd18..0000000
--- a/pynfft/cnfft3util.pxd
+++ /dev/null
@@ -1,34 +0,0 @@
-# -*- coding: utf-8 -*-
-#
-# Copyright (C) 2013  Ghislain Vaillant
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-from cnfft3 cimport fftw_complex
-
-cdef extern from "nfft3util.h":
-
-    void nfft_vrand_unit_complex (fftw_complex *x, int n)
- 	    # Inits a vector of random complex numbers in \
-        # $[0,1]\times[0,1]{\rm i}$ .
-
-    void nfft_vrand_shifted_unit_double (double *x, int n)
-        # Inits a vector of random double numbers in $[-1/2,1/2]$ .
-
-    void nfft_voronoi_weights_1d (double *w, double *x, int M)
- 	    # Computes non periodic voronoi weights, \
-        # assumes ordered nodes $x_j$.
-
-    void nfft_voronoi_weights_S2(double *w, double *xi, int M)
-        # Computes voronoi weights for nodes on the sphere S^2. */
diff --git a/pynfft/util.pyx b/pynfft/util.pyx
index e03cf56..c176b33 100644
--- a/pynfft/util.pyx
+++ b/pynfft/util.pyx
@@ -17,7 +17,7 @@
 
 import numpy as np
 cimport numpy as np
-from cnfft3util cimport *
+from cnfft3 cimport *
 
 
 # Numpy must be initialized. When using numpy from C or Cython you must
@@ -48,36 +48,3 @@ def vrand_shifted_unit_double (object[np.float64_t, mode='c'] x not None):
     :type x: ndarray <float64>
     '''
     nfft_vrand_shifted_unit_double(<double *>&x[0], x.size)
-
-def voronoi_weights_1d (object[np.float64_t, mode='c'] w not None,
-                        object[np.float64_t, mode='c'] x not None):
-    '''
-    Utilitary function for computing density compensation weights from 1D knots.
-
-    :param w: pre-allocated array
-    :type w: ndarray <float64>
-    :param x: ordered 1D knots
-    :type x: ndarray <float64>
-    '''
-    if x.size != w.size:
-        raise ValueError('Incompatible size between weights and nodes \
-                         (%d, %d)'%(w.size, x.size))
-    nfft_voronoi_weights_1d(<double *>&w[0], <double *>&x[0], w.size)
-
-def voronoi_weights_S2 (object[np.float64_t, mode='c'] w not None,
-                        object[np.float64_t, mode='c'] xi not None):
-    '''
-    Utilitary function for computing density compensation weights from knots
-    located on the surface of a sphere.
-
-    Useful for reconstruction of 3D radial data.
-
-    :param w: pre-allocated array
-    :type w: ndarray <float64>
-    :param xi: angular locations (2D) on the unit sphere
-    :type xi: ndarray <float64>
-    '''
-    if xi.size != 2 * w.size:
-        raise ValueError('Incompatible size between weights and nodes \
-                         (%d, %d)'%(w.size, xi.size))
-    nfft_voronoi_weights_S2(<double *>&w[0], <double *>&xi[0], w.size)