File Coverage

lib/PDL/Primitive-pp-setdiffvec.c
Criterion Covered Total %
statement 69 285 24.2
branch 100 852 11.7
condition n/a
subroutine n/a
pod n/a
total 169 1137 14.8


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