File Coverage

lib/PDL/Slices-pp-rleseq.c
Criterion Covered Total %
statement 30 86 34.8
branch 25 442 5.6
condition n/a
subroutine n/a
pod n/a
total 55 528 10.4


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/Slices.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_Slices
21             extern Core* PDL; /* Structure hold core C functions */
22              
23             #line 1857 "lib/PDL/PP.pm"
24             pdl_error pdl_rleseq_readdata(pdl_trans *__privtrans) {
25             pdl_error PDL_err = {0, NULL, 0};
26             #line 27 "lib/PDL/Slices-pp-rleseq.c"
27 1           register PDL_Indx __N_size = __privtrans->ind_sizes[0];
28 1 50         if (!__privtrans->broadcast.incs) return PDL->make_error(PDL_EUSERERROR, "Error in rleseq:" "broadcast.incs NULL");
29             /* broadcastloop declarations */
30             int __brcloopval;
31             register PDL_Indx __tind0,__tind1; /* counters along dim */
32 1           register PDL_Indx __tnpdls = __privtrans->broadcast.npdls;
33             /* dims here are how many steps along those dims */
34 1           register PDL_Indx __tinc0_c = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,0,0);
35 1           register PDL_Indx __tinc0_a = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,1,0);
36 1           register PDL_Indx __tinc0_b = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,2,0);
37 1           register PDL_Indx __tinc1_c = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,0,1);
38 1           register PDL_Indx __tinc1_a = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,1,1);
39 1           register PDL_Indx __tinc1_b = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,2,1);
40             #define PDL_BROADCASTLOOP_START_rleseq_readdata PDL_BROADCASTLOOP_START( \
41             readdata, \
42             __privtrans->broadcast, \
43             __privtrans->vtable, \
44             c_datap += __offsp[0]; \
45             a_datap += __offsp[1]; \
46             b_datap += __offsp[2]; \
47             , \
48             ( ,c_datap += __tinc1_c - __tinc0_c * __tdims0 \
49             ,a_datap += __tinc1_a - __tinc0_a * __tdims0 \
50             ,b_datap += __tinc1_b - __tinc0_b * __tdims0 \
51             ), \
52             ( ,c_datap += __tinc0_c \
53             ,a_datap += __tinc0_a \
54             ,b_datap += __tinc0_b \
55             ) \
56             )
57             #define PDL_BROADCASTLOOP_END_rleseq_readdata PDL_BROADCASTLOOP_END( \
58             __privtrans->broadcast, \
59             c_datap -= __tinc1_c * __tdims1 + __offsp[0]; \
60             a_datap -= __tinc1_a * __tdims1 + __offsp[1]; \
61             b_datap -= __tinc1_b * __tdims1 + __offsp[2]; \
62             )
63 1           register PDL_Indx __inc_a_N = __privtrans->inc_sizes[PDL_INC_ID(__privtrans->vtable,1,0)]; (void)__inc_a_N;
64 1           register PDL_Indx __inc_b_N = __privtrans->inc_sizes[PDL_INC_ID(__privtrans->vtable,2,0)]; (void)__inc_b_N;
65 1           register PDL_Indx __inc_c_N = __privtrans->inc_sizes[PDL_INC_ID(__privtrans->vtable,0,0)]; (void)__inc_c_N;
66             #ifndef PDL_DECLARE_PARAMS_rleseq_1
67             #define PDL_DECLARE_PARAMS_rleseq_1(PDL_TYPE_OP,PDL_PPSYM_OP,PDL_TYPE_PARAM_a,PDL_PPSYM_PARAM_a) \
68             PDL_DECLARE_PARAMETER(PDL_TYPE_OP, c, (__privtrans->pdls[0]), 1, PDL_PPSYM_OP) \
69             PDL_DECLARE_PARAMETER(PDL_TYPE_PARAM_a, a, (__privtrans->pdls[1]), 1, PDL_PPSYM_PARAM_a) \
70             PDL_DECLARE_PARAMETER(PDL_TYPE_OP, b, (__privtrans->pdls[2]), 1, PDL_PPSYM_OP)
71             #endif
72             #define PDL_IF_BAD(t,f) f
73 1           switch (__privtrans->__datatype) { /* Start generic switch */
74 0           case PDL_SB: {
75 0 0         PDL_DECLARE_PARAMS_rleseq_1(PDL_SByte,A,PDL_Indx,N)
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
76 0 0         PDL_BROADCASTLOOP_START_rleseq_readdata {
    0          
    0          
    0          
    0          
    0          
    0          
77             #line 1224 "lib/PDL/Slices.pd"
78             PDL_Indx j=0;
79             PDL_SByte coff;
80             coff = (c_datap)[0+(__inc_c_N*(0))];
81             (b_datap)[0+(__inc_b_N*(0))] = coff;
82             (a_datap)[0+(__inc_a_N*(0))] = 0;
83             {/* Open N */ PDL_EXPAND2(register PDL_Indx N=0, __N_stop=(__N_size)); for(; N<__N_stop; N+=1) {
84             #line 1230 "lib/PDL/Slices.pd"
85             if ((c_datap)[0+(__inc_c_N*(N))] == coff+(a_datap)[0+(__inc_a_N*(j))]) {
86             (a_datap)[0+(__inc_a_N*(j))]++;
87             } else {
88             j++;
89             (b_datap)[0+(__inc_b_N*(j))] = coff = (c_datap)[0+(__inc_c_N*(N))];
90             (a_datap)[0+(__inc_a_N*(j))] = 1;
91             }
92             }} /* Close N */
93             #line 1238 "lib/PDL/Slices.pd"
94             {/* Open N=j+1 */ PDL_EXPAND2(register PDL_Indx N=PDLMAX((j+1),0), __N_stop=(__N_size)); for(; N<__N_stop; N+=1) {
95             #line 1239 "lib/PDL/Slices.pd"
96             (a_datap)[0+(__inc_a_N*(N))] = 0;
97             (b_datap)[0+(__inc_b_N*(N))] = 0;
98             }} /* Close N=j+1 */
99             #line 100 "lib/PDL/Slices-pp-rleseq.c"
100 0 0         }PDL_BROADCASTLOOP_END_rleseq_readdata
    0          
101 0           } break;
102 0           case PDL_B: {
103 0 0         PDL_DECLARE_PARAMS_rleseq_1(PDL_Byte,B,PDL_Indx,N)
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
104 0 0         PDL_BROADCASTLOOP_START_rleseq_readdata {
    0          
    0          
    0          
    0          
    0          
    0          
105             #line 1224 "lib/PDL/Slices.pd"
106             PDL_Indx j=0;
107             PDL_Byte coff;
108             coff = (c_datap)[0+(__inc_c_N*(0))];
109             (b_datap)[0+(__inc_b_N*(0))] = coff;
110             (a_datap)[0+(__inc_a_N*(0))] = 0;
111             {/* Open N */ PDL_EXPAND2(register PDL_Indx N=0, __N_stop=(__N_size)); for(; N<__N_stop; N+=1) {
112             #line 1230 "lib/PDL/Slices.pd"
113             if ((c_datap)[0+(__inc_c_N*(N))] == coff+(a_datap)[0+(__inc_a_N*(j))]) {
114             (a_datap)[0+(__inc_a_N*(j))]++;
115             } else {
116             j++;
117             (b_datap)[0+(__inc_b_N*(j))] = coff = (c_datap)[0+(__inc_c_N*(N))];
118             (a_datap)[0+(__inc_a_N*(j))] = 1;
119             }
120             }} /* Close N */
121             #line 1238 "lib/PDL/Slices.pd"
122             {/* Open N=j+1 */ PDL_EXPAND2(register PDL_Indx N=PDLMAX((j+1),0), __N_stop=(__N_size)); for(; N<__N_stop; N+=1) {
123             #line 1239 "lib/PDL/Slices.pd"
124             (a_datap)[0+(__inc_a_N*(N))] = 0;
125             (b_datap)[0+(__inc_b_N*(N))] = 0;
126             }} /* Close N=j+1 */
127             #line 128 "lib/PDL/Slices-pp-rleseq.c"
128 0 0         }PDL_BROADCASTLOOP_END_rleseq_readdata
    0          
129 0           } break;
130 1           case PDL_S: {
131 1 50         PDL_DECLARE_PARAMS_rleseq_1(PDL_Short,S,PDL_Indx,N)
    50          
    50          
    50          
    50          
    50          
    50          
    50          
    50          
132 4 50         PDL_BROADCASTLOOP_START_rleseq_readdata {
    50          
    50          
    50          
    50          
    100          
    100          
133             #line 1224 "lib/PDL/Slices.pd"
134             PDL_Indx j=0;
135             PDL_Short coff;
136             coff = (c_datap)[0+(__inc_c_N*(0))];
137             (b_datap)[0+(__inc_b_N*(0))] = coff;
138             (a_datap)[0+(__inc_a_N*(0))] = 0;
139             {/* Open N */ PDL_EXPAND2(register PDL_Indx N=0, __N_stop=(__N_size)); for(; N<__N_stop; N+=1) {
140             #line 1230 "lib/PDL/Slices.pd"
141             if ((c_datap)[0+(__inc_c_N*(N))] == coff+(a_datap)[0+(__inc_a_N*(j))]) {
142             (a_datap)[0+(__inc_a_N*(j))]++;
143             } else {
144             j++;
145             (b_datap)[0+(__inc_b_N*(j))] = coff = (c_datap)[0+(__inc_c_N*(N))];
146             (a_datap)[0+(__inc_a_N*(j))] = 1;
147             }
148             }} /* Close N */
149             #line 1238 "lib/PDL/Slices.pd"
150             {/* Open N=j+1 */ PDL_EXPAND2(register PDL_Indx N=PDLMAX((j+1),0), __N_stop=(__N_size)); for(; N<__N_stop; N+=1) {
151             #line 1239 "lib/PDL/Slices.pd"
152             (a_datap)[0+(__inc_a_N*(N))] = 0;
153             (b_datap)[0+(__inc_b_N*(N))] = 0;
154             }} /* Close N=j+1 */
155             #line 156 "lib/PDL/Slices-pp-rleseq.c"
156 1 50         }PDL_BROADCASTLOOP_END_rleseq_readdata
    50          
157 1           } break;
158 0           case PDL_US: {
159 0 0         PDL_DECLARE_PARAMS_rleseq_1(PDL_Ushort,U,PDL_Indx,N)
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
160 0 0         PDL_BROADCASTLOOP_START_rleseq_readdata {
    0          
    0          
    0          
    0          
    0          
    0          
161             #line 1224 "lib/PDL/Slices.pd"
162             PDL_Indx j=0;
163             PDL_Ushort coff;
164             coff = (c_datap)[0+(__inc_c_N*(0))];
165             (b_datap)[0+(__inc_b_N*(0))] = coff;
166             (a_datap)[0+(__inc_a_N*(0))] = 0;
167             {/* Open N */ PDL_EXPAND2(register PDL_Indx N=0, __N_stop=(__N_size)); for(; N<__N_stop; N+=1) {
168             #line 1230 "lib/PDL/Slices.pd"
169             if ((c_datap)[0+(__inc_c_N*(N))] == coff+(a_datap)[0+(__inc_a_N*(j))]) {
170             (a_datap)[0+(__inc_a_N*(j))]++;
171             } else {
172             j++;
173             (b_datap)[0+(__inc_b_N*(j))] = coff = (c_datap)[0+(__inc_c_N*(N))];
174             (a_datap)[0+(__inc_a_N*(j))] = 1;
175             }
176             }} /* Close N */
177             #line 1238 "lib/PDL/Slices.pd"
178             {/* Open N=j+1 */ PDL_EXPAND2(register PDL_Indx N=PDLMAX((j+1),0), __N_stop=(__N_size)); for(; N<__N_stop; N+=1) {
179             #line 1239 "lib/PDL/Slices.pd"
180             (a_datap)[0+(__inc_a_N*(N))] = 0;
181             (b_datap)[0+(__inc_b_N*(N))] = 0;
182             }} /* Close N=j+1 */
183             #line 184 "lib/PDL/Slices-pp-rleseq.c"
184 0 0         }PDL_BROADCASTLOOP_END_rleseq_readdata
    0          
185 0           } break;
186 0           case PDL_L: {
187 0 0         PDL_DECLARE_PARAMS_rleseq_1(PDL_Long,L,PDL_Indx,N)
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
188 0 0         PDL_BROADCASTLOOP_START_rleseq_readdata {
    0          
    0          
    0          
    0          
    0          
    0          
189             #line 1224 "lib/PDL/Slices.pd"
190             PDL_Indx j=0;
191             PDL_Long coff;
192             coff = (c_datap)[0+(__inc_c_N*(0))];
193             (b_datap)[0+(__inc_b_N*(0))] = coff;
194             (a_datap)[0+(__inc_a_N*(0))] = 0;
195             {/* Open N */ PDL_EXPAND2(register PDL_Indx N=0, __N_stop=(__N_size)); for(; N<__N_stop; N+=1) {
196             #line 1230 "lib/PDL/Slices.pd"
197             if ((c_datap)[0+(__inc_c_N*(N))] == coff+(a_datap)[0+(__inc_a_N*(j))]) {
198             (a_datap)[0+(__inc_a_N*(j))]++;
199             } else {
200             j++;
201             (b_datap)[0+(__inc_b_N*(j))] = coff = (c_datap)[0+(__inc_c_N*(N))];
202             (a_datap)[0+(__inc_a_N*(j))] = 1;
203             }
204             }} /* Close N */
205             #line 1238 "lib/PDL/Slices.pd"
206             {/* Open N=j+1 */ PDL_EXPAND2(register PDL_Indx N=PDLMAX((j+1),0), __N_stop=(__N_size)); for(; N<__N_stop; N+=1) {
207             #line 1239 "lib/PDL/Slices.pd"
208             (a_datap)[0+(__inc_a_N*(N))] = 0;
209             (b_datap)[0+(__inc_b_N*(N))] = 0;
210             }} /* Close N=j+1 */
211             #line 212 "lib/PDL/Slices-pp-rleseq.c"
212 0 0         }PDL_BROADCASTLOOP_END_rleseq_readdata
    0          
213 0           } break;
214 0           case PDL_UL: {
215 0 0         PDL_DECLARE_PARAMS_rleseq_1(PDL_ULong,K,PDL_Indx,N)
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
216 0 0         PDL_BROADCASTLOOP_START_rleseq_readdata {
    0          
    0          
    0          
    0          
    0          
    0          
217             #line 1224 "lib/PDL/Slices.pd"
218             PDL_Indx j=0;
219             PDL_ULong coff;
220             coff = (c_datap)[0+(__inc_c_N*(0))];
221             (b_datap)[0+(__inc_b_N*(0))] = coff;
222             (a_datap)[0+(__inc_a_N*(0))] = 0;
223             {/* Open N */ PDL_EXPAND2(register PDL_Indx N=0, __N_stop=(__N_size)); for(; N<__N_stop; N+=1) {
224             #line 1230 "lib/PDL/Slices.pd"
225             if ((c_datap)[0+(__inc_c_N*(N))] == coff+(a_datap)[0+(__inc_a_N*(j))]) {
226             (a_datap)[0+(__inc_a_N*(j))]++;
227             } else {
228             j++;
229             (b_datap)[0+(__inc_b_N*(j))] = coff = (c_datap)[0+(__inc_c_N*(N))];
230             (a_datap)[0+(__inc_a_N*(j))] = 1;
231             }
232             }} /* Close N */
233             #line 1238 "lib/PDL/Slices.pd"
234             {/* Open N=j+1 */ PDL_EXPAND2(register PDL_Indx N=PDLMAX((j+1),0), __N_stop=(__N_size)); for(; N<__N_stop; N+=1) {
235             #line 1239 "lib/PDL/Slices.pd"
236             (a_datap)[0+(__inc_a_N*(N))] = 0;
237             (b_datap)[0+(__inc_b_N*(N))] = 0;
238             }} /* Close N=j+1 */
239             #line 240 "lib/PDL/Slices-pp-rleseq.c"
240 0 0         }PDL_BROADCASTLOOP_END_rleseq_readdata
    0          
241 0           } break;
242 0           case PDL_IND: {
243 0 0         PDL_DECLARE_PARAMS_rleseq_1(PDL_Indx,N,PDL_Indx,N)
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
244 0 0         PDL_BROADCASTLOOP_START_rleseq_readdata {
    0          
    0          
    0          
    0          
    0          
    0          
245             #line 1224 "lib/PDL/Slices.pd"
246             PDL_Indx j=0;
247             PDL_Indx coff;
248             coff = (c_datap)[0+(__inc_c_N*(0))];
249             (b_datap)[0+(__inc_b_N*(0))] = coff;
250             (a_datap)[0+(__inc_a_N*(0))] = 0;
251             {/* Open N */ PDL_EXPAND2(register PDL_Indx N=0, __N_stop=(__N_size)); for(; N<__N_stop; N+=1) {
252             #line 1230 "lib/PDL/Slices.pd"
253             if ((c_datap)[0+(__inc_c_N*(N))] == coff+(a_datap)[0+(__inc_a_N*(j))]) {
254             (a_datap)[0+(__inc_a_N*(j))]++;
255             } else {
256             j++;
257             (b_datap)[0+(__inc_b_N*(j))] = coff = (c_datap)[0+(__inc_c_N*(N))];
258             (a_datap)[0+(__inc_a_N*(j))] = 1;
259             }
260             }} /* Close N */
261             #line 1238 "lib/PDL/Slices.pd"
262             {/* Open N=j+1 */ PDL_EXPAND2(register PDL_Indx N=PDLMAX((j+1),0), __N_stop=(__N_size)); for(; N<__N_stop; N+=1) {
263             #line 1239 "lib/PDL/Slices.pd"
264             (a_datap)[0+(__inc_a_N*(N))] = 0;
265             (b_datap)[0+(__inc_b_N*(N))] = 0;
266             }} /* Close N=j+1 */
267             #line 268 "lib/PDL/Slices-pp-rleseq.c"
268 0 0         }PDL_BROADCASTLOOP_END_rleseq_readdata
    0          
269 0           } break;
270 0           case PDL_ULL: {
271 0 0         PDL_DECLARE_PARAMS_rleseq_1(PDL_ULongLong,P,PDL_Indx,N)
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
272 0 0         PDL_BROADCASTLOOP_START_rleseq_readdata {
    0          
    0          
    0          
    0          
    0          
    0          
273             #line 1224 "lib/PDL/Slices.pd"
274             PDL_Indx j=0;
275             PDL_ULongLong coff;
276             coff = (c_datap)[0+(__inc_c_N*(0))];
277             (b_datap)[0+(__inc_b_N*(0))] = coff;
278             (a_datap)[0+(__inc_a_N*(0))] = 0;
279             {/* Open N */ PDL_EXPAND2(register PDL_Indx N=0, __N_stop=(__N_size)); for(; N<__N_stop; N+=1) {
280             #line 1230 "lib/PDL/Slices.pd"
281             if ((c_datap)[0+(__inc_c_N*(N))] == coff+(a_datap)[0+(__inc_a_N*(j))]) {
282             (a_datap)[0+(__inc_a_N*(j))]++;
283             } else {
284             j++;
285             (b_datap)[0+(__inc_b_N*(j))] = coff = (c_datap)[0+(__inc_c_N*(N))];
286             (a_datap)[0+(__inc_a_N*(j))] = 1;
287             }
288             }} /* Close N */
289             #line 1238 "lib/PDL/Slices.pd"
290             {/* Open N=j+1 */ PDL_EXPAND2(register PDL_Indx N=PDLMAX((j+1),0), __N_stop=(__N_size)); for(; N<__N_stop; N+=1) {
291             #line 1239 "lib/PDL/Slices.pd"
292             (a_datap)[0+(__inc_a_N*(N))] = 0;
293             (b_datap)[0+(__inc_b_N*(N))] = 0;
294             }} /* Close N=j+1 */
295             #line 296 "lib/PDL/Slices-pp-rleseq.c"
296 0 0         }PDL_BROADCASTLOOP_END_rleseq_readdata
    0          
297 0           } break;
298 0           case PDL_LL: {
299 0 0         PDL_DECLARE_PARAMS_rleseq_1(PDL_LongLong,Q,PDL_Indx,N)
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
300 0 0         PDL_BROADCASTLOOP_START_rleseq_readdata {
    0          
    0          
    0          
    0          
    0          
    0          
301             #line 1224 "lib/PDL/Slices.pd"
302             PDL_Indx j=0;
303             PDL_LongLong coff;
304             coff = (c_datap)[0+(__inc_c_N*(0))];
305             (b_datap)[0+(__inc_b_N*(0))] = coff;
306             (a_datap)[0+(__inc_a_N*(0))] = 0;
307             {/* Open N */ PDL_EXPAND2(register PDL_Indx N=0, __N_stop=(__N_size)); for(; N<__N_stop; N+=1) {
308             #line 1230 "lib/PDL/Slices.pd"
309             if ((c_datap)[0+(__inc_c_N*(N))] == coff+(a_datap)[0+(__inc_a_N*(j))]) {
310             (a_datap)[0+(__inc_a_N*(j))]++;
311             } else {
312             j++;
313             (b_datap)[0+(__inc_b_N*(j))] = coff = (c_datap)[0+(__inc_c_N*(N))];
314             (a_datap)[0+(__inc_a_N*(j))] = 1;
315             }
316             }} /* Close N */
317             #line 1238 "lib/PDL/Slices.pd"
318             {/* Open N=j+1 */ PDL_EXPAND2(register PDL_Indx N=PDLMAX((j+1),0), __N_stop=(__N_size)); for(; N<__N_stop; N+=1) {
319             #line 1239 "lib/PDL/Slices.pd"
320             (a_datap)[0+(__inc_a_N*(N))] = 0;
321             (b_datap)[0+(__inc_b_N*(N))] = 0;
322             }} /* Close N=j+1 */
323             #line 324 "lib/PDL/Slices-pp-rleseq.c"
324 0 0         }PDL_BROADCASTLOOP_END_rleseq_readdata
    0          
325 0           } break;
326 0           case PDL_F: {
327 0 0         PDL_DECLARE_PARAMS_rleseq_1(PDL_Float,F,PDL_Indx,N)
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
328 0 0         PDL_BROADCASTLOOP_START_rleseq_readdata {
    0          
    0          
    0          
    0          
    0          
    0          
329             #line 1224 "lib/PDL/Slices.pd"
330             PDL_Indx j=0;
331             PDL_Float coff;
332             coff = (c_datap)[0+(__inc_c_N*(0))];
333             (b_datap)[0+(__inc_b_N*(0))] = coff;
334             (a_datap)[0+(__inc_a_N*(0))] = 0;
335             {/* Open N */ PDL_EXPAND2(register PDL_Indx N=0, __N_stop=(__N_size)); for(; N<__N_stop; N+=1) {
336             #line 1230 "lib/PDL/Slices.pd"
337             if ((c_datap)[0+(__inc_c_N*(N))] == coff+(a_datap)[0+(__inc_a_N*(j))]) {
338             (a_datap)[0+(__inc_a_N*(j))]++;
339             } else {
340             j++;
341             (b_datap)[0+(__inc_b_N*(j))] = coff = (c_datap)[0+(__inc_c_N*(N))];
342             (a_datap)[0+(__inc_a_N*(j))] = 1;
343             }
344             }} /* Close N */
345             #line 1238 "lib/PDL/Slices.pd"
346             {/* Open N=j+1 */ PDL_EXPAND2(register PDL_Indx N=PDLMAX((j+1),0), __N_stop=(__N_size)); for(; N<__N_stop; N+=1) {
347             #line 1239 "lib/PDL/Slices.pd"
348             (a_datap)[0+(__inc_a_N*(N))] = 0;
349             (b_datap)[0+(__inc_b_N*(N))] = 0;
350             }} /* Close N=j+1 */
351             #line 352 "lib/PDL/Slices-pp-rleseq.c"
352 0 0         }PDL_BROADCASTLOOP_END_rleseq_readdata
    0          
353 0           } break;
354 0           case PDL_D: {
355 0 0         PDL_DECLARE_PARAMS_rleseq_1(PDL_Double,D,PDL_Indx,N)
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
356 0 0         PDL_BROADCASTLOOP_START_rleseq_readdata {
    0          
    0          
    0          
    0          
    0          
    0          
357             #line 1224 "lib/PDL/Slices.pd"
358             PDL_Indx j=0;
359             PDL_Double coff;
360             coff = (c_datap)[0+(__inc_c_N*(0))];
361             (b_datap)[0+(__inc_b_N*(0))] = coff;
362             (a_datap)[0+(__inc_a_N*(0))] = 0;
363             {/* Open N */ PDL_EXPAND2(register PDL_Indx N=0, __N_stop=(__N_size)); for(; N<__N_stop; N+=1) {
364             #line 1230 "lib/PDL/Slices.pd"
365             if ((c_datap)[0+(__inc_c_N*(N))] == coff+(a_datap)[0+(__inc_a_N*(j))]) {
366             (a_datap)[0+(__inc_a_N*(j))]++;
367             } else {
368             j++;
369             (b_datap)[0+(__inc_b_N*(j))] = coff = (c_datap)[0+(__inc_c_N*(N))];
370             (a_datap)[0+(__inc_a_N*(j))] = 1;
371             }
372             }} /* Close N */
373             #line 1238 "lib/PDL/Slices.pd"
374             {/* Open N=j+1 */ PDL_EXPAND2(register PDL_Indx N=PDLMAX((j+1),0), __N_stop=(__N_size)); for(; N<__N_stop; N+=1) {
375             #line 1239 "lib/PDL/Slices.pd"
376             (a_datap)[0+(__inc_a_N*(N))] = 0;
377             (b_datap)[0+(__inc_b_N*(N))] = 0;
378             }} /* Close N=j+1 */
379             #line 380 "lib/PDL/Slices-pp-rleseq.c"
380 0 0         }PDL_BROADCASTLOOP_END_rleseq_readdata
    0          
381 0           } break;
382 0           case PDL_LD: {
383 0 0         PDL_DECLARE_PARAMS_rleseq_1(PDL_LDouble,E,PDL_Indx,N)
    0          
    0          
    0          
    0          
    0          
    0          
    0          
    0          
384 0 0         PDL_BROADCASTLOOP_START_rleseq_readdata {
    0          
    0          
    0          
    0          
    0          
    0          
385             #line 1224 "lib/PDL/Slices.pd"
386             PDL_Indx j=0;
387             PDL_LDouble coff;
388             coff = (c_datap)[0+(__inc_c_N*(0))];
389             (b_datap)[0+(__inc_b_N*(0))] = coff;
390             (a_datap)[0+(__inc_a_N*(0))] = 0;
391             {/* Open N */ PDL_EXPAND2(register PDL_Indx N=0, __N_stop=(__N_size)); for(; N<__N_stop; N+=1) {
392             #line 1230 "lib/PDL/Slices.pd"
393             if ((c_datap)[0+(__inc_c_N*(N))] == coff+(a_datap)[0+(__inc_a_N*(j))]) {
394             (a_datap)[0+(__inc_a_N*(j))]++;
395             } else {
396             j++;
397             (b_datap)[0+(__inc_b_N*(j))] = coff = (c_datap)[0+(__inc_c_N*(N))];
398             (a_datap)[0+(__inc_a_N*(j))] = 1;
399             }
400             }} /* Close N */
401             #line 1238 "lib/PDL/Slices.pd"
402             {/* Open N=j+1 */ PDL_EXPAND2(register PDL_Indx N=PDLMAX((j+1),0), __N_stop=(__N_size)); for(; N<__N_stop; N+=1) {
403             #line 1239 "lib/PDL/Slices.pd"
404             (a_datap)[0+(__inc_a_N*(N))] = 0;
405             (b_datap)[0+(__inc_b_N*(N))] = 0;
406             }} /* Close N=j+1 */
407             #line 408 "lib/PDL/Slices-pp-rleseq.c"
408 0 0         }PDL_BROADCASTLOOP_END_rleseq_readdata
    0          
409 0           } break;
410 0           default: return PDL->make_error(PDL_EUSERERROR, "PP INTERNAL ERROR in rleseq: unhandled datatype(%d), only handles (ABSULKNPQFDE)! PLEASE MAKE A BUG REPORT\n", __privtrans->__datatype);
411             }
412             #undef PDL_IF_BAD
413 1           return PDL_err;
414             }
415              
416             static pdl_datatypes pdl_rleseq_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, -1 };
417             static PDL_Indx pdl_rleseq_vtable_realdims[] = { 1, 1, 1 };
418             static char *pdl_rleseq_vtable_parnames[] = { "c","a","b" };
419             static short pdl_rleseq_vtable_parflags[] = {
420             0,
421             PDL_PARAM_ISCREAT|PDL_PARAM_ISOUT|PDL_PARAM_ISTYPED|PDL_PARAM_ISWRITE,
422             PDL_PARAM_ISCREAT|PDL_PARAM_ISOUT|PDL_PARAM_ISWRITE
423             };
424             static pdl_datatypes pdl_rleseq_vtable_partypes[] = { -1, PDL_IND, -1 };
425             static PDL_Indx pdl_rleseq_vtable_realdims_starts[] = { 0, 1, 2 };
426             static PDL_Indx pdl_rleseq_vtable_realdims_ind_ids[] = { 0, 0, 0 };
427             static char *pdl_rleseq_vtable_indnames[] = { "N" };
428             pdl_transvtable pdl_rleseq_vtable = {
429             PDL_TRANS_DO_BROADCAST, 0, pdl_rleseq_vtable_gentypes, 1, 3, NULL /*CORE21*/,
430             pdl_rleseq_vtable_realdims, pdl_rleseq_vtable_parnames,
431             pdl_rleseq_vtable_parflags, pdl_rleseq_vtable_partypes,
432             pdl_rleseq_vtable_realdims_starts, pdl_rleseq_vtable_realdims_ind_ids, 3,
433             1, pdl_rleseq_vtable_indnames,
434             NULL, pdl_rleseq_readdata, NULL,
435             NULL,
436             0,"PDL::Slices::rleseq"
437             };
438              
439              
440 1           pdl_error pdl_run_rleseq(pdl *c,pdl *a,pdl *b) {
441 1           pdl_error PDL_err = {0, NULL, 0};
442 1 50         if (!PDL) return (pdl_error){PDL_EFATAL, "PDL core struct is NULL, can't continue",0};
443 1           pdl_trans *__privtrans = PDL->create_trans(&pdl_rleseq_vtable);
444 1 50         if (!__privtrans) return PDL->make_error_simple(PDL_EFATAL, "Couldn't create trans");
445 1           __privtrans->pdls[0] = c;
446 1           __privtrans->pdls[1] = a;
447 1           __privtrans->pdls[2] = b;
448 1 50         PDL_RETERROR(PDL_err, PDL->type_coerce(__privtrans));
449 1 50         PDL_RETERROR(PDL_err, PDL->make_trans_mutual(__privtrans));
450 1           return PDL_err;
451             }