File Coverage

lib/PDL/Image2D-pp-rescale2d.c
Criterion Covered Total %
statement 0 1135 0.0
branch 0 1990 0.0
condition n/a
subroutine n/a
pod n/a
total 0 3125 0.0


line stmt bran cond sub pod time code
1              
2             #line 453 "lib/PDL/PP.pm"
3             /*
4             * THIS FILE WAS GENERATED BY PDL::PP from lib/PDL/Image2D.pd! Do not modify!
5             */
6              
7             #define PDL_FREE_CODE(trans, destroy, comp_free_code, ntpriv_free_code) \
8             if (destroy) { \
9             comp_free_code \
10             } \
11             if ((trans)->dims_redone) { \
12             ntpriv_free_code \
13             }
14              
15             #include "EXTERN.h"
16             #include "perl.h"
17             #include "XSUB.h"
18             #include "pdl.h"
19             #include "pdlcore.h"
20             #define PDL PDL_Image2D
21             extern Core* PDL; /* Structure hold core C functions */
22             #line 23 "lib/PDL/Image2D-pp-rescale2d.c"
23              
24             /* Fast Modulus with proper negative behaviour */
25              
26             #define REALMOD(a,b) {while ((a)>=(b)) (a) -= (b); while ((a)<0) (a) += (b);}
27              
28             #define X(symbol, ctype, ppsym, ...) \
29             ctype quick_select_ ## ppsym(ctype arr[], int n);
30             PDL_TYPELIST_REAL(X)
31             #undef X
32             #define EZ(x) ez ? 0 : (x)
33             int getnewsize(PDL_Indx cols, PDL_Indx rows, float fangle, PDL_Indx *newcols, PDL_Indx *newrows);
34             typedef unsigned char imT; /* image type */
35             int rotate(imT *im, imT *out, int cols, int rows, int nc, int nr,
36             float fangle, imT bgval, int antialias);
37              
38             #line 1857 "lib/PDL/PP.pm"
39             pdl_error pdl_rescale2d_readdata(pdl_trans *__privtrans) {
40             pdl_error PDL_err = {0, NULL, 0};
41             #line 42 "lib/PDL/Image2D-pp-rescale2d.c"
42 0           register PDL_Indx __m_size = __privtrans->ind_sizes[0];
43 0           register PDL_Indx __n_size = __privtrans->ind_sizes[1];
44 0           register PDL_Indx __p_size = __privtrans->ind_sizes[2];
45 0           register PDL_Indx __q_size = __privtrans->ind_sizes[3];
46 0 0         if (!__privtrans->broadcast.incs) return PDL->make_error(PDL_EUSERERROR, "Error in rescale2d:" "broadcast.incs NULL");
47             /* broadcastloop declarations */
48             int __brcloopval;
49             register PDL_Indx __tind0,__tind1; /* counters along dim */
50 0           register PDL_Indx __tnpdls = __privtrans->broadcast.npdls;
51             /* dims here are how many steps along those dims */
52 0           register PDL_Indx __tinc0_Int = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,0,0);
53 0           register PDL_Indx __tinc0_O = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,1,0);
54 0           register PDL_Indx __tinc1_Int = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,0,1);
55 0           register PDL_Indx __tinc1_O = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,1,1);
56             #define PDL_BROADCASTLOOP_START_rescale2d_readdata PDL_BROADCASTLOOP_START( \
57             readdata, \
58             __privtrans->broadcast, \
59             __privtrans->vtable, \
60             Int_datap += __offsp[0]; \
61             O_datap += __offsp[1]; \
62             , \
63             ( ,Int_datap += __tinc1_Int - __tinc0_Int * __tdims0 \
64             ,O_datap += __tinc1_O - __tinc0_O * __tdims0 \
65             ), \
66             ( ,Int_datap += __tinc0_Int \
67             ,O_datap += __tinc0_O \
68             ) \
69             )
70             #define PDL_BROADCASTLOOP_END_rescale2d_readdata PDL_BROADCASTLOOP_END( \
71             __privtrans->broadcast, \
72             Int_datap -= __tinc1_Int * __tdims1 + __offsp[0]; \
73             O_datap -= __tinc1_O * __tdims1 + __offsp[1]; \
74             )
75 0           register PDL_Indx __inc_Int_m = __privtrans->inc_sizes[PDL_INC_ID(__privtrans->vtable,0,0)]; (void)__inc_Int_m;register PDL_Indx __inc_Int_n = __privtrans->inc_sizes[PDL_INC_ID(__privtrans->vtable,0,1)]; (void)__inc_Int_n;
76 0           register PDL_Indx __inc_O_p = __privtrans->inc_sizes[PDL_INC_ID(__privtrans->vtable,1,0)]; (void)__inc_O_p;register PDL_Indx __inc_O_q = __privtrans->inc_sizes[PDL_INC_ID(__privtrans->vtable,1,1)]; (void)__inc_O_q;
77             #ifndef PDL_DECLARE_PARAMS_rescale2d_1
78             #define PDL_DECLARE_PARAMS_rescale2d_1(PDL_TYPE_OP,PDL_PPSYM_OP) \
79             PDL_DECLARE_PARAMETER(PDL_TYPE_OP, Int, (__privtrans->pdls[0]), 1, PDL_PPSYM_OP) \
80             PDL_DECLARE_PARAMETER(PDL_TYPE_OP, O, (__privtrans->pdls[1]), 1, PDL_PPSYM_OP)
81             #endif
82             #define PDL_IF_BAD(t,f) f
83 0           switch (__privtrans->__datatype) { /* Start generic switch */
84 0           case PDL_SB: {
85 0 0         PDL_DECLARE_PARAMS_rescale2d_1(PDL_SByte,A)
    0          
    0          
    0          
    0          
    0          
86             {
87 0 0         if(__privtrans->ind_sizes[2] >= __privtrans->ind_sizes[0] && __privtrans->ind_sizes[3] >= __privtrans->ind_sizes[1]) {
    0          
88 0           PDL_LDouble kx = ((PDL_LDouble) __privtrans->ind_sizes[2]) / __privtrans->ind_sizes[0];
89 0           PDL_LDouble ky = ((PDL_LDouble) __privtrans->ind_sizes[3]) / __privtrans->ind_sizes[1];
90 0 0         PDL_BROADCASTLOOP_START_rescale2d_readdata
    0          
    0          
    0          
    0          
    0          
    0          
91 0           PDL_Indx lx = 0;
92 0 0         {/* Open m */ PDL_EXPAND2(register PDL_Indx m=0, __m_stop=(__m_size)); for(; m<__m_stop; m+=1) {
93 0           PDL_Indx ly = 0, cx = rint((m+1)*kx);
94 0 0         {/* Open n */ PDL_EXPAND2(register PDL_Indx n=0, __n_stop=(__n_size)); for(; n<__n_stop; n+=1) {
95 0           PDL_Indx cy = rint((n+1)*ky);
96 0 0         {/* Open p=lx:cx */ PDL_EXPAND2(register PDL_Indx p=PDLMAX((lx),0), __p_stop=PDLMIN(cx, (__p_size))); for(; p<__p_stop; p+=1) {{/* Open q=ly:cy */ PDL_EXPAND2(register PDL_Indx q=PDLMAX((ly),0), __q_stop=PDLMIN(cy, (__q_size))); for(; q<__q_stop; q+=1) {
    0          
97 0           (O_datap)[0+(__inc_O_p*(p))+(__inc_O_q*(q))] += (Int_datap)[0+(__inc_Int_m*(m))+(__inc_Int_n*(n))];
98             }} /* Close p=lx:cx */}} /* Close q=ly:cy */
99 0           ly = cy + 1;
100             }} /* Close n */
101 0           lx = cx + 1;
102             }} /* Close m */
103 0 0         PDL_BROADCASTLOOP_END_rescale2d_readdata
    0          
104             }
105 0 0         else if(__privtrans->ind_sizes[2] < __privtrans->ind_sizes[0] && __privtrans->ind_sizes[3] < __privtrans->ind_sizes[1]) {
    0          
106 0           PDL_LDouble kx = ((PDL_LDouble) __privtrans->ind_sizes[0]) / __privtrans->ind_sizes[2];
107 0           PDL_LDouble ky = ((PDL_LDouble) __privtrans->ind_sizes[1]) / __privtrans->ind_sizes[3];
108 0 0         PDL_BROADCASTLOOP_START_rescale2d_readdata
    0          
    0          
    0          
    0          
    0          
    0          
109 0           PDL_Indx lx = 0;
110 0 0         {/* Open p */ PDL_EXPAND2(register PDL_Indx p=0, __p_stop=(__p_size)); for(; p<__p_stop; p+=1) {
111 0           PDL_Indx ly = 0, cx = rint((p+1)*kx);
112 0 0         {/* Open q */ PDL_EXPAND2(register PDL_Indx q=0, __q_stop=(__q_size)); for(; q<__q_stop; q+=1) {
113 0           PDL_Indx cy = rint((q+1)*ky);
114 0           PDL_LDouble temp = 0.0;
115 0           PDL_Indx num = 0;
116 0 0         {/* Open m=lx:cx */ PDL_EXPAND2(register PDL_Indx m=PDLMAX((lx),0), __m_stop=PDLMIN(cx, (__m_size))); for(; m<__m_stop; m+=1) {{/* Open n=ly:cy */ PDL_EXPAND2(register PDL_Indx n=PDLMAX((ly),0), __n_stop=PDLMIN(cy, (__n_size))); for(; n<__n_stop; n+=1) {
    0          
117 0           temp += (Int_datap)[0+(__inc_Int_m*(m))+(__inc_Int_n*(n))];
118 0           num++;
119             }} /* Close m=lx:cx */}} /* Close n=ly:cy */
120 0           (O_datap)[0+(__inc_O_p*(p))+(__inc_O_q*(q))] += temp/num;
121 0           ly = cy + 1;
122             }} /* Close q */
123 0           lx = cx + 1;
124             }} /* Close p */
125 0 0         PDL_BROADCASTLOOP_END_rescale2d_readdata
    0          
126             }
127 0 0         else if(__privtrans->ind_sizes[2] >= __privtrans->ind_sizes[0] && __privtrans->ind_sizes[3] < __privtrans->ind_sizes[1]) {
    0          
128 0           PDL_LDouble kx = ((PDL_LDouble) __privtrans->ind_sizes[2]) / __privtrans->ind_sizes[0];
129 0           PDL_LDouble ky = ((PDL_LDouble) __privtrans->ind_sizes[1]) / __privtrans->ind_sizes[3];
130 0 0         PDL_BROADCASTLOOP_START_rescale2d_readdata
    0          
    0          
    0          
    0          
    0          
    0          
131 0           PDL_Indx lx = 0;
132 0 0         {/* Open m */ PDL_EXPAND2(register PDL_Indx m=0, __m_stop=(__m_size)); for(; m<__m_stop; m+=1) {
133 0           PDL_Indx ly = 0, cx = rint((m+1)*kx);
134 0 0         {/* Open q */ PDL_EXPAND2(register PDL_Indx q=0, __q_stop=(__q_size)); for(; q<__q_stop; q+=1) {
135 0           PDL_Indx cy = rint((q+1)*ky);
136 0           PDL_LDouble temp = 0.0;
137 0           PDL_Indx num = 0;
138 0 0         {/* Open n=ly:cy */ PDL_EXPAND2(register PDL_Indx n=PDLMAX((ly),0), __n_stop=PDLMIN(cy, (__n_size))); for(; n<__n_stop; n+=1) {
139 0           temp += (Int_datap)[0+(__inc_Int_m*(m))+(__inc_Int_n*(n))];
140 0           num++;
141             }} /* Close n=ly:cy */
142 0 0         {/* Open p=lx:cx */ PDL_EXPAND2(register PDL_Indx p=PDLMAX((lx),0), __p_stop=PDLMIN(cx, (__p_size))); for(; p<__p_stop; p+=1) {
143 0           (O_datap)[0+(__inc_O_p*(p))+(__inc_O_q*(q))] += temp/num;
144             }} /* Close p=lx:cx */
145 0           ly = cy + 1;
146             }} /* Close q */
147 0           lx = cx + 1;
148             }} /* Close m */
149 0 0         PDL_BROADCASTLOOP_END_rescale2d_readdata
    0          
150             }
151 0 0         else if(__privtrans->ind_sizes[2] < __privtrans->ind_sizes[0] && __privtrans->ind_sizes[3] >= __privtrans->ind_sizes[1]) {
    0          
152 0           PDL_LDouble kx = ((PDL_LDouble) __privtrans->ind_sizes[0]) / __privtrans->ind_sizes[2];
153 0           PDL_LDouble ky = ((PDL_LDouble) __privtrans->ind_sizes[3]) / __privtrans->ind_sizes[1];
154 0 0         PDL_BROADCASTLOOP_START_rescale2d_readdata
    0          
    0          
    0          
    0          
    0          
    0          
155 0           PDL_Indx lx = 0;
156 0 0         {/* Open p */ PDL_EXPAND2(register PDL_Indx p=0, __p_stop=(__p_size)); for(; p<__p_stop; p+=1) {
157 0           PDL_Indx ly = 0, cx = rint((p+1)*kx);
158 0 0         {/* Open n */ PDL_EXPAND2(register PDL_Indx n=0, __n_stop=(__n_size)); for(; n<__n_stop; n+=1) {
159 0           PDL_Indx cy = rint((n+1)*ky);
160 0           PDL_CLDouble temp = 0.0;
161 0           PDL_Indx num = 0;
162 0 0         {/* Open m=lx:cx */ PDL_EXPAND2(register PDL_Indx m=PDLMAX((lx),0), __m_stop=PDLMIN(cx, (__m_size))); for(; m<__m_stop; m+=1) {
163 0           temp += (Int_datap)[0+(__inc_Int_m*(m))+(__inc_Int_n*(n))];
164 0           num++;
165             }} /* Close m=lx:cx */
166 0 0         {/* Open q=ly:cy */ PDL_EXPAND2(register PDL_Indx q=PDLMAX((ly),0), __q_stop=PDLMIN(cy, (__q_size))); for(; q<__q_stop; q+=1) {
167 0           (O_datap)[0+(__inc_O_p*(p))+(__inc_O_q*(q))] += temp/num;
168             }} /* Close q=ly:cy */
169 0           ly = cy + 1;
170             }} /* Close n */
171 0           lx = cx + 1;
172             }} /* Close p */
173 0 0         PDL_BROADCASTLOOP_END_rescale2d_readdata
    0          
174             }
175 0           else return PDL->make_error(PDL_EUSERERROR, "Error in rescale2d:" "I am not supposed to be here, please report the bug to ");
176             }
177 0           } break;
178 0           case PDL_B: {
179 0 0         PDL_DECLARE_PARAMS_rescale2d_1(PDL_Byte,B)
    0          
    0          
    0          
    0          
    0          
180             {
181 0 0         if(__privtrans->ind_sizes[2] >= __privtrans->ind_sizes[0] && __privtrans->ind_sizes[3] >= __privtrans->ind_sizes[1]) {
    0          
182 0           PDL_LDouble kx = ((PDL_LDouble) __privtrans->ind_sizes[2]) / __privtrans->ind_sizes[0];
183 0           PDL_LDouble ky = ((PDL_LDouble) __privtrans->ind_sizes[3]) / __privtrans->ind_sizes[1];
184 0 0         PDL_BROADCASTLOOP_START_rescale2d_readdata
    0          
    0          
    0          
    0          
    0          
    0          
185 0           PDL_Indx lx = 0;
186 0 0         {/* Open m */ PDL_EXPAND2(register PDL_Indx m=0, __m_stop=(__m_size)); for(; m<__m_stop; m+=1) {
187 0           PDL_Indx ly = 0, cx = rint((m+1)*kx);
188 0 0         {/* Open n */ PDL_EXPAND2(register PDL_Indx n=0, __n_stop=(__n_size)); for(; n<__n_stop; n+=1) {
189 0           PDL_Indx cy = rint((n+1)*ky);
190 0 0         {/* Open p=lx:cx */ PDL_EXPAND2(register PDL_Indx p=PDLMAX((lx),0), __p_stop=PDLMIN(cx, (__p_size))); for(; p<__p_stop; p+=1) {{/* Open q=ly:cy */ PDL_EXPAND2(register PDL_Indx q=PDLMAX((ly),0), __q_stop=PDLMIN(cy, (__q_size))); for(; q<__q_stop; q+=1) {
    0          
191 0           (O_datap)[0+(__inc_O_p*(p))+(__inc_O_q*(q))] += (Int_datap)[0+(__inc_Int_m*(m))+(__inc_Int_n*(n))];
192             }} /* Close p=lx:cx */}} /* Close q=ly:cy */
193 0           ly = cy + 1;
194             }} /* Close n */
195 0           lx = cx + 1;
196             }} /* Close m */
197 0 0         PDL_BROADCASTLOOP_END_rescale2d_readdata
    0          
198             }
199 0 0         else if(__privtrans->ind_sizes[2] < __privtrans->ind_sizes[0] && __privtrans->ind_sizes[3] < __privtrans->ind_sizes[1]) {
    0          
200 0           PDL_LDouble kx = ((PDL_LDouble) __privtrans->ind_sizes[0]) / __privtrans->ind_sizes[2];
201 0           PDL_LDouble ky = ((PDL_LDouble) __privtrans->ind_sizes[1]) / __privtrans->ind_sizes[3];
202 0 0         PDL_BROADCASTLOOP_START_rescale2d_readdata
    0          
    0          
    0          
    0          
    0          
    0          
203 0           PDL_Indx lx = 0;
204 0 0         {/* Open p */ PDL_EXPAND2(register PDL_Indx p=0, __p_stop=(__p_size)); for(; p<__p_stop; p+=1) {
205 0           PDL_Indx ly = 0, cx = rint((p+1)*kx);
206 0 0         {/* Open q */ PDL_EXPAND2(register PDL_Indx q=0, __q_stop=(__q_size)); for(; q<__q_stop; q+=1) {
207 0           PDL_Indx cy = rint((q+1)*ky);
208 0           PDL_LDouble temp = 0.0;
209 0           PDL_Indx num = 0;
210 0 0         {/* Open m=lx:cx */ PDL_EXPAND2(register PDL_Indx m=PDLMAX((lx),0), __m_stop=PDLMIN(cx, (__m_size))); for(; m<__m_stop; m+=1) {{/* Open n=ly:cy */ PDL_EXPAND2(register PDL_Indx n=PDLMAX((ly),0), __n_stop=PDLMIN(cy, (__n_size))); for(; n<__n_stop; n+=1) {
    0          
211 0           temp += (Int_datap)[0+(__inc_Int_m*(m))+(__inc_Int_n*(n))];
212 0           num++;
213             }} /* Close m=lx:cx */}} /* Close n=ly:cy */
214 0           (O_datap)[0+(__inc_O_p*(p))+(__inc_O_q*(q))] += temp/num;
215 0           ly = cy + 1;
216             }} /* Close q */
217 0           lx = cx + 1;
218             }} /* Close p */
219 0 0         PDL_BROADCASTLOOP_END_rescale2d_readdata
    0          
220             }
221 0 0         else if(__privtrans->ind_sizes[2] >= __privtrans->ind_sizes[0] && __privtrans->ind_sizes[3] < __privtrans->ind_sizes[1]) {
    0          
222 0           PDL_LDouble kx = ((PDL_LDouble) __privtrans->ind_sizes[2]) / __privtrans->ind_sizes[0];
223 0           PDL_LDouble ky = ((PDL_LDouble) __privtrans->ind_sizes[1]) / __privtrans->ind_sizes[3];
224 0 0         PDL_BROADCASTLOOP_START_rescale2d_readdata
    0          
    0          
    0          
    0          
    0          
    0          
225 0           PDL_Indx lx = 0;
226 0 0         {/* Open m */ PDL_EXPAND2(register PDL_Indx m=0, __m_stop=(__m_size)); for(; m<__m_stop; m+=1) {
227 0           PDL_Indx ly = 0, cx = rint((m+1)*kx);
228 0 0         {/* Open q */ PDL_EXPAND2(register PDL_Indx q=0, __q_stop=(__q_size)); for(; q<__q_stop; q+=1) {
229 0           PDL_Indx cy = rint((q+1)*ky);
230 0           PDL_LDouble temp = 0.0;
231 0           PDL_Indx num = 0;
232 0 0         {/* Open n=ly:cy */ PDL_EXPAND2(register PDL_Indx n=PDLMAX((ly),0), __n_stop=PDLMIN(cy, (__n_size))); for(; n<__n_stop; n+=1) {
233 0           temp += (Int_datap)[0+(__inc_Int_m*(m))+(__inc_Int_n*(n))];
234 0           num++;
235             }} /* Close n=ly:cy */
236 0 0         {/* Open p=lx:cx */ PDL_EXPAND2(register PDL_Indx p=PDLMAX((lx),0), __p_stop=PDLMIN(cx, (__p_size))); for(; p<__p_stop; p+=1) {
237 0           (O_datap)[0+(__inc_O_p*(p))+(__inc_O_q*(q))] += temp/num;
238             }} /* Close p=lx:cx */
239 0           ly = cy + 1;
240             }} /* Close q */
241 0           lx = cx + 1;
242             }} /* Close m */
243 0 0         PDL_BROADCASTLOOP_END_rescale2d_readdata
    0          
244             }
245 0 0         else if(__privtrans->ind_sizes[2] < __privtrans->ind_sizes[0] && __privtrans->ind_sizes[3] >= __privtrans->ind_sizes[1]) {
    0          
246 0           PDL_LDouble kx = ((PDL_LDouble) __privtrans->ind_sizes[0]) / __privtrans->ind_sizes[2];
247 0           PDL_LDouble ky = ((PDL_LDouble) __privtrans->ind_sizes[3]) / __privtrans->ind_sizes[1];
248 0 0         PDL_BROADCASTLOOP_START_rescale2d_readdata
    0          
    0          
    0          
    0          
    0          
    0          
249 0           PDL_Indx lx = 0;
250 0 0         {/* Open p */ PDL_EXPAND2(register PDL_Indx p=0, __p_stop=(__p_size)); for(; p<__p_stop; p+=1) {
251 0           PDL_Indx ly = 0, cx = rint((p+1)*kx);
252 0 0         {/* Open n */ PDL_EXPAND2(register PDL_Indx n=0, __n_stop=(__n_size)); for(; n<__n_stop; n+=1) {
253 0           PDL_Indx cy = rint((n+1)*ky);
254 0           PDL_CLDouble temp = 0.0;
255 0           PDL_Indx num = 0;
256 0 0         {/* Open m=lx:cx */ PDL_EXPAND2(register PDL_Indx m=PDLMAX((lx),0), __m_stop=PDLMIN(cx, (__m_size))); for(; m<__m_stop; m+=1) {
257 0           temp += (Int_datap)[0+(__inc_Int_m*(m))+(__inc_Int_n*(n))];
258 0           num++;
259             }} /* Close m=lx:cx */
260 0 0         {/* Open q=ly:cy */ PDL_EXPAND2(register PDL_Indx q=PDLMAX((ly),0), __q_stop=PDLMIN(cy, (__q_size))); for(; q<__q_stop; q+=1) {
261 0           (O_datap)[0+(__inc_O_p*(p))+(__inc_O_q*(q))] += temp/num;
262             }} /* Close q=ly:cy */
263 0           ly = cy + 1;
264             }} /* Close n */
265 0           lx = cx + 1;
266             }} /* Close p */
267 0 0         PDL_BROADCASTLOOP_END_rescale2d_readdata
    0          
268             }
269 0           else return PDL->make_error(PDL_EUSERERROR, "Error in rescale2d:" "I am not supposed to be here, please report the bug to ");
270             }
271 0           } break;
272 0           case PDL_S: {
273 0 0         PDL_DECLARE_PARAMS_rescale2d_1(PDL_Short,S)
    0          
    0          
    0          
    0          
    0          
274             {
275 0 0         if(__privtrans->ind_sizes[2] >= __privtrans->ind_sizes[0] && __privtrans->ind_sizes[3] >= __privtrans->ind_sizes[1]) {
    0          
276 0           PDL_LDouble kx = ((PDL_LDouble) __privtrans->ind_sizes[2]) / __privtrans->ind_sizes[0];
277 0           PDL_LDouble ky = ((PDL_LDouble) __privtrans->ind_sizes[3]) / __privtrans->ind_sizes[1];
278 0 0         PDL_BROADCASTLOOP_START_rescale2d_readdata
    0          
    0          
    0          
    0          
    0          
    0          
279 0           PDL_Indx lx = 0;
280 0 0         {/* Open m */ PDL_EXPAND2(register PDL_Indx m=0, __m_stop=(__m_size)); for(; m<__m_stop; m+=1) {
281 0           PDL_Indx ly = 0, cx = rint((m+1)*kx);
282 0 0         {/* Open n */ PDL_EXPAND2(register PDL_Indx n=0, __n_stop=(__n_size)); for(; n<__n_stop; n+=1) {
283 0           PDL_Indx cy = rint((n+1)*ky);
284 0 0         {/* Open p=lx:cx */ PDL_EXPAND2(register PDL_Indx p=PDLMAX((lx),0), __p_stop=PDLMIN(cx, (__p_size))); for(; p<__p_stop; p+=1) {{/* Open q=ly:cy */ PDL_EXPAND2(register PDL_Indx q=PDLMAX((ly),0), __q_stop=PDLMIN(cy, (__q_size))); for(; q<__q_stop; q+=1) {
    0          
285 0           (O_datap)[0+(__inc_O_p*(p))+(__inc_O_q*(q))] += (Int_datap)[0+(__inc_Int_m*(m))+(__inc_Int_n*(n))];
286             }} /* Close p=lx:cx */}} /* Close q=ly:cy */
287 0           ly = cy + 1;
288             }} /* Close n */
289 0           lx = cx + 1;
290             }} /* Close m */
291 0 0         PDL_BROADCASTLOOP_END_rescale2d_readdata
    0          
292             }
293 0 0         else if(__privtrans->ind_sizes[2] < __privtrans->ind_sizes[0] && __privtrans->ind_sizes[3] < __privtrans->ind_sizes[1]) {
    0          
294 0           PDL_LDouble kx = ((PDL_LDouble) __privtrans->ind_sizes[0]) / __privtrans->ind_sizes[2];
295 0           PDL_LDouble ky = ((PDL_LDouble) __privtrans->ind_sizes[1]) / __privtrans->ind_sizes[3];
296 0 0         PDL_BROADCASTLOOP_START_rescale2d_readdata
    0          
    0          
    0          
    0          
    0          
    0          
297 0           PDL_Indx lx = 0;
298 0 0         {/* Open p */ PDL_EXPAND2(register PDL_Indx p=0, __p_stop=(__p_size)); for(; p<__p_stop; p+=1) {
299 0           PDL_Indx ly = 0, cx = rint((p+1)*kx);
300 0 0         {/* Open q */ PDL_EXPAND2(register PDL_Indx q=0, __q_stop=(__q_size)); for(; q<__q_stop; q+=1) {
301 0           PDL_Indx cy = rint((q+1)*ky);
302 0           PDL_LDouble temp = 0.0;
303 0           PDL_Indx num = 0;
304 0 0         {/* Open m=lx:cx */ PDL_EXPAND2(register PDL_Indx m=PDLMAX((lx),0), __m_stop=PDLMIN(cx, (__m_size))); for(; m<__m_stop; m+=1) {{/* Open n=ly:cy */ PDL_EXPAND2(register PDL_Indx n=PDLMAX((ly),0), __n_stop=PDLMIN(cy, (__n_size))); for(; n<__n_stop; n+=1) {
    0          
305 0           temp += (Int_datap)[0+(__inc_Int_m*(m))+(__inc_Int_n*(n))];
306 0           num++;
307             }} /* Close m=lx:cx */}} /* Close n=ly:cy */
308 0           (O_datap)[0+(__inc_O_p*(p))+(__inc_O_q*(q))] += temp/num;
309 0           ly = cy + 1;
310             }} /* Close q */
311 0           lx = cx + 1;
312             }} /* Close p */
313 0 0         PDL_BROADCASTLOOP_END_rescale2d_readdata
    0          
314             }
315 0 0         else if(__privtrans->ind_sizes[2] >= __privtrans->ind_sizes[0] && __privtrans->ind_sizes[3] < __privtrans->ind_sizes[1]) {
    0          
316 0           PDL_LDouble kx = ((PDL_LDouble) __privtrans->ind_sizes[2]) / __privtrans->ind_sizes[0];
317 0           PDL_LDouble ky = ((PDL_LDouble) __privtrans->ind_sizes[1]) / __privtrans->ind_sizes[3];
318 0 0         PDL_BROADCASTLOOP_START_rescale2d_readdata
    0          
    0          
    0          
    0          
    0          
    0          
319 0           PDL_Indx lx = 0;
320 0 0         {/* Open m */ PDL_EXPAND2(register PDL_Indx m=0, __m_stop=(__m_size)); for(; m<__m_stop; m+=1) {
321 0           PDL_Indx ly = 0, cx = rint((m+1)*kx);
322 0 0         {/* Open q */ PDL_EXPAND2(register PDL_Indx q=0, __q_stop=(__q_size)); for(; q<__q_stop; q+=1) {
323 0           PDL_Indx cy = rint((q+1)*ky);
324 0           PDL_LDouble temp = 0.0;
325 0           PDL_Indx num = 0;
326 0 0         {/* Open n=ly:cy */ PDL_EXPAND2(register PDL_Indx n=PDLMAX((ly),0), __n_stop=PDLMIN(cy, (__n_size))); for(; n<__n_stop; n+=1) {
327 0           temp += (Int_datap)[0+(__inc_Int_m*(m))+(__inc_Int_n*(n))];
328 0           num++;
329             }} /* Close n=ly:cy */
330 0 0         {/* Open p=lx:cx */ PDL_EXPAND2(register PDL_Indx p=PDLMAX((lx),0), __p_stop=PDLMIN(cx, (__p_size))); for(; p<__p_stop; p+=1) {
331 0           (O_datap)[0+(__inc_O_p*(p))+(__inc_O_q*(q))] += temp/num;
332             }} /* Close p=lx:cx */
333 0           ly = cy + 1;
334             }} /* Close q */
335 0           lx = cx + 1;
336             }} /* Close m */
337 0 0         PDL_BROADCASTLOOP_END_rescale2d_readdata
    0          
338             }
339 0 0         else if(__privtrans->ind_sizes[2] < __privtrans->ind_sizes[0] && __privtrans->ind_sizes[3] >= __privtrans->ind_sizes[1]) {
    0          
340 0           PDL_LDouble kx = ((PDL_LDouble) __privtrans->ind_sizes[0]) / __privtrans->ind_sizes[2];
341 0           PDL_LDouble ky = ((PDL_LDouble) __privtrans->ind_sizes[3]) / __privtrans->ind_sizes[1];
342 0 0         PDL_BROADCASTLOOP_START_rescale2d_readdata
    0          
    0          
    0          
    0          
    0          
    0          
343 0           PDL_Indx lx = 0;
344 0 0         {/* Open p */ PDL_EXPAND2(register PDL_Indx p=0, __p_stop=(__p_size)); for(; p<__p_stop; p+=1) {
345 0           PDL_Indx ly = 0, cx = rint((p+1)*kx);
346 0 0         {/* Open n */ PDL_EXPAND2(register PDL_Indx n=0, __n_stop=(__n_size)); for(; n<__n_stop; n+=1) {
347 0           PDL_Indx cy = rint((n+1)*ky);
348 0           PDL_CLDouble temp = 0.0;
349 0           PDL_Indx num = 0;
350 0 0         {/* Open m=lx:cx */ PDL_EXPAND2(register PDL_Indx m=PDLMAX((lx),0), __m_stop=PDLMIN(cx, (__m_size))); for(; m<__m_stop; m+=1) {
351 0           temp += (Int_datap)[0+(__inc_Int_m*(m))+(__inc_Int_n*(n))];
352 0           num++;
353             }} /* Close m=lx:cx */
354 0 0         {/* Open q=ly:cy */ PDL_EXPAND2(register PDL_Indx q=PDLMAX((ly),0), __q_stop=PDLMIN(cy, (__q_size))); for(; q<__q_stop; q+=1) {
355 0           (O_datap)[0+(__inc_O_p*(p))+(__inc_O_q*(q))] += temp/num;
356             }} /* Close q=ly:cy */
357 0           ly = cy + 1;
358             }} /* Close n */
359 0           lx = cx + 1;
360             }} /* Close p */
361 0 0         PDL_BROADCASTLOOP_END_rescale2d_readdata
    0          
362             }
363 0           else return PDL->make_error(PDL_EUSERERROR, "Error in rescale2d:" "I am not supposed to be here, please report the bug to ");
364             }
365 0           } break;
366 0           case PDL_US: {
367 0 0         PDL_DECLARE_PARAMS_rescale2d_1(PDL_Ushort,U)
    0          
    0          
    0          
    0          
    0          
368             {
369 0 0         if(__privtrans->ind_sizes[2] >= __privtrans->ind_sizes[0] && __privtrans->ind_sizes[3] >= __privtrans->ind_sizes[1]) {
    0          
370 0           PDL_LDouble kx = ((PDL_LDouble) __privtrans->ind_sizes[2]) / __privtrans->ind_sizes[0];
371 0           PDL_LDouble ky = ((PDL_LDouble) __privtrans->ind_sizes[3]) / __privtrans->ind_sizes[1];
372 0 0         PDL_BROADCASTLOOP_START_rescale2d_readdata
    0          
    0          
    0          
    0          
    0          
    0          
373 0           PDL_Indx lx = 0;
374 0 0         {/* Open m */ PDL_EXPAND2(register PDL_Indx m=0, __m_stop=(__m_size)); for(; m<__m_stop; m+=1) {
375 0           PDL_Indx ly = 0, cx = rint((m+1)*kx);
376 0 0         {/* Open n */ PDL_EXPAND2(register PDL_Indx n=0, __n_stop=(__n_size)); for(; n<__n_stop; n+=1) {
377 0           PDL_Indx cy = rint((n+1)*ky);
378 0 0         {/* Open p=lx:cx */ PDL_EXPAND2(register PDL_Indx p=PDLMAX((lx),0), __p_stop=PDLMIN(cx, (__p_size))); for(; p<__p_stop; p+=1) {{/* Open q=ly:cy */ PDL_EXPAND2(register PDL_Indx q=PDLMAX((ly),0), __q_stop=PDLMIN(cy, (__q_size))); for(; q<__q_stop; q+=1) {
    0          
379 0           (O_datap)[0+(__inc_O_p*(p))+(__inc_O_q*(q))] += (Int_datap)[0+(__inc_Int_m*(m))+(__inc_Int_n*(n))];
380             }} /* Close p=lx:cx */}} /* Close q=ly:cy */
381 0           ly = cy + 1;
382             }} /* Close n */
383 0           lx = cx + 1;
384             }} /* Close m */
385 0 0         PDL_BROADCASTLOOP_END_rescale2d_readdata
    0          
386             }
387 0 0         else if(__privtrans->ind_sizes[2] < __privtrans->ind_sizes[0] && __privtrans->ind_sizes[3] < __privtrans->ind_sizes[1]) {
    0          
388 0           PDL_LDouble kx = ((PDL_LDouble) __privtrans->ind_sizes[0]) / __privtrans->ind_sizes[2];
389 0           PDL_LDouble ky = ((PDL_LDouble) __privtrans->ind_sizes[1]) / __privtrans->ind_sizes[3];
390 0 0         PDL_BROADCASTLOOP_START_rescale2d_readdata
    0          
    0          
    0          
    0          
    0          
    0          
391 0           PDL_Indx lx = 0;
392 0 0         {/* Open p */ PDL_EXPAND2(register PDL_Indx p=0, __p_stop=(__p_size)); for(; p<__p_stop; p+=1) {
393 0           PDL_Indx ly = 0, cx = rint((p+1)*kx);
394 0 0         {/* Open q */ PDL_EXPAND2(register PDL_Indx q=0, __q_stop=(__q_size)); for(; q<__q_stop; q+=1) {
395 0           PDL_Indx cy = rint((q+1)*ky);
396 0           PDL_LDouble temp = 0.0;
397 0           PDL_Indx num = 0;
398 0 0         {/* Open m=lx:cx */ PDL_EXPAND2(register PDL_Indx m=PDLMAX((lx),0), __m_stop=PDLMIN(cx, (__m_size))); for(; m<__m_stop; m+=1) {{/* Open n=ly:cy */ PDL_EXPAND2(register PDL_Indx n=PDLMAX((ly),0), __n_stop=PDLMIN(cy, (__n_size))); for(; n<__n_stop; n+=1) {
    0          
399 0           temp += (Int_datap)[0+(__inc_Int_m*(m))+(__inc_Int_n*(n))];
400 0           num++;
401             }} /* Close m=lx:cx */}} /* Close n=ly:cy */
402 0           (O_datap)[0+(__inc_O_p*(p))+(__inc_O_q*(q))] += temp/num;
403 0           ly = cy + 1;
404             }} /* Close q */
405 0           lx = cx + 1;
406             }} /* Close p */
407 0 0         PDL_BROADCASTLOOP_END_rescale2d_readdata
    0          
408             }
409 0 0         else if(__privtrans->ind_sizes[2] >= __privtrans->ind_sizes[0] && __privtrans->ind_sizes[3] < __privtrans->ind_sizes[1]) {
    0          
410 0           PDL_LDouble kx = ((PDL_LDouble) __privtrans->ind_sizes[2]) / __privtrans->ind_sizes[0];
411 0           PDL_LDouble ky = ((PDL_LDouble) __privtrans->ind_sizes[1]) / __privtrans->ind_sizes[3];
412 0 0         PDL_BROADCASTLOOP_START_rescale2d_readdata
    0          
    0          
    0          
    0          
    0          
    0          
413 0           PDL_Indx lx = 0;
414 0 0         {/* Open m */ PDL_EXPAND2(register PDL_Indx m=0, __m_stop=(__m_size)); for(; m<__m_stop; m+=1) {
415 0           PDL_Indx ly = 0, cx = rint((m+1)*kx);
416 0 0         {/* Open q */ PDL_EXPAND2(register PDL_Indx q=0, __q_stop=(__q_size)); for(; q<__q_stop; q+=1) {
417 0           PDL_Indx cy = rint((q+1)*ky);
418 0           PDL_LDouble temp = 0.0;
419 0           PDL_Indx num = 0;
420 0 0         {/* Open n=ly:cy */ PDL_EXPAND2(register PDL_Indx n=PDLMAX((ly),0), __n_stop=PDLMIN(cy, (__n_size))); for(; n<__n_stop; n+=1) {
421 0           temp += (Int_datap)[0+(__inc_Int_m*(m))+(__inc_Int_n*(n))];
422 0           num++;
423             }} /* Close n=ly:cy */
424 0 0         {/* Open p=lx:cx */ PDL_EXPAND2(register PDL_Indx p=PDLMAX((lx),0), __p_stop=PDLMIN(cx, (__p_size))); for(; p<__p_stop; p+=1) {
425 0           (O_datap)[0+(__inc_O_p*(p))+(__inc_O_q*(q))] += temp/num;
426             }} /* Close p=lx:cx */
427 0           ly = cy + 1;
428             }} /* Close q */
429 0           lx = cx + 1;
430             }} /* Close m */
431 0 0         PDL_BROADCASTLOOP_END_rescale2d_readdata
    0          
432             }
433 0 0         else if(__privtrans->ind_sizes[2] < __privtrans->ind_sizes[0] && __privtrans->ind_sizes[3] >= __privtrans->ind_sizes[1]) {
    0          
434 0           PDL_LDouble kx = ((PDL_LDouble) __privtrans->ind_sizes[0]) / __privtrans->ind_sizes[2];
435 0           PDL_LDouble ky = ((PDL_LDouble) __privtrans->ind_sizes[3]) / __privtrans->ind_sizes[1];
436 0 0         PDL_BROADCASTLOOP_START_rescale2d_readdata
    0          
    0          
    0          
    0          
    0          
    0          
437 0           PDL_Indx lx = 0;
438 0 0         {/* Open p */ PDL_EXPAND2(register PDL_Indx p=0, __p_stop=(__p_size)); for(; p<__p_stop; p+=1) {
439 0           PDL_Indx ly = 0, cx = rint((p+1)*kx);
440 0 0         {/* Open n */ PDL_EXPAND2(register PDL_Indx n=0, __n_stop=(__n_size)); for(; n<__n_stop; n+=1) {
441 0           PDL_Indx cy = rint((n+1)*ky);
442 0           PDL_CLDouble temp = 0.0;
443 0           PDL_Indx num = 0;
444 0 0         {/* Open m=lx:cx */ PDL_EXPAND2(register PDL_Indx m=PDLMAX((lx),0), __m_stop=PDLMIN(cx, (__m_size))); for(; m<__m_stop; m+=1) {
445 0           temp += (Int_datap)[0+(__inc_Int_m*(m))+(__inc_Int_n*(n))];
446 0           num++;
447             }} /* Close m=lx:cx */
448 0 0         {/* Open q=ly:cy */ PDL_EXPAND2(register PDL_Indx q=PDLMAX((ly),0), __q_stop=PDLMIN(cy, (__q_size))); for(; q<__q_stop; q+=1) {
449 0           (O_datap)[0+(__inc_O_p*(p))+(__inc_O_q*(q))] += temp/num;
450             }} /* Close q=ly:cy */
451 0           ly = cy + 1;
452             }} /* Close n */
453 0           lx = cx + 1;
454             }} /* Close p */
455 0 0         PDL_BROADCASTLOOP_END_rescale2d_readdata
    0          
456             }
457 0           else return PDL->make_error(PDL_EUSERERROR, "Error in rescale2d:" "I am not supposed to be here, please report the bug to ");
458             }
459 0           } break;
460 0           case PDL_L: {
461 0 0         PDL_DECLARE_PARAMS_rescale2d_1(PDL_Long,L)
    0          
    0          
    0          
    0          
    0          
462             {
463 0 0         if(__privtrans->ind_sizes[2] >= __privtrans->ind_sizes[0] && __privtrans->ind_sizes[3] >= __privtrans->ind_sizes[1]) {
    0          
464 0           PDL_LDouble kx = ((PDL_LDouble) __privtrans->ind_sizes[2]) / __privtrans->ind_sizes[0];
465 0           PDL_LDouble ky = ((PDL_LDouble) __privtrans->ind_sizes[3]) / __privtrans->ind_sizes[1];
466 0 0         PDL_BROADCASTLOOP_START_rescale2d_readdata
    0          
    0          
    0          
    0          
    0          
    0          
467 0           PDL_Indx lx = 0;
468 0 0         {/* Open m */ PDL_EXPAND2(register PDL_Indx m=0, __m_stop=(__m_size)); for(; m<__m_stop; m+=1) {
469 0           PDL_Indx ly = 0, cx = rint((m+1)*kx);
470 0 0         {/* Open n */ PDL_EXPAND2(register PDL_Indx n=0, __n_stop=(__n_size)); for(; n<__n_stop; n+=1) {
471 0           PDL_Indx cy = rint((n+1)*ky);
472 0 0         {/* Open p=lx:cx */ PDL_EXPAND2(register PDL_Indx p=PDLMAX((lx),0), __p_stop=PDLMIN(cx, (__p_size))); for(; p<__p_stop; p+=1) {{/* Open q=ly:cy */ PDL_EXPAND2(register PDL_Indx q=PDLMAX((ly),0), __q_stop=PDLMIN(cy, (__q_size))); for(; q<__q_stop; q+=1) {
    0          
473 0           (O_datap)[0+(__inc_O_p*(p))+(__inc_O_q*(q))] += (Int_datap)[0+(__inc_Int_m*(m))+(__inc_Int_n*(n))];
474             }} /* Close p=lx:cx */}} /* Close q=ly:cy */
475 0           ly = cy + 1;
476             }} /* Close n */
477 0           lx = cx + 1;
478             }} /* Close m */
479 0 0         PDL_BROADCASTLOOP_END_rescale2d_readdata
    0          
480             }
481 0 0         else if(__privtrans->ind_sizes[2] < __privtrans->ind_sizes[0] && __privtrans->ind_sizes[3] < __privtrans->ind_sizes[1]) {
    0          
482 0           PDL_LDouble kx = ((PDL_LDouble) __privtrans->ind_sizes[0]) / __privtrans->ind_sizes[2];
483 0           PDL_LDouble ky = ((PDL_LDouble) __privtrans->ind_sizes[1]) / __privtrans->ind_sizes[3];
484 0 0         PDL_BROADCASTLOOP_START_rescale2d_readdata
    0          
    0          
    0          
    0          
    0          
    0          
485 0           PDL_Indx lx = 0;
486 0 0         {/* Open p */ PDL_EXPAND2(register PDL_Indx p=0, __p_stop=(__p_size)); for(; p<__p_stop; p+=1) {
487 0           PDL_Indx ly = 0, cx = rint((p+1)*kx);
488 0 0         {/* Open q */ PDL_EXPAND2(register PDL_Indx q=0, __q_stop=(__q_size)); for(; q<__q_stop; q+=1) {
489 0           PDL_Indx cy = rint((q+1)*ky);
490 0           PDL_LDouble temp = 0.0;
491 0           PDL_Indx num = 0;
492 0 0         {/* Open m=lx:cx */ PDL_EXPAND2(register PDL_Indx m=PDLMAX((lx),0), __m_stop=PDLMIN(cx, (__m_size))); for(; m<__m_stop; m+=1) {{/* Open n=ly:cy */ PDL_EXPAND2(register PDL_Indx n=PDLMAX((ly),0), __n_stop=PDLMIN(cy, (__n_size))); for(; n<__n_stop; n+=1) {
    0          
493 0           temp += (Int_datap)[0+(__inc_Int_m*(m))+(__inc_Int_n*(n))];
494 0           num++;
495             }} /* Close m=lx:cx */}} /* Close n=ly:cy */
496 0           (O_datap)[0+(__inc_O_p*(p))+(__inc_O_q*(q))] += temp/num;
497 0           ly = cy + 1;
498             }} /* Close q */
499 0           lx = cx + 1;
500             }} /* Close p */
501 0 0         PDL_BROADCASTLOOP_END_rescale2d_readdata
    0          
502             }
503 0 0         else if(__privtrans->ind_sizes[2] >= __privtrans->ind_sizes[0] && __privtrans->ind_sizes[3] < __privtrans->ind_sizes[1]) {
    0          
504 0           PDL_LDouble kx = ((PDL_LDouble) __privtrans->ind_sizes[2]) / __privtrans->ind_sizes[0];
505 0           PDL_LDouble ky = ((PDL_LDouble) __privtrans->ind_sizes[1]) / __privtrans->ind_sizes[3];
506 0 0         PDL_BROADCASTLOOP_START_rescale2d_readdata
    0          
    0          
    0          
    0          
    0          
    0          
507 0           PDL_Indx lx = 0;
508 0 0         {/* Open m */ PDL_EXPAND2(register PDL_Indx m=0, __m_stop=(__m_size)); for(; m<__m_stop; m+=1) {
509 0           PDL_Indx ly = 0, cx = rint((m+1)*kx);
510 0 0         {/* Open q */ PDL_EXPAND2(register PDL_Indx q=0, __q_stop=(__q_size)); for(; q<__q_stop; q+=1) {
511 0           PDL_Indx cy = rint((q+1)*ky);
512 0           PDL_LDouble temp = 0.0;
513 0           PDL_Indx num = 0;
514 0 0         {/* Open n=ly:cy */ PDL_EXPAND2(register PDL_Indx n=PDLMAX((ly),0), __n_stop=PDLMIN(cy, (__n_size))); for(; n<__n_stop; n+=1) {
515 0           temp += (Int_datap)[0+(__inc_Int_m*(m))+(__inc_Int_n*(n))];
516 0           num++;
517             }} /* Close n=ly:cy */
518 0 0         {/* Open p=lx:cx */ PDL_EXPAND2(register PDL_Indx p=PDLMAX((lx),0), __p_stop=PDLMIN(cx, (__p_size))); for(; p<__p_stop; p+=1) {
519 0           (O_datap)[0+(__inc_O_p*(p))+(__inc_O_q*(q))] += temp/num;
520             }} /* Close p=lx:cx */
521 0           ly = cy + 1;
522             }} /* Close q */
523 0           lx = cx + 1;
524             }} /* Close m */
525 0 0         PDL_BROADCASTLOOP_END_rescale2d_readdata
    0          
526             }
527 0 0         else if(__privtrans->ind_sizes[2] < __privtrans->ind_sizes[0] && __privtrans->ind_sizes[3] >= __privtrans->ind_sizes[1]) {
    0          
528 0           PDL_LDouble kx = ((PDL_LDouble) __privtrans->ind_sizes[0]) / __privtrans->ind_sizes[2];
529 0           PDL_LDouble ky = ((PDL_LDouble) __privtrans->ind_sizes[3]) / __privtrans->ind_sizes[1];
530 0 0         PDL_BROADCASTLOOP_START_rescale2d_readdata
    0          
    0          
    0          
    0          
    0          
    0          
531 0           PDL_Indx lx = 0;
532 0 0         {/* Open p */ PDL_EXPAND2(register PDL_Indx p=0, __p_stop=(__p_size)); for(; p<__p_stop; p+=1) {
533 0           PDL_Indx ly = 0, cx = rint((p+1)*kx);
534 0 0         {/* Open n */ PDL_EXPAND2(register PDL_Indx n=0, __n_stop=(__n_size)); for(; n<__n_stop; n+=1) {
535 0           PDL_Indx cy = rint((n+1)*ky);
536 0           PDL_CLDouble temp = 0.0;
537 0           PDL_Indx num = 0;
538 0 0         {/* Open m=lx:cx */ PDL_EXPAND2(register PDL_Indx m=PDLMAX((lx),0), __m_stop=PDLMIN(cx, (__m_size))); for(; m<__m_stop; m+=1) {
539 0           temp += (Int_datap)[0+(__inc_Int_m*(m))+(__inc_Int_n*(n))];
540 0           num++;
541             }} /* Close m=lx:cx */
542 0 0         {/* Open q=ly:cy */ PDL_EXPAND2(register PDL_Indx q=PDLMAX((ly),0), __q_stop=PDLMIN(cy, (__q_size))); for(; q<__q_stop; q+=1) {
543 0           (O_datap)[0+(__inc_O_p*(p))+(__inc_O_q*(q))] += temp/num;
544             }} /* Close q=ly:cy */
545 0           ly = cy + 1;
546             }} /* Close n */
547 0           lx = cx + 1;
548             }} /* Close p */
549 0 0         PDL_BROADCASTLOOP_END_rescale2d_readdata
    0          
550             }
551 0           else return PDL->make_error(PDL_EUSERERROR, "Error in rescale2d:" "I am not supposed to be here, please report the bug to ");
552             }
553 0           } break;
554 0           case PDL_UL: {
555 0 0         PDL_DECLARE_PARAMS_rescale2d_1(PDL_ULong,K)
    0          
    0          
    0          
    0          
    0          
556             {
557 0 0         if(__privtrans->ind_sizes[2] >= __privtrans->ind_sizes[0] && __privtrans->ind_sizes[3] >= __privtrans->ind_sizes[1]) {
    0          
558 0           PDL_LDouble kx = ((PDL_LDouble) __privtrans->ind_sizes[2]) / __privtrans->ind_sizes[0];
559 0           PDL_LDouble ky = ((PDL_LDouble) __privtrans->ind_sizes[3]) / __privtrans->ind_sizes[1];
560 0 0         PDL_BROADCASTLOOP_START_rescale2d_readdata
    0          
    0          
    0          
    0          
    0          
    0          
561 0           PDL_Indx lx = 0;
562 0 0         {/* Open m */ PDL_EXPAND2(register PDL_Indx m=0, __m_stop=(__m_size)); for(; m<__m_stop; m+=1) {
563 0           PDL_Indx ly = 0, cx = rint((m+1)*kx);
564 0 0         {/* Open n */ PDL_EXPAND2(register PDL_Indx n=0, __n_stop=(__n_size)); for(; n<__n_stop; n+=1) {
565 0           PDL_Indx cy = rint((n+1)*ky);
566 0 0         {/* Open p=lx:cx */ PDL_EXPAND2(register PDL_Indx p=PDLMAX((lx),0), __p_stop=PDLMIN(cx, (__p_size))); for(; p<__p_stop; p+=1) {{/* Open q=ly:cy */ PDL_EXPAND2(register PDL_Indx q=PDLMAX((ly),0), __q_stop=PDLMIN(cy, (__q_size))); for(; q<__q_stop; q+=1) {
    0          
567 0           (O_datap)[0+(__inc_O_p*(p))+(__inc_O_q*(q))] += (Int_datap)[0+(__inc_Int_m*(m))+(__inc_Int_n*(n))];
568             }} /* Close p=lx:cx */}} /* Close q=ly:cy */
569 0           ly = cy + 1;
570             }} /* Close n */
571 0           lx = cx + 1;
572             }} /* Close m */
573 0 0         PDL_BROADCASTLOOP_END_rescale2d_readdata
    0          
574             }
575 0 0         else if(__privtrans->ind_sizes[2] < __privtrans->ind_sizes[0] && __privtrans->ind_sizes[3] < __privtrans->ind_sizes[1]) {
    0          
576 0           PDL_LDouble kx = ((PDL_LDouble) __privtrans->ind_sizes[0]) / __privtrans->ind_sizes[2];
577 0           PDL_LDouble ky = ((PDL_LDouble) __privtrans->ind_sizes[1]) / __privtrans->ind_sizes[3];
578 0 0         PDL_BROADCASTLOOP_START_rescale2d_readdata
    0          
    0          
    0          
    0          
    0          
    0          
579 0           PDL_Indx lx = 0;
580 0 0         {/* Open p */ PDL_EXPAND2(register PDL_Indx p=0, __p_stop=(__p_size)); for(; p<__p_stop; p+=1) {
581 0           PDL_Indx ly = 0, cx = rint((p+1)*kx);
582 0 0         {/* Open q */ PDL_EXPAND2(register PDL_Indx q=0, __q_stop=(__q_size)); for(; q<__q_stop; q+=1) {
583 0           PDL_Indx cy = rint((q+1)*ky);
584 0           PDL_LDouble temp = 0.0;
585 0           PDL_Indx num = 0;
586 0 0         {/* Open m=lx:cx */ PDL_EXPAND2(register PDL_Indx m=PDLMAX((lx),0), __m_stop=PDLMIN(cx, (__m_size))); for(; m<__m_stop; m+=1) {{/* Open n=ly:cy */ PDL_EXPAND2(register PDL_Indx n=PDLMAX((ly),0), __n_stop=PDLMIN(cy, (__n_size))); for(; n<__n_stop; n+=1) {
    0          
587 0           temp += (Int_datap)[0+(__inc_Int_m*(m))+(__inc_Int_n*(n))];
588 0           num++;
589             }} /* Close m=lx:cx */}} /* Close n=ly:cy */
590 0           (O_datap)[0+(__inc_O_p*(p))+(__inc_O_q*(q))] += temp/num;
591 0           ly = cy + 1;
592             }} /* Close q */
593 0           lx = cx + 1;
594             }} /* Close p */
595 0 0         PDL_BROADCASTLOOP_END_rescale2d_readdata
    0          
596             }
597 0 0         else if(__privtrans->ind_sizes[2] >= __privtrans->ind_sizes[0] && __privtrans->ind_sizes[3] < __privtrans->ind_sizes[1]) {
    0          
598 0           PDL_LDouble kx = ((PDL_LDouble) __privtrans->ind_sizes[2]) / __privtrans->ind_sizes[0];
599 0           PDL_LDouble ky = ((PDL_LDouble) __privtrans->ind_sizes[1]) / __privtrans->ind_sizes[3];
600 0 0         PDL_BROADCASTLOOP_START_rescale2d_readdata
    0          
    0          
    0          
    0          
    0          
    0          
601 0           PDL_Indx lx = 0;
602 0 0         {/* Open m */ PDL_EXPAND2(register PDL_Indx m=0, __m_stop=(__m_size)); for(; m<__m_stop; m+=1) {
603 0           PDL_Indx ly = 0, cx = rint((m+1)*kx);
604 0 0         {/* Open q */ PDL_EXPAND2(register PDL_Indx q=0, __q_stop=(__q_size)); for(; q<__q_stop; q+=1) {
605 0           PDL_Indx cy = rint((q+1)*ky);
606 0           PDL_LDouble temp = 0.0;
607 0           PDL_Indx num = 0;
608 0 0         {/* Open n=ly:cy */ PDL_EXPAND2(register PDL_Indx n=PDLMAX((ly),0), __n_stop=PDLMIN(cy, (__n_size))); for(; n<__n_stop; n+=1) {
609 0           temp += (Int_datap)[0+(__inc_Int_m*(m))+(__inc_Int_n*(n))];
610 0           num++;
611             }} /* Close n=ly:cy */
612 0 0         {/* Open p=lx:cx */ PDL_EXPAND2(register PDL_Indx p=PDLMAX((lx),0), __p_stop=PDLMIN(cx, (__p_size))); for(; p<__p_stop; p+=1) {
613 0           (O_datap)[0+(__inc_O_p*(p))+(__inc_O_q*(q))] += temp/num;
614             }} /* Close p=lx:cx */
615 0           ly = cy + 1;
616             }} /* Close q */
617 0           lx = cx + 1;
618             }} /* Close m */
619 0 0         PDL_BROADCASTLOOP_END_rescale2d_readdata
    0          
620             }
621 0 0         else if(__privtrans->ind_sizes[2] < __privtrans->ind_sizes[0] && __privtrans->ind_sizes[3] >= __privtrans->ind_sizes[1]) {
    0          
622 0           PDL_LDouble kx = ((PDL_LDouble) __privtrans->ind_sizes[0]) / __privtrans->ind_sizes[2];
623 0           PDL_LDouble ky = ((PDL_LDouble) __privtrans->ind_sizes[3]) / __privtrans->ind_sizes[1];
624 0 0         PDL_BROADCASTLOOP_START_rescale2d_readdata
    0          
    0          
    0          
    0          
    0          
    0          
625 0           PDL_Indx lx = 0;
626 0 0         {/* Open p */ PDL_EXPAND2(register PDL_Indx p=0, __p_stop=(__p_size)); for(; p<__p_stop; p+=1) {
627 0           PDL_Indx ly = 0, cx = rint((p+1)*kx);
628 0 0         {/* Open n */ PDL_EXPAND2(register PDL_Indx n=0, __n_stop=(__n_size)); for(; n<__n_stop; n+=1) {
629 0           PDL_Indx cy = rint((n+1)*ky);
630 0           PDL_CLDouble temp = 0.0;
631 0           PDL_Indx num = 0;
632 0 0         {/* Open m=lx:cx */ PDL_EXPAND2(register PDL_Indx m=PDLMAX((lx),0), __m_stop=PDLMIN(cx, (__m_size))); for(; m<__m_stop; m+=1) {
633 0           temp += (Int_datap)[0+(__inc_Int_m*(m))+(__inc_Int_n*(n))];
634 0           num++;
635             }} /* Close m=lx:cx */
636 0 0         {/* Open q=ly:cy */ PDL_EXPAND2(register PDL_Indx q=PDLMAX((ly),0), __q_stop=PDLMIN(cy, (__q_size))); for(; q<__q_stop; q+=1) {
637 0           (O_datap)[0+(__inc_O_p*(p))+(__inc_O_q*(q))] += temp/num;
638             }} /* Close q=ly:cy */
639 0           ly = cy + 1;
640             }} /* Close n */
641 0           lx = cx + 1;
642             }} /* Close p */
643 0 0         PDL_BROADCASTLOOP_END_rescale2d_readdata
    0          
644             }
645 0           else return PDL->make_error(PDL_EUSERERROR, "Error in rescale2d:" "I am not supposed to be here, please report the bug to ");
646             }
647 0           } break;
648 0           case PDL_IND: {
649 0 0         PDL_DECLARE_PARAMS_rescale2d_1(PDL_Indx,N)
    0          
    0          
    0          
    0          
    0          
650             {
651 0 0         if(__privtrans->ind_sizes[2] >= __privtrans->ind_sizes[0] && __privtrans->ind_sizes[3] >= __privtrans->ind_sizes[1]) {
    0          
652 0           PDL_LDouble kx = ((PDL_LDouble) __privtrans->ind_sizes[2]) / __privtrans->ind_sizes[0];
653 0           PDL_LDouble ky = ((PDL_LDouble) __privtrans->ind_sizes[3]) / __privtrans->ind_sizes[1];
654 0 0         PDL_BROADCASTLOOP_START_rescale2d_readdata
    0          
    0          
    0          
    0          
    0          
    0          
655 0           PDL_Indx lx = 0;
656 0 0         {/* Open m */ PDL_EXPAND2(register PDL_Indx m=0, __m_stop=(__m_size)); for(; m<__m_stop; m+=1) {
657 0           PDL_Indx ly = 0, cx = rint((m+1)*kx);
658 0 0         {/* Open n */ PDL_EXPAND2(register PDL_Indx n=0, __n_stop=(__n_size)); for(; n<__n_stop; n+=1) {
659 0           PDL_Indx cy = rint((n+1)*ky);
660 0 0         {/* Open p=lx:cx */ PDL_EXPAND2(register PDL_Indx p=PDLMAX((lx),0), __p_stop=PDLMIN(cx, (__p_size))); for(; p<__p_stop; p+=1) {{/* Open q=ly:cy */ PDL_EXPAND2(register PDL_Indx q=PDLMAX((ly),0), __q_stop=PDLMIN(cy, (__q_size))); for(; q<__q_stop; q+=1) {
    0          
661 0           (O_datap)[0+(__inc_O_p*(p))+(__inc_O_q*(q))] += (Int_datap)[0+(__inc_Int_m*(m))+(__inc_Int_n*(n))];
662             }} /* Close p=lx:cx */}} /* Close q=ly:cy */
663 0           ly = cy + 1;
664             }} /* Close n */
665 0           lx = cx + 1;
666             }} /* Close m */
667 0 0         PDL_BROADCASTLOOP_END_rescale2d_readdata
    0          
668             }
669 0 0         else if(__privtrans->ind_sizes[2] < __privtrans->ind_sizes[0] && __privtrans->ind_sizes[3] < __privtrans->ind_sizes[1]) {
    0          
670 0           PDL_LDouble kx = ((PDL_LDouble) __privtrans->ind_sizes[0]) / __privtrans->ind_sizes[2];
671 0           PDL_LDouble ky = ((PDL_LDouble) __privtrans->ind_sizes[1]) / __privtrans->ind_sizes[3];
672 0 0         PDL_BROADCASTLOOP_START_rescale2d_readdata
    0          
    0          
    0          
    0          
    0          
    0          
673 0           PDL_Indx lx = 0;
674 0 0         {/* Open p */ PDL_EXPAND2(register PDL_Indx p=0, __p_stop=(__p_size)); for(; p<__p_stop; p+=1) {
675 0           PDL_Indx ly = 0, cx = rint((p+1)*kx);
676 0 0         {/* Open q */ PDL_EXPAND2(register PDL_Indx q=0, __q_stop=(__q_size)); for(; q<__q_stop; q+=1) {
677 0           PDL_Indx cy = rint((q+1)*ky);
678 0           PDL_LDouble temp = 0.0;
679 0           PDL_Indx num = 0;
680 0 0         {/* Open m=lx:cx */ PDL_EXPAND2(register PDL_Indx m=PDLMAX((lx),0), __m_stop=PDLMIN(cx, (__m_size))); for(; m<__m_stop; m+=1) {{/* Open n=ly:cy */ PDL_EXPAND2(register PDL_Indx n=PDLMAX((ly),0), __n_stop=PDLMIN(cy, (__n_size))); for(; n<__n_stop; n+=1) {
    0          
681 0           temp += (Int_datap)[0+(__inc_Int_m*(m))+(__inc_Int_n*(n))];
682 0           num++;
683             }} /* Close m=lx:cx */}} /* Close n=ly:cy */
684 0           (O_datap)[0+(__inc_O_p*(p))+(__inc_O_q*(q))] += temp/num;
685 0           ly = cy + 1;
686             }} /* Close q */
687 0           lx = cx + 1;
688             }} /* Close p */
689 0 0         PDL_BROADCASTLOOP_END_rescale2d_readdata
    0          
690             }
691 0 0         else if(__privtrans->ind_sizes[2] >= __privtrans->ind_sizes[0] && __privtrans->ind_sizes[3] < __privtrans->ind_sizes[1]) {
    0          
692 0           PDL_LDouble kx = ((PDL_LDouble) __privtrans->ind_sizes[2]) / __privtrans->ind_sizes[0];
693 0           PDL_LDouble ky = ((PDL_LDouble) __privtrans->ind_sizes[1]) / __privtrans->ind_sizes[3];
694 0 0         PDL_BROADCASTLOOP_START_rescale2d_readdata
    0          
    0          
    0          
    0          
    0          
    0          
695 0           PDL_Indx lx = 0;
696 0 0         {/* Open m */ PDL_EXPAND2(register PDL_Indx m=0, __m_stop=(__m_size)); for(; m<__m_stop; m+=1) {
697 0           PDL_Indx ly = 0, cx = rint((m+1)*kx);
698 0 0         {/* Open q */ PDL_EXPAND2(register PDL_Indx q=0, __q_stop=(__q_size)); for(; q<__q_stop; q+=1) {
699 0           PDL_Indx cy = rint((q+1)*ky);
700 0           PDL_LDouble temp = 0.0;
701 0           PDL_Indx num = 0;
702 0 0         {/* Open n=ly:cy */ PDL_EXPAND2(register PDL_Indx n=PDLMAX((ly),0), __n_stop=PDLMIN(cy, (__n_size))); for(; n<__n_stop; n+=1) {
703 0           temp += (Int_datap)[0+(__inc_Int_m*(m))+(__inc_Int_n*(n))];
704 0           num++;
705             }} /* Close n=ly:cy */
706 0 0         {/* Open p=lx:cx */ PDL_EXPAND2(register PDL_Indx p=PDLMAX((lx),0), __p_stop=PDLMIN(cx, (__p_size))); for(; p<__p_stop; p+=1) {
707 0           (O_datap)[0+(__inc_O_p*(p))+(__inc_O_q*(q))] += temp/num;
708             }} /* Close p=lx:cx */
709 0           ly = cy + 1;
710             }} /* Close q */
711 0           lx = cx + 1;
712             }} /* Close m */
713 0 0         PDL_BROADCASTLOOP_END_rescale2d_readdata
    0          
714             }
715 0 0         else if(__privtrans->ind_sizes[2] < __privtrans->ind_sizes[0] && __privtrans->ind_sizes[3] >= __privtrans->ind_sizes[1]) {
    0          
716 0           PDL_LDouble kx = ((PDL_LDouble) __privtrans->ind_sizes[0]) / __privtrans->ind_sizes[2];
717 0           PDL_LDouble ky = ((PDL_LDouble) __privtrans->ind_sizes[3]) / __privtrans->ind_sizes[1];
718 0 0         PDL_BROADCASTLOOP_START_rescale2d_readdata
    0          
    0          
    0          
    0          
    0          
    0          
719 0           PDL_Indx lx = 0;
720 0 0         {/* Open p */ PDL_EXPAND2(register PDL_Indx p=0, __p_stop=(__p_size)); for(; p<__p_stop; p+=1) {
721 0           PDL_Indx ly = 0, cx = rint((p+1)*kx);
722 0 0         {/* Open n */ PDL_EXPAND2(register PDL_Indx n=0, __n_stop=(__n_size)); for(; n<__n_stop; n+=1) {
723 0           PDL_Indx cy = rint((n+1)*ky);
724 0           PDL_CLDouble temp = 0.0;
725 0           PDL_Indx num = 0;
726 0 0         {/* Open m=lx:cx */ PDL_EXPAND2(register PDL_Indx m=PDLMAX((lx),0), __m_stop=PDLMIN(cx, (__m_size))); for(; m<__m_stop; m+=1) {
727 0           temp += (Int_datap)[0+(__inc_Int_m*(m))+(__inc_Int_n*(n))];
728 0           num++;
729             }} /* Close m=lx:cx */
730 0 0         {/* Open q=ly:cy */ PDL_EXPAND2(register PDL_Indx q=PDLMAX((ly),0), __q_stop=PDLMIN(cy, (__q_size))); for(; q<__q_stop; q+=1) {
731 0           (O_datap)[0+(__inc_O_p*(p))+(__inc_O_q*(q))] += temp/num;
732             }} /* Close q=ly:cy */
733 0           ly = cy + 1;
734             }} /* Close n */
735 0           lx = cx + 1;
736             }} /* Close p */
737 0 0         PDL_BROADCASTLOOP_END_rescale2d_readdata
    0          
738             }
739 0           else return PDL->make_error(PDL_EUSERERROR, "Error in rescale2d:" "I am not supposed to be here, please report the bug to ");
740             }
741 0           } break;
742 0           case PDL_ULL: {
743 0 0         PDL_DECLARE_PARAMS_rescale2d_1(PDL_ULongLong,P)
    0          
    0          
    0          
    0          
    0          
744             {
745 0 0         if(__privtrans->ind_sizes[2] >= __privtrans->ind_sizes[0] && __privtrans->ind_sizes[3] >= __privtrans->ind_sizes[1]) {
    0          
746 0           PDL_LDouble kx = ((PDL_LDouble) __privtrans->ind_sizes[2]) / __privtrans->ind_sizes[0];
747 0           PDL_LDouble ky = ((PDL_LDouble) __privtrans->ind_sizes[3]) / __privtrans->ind_sizes[1];
748 0 0         PDL_BROADCASTLOOP_START_rescale2d_readdata
    0          
    0          
    0          
    0          
    0          
    0          
749 0           PDL_Indx lx = 0;
750 0 0         {/* Open m */ PDL_EXPAND2(register PDL_Indx m=0, __m_stop=(__m_size)); for(; m<__m_stop; m+=1) {
751 0           PDL_Indx ly = 0, cx = rint((m+1)*kx);
752 0 0         {/* Open n */ PDL_EXPAND2(register PDL_Indx n=0, __n_stop=(__n_size)); for(; n<__n_stop; n+=1) {
753 0           PDL_Indx cy = rint((n+1)*ky);
754 0 0         {/* Open p=lx:cx */ PDL_EXPAND2(register PDL_Indx p=PDLMAX((lx),0), __p_stop=PDLMIN(cx, (__p_size))); for(; p<__p_stop; p+=1) {{/* Open q=ly:cy */ PDL_EXPAND2(register PDL_Indx q=PDLMAX((ly),0), __q_stop=PDLMIN(cy, (__q_size))); for(; q<__q_stop; q+=1) {
    0          
755 0           (O_datap)[0+(__inc_O_p*(p))+(__inc_O_q*(q))] += (Int_datap)[0+(__inc_Int_m*(m))+(__inc_Int_n*(n))];
756             }} /* Close p=lx:cx */}} /* Close q=ly:cy */
757 0           ly = cy + 1;
758             }} /* Close n */
759 0           lx = cx + 1;
760             }} /* Close m */
761 0 0         PDL_BROADCASTLOOP_END_rescale2d_readdata
    0          
762             }
763 0 0         else if(__privtrans->ind_sizes[2] < __privtrans->ind_sizes[0] && __privtrans->ind_sizes[3] < __privtrans->ind_sizes[1]) {
    0          
764 0           PDL_LDouble kx = ((PDL_LDouble) __privtrans->ind_sizes[0]) / __privtrans->ind_sizes[2];
765 0           PDL_LDouble ky = ((PDL_LDouble) __privtrans->ind_sizes[1]) / __privtrans->ind_sizes[3];
766 0 0         PDL_BROADCASTLOOP_START_rescale2d_readdata
    0          
    0          
    0          
    0          
    0          
    0          
767 0           PDL_Indx lx = 0;
768 0 0         {/* Open p */ PDL_EXPAND2(register PDL_Indx p=0, __p_stop=(__p_size)); for(; p<__p_stop; p+=1) {
769 0           PDL_Indx ly = 0, cx = rint((p+1)*kx);
770 0 0         {/* Open q */ PDL_EXPAND2(register PDL_Indx q=0, __q_stop=(__q_size)); for(; q<__q_stop; q+=1) {
771 0           PDL_Indx cy = rint((q+1)*ky);
772 0           PDL_LDouble temp = 0.0;
773 0           PDL_Indx num = 0;
774 0 0         {/* Open m=lx:cx */ PDL_EXPAND2(register PDL_Indx m=PDLMAX((lx),0), __m_stop=PDLMIN(cx, (__m_size))); for(; m<__m_stop; m+=1) {{/* Open n=ly:cy */ PDL_EXPAND2(register PDL_Indx n=PDLMAX((ly),0), __n_stop=PDLMIN(cy, (__n_size))); for(; n<__n_stop; n+=1) {
    0          
775 0           temp += (Int_datap)[0+(__inc_Int_m*(m))+(__inc_Int_n*(n))];
776 0           num++;
777             }} /* Close m=lx:cx */}} /* Close n=ly:cy */
778 0           (O_datap)[0+(__inc_O_p*(p))+(__inc_O_q*(q))] += temp/num;
779 0           ly = cy + 1;
780             }} /* Close q */
781 0           lx = cx + 1;
782             }} /* Close p */
783 0 0         PDL_BROADCASTLOOP_END_rescale2d_readdata
    0          
784             }
785 0 0         else if(__privtrans->ind_sizes[2] >= __privtrans->ind_sizes[0] && __privtrans->ind_sizes[3] < __privtrans->ind_sizes[1]) {
    0          
786 0           PDL_LDouble kx = ((PDL_LDouble) __privtrans->ind_sizes[2]) / __privtrans->ind_sizes[0];
787 0           PDL_LDouble ky = ((PDL_LDouble) __privtrans->ind_sizes[1]) / __privtrans->ind_sizes[3];
788 0 0         PDL_BROADCASTLOOP_START_rescale2d_readdata
    0          
    0          
    0          
    0          
    0          
    0          
789 0           PDL_Indx lx = 0;
790 0 0         {/* Open m */ PDL_EXPAND2(register PDL_Indx m=0, __m_stop=(__m_size)); for(; m<__m_stop; m+=1) {
791 0           PDL_Indx ly = 0, cx = rint((m+1)*kx);
792 0 0         {/* Open q */ PDL_EXPAND2(register PDL_Indx q=0, __q_stop=(__q_size)); for(; q<__q_stop; q+=1) {
793 0           PDL_Indx cy = rint((q+1)*ky);
794 0           PDL_LDouble temp = 0.0;
795 0           PDL_Indx num = 0;
796 0 0         {/* Open n=ly:cy */ PDL_EXPAND2(register PDL_Indx n=PDLMAX((ly),0), __n_stop=PDLMIN(cy, (__n_size))); for(; n<__n_stop; n+=1) {
797 0           temp += (Int_datap)[0+(__inc_Int_m*(m))+(__inc_Int_n*(n))];
798 0           num++;
799             }} /* Close n=ly:cy */
800 0 0         {/* Open p=lx:cx */ PDL_EXPAND2(register PDL_Indx p=PDLMAX((lx),0), __p_stop=PDLMIN(cx, (__p_size))); for(; p<__p_stop; p+=1) {
801 0           (O_datap)[0+(__inc_O_p*(p))+(__inc_O_q*(q))] += temp/num;
802             }} /* Close p=lx:cx */
803 0           ly = cy + 1;
804             }} /* Close q */
805 0           lx = cx + 1;
806             }} /* Close m */
807 0 0         PDL_BROADCASTLOOP_END_rescale2d_readdata
    0          
808             }
809 0 0         else if(__privtrans->ind_sizes[2] < __privtrans->ind_sizes[0] && __privtrans->ind_sizes[3] >= __privtrans->ind_sizes[1]) {
    0          
810 0           PDL_LDouble kx = ((PDL_LDouble) __privtrans->ind_sizes[0]) / __privtrans->ind_sizes[2];
811 0           PDL_LDouble ky = ((PDL_LDouble) __privtrans->ind_sizes[3]) / __privtrans->ind_sizes[1];
812 0 0         PDL_BROADCASTLOOP_START_rescale2d_readdata
    0          
    0          
    0          
    0          
    0          
    0          
813 0           PDL_Indx lx = 0;
814 0 0         {/* Open p */ PDL_EXPAND2(register PDL_Indx p=0, __p_stop=(__p_size)); for(; p<__p_stop; p+=1) {
815 0           PDL_Indx ly = 0, cx = rint((p+1)*kx);
816 0 0         {/* Open n */ PDL_EXPAND2(register PDL_Indx n=0, __n_stop=(__n_size)); for(; n<__n_stop; n+=1) {
817 0           PDL_Indx cy = rint((n+1)*ky);
818 0           PDL_CLDouble temp = 0.0;
819 0           PDL_Indx num = 0;
820 0 0         {/* Open m=lx:cx */ PDL_EXPAND2(register PDL_Indx m=PDLMAX((lx),0), __m_stop=PDLMIN(cx, (__m_size))); for(; m<__m_stop; m+=1) {
821 0           temp += (Int_datap)[0+(__inc_Int_m*(m))+(__inc_Int_n*(n))];
822 0           num++;
823             }} /* Close m=lx:cx */
824 0 0         {/* Open q=ly:cy */ PDL_EXPAND2(register PDL_Indx q=PDLMAX((ly),0), __q_stop=PDLMIN(cy, (__q_size))); for(; q<__q_stop; q+=1) {
825 0           (O_datap)[0+(__inc_O_p*(p))+(__inc_O_q*(q))] += temp/num;
826             }} /* Close q=ly:cy */
827 0           ly = cy + 1;
828             }} /* Close n */
829 0           lx = cx + 1;
830             }} /* Close p */
831 0 0         PDL_BROADCASTLOOP_END_rescale2d_readdata
    0          
832             }
833 0           else return PDL->make_error(PDL_EUSERERROR, "Error in rescale2d:" "I am not supposed to be here, please report the bug to ");
834             }
835 0           } break;
836 0           case PDL_LL: {
837 0 0         PDL_DECLARE_PARAMS_rescale2d_1(PDL_LongLong,Q)
    0          
    0          
    0          
    0          
    0          
838             {
839 0 0         if(__privtrans->ind_sizes[2] >= __privtrans->ind_sizes[0] && __privtrans->ind_sizes[3] >= __privtrans->ind_sizes[1]) {
    0          
840 0           PDL_LDouble kx = ((PDL_LDouble) __privtrans->ind_sizes[2]) / __privtrans->ind_sizes[0];
841 0           PDL_LDouble ky = ((PDL_LDouble) __privtrans->ind_sizes[3]) / __privtrans->ind_sizes[1];
842 0 0         PDL_BROADCASTLOOP_START_rescale2d_readdata
    0          
    0          
    0          
    0          
    0          
    0          
843 0           PDL_Indx lx = 0;
844 0 0         {/* Open m */ PDL_EXPAND2(register PDL_Indx m=0, __m_stop=(__m_size)); for(; m<__m_stop; m+=1) {
845 0           PDL_Indx ly = 0, cx = rint((m+1)*kx);
846 0 0         {/* Open n */ PDL_EXPAND2(register PDL_Indx n=0, __n_stop=(__n_size)); for(; n<__n_stop; n+=1) {
847 0           PDL_Indx cy = rint((n+1)*ky);
848 0 0         {/* Open p=lx:cx */ PDL_EXPAND2(register PDL_Indx p=PDLMAX((lx),0), __p_stop=PDLMIN(cx, (__p_size))); for(; p<__p_stop; p+=1) {{/* Open q=ly:cy */ PDL_EXPAND2(register PDL_Indx q=PDLMAX((ly),0), __q_stop=PDLMIN(cy, (__q_size))); for(; q<__q_stop; q+=1) {
    0          
849 0           (O_datap)[0+(__inc_O_p*(p))+(__inc_O_q*(q))] += (Int_datap)[0+(__inc_Int_m*(m))+(__inc_Int_n*(n))];
850             }} /* Close p=lx:cx */}} /* Close q=ly:cy */
851 0           ly = cy + 1;
852             }} /* Close n */
853 0           lx = cx + 1;
854             }} /* Close m */
855 0 0         PDL_BROADCASTLOOP_END_rescale2d_readdata
    0          
856             }
857 0 0         else if(__privtrans->ind_sizes[2] < __privtrans->ind_sizes[0] && __privtrans->ind_sizes[3] < __privtrans->ind_sizes[1]) {
    0          
858 0           PDL_LDouble kx = ((PDL_LDouble) __privtrans->ind_sizes[0]) / __privtrans->ind_sizes[2];
859 0           PDL_LDouble ky = ((PDL_LDouble) __privtrans->ind_sizes[1]) / __privtrans->ind_sizes[3];
860 0 0         PDL_BROADCASTLOOP_START_rescale2d_readdata
    0          
    0          
    0          
    0          
    0          
    0          
861 0           PDL_Indx lx = 0;
862 0 0         {/* Open p */ PDL_EXPAND2(register PDL_Indx p=0, __p_stop=(__p_size)); for(; p<__p_stop; p+=1) {
863 0           PDL_Indx ly = 0, cx = rint((p+1)*kx);
864 0 0         {/* Open q */ PDL_EXPAND2(register PDL_Indx q=0, __q_stop=(__q_size)); for(; q<__q_stop; q+=1) {
865 0           PDL_Indx cy = rint((q+1)*ky);
866 0           PDL_LDouble temp = 0.0;
867 0           PDL_Indx num = 0;
868 0 0         {/* Open m=lx:cx */ PDL_EXPAND2(register PDL_Indx m=PDLMAX((lx),0), __m_stop=PDLMIN(cx, (__m_size))); for(; m<__m_stop; m+=1) {{/* Open n=ly:cy */ PDL_EXPAND2(register PDL_Indx n=PDLMAX((ly),0), __n_stop=PDLMIN(cy, (__n_size))); for(; n<__n_stop; n+=1) {
    0          
869 0           temp += (Int_datap)[0+(__inc_Int_m*(m))+(__inc_Int_n*(n))];
870 0           num++;
871             }} /* Close m=lx:cx */}} /* Close n=ly:cy */
872 0           (O_datap)[0+(__inc_O_p*(p))+(__inc_O_q*(q))] += temp/num;
873 0           ly = cy + 1;
874             }} /* Close q */
875 0           lx = cx + 1;
876             }} /* Close p */
877 0 0         PDL_BROADCASTLOOP_END_rescale2d_readdata
    0          
878             }
879 0 0         else if(__privtrans->ind_sizes[2] >= __privtrans->ind_sizes[0] && __privtrans->ind_sizes[3] < __privtrans->ind_sizes[1]) {
    0          
880 0           PDL_LDouble kx = ((PDL_LDouble) __privtrans->ind_sizes[2]) / __privtrans->ind_sizes[0];
881 0           PDL_LDouble ky = ((PDL_LDouble) __privtrans->ind_sizes[1]) / __privtrans->ind_sizes[3];
882 0 0         PDL_BROADCASTLOOP_START_rescale2d_readdata
    0          
    0          
    0          
    0          
    0          
    0          
883 0           PDL_Indx lx = 0;
884 0 0         {/* Open m */ PDL_EXPAND2(register PDL_Indx m=0, __m_stop=(__m_size)); for(; m<__m_stop; m+=1) {
885 0           PDL_Indx ly = 0, cx = rint((m+1)*kx);
886 0 0         {/* Open q */ PDL_EXPAND2(register PDL_Indx q=0, __q_stop=(__q_size)); for(; q<__q_stop; q+=1) {
887 0           PDL_Indx cy = rint((q+1)*ky);
888 0           PDL_LDouble temp = 0.0;
889 0           PDL_Indx num = 0;
890 0 0         {/* Open n=ly:cy */ PDL_EXPAND2(register PDL_Indx n=PDLMAX((ly),0), __n_stop=PDLMIN(cy, (__n_size))); for(; n<__n_stop; n+=1) {
891 0           temp += (Int_datap)[0+(__inc_Int_m*(m))+(__inc_Int_n*(n))];
892 0           num++;
893             }} /* Close n=ly:cy */
894 0 0         {/* Open p=lx:cx */ PDL_EXPAND2(register PDL_Indx p=PDLMAX((lx),0), __p_stop=PDLMIN(cx, (__p_size))); for(; p<__p_stop; p+=1) {
895 0           (O_datap)[0+(__inc_O_p*(p))+(__inc_O_q*(q))] += temp/num;
896             }} /* Close p=lx:cx */
897 0           ly = cy + 1;
898             }} /* Close q */
899 0           lx = cx + 1;
900             }} /* Close m */
901 0 0         PDL_BROADCASTLOOP_END_rescale2d_readdata
    0          
902             }
903 0 0         else if(__privtrans->ind_sizes[2] < __privtrans->ind_sizes[0] && __privtrans->ind_sizes[3] >= __privtrans->ind_sizes[1]) {
    0          
904 0           PDL_LDouble kx = ((PDL_LDouble) __privtrans->ind_sizes[0]) / __privtrans->ind_sizes[2];
905 0           PDL_LDouble ky = ((PDL_LDouble) __privtrans->ind_sizes[3]) / __privtrans->ind_sizes[1];
906 0 0         PDL_BROADCASTLOOP_START_rescale2d_readdata
    0          
    0          
    0          
    0          
    0          
    0          
907 0           PDL_Indx lx = 0;
908 0 0         {/* Open p */ PDL_EXPAND2(register PDL_Indx p=0, __p_stop=(__p_size)); for(; p<__p_stop; p+=1) {
909 0           PDL_Indx ly = 0, cx = rint((p+1)*kx);
910 0 0         {/* Open n */ PDL_EXPAND2(register PDL_Indx n=0, __n_stop=(__n_size)); for(; n<__n_stop; n+=1) {
911 0           PDL_Indx cy = rint((n+1)*ky);
912 0           PDL_CLDouble temp = 0.0;
913 0           PDL_Indx num = 0;
914 0 0         {/* Open m=lx:cx */ PDL_EXPAND2(register PDL_Indx m=PDLMAX((lx),0), __m_stop=PDLMIN(cx, (__m_size))); for(; m<__m_stop; m+=1) {
915 0           temp += (Int_datap)[0+(__inc_Int_m*(m))+(__inc_Int_n*(n))];
916 0           num++;
917             }} /* Close m=lx:cx */
918 0 0         {/* Open q=ly:cy */ PDL_EXPAND2(register PDL_Indx q=PDLMAX((ly),0), __q_stop=PDLMIN(cy, (__q_size))); for(; q<__q_stop; q+=1) {
919 0           (O_datap)[0+(__inc_O_p*(p))+(__inc_O_q*(q))] += temp/num;
920             }} /* Close q=ly:cy */
921 0           ly = cy + 1;
922             }} /* Close n */
923 0           lx = cx + 1;
924             }} /* Close p */
925 0 0         PDL_BROADCASTLOOP_END_rescale2d_readdata
    0          
926             }
927 0           else return PDL->make_error(PDL_EUSERERROR, "Error in rescale2d:" "I am not supposed to be here, please report the bug to ");
928             }
929 0           } break;
930 0           case PDL_F: {
931 0 0         PDL_DECLARE_PARAMS_rescale2d_1(PDL_Float,F)
    0          
    0          
    0          
    0          
    0          
932             {
933 0 0         if(__privtrans->ind_sizes[2] >= __privtrans->ind_sizes[0] && __privtrans->ind_sizes[3] >= __privtrans->ind_sizes[1]) {
    0          
934 0           PDL_LDouble kx = ((PDL_LDouble) __privtrans->ind_sizes[2]) / __privtrans->ind_sizes[0];
935 0           PDL_LDouble ky = ((PDL_LDouble) __privtrans->ind_sizes[3]) / __privtrans->ind_sizes[1];
936 0 0         PDL_BROADCASTLOOP_START_rescale2d_readdata
    0          
    0          
    0          
    0          
    0          
    0          
937 0           PDL_Indx lx = 0;
938 0 0         {/* Open m */ PDL_EXPAND2(register PDL_Indx m=0, __m_stop=(__m_size)); for(; m<__m_stop; m+=1) {
939 0           PDL_Indx ly = 0, cx = rint((m+1)*kx);
940 0 0         {/* Open n */ PDL_EXPAND2(register PDL_Indx n=0, __n_stop=(__n_size)); for(; n<__n_stop; n+=1) {
941 0           PDL_Indx cy = rint((n+1)*ky);
942 0 0         {/* Open p=lx:cx */ PDL_EXPAND2(register PDL_Indx p=PDLMAX((lx),0), __p_stop=PDLMIN(cx, (__p_size))); for(; p<__p_stop; p+=1) {{/* Open q=ly:cy */ PDL_EXPAND2(register PDL_Indx q=PDLMAX((ly),0), __q_stop=PDLMIN(cy, (__q_size))); for(; q<__q_stop; q+=1) {
    0          
943 0           (O_datap)[0+(__inc_O_p*(p))+(__inc_O_q*(q))] += (Int_datap)[0+(__inc_Int_m*(m))+(__inc_Int_n*(n))];
944             }} /* Close p=lx:cx */}} /* Close q=ly:cy */
945 0           ly = cy + 1;
946             }} /* Close n */
947 0           lx = cx + 1;
948             }} /* Close m */
949 0 0         PDL_BROADCASTLOOP_END_rescale2d_readdata
    0          
950             }
951 0 0         else if(__privtrans->ind_sizes[2] < __privtrans->ind_sizes[0] && __privtrans->ind_sizes[3] < __privtrans->ind_sizes[1]) {
    0          
952 0           PDL_LDouble kx = ((PDL_LDouble) __privtrans->ind_sizes[0]) / __privtrans->ind_sizes[2];
953 0           PDL_LDouble ky = ((PDL_LDouble) __privtrans->ind_sizes[1]) / __privtrans->ind_sizes[3];
954 0 0         PDL_BROADCASTLOOP_START_rescale2d_readdata
    0          
    0          
    0          
    0          
    0          
    0          
955 0           PDL_Indx lx = 0;
956 0 0         {/* Open p */ PDL_EXPAND2(register PDL_Indx p=0, __p_stop=(__p_size)); for(; p<__p_stop; p+=1) {
957 0           PDL_Indx ly = 0, cx = rint((p+1)*kx);
958 0 0         {/* Open q */ PDL_EXPAND2(register PDL_Indx q=0, __q_stop=(__q_size)); for(; q<__q_stop; q+=1) {
959 0           PDL_Indx cy = rint((q+1)*ky);
960 0           PDL_LDouble temp = 0.0;
961 0           PDL_Indx num = 0;
962 0 0         {/* Open m=lx:cx */ PDL_EXPAND2(register PDL_Indx m=PDLMAX((lx),0), __m_stop=PDLMIN(cx, (__m_size))); for(; m<__m_stop; m+=1) {{/* Open n=ly:cy */ PDL_EXPAND2(register PDL_Indx n=PDLMAX((ly),0), __n_stop=PDLMIN(cy, (__n_size))); for(; n<__n_stop; n+=1) {
    0          
963 0           temp += (Int_datap)[0+(__inc_Int_m*(m))+(__inc_Int_n*(n))];
964 0           num++;
965             }} /* Close m=lx:cx */}} /* Close n=ly:cy */
966 0           (O_datap)[0+(__inc_O_p*(p))+(__inc_O_q*(q))] += temp/num;
967 0           ly = cy + 1;
968             }} /* Close q */
969 0           lx = cx + 1;
970             }} /* Close p */
971 0 0         PDL_BROADCASTLOOP_END_rescale2d_readdata
    0          
972             }
973 0 0         else if(__privtrans->ind_sizes[2] >= __privtrans->ind_sizes[0] && __privtrans->ind_sizes[3] < __privtrans->ind_sizes[1]) {
    0          
974 0           PDL_LDouble kx = ((PDL_LDouble) __privtrans->ind_sizes[2]) / __privtrans->ind_sizes[0];
975 0           PDL_LDouble ky = ((PDL_LDouble) __privtrans->ind_sizes[1]) / __privtrans->ind_sizes[3];
976 0 0         PDL_BROADCASTLOOP_START_rescale2d_readdata
    0          
    0          
    0          
    0          
    0          
    0          
977 0           PDL_Indx lx = 0;
978 0 0         {/* Open m */ PDL_EXPAND2(register PDL_Indx m=0, __m_stop=(__m_size)); for(; m<__m_stop; m+=1) {
979 0           PDL_Indx ly = 0, cx = rint((m+1)*kx);
980 0 0         {/* Open q */ PDL_EXPAND2(register PDL_Indx q=0, __q_stop=(__q_size)); for(; q<__q_stop; q+=1) {
981 0           PDL_Indx cy = rint((q+1)*ky);
982 0           PDL_LDouble temp = 0.0;
983 0           PDL_Indx num = 0;
984 0 0         {/* Open n=ly:cy */ PDL_EXPAND2(register PDL_Indx n=PDLMAX((ly),0), __n_stop=PDLMIN(cy, (__n_size))); for(; n<__n_stop; n+=1) {
985 0           temp += (Int_datap)[0+(__inc_Int_m*(m))+(__inc_Int_n*(n))];
986 0           num++;
987             }} /* Close n=ly:cy */
988 0 0         {/* Open p=lx:cx */ PDL_EXPAND2(register PDL_Indx p=PDLMAX((lx),0), __p_stop=PDLMIN(cx, (__p_size))); for(; p<__p_stop; p+=1) {
989 0           (O_datap)[0+(__inc_O_p*(p))+(__inc_O_q*(q))] += temp/num;
990             }} /* Close p=lx:cx */
991 0           ly = cy + 1;
992             }} /* Close q */
993 0           lx = cx + 1;
994             }} /* Close m */
995 0 0         PDL_BROADCASTLOOP_END_rescale2d_readdata
    0          
996             }
997 0 0         else if(__privtrans->ind_sizes[2] < __privtrans->ind_sizes[0] && __privtrans->ind_sizes[3] >= __privtrans->ind_sizes[1]) {
    0          
998 0           PDL_LDouble kx = ((PDL_LDouble) __privtrans->ind_sizes[0]) / __privtrans->ind_sizes[2];
999 0           PDL_LDouble ky = ((PDL_LDouble) __privtrans->ind_sizes[3]) / __privtrans->ind_sizes[1];
1000 0 0         PDL_BROADCASTLOOP_START_rescale2d_readdata
    0          
    0          
    0          
    0          
    0          
    0          
1001 0           PDL_Indx lx = 0;
1002 0 0         {/* Open p */ PDL_EXPAND2(register PDL_Indx p=0, __p_stop=(__p_size)); for(; p<__p_stop; p+=1) {
1003 0           PDL_Indx ly = 0, cx = rint((p+1)*kx);
1004 0 0         {/* Open n */ PDL_EXPAND2(register PDL_Indx n=0, __n_stop=(__n_size)); for(; n<__n_stop; n+=1) {
1005 0           PDL_Indx cy = rint((n+1)*ky);
1006 0           PDL_CLDouble temp = 0.0;
1007 0           PDL_Indx num = 0;
1008 0 0         {/* Open m=lx:cx */ PDL_EXPAND2(register PDL_Indx m=PDLMAX((lx),0), __m_stop=PDLMIN(cx, (__m_size))); for(; m<__m_stop; m+=1) {
1009 0           temp += (Int_datap)[0+(__inc_Int_m*(m))+(__inc_Int_n*(n))];
1010 0           num++;
1011             }} /* Close m=lx:cx */
1012 0 0         {/* Open q=ly:cy */ PDL_EXPAND2(register PDL_Indx q=PDLMAX((ly),0), __q_stop=PDLMIN(cy, (__q_size))); for(; q<__q_stop; q+=1) {
1013 0           (O_datap)[0+(__inc_O_p*(p))+(__inc_O_q*(q))] += temp/num;
1014             }} /* Close q=ly:cy */
1015 0           ly = cy + 1;
1016             }} /* Close n */
1017 0           lx = cx + 1;
1018             }} /* Close p */
1019 0 0         PDL_BROADCASTLOOP_END_rescale2d_readdata
    0          
1020             }
1021 0           else return PDL->make_error(PDL_EUSERERROR, "Error in rescale2d:" "I am not supposed to be here, please report the bug to ");
1022             }
1023 0           } break;
1024 0           case PDL_D: {
1025 0 0         PDL_DECLARE_PARAMS_rescale2d_1(PDL_Double,D)
    0          
    0          
    0          
    0          
    0          
1026             {
1027 0 0         if(__privtrans->ind_sizes[2] >= __privtrans->ind_sizes[0] && __privtrans->ind_sizes[3] >= __privtrans->ind_sizes[1]) {
    0          
1028 0           PDL_LDouble kx = ((PDL_LDouble) __privtrans->ind_sizes[2]) / __privtrans->ind_sizes[0];
1029 0           PDL_LDouble ky = ((PDL_LDouble) __privtrans->ind_sizes[3]) / __privtrans->ind_sizes[1];
1030 0 0         PDL_BROADCASTLOOP_START_rescale2d_readdata
    0          
    0          
    0          
    0          
    0          
    0          
1031 0           PDL_Indx lx = 0;
1032 0 0         {/* Open m */ PDL_EXPAND2(register PDL_Indx m=0, __m_stop=(__m_size)); for(; m<__m_stop; m+=1) {
1033 0           PDL_Indx ly = 0, cx = rint((m+1)*kx);
1034 0 0         {/* Open n */ PDL_EXPAND2(register PDL_Indx n=0, __n_stop=(__n_size)); for(; n<__n_stop; n+=1) {
1035 0           PDL_Indx cy = rint((n+1)*ky);
1036 0 0         {/* Open p=lx:cx */ PDL_EXPAND2(register PDL_Indx p=PDLMAX((lx),0), __p_stop=PDLMIN(cx, (__p_size))); for(; p<__p_stop; p+=1) {{/* Open q=ly:cy */ PDL_EXPAND2(register PDL_Indx q=PDLMAX((ly),0), __q_stop=PDLMIN(cy, (__q_size))); for(; q<__q_stop; q+=1) {
    0          
1037 0           (O_datap)[0+(__inc_O_p*(p))+(__inc_O_q*(q))] += (Int_datap)[0+(__inc_Int_m*(m))+(__inc_Int_n*(n))];
1038             }} /* Close p=lx:cx */}} /* Close q=ly:cy */
1039 0           ly = cy + 1;
1040             }} /* Close n */
1041 0           lx = cx + 1;
1042             }} /* Close m */
1043 0 0         PDL_BROADCASTLOOP_END_rescale2d_readdata
    0          
1044             }
1045 0 0         else if(__privtrans->ind_sizes[2] < __privtrans->ind_sizes[0] && __privtrans->ind_sizes[3] < __privtrans->ind_sizes[1]) {
    0          
1046 0           PDL_LDouble kx = ((PDL_LDouble) __privtrans->ind_sizes[0]) / __privtrans->ind_sizes[2];
1047 0           PDL_LDouble ky = ((PDL_LDouble) __privtrans->ind_sizes[1]) / __privtrans->ind_sizes[3];
1048 0 0         PDL_BROADCASTLOOP_START_rescale2d_readdata
    0          
    0          
    0          
    0          
    0          
    0          
1049 0           PDL_Indx lx = 0;
1050 0 0         {/* Open p */ PDL_EXPAND2(register PDL_Indx p=0, __p_stop=(__p_size)); for(; p<__p_stop; p+=1) {
1051 0           PDL_Indx ly = 0, cx = rint((p+1)*kx);
1052 0 0         {/* Open q */ PDL_EXPAND2(register PDL_Indx q=0, __q_stop=(__q_size)); for(; q<__q_stop; q+=1) {
1053 0           PDL_Indx cy = rint((q+1)*ky);
1054 0           PDL_LDouble temp = 0.0;
1055 0           PDL_Indx num = 0;
1056 0 0         {/* Open m=lx:cx */ PDL_EXPAND2(register PDL_Indx m=PDLMAX((lx),0), __m_stop=PDLMIN(cx, (__m_size))); for(; m<__m_stop; m+=1) {{/* Open n=ly:cy */ PDL_EXPAND2(register PDL_Indx n=PDLMAX((ly),0), __n_stop=PDLMIN(cy, (__n_size))); for(; n<__n_stop; n+=1) {
    0          
1057 0           temp += (Int_datap)[0+(__inc_Int_m*(m))+(__inc_Int_n*(n))];
1058 0           num++;
1059             }} /* Close m=lx:cx */}} /* Close n=ly:cy */
1060 0           (O_datap)[0+(__inc_O_p*(p))+(__inc_O_q*(q))] += temp/num;
1061 0           ly = cy + 1;
1062             }} /* Close q */
1063 0           lx = cx + 1;
1064             }} /* Close p */
1065 0 0         PDL_BROADCASTLOOP_END_rescale2d_readdata
    0          
1066             }
1067 0 0         else if(__privtrans->ind_sizes[2] >= __privtrans->ind_sizes[0] && __privtrans->ind_sizes[3] < __privtrans->ind_sizes[1]) {
    0          
1068 0           PDL_LDouble kx = ((PDL_LDouble) __privtrans->ind_sizes[2]) / __privtrans->ind_sizes[0];
1069 0           PDL_LDouble ky = ((PDL_LDouble) __privtrans->ind_sizes[1]) / __privtrans->ind_sizes[3];
1070 0 0         PDL_BROADCASTLOOP_START_rescale2d_readdata
    0          
    0          
    0          
    0          
    0          
    0          
1071 0           PDL_Indx lx = 0;
1072 0 0         {/* Open m */ PDL_EXPAND2(register PDL_Indx m=0, __m_stop=(__m_size)); for(; m<__m_stop; m+=1) {
1073 0           PDL_Indx ly = 0, cx = rint((m+1)*kx);
1074 0 0         {/* Open q */ PDL_EXPAND2(register PDL_Indx q=0, __q_stop=(__q_size)); for(; q<__q_stop; q+=1) {
1075 0           PDL_Indx cy = rint((q+1)*ky);
1076 0           PDL_LDouble temp = 0.0;
1077 0           PDL_Indx num = 0;
1078 0 0         {/* Open n=ly:cy */ PDL_EXPAND2(register PDL_Indx n=PDLMAX((ly),0), __n_stop=PDLMIN(cy, (__n_size))); for(; n<__n_stop; n+=1) {
1079 0           temp += (Int_datap)[0+(__inc_Int_m*(m))+(__inc_Int_n*(n))];
1080 0           num++;
1081             }} /* Close n=ly:cy */
1082 0 0         {/* Open p=lx:cx */ PDL_EXPAND2(register PDL_Indx p=PDLMAX((lx),0), __p_stop=PDLMIN(cx, (__p_size))); for(; p<__p_stop; p+=1) {
1083 0           (O_datap)[0+(__inc_O_p*(p))+(__inc_O_q*(q))] += temp/num;
1084             }} /* Close p=lx:cx */
1085 0           ly = cy + 1;
1086             }} /* Close q */
1087 0           lx = cx + 1;
1088             }} /* Close m */
1089 0 0         PDL_BROADCASTLOOP_END_rescale2d_readdata
    0          
1090             }
1091 0 0         else if(__privtrans->ind_sizes[2] < __privtrans->ind_sizes[0] && __privtrans->ind_sizes[3] >= __privtrans->ind_sizes[1]) {
    0          
1092 0           PDL_LDouble kx = ((PDL_LDouble) __privtrans->ind_sizes[0]) / __privtrans->ind_sizes[2];
1093 0           PDL_LDouble ky = ((PDL_LDouble) __privtrans->ind_sizes[3]) / __privtrans->ind_sizes[1];
1094 0 0         PDL_BROADCASTLOOP_START_rescale2d_readdata
    0          
    0          
    0          
    0          
    0          
    0          
1095 0           PDL_Indx lx = 0;
1096 0 0         {/* Open p */ PDL_EXPAND2(register PDL_Indx p=0, __p_stop=(__p_size)); for(; p<__p_stop; p+=1) {
1097 0           PDL_Indx ly = 0, cx = rint((p+1)*kx);
1098 0 0         {/* Open n */ PDL_EXPAND2(register PDL_Indx n=0, __n_stop=(__n_size)); for(; n<__n_stop; n+=1) {
1099 0           PDL_Indx cy = rint((n+1)*ky);
1100 0           PDL_CLDouble temp = 0.0;
1101 0           PDL_Indx num = 0;
1102 0 0         {/* Open m=lx:cx */ PDL_EXPAND2(register PDL_Indx m=PDLMAX((lx),0), __m_stop=PDLMIN(cx, (__m_size))); for(; m<__m_stop; m+=1) {
1103 0           temp += (Int_datap)[0+(__inc_Int_m*(m))+(__inc_Int_n*(n))];
1104 0           num++;
1105             }} /* Close m=lx:cx */
1106 0 0         {/* Open q=ly:cy */ PDL_EXPAND2(register PDL_Indx q=PDLMAX((ly),0), __q_stop=PDLMIN(cy, (__q_size))); for(; q<__q_stop; q+=1) {
1107 0           (O_datap)[0+(__inc_O_p*(p))+(__inc_O_q*(q))] += temp/num;
1108             }} /* Close q=ly:cy */
1109 0           ly = cy + 1;
1110             }} /* Close n */
1111 0           lx = cx + 1;
1112             }} /* Close p */
1113 0 0         PDL_BROADCASTLOOP_END_rescale2d_readdata
    0          
1114             }
1115 0           else return PDL->make_error(PDL_EUSERERROR, "Error in rescale2d:" "I am not supposed to be here, please report the bug to ");
1116             }
1117 0           } break;
1118 0           case PDL_LD: {
1119 0 0         PDL_DECLARE_PARAMS_rescale2d_1(PDL_LDouble,E)
    0          
    0          
    0          
    0          
    0          
1120             {
1121 0 0         if(__privtrans->ind_sizes[2] >= __privtrans->ind_sizes[0] && __privtrans->ind_sizes[3] >= __privtrans->ind_sizes[1]) {
    0          
1122 0           PDL_LDouble kx = ((PDL_LDouble) __privtrans->ind_sizes[2]) / __privtrans->ind_sizes[0];
1123 0           PDL_LDouble ky = ((PDL_LDouble) __privtrans->ind_sizes[3]) / __privtrans->ind_sizes[1];
1124 0 0         PDL_BROADCASTLOOP_START_rescale2d_readdata
    0          
    0          
    0          
    0          
    0          
    0          
1125 0           PDL_Indx lx = 0;
1126 0 0         {/* Open m */ PDL_EXPAND2(register PDL_Indx m=0, __m_stop=(__m_size)); for(; m<__m_stop; m+=1) {
1127 0           PDL_Indx ly = 0, cx = rint((m+1)*kx);
1128 0 0         {/* Open n */ PDL_EXPAND2(register PDL_Indx n=0, __n_stop=(__n_size)); for(; n<__n_stop; n+=1) {
1129 0           PDL_Indx cy = rint((n+1)*ky);
1130 0 0         {/* Open p=lx:cx */ PDL_EXPAND2(register PDL_Indx p=PDLMAX((lx),0), __p_stop=PDLMIN(cx, (__p_size))); for(; p<__p_stop; p+=1) {{/* Open q=ly:cy */ PDL_EXPAND2(register PDL_Indx q=PDLMAX((ly),0), __q_stop=PDLMIN(cy, (__q_size))); for(; q<__q_stop; q+=1) {
    0          
1131 0           (O_datap)[0+(__inc_O_p*(p))+(__inc_O_q*(q))] += (Int_datap)[0+(__inc_Int_m*(m))+(__inc_Int_n*(n))];
1132             }} /* Close p=lx:cx */}} /* Close q=ly:cy */
1133 0           ly = cy + 1;
1134             }} /* Close n */
1135 0           lx = cx + 1;
1136             }} /* Close m */
1137 0 0         PDL_BROADCASTLOOP_END_rescale2d_readdata
    0          
1138             }
1139 0 0         else if(__privtrans->ind_sizes[2] < __privtrans->ind_sizes[0] && __privtrans->ind_sizes[3] < __privtrans->ind_sizes[1]) {
    0          
1140 0           PDL_LDouble kx = ((PDL_LDouble) __privtrans->ind_sizes[0]) / __privtrans->ind_sizes[2];
1141 0           PDL_LDouble ky = ((PDL_LDouble) __privtrans->ind_sizes[1]) / __privtrans->ind_sizes[3];
1142 0 0         PDL_BROADCASTLOOP_START_rescale2d_readdata
    0          
    0          
    0          
    0          
    0          
    0          
1143 0           PDL_Indx lx = 0;
1144 0 0         {/* Open p */ PDL_EXPAND2(register PDL_Indx p=0, __p_stop=(__p_size)); for(; p<__p_stop; p+=1) {
1145 0           PDL_Indx ly = 0, cx = rint((p+1)*kx);
1146 0 0         {/* Open q */ PDL_EXPAND2(register PDL_Indx q=0, __q_stop=(__q_size)); for(; q<__q_stop; q+=1) {
1147 0           PDL_Indx cy = rint((q+1)*ky);
1148 0           PDL_LDouble temp = 0.0;
1149 0           PDL_Indx num = 0;
1150 0 0         {/* Open m=lx:cx */ PDL_EXPAND2(register PDL_Indx m=PDLMAX((lx),0), __m_stop=PDLMIN(cx, (__m_size))); for(; m<__m_stop; m+=1) {{/* Open n=ly:cy */ PDL_EXPAND2(register PDL_Indx n=PDLMAX((ly),0), __n_stop=PDLMIN(cy, (__n_size))); for(; n<__n_stop; n+=1) {
    0          
1151 0           temp += (Int_datap)[0+(__inc_Int_m*(m))+(__inc_Int_n*(n))];
1152 0           num++;
1153             }} /* Close m=lx:cx */}} /* Close n=ly:cy */
1154 0           (O_datap)[0+(__inc_O_p*(p))+(__inc_O_q*(q))] += temp/num;
1155 0           ly = cy + 1;
1156             }} /* Close q */
1157 0           lx = cx + 1;
1158             }} /* Close p */
1159 0 0         PDL_BROADCASTLOOP_END_rescale2d_readdata
    0          
1160             }
1161 0 0         else if(__privtrans->ind_sizes[2] >= __privtrans->ind_sizes[0] && __privtrans->ind_sizes[3] < __privtrans->ind_sizes[1]) {
    0          
1162 0           PDL_LDouble kx = ((PDL_LDouble) __privtrans->ind_sizes[2]) / __privtrans->ind_sizes[0];
1163 0           PDL_LDouble ky = ((PDL_LDouble) __privtrans->ind_sizes[1]) / __privtrans->ind_sizes[3];
1164 0 0         PDL_BROADCASTLOOP_START_rescale2d_readdata
    0          
    0          
    0          
    0          
    0          
    0          
1165 0           PDL_Indx lx = 0;
1166 0 0         {/* Open m */ PDL_EXPAND2(register PDL_Indx m=0, __m_stop=(__m_size)); for(; m<__m_stop; m+=1) {
1167 0           PDL_Indx ly = 0, cx = rint((m+1)*kx);
1168 0 0         {/* Open q */ PDL_EXPAND2(register PDL_Indx q=0, __q_stop=(__q_size)); for(; q<__q_stop; q+=1) {
1169 0           PDL_Indx cy = rint((q+1)*ky);
1170 0           PDL_LDouble temp = 0.0;
1171 0           PDL_Indx num = 0;
1172 0 0         {/* Open n=ly:cy */ PDL_EXPAND2(register PDL_Indx n=PDLMAX((ly),0), __n_stop=PDLMIN(cy, (__n_size))); for(; n<__n_stop; n+=1) {
1173 0           temp += (Int_datap)[0+(__inc_Int_m*(m))+(__inc_Int_n*(n))];
1174 0           num++;
1175             }} /* Close n=ly:cy */
1176 0 0         {/* Open p=lx:cx */ PDL_EXPAND2(register PDL_Indx p=PDLMAX((lx),0), __p_stop=PDLMIN(cx, (__p_size))); for(; p<__p_stop; p+=1) {
1177 0           (O_datap)[0+(__inc_O_p*(p))+(__inc_O_q*(q))] += temp/num;
1178             }} /* Close p=lx:cx */
1179 0           ly = cy + 1;
1180             }} /* Close q */
1181 0           lx = cx + 1;
1182             }} /* Close m */
1183 0 0         PDL_BROADCASTLOOP_END_rescale2d_readdata
    0          
1184             }
1185 0 0         else if(__privtrans->ind_sizes[2] < __privtrans->ind_sizes[0] && __privtrans->ind_sizes[3] >= __privtrans->ind_sizes[1]) {
    0          
1186 0           PDL_LDouble kx = ((PDL_LDouble) __privtrans->ind_sizes[0]) / __privtrans->ind_sizes[2];
1187 0           PDL_LDouble ky = ((PDL_LDouble) __privtrans->ind_sizes[3]) / __privtrans->ind_sizes[1];
1188 0 0         PDL_BROADCASTLOOP_START_rescale2d_readdata
    0          
    0          
    0          
    0          
    0          
    0          
1189 0           PDL_Indx lx = 0;
1190 0 0         {/* Open p */ PDL_EXPAND2(register PDL_Indx p=0, __p_stop=(__p_size)); for(; p<__p_stop; p+=1) {
1191 0           PDL_Indx ly = 0, cx = rint((p+1)*kx);
1192 0 0         {/* Open n */ PDL_EXPAND2(register PDL_Indx n=0, __n_stop=(__n_size)); for(; n<__n_stop; n+=1) {
1193 0           PDL_Indx cy = rint((n+1)*ky);
1194 0           PDL_CLDouble temp = 0.0;
1195 0           PDL_Indx num = 0;
1196 0 0         {/* Open m=lx:cx */ PDL_EXPAND2(register PDL_Indx m=PDLMAX((lx),0), __m_stop=PDLMIN(cx, (__m_size))); for(; m<__m_stop; m+=1) {
1197 0           temp += (Int_datap)[0+(__inc_Int_m*(m))+(__inc_Int_n*(n))];
1198 0           num++;
1199             }} /* Close m=lx:cx */
1200 0 0         {/* Open q=ly:cy */ PDL_EXPAND2(register PDL_Indx q=PDLMAX((ly),0), __q_stop=PDLMIN(cy, (__q_size))); for(; q<__q_stop; q+=1) {
1201 0           (O_datap)[0+(__inc_O_p*(p))+(__inc_O_q*(q))] += temp/num;
1202             }} /* Close q=ly:cy */
1203 0           ly = cy + 1;
1204             }} /* Close n */
1205 0           lx = cx + 1;
1206             }} /* Close p */
1207 0 0         PDL_BROADCASTLOOP_END_rescale2d_readdata
    0          
1208             }
1209 0           else return PDL->make_error(PDL_EUSERERROR, "Error in rescale2d:" "I am not supposed to be here, please report the bug to ");
1210             }
1211 0           } break;
1212 0           case PDL_CF: {
1213 0 0         PDL_DECLARE_PARAMS_rescale2d_1(PDL_CFloat,G)
    0          
    0          
    0          
    0          
    0          
1214             {
1215 0 0         if(__privtrans->ind_sizes[2] >= __privtrans->ind_sizes[0] && __privtrans->ind_sizes[3] >= __privtrans->ind_sizes[1]) {
    0          
1216 0           PDL_LDouble kx = ((PDL_LDouble) __privtrans->ind_sizes[2]) / __privtrans->ind_sizes[0];
1217 0           PDL_LDouble ky = ((PDL_LDouble) __privtrans->ind_sizes[3]) / __privtrans->ind_sizes[1];
1218 0 0         PDL_BROADCASTLOOP_START_rescale2d_readdata
    0          
    0          
    0          
    0          
    0          
    0          
1219 0           PDL_Indx lx = 0;
1220 0 0         {/* Open m */ PDL_EXPAND2(register PDL_Indx m=0, __m_stop=(__m_size)); for(; m<__m_stop; m+=1) {
1221 0           PDL_Indx ly = 0, cx = rint((m+1)*kx);
1222 0 0         {/* Open n */ PDL_EXPAND2(register PDL_Indx n=0, __n_stop=(__n_size)); for(; n<__n_stop; n+=1) {
1223 0           PDL_Indx cy = rint((n+1)*ky);
1224 0 0         {/* Open p=lx:cx */ PDL_EXPAND2(register PDL_Indx p=PDLMAX((lx),0), __p_stop=PDLMIN(cx, (__p_size))); for(; p<__p_stop; p+=1) {{/* Open q=ly:cy */ PDL_EXPAND2(register PDL_Indx q=PDLMAX((ly),0), __q_stop=PDLMIN(cy, (__q_size))); for(; q<__q_stop; q+=1) {
    0          
1225 0           (O_datap)[0+(__inc_O_p*(p))+(__inc_O_q*(q))] += (Int_datap)[0+(__inc_Int_m*(m))+(__inc_Int_n*(n))];
1226             }} /* Close p=lx:cx */}} /* Close q=ly:cy */
1227 0           ly = cy + 1;
1228             }} /* Close n */
1229 0           lx = cx + 1;
1230             }} /* Close m */
1231 0 0         PDL_BROADCASTLOOP_END_rescale2d_readdata
    0          
1232             }
1233 0 0         else if(__privtrans->ind_sizes[2] < __privtrans->ind_sizes[0] && __privtrans->ind_sizes[3] < __privtrans->ind_sizes[1]) {
    0          
1234 0           PDL_LDouble kx = ((PDL_LDouble) __privtrans->ind_sizes[0]) / __privtrans->ind_sizes[2];
1235 0           PDL_LDouble ky = ((PDL_LDouble) __privtrans->ind_sizes[1]) / __privtrans->ind_sizes[3];
1236 0 0         PDL_BROADCASTLOOP_START_rescale2d_readdata
    0          
    0          
    0          
    0          
    0          
    0          
1237 0           PDL_Indx lx = 0;
1238 0 0         {/* Open p */ PDL_EXPAND2(register PDL_Indx p=0, __p_stop=(__p_size)); for(; p<__p_stop; p+=1) {
1239 0           PDL_Indx ly = 0, cx = rint((p+1)*kx);
1240 0 0         {/* Open q */ PDL_EXPAND2(register PDL_Indx q=0, __q_stop=(__q_size)); for(; q<__q_stop; q+=1) {
1241 0           PDL_Indx cy = rint((q+1)*ky);
1242 0           PDL_LDouble temp = 0.0;
1243 0           PDL_Indx num = 0;
1244 0 0         {/* Open m=lx:cx */ PDL_EXPAND2(register PDL_Indx m=PDLMAX((lx),0), __m_stop=PDLMIN(cx, (__m_size))); for(; m<__m_stop; m+=1) {{/* Open n=ly:cy */ PDL_EXPAND2(register PDL_Indx n=PDLMAX((ly),0), __n_stop=PDLMIN(cy, (__n_size))); for(; n<__n_stop; n+=1) {
    0          
1245 0           temp += (Int_datap)[0+(__inc_Int_m*(m))+(__inc_Int_n*(n))];
1246 0           num++;
1247             }} /* Close m=lx:cx */}} /* Close n=ly:cy */
1248 0           (O_datap)[0+(__inc_O_p*(p))+(__inc_O_q*(q))] += temp/num;
1249 0           ly = cy + 1;
1250             }} /* Close q */
1251 0           lx = cx + 1;
1252             }} /* Close p */
1253 0 0         PDL_BROADCASTLOOP_END_rescale2d_readdata
    0          
1254             }
1255 0 0         else if(__privtrans->ind_sizes[2] >= __privtrans->ind_sizes[0] && __privtrans->ind_sizes[3] < __privtrans->ind_sizes[1]) {
    0          
1256 0           PDL_LDouble kx = ((PDL_LDouble) __privtrans->ind_sizes[2]) / __privtrans->ind_sizes[0];
1257 0           PDL_LDouble ky = ((PDL_LDouble) __privtrans->ind_sizes[1]) / __privtrans->ind_sizes[3];
1258 0 0         PDL_BROADCASTLOOP_START_rescale2d_readdata
    0          
    0          
    0          
    0          
    0          
    0          
1259 0           PDL_Indx lx = 0;
1260 0 0         {/* Open m */ PDL_EXPAND2(register PDL_Indx m=0, __m_stop=(__m_size)); for(; m<__m_stop; m+=1) {
1261 0           PDL_Indx ly = 0, cx = rint((m+1)*kx);
1262 0 0         {/* Open q */ PDL_EXPAND2(register PDL_Indx q=0, __q_stop=(__q_size)); for(; q<__q_stop; q+=1) {
1263 0           PDL_Indx cy = rint((q+1)*ky);
1264 0           PDL_LDouble temp = 0.0;
1265 0           PDL_Indx num = 0;
1266 0 0         {/* Open n=ly:cy */ PDL_EXPAND2(register PDL_Indx n=PDLMAX((ly),0), __n_stop=PDLMIN(cy, (__n_size))); for(; n<__n_stop; n+=1) {
1267 0           temp += (Int_datap)[0+(__inc_Int_m*(m))+(__inc_Int_n*(n))];
1268 0           num++;
1269             }} /* Close n=ly:cy */
1270 0 0         {/* Open p=lx:cx */ PDL_EXPAND2(register PDL_Indx p=PDLMAX((lx),0), __p_stop=PDLMIN(cx, (__p_size))); for(; p<__p_stop; p+=1) {
1271 0           (O_datap)[0+(__inc_O_p*(p))+(__inc_O_q*(q))] += temp/num;
1272             }} /* Close p=lx:cx */
1273 0           ly = cy + 1;
1274             }} /* Close q */
1275 0           lx = cx + 1;
1276             }} /* Close m */
1277 0 0         PDL_BROADCASTLOOP_END_rescale2d_readdata
    0          
1278             }
1279 0 0         else if(__privtrans->ind_sizes[2] < __privtrans->ind_sizes[0] && __privtrans->ind_sizes[3] >= __privtrans->ind_sizes[1]) {
    0          
1280 0           PDL_LDouble kx = ((PDL_LDouble) __privtrans->ind_sizes[0]) / __privtrans->ind_sizes[2];
1281 0           PDL_LDouble ky = ((PDL_LDouble) __privtrans->ind_sizes[3]) / __privtrans->ind_sizes[1];
1282 0 0         PDL_BROADCASTLOOP_START_rescale2d_readdata
    0          
    0          
    0          
    0          
    0          
    0          
1283 0           PDL_Indx lx = 0;
1284 0 0         {/* Open p */ PDL_EXPAND2(register PDL_Indx p=0, __p_stop=(__p_size)); for(; p<__p_stop; p+=1) {
1285 0           PDL_Indx ly = 0, cx = rint((p+1)*kx);
1286 0 0         {/* Open n */ PDL_EXPAND2(register PDL_Indx n=0, __n_stop=(__n_size)); for(; n<__n_stop; n+=1) {
1287 0           PDL_Indx cy = rint((n+1)*ky);
1288 0           PDL_CLDouble temp = 0.0;
1289 0           PDL_Indx num = 0;
1290 0 0         {/* Open m=lx:cx */ PDL_EXPAND2(register PDL_Indx m=PDLMAX((lx),0), __m_stop=PDLMIN(cx, (__m_size))); for(; m<__m_stop; m+=1) {
1291 0           temp += (Int_datap)[0+(__inc_Int_m*(m))+(__inc_Int_n*(n))];
1292 0           num++;
1293             }} /* Close m=lx:cx */
1294 0 0         {/* Open q=ly:cy */ PDL_EXPAND2(register PDL_Indx q=PDLMAX((ly),0), __q_stop=PDLMIN(cy, (__q_size))); for(; q<__q_stop; q+=1) {
1295 0           (O_datap)[0+(__inc_O_p*(p))+(__inc_O_q*(q))] += temp/num;
1296             }} /* Close q=ly:cy */
1297 0           ly = cy + 1;
1298             }} /* Close n */
1299 0           lx = cx + 1;
1300             }} /* Close p */
1301 0 0         PDL_BROADCASTLOOP_END_rescale2d_readdata
    0          
1302             }
1303 0           else return PDL->make_error(PDL_EUSERERROR, "Error in rescale2d:" "I am not supposed to be here, please report the bug to ");
1304             }
1305 0           } break;
1306 0           case PDL_CD: {
1307 0 0         PDL_DECLARE_PARAMS_rescale2d_1(PDL_CDouble,C)
    0          
    0          
    0          
    0          
    0          
1308             {
1309 0 0         if(__privtrans->ind_sizes[2] >= __privtrans->ind_sizes[0] && __privtrans->ind_sizes[3] >= __privtrans->ind_sizes[1]) {
    0          
1310 0           PDL_LDouble kx = ((PDL_LDouble) __privtrans->ind_sizes[2]) / __privtrans->ind_sizes[0];
1311 0           PDL_LDouble ky = ((PDL_LDouble) __privtrans->ind_sizes[3]) / __privtrans->ind_sizes[1];
1312 0 0         PDL_BROADCASTLOOP_START_rescale2d_readdata
    0          
    0          
    0          
    0          
    0          
    0          
1313 0           PDL_Indx lx = 0;
1314 0 0         {/* Open m */ PDL_EXPAND2(register PDL_Indx m=0, __m_stop=(__m_size)); for(; m<__m_stop; m+=1) {
1315 0           PDL_Indx ly = 0, cx = rint((m+1)*kx);
1316 0 0         {/* Open n */ PDL_EXPAND2(register PDL_Indx n=0, __n_stop=(__n_size)); for(; n<__n_stop; n+=1) {
1317 0           PDL_Indx cy = rint((n+1)*ky);
1318 0 0         {/* Open p=lx:cx */ PDL_EXPAND2(register PDL_Indx p=PDLMAX((lx),0), __p_stop=PDLMIN(cx, (__p_size))); for(; p<__p_stop; p+=1) {{/* Open q=ly:cy */ PDL_EXPAND2(register PDL_Indx q=PDLMAX((ly),0), __q_stop=PDLMIN(cy, (__q_size))); for(; q<__q_stop; q+=1) {
    0          
1319 0           (O_datap)[0+(__inc_O_p*(p))+(__inc_O_q*(q))] += (Int_datap)[0+(__inc_Int_m*(m))+(__inc_Int_n*(n))];
1320             }} /* Close p=lx:cx */}} /* Close q=ly:cy */
1321 0           ly = cy + 1;
1322             }} /* Close n */
1323 0           lx = cx + 1;
1324             }} /* Close m */
1325 0 0         PDL_BROADCASTLOOP_END_rescale2d_readdata
    0          
1326             }
1327 0 0         else if(__privtrans->ind_sizes[2] < __privtrans->ind_sizes[0] && __privtrans->ind_sizes[3] < __privtrans->ind_sizes[1]) {
    0          
1328 0           PDL_LDouble kx = ((PDL_LDouble) __privtrans->ind_sizes[0]) / __privtrans->ind_sizes[2];
1329 0           PDL_LDouble ky = ((PDL_LDouble) __privtrans->ind_sizes[1]) / __privtrans->ind_sizes[3];
1330 0 0         PDL_BROADCASTLOOP_START_rescale2d_readdata
    0          
    0          
    0          
    0          
    0          
    0          
1331 0           PDL_Indx lx = 0;
1332 0 0         {/* Open p */ PDL_EXPAND2(register PDL_Indx p=0, __p_stop=(__p_size)); for(; p<__p_stop; p+=1) {
1333 0           PDL_Indx ly = 0, cx = rint((p+1)*kx);
1334 0 0         {/* Open q */ PDL_EXPAND2(register PDL_Indx q=0, __q_stop=(__q_size)); for(; q<__q_stop; q+=1) {
1335 0           PDL_Indx cy = rint((q+1)*ky);
1336 0           PDL_LDouble temp = 0.0;
1337 0           PDL_Indx num = 0;
1338 0 0         {/* Open m=lx:cx */ PDL_EXPAND2(register PDL_Indx m=PDLMAX((lx),0), __m_stop=PDLMIN(cx, (__m_size))); for(; m<__m_stop; m+=1) {{/* Open n=ly:cy */ PDL_EXPAND2(register PDL_Indx n=PDLMAX((ly),0), __n_stop=PDLMIN(cy, (__n_size))); for(; n<__n_stop; n+=1) {
    0          
1339 0           temp += (Int_datap)[0+(__inc_Int_m*(m))+(__inc_Int_n*(n))];
1340 0           num++;
1341             }} /* Close m=lx:cx */}} /* Close n=ly:cy */
1342 0           (O_datap)[0+(__inc_O_p*(p))+(__inc_O_q*(q))] += temp/num;
1343 0           ly = cy + 1;
1344             }} /* Close q */
1345 0           lx = cx + 1;
1346             }} /* Close p */
1347 0 0         PDL_BROADCASTLOOP_END_rescale2d_readdata
    0          
1348             }
1349 0 0         else if(__privtrans->ind_sizes[2] >= __privtrans->ind_sizes[0] && __privtrans->ind_sizes[3] < __privtrans->ind_sizes[1]) {
    0          
1350 0           PDL_LDouble kx = ((PDL_LDouble) __privtrans->ind_sizes[2]) / __privtrans->ind_sizes[0];
1351 0           PDL_LDouble ky = ((PDL_LDouble) __privtrans->ind_sizes[1]) / __privtrans->ind_sizes[3];
1352 0 0         PDL_BROADCASTLOOP_START_rescale2d_readdata
    0          
    0          
    0          
    0          
    0          
    0          
1353 0           PDL_Indx lx = 0;
1354 0 0         {/* Open m */ PDL_EXPAND2(register PDL_Indx m=0, __m_stop=(__m_size)); for(; m<__m_stop; m+=1) {
1355 0           PDL_Indx ly = 0, cx = rint((m+1)*kx);
1356 0 0         {/* Open q */ PDL_EXPAND2(register PDL_Indx q=0, __q_stop=(__q_size)); for(; q<__q_stop; q+=1) {
1357 0           PDL_Indx cy = rint((q+1)*ky);
1358 0           PDL_LDouble temp = 0.0;
1359 0           PDL_Indx num = 0;
1360 0 0         {/* Open n=ly:cy */ PDL_EXPAND2(register PDL_Indx n=PDLMAX((ly),0), __n_stop=PDLMIN(cy, (__n_size))); for(; n<__n_stop; n+=1) {
1361 0           temp += (Int_datap)[0+(__inc_Int_m*(m))+(__inc_Int_n*(n))];
1362 0           num++;
1363             }} /* Close n=ly:cy */
1364 0 0         {/* Open p=lx:cx */ PDL_EXPAND2(register PDL_Indx p=PDLMAX((lx),0), __p_stop=PDLMIN(cx, (__p_size))); for(; p<__p_stop; p+=1) {
1365 0           (O_datap)[0+(__inc_O_p*(p))+(__inc_O_q*(q))] += temp/num;
1366             }} /* Close p=lx:cx */
1367 0           ly = cy + 1;
1368             }} /* Close q */
1369 0           lx = cx + 1;
1370             }} /* Close m */
1371 0 0         PDL_BROADCASTLOOP_END_rescale2d_readdata
    0          
1372             }
1373 0 0         else if(__privtrans->ind_sizes[2] < __privtrans->ind_sizes[0] && __privtrans->ind_sizes[3] >= __privtrans->ind_sizes[1]) {
    0          
1374 0           PDL_LDouble kx = ((PDL_LDouble) __privtrans->ind_sizes[0]) / __privtrans->ind_sizes[2];
1375 0           PDL_LDouble ky = ((PDL_LDouble) __privtrans->ind_sizes[3]) / __privtrans->ind_sizes[1];
1376 0 0         PDL_BROADCASTLOOP_START_rescale2d_readdata
    0          
    0          
    0          
    0          
    0          
    0          
1377 0           PDL_Indx lx = 0;
1378 0 0         {/* Open p */ PDL_EXPAND2(register PDL_Indx p=0, __p_stop=(__p_size)); for(; p<__p_stop; p+=1) {
1379 0           PDL_Indx ly = 0, cx = rint((p+1)*kx);
1380 0 0         {/* Open n */ PDL_EXPAND2(register PDL_Indx n=0, __n_stop=(__n_size)); for(; n<__n_stop; n+=1) {
1381 0           PDL_Indx cy = rint((n+1)*ky);
1382 0           PDL_CLDouble temp = 0.0;
1383 0           PDL_Indx num = 0;
1384 0 0         {/* Open m=lx:cx */ PDL_EXPAND2(register PDL_Indx m=PDLMAX((lx),0), __m_stop=PDLMIN(cx, (__m_size))); for(; m<__m_stop; m+=1) {
1385 0           temp += (Int_datap)[0+(__inc_Int_m*(m))+(__inc_Int_n*(n))];
1386 0           num++;
1387             }} /* Close m=lx:cx */
1388 0 0         {/* Open q=ly:cy */ PDL_EXPAND2(register PDL_Indx q=PDLMAX((ly),0), __q_stop=PDLMIN(cy, (__q_size))); for(; q<__q_stop; q+=1) {
1389 0           (O_datap)[0+(__inc_O_p*(p))+(__inc_O_q*(q))] += temp/num;
1390             }} /* Close q=ly:cy */
1391 0           ly = cy + 1;
1392             }} /* Close n */
1393 0           lx = cx + 1;
1394             }} /* Close p */
1395 0 0         PDL_BROADCASTLOOP_END_rescale2d_readdata
    0          
1396             }
1397 0           else return PDL->make_error(PDL_EUSERERROR, "Error in rescale2d:" "I am not supposed to be here, please report the bug to ");
1398             }
1399 0           } break;
1400 0           case PDL_CLD: {
1401 0 0         PDL_DECLARE_PARAMS_rescale2d_1(PDL_CLDouble,H)
    0          
    0          
    0          
    0          
    0          
1402             {
1403 0 0         if(__privtrans->ind_sizes[2] >= __privtrans->ind_sizes[0] && __privtrans->ind_sizes[3] >= __privtrans->ind_sizes[1]) {
    0          
1404 0           PDL_LDouble kx = ((PDL_LDouble) __privtrans->ind_sizes[2]) / __privtrans->ind_sizes[0];
1405 0           PDL_LDouble ky = ((PDL_LDouble) __privtrans->ind_sizes[3]) / __privtrans->ind_sizes[1];
1406 0 0         PDL_BROADCASTLOOP_START_rescale2d_readdata
    0          
    0          
    0          
    0          
    0          
    0          
1407 0           PDL_Indx lx = 0;
1408 0 0         {/* Open m */ PDL_EXPAND2(register PDL_Indx m=0, __m_stop=(__m_size)); for(; m<__m_stop; m+=1) {
1409 0           PDL_Indx ly = 0, cx = rint((m+1)*kx);
1410 0 0         {/* Open n */ PDL_EXPAND2(register PDL_Indx n=0, __n_stop=(__n_size)); for(; n<__n_stop; n+=1) {
1411 0           PDL_Indx cy = rint((n+1)*ky);
1412 0 0         {/* Open p=lx:cx */ PDL_EXPAND2(register PDL_Indx p=PDLMAX((lx),0), __p_stop=PDLMIN(cx, (__p_size))); for(; p<__p_stop; p+=1) {{/* Open q=ly:cy */ PDL_EXPAND2(register PDL_Indx q=PDLMAX((ly),0), __q_stop=PDLMIN(cy, (__q_size))); for(; q<__q_stop; q+=1) {
    0          
1413 0           (O_datap)[0+(__inc_O_p*(p))+(__inc_O_q*(q))] += (Int_datap)[0+(__inc_Int_m*(m))+(__inc_Int_n*(n))];
1414             }} /* Close p=lx:cx */}} /* Close q=ly:cy */
1415 0           ly = cy + 1;
1416             }} /* Close n */
1417 0           lx = cx + 1;
1418             }} /* Close m */
1419 0 0         PDL_BROADCASTLOOP_END_rescale2d_readdata
    0          
1420             }
1421 0 0         else if(__privtrans->ind_sizes[2] < __privtrans->ind_sizes[0] && __privtrans->ind_sizes[3] < __privtrans->ind_sizes[1]) {
    0          
1422 0           PDL_LDouble kx = ((PDL_LDouble) __privtrans->ind_sizes[0]) / __privtrans->ind_sizes[2];
1423 0           PDL_LDouble ky = ((PDL_LDouble) __privtrans->ind_sizes[1]) / __privtrans->ind_sizes[3];
1424 0 0         PDL_BROADCASTLOOP_START_rescale2d_readdata
    0          
    0          
    0          
    0          
    0          
    0          
1425 0           PDL_Indx lx = 0;
1426 0 0         {/* Open p */ PDL_EXPAND2(register PDL_Indx p=0, __p_stop=(__p_size)); for(; p<__p_stop; p+=1) {
1427 0           PDL_Indx ly = 0, cx = rint((p+1)*kx);
1428 0 0         {/* Open q */ PDL_EXPAND2(register PDL_Indx q=0, __q_stop=(__q_size)); for(; q<__q_stop; q+=1) {
1429 0           PDL_Indx cy = rint((q+1)*ky);
1430 0           PDL_LDouble temp = 0.0;
1431 0           PDL_Indx num = 0;
1432 0 0         {/* Open m=lx:cx */ PDL_EXPAND2(register PDL_Indx m=PDLMAX((lx),0), __m_stop=PDLMIN(cx, (__m_size))); for(; m<__m_stop; m+=1) {{/* Open n=ly:cy */ PDL_EXPAND2(register PDL_Indx n=PDLMAX((ly),0), __n_stop=PDLMIN(cy, (__n_size))); for(; n<__n_stop; n+=1) {
    0          
1433 0           temp += (Int_datap)[0+(__inc_Int_m*(m))+(__inc_Int_n*(n))];
1434 0           num++;
1435             }} /* Close m=lx:cx */}} /* Close n=ly:cy */
1436 0           (O_datap)[0+(__inc_O_p*(p))+(__inc_O_q*(q))] += temp/num;
1437 0           ly = cy + 1;
1438             }} /* Close q */
1439 0           lx = cx + 1;
1440             }} /* Close p */
1441 0 0         PDL_BROADCASTLOOP_END_rescale2d_readdata
    0          
1442             }
1443 0 0         else if(__privtrans->ind_sizes[2] >= __privtrans->ind_sizes[0] && __privtrans->ind_sizes[3] < __privtrans->ind_sizes[1]) {
    0          
1444 0           PDL_LDouble kx = ((PDL_LDouble) __privtrans->ind_sizes[2]) / __privtrans->ind_sizes[0];
1445 0           PDL_LDouble ky = ((PDL_LDouble) __privtrans->ind_sizes[1]) / __privtrans->ind_sizes[3];
1446 0 0         PDL_BROADCASTLOOP_START_rescale2d_readdata
    0          
    0          
    0          
    0          
    0          
    0          
1447 0           PDL_Indx lx = 0;
1448 0 0         {/* Open m */ PDL_EXPAND2(register PDL_Indx m=0, __m_stop=(__m_size)); for(; m<__m_stop; m+=1) {
1449 0           PDL_Indx ly = 0, cx = rint((m+1)*kx);
1450 0 0         {/* Open q */ PDL_EXPAND2(register PDL_Indx q=0, __q_stop=(__q_size)); for(; q<__q_stop; q+=1) {
1451 0           PDL_Indx cy = rint((q+1)*ky);
1452 0           PDL_LDouble temp = 0.0;
1453 0           PDL_Indx num = 0;
1454 0 0         {/* Open n=ly:cy */ PDL_EXPAND2(register PDL_Indx n=PDLMAX((ly),0), __n_stop=PDLMIN(cy, (__n_size))); for(; n<__n_stop; n+=1) {
1455 0           temp += (Int_datap)[0+(__inc_Int_m*(m))+(__inc_Int_n*(n))];
1456 0           num++;
1457             }} /* Close n=ly:cy */
1458 0 0         {/* Open p=lx:cx */ PDL_EXPAND2(register PDL_Indx p=PDLMAX((lx),0), __p_stop=PDLMIN(cx, (__p_size))); for(; p<__p_stop; p+=1) {
1459 0           (O_datap)[0+(__inc_O_p*(p))+(__inc_O_q*(q))] += temp/num;
1460             }} /* Close p=lx:cx */
1461 0           ly = cy + 1;
1462             }} /* Close q */
1463 0           lx = cx + 1;
1464             }} /* Close m */
1465 0 0         PDL_BROADCASTLOOP_END_rescale2d_readdata
    0          
1466             }
1467 0 0         else if(__privtrans->ind_sizes[2] < __privtrans->ind_sizes[0] && __privtrans->ind_sizes[3] >= __privtrans->ind_sizes[1]) {
    0          
1468 0           PDL_LDouble kx = ((PDL_LDouble) __privtrans->ind_sizes[0]) / __privtrans->ind_sizes[2];
1469 0           PDL_LDouble ky = ((PDL_LDouble) __privtrans->ind_sizes[3]) / __privtrans->ind_sizes[1];
1470 0 0         PDL_BROADCASTLOOP_START_rescale2d_readdata
    0          
    0          
    0          
    0          
    0          
    0          
1471 0           PDL_Indx lx = 0;
1472 0 0         {/* Open p */ PDL_EXPAND2(register PDL_Indx p=0, __p_stop=(__p_size)); for(; p<__p_stop; p+=1) {
1473 0           PDL_Indx ly = 0, cx = rint((p+1)*kx);
1474 0 0         {/* Open n */ PDL_EXPAND2(register PDL_Indx n=0, __n_stop=(__n_size)); for(; n<__n_stop; n+=1) {
1475 0           PDL_Indx cy = rint((n+1)*ky);
1476 0           PDL_CLDouble temp = 0.0;
1477 0           PDL_Indx num = 0;
1478 0 0         {/* Open m=lx:cx */ PDL_EXPAND2(register PDL_Indx m=PDLMAX((lx),0), __m_stop=PDLMIN(cx, (__m_size))); for(; m<__m_stop; m+=1) {
1479 0           temp += (Int_datap)[0+(__inc_Int_m*(m))+(__inc_Int_n*(n))];
1480 0           num++;
1481             }} /* Close m=lx:cx */
1482 0 0         {/* Open q=ly:cy */ PDL_EXPAND2(register PDL_Indx q=PDLMAX((ly),0), __q_stop=PDLMIN(cy, (__q_size))); for(; q<__q_stop; q+=1) {
1483 0           (O_datap)[0+(__inc_O_p*(p))+(__inc_O_q*(q))] += temp/num;
1484             }} /* Close q=ly:cy */
1485 0           ly = cy + 1;
1486             }} /* Close n */
1487 0           lx = cx + 1;
1488             }} /* Close p */
1489 0 0         PDL_BROADCASTLOOP_END_rescale2d_readdata
    0          
1490             }
1491 0           else return PDL->make_error(PDL_EUSERERROR, "Error in rescale2d:" "I am not supposed to be here, please report the bug to ");
1492             }
1493 0           } break;
1494 0           default: return PDL->make_error(PDL_EUSERERROR, "PP INTERNAL ERROR in rescale2d: unhandled datatype(%d), only handles (ABSULKNPQFDEGCH)! PLEASE MAKE A BUG REPORT\n", __privtrans->__datatype);
1495             }
1496             #undef PDL_IF_BAD
1497 0           return PDL_err;
1498             }
1499              
1500             static pdl_datatypes pdl_rescale2d_vtable_gentypes[] = { PDL_SB, PDL_B, PDL_S, PDL_US, PDL_L, PDL_UL, PDL_IND, PDL_ULL, PDL_LL, PDL_F, PDL_D, PDL_LD, PDL_CF, PDL_CD, PDL_CLD, -1 };
1501             static PDL_Indx pdl_rescale2d_vtable_realdims[] = { 2, 2 };
1502             static char *pdl_rescale2d_vtable_parnames[] = { "Int","O" };
1503             static short pdl_rescale2d_vtable_parflags[] = {
1504             0,
1505             PDL_PARAM_ISWRITE
1506             };
1507             static pdl_datatypes pdl_rescale2d_vtable_partypes[] = { -1, -1 };
1508             static PDL_Indx pdl_rescale2d_vtable_realdims_starts[] = { 0, 2 };
1509             static PDL_Indx pdl_rescale2d_vtable_realdims_ind_ids[] = { 0, 1, 2, 3 };
1510             static char *pdl_rescale2d_vtable_indnames[] = { "m","n","p","q" };
1511             pdl_transvtable pdl_rescale2d_vtable = {
1512             PDL_TRANS_DO_BROADCAST|PDL_TRANS_BADIGNORE, 0, pdl_rescale2d_vtable_gentypes, 1, 2, NULL /*CORE21*/,
1513             pdl_rescale2d_vtable_realdims, pdl_rescale2d_vtable_parnames,
1514             pdl_rescale2d_vtable_parflags, pdl_rescale2d_vtable_partypes,
1515             pdl_rescale2d_vtable_realdims_starts, pdl_rescale2d_vtable_realdims_ind_ids, 4,
1516             4, pdl_rescale2d_vtable_indnames,
1517             NULL, pdl_rescale2d_readdata, NULL,
1518             NULL,
1519             0,"PDL::Image2D::rescale2d"
1520             };
1521              
1522              
1523 0           pdl_error pdl_run_rescale2d(pdl *Int,pdl *O) {
1524 0           pdl_error PDL_err = {0, NULL, 0};
1525 0 0         if (!PDL) return (pdl_error){PDL_EFATAL, "PDL core struct is NULL, can't continue",0};
1526 0           pdl_trans *__privtrans = PDL->create_trans(&pdl_rescale2d_vtable);
1527 0 0         if (!__privtrans) return PDL->make_error_simple(PDL_EFATAL, "Couldn't create trans");
1528 0           __privtrans->pdls[0] = Int;
1529 0           __privtrans->pdls[1] = O;
1530 0 0         PDL_RETERROR(PDL_err, PDL->type_coerce(__privtrans));
1531 0 0         PDL_RETERROR(PDL_err, PDL->make_trans_mutual(__privtrans));
1532 0           return PDL_err;
1533             }