| 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_indadd_readdata(pdl_trans *__privtrans) { |
|
25
|
|
|
|
|
|
|
pdl_error PDL_err = {0, NULL, 0}; |
|
26
|
|
|
|
|
|
|
#line 27 "lib/PDL/Primitive-pp-indadd.c" |
|
27
|
7
|
|
|
|
|
|
register PDL_Indx __n_size = __privtrans->ind_sizes[1]; |
|
28
|
7
|
50
|
|
|
|
|
if (!__privtrans->broadcast.incs) return PDL->make_error(PDL_EUSERERROR, "Error in indadd:" "broadcast.incs NULL"); |
|
29
|
|
|
|
|
|
|
/* broadcastloop declarations */ |
|
30
|
|
|
|
|
|
|
int __brcloopval; |
|
31
|
|
|
|
|
|
|
register PDL_Indx __tind0,__tind1; /* counters along dim */ |
|
32
|
7
|
|
|
|
|
|
register PDL_Indx __tnpdls = __privtrans->broadcast.npdls; |
|
33
|
|
|
|
|
|
|
/* dims here are how many steps along those dims */ |
|
34
|
7
|
|
|
|
|
|
register PDL_Indx __tinc0_input = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,0,0); |
|
35
|
7
|
|
|
|
|
|
register PDL_Indx __tinc0_ind = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,1,0); |
|
36
|
7
|
|
|
|
|
|
register PDL_Indx __tinc0_sum = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,2,0); |
|
37
|
7
|
|
|
|
|
|
register PDL_Indx __tinc1_input = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,0,1); |
|
38
|
7
|
|
|
|
|
|
register PDL_Indx __tinc1_ind = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,1,1); |
|
39
|
7
|
|
|
|
|
|
register PDL_Indx __tinc1_sum = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,2,1); |
|
40
|
|
|
|
|
|
|
#define PDL_BROADCASTLOOP_START_indadd_readdata PDL_BROADCASTLOOP_START( \ |
|
41
|
|
|
|
|
|
|
readdata, \ |
|
42
|
|
|
|
|
|
|
__privtrans->broadcast, \ |
|
43
|
|
|
|
|
|
|
__privtrans->vtable, \ |
|
44
|
|
|
|
|
|
|
input_datap += __offsp[0]; \ |
|
45
|
|
|
|
|
|
|
ind_datap += __offsp[1]; \ |
|
46
|
|
|
|
|
|
|
sum_datap += __offsp[2]; \ |
|
47
|
|
|
|
|
|
|
, \ |
|
48
|
|
|
|
|
|
|
( ,input_datap += __tinc1_input - __tinc0_input * __tdims0 \ |
|
49
|
|
|
|
|
|
|
,ind_datap += __tinc1_ind - __tinc0_ind * __tdims0 \ |
|
50
|
|
|
|
|
|
|
,sum_datap += __tinc1_sum - __tinc0_sum * __tdims0 \ |
|
51
|
|
|
|
|
|
|
), \ |
|
52
|
|
|
|
|
|
|
( ,input_datap += __tinc0_input \ |
|
53
|
|
|
|
|
|
|
,ind_datap += __tinc0_ind \ |
|
54
|
|
|
|
|
|
|
,sum_datap += __tinc0_sum \ |
|
55
|
|
|
|
|
|
|
) \ |
|
56
|
|
|
|
|
|
|
) |
|
57
|
|
|
|
|
|
|
#define PDL_BROADCASTLOOP_END_indadd_readdata PDL_BROADCASTLOOP_END( \ |
|
58
|
|
|
|
|
|
|
__privtrans->broadcast, \ |
|
59
|
|
|
|
|
|
|
input_datap -= __tinc1_input * __tdims1 + __offsp[0]; \ |
|
60
|
|
|
|
|
|
|
ind_datap -= __tinc1_ind * __tdims1 + __offsp[1]; \ |
|
61
|
|
|
|
|
|
|
sum_datap -= __tinc1_sum * __tdims1 + __offsp[2]; \ |
|
62
|
|
|
|
|
|
|
) |
|
63
|
7
|
|
|
|
|
|
register PDL_Indx __inc_ind_n = __privtrans->inc_sizes[PDL_INC_ID(__privtrans->vtable,1,0)]; (void)__inc_ind_n; |
|
64
|
7
|
|
|
|
|
|
register PDL_Indx __inc_input_n = __privtrans->inc_sizes[PDL_INC_ID(__privtrans->vtable,0,0)]; (void)__inc_input_n; |
|
65
|
7
|
|
|
|
|
|
register PDL_Indx __inc_sum_m = __privtrans->inc_sizes[PDL_INC_ID(__privtrans->vtable,2,0)]; (void)__inc_sum_m; |
|
66
|
|
|
|
|
|
|
#ifndef PDL_DECLARE_PARAMS_indadd_1 |
|
67
|
|
|
|
|
|
|
#define PDL_DECLARE_PARAMS_indadd_1(PDL_TYPE_OP,PDL_PPSYM_OP,PDL_TYPE_PARAM_ind,PDL_PPSYM_PARAM_ind) \ |
|
68
|
|
|
|
|
|
|
PDL_DECLARE_PARAMETER_BADVAL(PDL_TYPE_OP, input, (__privtrans->pdls[0]), 1, PDL_PPSYM_OP) \ |
|
69
|
|
|
|
|
|
|
PDL_DECLARE_PARAMETER_BADVAL(PDL_TYPE_PARAM_ind, ind, (__privtrans->pdls[1]), 1, PDL_PPSYM_PARAM_ind) \ |
|
70
|
|
|
|
|
|
|
PDL_DECLARE_PARAMETER_BADVAL(PDL_TYPE_OP, sum, (__privtrans->pdls[2]), 1, PDL_PPSYM_OP) |
|
71
|
|
|
|
|
|
|
#endif |
|
72
|
7
|
100
|
|
|
|
|
if ( __privtrans->bvalflag ) { /* ** do 'bad' Code ** */ |
|
73
|
|
|
|
|
|
|
#define PDL_BAD_CODE |
|
74
|
|
|
|
|
|
|
#define PDL_IF_BAD(t,f) t |
|
75
|
1
|
|
|
|
|
|
switch (__privtrans->__datatype) { /* Start generic switch */ |
|
76
|
0
|
|
|
|
|
|
case PDL_SB: { |
|
77
|
0
|
0
|
|
|
|
|
PDL_DECLARE_PARAMS_indadd_1(PDL_SByte,A,PDL_Indx,N) |
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
78
|
0
|
0
|
|
|
|
|
PDL_BROADCASTLOOP_START_indadd_readdata {{/* Open n */ PDL_EXPAND2(register PDL_Indx n=0, __n_stop=(__n_size)); for(; n<__n_stop; n+=1) { |
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
79
|
0
|
|
|
|
|
|
register PDL_Indx this_ind = (ind_datap)[0+(__inc_ind_n*(n))]; |
|
80
|
0
|
0
|
|
|
|
|
PDL_IF_BAD( |
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
if (PDL_ISBAD2(this_ind,ind_badval,N,ind_badval_isnan)) return PDL->make_error(PDL_EUSERERROR, "Error in indadd:" "bad index %"IND_FLAG,n); |
|
82
|
|
|
|
|
|
|
if (PDL_ISBAD2((input_datap)[0+(__inc_input_n*(n))],input_badval,A,input_badval_isnan)) { (sum_datap)[0+(__inc_sum_m*(this_ind))]=sum_badval; continue; },) |
|
83
|
0
|
0
|
|
|
|
|
if (this_ind<0 || this_ind>=__privtrans->ind_sizes[0]) |
|
|
|
0
|
|
|
|
|
|
|
84
|
0
|
|
|
|
|
|
return PDL->make_error(PDL_EUSERERROR, "Error in indadd:" "invalid index %"IND_FLAG"; range 0..%"IND_FLAG,this_ind,__privtrans->ind_sizes[0]); |
|
85
|
0
|
|
|
|
|
|
(sum_datap)[0+(__inc_sum_m*(this_ind))] += (input_datap)[0+(__inc_input_n*(n))]; |
|
86
|
|
|
|
|
|
|
}} /* Close n */ |
|
87
|
0
|
0
|
|
|
|
|
}PDL_BROADCASTLOOP_END_indadd_readdata |
|
|
|
0
|
|
|
|
|
|
|
88
|
0
|
|
|
|
|
|
} break; |
|
89
|
0
|
|
|
|
|
|
case PDL_B: { |
|
90
|
0
|
0
|
|
|
|
|
PDL_DECLARE_PARAMS_indadd_1(PDL_Byte,B,PDL_Indx,N) |
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
91
|
0
|
0
|
|
|
|
|
PDL_BROADCASTLOOP_START_indadd_readdata {{/* Open n */ PDL_EXPAND2(register PDL_Indx n=0, __n_stop=(__n_size)); for(; n<__n_stop; n+=1) { |
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
92
|
0
|
|
|
|
|
|
register PDL_Indx this_ind = (ind_datap)[0+(__inc_ind_n*(n))]; |
|
93
|
0
|
0
|
|
|
|
|
PDL_IF_BAD( |
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
if (PDL_ISBAD2(this_ind,ind_badval,N,ind_badval_isnan)) return PDL->make_error(PDL_EUSERERROR, "Error in indadd:" "bad index %"IND_FLAG,n); |
|
95
|
|
|
|
|
|
|
if (PDL_ISBAD2((input_datap)[0+(__inc_input_n*(n))],input_badval,B,input_badval_isnan)) { (sum_datap)[0+(__inc_sum_m*(this_ind))]=sum_badval; continue; },) |
|
96
|
0
|
0
|
|
|
|
|
if (this_ind<0 || this_ind>=__privtrans->ind_sizes[0]) |
|
|
|
0
|
|
|
|
|
|
|
97
|
0
|
|
|
|
|
|
return PDL->make_error(PDL_EUSERERROR, "Error in indadd:" "invalid index %"IND_FLAG"; range 0..%"IND_FLAG,this_ind,__privtrans->ind_sizes[0]); |
|
98
|
0
|
|
|
|
|
|
(sum_datap)[0+(__inc_sum_m*(this_ind))] += (input_datap)[0+(__inc_input_n*(n))]; |
|
99
|
|
|
|
|
|
|
}} /* Close n */ |
|
100
|
0
|
0
|
|
|
|
|
}PDL_BROADCASTLOOP_END_indadd_readdata |
|
|
|
0
|
|
|
|
|
|
|
101
|
0
|
|
|
|
|
|
} break; |
|
102
|
0
|
|
|
|
|
|
case PDL_S: { |
|
103
|
0
|
0
|
|
|
|
|
PDL_DECLARE_PARAMS_indadd_1(PDL_Short,S,PDL_Indx,N) |
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
104
|
0
|
0
|
|
|
|
|
PDL_BROADCASTLOOP_START_indadd_readdata {{/* Open n */ PDL_EXPAND2(register PDL_Indx n=0, __n_stop=(__n_size)); for(; n<__n_stop; n+=1) { |
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
105
|
0
|
|
|
|
|
|
register PDL_Indx this_ind = (ind_datap)[0+(__inc_ind_n*(n))]; |
|
106
|
0
|
0
|
|
|
|
|
PDL_IF_BAD( |
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
if (PDL_ISBAD2(this_ind,ind_badval,N,ind_badval_isnan)) return PDL->make_error(PDL_EUSERERROR, "Error in indadd:" "bad index %"IND_FLAG,n); |
|
108
|
|
|
|
|
|
|
if (PDL_ISBAD2((input_datap)[0+(__inc_input_n*(n))],input_badval,S,input_badval_isnan)) { (sum_datap)[0+(__inc_sum_m*(this_ind))]=sum_badval; continue; },) |
|
109
|
0
|
0
|
|
|
|
|
if (this_ind<0 || this_ind>=__privtrans->ind_sizes[0]) |
|
|
|
0
|
|
|
|
|
|
|
110
|
0
|
|
|
|
|
|
return PDL->make_error(PDL_EUSERERROR, "Error in indadd:" "invalid index %"IND_FLAG"; range 0..%"IND_FLAG,this_ind,__privtrans->ind_sizes[0]); |
|
111
|
0
|
|
|
|
|
|
(sum_datap)[0+(__inc_sum_m*(this_ind))] += (input_datap)[0+(__inc_input_n*(n))]; |
|
112
|
|
|
|
|
|
|
}} /* Close n */ |
|
113
|
0
|
0
|
|
|
|
|
}PDL_BROADCASTLOOP_END_indadd_readdata |
|
|
|
0
|
|
|
|
|
|
|
114
|
0
|
|
|
|
|
|
} break; |
|
115
|
0
|
|
|
|
|
|
case PDL_US: { |
|
116
|
0
|
0
|
|
|
|
|
PDL_DECLARE_PARAMS_indadd_1(PDL_Ushort,U,PDL_Indx,N) |
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
117
|
0
|
0
|
|
|
|
|
PDL_BROADCASTLOOP_START_indadd_readdata {{/* Open n */ PDL_EXPAND2(register PDL_Indx n=0, __n_stop=(__n_size)); for(; n<__n_stop; n+=1) { |
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
118
|
0
|
|
|
|
|
|
register PDL_Indx this_ind = (ind_datap)[0+(__inc_ind_n*(n))]; |
|
119
|
0
|
0
|
|
|
|
|
PDL_IF_BAD( |
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
if (PDL_ISBAD2(this_ind,ind_badval,N,ind_badval_isnan)) return PDL->make_error(PDL_EUSERERROR, "Error in indadd:" "bad index %"IND_FLAG,n); |
|
121
|
|
|
|
|
|
|
if (PDL_ISBAD2((input_datap)[0+(__inc_input_n*(n))],input_badval,U,input_badval_isnan)) { (sum_datap)[0+(__inc_sum_m*(this_ind))]=sum_badval; continue; },) |
|
122
|
0
|
0
|
|
|
|
|
if (this_ind<0 || this_ind>=__privtrans->ind_sizes[0]) |
|
|
|
0
|
|
|
|
|
|
|
123
|
0
|
|
|
|
|
|
return PDL->make_error(PDL_EUSERERROR, "Error in indadd:" "invalid index %"IND_FLAG"; range 0..%"IND_FLAG,this_ind,__privtrans->ind_sizes[0]); |
|
124
|
0
|
|
|
|
|
|
(sum_datap)[0+(__inc_sum_m*(this_ind))] += (input_datap)[0+(__inc_input_n*(n))]; |
|
125
|
|
|
|
|
|
|
}} /* Close n */ |
|
126
|
0
|
0
|
|
|
|
|
}PDL_BROADCASTLOOP_END_indadd_readdata |
|
|
|
0
|
|
|
|
|
|
|
127
|
0
|
|
|
|
|
|
} break; |
|
128
|
0
|
|
|
|
|
|
case PDL_L: { |
|
129
|
0
|
0
|
|
|
|
|
PDL_DECLARE_PARAMS_indadd_1(PDL_Long,L,PDL_Indx,N) |
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
130
|
0
|
0
|
|
|
|
|
PDL_BROADCASTLOOP_START_indadd_readdata {{/* Open n */ PDL_EXPAND2(register PDL_Indx n=0, __n_stop=(__n_size)); for(; n<__n_stop; n+=1) { |
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
131
|
0
|
|
|
|
|
|
register PDL_Indx this_ind = (ind_datap)[0+(__inc_ind_n*(n))]; |
|
132
|
0
|
0
|
|
|
|
|
PDL_IF_BAD( |
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
if (PDL_ISBAD2(this_ind,ind_badval,N,ind_badval_isnan)) return PDL->make_error(PDL_EUSERERROR, "Error in indadd:" "bad index %"IND_FLAG,n); |
|
134
|
|
|
|
|
|
|
if (PDL_ISBAD2((input_datap)[0+(__inc_input_n*(n))],input_badval,L,input_badval_isnan)) { (sum_datap)[0+(__inc_sum_m*(this_ind))]=sum_badval; continue; },) |
|
135
|
0
|
0
|
|
|
|
|
if (this_ind<0 || this_ind>=__privtrans->ind_sizes[0]) |
|
|
|
0
|
|
|
|
|
|
|
136
|
0
|
|
|
|
|
|
return PDL->make_error(PDL_EUSERERROR, "Error in indadd:" "invalid index %"IND_FLAG"; range 0..%"IND_FLAG,this_ind,__privtrans->ind_sizes[0]); |
|
137
|
0
|
|
|
|
|
|
(sum_datap)[0+(__inc_sum_m*(this_ind))] += (input_datap)[0+(__inc_input_n*(n))]; |
|
138
|
|
|
|
|
|
|
}} /* Close n */ |
|
139
|
0
|
0
|
|
|
|
|
}PDL_BROADCASTLOOP_END_indadd_readdata |
|
|
|
0
|
|
|
|
|
|
|
140
|
0
|
|
|
|
|
|
} break; |
|
141
|
0
|
|
|
|
|
|
case PDL_UL: { |
|
142
|
0
|
0
|
|
|
|
|
PDL_DECLARE_PARAMS_indadd_1(PDL_ULong,K,PDL_Indx,N) |
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
143
|
0
|
0
|
|
|
|
|
PDL_BROADCASTLOOP_START_indadd_readdata {{/* Open n */ PDL_EXPAND2(register PDL_Indx n=0, __n_stop=(__n_size)); for(; n<__n_stop; n+=1) { |
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
144
|
0
|
|
|
|
|
|
register PDL_Indx this_ind = (ind_datap)[0+(__inc_ind_n*(n))]; |
|
145
|
0
|
0
|
|
|
|
|
PDL_IF_BAD( |
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
if (PDL_ISBAD2(this_ind,ind_badval,N,ind_badval_isnan)) return PDL->make_error(PDL_EUSERERROR, "Error in indadd:" "bad index %"IND_FLAG,n); |
|
147
|
|
|
|
|
|
|
if (PDL_ISBAD2((input_datap)[0+(__inc_input_n*(n))],input_badval,K,input_badval_isnan)) { (sum_datap)[0+(__inc_sum_m*(this_ind))]=sum_badval; continue; },) |
|
148
|
0
|
0
|
|
|
|
|
if (this_ind<0 || this_ind>=__privtrans->ind_sizes[0]) |
|
|
|
0
|
|
|
|
|
|
|
149
|
0
|
|
|
|
|
|
return PDL->make_error(PDL_EUSERERROR, "Error in indadd:" "invalid index %"IND_FLAG"; range 0..%"IND_FLAG,this_ind,__privtrans->ind_sizes[0]); |
|
150
|
0
|
|
|
|
|
|
(sum_datap)[0+(__inc_sum_m*(this_ind))] += (input_datap)[0+(__inc_input_n*(n))]; |
|
151
|
|
|
|
|
|
|
}} /* Close n */ |
|
152
|
0
|
0
|
|
|
|
|
}PDL_BROADCASTLOOP_END_indadd_readdata |
|
|
|
0
|
|
|
|
|
|
|
153
|
0
|
|
|
|
|
|
} break; |
|
154
|
0
|
|
|
|
|
|
case PDL_IND: { |
|
155
|
0
|
0
|
|
|
|
|
PDL_DECLARE_PARAMS_indadd_1(PDL_Indx,N,PDL_Indx,N) |
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
156
|
0
|
0
|
|
|
|
|
PDL_BROADCASTLOOP_START_indadd_readdata {{/* Open n */ PDL_EXPAND2(register PDL_Indx n=0, __n_stop=(__n_size)); for(; n<__n_stop; n+=1) { |
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
157
|
0
|
|
|
|
|
|
register PDL_Indx this_ind = (ind_datap)[0+(__inc_ind_n*(n))]; |
|
158
|
0
|
0
|
|
|
|
|
PDL_IF_BAD( |
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
159
|
|
|
|
|
|
|
if (PDL_ISBAD2(this_ind,ind_badval,N,ind_badval_isnan)) return PDL->make_error(PDL_EUSERERROR, "Error in indadd:" "bad index %"IND_FLAG,n); |
|
160
|
|
|
|
|
|
|
if (PDL_ISBAD2((input_datap)[0+(__inc_input_n*(n))],input_badval,N,input_badval_isnan)) { (sum_datap)[0+(__inc_sum_m*(this_ind))]=sum_badval; continue; },) |
|
161
|
0
|
0
|
|
|
|
|
if (this_ind<0 || this_ind>=__privtrans->ind_sizes[0]) |
|
|
|
0
|
|
|
|
|
|
|
162
|
0
|
|
|
|
|
|
return PDL->make_error(PDL_EUSERERROR, "Error in indadd:" "invalid index %"IND_FLAG"; range 0..%"IND_FLAG,this_ind,__privtrans->ind_sizes[0]); |
|
163
|
0
|
|
|
|
|
|
(sum_datap)[0+(__inc_sum_m*(this_ind))] += (input_datap)[0+(__inc_input_n*(n))]; |
|
164
|
|
|
|
|
|
|
}} /* Close n */ |
|
165
|
0
|
0
|
|
|
|
|
}PDL_BROADCASTLOOP_END_indadd_readdata |
|
|
|
0
|
|
|
|
|
|
|
166
|
0
|
|
|
|
|
|
} break; |
|
167
|
0
|
|
|
|
|
|
case PDL_ULL: { |
|
168
|
0
|
0
|
|
|
|
|
PDL_DECLARE_PARAMS_indadd_1(PDL_ULongLong,P,PDL_Indx,N) |
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
169
|
0
|
0
|
|
|
|
|
PDL_BROADCASTLOOP_START_indadd_readdata {{/* Open n */ PDL_EXPAND2(register PDL_Indx n=0, __n_stop=(__n_size)); for(; n<__n_stop; n+=1) { |
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
170
|
0
|
|
|
|
|
|
register PDL_Indx this_ind = (ind_datap)[0+(__inc_ind_n*(n))]; |
|
171
|
0
|
0
|
|
|
|
|
PDL_IF_BAD( |
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
172
|
|
|
|
|
|
|
if (PDL_ISBAD2(this_ind,ind_badval,N,ind_badval_isnan)) return PDL->make_error(PDL_EUSERERROR, "Error in indadd:" "bad index %"IND_FLAG,n); |
|
173
|
|
|
|
|
|
|
if (PDL_ISBAD2((input_datap)[0+(__inc_input_n*(n))],input_badval,P,input_badval_isnan)) { (sum_datap)[0+(__inc_sum_m*(this_ind))]=sum_badval; continue; },) |
|
174
|
0
|
0
|
|
|
|
|
if (this_ind<0 || this_ind>=__privtrans->ind_sizes[0]) |
|
|
|
0
|
|
|
|
|
|
|
175
|
0
|
|
|
|
|
|
return PDL->make_error(PDL_EUSERERROR, "Error in indadd:" "invalid index %"IND_FLAG"; range 0..%"IND_FLAG,this_ind,__privtrans->ind_sizes[0]); |
|
176
|
0
|
|
|
|
|
|
(sum_datap)[0+(__inc_sum_m*(this_ind))] += (input_datap)[0+(__inc_input_n*(n))]; |
|
177
|
|
|
|
|
|
|
}} /* Close n */ |
|
178
|
0
|
0
|
|
|
|
|
}PDL_BROADCASTLOOP_END_indadd_readdata |
|
|
|
0
|
|
|
|
|
|
|
179
|
0
|
|
|
|
|
|
} break; |
|
180
|
0
|
|
|
|
|
|
case PDL_LL: { |
|
181
|
0
|
0
|
|
|
|
|
PDL_DECLARE_PARAMS_indadd_1(PDL_LongLong,Q,PDL_Indx,N) |
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
182
|
0
|
0
|
|
|
|
|
PDL_BROADCASTLOOP_START_indadd_readdata {{/* Open n */ PDL_EXPAND2(register PDL_Indx n=0, __n_stop=(__n_size)); for(; n<__n_stop; n+=1) { |
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
183
|
0
|
|
|
|
|
|
register PDL_Indx this_ind = (ind_datap)[0+(__inc_ind_n*(n))]; |
|
184
|
0
|
0
|
|
|
|
|
PDL_IF_BAD( |
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
185
|
|
|
|
|
|
|
if (PDL_ISBAD2(this_ind,ind_badval,N,ind_badval_isnan)) return PDL->make_error(PDL_EUSERERROR, "Error in indadd:" "bad index %"IND_FLAG,n); |
|
186
|
|
|
|
|
|
|
if (PDL_ISBAD2((input_datap)[0+(__inc_input_n*(n))],input_badval,Q,input_badval_isnan)) { (sum_datap)[0+(__inc_sum_m*(this_ind))]=sum_badval; continue; },) |
|
187
|
0
|
0
|
|
|
|
|
if (this_ind<0 || this_ind>=__privtrans->ind_sizes[0]) |
|
|
|
0
|
|
|
|
|
|
|
188
|
0
|
|
|
|
|
|
return PDL->make_error(PDL_EUSERERROR, "Error in indadd:" "invalid index %"IND_FLAG"; range 0..%"IND_FLAG,this_ind,__privtrans->ind_sizes[0]); |
|
189
|
0
|
|
|
|
|
|
(sum_datap)[0+(__inc_sum_m*(this_ind))] += (input_datap)[0+(__inc_input_n*(n))]; |
|
190
|
|
|
|
|
|
|
}} /* Close n */ |
|
191
|
0
|
0
|
|
|
|
|
}PDL_BROADCASTLOOP_END_indadd_readdata |
|
|
|
0
|
|
|
|
|
|
|
192
|
0
|
|
|
|
|
|
} break; |
|
193
|
0
|
|
|
|
|
|
case PDL_F: { |
|
194
|
0
|
0
|
|
|
|
|
PDL_DECLARE_PARAMS_indadd_1(PDL_Float,F,PDL_Indx,N) |
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
195
|
0
|
0
|
|
|
|
|
PDL_BROADCASTLOOP_START_indadd_readdata {{/* Open n */ PDL_EXPAND2(register PDL_Indx n=0, __n_stop=(__n_size)); for(; n<__n_stop; n+=1) { |
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
196
|
0
|
|
|
|
|
|
register PDL_Indx this_ind = (ind_datap)[0+(__inc_ind_n*(n))]; |
|
197
|
0
|
0
|
|
|
|
|
PDL_IF_BAD( |
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
198
|
|
|
|
|
|
|
if (PDL_ISBAD2(this_ind,ind_badval,N,ind_badval_isnan)) return PDL->make_error(PDL_EUSERERROR, "Error in indadd:" "bad index %"IND_FLAG,n); |
|
199
|
|
|
|
|
|
|
if (PDL_ISBAD2((input_datap)[0+(__inc_input_n*(n))],input_badval,F,input_badval_isnan)) { (sum_datap)[0+(__inc_sum_m*(this_ind))]=sum_badval; continue; },) |
|
200
|
0
|
0
|
|
|
|
|
if (this_ind<0 || this_ind>=__privtrans->ind_sizes[0]) |
|
|
|
0
|
|
|
|
|
|
|
201
|
0
|
|
|
|
|
|
return PDL->make_error(PDL_EUSERERROR, "Error in indadd:" "invalid index %"IND_FLAG"; range 0..%"IND_FLAG,this_ind,__privtrans->ind_sizes[0]); |
|
202
|
0
|
|
|
|
|
|
(sum_datap)[0+(__inc_sum_m*(this_ind))] += (input_datap)[0+(__inc_input_n*(n))]; |
|
203
|
|
|
|
|
|
|
}} /* Close n */ |
|
204
|
0
|
0
|
|
|
|
|
}PDL_BROADCASTLOOP_END_indadd_readdata |
|
|
|
0
|
|
|
|
|
|
|
205
|
0
|
|
|
|
|
|
} break; |
|
206
|
1
|
|
|
|
|
|
case PDL_D: { |
|
207
|
1
|
50
|
|
|
|
|
PDL_DECLARE_PARAMS_indadd_1(PDL_Double,D,PDL_Indx,N) |
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
208
|
2
|
50
|
|
|
|
|
PDL_BROADCASTLOOP_START_indadd_readdata {{/* Open n */ PDL_EXPAND2(register PDL_Indx n=0, __n_stop=(__n_size)); for(; n<__n_stop; n+=1) { |
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
209
|
1
|
|
|
|
|
|
register PDL_Indx this_ind = (ind_datap)[0+(__inc_ind_n*(n))]; |
|
210
|
1
|
50
|
|
|
|
|
PDL_IF_BAD( |
|
|
|
50
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
211
|
|
|
|
|
|
|
if (PDL_ISBAD2(this_ind,ind_badval,N,ind_badval_isnan)) return PDL->make_error(PDL_EUSERERROR, "Error in indadd:" "bad index %"IND_FLAG,n); |
|
212
|
|
|
|
|
|
|
if (PDL_ISBAD2((input_datap)[0+(__inc_input_n*(n))],input_badval,D,input_badval_isnan)) { (sum_datap)[0+(__inc_sum_m*(this_ind))]=sum_badval; continue; },) |
|
213
|
0
|
0
|
|
|
|
|
if (this_ind<0 || this_ind>=__privtrans->ind_sizes[0]) |
|
|
|
0
|
|
|
|
|
|
|
214
|
0
|
|
|
|
|
|
return PDL->make_error(PDL_EUSERERROR, "Error in indadd:" "invalid index %"IND_FLAG"; range 0..%"IND_FLAG,this_ind,__privtrans->ind_sizes[0]); |
|
215
|
0
|
|
|
|
|
|
(sum_datap)[0+(__inc_sum_m*(this_ind))] += (input_datap)[0+(__inc_input_n*(n))]; |
|
216
|
|
|
|
|
|
|
}} /* Close n */ |
|
217
|
0
|
0
|
|
|
|
|
}PDL_BROADCASTLOOP_END_indadd_readdata |
|
|
|
0
|
|
|
|
|
|
|
218
|
0
|
|
|
|
|
|
} break; |
|
219
|
0
|
|
|
|
|
|
case PDL_LD: { |
|
220
|
0
|
0
|
|
|
|
|
PDL_DECLARE_PARAMS_indadd_1(PDL_LDouble,E,PDL_Indx,N) |
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
221
|
0
|
0
|
|
|
|
|
PDL_BROADCASTLOOP_START_indadd_readdata {{/* Open n */ PDL_EXPAND2(register PDL_Indx n=0, __n_stop=(__n_size)); for(; n<__n_stop; n+=1) { |
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
222
|
0
|
|
|
|
|
|
register PDL_Indx this_ind = (ind_datap)[0+(__inc_ind_n*(n))]; |
|
223
|
0
|
0
|
|
|
|
|
PDL_IF_BAD( |
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
224
|
|
|
|
|
|
|
if (PDL_ISBAD2(this_ind,ind_badval,N,ind_badval_isnan)) return PDL->make_error(PDL_EUSERERROR, "Error in indadd:" "bad index %"IND_FLAG,n); |
|
225
|
|
|
|
|
|
|
if (PDL_ISBAD2((input_datap)[0+(__inc_input_n*(n))],input_badval,E,input_badval_isnan)) { (sum_datap)[0+(__inc_sum_m*(this_ind))]=sum_badval; continue; },) |
|
226
|
0
|
0
|
|
|
|
|
if (this_ind<0 || this_ind>=__privtrans->ind_sizes[0]) |
|
|
|
0
|
|
|
|
|
|
|
227
|
0
|
|
|
|
|
|
return PDL->make_error(PDL_EUSERERROR, "Error in indadd:" "invalid index %"IND_FLAG"; range 0..%"IND_FLAG,this_ind,__privtrans->ind_sizes[0]); |
|
228
|
0
|
|
|
|
|
|
(sum_datap)[0+(__inc_sum_m*(this_ind))] += (input_datap)[0+(__inc_input_n*(n))]; |
|
229
|
|
|
|
|
|
|
}} /* Close n */ |
|
230
|
0
|
0
|
|
|
|
|
}PDL_BROADCASTLOOP_END_indadd_readdata |
|
|
|
0
|
|
|
|
|
|
|
231
|
0
|
|
|
|
|
|
} break; |
|
232
|
0
|
|
|
|
|
|
case PDL_CF: { |
|
233
|
0
|
0
|
|
|
|
|
PDL_DECLARE_PARAMS_indadd_1(PDL_CFloat,G,PDL_Indx,N) |
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
234
|
0
|
0
|
|
|
|
|
PDL_BROADCASTLOOP_START_indadd_readdata {{/* Open n */ PDL_EXPAND2(register PDL_Indx n=0, __n_stop=(__n_size)); for(; n<__n_stop; n+=1) { |
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
235
|
0
|
|
|
|
|
|
register PDL_Indx this_ind = (ind_datap)[0+(__inc_ind_n*(n))]; |
|
236
|
0
|
0
|
|
|
|
|
PDL_IF_BAD( |
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
237
|
|
|
|
|
|
|
if (PDL_ISBAD2(this_ind,ind_badval,N,ind_badval_isnan)) return PDL->make_error(PDL_EUSERERROR, "Error in indadd:" "bad index %"IND_FLAG,n); |
|
238
|
|
|
|
|
|
|
if (PDL_ISBAD2((input_datap)[0+(__inc_input_n*(n))],input_badval,G,input_badval_isnan)) { (sum_datap)[0+(__inc_sum_m*(this_ind))]=sum_badval; continue; },) |
|
239
|
0
|
0
|
|
|
|
|
if (this_ind<0 || this_ind>=__privtrans->ind_sizes[0]) |
|
|
|
0
|
|
|
|
|
|
|
240
|
0
|
|
|
|
|
|
return PDL->make_error(PDL_EUSERERROR, "Error in indadd:" "invalid index %"IND_FLAG"; range 0..%"IND_FLAG,this_ind,__privtrans->ind_sizes[0]); |
|
241
|
0
|
|
|
|
|
|
(sum_datap)[0+(__inc_sum_m*(this_ind))] += (input_datap)[0+(__inc_input_n*(n))]; |
|
242
|
|
|
|
|
|
|
}} /* Close n */ |
|
243
|
0
|
0
|
|
|
|
|
}PDL_BROADCASTLOOP_END_indadd_readdata |
|
|
|
0
|
|
|
|
|
|
|
244
|
0
|
|
|
|
|
|
} break; |
|
245
|
0
|
|
|
|
|
|
case PDL_CD: { |
|
246
|
0
|
0
|
|
|
|
|
PDL_DECLARE_PARAMS_indadd_1(PDL_CDouble,C,PDL_Indx,N) |
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
247
|
0
|
0
|
|
|
|
|
PDL_BROADCASTLOOP_START_indadd_readdata {{/* Open n */ PDL_EXPAND2(register PDL_Indx n=0, __n_stop=(__n_size)); for(; n<__n_stop; n+=1) { |
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
248
|
0
|
|
|
|
|
|
register PDL_Indx this_ind = (ind_datap)[0+(__inc_ind_n*(n))]; |
|
249
|
0
|
0
|
|
|
|
|
PDL_IF_BAD( |
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
250
|
|
|
|
|
|
|
if (PDL_ISBAD2(this_ind,ind_badval,N,ind_badval_isnan)) return PDL->make_error(PDL_EUSERERROR, "Error in indadd:" "bad index %"IND_FLAG,n); |
|
251
|
|
|
|
|
|
|
if (PDL_ISBAD2((input_datap)[0+(__inc_input_n*(n))],input_badval,C,input_badval_isnan)) { (sum_datap)[0+(__inc_sum_m*(this_ind))]=sum_badval; continue; },) |
|
252
|
0
|
0
|
|
|
|
|
if (this_ind<0 || this_ind>=__privtrans->ind_sizes[0]) |
|
|
|
0
|
|
|
|
|
|
|
253
|
0
|
|
|
|
|
|
return PDL->make_error(PDL_EUSERERROR, "Error in indadd:" "invalid index %"IND_FLAG"; range 0..%"IND_FLAG,this_ind,__privtrans->ind_sizes[0]); |
|
254
|
0
|
|
|
|
|
|
(sum_datap)[0+(__inc_sum_m*(this_ind))] += (input_datap)[0+(__inc_input_n*(n))]; |
|
255
|
|
|
|
|
|
|
}} /* Close n */ |
|
256
|
0
|
0
|
|
|
|
|
}PDL_BROADCASTLOOP_END_indadd_readdata |
|
|
|
0
|
|
|
|
|
|
|
257
|
0
|
|
|
|
|
|
} break; |
|
258
|
0
|
|
|
|
|
|
case PDL_CLD: { |
|
259
|
0
|
0
|
|
|
|
|
PDL_DECLARE_PARAMS_indadd_1(PDL_CLDouble,H,PDL_Indx,N) |
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
260
|
0
|
0
|
|
|
|
|
PDL_BROADCASTLOOP_START_indadd_readdata {{/* Open n */ PDL_EXPAND2(register PDL_Indx n=0, __n_stop=(__n_size)); for(; n<__n_stop; n+=1) { |
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
261
|
0
|
|
|
|
|
|
register PDL_Indx this_ind = (ind_datap)[0+(__inc_ind_n*(n))]; |
|
262
|
0
|
0
|
|
|
|
|
PDL_IF_BAD( |
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
263
|
|
|
|
|
|
|
if (PDL_ISBAD2(this_ind,ind_badval,N,ind_badval_isnan)) return PDL->make_error(PDL_EUSERERROR, "Error in indadd:" "bad index %"IND_FLAG,n); |
|
264
|
|
|
|
|
|
|
if (PDL_ISBAD2((input_datap)[0+(__inc_input_n*(n))],input_badval,H,input_badval_isnan)) { (sum_datap)[0+(__inc_sum_m*(this_ind))]=sum_badval; continue; },) |
|
265
|
0
|
0
|
|
|
|
|
if (this_ind<0 || this_ind>=__privtrans->ind_sizes[0]) |
|
|
|
0
|
|
|
|
|
|
|
266
|
0
|
|
|
|
|
|
return PDL->make_error(PDL_EUSERERROR, "Error in indadd:" "invalid index %"IND_FLAG"; range 0..%"IND_FLAG,this_ind,__privtrans->ind_sizes[0]); |
|
267
|
0
|
|
|
|
|
|
(sum_datap)[0+(__inc_sum_m*(this_ind))] += (input_datap)[0+(__inc_input_n*(n))]; |
|
268
|
|
|
|
|
|
|
}} /* Close n */ |
|
269
|
0
|
0
|
|
|
|
|
}PDL_BROADCASTLOOP_END_indadd_readdata |
|
|
|
0
|
|
|
|
|
|
|
270
|
0
|
|
|
|
|
|
} break; |
|
271
|
0
|
|
|
|
|
|
default: return PDL->make_error(PDL_EUSERERROR, "PP INTERNAL ERROR in indadd: unhandled datatype(%d), only handles (ABSULKNPQFDEGCH)! PLEASE MAKE A BUG REPORT\n", __privtrans->__datatype); |
|
272
|
|
|
|
|
|
|
} |
|
273
|
|
|
|
|
|
|
#undef PDL_BAD_CODE |
|
274
|
|
|
|
|
|
|
#undef PDL_IF_BAD |
|
275
|
|
|
|
|
|
|
} else { /* ** else do 'good' Code ** */ |
|
276
|
|
|
|
|
|
|
#define PDL_IF_BAD(t,f) f |
|
277
|
6
|
|
|
|
|
|
switch (__privtrans->__datatype) { /* Start generic switch */ |
|
278
|
0
|
|
|
|
|
|
case PDL_SB: { |
|
279
|
0
|
0
|
|
|
|
|
PDL_DECLARE_PARAMS_indadd_1(PDL_SByte,A,PDL_Indx,N) |
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
280
|
0
|
0
|
|
|
|
|
PDL_BROADCASTLOOP_START_indadd_readdata {{/* Open n */ PDL_EXPAND2(register PDL_Indx n=0, __n_stop=(__n_size)); for(; n<__n_stop; n+=1) { |
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
281
|
0
|
|
|
|
|
|
register PDL_Indx this_ind = (ind_datap)[0+(__inc_ind_n*(n))]; |
|
282
|
|
|
|
|
|
|
PDL_IF_BAD( |
|
283
|
|
|
|
|
|
|
if (PDL_ISBAD2(this_ind,ind_badval,N,ind_badval_isnan)) return PDL->make_error(PDL_EUSERERROR, "Error in indadd:" "bad index %"IND_FLAG,n); |
|
284
|
|
|
|
|
|
|
if (PDL_ISBAD2((input_datap)[0+(__inc_input_n*(n))],input_badval,A,input_badval_isnan)) { (sum_datap)[0+(__inc_sum_m*(this_ind))]=sum_badval; continue; },) |
|
285
|
0
|
0
|
|
|
|
|
if (this_ind<0 || this_ind>=__privtrans->ind_sizes[0]) |
|
|
|
0
|
|
|
|
|
|
|
286
|
0
|
|
|
|
|
|
return PDL->make_error(PDL_EUSERERROR, "Error in indadd:" "invalid index %"IND_FLAG"; range 0..%"IND_FLAG,this_ind,__privtrans->ind_sizes[0]); |
|
287
|
0
|
|
|
|
|
|
(sum_datap)[0+(__inc_sum_m*(this_ind))] += (input_datap)[0+(__inc_input_n*(n))]; |
|
288
|
|
|
|
|
|
|
}} /* Close n */ |
|
289
|
0
|
0
|
|
|
|
|
}PDL_BROADCASTLOOP_END_indadd_readdata |
|
|
|
0
|
|
|
|
|
|
|
290
|
0
|
|
|
|
|
|
} break; |
|
291
|
0
|
|
|
|
|
|
case PDL_B: { |
|
292
|
0
|
0
|
|
|
|
|
PDL_DECLARE_PARAMS_indadd_1(PDL_Byte,B,PDL_Indx,N) |
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
293
|
0
|
0
|
|
|
|
|
PDL_BROADCASTLOOP_START_indadd_readdata {{/* Open n */ PDL_EXPAND2(register PDL_Indx n=0, __n_stop=(__n_size)); for(; n<__n_stop; n+=1) { |
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
294
|
0
|
|
|
|
|
|
register PDL_Indx this_ind = (ind_datap)[0+(__inc_ind_n*(n))]; |
|
295
|
|
|
|
|
|
|
PDL_IF_BAD( |
|
296
|
|
|
|
|
|
|
if (PDL_ISBAD2(this_ind,ind_badval,N,ind_badval_isnan)) return PDL->make_error(PDL_EUSERERROR, "Error in indadd:" "bad index %"IND_FLAG,n); |
|
297
|
|
|
|
|
|
|
if (PDL_ISBAD2((input_datap)[0+(__inc_input_n*(n))],input_badval,B,input_badval_isnan)) { (sum_datap)[0+(__inc_sum_m*(this_ind))]=sum_badval; continue; },) |
|
298
|
0
|
0
|
|
|
|
|
if (this_ind<0 || this_ind>=__privtrans->ind_sizes[0]) |
|
|
|
0
|
|
|
|
|
|
|
299
|
0
|
|
|
|
|
|
return PDL->make_error(PDL_EUSERERROR, "Error in indadd:" "invalid index %"IND_FLAG"; range 0..%"IND_FLAG,this_ind,__privtrans->ind_sizes[0]); |
|
300
|
0
|
|
|
|
|
|
(sum_datap)[0+(__inc_sum_m*(this_ind))] += (input_datap)[0+(__inc_input_n*(n))]; |
|
301
|
|
|
|
|
|
|
}} /* Close n */ |
|
302
|
0
|
0
|
|
|
|
|
}PDL_BROADCASTLOOP_END_indadd_readdata |
|
|
|
0
|
|
|
|
|
|
|
303
|
0
|
|
|
|
|
|
} break; |
|
304
|
0
|
|
|
|
|
|
case PDL_S: { |
|
305
|
0
|
0
|
|
|
|
|
PDL_DECLARE_PARAMS_indadd_1(PDL_Short,S,PDL_Indx,N) |
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
306
|
0
|
0
|
|
|
|
|
PDL_BROADCASTLOOP_START_indadd_readdata {{/* Open n */ PDL_EXPAND2(register PDL_Indx n=0, __n_stop=(__n_size)); for(; n<__n_stop; n+=1) { |
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
307
|
0
|
|
|
|
|
|
register PDL_Indx this_ind = (ind_datap)[0+(__inc_ind_n*(n))]; |
|
308
|
|
|
|
|
|
|
PDL_IF_BAD( |
|
309
|
|
|
|
|
|
|
if (PDL_ISBAD2(this_ind,ind_badval,N,ind_badval_isnan)) return PDL->make_error(PDL_EUSERERROR, "Error in indadd:" "bad index %"IND_FLAG,n); |
|
310
|
|
|
|
|
|
|
if (PDL_ISBAD2((input_datap)[0+(__inc_input_n*(n))],input_badval,S,input_badval_isnan)) { (sum_datap)[0+(__inc_sum_m*(this_ind))]=sum_badval; continue; },) |
|
311
|
0
|
0
|
|
|
|
|
if (this_ind<0 || this_ind>=__privtrans->ind_sizes[0]) |
|
|
|
0
|
|
|
|
|
|
|
312
|
0
|
|
|
|
|
|
return PDL->make_error(PDL_EUSERERROR, "Error in indadd:" "invalid index %"IND_FLAG"; range 0..%"IND_FLAG,this_ind,__privtrans->ind_sizes[0]); |
|
313
|
0
|
|
|
|
|
|
(sum_datap)[0+(__inc_sum_m*(this_ind))] += (input_datap)[0+(__inc_input_n*(n))]; |
|
314
|
|
|
|
|
|
|
}} /* Close n */ |
|
315
|
0
|
0
|
|
|
|
|
}PDL_BROADCASTLOOP_END_indadd_readdata |
|
|
|
0
|
|
|
|
|
|
|
316
|
0
|
|
|
|
|
|
} break; |
|
317
|
0
|
|
|
|
|
|
case PDL_US: { |
|
318
|
0
|
0
|
|
|
|
|
PDL_DECLARE_PARAMS_indadd_1(PDL_Ushort,U,PDL_Indx,N) |
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
319
|
0
|
0
|
|
|
|
|
PDL_BROADCASTLOOP_START_indadd_readdata {{/* Open n */ PDL_EXPAND2(register PDL_Indx n=0, __n_stop=(__n_size)); for(; n<__n_stop; n+=1) { |
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
320
|
0
|
|
|
|
|
|
register PDL_Indx this_ind = (ind_datap)[0+(__inc_ind_n*(n))]; |
|
321
|
|
|
|
|
|
|
PDL_IF_BAD( |
|
322
|
|
|
|
|
|
|
if (PDL_ISBAD2(this_ind,ind_badval,N,ind_badval_isnan)) return PDL->make_error(PDL_EUSERERROR, "Error in indadd:" "bad index %"IND_FLAG,n); |
|
323
|
|
|
|
|
|
|
if (PDL_ISBAD2((input_datap)[0+(__inc_input_n*(n))],input_badval,U,input_badval_isnan)) { (sum_datap)[0+(__inc_sum_m*(this_ind))]=sum_badval; continue; },) |
|
324
|
0
|
0
|
|
|
|
|
if (this_ind<0 || this_ind>=__privtrans->ind_sizes[0]) |
|
|
|
0
|
|
|
|
|
|
|
325
|
0
|
|
|
|
|
|
return PDL->make_error(PDL_EUSERERROR, "Error in indadd:" "invalid index %"IND_FLAG"; range 0..%"IND_FLAG,this_ind,__privtrans->ind_sizes[0]); |
|
326
|
0
|
|
|
|
|
|
(sum_datap)[0+(__inc_sum_m*(this_ind))] += (input_datap)[0+(__inc_input_n*(n))]; |
|
327
|
|
|
|
|
|
|
}} /* Close n */ |
|
328
|
0
|
0
|
|
|
|
|
}PDL_BROADCASTLOOP_END_indadd_readdata |
|
|
|
0
|
|
|
|
|
|
|
329
|
0
|
|
|
|
|
|
} break; |
|
330
|
0
|
|
|
|
|
|
case PDL_L: { |
|
331
|
0
|
0
|
|
|
|
|
PDL_DECLARE_PARAMS_indadd_1(PDL_Long,L,PDL_Indx,N) |
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
332
|
0
|
0
|
|
|
|
|
PDL_BROADCASTLOOP_START_indadd_readdata {{/* Open n */ PDL_EXPAND2(register PDL_Indx n=0, __n_stop=(__n_size)); for(; n<__n_stop; n+=1) { |
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
333
|
0
|
|
|
|
|
|
register PDL_Indx this_ind = (ind_datap)[0+(__inc_ind_n*(n))]; |
|
334
|
|
|
|
|
|
|
PDL_IF_BAD( |
|
335
|
|
|
|
|
|
|
if (PDL_ISBAD2(this_ind,ind_badval,N,ind_badval_isnan)) return PDL->make_error(PDL_EUSERERROR, "Error in indadd:" "bad index %"IND_FLAG,n); |
|
336
|
|
|
|
|
|
|
if (PDL_ISBAD2((input_datap)[0+(__inc_input_n*(n))],input_badval,L,input_badval_isnan)) { (sum_datap)[0+(__inc_sum_m*(this_ind))]=sum_badval; continue; },) |
|
337
|
0
|
0
|
|
|
|
|
if (this_ind<0 || this_ind>=__privtrans->ind_sizes[0]) |
|
|
|
0
|
|
|
|
|
|
|
338
|
0
|
|
|
|
|
|
return PDL->make_error(PDL_EUSERERROR, "Error in indadd:" "invalid index %"IND_FLAG"; range 0..%"IND_FLAG,this_ind,__privtrans->ind_sizes[0]); |
|
339
|
0
|
|
|
|
|
|
(sum_datap)[0+(__inc_sum_m*(this_ind))] += (input_datap)[0+(__inc_input_n*(n))]; |
|
340
|
|
|
|
|
|
|
}} /* Close n */ |
|
341
|
0
|
0
|
|
|
|
|
}PDL_BROADCASTLOOP_END_indadd_readdata |
|
|
|
0
|
|
|
|
|
|
|
342
|
0
|
|
|
|
|
|
} break; |
|
343
|
0
|
|
|
|
|
|
case PDL_UL: { |
|
344
|
0
|
0
|
|
|
|
|
PDL_DECLARE_PARAMS_indadd_1(PDL_ULong,K,PDL_Indx,N) |
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
345
|
0
|
0
|
|
|
|
|
PDL_BROADCASTLOOP_START_indadd_readdata {{/* Open n */ PDL_EXPAND2(register PDL_Indx n=0, __n_stop=(__n_size)); for(; n<__n_stop; n+=1) { |
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
346
|
0
|
|
|
|
|
|
register PDL_Indx this_ind = (ind_datap)[0+(__inc_ind_n*(n))]; |
|
347
|
|
|
|
|
|
|
PDL_IF_BAD( |
|
348
|
|
|
|
|
|
|
if (PDL_ISBAD2(this_ind,ind_badval,N,ind_badval_isnan)) return PDL->make_error(PDL_EUSERERROR, "Error in indadd:" "bad index %"IND_FLAG,n); |
|
349
|
|
|
|
|
|
|
if (PDL_ISBAD2((input_datap)[0+(__inc_input_n*(n))],input_badval,K,input_badval_isnan)) { (sum_datap)[0+(__inc_sum_m*(this_ind))]=sum_badval; continue; },) |
|
350
|
0
|
0
|
|
|
|
|
if (this_ind<0 || this_ind>=__privtrans->ind_sizes[0]) |
|
|
|
0
|
|
|
|
|
|
|
351
|
0
|
|
|
|
|
|
return PDL->make_error(PDL_EUSERERROR, "Error in indadd:" "invalid index %"IND_FLAG"; range 0..%"IND_FLAG,this_ind,__privtrans->ind_sizes[0]); |
|
352
|
0
|
|
|
|
|
|
(sum_datap)[0+(__inc_sum_m*(this_ind))] += (input_datap)[0+(__inc_input_n*(n))]; |
|
353
|
|
|
|
|
|
|
}} /* Close n */ |
|
354
|
0
|
0
|
|
|
|
|
}PDL_BROADCASTLOOP_END_indadd_readdata |
|
|
|
0
|
|
|
|
|
|
|
355
|
0
|
|
|
|
|
|
} break; |
|
356
|
0
|
|
|
|
|
|
case PDL_IND: { |
|
357
|
0
|
0
|
|
|
|
|
PDL_DECLARE_PARAMS_indadd_1(PDL_Indx,N,PDL_Indx,N) |
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
358
|
0
|
0
|
|
|
|
|
PDL_BROADCASTLOOP_START_indadd_readdata {{/* Open n */ PDL_EXPAND2(register PDL_Indx n=0, __n_stop=(__n_size)); for(; n<__n_stop; n+=1) { |
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
359
|
0
|
|
|
|
|
|
register PDL_Indx this_ind = (ind_datap)[0+(__inc_ind_n*(n))]; |
|
360
|
|
|
|
|
|
|
PDL_IF_BAD( |
|
361
|
|
|
|
|
|
|
if (PDL_ISBAD2(this_ind,ind_badval,N,ind_badval_isnan)) return PDL->make_error(PDL_EUSERERROR, "Error in indadd:" "bad index %"IND_FLAG,n); |
|
362
|
|
|
|
|
|
|
if (PDL_ISBAD2((input_datap)[0+(__inc_input_n*(n))],input_badval,N,input_badval_isnan)) { (sum_datap)[0+(__inc_sum_m*(this_ind))]=sum_badval; continue; },) |
|
363
|
0
|
0
|
|
|
|
|
if (this_ind<0 || this_ind>=__privtrans->ind_sizes[0]) |
|
|
|
0
|
|
|
|
|
|
|
364
|
0
|
|
|
|
|
|
return PDL->make_error(PDL_EUSERERROR, "Error in indadd:" "invalid index %"IND_FLAG"; range 0..%"IND_FLAG,this_ind,__privtrans->ind_sizes[0]); |
|
365
|
0
|
|
|
|
|
|
(sum_datap)[0+(__inc_sum_m*(this_ind))] += (input_datap)[0+(__inc_input_n*(n))]; |
|
366
|
|
|
|
|
|
|
}} /* Close n */ |
|
367
|
0
|
0
|
|
|
|
|
}PDL_BROADCASTLOOP_END_indadd_readdata |
|
|
|
0
|
|
|
|
|
|
|
368
|
0
|
|
|
|
|
|
} break; |
|
369
|
0
|
|
|
|
|
|
case PDL_ULL: { |
|
370
|
0
|
0
|
|
|
|
|
PDL_DECLARE_PARAMS_indadd_1(PDL_ULongLong,P,PDL_Indx,N) |
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
371
|
0
|
0
|
|
|
|
|
PDL_BROADCASTLOOP_START_indadd_readdata {{/* Open n */ PDL_EXPAND2(register PDL_Indx n=0, __n_stop=(__n_size)); for(; n<__n_stop; n+=1) { |
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
372
|
0
|
|
|
|
|
|
register PDL_Indx this_ind = (ind_datap)[0+(__inc_ind_n*(n))]; |
|
373
|
|
|
|
|
|
|
PDL_IF_BAD( |
|
374
|
|
|
|
|
|
|
if (PDL_ISBAD2(this_ind,ind_badval,N,ind_badval_isnan)) return PDL->make_error(PDL_EUSERERROR, "Error in indadd:" "bad index %"IND_FLAG,n); |
|
375
|
|
|
|
|
|
|
if (PDL_ISBAD2((input_datap)[0+(__inc_input_n*(n))],input_badval,P,input_badval_isnan)) { (sum_datap)[0+(__inc_sum_m*(this_ind))]=sum_badval; continue; },) |
|
376
|
0
|
0
|
|
|
|
|
if (this_ind<0 || this_ind>=__privtrans->ind_sizes[0]) |
|
|
|
0
|
|
|
|
|
|
|
377
|
0
|
|
|
|
|
|
return PDL->make_error(PDL_EUSERERROR, "Error in indadd:" "invalid index %"IND_FLAG"; range 0..%"IND_FLAG,this_ind,__privtrans->ind_sizes[0]); |
|
378
|
0
|
|
|
|
|
|
(sum_datap)[0+(__inc_sum_m*(this_ind))] += (input_datap)[0+(__inc_input_n*(n))]; |
|
379
|
|
|
|
|
|
|
}} /* Close n */ |
|
380
|
0
|
0
|
|
|
|
|
}PDL_BROADCASTLOOP_END_indadd_readdata |
|
|
|
0
|
|
|
|
|
|
|
381
|
0
|
|
|
|
|
|
} break; |
|
382
|
0
|
|
|
|
|
|
case PDL_LL: { |
|
383
|
0
|
0
|
|
|
|
|
PDL_DECLARE_PARAMS_indadd_1(PDL_LongLong,Q,PDL_Indx,N) |
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
384
|
0
|
0
|
|
|
|
|
PDL_BROADCASTLOOP_START_indadd_readdata {{/* Open n */ PDL_EXPAND2(register PDL_Indx n=0, __n_stop=(__n_size)); for(; n<__n_stop; n+=1) { |
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
385
|
0
|
|
|
|
|
|
register PDL_Indx this_ind = (ind_datap)[0+(__inc_ind_n*(n))]; |
|
386
|
|
|
|
|
|
|
PDL_IF_BAD( |
|
387
|
|
|
|
|
|
|
if (PDL_ISBAD2(this_ind,ind_badval,N,ind_badval_isnan)) return PDL->make_error(PDL_EUSERERROR, "Error in indadd:" "bad index %"IND_FLAG,n); |
|
388
|
|
|
|
|
|
|
if (PDL_ISBAD2((input_datap)[0+(__inc_input_n*(n))],input_badval,Q,input_badval_isnan)) { (sum_datap)[0+(__inc_sum_m*(this_ind))]=sum_badval; continue; },) |
|
389
|
0
|
0
|
|
|
|
|
if (this_ind<0 || this_ind>=__privtrans->ind_sizes[0]) |
|
|
|
0
|
|
|
|
|
|
|
390
|
0
|
|
|
|
|
|
return PDL->make_error(PDL_EUSERERROR, "Error in indadd:" "invalid index %"IND_FLAG"; range 0..%"IND_FLAG,this_ind,__privtrans->ind_sizes[0]); |
|
391
|
0
|
|
|
|
|
|
(sum_datap)[0+(__inc_sum_m*(this_ind))] += (input_datap)[0+(__inc_input_n*(n))]; |
|
392
|
|
|
|
|
|
|
}} /* Close n */ |
|
393
|
0
|
0
|
|
|
|
|
}PDL_BROADCASTLOOP_END_indadd_readdata |
|
|
|
0
|
|
|
|
|
|
|
394
|
0
|
|
|
|
|
|
} break; |
|
395
|
0
|
|
|
|
|
|
case PDL_F: { |
|
396
|
0
|
0
|
|
|
|
|
PDL_DECLARE_PARAMS_indadd_1(PDL_Float,F,PDL_Indx,N) |
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
397
|
0
|
0
|
|
|
|
|
PDL_BROADCASTLOOP_START_indadd_readdata {{/* Open n */ PDL_EXPAND2(register PDL_Indx n=0, __n_stop=(__n_size)); for(; n<__n_stop; n+=1) { |
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
398
|
0
|
|
|
|
|
|
register PDL_Indx this_ind = (ind_datap)[0+(__inc_ind_n*(n))]; |
|
399
|
|
|
|
|
|
|
PDL_IF_BAD( |
|
400
|
|
|
|
|
|
|
if (PDL_ISBAD2(this_ind,ind_badval,N,ind_badval_isnan)) return PDL->make_error(PDL_EUSERERROR, "Error in indadd:" "bad index %"IND_FLAG,n); |
|
401
|
|
|
|
|
|
|
if (PDL_ISBAD2((input_datap)[0+(__inc_input_n*(n))],input_badval,F,input_badval_isnan)) { (sum_datap)[0+(__inc_sum_m*(this_ind))]=sum_badval; continue; },) |
|
402
|
0
|
0
|
|
|
|
|
if (this_ind<0 || this_ind>=__privtrans->ind_sizes[0]) |
|
|
|
0
|
|
|
|
|
|
|
403
|
0
|
|
|
|
|
|
return PDL->make_error(PDL_EUSERERROR, "Error in indadd:" "invalid index %"IND_FLAG"; range 0..%"IND_FLAG,this_ind,__privtrans->ind_sizes[0]); |
|
404
|
0
|
|
|
|
|
|
(sum_datap)[0+(__inc_sum_m*(this_ind))] += (input_datap)[0+(__inc_input_n*(n))]; |
|
405
|
|
|
|
|
|
|
}} /* Close n */ |
|
406
|
0
|
0
|
|
|
|
|
}PDL_BROADCASTLOOP_END_indadd_readdata |
|
|
|
0
|
|
|
|
|
|
|
407
|
0
|
|
|
|
|
|
} break; |
|
408
|
6
|
|
|
|
|
|
case PDL_D: { |
|
409
|
6
|
50
|
|
|
|
|
PDL_DECLARE_PARAMS_indadd_1(PDL_Double,D,PDL_Indx,N) |
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
410
|
161
|
50
|
|
|
|
|
PDL_BROADCASTLOOP_START_indadd_readdata {{/* Open n */ PDL_EXPAND2(register PDL_Indx n=0, __n_stop=(__n_size)); for(; n<__n_stop; n+=1) { |
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
411
|
140
|
|
|
|
|
|
register PDL_Indx this_ind = (ind_datap)[0+(__inc_ind_n*(n))]; |
|
412
|
|
|
|
|
|
|
PDL_IF_BAD( |
|
413
|
|
|
|
|
|
|
if (PDL_ISBAD2(this_ind,ind_badval,N,ind_badval_isnan)) return PDL->make_error(PDL_EUSERERROR, "Error in indadd:" "bad index %"IND_FLAG,n); |
|
414
|
|
|
|
|
|
|
if (PDL_ISBAD2((input_datap)[0+(__inc_input_n*(n))],input_badval,D,input_badval_isnan)) { (sum_datap)[0+(__inc_sum_m*(this_ind))]=sum_badval; continue; },) |
|
415
|
140
|
100
|
|
|
|
|
if (this_ind<0 || this_ind>=__privtrans->ind_sizes[0]) |
|
|
|
50
|
|
|
|
|
|
|
416
|
1
|
|
|
|
|
|
return PDL->make_error(PDL_EUSERERROR, "Error in indadd:" "invalid index %"IND_FLAG"; range 0..%"IND_FLAG,this_ind,__privtrans->ind_sizes[0]); |
|
417
|
139
|
|
|
|
|
|
(sum_datap)[0+(__inc_sum_m*(this_ind))] += (input_datap)[0+(__inc_input_n*(n))]; |
|
418
|
|
|
|
|
|
|
}} /* Close n */ |
|
419
|
5
|
50
|
|
|
|
|
}PDL_BROADCASTLOOP_END_indadd_readdata |
|
|
|
50
|
|
|
|
|
|
|
420
|
5
|
|
|
|
|
|
} break; |
|
421
|
0
|
|
|
|
|
|
case PDL_LD: { |
|
422
|
0
|
0
|
|
|
|
|
PDL_DECLARE_PARAMS_indadd_1(PDL_LDouble,E,PDL_Indx,N) |
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
423
|
0
|
0
|
|
|
|
|
PDL_BROADCASTLOOP_START_indadd_readdata {{/* Open n */ PDL_EXPAND2(register PDL_Indx n=0, __n_stop=(__n_size)); for(; n<__n_stop; n+=1) { |
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
424
|
0
|
|
|
|
|
|
register PDL_Indx this_ind = (ind_datap)[0+(__inc_ind_n*(n))]; |
|
425
|
|
|
|
|
|
|
PDL_IF_BAD( |
|
426
|
|
|
|
|
|
|
if (PDL_ISBAD2(this_ind,ind_badval,N,ind_badval_isnan)) return PDL->make_error(PDL_EUSERERROR, "Error in indadd:" "bad index %"IND_FLAG,n); |
|
427
|
|
|
|
|
|
|
if (PDL_ISBAD2((input_datap)[0+(__inc_input_n*(n))],input_badval,E,input_badval_isnan)) { (sum_datap)[0+(__inc_sum_m*(this_ind))]=sum_badval; continue; },) |
|
428
|
0
|
0
|
|
|
|
|
if (this_ind<0 || this_ind>=__privtrans->ind_sizes[0]) |
|
|
|
0
|
|
|
|
|
|
|
429
|
0
|
|
|
|
|
|
return PDL->make_error(PDL_EUSERERROR, "Error in indadd:" "invalid index %"IND_FLAG"; range 0..%"IND_FLAG,this_ind,__privtrans->ind_sizes[0]); |
|
430
|
0
|
|
|
|
|
|
(sum_datap)[0+(__inc_sum_m*(this_ind))] += (input_datap)[0+(__inc_input_n*(n))]; |
|
431
|
|
|
|
|
|
|
}} /* Close n */ |
|
432
|
0
|
0
|
|
|
|
|
}PDL_BROADCASTLOOP_END_indadd_readdata |
|
|
|
0
|
|
|
|
|
|
|
433
|
0
|
|
|
|
|
|
} break; |
|
434
|
0
|
|
|
|
|
|
case PDL_CF: { |
|
435
|
0
|
0
|
|
|
|
|
PDL_DECLARE_PARAMS_indadd_1(PDL_CFloat,G,PDL_Indx,N) |
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
436
|
0
|
0
|
|
|
|
|
PDL_BROADCASTLOOP_START_indadd_readdata {{/* Open n */ PDL_EXPAND2(register PDL_Indx n=0, __n_stop=(__n_size)); for(; n<__n_stop; n+=1) { |
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
437
|
0
|
|
|
|
|
|
register PDL_Indx this_ind = (ind_datap)[0+(__inc_ind_n*(n))]; |
|
438
|
|
|
|
|
|
|
PDL_IF_BAD( |
|
439
|
|
|
|
|
|
|
if (PDL_ISBAD2(this_ind,ind_badval,N,ind_badval_isnan)) return PDL->make_error(PDL_EUSERERROR, "Error in indadd:" "bad index %"IND_FLAG,n); |
|
440
|
|
|
|
|
|
|
if (PDL_ISBAD2((input_datap)[0+(__inc_input_n*(n))],input_badval,G,input_badval_isnan)) { (sum_datap)[0+(__inc_sum_m*(this_ind))]=sum_badval; continue; },) |
|
441
|
0
|
0
|
|
|
|
|
if (this_ind<0 || this_ind>=__privtrans->ind_sizes[0]) |
|
|
|
0
|
|
|
|
|
|
|
442
|
0
|
|
|
|
|
|
return PDL->make_error(PDL_EUSERERROR, "Error in indadd:" "invalid index %"IND_FLAG"; range 0..%"IND_FLAG,this_ind,__privtrans->ind_sizes[0]); |
|
443
|
0
|
|
|
|
|
|
(sum_datap)[0+(__inc_sum_m*(this_ind))] += (input_datap)[0+(__inc_input_n*(n))]; |
|
444
|
|
|
|
|
|
|
}} /* Close n */ |
|
445
|
0
|
0
|
|
|
|
|
}PDL_BROADCASTLOOP_END_indadd_readdata |
|
|
|
0
|
|
|
|
|
|
|
446
|
0
|
|
|
|
|
|
} break; |
|
447
|
0
|
|
|
|
|
|
case PDL_CD: { |
|
448
|
0
|
0
|
|
|
|
|
PDL_DECLARE_PARAMS_indadd_1(PDL_CDouble,C,PDL_Indx,N) |
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
449
|
0
|
0
|
|
|
|
|
PDL_BROADCASTLOOP_START_indadd_readdata {{/* Open n */ PDL_EXPAND2(register PDL_Indx n=0, __n_stop=(__n_size)); for(; n<__n_stop; n+=1) { |
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
450
|
0
|
|
|
|
|
|
register PDL_Indx this_ind = (ind_datap)[0+(__inc_ind_n*(n))]; |
|
451
|
|
|
|
|
|
|
PDL_IF_BAD( |
|
452
|
|
|
|
|
|
|
if (PDL_ISBAD2(this_ind,ind_badval,N,ind_badval_isnan)) return PDL->make_error(PDL_EUSERERROR, "Error in indadd:" "bad index %"IND_FLAG,n); |
|
453
|
|
|
|
|
|
|
if (PDL_ISBAD2((input_datap)[0+(__inc_input_n*(n))],input_badval,C,input_badval_isnan)) { (sum_datap)[0+(__inc_sum_m*(this_ind))]=sum_badval; continue; },) |
|
454
|
0
|
0
|
|
|
|
|
if (this_ind<0 || this_ind>=__privtrans->ind_sizes[0]) |
|
|
|
0
|
|
|
|
|
|
|
455
|
0
|
|
|
|
|
|
return PDL->make_error(PDL_EUSERERROR, "Error in indadd:" "invalid index %"IND_FLAG"; range 0..%"IND_FLAG,this_ind,__privtrans->ind_sizes[0]); |
|
456
|
0
|
|
|
|
|
|
(sum_datap)[0+(__inc_sum_m*(this_ind))] += (input_datap)[0+(__inc_input_n*(n))]; |
|
457
|
|
|
|
|
|
|
}} /* Close n */ |
|
458
|
0
|
0
|
|
|
|
|
}PDL_BROADCASTLOOP_END_indadd_readdata |
|
|
|
0
|
|
|
|
|
|
|
459
|
0
|
|
|
|
|
|
} break; |
|
460
|
0
|
|
|
|
|
|
case PDL_CLD: { |
|
461
|
0
|
0
|
|
|
|
|
PDL_DECLARE_PARAMS_indadd_1(PDL_CLDouble,H,PDL_Indx,N) |
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
462
|
0
|
0
|
|
|
|
|
PDL_BROADCASTLOOP_START_indadd_readdata {{/* Open n */ PDL_EXPAND2(register PDL_Indx n=0, __n_stop=(__n_size)); for(; n<__n_stop; n+=1) { |
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
463
|
0
|
|
|
|
|
|
register PDL_Indx this_ind = (ind_datap)[0+(__inc_ind_n*(n))]; |
|
464
|
|
|
|
|
|
|
PDL_IF_BAD( |
|
465
|
|
|
|
|
|
|
if (PDL_ISBAD2(this_ind,ind_badval,N,ind_badval_isnan)) return PDL->make_error(PDL_EUSERERROR, "Error in indadd:" "bad index %"IND_FLAG,n); |
|
466
|
|
|
|
|
|
|
if (PDL_ISBAD2((input_datap)[0+(__inc_input_n*(n))],input_badval,H,input_badval_isnan)) { (sum_datap)[0+(__inc_sum_m*(this_ind))]=sum_badval; continue; },) |
|
467
|
0
|
0
|
|
|
|
|
if (this_ind<0 || this_ind>=__privtrans->ind_sizes[0]) |
|
|
|
0
|
|
|
|
|
|
|
468
|
0
|
|
|
|
|
|
return PDL->make_error(PDL_EUSERERROR, "Error in indadd:" "invalid index %"IND_FLAG"; range 0..%"IND_FLAG,this_ind,__privtrans->ind_sizes[0]); |
|
469
|
0
|
|
|
|
|
|
(sum_datap)[0+(__inc_sum_m*(this_ind))] += (input_datap)[0+(__inc_input_n*(n))]; |
|
470
|
|
|
|
|
|
|
}} /* Close n */ |
|
471
|
0
|
0
|
|
|
|
|
}PDL_BROADCASTLOOP_END_indadd_readdata |
|
|
|
0
|
|
|
|
|
|
|
472
|
0
|
|
|
|
|
|
} break; |
|
473
|
0
|
|
|
|
|
|
default: return PDL->make_error(PDL_EUSERERROR, "PP INTERNAL ERROR in indadd: unhandled datatype(%d), only handles (ABSULKNPQFDEGCH)! PLEASE MAKE A BUG REPORT\n", __privtrans->__datatype); |
|
474
|
|
|
|
|
|
|
} |
|
475
|
|
|
|
|
|
|
#undef PDL_IF_BAD |
|
476
|
|
|
|
|
|
|
} |
|
477
|
5
|
|
|
|
|
|
return PDL_err; |
|
478
|
|
|
|
|
|
|
} |
|
479
|
|
|
|
|
|
|
|
|
480
|
|
|
|
|
|
|
static pdl_datatypes pdl_indadd_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 }; |
|
481
|
|
|
|
|
|
|
static PDL_Indx pdl_indadd_vtable_realdims[] = { 1, 1, 1 }; |
|
482
|
|
|
|
|
|
|
static char *pdl_indadd_vtable_parnames[] = { "input","ind","sum" }; |
|
483
|
|
|
|
|
|
|
static short pdl_indadd_vtable_parflags[] = { |
|
484
|
|
|
|
|
|
|
0, |
|
485
|
|
|
|
|
|
|
PDL_PARAM_ISTYPED, |
|
486
|
|
|
|
|
|
|
PDL_PARAM_ISWRITE |
|
487
|
|
|
|
|
|
|
}; |
|
488
|
|
|
|
|
|
|
static pdl_datatypes pdl_indadd_vtable_partypes[] = { -1, PDL_IND, -1 }; |
|
489
|
|
|
|
|
|
|
static PDL_Indx pdl_indadd_vtable_realdims_starts[] = { 0, 1, 2 }; |
|
490
|
|
|
|
|
|
|
static PDL_Indx pdl_indadd_vtable_realdims_ind_ids[] = { 1, 1, 0 }; |
|
491
|
|
|
|
|
|
|
static char *pdl_indadd_vtable_indnames[] = { "m","n" }; |
|
492
|
|
|
|
|
|
|
pdl_transvtable pdl_indadd_vtable = { |
|
493
|
|
|
|
|
|
|
PDL_TRANS_DO_BROADCAST|PDL_TRANS_BADPROCESS, 0, pdl_indadd_vtable_gentypes, 2, 3, NULL /*CORE21*/, |
|
494
|
|
|
|
|
|
|
pdl_indadd_vtable_realdims, pdl_indadd_vtable_parnames, |
|
495
|
|
|
|
|
|
|
pdl_indadd_vtable_parflags, pdl_indadd_vtable_partypes, |
|
496
|
|
|
|
|
|
|
pdl_indadd_vtable_realdims_starts, pdl_indadd_vtable_realdims_ind_ids, 3, |
|
497
|
|
|
|
|
|
|
2, pdl_indadd_vtable_indnames, |
|
498
|
|
|
|
|
|
|
NULL, pdl_indadd_readdata, NULL, |
|
499
|
|
|
|
|
|
|
NULL, |
|
500
|
|
|
|
|
|
|
0,"PDL::Primitive::indadd" |
|
501
|
|
|
|
|
|
|
}; |
|
502
|
|
|
|
|
|
|
|
|
503
|
|
|
|
|
|
|
|
|
504
|
7
|
|
|
|
|
|
pdl_error pdl_run_indadd(pdl *input,pdl *ind,pdl *sum) { |
|
505
|
7
|
|
|
|
|
|
pdl_error PDL_err = {0, NULL, 0}; |
|
506
|
7
|
50
|
|
|
|
|
if (!PDL) return (pdl_error){PDL_EFATAL, "PDL core struct is NULL, can't continue",0}; |
|
507
|
7
|
|
|
|
|
|
pdl_trans *__privtrans = PDL->create_trans(&pdl_indadd_vtable); |
|
508
|
7
|
50
|
|
|
|
|
if (!__privtrans) return PDL->make_error_simple(PDL_EFATAL, "Couldn't create trans"); |
|
509
|
7
|
|
|
|
|
|
__privtrans->pdls[0] = input; |
|
510
|
7
|
|
|
|
|
|
__privtrans->pdls[1] = ind; |
|
511
|
7
|
|
|
|
|
|
__privtrans->pdls[2] = sum; |
|
512
|
7
|
50
|
|
|
|
|
PDL_RETERROR(PDL_err, PDL->type_coerce(__privtrans)); |
|
513
|
7
|
100
|
|
|
|
|
PDL_RETERROR(PDL_err, PDL->make_trans_mutual(__privtrans)); |
|
514
|
5
|
|
|
|
|
|
return PDL_err; |
|
515
|
|
|
|
|
|
|
} |