| 1 |
|
| |
| 2 |
|
| #line 453 "lib/PDL/PP.pm" |
| 3 |
|
| /* |
| 4 |
|
| * THIS FILE WAS GENERATED BY PDL::PP from lib/PDL/ImageND.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_ImageND |
| 21 |
|
| extern Core* PDL; /* Structure hold core C functions */ |
| 22 |
|
| #line 23 "lib/PDL/ImageND-pp-convolve.c" |
| 23 |
|
| /* Compute offset of (x,y,z,...) position in row-major list */ |
| 24 |
2 |
| static inline PDL_Indx ndim_get_offset(PDL_Indx* pos, PDL_Indx* dims, PDL_Long ndims) { |
| 25 |
|
| PDL_Long i; |
| 26 |
|
| PDL_Indx result,size; |
| 27 |
2 |
| size = 1; |
| 28 |
2 |
| result = 0; |
| 29 |
6 |
▶ | for (i=0; i<ndims; i++) { |
Branch: 1 branch
| Branch | True | False | Total |
| for (i=0; i<ndims; i++) { |
4 |
2 |
6 |
|
| 30 |
4 |
▶ | if (i>0) |
Branch: 1 branch
| Branch | True | False | Total |
| if (i>0) |
2 |
2 |
4 |
|
| 31 |
2 |
| size = size*dims[i-1]; |
| 32 |
4 |
| result = result + pos[i]*size; |
| 33 |
|
| } |
| 34 |
2 |
| return result; |
| 35 |
|
| } |
| 36 |
|
| /* Increment a position pointer array by one row */ |
| 37 |
4 |
| static inline void ndim_row_plusplus ( PDL_Indx* pos, PDL_Indx* dims, PDL_Long ndims ) { |
| 38 |
|
| PDL_Long noescape; |
| 39 |
|
| PDL_Indx i; |
| 40 |
4 |
| i=1; noescape=1; |
| 41 |
8 |
▶ | while(noescape) { |
Branch: 1 branch
| Branch | True | False | Total |
| while(noescape) { |
4 |
4 |
8 |
|
| 42 |
4 |
| (pos[i])++; |
| 43 |
4 |
▶ | if (pos[i]==dims[i]) { /* Carry */ |
Branch: 1 branch
| Branch | True | False | Total |
| if (pos[i]==dims[i]) { /* Carry */ |
1 |
3 |
4 |
|
| 44 |
1 |
▶ | if (i>=(ndims)-1) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (i>=(ndims)-1) { |
1 |
0 |
1 |
|
| 45 |
1 |
| noescape = 0; /* Exit */ |
| 46 |
|
| }else{ |
| 47 |
0 |
| pos[i]=0; |
| 48 |
0 |
| i++; |
| 49 |
|
| } |
| 50 |
|
| }else{ |
| 51 |
3 |
| noescape = 0; /* Exit */ |
| 52 |
|
| } |
| 53 |
|
| } |
| 54 |
4 |
| } |
| 55 |
|
| |
| 56 |
|
| |
| 57 |
|
| |
| 58 |
|
| #line 1888 "lib/PDL/PP.pm" |
| 59 |
|
| pdl_error pdl_convolve_redodims(pdl_trans *__privtrans) { |
| 60 |
|
| pdl_error PDL_err = {0, NULL, 0}; |
| 61 |
|
| #line 62 "lib/PDL/ImageND-pp-convolve.c" |
| 62 |
|
| #ifndef PDL_DECLARE_PARAMS_convolve_0 |
| 63 |
|
| #define PDL_DECLARE_PARAMS_convolve_0(PDL_TYPE_OP,PDL_PPSYM_OP,PDL_TYPE_PARAM_adims,PDL_PPSYM_PARAM_adims,PDL_TYPE_PARAM_bdims,PDL_PPSYM_PARAM_bdims) \ |
| 64 |
|
| PDL_DECLARE_PARAMETER(PDL_TYPE_OP, a, (__privtrans->pdls[0]), 0, PDL_PPSYM_OP) \ |
| 65 |
|
| PDL_DECLARE_PARAMETER(PDL_TYPE_OP, b, (__privtrans->pdls[1]), 0, PDL_PPSYM_OP) \ |
| 66 |
|
| PDL_DECLARE_PARAMETER(PDL_TYPE_PARAM_adims, adims, (__privtrans->pdls[2]), 0, PDL_PPSYM_PARAM_adims) \ |
| 67 |
|
| PDL_DECLARE_PARAMETER(PDL_TYPE_PARAM_bdims, bdims, (__privtrans->pdls[3]), 0, PDL_PPSYM_PARAM_bdims) \ |
| 68 |
|
| PDL_DECLARE_PARAMETER(PDL_TYPE_OP, c, (__privtrans->pdls[4]), 0, PDL_PPSYM_OP) |
| 69 |
|
| #endif |
| 70 |
|
| #define PDL_IF_BAD(t,f) f |
| 71 |
1 |
| switch (__privtrans->__datatype) { /* Start generic switch */ |
| 72 |
0 |
| case PDL_SB: { |
| 73 |
0 |
▶ | PDL_DECLARE_PARAMS_convolve_0(PDL_SByte,A,PDL_Indx,N,PDL_Indx,N) |
Branch: 5 branches
| Branch | True | False | Total |
| PDL_DECLARE_PARAMS_convolve_0(PDL_SByte,A,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_0(PDL_SByte,A,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_0(PDL_SByte,A,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_0(PDL_SByte,A,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_0(PDL_SByte,A,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
|
| 74 |
|
| { |
| 75 |
0 |
▶ | if (__privtrans->ind_sizes[2] != __privtrans->ind_sizes[3]) |
Branch: 1 branch
| Branch | True | False | Total |
| if (__privtrans->ind_sizes[2] != __privtrans->ind_sizes[3]) |
0 |
0 |
0 |
|
| 76 |
0 |
| return PDL->make_error(PDL_EUSERERROR, "Error in convolve:" "Arguments do not have the same dimensionality"); |
| 77 |
0 |
| PDL_Indx i, *dimsa = adims_datap, *dimsb = bdims_datap; |
| 78 |
0 |
▶ | for(i=0; i<__privtrans->ind_sizes[2]; i++) |
Branch: 1 branch
| Branch | True | False | Total |
| for(i=0; i<__privtrans->ind_sizes[2]; i++) |
0 |
0 |
0 |
|
| 79 |
0 |
▶ | if (dimsb[i]>=dimsa[i]) |
Branch: 1 branch
| Branch | True | False | Total |
| if (dimsb[i]>=dimsa[i]) |
0 |
0 |
0 |
|
| 80 |
0 |
| return PDL->make_error(PDL_EUSERERROR, "Error in convolve:" "Second argument must be smaller in all dimensions that first"); |
| 81 |
|
| } |
| 82 |
0 |
| } break; |
| 83 |
0 |
| case PDL_B: { |
| 84 |
0 |
▶ | PDL_DECLARE_PARAMS_convolve_0(PDL_Byte,B,PDL_Indx,N,PDL_Indx,N) |
Branch: 5 branches
| Branch | True | False | Total |
| PDL_DECLARE_PARAMS_convolve_0(PDL_Byte,B,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_0(PDL_Byte,B,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_0(PDL_Byte,B,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_0(PDL_Byte,B,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_0(PDL_Byte,B,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
|
| 85 |
|
| { |
| 86 |
0 |
▶ | if (__privtrans->ind_sizes[2] != __privtrans->ind_sizes[3]) |
Branch: 1 branch
| Branch | True | False | Total |
| if (__privtrans->ind_sizes[2] != __privtrans->ind_sizes[3]) |
0 |
0 |
0 |
|
| 87 |
0 |
| return PDL->make_error(PDL_EUSERERROR, "Error in convolve:" "Arguments do not have the same dimensionality"); |
| 88 |
0 |
| PDL_Indx i, *dimsa = adims_datap, *dimsb = bdims_datap; |
| 89 |
0 |
▶ | for(i=0; i<__privtrans->ind_sizes[2]; i++) |
Branch: 1 branch
| Branch | True | False | Total |
| for(i=0; i<__privtrans->ind_sizes[2]; i++) |
0 |
0 |
0 |
|
| 90 |
0 |
▶ | if (dimsb[i]>=dimsa[i]) |
Branch: 1 branch
| Branch | True | False | Total |
| if (dimsb[i]>=dimsa[i]) |
0 |
0 |
0 |
|
| 91 |
0 |
| return PDL->make_error(PDL_EUSERERROR, "Error in convolve:" "Second argument must be smaller in all dimensions that first"); |
| 92 |
|
| } |
| 93 |
0 |
| } break; |
| 94 |
0 |
| case PDL_S: { |
| 95 |
0 |
▶ | PDL_DECLARE_PARAMS_convolve_0(PDL_Short,S,PDL_Indx,N,PDL_Indx,N) |
Branch: 5 branches
| Branch | True | False | Total |
| PDL_DECLARE_PARAMS_convolve_0(PDL_Short,S,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_0(PDL_Short,S,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_0(PDL_Short,S,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_0(PDL_Short,S,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_0(PDL_Short,S,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
|
| 96 |
|
| { |
| 97 |
0 |
▶ | if (__privtrans->ind_sizes[2] != __privtrans->ind_sizes[3]) |
Branch: 1 branch
| Branch | True | False | Total |
| if (__privtrans->ind_sizes[2] != __privtrans->ind_sizes[3]) |
0 |
0 |
0 |
|
| 98 |
0 |
| return PDL->make_error(PDL_EUSERERROR, "Error in convolve:" "Arguments do not have the same dimensionality"); |
| 99 |
0 |
| PDL_Indx i, *dimsa = adims_datap, *dimsb = bdims_datap; |
| 100 |
0 |
▶ | for(i=0; i<__privtrans->ind_sizes[2]; i++) |
Branch: 1 branch
| Branch | True | False | Total |
| for(i=0; i<__privtrans->ind_sizes[2]; i++) |
0 |
0 |
0 |
|
| 101 |
0 |
▶ | if (dimsb[i]>=dimsa[i]) |
Branch: 1 branch
| Branch | True | False | Total |
| if (dimsb[i]>=dimsa[i]) |
0 |
0 |
0 |
|
| 102 |
0 |
| return PDL->make_error(PDL_EUSERERROR, "Error in convolve:" "Second argument must be smaller in all dimensions that first"); |
| 103 |
|
| } |
| 104 |
0 |
| } break; |
| 105 |
0 |
| case PDL_US: { |
| 106 |
0 |
▶ | PDL_DECLARE_PARAMS_convolve_0(PDL_Ushort,U,PDL_Indx,N,PDL_Indx,N) |
Branch: 5 branches
| Branch | True | False | Total |
| PDL_DECLARE_PARAMS_convolve_0(PDL_Ushort,U,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_0(PDL_Ushort,U,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_0(PDL_Ushort,U,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_0(PDL_Ushort,U,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_0(PDL_Ushort,U,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
|
| 107 |
|
| { |
| 108 |
0 |
▶ | if (__privtrans->ind_sizes[2] != __privtrans->ind_sizes[3]) |
Branch: 1 branch
| Branch | True | False | Total |
| if (__privtrans->ind_sizes[2] != __privtrans->ind_sizes[3]) |
0 |
0 |
0 |
|
| 109 |
0 |
| return PDL->make_error(PDL_EUSERERROR, "Error in convolve:" "Arguments do not have the same dimensionality"); |
| 110 |
0 |
| PDL_Indx i, *dimsa = adims_datap, *dimsb = bdims_datap; |
| 111 |
0 |
▶ | for(i=0; i<__privtrans->ind_sizes[2]; i++) |
Branch: 1 branch
| Branch | True | False | Total |
| for(i=0; i<__privtrans->ind_sizes[2]; i++) |
0 |
0 |
0 |
|
| 112 |
0 |
▶ | if (dimsb[i]>=dimsa[i]) |
Branch: 1 branch
| Branch | True | False | Total |
| if (dimsb[i]>=dimsa[i]) |
0 |
0 |
0 |
|
| 113 |
0 |
| return PDL->make_error(PDL_EUSERERROR, "Error in convolve:" "Second argument must be smaller in all dimensions that first"); |
| 114 |
|
| } |
| 115 |
0 |
| } break; |
| 116 |
0 |
| case PDL_L: { |
| 117 |
0 |
▶ | PDL_DECLARE_PARAMS_convolve_0(PDL_Long,L,PDL_Indx,N,PDL_Indx,N) |
Branch: 5 branches
| Branch | True | False | Total |
| PDL_DECLARE_PARAMS_convolve_0(PDL_Long,L,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_0(PDL_Long,L,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_0(PDL_Long,L,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_0(PDL_Long,L,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_0(PDL_Long,L,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
|
| 118 |
|
| { |
| 119 |
0 |
▶ | if (__privtrans->ind_sizes[2] != __privtrans->ind_sizes[3]) |
Branch: 1 branch
| Branch | True | False | Total |
| if (__privtrans->ind_sizes[2] != __privtrans->ind_sizes[3]) |
0 |
0 |
0 |
|
| 120 |
0 |
| return PDL->make_error(PDL_EUSERERROR, "Error in convolve:" "Arguments do not have the same dimensionality"); |
| 121 |
0 |
| PDL_Indx i, *dimsa = adims_datap, *dimsb = bdims_datap; |
| 122 |
0 |
▶ | for(i=0; i<__privtrans->ind_sizes[2]; i++) |
Branch: 1 branch
| Branch | True | False | Total |
| for(i=0; i<__privtrans->ind_sizes[2]; i++) |
0 |
0 |
0 |
|
| 123 |
0 |
▶ | if (dimsb[i]>=dimsa[i]) |
Branch: 1 branch
| Branch | True | False | Total |
| if (dimsb[i]>=dimsa[i]) |
0 |
0 |
0 |
|
| 124 |
0 |
| return PDL->make_error(PDL_EUSERERROR, "Error in convolve:" "Second argument must be smaller in all dimensions that first"); |
| 125 |
|
| } |
| 126 |
0 |
| } break; |
| 127 |
0 |
| case PDL_UL: { |
| 128 |
0 |
▶ | PDL_DECLARE_PARAMS_convolve_0(PDL_ULong,K,PDL_Indx,N,PDL_Indx,N) |
Branch: 5 branches
| Branch | True | False | Total |
| PDL_DECLARE_PARAMS_convolve_0(PDL_ULong,K,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_0(PDL_ULong,K,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_0(PDL_ULong,K,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_0(PDL_ULong,K,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_0(PDL_ULong,K,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
|
| 129 |
|
| { |
| 130 |
0 |
▶ | if (__privtrans->ind_sizes[2] != __privtrans->ind_sizes[3]) |
Branch: 1 branch
| Branch | True | False | Total |
| if (__privtrans->ind_sizes[2] != __privtrans->ind_sizes[3]) |
0 |
0 |
0 |
|
| 131 |
0 |
| return PDL->make_error(PDL_EUSERERROR, "Error in convolve:" "Arguments do not have the same dimensionality"); |
| 132 |
0 |
| PDL_Indx i, *dimsa = adims_datap, *dimsb = bdims_datap; |
| 133 |
0 |
▶ | for(i=0; i<__privtrans->ind_sizes[2]; i++) |
Branch: 1 branch
| Branch | True | False | Total |
| for(i=0; i<__privtrans->ind_sizes[2]; i++) |
0 |
0 |
0 |
|
| 134 |
0 |
▶ | if (dimsb[i]>=dimsa[i]) |
Branch: 1 branch
| Branch | True | False | Total |
| if (dimsb[i]>=dimsa[i]) |
0 |
0 |
0 |
|
| 135 |
0 |
| return PDL->make_error(PDL_EUSERERROR, "Error in convolve:" "Second argument must be smaller in all dimensions that first"); |
| 136 |
|
| } |
| 137 |
0 |
| } break; |
| 138 |
0 |
| case PDL_IND: { |
| 139 |
0 |
▶ | PDL_DECLARE_PARAMS_convolve_0(PDL_Indx,N,PDL_Indx,N,PDL_Indx,N) |
Branch: 5 branches
| Branch | True | False | Total |
| PDL_DECLARE_PARAMS_convolve_0(PDL_Indx,N,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_0(PDL_Indx,N,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_0(PDL_Indx,N,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_0(PDL_Indx,N,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_0(PDL_Indx,N,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
|
| 140 |
|
| { |
| 141 |
0 |
▶ | if (__privtrans->ind_sizes[2] != __privtrans->ind_sizes[3]) |
Branch: 1 branch
| Branch | True | False | Total |
| if (__privtrans->ind_sizes[2] != __privtrans->ind_sizes[3]) |
0 |
0 |
0 |
|
| 142 |
0 |
| return PDL->make_error(PDL_EUSERERROR, "Error in convolve:" "Arguments do not have the same dimensionality"); |
| 143 |
0 |
| PDL_Indx i, *dimsa = adims_datap, *dimsb = bdims_datap; |
| 144 |
0 |
▶ | for(i=0; i<__privtrans->ind_sizes[2]; i++) |
Branch: 1 branch
| Branch | True | False | Total |
| for(i=0; i<__privtrans->ind_sizes[2]; i++) |
0 |
0 |
0 |
|
| 145 |
0 |
▶ | if (dimsb[i]>=dimsa[i]) |
Branch: 1 branch
| Branch | True | False | Total |
| if (dimsb[i]>=dimsa[i]) |
0 |
0 |
0 |
|
| 146 |
0 |
| return PDL->make_error(PDL_EUSERERROR, "Error in convolve:" "Second argument must be smaller in all dimensions that first"); |
| 147 |
|
| } |
| 148 |
0 |
| } break; |
| 149 |
0 |
| case PDL_ULL: { |
| 150 |
0 |
▶ | PDL_DECLARE_PARAMS_convolve_0(PDL_ULongLong,P,PDL_Indx,N,PDL_Indx,N) |
Branch: 5 branches
| Branch | True | False | Total |
| PDL_DECLARE_PARAMS_convolve_0(PDL_ULongLong,P,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_0(PDL_ULongLong,P,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_0(PDL_ULongLong,P,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_0(PDL_ULongLong,P,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_0(PDL_ULongLong,P,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
|
| 151 |
|
| { |
| 152 |
0 |
▶ | if (__privtrans->ind_sizes[2] != __privtrans->ind_sizes[3]) |
Branch: 1 branch
| Branch | True | False | Total |
| if (__privtrans->ind_sizes[2] != __privtrans->ind_sizes[3]) |
0 |
0 |
0 |
|
| 153 |
0 |
| return PDL->make_error(PDL_EUSERERROR, "Error in convolve:" "Arguments do not have the same dimensionality"); |
| 154 |
0 |
| PDL_Indx i, *dimsa = adims_datap, *dimsb = bdims_datap; |
| 155 |
0 |
▶ | for(i=0; i<__privtrans->ind_sizes[2]; i++) |
Branch: 1 branch
| Branch | True | False | Total |
| for(i=0; i<__privtrans->ind_sizes[2]; i++) |
0 |
0 |
0 |
|
| 156 |
0 |
▶ | if (dimsb[i]>=dimsa[i]) |
Branch: 1 branch
| Branch | True | False | Total |
| if (dimsb[i]>=dimsa[i]) |
0 |
0 |
0 |
|
| 157 |
0 |
| return PDL->make_error(PDL_EUSERERROR, "Error in convolve:" "Second argument must be smaller in all dimensions that first"); |
| 158 |
|
| } |
| 159 |
0 |
| } break; |
| 160 |
0 |
| case PDL_LL: { |
| 161 |
0 |
▶ | PDL_DECLARE_PARAMS_convolve_0(PDL_LongLong,Q,PDL_Indx,N,PDL_Indx,N) |
Branch: 5 branches
| Branch | True | False | Total |
| PDL_DECLARE_PARAMS_convolve_0(PDL_LongLong,Q,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_0(PDL_LongLong,Q,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_0(PDL_LongLong,Q,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_0(PDL_LongLong,Q,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_0(PDL_LongLong,Q,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
|
| 162 |
|
| { |
| 163 |
0 |
▶ | if (__privtrans->ind_sizes[2] != __privtrans->ind_sizes[3]) |
Branch: 1 branch
| Branch | True | False | Total |
| if (__privtrans->ind_sizes[2] != __privtrans->ind_sizes[3]) |
0 |
0 |
0 |
|
| 164 |
0 |
| return PDL->make_error(PDL_EUSERERROR, "Error in convolve:" "Arguments do not have the same dimensionality"); |
| 165 |
0 |
| PDL_Indx i, *dimsa = adims_datap, *dimsb = bdims_datap; |
| 166 |
0 |
▶ | for(i=0; i<__privtrans->ind_sizes[2]; i++) |
Branch: 1 branch
| Branch | True | False | Total |
| for(i=0; i<__privtrans->ind_sizes[2]; i++) |
0 |
0 |
0 |
|
| 167 |
0 |
▶ | if (dimsb[i]>=dimsa[i]) |
Branch: 1 branch
| Branch | True | False | Total |
| if (dimsb[i]>=dimsa[i]) |
0 |
0 |
0 |
|
| 168 |
0 |
| return PDL->make_error(PDL_EUSERERROR, "Error in convolve:" "Second argument must be smaller in all dimensions that first"); |
| 169 |
|
| } |
| 170 |
0 |
| } break; |
| 171 |
0 |
| case PDL_F: { |
| 172 |
0 |
▶ | PDL_DECLARE_PARAMS_convolve_0(PDL_Float,F,PDL_Indx,N,PDL_Indx,N) |
Branch: 5 branches
| Branch | True | False | Total |
| PDL_DECLARE_PARAMS_convolve_0(PDL_Float,F,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_0(PDL_Float,F,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_0(PDL_Float,F,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_0(PDL_Float,F,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_0(PDL_Float,F,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
|
| 173 |
|
| { |
| 174 |
0 |
▶ | if (__privtrans->ind_sizes[2] != __privtrans->ind_sizes[3]) |
Branch: 1 branch
| Branch | True | False | Total |
| if (__privtrans->ind_sizes[2] != __privtrans->ind_sizes[3]) |
0 |
0 |
0 |
|
| 175 |
0 |
| return PDL->make_error(PDL_EUSERERROR, "Error in convolve:" "Arguments do not have the same dimensionality"); |
| 176 |
0 |
| PDL_Indx i, *dimsa = adims_datap, *dimsb = bdims_datap; |
| 177 |
0 |
▶ | for(i=0; i<__privtrans->ind_sizes[2]; i++) |
Branch: 1 branch
| Branch | True | False | Total |
| for(i=0; i<__privtrans->ind_sizes[2]; i++) |
0 |
0 |
0 |
|
| 178 |
0 |
▶ | if (dimsb[i]>=dimsa[i]) |
Branch: 1 branch
| Branch | True | False | Total |
| if (dimsb[i]>=dimsa[i]) |
0 |
0 |
0 |
|
| 179 |
0 |
| return PDL->make_error(PDL_EUSERERROR, "Error in convolve:" "Second argument must be smaller in all dimensions that first"); |
| 180 |
|
| } |
| 181 |
0 |
| } break; |
| 182 |
1 |
| case PDL_D: { |
| 183 |
1 |
▶ | PDL_DECLARE_PARAMS_convolve_0(PDL_Double,D,PDL_Indx,N,PDL_Indx,N) |
Branch: 5 branches
| Branch | True | False | Total |
| PDL_DECLARE_PARAMS_convolve_0(PDL_Double,D,PDL_Indx,N,PDL_Indx,N) |
0 |
1 |
1 |
| PDL_DECLARE_PARAMS_convolve_0(PDL_Double,D,PDL_Indx,N,PDL_Indx,N) |
0 |
1 |
1 |
| PDL_DECLARE_PARAMS_convolve_0(PDL_Double,D,PDL_Indx,N,PDL_Indx,N) |
0 |
1 |
1 |
| PDL_DECLARE_PARAMS_convolve_0(PDL_Double,D,PDL_Indx,N,PDL_Indx,N) |
0 |
1 |
1 |
| PDL_DECLARE_PARAMS_convolve_0(PDL_Double,D,PDL_Indx,N,PDL_Indx,N) |
0 |
1 |
1 |
|
| 184 |
|
| { |
| 185 |
1 |
▶ | if (__privtrans->ind_sizes[2] != __privtrans->ind_sizes[3]) |
Branch: 1 branch
| Branch | True | False | Total |
| if (__privtrans->ind_sizes[2] != __privtrans->ind_sizes[3]) |
0 |
1 |
1 |
|
| 186 |
0 |
| return PDL->make_error(PDL_EUSERERROR, "Error in convolve:" "Arguments do not have the same dimensionality"); |
| 187 |
1 |
| PDL_Indx i, *dimsa = adims_datap, *dimsb = bdims_datap; |
| 188 |
3 |
▶ | for(i=0; i<__privtrans->ind_sizes[2]; i++) |
Branch: 1 branch
| Branch | True | False | Total |
| for(i=0; i<__privtrans->ind_sizes[2]; i++) |
2 |
1 |
3 |
|
| 189 |
2 |
▶ | if (dimsb[i]>=dimsa[i]) |
Branch: 1 branch
| Branch | True | False | Total |
| if (dimsb[i]>=dimsa[i]) |
0 |
2 |
2 |
|
| 190 |
0 |
| return PDL->make_error(PDL_EUSERERROR, "Error in convolve:" "Second argument must be smaller in all dimensions that first"); |
| 191 |
|
| } |
| 192 |
1 |
| } break; |
| 193 |
0 |
| case PDL_LD: { |
| 194 |
0 |
▶ | PDL_DECLARE_PARAMS_convolve_0(PDL_LDouble,E,PDL_Indx,N,PDL_Indx,N) |
Branch: 5 branches
| Branch | True | False | Total |
| PDL_DECLARE_PARAMS_convolve_0(PDL_LDouble,E,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_0(PDL_LDouble,E,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_0(PDL_LDouble,E,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_0(PDL_LDouble,E,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_0(PDL_LDouble,E,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
|
| 195 |
|
| { |
| 196 |
0 |
▶ | if (__privtrans->ind_sizes[2] != __privtrans->ind_sizes[3]) |
Branch: 1 branch
| Branch | True | False | Total |
| if (__privtrans->ind_sizes[2] != __privtrans->ind_sizes[3]) |
0 |
0 |
0 |
|
| 197 |
0 |
| return PDL->make_error(PDL_EUSERERROR, "Error in convolve:" "Arguments do not have the same dimensionality"); |
| 198 |
0 |
| PDL_Indx i, *dimsa = adims_datap, *dimsb = bdims_datap; |
| 199 |
0 |
▶ | for(i=0; i<__privtrans->ind_sizes[2]; i++) |
Branch: 1 branch
| Branch | True | False | Total |
| for(i=0; i<__privtrans->ind_sizes[2]; i++) |
0 |
0 |
0 |
|
| 200 |
0 |
▶ | if (dimsb[i]>=dimsa[i]) |
Branch: 1 branch
| Branch | True | False | Total |
| if (dimsb[i]>=dimsa[i]) |
0 |
0 |
0 |
|
| 201 |
0 |
| return PDL->make_error(PDL_EUSERERROR, "Error in convolve:" "Second argument must be smaller in all dimensions that first"); |
| 202 |
|
| } |
| 203 |
0 |
| } break; |
| 204 |
0 |
| default: return PDL->make_error(PDL_EUSERERROR, "PP INTERNAL ERROR in convolve: unhandled datatype(%d), only handles (ABSULKNPQFDE)! PLEASE MAKE A BUG REPORT\n", __privtrans->__datatype); |
| 205 |
|
| } |
| 206 |
|
| #undef PDL_IF_BAD |
| 207 |
|
| |
| 208 |
1 |
▶ | PDL_RETERROR(PDL_err, PDL->redodims_default(__privtrans)); |
Branch: 1 branch
| Branch | True | False | Total |
| PDL_RETERROR(PDL_err, PDL->redodims_default(__privtrans)); |
0 |
1 |
1 |
|
| 209 |
1 |
| return PDL_err; |
| 210 |
|
| } |
| 211 |
|
| |
| 212 |
|
| |
| 213 |
|
| #line 1888 "lib/PDL/PP.pm" |
| 214 |
|
| pdl_error pdl_convolve_readdata(pdl_trans *__privtrans) { |
| 215 |
|
| pdl_error PDL_err = {0, NULL, 0}; |
| 216 |
|
| #line 217 "lib/PDL/ImageND-pp-convolve.c" |
| 217 |
1 |
▶ | if (!__privtrans->broadcast.incs) return PDL->make_error(PDL_EUSERERROR, "Error in convolve:" "broadcast.incs NULL"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (!__privtrans->broadcast.incs) return PDL->make_error(PDL_EUSERERROR, "Error in convolve:" "broadcast.incs NULL"); |
0 |
1 |
1 |
|
| 218 |
|
| /* broadcastloop declarations */ |
| 219 |
|
| int __brcloopval; |
| 220 |
|
| register PDL_Indx __tind0,__tind1; /* counters along dim */ |
| 221 |
1 |
| register PDL_Indx __tnpdls = __privtrans->broadcast.npdls; |
| 222 |
|
| /* dims here are how many steps along those dims */ |
| 223 |
1 |
| register PDL_Indx __tinc0_a = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,0,0); |
| 224 |
1 |
| register PDL_Indx __tinc0_b = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,1,0); |
| 225 |
1 |
| register PDL_Indx __tinc0_adims = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,2,0); |
| 226 |
1 |
| register PDL_Indx __tinc0_bdims = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,3,0); |
| 227 |
1 |
| register PDL_Indx __tinc0_c = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,4,0); |
| 228 |
1 |
| register PDL_Indx __tinc1_a = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,0,1); |
| 229 |
1 |
| register PDL_Indx __tinc1_b = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,1,1); |
| 230 |
1 |
| register PDL_Indx __tinc1_adims = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,2,1); |
| 231 |
1 |
| register PDL_Indx __tinc1_bdims = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,3,1); |
| 232 |
1 |
| register PDL_Indx __tinc1_c = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,4,1); |
| 233 |
|
| #define PDL_BROADCASTLOOP_START_convolve_readdata PDL_BROADCASTLOOP_START( \ |
| 234 |
|
| readdata, \ |
| 235 |
|
| __privtrans->broadcast, \ |
| 236 |
|
| __privtrans->vtable, \ |
| 237 |
|
| a_datap += __offsp[0]; \ |
| 238 |
|
| b_datap += __offsp[1]; \ |
| 239 |
|
| adims_datap += __offsp[2]; \ |
| 240 |
|
| bdims_datap += __offsp[3]; \ |
| 241 |
|
| c_datap += __offsp[4]; \ |
| 242 |
|
| , \ |
| 243 |
|
| ( ,a_datap += __tinc1_a - __tinc0_a * __tdims0 \ |
| 244 |
|
| ,b_datap += __tinc1_b - __tinc0_b * __tdims0 \ |
| 245 |
|
| ,adims_datap += __tinc1_adims - __tinc0_adims * __tdims0 \ |
| 246 |
|
| ,bdims_datap += __tinc1_bdims - __tinc0_bdims * __tdims0 \ |
| 247 |
|
| ,c_datap += __tinc1_c - __tinc0_c * __tdims0 \ |
| 248 |
|
| ), \ |
| 249 |
|
| ( ,a_datap += __tinc0_a \ |
| 250 |
|
| ,b_datap += __tinc0_b \ |
| 251 |
|
| ,adims_datap += __tinc0_adims \ |
| 252 |
|
| ,bdims_datap += __tinc0_bdims \ |
| 253 |
|
| ,c_datap += __tinc0_c \ |
| 254 |
|
| ) \ |
| 255 |
|
| ) |
| 256 |
|
| #define PDL_BROADCASTLOOP_END_convolve_readdata PDL_BROADCASTLOOP_END( \ |
| 257 |
|
| __privtrans->broadcast, \ |
| 258 |
|
| a_datap -= __tinc1_a * __tdims1 + __offsp[0]; \ |
| 259 |
|
| b_datap -= __tinc1_b * __tdims1 + __offsp[1]; \ |
| 260 |
|
| adims_datap -= __tinc1_adims * __tdims1 + __offsp[2]; \ |
| 261 |
|
| bdims_datap -= __tinc1_bdims * __tdims1 + __offsp[3]; \ |
| 262 |
|
| c_datap -= __tinc1_c * __tdims1 + __offsp[4]; \ |
| 263 |
|
| ) |
| 264 |
1 |
| register PDL_Indx __inc_a_m = __privtrans->inc_sizes[PDL_INC_ID(__privtrans->vtable,0,0)]; (void)__inc_a_m; |
| 265 |
1 |
| register PDL_Indx __inc_adims_p = __privtrans->inc_sizes[PDL_INC_ID(__privtrans->vtable,2,0)]; (void)__inc_adims_p; |
| 266 |
1 |
| register PDL_Indx __inc_b_n = __privtrans->inc_sizes[PDL_INC_ID(__privtrans->vtable,1,0)]; (void)__inc_b_n; |
| 267 |
1 |
| register PDL_Indx __inc_bdims_q = __privtrans->inc_sizes[PDL_INC_ID(__privtrans->vtable,3,0)]; (void)__inc_bdims_q; |
| 268 |
1 |
| register PDL_Indx __inc_c_m = __privtrans->inc_sizes[PDL_INC_ID(__privtrans->vtable,4,0)]; (void)__inc_c_m; |
| 269 |
|
| #ifndef PDL_DECLARE_PARAMS_convolve_1 |
| 270 |
|
| #define PDL_DECLARE_PARAMS_convolve_1(PDL_TYPE_OP,PDL_PPSYM_OP,PDL_TYPE_PARAM_adims,PDL_PPSYM_PARAM_adims,PDL_TYPE_PARAM_bdims,PDL_PPSYM_PARAM_bdims) \ |
| 271 |
|
| PDL_DECLARE_PARAMETER(PDL_TYPE_OP, a, (__privtrans->pdls[0]), 1, PDL_PPSYM_OP) \ |
| 272 |
|
| PDL_DECLARE_PARAMETER(PDL_TYPE_OP, b, (__privtrans->pdls[1]), 1, PDL_PPSYM_OP) \ |
| 273 |
|
| PDL_DECLARE_PARAMETER(PDL_TYPE_PARAM_adims, adims, (__privtrans->pdls[2]), 1, PDL_PPSYM_PARAM_adims) \ |
| 274 |
|
| PDL_DECLARE_PARAMETER(PDL_TYPE_PARAM_bdims, bdims, (__privtrans->pdls[3]), 1, PDL_PPSYM_PARAM_bdims) \ |
| 275 |
|
| PDL_DECLARE_PARAMETER(PDL_TYPE_OP, c, (__privtrans->pdls[4]), 1, PDL_PPSYM_OP) |
| 276 |
|
| #endif |
| 277 |
|
| #define PDL_IF_BAD(t,f) f |
| 278 |
1 |
| switch (__privtrans->__datatype) { /* Start generic switch */ |
| 279 |
0 |
| case PDL_SB: { |
| 280 |
0 |
▶ | PDL_DECLARE_PARAMS_convolve_1(PDL_SByte,A,PDL_Indx,N,PDL_Indx,N) |
Branch: 15 branches
| Branch | True | False | Total |
| PDL_DECLARE_PARAMS_convolve_1(PDL_SByte,A,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_SByte,A,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_SByte,A,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_SByte,A,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_SByte,A,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_SByte,A,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_SByte,A,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_SByte,A,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_SByte,A,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_SByte,A,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_SByte,A,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_SByte,A,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_SByte,A,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_SByte,A,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_SByte,A,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
|
| 281 |
0 |
▶ | PDL_BROADCASTLOOP_START_convolve_readdata { |
Branch: 7 branches
| Branch | True | False | Total |
| PDL_BROADCASTLOOP_START_convolve_readdata { |
0 |
0 |
0 |
| PDL_BROADCASTLOOP_START_convolve_readdata { |
0 |
0 |
0 |
| PDL_BROADCASTLOOP_START_convolve_readdata { |
0 |
0 |
0 |
| PDL_BROADCASTLOOP_START_convolve_readdata { |
0 |
0 |
0 |
| PDL_BROADCASTLOOP_START_convolve_readdata { |
0 |
0 |
0 |
| PDL_BROADCASTLOOP_START_convolve_readdata { |
0 |
0 |
0 |
| PDL_BROADCASTLOOP_START_convolve_readdata { |
0 |
0 |
0 |
|
| 282 |
0 |
| PDL_Indx *dimsa = adims_datap; |
| 283 |
0 |
| PDL_Indx *dimsb = bdims_datap; |
| 284 |
0 |
| PDL_Indx andims = __privtrans->ind_sizes[2]; |
| 285 |
0 |
| PDL_Indx bndims = __privtrans->ind_sizes[3]; |
| 286 |
0 |
| PDL_Indx anvals = __privtrans->ind_sizes[0]; |
| 287 |
0 |
| PDL_Indx bnvals = __privtrans->ind_sizes[1]; |
| 288 |
|
| double cc; |
| 289 |
|
| |
| 290 |
0 |
| PDL_Indx i,i2,j,k,n,offcen=0,ncen=0,nrow; |
| 291 |
|
| |
| 292 |
0 |
| PDL_Indx pos[andims]; |
| 293 |
0 |
▶ | for (i=0; i<andims; i++) /* Zero */ |
Branch: 1 branch
| Branch | True | False | Total |
| for (i=0; i<andims; i++) /* Zero */ |
0 |
0 |
0 |
|
| 294 |
0 |
| pos[i]=0; |
| 295 |
|
| |
| 296 |
|
| /* Find middle pixel in b */ |
| 297 |
0 |
| i=0; nrow = dimsb[0]; |
| 298 |
0 |
▶ | while (i<bnvals) { |
Branch: 1 branch
| Branch | True | False | Total |
| while (i<bnvals) { |
0 |
0 |
0 |
|
| 299 |
0 |
▶ | for (j=0; j<nrow; j++) { /* For each row */ |
Branch: 1 branch
| Branch | True | False | Total |
| for (j=0; j<nrow; j++) { /* For each row */ |
0 |
0 |
0 |
|
| 300 |
0 |
| pos[0]=j; |
| 301 |
0 |
▶ | for (k=0; k < bndims; k++) { /* Is centre? */ |
Branch: 1 branch
| Branch | True | False | Total |
| for (k=0; k < bndims; k++) { /* Is centre? */ |
0 |
0 |
0 |
|
| 302 |
0 |
▶ | if (pos[k] != dimsb[k]/2) goto getout_PDL_SByte; |
Branch: 1 branch
| Branch | True | False | Total |
| if (pos[k] != dimsb[k]/2) goto getout_PDL_SByte; |
0 |
0 |
0 |
|
| 303 |
|
| } |
| 304 |
0 |
| ncen = i; |
| 305 |
0 |
| getout_PDL_SByte: i++; |
| 306 |
|
| } |
| 307 |
0 |
| pos[0]=0; |
| 308 |
0 |
| ndim_row_plusplus( pos, dimsb, bndims ); |
| 309 |
|
| } |
| 310 |
|
| |
| 311 |
0 |
▶ | for (i=0; i<andims; i++) /* Zero */ |
Branch: 1 branch
| Branch | True | False | Total |
| for (i=0; i<andims; i++) /* Zero */ |
0 |
0 |
0 |
|
| 312 |
0 |
| pos[i]=0; |
| 313 |
|
| |
| 314 |
|
| /* Initialise offset array to handle the relative coords efficiently */ |
| 315 |
0 |
| PDL_Indx off[bnvals]; /* Offset array */ |
| 316 |
|
| |
| 317 |
0 |
| i=0; |
| 318 |
0 |
▶ | while(i<bnvals) { |
Branch: 1 branch
| Branch | True | False | Total |
| while(i<bnvals) { |
0 |
0 |
0 |
|
| 319 |
0 |
| n = ndim_get_offset(pos, dimsa, andims); /* Start of row in A */ |
| 320 |
0 |
▶ | for (j=0; j<nrow; j++) { /* Fill row */ |
Branch: 1 branch
| Branch | True | False | Total |
| for (j=0; j<nrow; j++) { /* Fill row */ |
0 |
0 |
0 |
|
| 321 |
0 |
| off[i] = n+j; |
| 322 |
0 |
▶ | if (i==ncen) |
Branch: 1 branch
| Branch | True | False | Total |
| if (i==ncen) |
0 |
0 |
0 |
|
| 323 |
0 |
| offcen = off[i]; /* Offset to middle */ |
| 324 |
0 |
| i++; |
| 325 |
|
| } |
| 326 |
0 |
| ndim_row_plusplus( pos, dimsa, andims ); |
| 327 |
|
| } |
| 328 |
|
| |
| 329 |
0 |
▶ | for(i=0;i<bnvals;i++) /* Subtract center offset */ |
Branch: 1 branch
| Branch | True | False | Total |
| for(i=0;i<bnvals;i++) /* Subtract center offset */ |
0 |
0 |
0 |
|
| 330 |
0 |
| off[i]=offcen-off[i]; |
| 331 |
|
| |
| 332 |
|
| /* Now convolve the data */ |
| 333 |
|
| |
| 334 |
0 |
▶ | for(i=0; i<anvals; i++) { |
Branch: 1 branch
| Branch | True | False | Total |
| for(i=0; i<anvals; i++) { |
0 |
0 |
0 |
|
| 335 |
0 |
| cc = 0; |
| 336 |
0 |
▶ | for(j=0; j<bnvals; j++) { |
Branch: 1 branch
| Branch | True | False | Total |
| for(j=0; j<bnvals; j++) { |
0 |
0 |
0 |
|
| 337 |
0 |
| i2 = (i+off[j]+anvals) % anvals ; |
| 338 |
0 |
| cc += (a_datap)[0+(__inc_a_m*(i2))] * (b_datap)[0+(__inc_b_n*(j))] ; |
| 339 |
|
| } |
| 340 |
0 |
| (c_datap)[0+(__inc_c_m*(i))] = cc; |
| 341 |
|
| } |
| 342 |
0 |
▶ | }PDL_BROADCASTLOOP_END_convolve_readdata |
Branch: 2 branches
| Branch | True | False | Total |
| }PDL_BROADCASTLOOP_END_convolve_readdata |
0 |
0 |
0 |
| }PDL_BROADCASTLOOP_END_convolve_readdata |
0 |
0 |
0 |
|
| 343 |
0 |
| } break; |
| 344 |
0 |
| case PDL_B: { |
| 345 |
0 |
▶ | PDL_DECLARE_PARAMS_convolve_1(PDL_Byte,B,PDL_Indx,N,PDL_Indx,N) |
Branch: 15 branches
| Branch | True | False | Total |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Byte,B,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Byte,B,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Byte,B,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Byte,B,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Byte,B,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Byte,B,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Byte,B,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Byte,B,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Byte,B,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Byte,B,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Byte,B,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Byte,B,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Byte,B,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Byte,B,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Byte,B,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
|
| 346 |
0 |
▶ | PDL_BROADCASTLOOP_START_convolve_readdata { |
Branch: 7 branches
| Branch | True | False | Total |
| PDL_BROADCASTLOOP_START_convolve_readdata { |
0 |
0 |
0 |
| PDL_BROADCASTLOOP_START_convolve_readdata { |
0 |
0 |
0 |
| PDL_BROADCASTLOOP_START_convolve_readdata { |
0 |
0 |
0 |
| PDL_BROADCASTLOOP_START_convolve_readdata { |
0 |
0 |
0 |
| PDL_BROADCASTLOOP_START_convolve_readdata { |
0 |
0 |
0 |
| PDL_BROADCASTLOOP_START_convolve_readdata { |
0 |
0 |
0 |
| PDL_BROADCASTLOOP_START_convolve_readdata { |
0 |
0 |
0 |
|
| 347 |
0 |
| PDL_Indx *dimsa = adims_datap; |
| 348 |
0 |
| PDL_Indx *dimsb = bdims_datap; |
| 349 |
0 |
| PDL_Indx andims = __privtrans->ind_sizes[2]; |
| 350 |
0 |
| PDL_Indx bndims = __privtrans->ind_sizes[3]; |
| 351 |
0 |
| PDL_Indx anvals = __privtrans->ind_sizes[0]; |
| 352 |
0 |
| PDL_Indx bnvals = __privtrans->ind_sizes[1]; |
| 353 |
|
| double cc; |
| 354 |
|
| |
| 355 |
0 |
| PDL_Indx i,i2,j,k,n,offcen=0,ncen=0,nrow; |
| 356 |
|
| |
| 357 |
0 |
| PDL_Indx pos[andims]; |
| 358 |
0 |
▶ | for (i=0; i<andims; i++) /* Zero */ |
Branch: 1 branch
| Branch | True | False | Total |
| for (i=0; i<andims; i++) /* Zero */ |
0 |
0 |
0 |
|
| 359 |
0 |
| pos[i]=0; |
| 360 |
|
| |
| 361 |
|
| /* Find middle pixel in b */ |
| 362 |
0 |
| i=0; nrow = dimsb[0]; |
| 363 |
0 |
▶ | while (i<bnvals) { |
Branch: 1 branch
| Branch | True | False | Total |
| while (i<bnvals) { |
0 |
0 |
0 |
|
| 364 |
0 |
▶ | for (j=0; j<nrow; j++) { /* For each row */ |
Branch: 1 branch
| Branch | True | False | Total |
| for (j=0; j<nrow; j++) { /* For each row */ |
0 |
0 |
0 |
|
| 365 |
0 |
| pos[0]=j; |
| 366 |
0 |
▶ | for (k=0; k < bndims; k++) { /* Is centre? */ |
Branch: 1 branch
| Branch | True | False | Total |
| for (k=0; k < bndims; k++) { /* Is centre? */ |
0 |
0 |
0 |
|
| 367 |
0 |
▶ | if (pos[k] != dimsb[k]/2) goto getout_PDL_Byte; |
Branch: 1 branch
| Branch | True | False | Total |
| if (pos[k] != dimsb[k]/2) goto getout_PDL_Byte; |
0 |
0 |
0 |
|
| 368 |
|
| } |
| 369 |
0 |
| ncen = i; |
| 370 |
0 |
| getout_PDL_Byte: i++; |
| 371 |
|
| } |
| 372 |
0 |
| pos[0]=0; |
| 373 |
0 |
| ndim_row_plusplus( pos, dimsb, bndims ); |
| 374 |
|
| } |
| 375 |
|
| |
| 376 |
0 |
▶ | for (i=0; i<andims; i++) /* Zero */ |
Branch: 1 branch
| Branch | True | False | Total |
| for (i=0; i<andims; i++) /* Zero */ |
0 |
0 |
0 |
|
| 377 |
0 |
| pos[i]=0; |
| 378 |
|
| |
| 379 |
|
| /* Initialise offset array to handle the relative coords efficiently */ |
| 380 |
0 |
| PDL_Indx off[bnvals]; /* Offset array */ |
| 381 |
|
| |
| 382 |
0 |
| i=0; |
| 383 |
0 |
▶ | while(i<bnvals) { |
Branch: 1 branch
| Branch | True | False | Total |
| while(i<bnvals) { |
0 |
0 |
0 |
|
| 384 |
0 |
| n = ndim_get_offset(pos, dimsa, andims); /* Start of row in A */ |
| 385 |
0 |
▶ | for (j=0; j<nrow; j++) { /* Fill row */ |
Branch: 1 branch
| Branch | True | False | Total |
| for (j=0; j<nrow; j++) { /* Fill row */ |
0 |
0 |
0 |
|
| 386 |
0 |
| off[i] = n+j; |
| 387 |
0 |
▶ | if (i==ncen) |
Branch: 1 branch
| Branch | True | False | Total |
| if (i==ncen) |
0 |
0 |
0 |
|
| 388 |
0 |
| offcen = off[i]; /* Offset to middle */ |
| 389 |
0 |
| i++; |
| 390 |
|
| } |
| 391 |
0 |
| ndim_row_plusplus( pos, dimsa, andims ); |
| 392 |
|
| } |
| 393 |
|
| |
| 394 |
0 |
▶ | for(i=0;i<bnvals;i++) /* Subtract center offset */ |
Branch: 1 branch
| Branch | True | False | Total |
| for(i=0;i<bnvals;i++) /* Subtract center offset */ |
0 |
0 |
0 |
|
| 395 |
0 |
| off[i]=offcen-off[i]; |
| 396 |
|
| |
| 397 |
|
| /* Now convolve the data */ |
| 398 |
|
| |
| 399 |
0 |
▶ | for(i=0; i<anvals; i++) { |
Branch: 1 branch
| Branch | True | False | Total |
| for(i=0; i<anvals; i++) { |
0 |
0 |
0 |
|
| 400 |
0 |
| cc = 0; |
| 401 |
0 |
▶ | for(j=0; j<bnvals; j++) { |
Branch: 1 branch
| Branch | True | False | Total |
| for(j=0; j<bnvals; j++) { |
0 |
0 |
0 |
|
| 402 |
0 |
| i2 = (i+off[j]+anvals) % anvals ; |
| 403 |
0 |
| cc += (a_datap)[0+(__inc_a_m*(i2))] * (b_datap)[0+(__inc_b_n*(j))] ; |
| 404 |
|
| } |
| 405 |
0 |
| (c_datap)[0+(__inc_c_m*(i))] = cc; |
| 406 |
|
| } |
| 407 |
0 |
▶ | }PDL_BROADCASTLOOP_END_convolve_readdata |
Branch: 2 branches
| Branch | True | False | Total |
| }PDL_BROADCASTLOOP_END_convolve_readdata |
0 |
0 |
0 |
| }PDL_BROADCASTLOOP_END_convolve_readdata |
0 |
0 |
0 |
|
| 408 |
0 |
| } break; |
| 409 |
0 |
| case PDL_S: { |
| 410 |
0 |
▶ | PDL_DECLARE_PARAMS_convolve_1(PDL_Short,S,PDL_Indx,N,PDL_Indx,N) |
Branch: 15 branches
| Branch | True | False | Total |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Short,S,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Short,S,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Short,S,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Short,S,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Short,S,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Short,S,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Short,S,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Short,S,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Short,S,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Short,S,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Short,S,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Short,S,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Short,S,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Short,S,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Short,S,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
|
| 411 |
0 |
▶ | PDL_BROADCASTLOOP_START_convolve_readdata { |
Branch: 7 branches
| Branch | True | False | Total |
| PDL_BROADCASTLOOP_START_convolve_readdata { |
0 |
0 |
0 |
| PDL_BROADCASTLOOP_START_convolve_readdata { |
0 |
0 |
0 |
| PDL_BROADCASTLOOP_START_convolve_readdata { |
0 |
0 |
0 |
| PDL_BROADCASTLOOP_START_convolve_readdata { |
0 |
0 |
0 |
| PDL_BROADCASTLOOP_START_convolve_readdata { |
0 |
0 |
0 |
| PDL_BROADCASTLOOP_START_convolve_readdata { |
0 |
0 |
0 |
| PDL_BROADCASTLOOP_START_convolve_readdata { |
0 |
0 |
0 |
|
| 412 |
0 |
| PDL_Indx *dimsa = adims_datap; |
| 413 |
0 |
| PDL_Indx *dimsb = bdims_datap; |
| 414 |
0 |
| PDL_Indx andims = __privtrans->ind_sizes[2]; |
| 415 |
0 |
| PDL_Indx bndims = __privtrans->ind_sizes[3]; |
| 416 |
0 |
| PDL_Indx anvals = __privtrans->ind_sizes[0]; |
| 417 |
0 |
| PDL_Indx bnvals = __privtrans->ind_sizes[1]; |
| 418 |
|
| double cc; |
| 419 |
|
| |
| 420 |
0 |
| PDL_Indx i,i2,j,k,n,offcen=0,ncen=0,nrow; |
| 421 |
|
| |
| 422 |
0 |
| PDL_Indx pos[andims]; |
| 423 |
0 |
▶ | for (i=0; i<andims; i++) /* Zero */ |
Branch: 1 branch
| Branch | True | False | Total |
| for (i=0; i<andims; i++) /* Zero */ |
0 |
0 |
0 |
|
| 424 |
0 |
| pos[i]=0; |
| 425 |
|
| |
| 426 |
|
| /* Find middle pixel in b */ |
| 427 |
0 |
| i=0; nrow = dimsb[0]; |
| 428 |
0 |
▶ | while (i<bnvals) { |
Branch: 1 branch
| Branch | True | False | Total |
| while (i<bnvals) { |
0 |
0 |
0 |
|
| 429 |
0 |
▶ | for (j=0; j<nrow; j++) { /* For each row */ |
Branch: 1 branch
| Branch | True | False | Total |
| for (j=0; j<nrow; j++) { /* For each row */ |
0 |
0 |
0 |
|
| 430 |
0 |
| pos[0]=j; |
| 431 |
0 |
▶ | for (k=0; k < bndims; k++) { /* Is centre? */ |
Branch: 1 branch
| Branch | True | False | Total |
| for (k=0; k < bndims; k++) { /* Is centre? */ |
0 |
0 |
0 |
|
| 432 |
0 |
▶ | if (pos[k] != dimsb[k]/2) goto getout_PDL_Short; |
Branch: 1 branch
| Branch | True | False | Total |
| if (pos[k] != dimsb[k]/2) goto getout_PDL_Short; |
0 |
0 |
0 |
|
| 433 |
|
| } |
| 434 |
0 |
| ncen = i; |
| 435 |
0 |
| getout_PDL_Short: i++; |
| 436 |
|
| } |
| 437 |
0 |
| pos[0]=0; |
| 438 |
0 |
| ndim_row_plusplus( pos, dimsb, bndims ); |
| 439 |
|
| } |
| 440 |
|
| |
| 441 |
0 |
▶ | for (i=0; i<andims; i++) /* Zero */ |
Branch: 1 branch
| Branch | True | False | Total |
| for (i=0; i<andims; i++) /* Zero */ |
0 |
0 |
0 |
|
| 442 |
0 |
| pos[i]=0; |
| 443 |
|
| |
| 444 |
|
| /* Initialise offset array to handle the relative coords efficiently */ |
| 445 |
0 |
| PDL_Indx off[bnvals]; /* Offset array */ |
| 446 |
|
| |
| 447 |
0 |
| i=0; |
| 448 |
0 |
▶ | while(i<bnvals) { |
Branch: 1 branch
| Branch | True | False | Total |
| while(i<bnvals) { |
0 |
0 |
0 |
|
| 449 |
0 |
| n = ndim_get_offset(pos, dimsa, andims); /* Start of row in A */ |
| 450 |
0 |
▶ | for (j=0; j<nrow; j++) { /* Fill row */ |
Branch: 1 branch
| Branch | True | False | Total |
| for (j=0; j<nrow; j++) { /* Fill row */ |
0 |
0 |
0 |
|
| 451 |
0 |
| off[i] = n+j; |
| 452 |
0 |
▶ | if (i==ncen) |
Branch: 1 branch
| Branch | True | False | Total |
| if (i==ncen) |
0 |
0 |
0 |
|
| 453 |
0 |
| offcen = off[i]; /* Offset to middle */ |
| 454 |
0 |
| i++; |
| 455 |
|
| } |
| 456 |
0 |
| ndim_row_plusplus( pos, dimsa, andims ); |
| 457 |
|
| } |
| 458 |
|
| |
| 459 |
0 |
▶ | for(i=0;i<bnvals;i++) /* Subtract center offset */ |
Branch: 1 branch
| Branch | True | False | Total |
| for(i=0;i<bnvals;i++) /* Subtract center offset */ |
0 |
0 |
0 |
|
| 460 |
0 |
| off[i]=offcen-off[i]; |
| 461 |
|
| |
| 462 |
|
| /* Now convolve the data */ |
| 463 |
|
| |
| 464 |
0 |
▶ | for(i=0; i<anvals; i++) { |
Branch: 1 branch
| Branch | True | False | Total |
| for(i=0; i<anvals; i++) { |
0 |
0 |
0 |
|
| 465 |
0 |
| cc = 0; |
| 466 |
0 |
▶ | for(j=0; j<bnvals; j++) { |
Branch: 1 branch
| Branch | True | False | Total |
| for(j=0; j<bnvals; j++) { |
0 |
0 |
0 |
|
| 467 |
0 |
| i2 = (i+off[j]+anvals) % anvals ; |
| 468 |
0 |
| cc += (a_datap)[0+(__inc_a_m*(i2))] * (b_datap)[0+(__inc_b_n*(j))] ; |
| 469 |
|
| } |
| 470 |
0 |
| (c_datap)[0+(__inc_c_m*(i))] = cc; |
| 471 |
|
| } |
| 472 |
0 |
▶ | }PDL_BROADCASTLOOP_END_convolve_readdata |
Branch: 2 branches
| Branch | True | False | Total |
| }PDL_BROADCASTLOOP_END_convolve_readdata |
0 |
0 |
0 |
| }PDL_BROADCASTLOOP_END_convolve_readdata |
0 |
0 |
0 |
|
| 473 |
0 |
| } break; |
| 474 |
0 |
| case PDL_US: { |
| 475 |
0 |
▶ | PDL_DECLARE_PARAMS_convolve_1(PDL_Ushort,U,PDL_Indx,N,PDL_Indx,N) |
Branch: 15 branches
| Branch | True | False | Total |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Ushort,U,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Ushort,U,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Ushort,U,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Ushort,U,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Ushort,U,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Ushort,U,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Ushort,U,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Ushort,U,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Ushort,U,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Ushort,U,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Ushort,U,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Ushort,U,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Ushort,U,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Ushort,U,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Ushort,U,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
|
| 476 |
0 |
▶ | PDL_BROADCASTLOOP_START_convolve_readdata { |
Branch: 7 branches
| Branch | True | False | Total |
| PDL_BROADCASTLOOP_START_convolve_readdata { |
0 |
0 |
0 |
| PDL_BROADCASTLOOP_START_convolve_readdata { |
0 |
0 |
0 |
| PDL_BROADCASTLOOP_START_convolve_readdata { |
0 |
0 |
0 |
| PDL_BROADCASTLOOP_START_convolve_readdata { |
0 |
0 |
0 |
| PDL_BROADCASTLOOP_START_convolve_readdata { |
0 |
0 |
0 |
| PDL_BROADCASTLOOP_START_convolve_readdata { |
0 |
0 |
0 |
| PDL_BROADCASTLOOP_START_convolve_readdata { |
0 |
0 |
0 |
|
| 477 |
0 |
| PDL_Indx *dimsa = adims_datap; |
| 478 |
0 |
| PDL_Indx *dimsb = bdims_datap; |
| 479 |
0 |
| PDL_Indx andims = __privtrans->ind_sizes[2]; |
| 480 |
0 |
| PDL_Indx bndims = __privtrans->ind_sizes[3]; |
| 481 |
0 |
| PDL_Indx anvals = __privtrans->ind_sizes[0]; |
| 482 |
0 |
| PDL_Indx bnvals = __privtrans->ind_sizes[1]; |
| 483 |
|
| double cc; |
| 484 |
|
| |
| 485 |
0 |
| PDL_Indx i,i2,j,k,n,offcen=0,ncen=0,nrow; |
| 486 |
|
| |
| 487 |
0 |
| PDL_Indx pos[andims]; |
| 488 |
0 |
▶ | for (i=0; i<andims; i++) /* Zero */ |
Branch: 1 branch
| Branch | True | False | Total |
| for (i=0; i<andims; i++) /* Zero */ |
0 |
0 |
0 |
|
| 489 |
0 |
| pos[i]=0; |
| 490 |
|
| |
| 491 |
|
| /* Find middle pixel in b */ |
| 492 |
0 |
| i=0; nrow = dimsb[0]; |
| 493 |
0 |
▶ | while (i<bnvals) { |
Branch: 1 branch
| Branch | True | False | Total |
| while (i<bnvals) { |
0 |
0 |
0 |
|
| 494 |
0 |
▶ | for (j=0; j<nrow; j++) { /* For each row */ |
Branch: 1 branch
| Branch | True | False | Total |
| for (j=0; j<nrow; j++) { /* For each row */ |
0 |
0 |
0 |
|
| 495 |
0 |
| pos[0]=j; |
| 496 |
0 |
▶ | for (k=0; k < bndims; k++) { /* Is centre? */ |
Branch: 1 branch
| Branch | True | False | Total |
| for (k=0; k < bndims; k++) { /* Is centre? */ |
0 |
0 |
0 |
|
| 497 |
0 |
▶ | if (pos[k] != dimsb[k]/2) goto getout_PDL_Ushort; |
Branch: 1 branch
| Branch | True | False | Total |
| if (pos[k] != dimsb[k]/2) goto getout_PDL_Ushort; |
0 |
0 |
0 |
|
| 498 |
|
| } |
| 499 |
0 |
| ncen = i; |
| 500 |
0 |
| getout_PDL_Ushort: i++; |
| 501 |
|
| } |
| 502 |
0 |
| pos[0]=0; |
| 503 |
0 |
| ndim_row_plusplus( pos, dimsb, bndims ); |
| 504 |
|
| } |
| 505 |
|
| |
| 506 |
0 |
▶ | for (i=0; i<andims; i++) /* Zero */ |
Branch: 1 branch
| Branch | True | False | Total |
| for (i=0; i<andims; i++) /* Zero */ |
0 |
0 |
0 |
|
| 507 |
0 |
| pos[i]=0; |
| 508 |
|
| |
| 509 |
|
| /* Initialise offset array to handle the relative coords efficiently */ |
| 510 |
0 |
| PDL_Indx off[bnvals]; /* Offset array */ |
| 511 |
|
| |
| 512 |
0 |
| i=0; |
| 513 |
0 |
▶ | while(i<bnvals) { |
Branch: 1 branch
| Branch | True | False | Total |
| while(i<bnvals) { |
0 |
0 |
0 |
|
| 514 |
0 |
| n = ndim_get_offset(pos, dimsa, andims); /* Start of row in A */ |
| 515 |
0 |
▶ | for (j=0; j<nrow; j++) { /* Fill row */ |
Branch: 1 branch
| Branch | True | False | Total |
| for (j=0; j<nrow; j++) { /* Fill row */ |
0 |
0 |
0 |
|
| 516 |
0 |
| off[i] = n+j; |
| 517 |
0 |
▶ | if (i==ncen) |
Branch: 1 branch
| Branch | True | False | Total |
| if (i==ncen) |
0 |
0 |
0 |
|
| 518 |
0 |
| offcen = off[i]; /* Offset to middle */ |
| 519 |
0 |
| i++; |
| 520 |
|
| } |
| 521 |
0 |
| ndim_row_plusplus( pos, dimsa, andims ); |
| 522 |
|
| } |
| 523 |
|
| |
| 524 |
0 |
▶ | for(i=0;i<bnvals;i++) /* Subtract center offset */ |
Branch: 1 branch
| Branch | True | False | Total |
| for(i=0;i<bnvals;i++) /* Subtract center offset */ |
0 |
0 |
0 |
|
| 525 |
0 |
| off[i]=offcen-off[i]; |
| 526 |
|
| |
| 527 |
|
| /* Now convolve the data */ |
| 528 |
|
| |
| 529 |
0 |
▶ | for(i=0; i<anvals; i++) { |
Branch: 1 branch
| Branch | True | False | Total |
| for(i=0; i<anvals; i++) { |
0 |
0 |
0 |
|
| 530 |
0 |
| cc = 0; |
| 531 |
0 |
▶ | for(j=0; j<bnvals; j++) { |
Branch: 1 branch
| Branch | True | False | Total |
| for(j=0; j<bnvals; j++) { |
0 |
0 |
0 |
|
| 532 |
0 |
| i2 = (i+off[j]+anvals) % anvals ; |
| 533 |
0 |
| cc += (a_datap)[0+(__inc_a_m*(i2))] * (b_datap)[0+(__inc_b_n*(j))] ; |
| 534 |
|
| } |
| 535 |
0 |
| (c_datap)[0+(__inc_c_m*(i))] = cc; |
| 536 |
|
| } |
| 537 |
0 |
▶ | }PDL_BROADCASTLOOP_END_convolve_readdata |
Branch: 2 branches
| Branch | True | False | Total |
| }PDL_BROADCASTLOOP_END_convolve_readdata |
0 |
0 |
0 |
| }PDL_BROADCASTLOOP_END_convolve_readdata |
0 |
0 |
0 |
|
| 538 |
0 |
| } break; |
| 539 |
0 |
| case PDL_L: { |
| 540 |
0 |
▶ | PDL_DECLARE_PARAMS_convolve_1(PDL_Long,L,PDL_Indx,N,PDL_Indx,N) |
Branch: 15 branches
| Branch | True | False | Total |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Long,L,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Long,L,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Long,L,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Long,L,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Long,L,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Long,L,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Long,L,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Long,L,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Long,L,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Long,L,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Long,L,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Long,L,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Long,L,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Long,L,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Long,L,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
|
| 541 |
0 |
▶ | PDL_BROADCASTLOOP_START_convolve_readdata { |
Branch: 7 branches
| Branch | True | False | Total |
| PDL_BROADCASTLOOP_START_convolve_readdata { |
0 |
0 |
0 |
| PDL_BROADCASTLOOP_START_convolve_readdata { |
0 |
0 |
0 |
| PDL_BROADCASTLOOP_START_convolve_readdata { |
0 |
0 |
0 |
| PDL_BROADCASTLOOP_START_convolve_readdata { |
0 |
0 |
0 |
| PDL_BROADCASTLOOP_START_convolve_readdata { |
0 |
0 |
0 |
| PDL_BROADCASTLOOP_START_convolve_readdata { |
0 |
0 |
0 |
| PDL_BROADCASTLOOP_START_convolve_readdata { |
0 |
0 |
0 |
|
| 542 |
0 |
| PDL_Indx *dimsa = adims_datap; |
| 543 |
0 |
| PDL_Indx *dimsb = bdims_datap; |
| 544 |
0 |
| PDL_Indx andims = __privtrans->ind_sizes[2]; |
| 545 |
0 |
| PDL_Indx bndims = __privtrans->ind_sizes[3]; |
| 546 |
0 |
| PDL_Indx anvals = __privtrans->ind_sizes[0]; |
| 547 |
0 |
| PDL_Indx bnvals = __privtrans->ind_sizes[1]; |
| 548 |
|
| double cc; |
| 549 |
|
| |
| 550 |
0 |
| PDL_Indx i,i2,j,k,n,offcen=0,ncen=0,nrow; |
| 551 |
|
| |
| 552 |
0 |
| PDL_Indx pos[andims]; |
| 553 |
0 |
▶ | for (i=0; i<andims; i++) /* Zero */ |
Branch: 1 branch
| Branch | True | False | Total |
| for (i=0; i<andims; i++) /* Zero */ |
0 |
0 |
0 |
|
| 554 |
0 |
| pos[i]=0; |
| 555 |
|
| |
| 556 |
|
| /* Find middle pixel in b */ |
| 557 |
0 |
| i=0; nrow = dimsb[0]; |
| 558 |
0 |
▶ | while (i<bnvals) { |
Branch: 1 branch
| Branch | True | False | Total |
| while (i<bnvals) { |
0 |
0 |
0 |
|
| 559 |
0 |
▶ | for (j=0; j<nrow; j++) { /* For each row */ |
Branch: 1 branch
| Branch | True | False | Total |
| for (j=0; j<nrow; j++) { /* For each row */ |
0 |
0 |
0 |
|
| 560 |
0 |
| pos[0]=j; |
| 561 |
0 |
▶ | for (k=0; k < bndims; k++) { /* Is centre? */ |
Branch: 1 branch
| Branch | True | False | Total |
| for (k=0; k < bndims; k++) { /* Is centre? */ |
0 |
0 |
0 |
|
| 562 |
0 |
▶ | if (pos[k] != dimsb[k]/2) goto getout_PDL_Long; |
Branch: 1 branch
| Branch | True | False | Total |
| if (pos[k] != dimsb[k]/2) goto getout_PDL_Long; |
0 |
0 |
0 |
|
| 563 |
|
| } |
| 564 |
0 |
| ncen = i; |
| 565 |
0 |
| getout_PDL_Long: i++; |
| 566 |
|
| } |
| 567 |
0 |
| pos[0]=0; |
| 568 |
0 |
| ndim_row_plusplus( pos, dimsb, bndims ); |
| 569 |
|
| } |
| 570 |
|
| |
| 571 |
0 |
▶ | for (i=0; i<andims; i++) /* Zero */ |
Branch: 1 branch
| Branch | True | False | Total |
| for (i=0; i<andims; i++) /* Zero */ |
0 |
0 |
0 |
|
| 572 |
0 |
| pos[i]=0; |
| 573 |
|
| |
| 574 |
|
| /* Initialise offset array to handle the relative coords efficiently */ |
| 575 |
0 |
| PDL_Indx off[bnvals]; /* Offset array */ |
| 576 |
|
| |
| 577 |
0 |
| i=0; |
| 578 |
0 |
▶ | while(i<bnvals) { |
Branch: 1 branch
| Branch | True | False | Total |
| while(i<bnvals) { |
0 |
0 |
0 |
|
| 579 |
0 |
| n = ndim_get_offset(pos, dimsa, andims); /* Start of row in A */ |
| 580 |
0 |
▶ | for (j=0; j<nrow; j++) { /* Fill row */ |
Branch: 1 branch
| Branch | True | False | Total |
| for (j=0; j<nrow; j++) { /* Fill row */ |
0 |
0 |
0 |
|
| 581 |
0 |
| off[i] = n+j; |
| 582 |
0 |
▶ | if (i==ncen) |
Branch: 1 branch
| Branch | True | False | Total |
| if (i==ncen) |
0 |
0 |
0 |
|
| 583 |
0 |
| offcen = off[i]; /* Offset to middle */ |
| 584 |
0 |
| i++; |
| 585 |
|
| } |
| 586 |
0 |
| ndim_row_plusplus( pos, dimsa, andims ); |
| 587 |
|
| } |
| 588 |
|
| |
| 589 |
0 |
▶ | for(i=0;i<bnvals;i++) /* Subtract center offset */ |
Branch: 1 branch
| Branch | True | False | Total |
| for(i=0;i<bnvals;i++) /* Subtract center offset */ |
0 |
0 |
0 |
|
| 590 |
0 |
| off[i]=offcen-off[i]; |
| 591 |
|
| |
| 592 |
|
| /* Now convolve the data */ |
| 593 |
|
| |
| 594 |
0 |
▶ | for(i=0; i<anvals; i++) { |
Branch: 1 branch
| Branch | True | False | Total |
| for(i=0; i<anvals; i++) { |
0 |
0 |
0 |
|
| 595 |
0 |
| cc = 0; |
| 596 |
0 |
▶ | for(j=0; j<bnvals; j++) { |
Branch: 1 branch
| Branch | True | False | Total |
| for(j=0; j<bnvals; j++) { |
0 |
0 |
0 |
|
| 597 |
0 |
| i2 = (i+off[j]+anvals) % anvals ; |
| 598 |
0 |
| cc += (a_datap)[0+(__inc_a_m*(i2))] * (b_datap)[0+(__inc_b_n*(j))] ; |
| 599 |
|
| } |
| 600 |
0 |
| (c_datap)[0+(__inc_c_m*(i))] = cc; |
| 601 |
|
| } |
| 602 |
0 |
▶ | }PDL_BROADCASTLOOP_END_convolve_readdata |
Branch: 2 branches
| Branch | True | False | Total |
| }PDL_BROADCASTLOOP_END_convolve_readdata |
0 |
0 |
0 |
| }PDL_BROADCASTLOOP_END_convolve_readdata |
0 |
0 |
0 |
|
| 603 |
0 |
| } break; |
| 604 |
0 |
| case PDL_UL: { |
| 605 |
0 |
▶ | PDL_DECLARE_PARAMS_convolve_1(PDL_ULong,K,PDL_Indx,N,PDL_Indx,N) |
Branch: 15 branches
| Branch | True | False | Total |
| PDL_DECLARE_PARAMS_convolve_1(PDL_ULong,K,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_ULong,K,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_ULong,K,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_ULong,K,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_ULong,K,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_ULong,K,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_ULong,K,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_ULong,K,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_ULong,K,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_ULong,K,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_ULong,K,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_ULong,K,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_ULong,K,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_ULong,K,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_ULong,K,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
|
| 606 |
0 |
▶ | PDL_BROADCASTLOOP_START_convolve_readdata { |
Branch: 7 branches
| Branch | True | False | Total |
| PDL_BROADCASTLOOP_START_convolve_readdata { |
0 |
0 |
0 |
| PDL_BROADCASTLOOP_START_convolve_readdata { |
0 |
0 |
0 |
| PDL_BROADCASTLOOP_START_convolve_readdata { |
0 |
0 |
0 |
| PDL_BROADCASTLOOP_START_convolve_readdata { |
0 |
0 |
0 |
| PDL_BROADCASTLOOP_START_convolve_readdata { |
0 |
0 |
0 |
| PDL_BROADCASTLOOP_START_convolve_readdata { |
0 |
0 |
0 |
| PDL_BROADCASTLOOP_START_convolve_readdata { |
0 |
0 |
0 |
|
| 607 |
0 |
| PDL_Indx *dimsa = adims_datap; |
| 608 |
0 |
| PDL_Indx *dimsb = bdims_datap; |
| 609 |
0 |
| PDL_Indx andims = __privtrans->ind_sizes[2]; |
| 610 |
0 |
| PDL_Indx bndims = __privtrans->ind_sizes[3]; |
| 611 |
0 |
| PDL_Indx anvals = __privtrans->ind_sizes[0]; |
| 612 |
0 |
| PDL_Indx bnvals = __privtrans->ind_sizes[1]; |
| 613 |
|
| double cc; |
| 614 |
|
| |
| 615 |
0 |
| PDL_Indx i,i2,j,k,n,offcen=0,ncen=0,nrow; |
| 616 |
|
| |
| 617 |
0 |
| PDL_Indx pos[andims]; |
| 618 |
0 |
▶ | for (i=0; i<andims; i++) /* Zero */ |
Branch: 1 branch
| Branch | True | False | Total |
| for (i=0; i<andims; i++) /* Zero */ |
0 |
0 |
0 |
|
| 619 |
0 |
| pos[i]=0; |
| 620 |
|
| |
| 621 |
|
| /* Find middle pixel in b */ |
| 622 |
0 |
| i=0; nrow = dimsb[0]; |
| 623 |
0 |
▶ | while (i<bnvals) { |
Branch: 1 branch
| Branch | True | False | Total |
| while (i<bnvals) { |
0 |
0 |
0 |
|
| 624 |
0 |
▶ | for (j=0; j<nrow; j++) { /* For each row */ |
Branch: 1 branch
| Branch | True | False | Total |
| for (j=0; j<nrow; j++) { /* For each row */ |
0 |
0 |
0 |
|
| 625 |
0 |
| pos[0]=j; |
| 626 |
0 |
▶ | for (k=0; k < bndims; k++) { /* Is centre? */ |
Branch: 1 branch
| Branch | True | False | Total |
| for (k=0; k < bndims; k++) { /* Is centre? */ |
0 |
0 |
0 |
|
| 627 |
0 |
▶ | if (pos[k] != dimsb[k]/2) goto getout_PDL_ULong; |
Branch: 1 branch
| Branch | True | False | Total |
| if (pos[k] != dimsb[k]/2) goto getout_PDL_ULong; |
0 |
0 |
0 |
|
| 628 |
|
| } |
| 629 |
0 |
| ncen = i; |
| 630 |
0 |
| getout_PDL_ULong: i++; |
| 631 |
|
| } |
| 632 |
0 |
| pos[0]=0; |
| 633 |
0 |
| ndim_row_plusplus( pos, dimsb, bndims ); |
| 634 |
|
| } |
| 635 |
|
| |
| 636 |
0 |
▶ | for (i=0; i<andims; i++) /* Zero */ |
Branch: 1 branch
| Branch | True | False | Total |
| for (i=0; i<andims; i++) /* Zero */ |
0 |
0 |
0 |
|
| 637 |
0 |
| pos[i]=0; |
| 638 |
|
| |
| 639 |
|
| /* Initialise offset array to handle the relative coords efficiently */ |
| 640 |
0 |
| PDL_Indx off[bnvals]; /* Offset array */ |
| 641 |
|
| |
| 642 |
0 |
| i=0; |
| 643 |
0 |
▶ | while(i<bnvals) { |
Branch: 1 branch
| Branch | True | False | Total |
| while(i<bnvals) { |
0 |
0 |
0 |
|
| 644 |
0 |
| n = ndim_get_offset(pos, dimsa, andims); /* Start of row in A */ |
| 645 |
0 |
▶ | for (j=0; j<nrow; j++) { /* Fill row */ |
Branch: 1 branch
| Branch | True | False | Total |
| for (j=0; j<nrow; j++) { /* Fill row */ |
0 |
0 |
0 |
|
| 646 |
0 |
| off[i] = n+j; |
| 647 |
0 |
▶ | if (i==ncen) |
Branch: 1 branch
| Branch | True | False | Total |
| if (i==ncen) |
0 |
0 |
0 |
|
| 648 |
0 |
| offcen = off[i]; /* Offset to middle */ |
| 649 |
0 |
| i++; |
| 650 |
|
| } |
| 651 |
0 |
| ndim_row_plusplus( pos, dimsa, andims ); |
| 652 |
|
| } |
| 653 |
|
| |
| 654 |
0 |
▶ | for(i=0;i<bnvals;i++) /* Subtract center offset */ |
Branch: 1 branch
| Branch | True | False | Total |
| for(i=0;i<bnvals;i++) /* Subtract center offset */ |
0 |
0 |
0 |
|
| 655 |
0 |
| off[i]=offcen-off[i]; |
| 656 |
|
| |
| 657 |
|
| /* Now convolve the data */ |
| 658 |
|
| |
| 659 |
0 |
▶ | for(i=0; i<anvals; i++) { |
Branch: 1 branch
| Branch | True | False | Total |
| for(i=0; i<anvals; i++) { |
0 |
0 |
0 |
|
| 660 |
0 |
| cc = 0; |
| 661 |
0 |
▶ | for(j=0; j<bnvals; j++) { |
Branch: 1 branch
| Branch | True | False | Total |
| for(j=0; j<bnvals; j++) { |
0 |
0 |
0 |
|
| 662 |
0 |
| i2 = (i+off[j]+anvals) % anvals ; |
| 663 |
0 |
| cc += (a_datap)[0+(__inc_a_m*(i2))] * (b_datap)[0+(__inc_b_n*(j))] ; |
| 664 |
|
| } |
| 665 |
0 |
| (c_datap)[0+(__inc_c_m*(i))] = cc; |
| 666 |
|
| } |
| 667 |
0 |
▶ | }PDL_BROADCASTLOOP_END_convolve_readdata |
Branch: 2 branches
| Branch | True | False | Total |
| }PDL_BROADCASTLOOP_END_convolve_readdata |
0 |
0 |
0 |
| }PDL_BROADCASTLOOP_END_convolve_readdata |
0 |
0 |
0 |
|
| 668 |
0 |
| } break; |
| 669 |
0 |
| case PDL_IND: { |
| 670 |
0 |
▶ | PDL_DECLARE_PARAMS_convolve_1(PDL_Indx,N,PDL_Indx,N,PDL_Indx,N) |
Branch: 15 branches
| Branch | True | False | Total |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Indx,N,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Indx,N,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Indx,N,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Indx,N,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Indx,N,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Indx,N,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Indx,N,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Indx,N,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Indx,N,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Indx,N,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Indx,N,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Indx,N,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Indx,N,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Indx,N,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Indx,N,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
|
| 671 |
0 |
▶ | PDL_BROADCASTLOOP_START_convolve_readdata { |
Branch: 7 branches
| Branch | True | False | Total |
| PDL_BROADCASTLOOP_START_convolve_readdata { |
0 |
0 |
0 |
| PDL_BROADCASTLOOP_START_convolve_readdata { |
0 |
0 |
0 |
| PDL_BROADCASTLOOP_START_convolve_readdata { |
0 |
0 |
0 |
| PDL_BROADCASTLOOP_START_convolve_readdata { |
0 |
0 |
0 |
| PDL_BROADCASTLOOP_START_convolve_readdata { |
0 |
0 |
0 |
| PDL_BROADCASTLOOP_START_convolve_readdata { |
0 |
0 |
0 |
| PDL_BROADCASTLOOP_START_convolve_readdata { |
0 |
0 |
0 |
|
| 672 |
0 |
| PDL_Indx *dimsa = adims_datap; |
| 673 |
0 |
| PDL_Indx *dimsb = bdims_datap; |
| 674 |
0 |
| PDL_Indx andims = __privtrans->ind_sizes[2]; |
| 675 |
0 |
| PDL_Indx bndims = __privtrans->ind_sizes[3]; |
| 676 |
0 |
| PDL_Indx anvals = __privtrans->ind_sizes[0]; |
| 677 |
0 |
| PDL_Indx bnvals = __privtrans->ind_sizes[1]; |
| 678 |
|
| double cc; |
| 679 |
|
| |
| 680 |
0 |
| PDL_Indx i,i2,j,k,n,offcen=0,ncen=0,nrow; |
| 681 |
|
| |
| 682 |
0 |
| PDL_Indx pos[andims]; |
| 683 |
0 |
▶ | for (i=0; i<andims; i++) /* Zero */ |
Branch: 1 branch
| Branch | True | False | Total |
| for (i=0; i<andims; i++) /* Zero */ |
0 |
0 |
0 |
|
| 684 |
0 |
| pos[i]=0; |
| 685 |
|
| |
| 686 |
|
| /* Find middle pixel in b */ |
| 687 |
0 |
| i=0; nrow = dimsb[0]; |
| 688 |
0 |
▶ | while (i<bnvals) { |
Branch: 1 branch
| Branch | True | False | Total |
| while (i<bnvals) { |
0 |
0 |
0 |
|
| 689 |
0 |
▶ | for (j=0; j<nrow; j++) { /* For each row */ |
Branch: 1 branch
| Branch | True | False | Total |
| for (j=0; j<nrow; j++) { /* For each row */ |
0 |
0 |
0 |
|
| 690 |
0 |
| pos[0]=j; |
| 691 |
0 |
▶ | for (k=0; k < bndims; k++) { /* Is centre? */ |
Branch: 1 branch
| Branch | True | False | Total |
| for (k=0; k < bndims; k++) { /* Is centre? */ |
0 |
0 |
0 |
|
| 692 |
0 |
▶ | if (pos[k] != dimsb[k]/2) goto getout_PDL_Indx; |
Branch: 1 branch
| Branch | True | False | Total |
| if (pos[k] != dimsb[k]/2) goto getout_PDL_Indx; |
0 |
0 |
0 |
|
| 693 |
|
| } |
| 694 |
0 |
| ncen = i; |
| 695 |
0 |
| getout_PDL_Indx: i++; |
| 696 |
|
| } |
| 697 |
0 |
| pos[0]=0; |
| 698 |
0 |
| ndim_row_plusplus( pos, dimsb, bndims ); |
| 699 |
|
| } |
| 700 |
|
| |
| 701 |
0 |
▶ | for (i=0; i<andims; i++) /* Zero */ |
Branch: 1 branch
| Branch | True | False | Total |
| for (i=0; i<andims; i++) /* Zero */ |
0 |
0 |
0 |
|
| 702 |
0 |
| pos[i]=0; |
| 703 |
|
| |
| 704 |
|
| /* Initialise offset array to handle the relative coords efficiently */ |
| 705 |
0 |
| PDL_Indx off[bnvals]; /* Offset array */ |
| 706 |
|
| |
| 707 |
0 |
| i=0; |
| 708 |
0 |
▶ | while(i<bnvals) { |
Branch: 1 branch
| Branch | True | False | Total |
| while(i<bnvals) { |
0 |
0 |
0 |
|
| 709 |
0 |
| n = ndim_get_offset(pos, dimsa, andims); /* Start of row in A */ |
| 710 |
0 |
▶ | for (j=0; j<nrow; j++) { /* Fill row */ |
Branch: 1 branch
| Branch | True | False | Total |
| for (j=0; j<nrow; j++) { /* Fill row */ |
0 |
0 |
0 |
|
| 711 |
0 |
| off[i] = n+j; |
| 712 |
0 |
▶ | if (i==ncen) |
Branch: 1 branch
| Branch | True | False | Total |
| if (i==ncen) |
0 |
0 |
0 |
|
| 713 |
0 |
| offcen = off[i]; /* Offset to middle */ |
| 714 |
0 |
| i++; |
| 715 |
|
| } |
| 716 |
0 |
| ndim_row_plusplus( pos, dimsa, andims ); |
| 717 |
|
| } |
| 718 |
|
| |
| 719 |
0 |
▶ | for(i=0;i<bnvals;i++) /* Subtract center offset */ |
Branch: 1 branch
| Branch | True | False | Total |
| for(i=0;i<bnvals;i++) /* Subtract center offset */ |
0 |
0 |
0 |
|
| 720 |
0 |
| off[i]=offcen-off[i]; |
| 721 |
|
| |
| 722 |
|
| /* Now convolve the data */ |
| 723 |
|
| |
| 724 |
0 |
▶ | for(i=0; i<anvals; i++) { |
Branch: 1 branch
| Branch | True | False | Total |
| for(i=0; i<anvals; i++) { |
0 |
0 |
0 |
|
| 725 |
0 |
| cc = 0; |
| 726 |
0 |
▶ | for(j=0; j<bnvals; j++) { |
Branch: 1 branch
| Branch | True | False | Total |
| for(j=0; j<bnvals; j++) { |
0 |
0 |
0 |
|
| 727 |
0 |
| i2 = (i+off[j]+anvals) % anvals ; |
| 728 |
0 |
| cc += (a_datap)[0+(__inc_a_m*(i2))] * (b_datap)[0+(__inc_b_n*(j))] ; |
| 729 |
|
| } |
| 730 |
0 |
| (c_datap)[0+(__inc_c_m*(i))] = cc; |
| 731 |
|
| } |
| 732 |
0 |
▶ | }PDL_BROADCASTLOOP_END_convolve_readdata |
Branch: 2 branches
| Branch | True | False | Total |
| }PDL_BROADCASTLOOP_END_convolve_readdata |
0 |
0 |
0 |
| }PDL_BROADCASTLOOP_END_convolve_readdata |
0 |
0 |
0 |
|
| 733 |
0 |
| } break; |
| 734 |
0 |
| case PDL_ULL: { |
| 735 |
0 |
▶ | PDL_DECLARE_PARAMS_convolve_1(PDL_ULongLong,P,PDL_Indx,N,PDL_Indx,N) |
Branch: 15 branches
| Branch | True | False | Total |
| PDL_DECLARE_PARAMS_convolve_1(PDL_ULongLong,P,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_ULongLong,P,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_ULongLong,P,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_ULongLong,P,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_ULongLong,P,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_ULongLong,P,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_ULongLong,P,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_ULongLong,P,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_ULongLong,P,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_ULongLong,P,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_ULongLong,P,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_ULongLong,P,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_ULongLong,P,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_ULongLong,P,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_ULongLong,P,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
|
| 736 |
0 |
▶ | PDL_BROADCASTLOOP_START_convolve_readdata { |
Branch: 7 branches
| Branch | True | False | Total |
| PDL_BROADCASTLOOP_START_convolve_readdata { |
0 |
0 |
0 |
| PDL_BROADCASTLOOP_START_convolve_readdata { |
0 |
0 |
0 |
| PDL_BROADCASTLOOP_START_convolve_readdata { |
0 |
0 |
0 |
| PDL_BROADCASTLOOP_START_convolve_readdata { |
0 |
0 |
0 |
| PDL_BROADCASTLOOP_START_convolve_readdata { |
0 |
0 |
0 |
| PDL_BROADCASTLOOP_START_convolve_readdata { |
0 |
0 |
0 |
| PDL_BROADCASTLOOP_START_convolve_readdata { |
0 |
0 |
0 |
|
| 737 |
0 |
| PDL_Indx *dimsa = adims_datap; |
| 738 |
0 |
| PDL_Indx *dimsb = bdims_datap; |
| 739 |
0 |
| PDL_Indx andims = __privtrans->ind_sizes[2]; |
| 740 |
0 |
| PDL_Indx bndims = __privtrans->ind_sizes[3]; |
| 741 |
0 |
| PDL_Indx anvals = __privtrans->ind_sizes[0]; |
| 742 |
0 |
| PDL_Indx bnvals = __privtrans->ind_sizes[1]; |
| 743 |
|
| double cc; |
| 744 |
|
| |
| 745 |
0 |
| PDL_Indx i,i2,j,k,n,offcen=0,ncen=0,nrow; |
| 746 |
|
| |
| 747 |
0 |
| PDL_Indx pos[andims]; |
| 748 |
0 |
▶ | for (i=0; i<andims; i++) /* Zero */ |
Branch: 1 branch
| Branch | True | False | Total |
| for (i=0; i<andims; i++) /* Zero */ |
0 |
0 |
0 |
|
| 749 |
0 |
| pos[i]=0; |
| 750 |
|
| |
| 751 |
|
| /* Find middle pixel in b */ |
| 752 |
0 |
| i=0; nrow = dimsb[0]; |
| 753 |
0 |
▶ | while (i<bnvals) { |
Branch: 1 branch
| Branch | True | False | Total |
| while (i<bnvals) { |
0 |
0 |
0 |
|
| 754 |
0 |
▶ | for (j=0; j<nrow; j++) { /* For each row */ |
Branch: 1 branch
| Branch | True | False | Total |
| for (j=0; j<nrow; j++) { /* For each row */ |
0 |
0 |
0 |
|
| 755 |
0 |
| pos[0]=j; |
| 756 |
0 |
▶ | for (k=0; k < bndims; k++) { /* Is centre? */ |
Branch: 1 branch
| Branch | True | False | Total |
| for (k=0; k < bndims; k++) { /* Is centre? */ |
0 |
0 |
0 |
|
| 757 |
0 |
▶ | if (pos[k] != dimsb[k]/2) goto getout_PDL_ULongLong; |
Branch: 1 branch
| Branch | True | False | Total |
| if (pos[k] != dimsb[k]/2) goto getout_PDL_ULongLong; |
0 |
0 |
0 |
|
| 758 |
|
| } |
| 759 |
0 |
| ncen = i; |
| 760 |
0 |
| getout_PDL_ULongLong: i++; |
| 761 |
|
| } |
| 762 |
0 |
| pos[0]=0; |
| 763 |
0 |
| ndim_row_plusplus( pos, dimsb, bndims ); |
| 764 |
|
| } |
| 765 |
|
| |
| 766 |
0 |
▶ | for (i=0; i<andims; i++) /* Zero */ |
Branch: 1 branch
| Branch | True | False | Total |
| for (i=0; i<andims; i++) /* Zero */ |
0 |
0 |
0 |
|
| 767 |
0 |
| pos[i]=0; |
| 768 |
|
| |
| 769 |
|
| /* Initialise offset array to handle the relative coords efficiently */ |
| 770 |
0 |
| PDL_Indx off[bnvals]; /* Offset array */ |
| 771 |
|
| |
| 772 |
0 |
| i=0; |
| 773 |
0 |
▶ | while(i<bnvals) { |
Branch: 1 branch
| Branch | True | False | Total |
| while(i<bnvals) { |
0 |
0 |
0 |
|
| 774 |
0 |
| n = ndim_get_offset(pos, dimsa, andims); /* Start of row in A */ |
| 775 |
0 |
▶ | for (j=0; j<nrow; j++) { /* Fill row */ |
Branch: 1 branch
| Branch | True | False | Total |
| for (j=0; j<nrow; j++) { /* Fill row */ |
0 |
0 |
0 |
|
| 776 |
0 |
| off[i] = n+j; |
| 777 |
0 |
▶ | if (i==ncen) |
Branch: 1 branch
| Branch | True | False | Total |
| if (i==ncen) |
0 |
0 |
0 |
|
| 778 |
0 |
| offcen = off[i]; /* Offset to middle */ |
| 779 |
0 |
| i++; |
| 780 |
|
| } |
| 781 |
0 |
| ndim_row_plusplus( pos, dimsa, andims ); |
| 782 |
|
| } |
| 783 |
|
| |
| 784 |
0 |
▶ | for(i=0;i<bnvals;i++) /* Subtract center offset */ |
Branch: 1 branch
| Branch | True | False | Total |
| for(i=0;i<bnvals;i++) /* Subtract center offset */ |
0 |
0 |
0 |
|
| 785 |
0 |
| off[i]=offcen-off[i]; |
| 786 |
|
| |
| 787 |
|
| /* Now convolve the data */ |
| 788 |
|
| |
| 789 |
0 |
▶ | for(i=0; i<anvals; i++) { |
Branch: 1 branch
| Branch | True | False | Total |
| for(i=0; i<anvals; i++) { |
0 |
0 |
0 |
|
| 790 |
0 |
| cc = 0; |
| 791 |
0 |
▶ | for(j=0; j<bnvals; j++) { |
Branch: 1 branch
| Branch | True | False | Total |
| for(j=0; j<bnvals; j++) { |
0 |
0 |
0 |
|
| 792 |
0 |
| i2 = (i+off[j]+anvals) % anvals ; |
| 793 |
0 |
| cc += (a_datap)[0+(__inc_a_m*(i2))] * (b_datap)[0+(__inc_b_n*(j))] ; |
| 794 |
|
| } |
| 795 |
0 |
| (c_datap)[0+(__inc_c_m*(i))] = cc; |
| 796 |
|
| } |
| 797 |
0 |
▶ | }PDL_BROADCASTLOOP_END_convolve_readdata |
Branch: 2 branches
| Branch | True | False | Total |
| }PDL_BROADCASTLOOP_END_convolve_readdata |
0 |
0 |
0 |
| }PDL_BROADCASTLOOP_END_convolve_readdata |
0 |
0 |
0 |
|
| 798 |
0 |
| } break; |
| 799 |
0 |
| case PDL_LL: { |
| 800 |
0 |
▶ | PDL_DECLARE_PARAMS_convolve_1(PDL_LongLong,Q,PDL_Indx,N,PDL_Indx,N) |
Branch: 15 branches
| Branch | True | False | Total |
| PDL_DECLARE_PARAMS_convolve_1(PDL_LongLong,Q,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_LongLong,Q,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_LongLong,Q,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_LongLong,Q,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_LongLong,Q,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_LongLong,Q,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_LongLong,Q,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_LongLong,Q,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_LongLong,Q,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_LongLong,Q,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_LongLong,Q,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_LongLong,Q,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_LongLong,Q,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_LongLong,Q,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_LongLong,Q,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
|
| 801 |
0 |
▶ | PDL_BROADCASTLOOP_START_convolve_readdata { |
Branch: 7 branches
| Branch | True | False | Total |
| PDL_BROADCASTLOOP_START_convolve_readdata { |
0 |
0 |
0 |
| PDL_BROADCASTLOOP_START_convolve_readdata { |
0 |
0 |
0 |
| PDL_BROADCASTLOOP_START_convolve_readdata { |
0 |
0 |
0 |
| PDL_BROADCASTLOOP_START_convolve_readdata { |
0 |
0 |
0 |
| PDL_BROADCASTLOOP_START_convolve_readdata { |
0 |
0 |
0 |
| PDL_BROADCASTLOOP_START_convolve_readdata { |
0 |
0 |
0 |
| PDL_BROADCASTLOOP_START_convolve_readdata { |
0 |
0 |
0 |
|
| 802 |
0 |
| PDL_Indx *dimsa = adims_datap; |
| 803 |
0 |
| PDL_Indx *dimsb = bdims_datap; |
| 804 |
0 |
| PDL_Indx andims = __privtrans->ind_sizes[2]; |
| 805 |
0 |
| PDL_Indx bndims = __privtrans->ind_sizes[3]; |
| 806 |
0 |
| PDL_Indx anvals = __privtrans->ind_sizes[0]; |
| 807 |
0 |
| PDL_Indx bnvals = __privtrans->ind_sizes[1]; |
| 808 |
|
| double cc; |
| 809 |
|
| |
| 810 |
0 |
| PDL_Indx i,i2,j,k,n,offcen=0,ncen=0,nrow; |
| 811 |
|
| |
| 812 |
0 |
| PDL_Indx pos[andims]; |
| 813 |
0 |
▶ | for (i=0; i<andims; i++) /* Zero */ |
Branch: 1 branch
| Branch | True | False | Total |
| for (i=0; i<andims; i++) /* Zero */ |
0 |
0 |
0 |
|
| 814 |
0 |
| pos[i]=0; |
| 815 |
|
| |
| 816 |
|
| /* Find middle pixel in b */ |
| 817 |
0 |
| i=0; nrow = dimsb[0]; |
| 818 |
0 |
▶ | while (i<bnvals) { |
Branch: 1 branch
| Branch | True | False | Total |
| while (i<bnvals) { |
0 |
0 |
0 |
|
| 819 |
0 |
▶ | for (j=0; j<nrow; j++) { /* For each row */ |
Branch: 1 branch
| Branch | True | False | Total |
| for (j=0; j<nrow; j++) { /* For each row */ |
0 |
0 |
0 |
|
| 820 |
0 |
| pos[0]=j; |
| 821 |
0 |
▶ | for (k=0; k < bndims; k++) { /* Is centre? */ |
Branch: 1 branch
| Branch | True | False | Total |
| for (k=0; k < bndims; k++) { /* Is centre? */ |
0 |
0 |
0 |
|
| 822 |
0 |
▶ | if (pos[k] != dimsb[k]/2) goto getout_PDL_LongLong; |
Branch: 1 branch
| Branch | True | False | Total |
| if (pos[k] != dimsb[k]/2) goto getout_PDL_LongLong; |
0 |
0 |
0 |
|
| 823 |
|
| } |
| 824 |
0 |
| ncen = i; |
| 825 |
0 |
| getout_PDL_LongLong: i++; |
| 826 |
|
| } |
| 827 |
0 |
| pos[0]=0; |
| 828 |
0 |
| ndim_row_plusplus( pos, dimsb, bndims ); |
| 829 |
|
| } |
| 830 |
|
| |
| 831 |
0 |
▶ | for (i=0; i<andims; i++) /* Zero */ |
Branch: 1 branch
| Branch | True | False | Total |
| for (i=0; i<andims; i++) /* Zero */ |
0 |
0 |
0 |
|
| 832 |
0 |
| pos[i]=0; |
| 833 |
|
| |
| 834 |
|
| /* Initialise offset array to handle the relative coords efficiently */ |
| 835 |
0 |
| PDL_Indx off[bnvals]; /* Offset array */ |
| 836 |
|
| |
| 837 |
0 |
| i=0; |
| 838 |
0 |
▶ | while(i<bnvals) { |
Branch: 1 branch
| Branch | True | False | Total |
| while(i<bnvals) { |
0 |
0 |
0 |
|
| 839 |
0 |
| n = ndim_get_offset(pos, dimsa, andims); /* Start of row in A */ |
| 840 |
0 |
▶ | for (j=0; j<nrow; j++) { /* Fill row */ |
Branch: 1 branch
| Branch | True | False | Total |
| for (j=0; j<nrow; j++) { /* Fill row */ |
0 |
0 |
0 |
|
| 841 |
0 |
| off[i] = n+j; |
| 842 |
0 |
▶ | if (i==ncen) |
Branch: 1 branch
| Branch | True | False | Total |
| if (i==ncen) |
0 |
0 |
0 |
|
| 843 |
0 |
| offcen = off[i]; /* Offset to middle */ |
| 844 |
0 |
| i++; |
| 845 |
|
| } |
| 846 |
0 |
| ndim_row_plusplus( pos, dimsa, andims ); |
| 847 |
|
| } |
| 848 |
|
| |
| 849 |
0 |
▶ | for(i=0;i<bnvals;i++) /* Subtract center offset */ |
Branch: 1 branch
| Branch | True | False | Total |
| for(i=0;i<bnvals;i++) /* Subtract center offset */ |
0 |
0 |
0 |
|
| 850 |
0 |
| off[i]=offcen-off[i]; |
| 851 |
|
| |
| 852 |
|
| /* Now convolve the data */ |
| 853 |
|
| |
| 854 |
0 |
▶ | for(i=0; i<anvals; i++) { |
Branch: 1 branch
| Branch | True | False | Total |
| for(i=0; i<anvals; i++) { |
0 |
0 |
0 |
|
| 855 |
0 |
| cc = 0; |
| 856 |
0 |
▶ | for(j=0; j<bnvals; j++) { |
Branch: 1 branch
| Branch | True | False | Total |
| for(j=0; j<bnvals; j++) { |
0 |
0 |
0 |
|
| 857 |
0 |
| i2 = (i+off[j]+anvals) % anvals ; |
| 858 |
0 |
| cc += (a_datap)[0+(__inc_a_m*(i2))] * (b_datap)[0+(__inc_b_n*(j))] ; |
| 859 |
|
| } |
| 860 |
0 |
| (c_datap)[0+(__inc_c_m*(i))] = cc; |
| 861 |
|
| } |
| 862 |
0 |
▶ | }PDL_BROADCASTLOOP_END_convolve_readdata |
Branch: 2 branches
| Branch | True | False | Total |
| }PDL_BROADCASTLOOP_END_convolve_readdata |
0 |
0 |
0 |
| }PDL_BROADCASTLOOP_END_convolve_readdata |
0 |
0 |
0 |
|
| 863 |
0 |
| } break; |
| 864 |
0 |
| case PDL_F: { |
| 865 |
0 |
▶ | PDL_DECLARE_PARAMS_convolve_1(PDL_Float,F,PDL_Indx,N,PDL_Indx,N) |
Branch: 15 branches
| Branch | True | False | Total |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Float,F,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Float,F,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Float,F,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Float,F,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Float,F,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Float,F,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Float,F,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Float,F,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Float,F,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Float,F,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Float,F,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Float,F,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Float,F,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Float,F,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Float,F,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
|
| 866 |
0 |
▶ | PDL_BROADCASTLOOP_START_convolve_readdata { |
Branch: 7 branches
| Branch | True | False | Total |
| PDL_BROADCASTLOOP_START_convolve_readdata { |
0 |
0 |
0 |
| PDL_BROADCASTLOOP_START_convolve_readdata { |
0 |
0 |
0 |
| PDL_BROADCASTLOOP_START_convolve_readdata { |
0 |
0 |
0 |
| PDL_BROADCASTLOOP_START_convolve_readdata { |
0 |
0 |
0 |
| PDL_BROADCASTLOOP_START_convolve_readdata { |
0 |
0 |
0 |
| PDL_BROADCASTLOOP_START_convolve_readdata { |
0 |
0 |
0 |
| PDL_BROADCASTLOOP_START_convolve_readdata { |
0 |
0 |
0 |
|
| 867 |
0 |
| PDL_Indx *dimsa = adims_datap; |
| 868 |
0 |
| PDL_Indx *dimsb = bdims_datap; |
| 869 |
0 |
| PDL_Indx andims = __privtrans->ind_sizes[2]; |
| 870 |
0 |
| PDL_Indx bndims = __privtrans->ind_sizes[3]; |
| 871 |
0 |
| PDL_Indx anvals = __privtrans->ind_sizes[0]; |
| 872 |
0 |
| PDL_Indx bnvals = __privtrans->ind_sizes[1]; |
| 873 |
|
| double cc; |
| 874 |
|
| |
| 875 |
0 |
| PDL_Indx i,i2,j,k,n,offcen=0,ncen=0,nrow; |
| 876 |
|
| |
| 877 |
0 |
| PDL_Indx pos[andims]; |
| 878 |
0 |
▶ | for (i=0; i<andims; i++) /* Zero */ |
Branch: 1 branch
| Branch | True | False | Total |
| for (i=0; i<andims; i++) /* Zero */ |
0 |
0 |
0 |
|
| 879 |
0 |
| pos[i]=0; |
| 880 |
|
| |
| 881 |
|
| /* Find middle pixel in b */ |
| 882 |
0 |
| i=0; nrow = dimsb[0]; |
| 883 |
0 |
▶ | while (i<bnvals) { |
Branch: 1 branch
| Branch | True | False | Total |
| while (i<bnvals) { |
0 |
0 |
0 |
|
| 884 |
0 |
▶ | for (j=0; j<nrow; j++) { /* For each row */ |
Branch: 1 branch
| Branch | True | False | Total |
| for (j=0; j<nrow; j++) { /* For each row */ |
0 |
0 |
0 |
|
| 885 |
0 |
| pos[0]=j; |
| 886 |
0 |
▶ | for (k=0; k < bndims; k++) { /* Is centre? */ |
Branch: 1 branch
| Branch | True | False | Total |
| for (k=0; k < bndims; k++) { /* Is centre? */ |
0 |
0 |
0 |
|
| 887 |
0 |
▶ | if (pos[k] != dimsb[k]/2) goto getout_PDL_Float; |
Branch: 1 branch
| Branch | True | False | Total |
| if (pos[k] != dimsb[k]/2) goto getout_PDL_Float; |
0 |
0 |
0 |
|
| 888 |
|
| } |
| 889 |
0 |
| ncen = i; |
| 890 |
0 |
| getout_PDL_Float: i++; |
| 891 |
|
| } |
| 892 |
0 |
| pos[0]=0; |
| 893 |
0 |
| ndim_row_plusplus( pos, dimsb, bndims ); |
| 894 |
|
| } |
| 895 |
|
| |
| 896 |
0 |
▶ | for (i=0; i<andims; i++) /* Zero */ |
Branch: 1 branch
| Branch | True | False | Total |
| for (i=0; i<andims; i++) /* Zero */ |
0 |
0 |
0 |
|
| 897 |
0 |
| pos[i]=0; |
| 898 |
|
| |
| 899 |
|
| /* Initialise offset array to handle the relative coords efficiently */ |
| 900 |
0 |
| PDL_Indx off[bnvals]; /* Offset array */ |
| 901 |
|
| |
| 902 |
0 |
| i=0; |
| 903 |
0 |
▶ | while(i<bnvals) { |
Branch: 1 branch
| Branch | True | False | Total |
| while(i<bnvals) { |
0 |
0 |
0 |
|
| 904 |
0 |
| n = ndim_get_offset(pos, dimsa, andims); /* Start of row in A */ |
| 905 |
0 |
▶ | for (j=0; j<nrow; j++) { /* Fill row */ |
Branch: 1 branch
| Branch | True | False | Total |
| for (j=0; j<nrow; j++) { /* Fill row */ |
0 |
0 |
0 |
|
| 906 |
0 |
| off[i] = n+j; |
| 907 |
0 |
▶ | if (i==ncen) |
Branch: 1 branch
| Branch | True | False | Total |
| if (i==ncen) |
0 |
0 |
0 |
|
| 908 |
0 |
| offcen = off[i]; /* Offset to middle */ |
| 909 |
0 |
| i++; |
| 910 |
|
| } |
| 911 |
0 |
| ndim_row_plusplus( pos, dimsa, andims ); |
| 912 |
|
| } |
| 913 |
|
| |
| 914 |
0 |
▶ | for(i=0;i<bnvals;i++) /* Subtract center offset */ |
Branch: 1 branch
| Branch | True | False | Total |
| for(i=0;i<bnvals;i++) /* Subtract center offset */ |
0 |
0 |
0 |
|
| 915 |
0 |
| off[i]=offcen-off[i]; |
| 916 |
|
| |
| 917 |
|
| /* Now convolve the data */ |
| 918 |
|
| |
| 919 |
0 |
▶ | for(i=0; i<anvals; i++) { |
Branch: 1 branch
| Branch | True | False | Total |
| for(i=0; i<anvals; i++) { |
0 |
0 |
0 |
|
| 920 |
0 |
| cc = 0; |
| 921 |
0 |
▶ | for(j=0; j<bnvals; j++) { |
Branch: 1 branch
| Branch | True | False | Total |
| for(j=0; j<bnvals; j++) { |
0 |
0 |
0 |
|
| 922 |
0 |
| i2 = (i+off[j]+anvals) % anvals ; |
| 923 |
0 |
| cc += (a_datap)[0+(__inc_a_m*(i2))] * (b_datap)[0+(__inc_b_n*(j))] ; |
| 924 |
|
| } |
| 925 |
0 |
| (c_datap)[0+(__inc_c_m*(i))] = cc; |
| 926 |
|
| } |
| 927 |
0 |
▶ | }PDL_BROADCASTLOOP_END_convolve_readdata |
Branch: 2 branches
| Branch | True | False | Total |
| }PDL_BROADCASTLOOP_END_convolve_readdata |
0 |
0 |
0 |
| }PDL_BROADCASTLOOP_END_convolve_readdata |
0 |
0 |
0 |
|
| 928 |
0 |
| } break; |
| 929 |
1 |
| case PDL_D: { |
| 930 |
1 |
▶ | PDL_DECLARE_PARAMS_convolve_1(PDL_Double,D,PDL_Indx,N,PDL_Indx,N) |
Branch: 15 branches
| Branch | True | False | Total |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Double,D,PDL_Indx,N,PDL_Indx,N) |
0 |
1 |
1 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Double,D,PDL_Indx,N,PDL_Indx,N) |
1 |
0 |
1 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Double,D,PDL_Indx,N,PDL_Indx,N) |
0 |
1 |
1 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Double,D,PDL_Indx,N,PDL_Indx,N) |
0 |
1 |
1 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Double,D,PDL_Indx,N,PDL_Indx,N) |
1 |
0 |
1 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Double,D,PDL_Indx,N,PDL_Indx,N) |
0 |
1 |
1 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Double,D,PDL_Indx,N,PDL_Indx,N) |
0 |
1 |
1 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Double,D,PDL_Indx,N,PDL_Indx,N) |
1 |
0 |
1 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Double,D,PDL_Indx,N,PDL_Indx,N) |
0 |
1 |
1 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Double,D,PDL_Indx,N,PDL_Indx,N) |
0 |
1 |
1 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Double,D,PDL_Indx,N,PDL_Indx,N) |
1 |
0 |
1 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Double,D,PDL_Indx,N,PDL_Indx,N) |
0 |
1 |
1 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Double,D,PDL_Indx,N,PDL_Indx,N) |
0 |
1 |
1 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Double,D,PDL_Indx,N,PDL_Indx,N) |
1 |
0 |
1 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_Double,D,PDL_Indx,N,PDL_Indx,N) |
0 |
1 |
1 |
|
| 931 |
4 |
▶ | PDL_BROADCASTLOOP_START_convolve_readdata { |
Branch: 7 branches
| Branch | True | False | Total |
| PDL_BROADCASTLOOP_START_convolve_readdata { |
0 |
1 |
1 |
| PDL_BROADCASTLOOP_START_convolve_readdata { |
0 |
1 |
1 |
| PDL_BROADCASTLOOP_START_convolve_readdata { |
0 |
1 |
1 |
| PDL_BROADCASTLOOP_START_convolve_readdata { |
0 |
1 |
1 |
| PDL_BROADCASTLOOP_START_convolve_readdata { |
0 |
1 |
1 |
| PDL_BROADCASTLOOP_START_convolve_readdata { |
1 |
1 |
2 |
| PDL_BROADCASTLOOP_START_convolve_readdata { |
1 |
1 |
2 |
|
| 932 |
1 |
| PDL_Indx *dimsa = adims_datap; |
| 933 |
1 |
| PDL_Indx *dimsb = bdims_datap; |
| 934 |
1 |
| PDL_Indx andims = __privtrans->ind_sizes[2]; |
| 935 |
1 |
| PDL_Indx bndims = __privtrans->ind_sizes[3]; |
| 936 |
1 |
| PDL_Indx anvals = __privtrans->ind_sizes[0]; |
| 937 |
1 |
| PDL_Indx bnvals = __privtrans->ind_sizes[1]; |
| 938 |
|
| double cc; |
| 939 |
|
| |
| 940 |
1 |
| PDL_Indx i,i2,j,k,n,offcen=0,ncen=0,nrow; |
| 941 |
|
| |
| 942 |
1 |
| PDL_Indx pos[andims]; |
| 943 |
3 |
▶ | for (i=0; i<andims; i++) /* Zero */ |
Branch: 1 branch
| Branch | True | False | Total |
| for (i=0; i<andims; i++) /* Zero */ |
2 |
1 |
3 |
|
| 944 |
2 |
| pos[i]=0; |
| 945 |
|
| |
| 946 |
|
| /* Find middle pixel in b */ |
| 947 |
1 |
| i=0; nrow = dimsb[0]; |
| 948 |
3 |
▶ | while (i<bnvals) { |
Branch: 1 branch
| Branch | True | False | Total |
| while (i<bnvals) { |
2 |
1 |
3 |
|
| 949 |
6 |
▶ | for (j=0; j<nrow; j++) { /* For each row */ |
Branch: 1 branch
| Branch | True | False | Total |
| for (j=0; j<nrow; j++) { /* For each row */ |
4 |
2 |
6 |
|
| 950 |
4 |
| pos[0]=j; |
| 951 |
7 |
▶ | for (k=0; k < bndims; k++) { /* Is centre? */ |
Branch: 1 branch
| Branch | True | False | Total |
| for (k=0; k < bndims; k++) { /* Is centre? */ |
6 |
1 |
7 |
|
| 952 |
6 |
▶ | if (pos[k] != dimsb[k]/2) goto getout_PDL_Double; |
Branch: 1 branch
| Branch | True | False | Total |
| if (pos[k] != dimsb[k]/2) goto getout_PDL_Double; |
3 |
3 |
6 |
|
| 953 |
|
| } |
| 954 |
1 |
| ncen = i; |
| 955 |
4 |
| getout_PDL_Double: i++; |
| 956 |
|
| } |
| 957 |
2 |
| pos[0]=0; |
| 958 |
2 |
| ndim_row_plusplus( pos, dimsb, bndims ); |
| 959 |
|
| } |
| 960 |
|
| |
| 961 |
3 |
▶ | for (i=0; i<andims; i++) /* Zero */ |
Branch: 1 branch
| Branch | True | False | Total |
| for (i=0; i<andims; i++) /* Zero */ |
2 |
1 |
3 |
|
| 962 |
2 |
| pos[i]=0; |
| 963 |
|
| |
| 964 |
|
| /* Initialise offset array to handle the relative coords efficiently */ |
| 965 |
1 |
| PDL_Indx off[bnvals]; /* Offset array */ |
| 966 |
|
| |
| 967 |
1 |
| i=0; |
| 968 |
3 |
▶ | while(i<bnvals) { |
Branch: 1 branch
| Branch | True | False | Total |
| while(i<bnvals) { |
2 |
1 |
3 |
|
| 969 |
2 |
| n = ndim_get_offset(pos, dimsa, andims); /* Start of row in A */ |
| 970 |
6 |
▶ | for (j=0; j<nrow; j++) { /* Fill row */ |
Branch: 1 branch
| Branch | True | False | Total |
| for (j=0; j<nrow; j++) { /* Fill row */ |
4 |
2 |
6 |
|
| 971 |
4 |
| off[i] = n+j; |
| 972 |
4 |
▶ | if (i==ncen) |
Branch: 1 branch
| Branch | True | False | Total |
| if (i==ncen) |
1 |
3 |
4 |
|
| 973 |
1 |
| offcen = off[i]; /* Offset to middle */ |
| 974 |
4 |
| i++; |
| 975 |
|
| } |
| 976 |
2 |
| ndim_row_plusplus( pos, dimsa, andims ); |
| 977 |
|
| } |
| 978 |
|
| |
| 979 |
5 |
▶ | for(i=0;i<bnvals;i++) /* Subtract center offset */ |
Branch: 1 branch
| Branch | True | False | Total |
| for(i=0;i<bnvals;i++) /* Subtract center offset */ |
4 |
1 |
5 |
|
| 980 |
4 |
| off[i]=offcen-off[i]; |
| 981 |
|
| |
| 982 |
|
| /* Now convolve the data */ |
| 983 |
|
| |
| 984 |
31 |
▶ | for(i=0; i<anvals; i++) { |
Branch: 1 branch
| Branch | True | False | Total |
| for(i=0; i<anvals; i++) { |
30 |
1 |
31 |
|
| 985 |
30 |
| cc = 0; |
| 986 |
150 |
▶ | for(j=0; j<bnvals; j++) { |
Branch: 1 branch
| Branch | True | False | Total |
| for(j=0; j<bnvals; j++) { |
120 |
30 |
150 |
|
| 987 |
120 |
| i2 = (i+off[j]+anvals) % anvals ; |
| 988 |
120 |
| cc += (a_datap)[0+(__inc_a_m*(i2))] * (b_datap)[0+(__inc_b_n*(j))] ; |
| 989 |
|
| } |
| 990 |
30 |
| (c_datap)[0+(__inc_c_m*(i))] = cc; |
| 991 |
|
| } |
| 992 |
1 |
▶ | }PDL_BROADCASTLOOP_END_convolve_readdata |
Branch: 2 branches
| Branch | True | False | Total |
| }PDL_BROADCASTLOOP_END_convolve_readdata |
0 |
1 |
1 |
| }PDL_BROADCASTLOOP_END_convolve_readdata |
0 |
1 |
1 |
|
| 993 |
1 |
| } break; |
| 994 |
0 |
| case PDL_LD: { |
| 995 |
0 |
▶ | PDL_DECLARE_PARAMS_convolve_1(PDL_LDouble,E,PDL_Indx,N,PDL_Indx,N) |
Branch: 15 branches
| Branch | True | False | Total |
| PDL_DECLARE_PARAMS_convolve_1(PDL_LDouble,E,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_LDouble,E,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_LDouble,E,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_LDouble,E,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_LDouble,E,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_LDouble,E,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_LDouble,E,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_LDouble,E,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_LDouble,E,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_LDouble,E,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_LDouble,E,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_LDouble,E,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_LDouble,E,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_LDouble,E,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
| PDL_DECLARE_PARAMS_convolve_1(PDL_LDouble,E,PDL_Indx,N,PDL_Indx,N) |
0 |
0 |
0 |
|
| 996 |
0 |
▶ | PDL_BROADCASTLOOP_START_convolve_readdata { |
Branch: 7 branches
| Branch | True | False | Total |
| PDL_BROADCASTLOOP_START_convolve_readdata { |
0 |
0 |
0 |
| PDL_BROADCASTLOOP_START_convolve_readdata { |
0 |
0 |
0 |
| PDL_BROADCASTLOOP_START_convolve_readdata { |
0 |
0 |
0 |
| PDL_BROADCASTLOOP_START_convolve_readdata { |
0 |
0 |
0 |
| PDL_BROADCASTLOOP_START_convolve_readdata { |
0 |
0 |
0 |
| PDL_BROADCASTLOOP_START_convolve_readdata { |
0 |
0 |
0 |
| PDL_BROADCASTLOOP_START_convolve_readdata { |
0 |
0 |
0 |
|
| 997 |
0 |
| PDL_Indx *dimsa = adims_datap; |
| 998 |
0 |
| PDL_Indx *dimsb = bdims_datap; |
| 999 |
0 |
| PDL_Indx andims = __privtrans->ind_sizes[2]; |
| 1000 |
0 |
| PDL_Indx bndims = __privtrans->ind_sizes[3]; |
| 1001 |
0 |
| PDL_Indx anvals = __privtrans->ind_sizes[0]; |
| 1002 |
0 |
| PDL_Indx bnvals = __privtrans->ind_sizes[1]; |
| 1003 |
|
| double cc; |
| 1004 |
|
| |
| 1005 |
0 |
| PDL_Indx i,i2,j,k,n,offcen=0,ncen=0,nrow; |
| 1006 |
|
| |
| 1007 |
0 |
| PDL_Indx pos[andims]; |
| 1008 |
0 |
▶ | for (i=0; i<andims; i++) /* Zero */ |
Branch: 1 branch
| Branch | True | False | Total |
| for (i=0; i<andims; i++) /* Zero */ |
0 |
0 |
0 |
|
| 1009 |
0 |
| pos[i]=0; |
| 1010 |
|
| |
| 1011 |
|
| /* Find middle pixel in b */ |
| 1012 |
0 |
| i=0; nrow = dimsb[0]; |
| 1013 |
0 |
▶ | while (i<bnvals) { |
Branch: 1 branch
| Branch | True | False | Total |
| while (i<bnvals) { |
0 |
0 |
0 |
|
| 1014 |
0 |
▶ | for (j=0; j<nrow; j++) { /* For each row */ |
Branch: 1 branch
| Branch | True | False | Total |
| for (j=0; j<nrow; j++) { /* For each row */ |
0 |
0 |
0 |
|
| 1015 |
0 |
| pos[0]=j; |
| 1016 |
0 |
▶ | for (k=0; k < bndims; k++) { /* Is centre? */ |
Branch: 1 branch
| Branch | True | False | Total |
| for (k=0; k < bndims; k++) { /* Is centre? */ |
0 |
0 |
0 |
|
| 1017 |
0 |
▶ | if (pos[k] != dimsb[k]/2) goto getout_PDL_LDouble; |
Branch: 1 branch
| Branch | True | False | Total |
| if (pos[k] != dimsb[k]/2) goto getout_PDL_LDouble; |
0 |
0 |
0 |
|
| 1018 |
|
| } |
| 1019 |
0 |
| ncen = i; |
| 1020 |
0 |
| getout_PDL_LDouble: i++; |
| 1021 |
|
| } |
| 1022 |
0 |
| pos[0]=0; |
| 1023 |
0 |
| ndim_row_plusplus( pos, dimsb, bndims ); |
| 1024 |
|
| } |
| 1025 |
|
| |
| 1026 |
0 |
▶ | for (i=0; i<andims; i++) /* Zero */ |
Branch: 1 branch
| Branch | True | False | Total |
| for (i=0; i<andims; i++) /* Zero */ |
0 |
0 |
0 |
|
| 1027 |
0 |
| pos[i]=0; |
| 1028 |
|
| |
| 1029 |
|
| /* Initialise offset array to handle the relative coords efficiently */ |
| 1030 |
0 |
| PDL_Indx off[bnvals]; /* Offset array */ |
| 1031 |
|
| |
| 1032 |
0 |
| i=0; |
| 1033 |
0 |
▶ | while(i<bnvals) { |
Branch: 1 branch
| Branch | True | False | Total |
| while(i<bnvals) { |
0 |
0 |
0 |
|
| 1034 |
0 |
| n = ndim_get_offset(pos, dimsa, andims); /* Start of row in A */ |
| 1035 |
0 |
▶ | for (j=0; j<nrow; j++) { /* Fill row */ |
Branch: 1 branch
| Branch | True | False | Total |
| for (j=0; j<nrow; j++) { /* Fill row */ |
0 |
0 |
0 |
|
| 1036 |
0 |
| off[i] = n+j; |
| 1037 |
0 |
▶ | if (i==ncen) |
Branch: 1 branch
| Branch | True | False | Total |
| if (i==ncen) |
0 |
0 |
0 |
|
| 1038 |
0 |
| offcen = off[i]; /* Offset to middle */ |
| 1039 |
0 |
| i++; |
| 1040 |
|
| } |
| 1041 |
0 |
| ndim_row_plusplus( pos, dimsa, andims ); |
| 1042 |
|
| } |
| 1043 |
|
| |
| 1044 |
0 |
▶ | for(i=0;i<bnvals;i++) /* Subtract center offset */ |
Branch: 1 branch
| Branch | True | False | Total |
| for(i=0;i<bnvals;i++) /* Subtract center offset */ |
0 |
0 |
0 |
|
| 1045 |
0 |
| off[i]=offcen-off[i]; |
| 1046 |
|
| |
| 1047 |
|
| /* Now convolve the data */ |
| 1048 |
|
| |
| 1049 |
0 |
▶ | for(i=0; i<anvals; i++) { |
Branch: 1 branch
| Branch | True | False | Total |
| for(i=0; i<anvals; i++) { |
0 |
0 |
0 |
|
| 1050 |
0 |
| cc = 0; |
| 1051 |
0 |
▶ | for(j=0; j<bnvals; j++) { |
Branch: 1 branch
| Branch | True | False | Total |
| for(j=0; j<bnvals; j++) { |
0 |
0 |
0 |
|
| 1052 |
0 |
| i2 = (i+off[j]+anvals) % anvals ; |
| 1053 |
0 |
| cc += (a_datap)[0+(__inc_a_m*(i2))] * (b_datap)[0+(__inc_b_n*(j))] ; |
| 1054 |
|
| } |
| 1055 |
0 |
| (c_datap)[0+(__inc_c_m*(i))] = cc; |
| 1056 |
|
| } |
| 1057 |
0 |
▶ | }PDL_BROADCASTLOOP_END_convolve_readdata |
Branch: 2 branches
| Branch | True | False | Total |
| }PDL_BROADCASTLOOP_END_convolve_readdata |
0 |
0 |
0 |
| }PDL_BROADCASTLOOP_END_convolve_readdata |
0 |
0 |
0 |
|
| 1058 |
0 |
| } break; |
| 1059 |
0 |
| default: return PDL->make_error(PDL_EUSERERROR, "PP INTERNAL ERROR in convolve: unhandled datatype(%d), only handles (ABSULKNPQFDE)! PLEASE MAKE A BUG REPORT\n", __privtrans->__datatype); |
| 1060 |
|
| } |
| 1061 |
|
| #undef PDL_IF_BAD |
| 1062 |
1 |
| return PDL_err; |
| 1063 |
|
| } |
| 1064 |
|
| |
| 1065 |
|
| static pdl_datatypes pdl_convolve_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 }; |
| 1066 |
|
| static PDL_Indx pdl_convolve_vtable_realdims[] = { 1, 1, 1, 1, 1 }; |
| 1067 |
|
| static char *pdl_convolve_vtable_parnames[] = { "a","b","adims","bdims","c" }; |
| 1068 |
|
| static short pdl_convolve_vtable_parflags[] = { |
| 1069 |
|
| 0, |
| 1070 |
|
| 0, |
| 1071 |
|
| PDL_PARAM_ISPHYS|PDL_PARAM_ISTYPED, |
| 1072 |
|
| PDL_PARAM_ISPHYS|PDL_PARAM_ISTYPED, |
| 1073 |
|
| PDL_PARAM_ISCREAT|PDL_PARAM_ISOUT|PDL_PARAM_ISWRITE |
| 1074 |
|
| }; |
| 1075 |
|
| static pdl_datatypes pdl_convolve_vtable_partypes[] = { -1, -1, PDL_IND, PDL_IND, -1 }; |
| 1076 |
|
| static PDL_Indx pdl_convolve_vtable_realdims_starts[] = { 0, 1, 2, 3, 4 }; |
| 1077 |
|
| static PDL_Indx pdl_convolve_vtable_realdims_ind_ids[] = { 0, 1, 2, 3, 0 }; |
| 1078 |
|
| static char *pdl_convolve_vtable_indnames[] = { "m","n","p","q" }; |
| 1079 |
|
| pdl_transvtable pdl_convolve_vtable = { |
| 1080 |
|
| PDL_TRANS_DO_BROADCAST, 0, pdl_convolve_vtable_gentypes, 4, 5, NULL /*CORE21*/, |
| 1081 |
|
| pdl_convolve_vtable_realdims, pdl_convolve_vtable_parnames, |
| 1082 |
|
| pdl_convolve_vtable_parflags, pdl_convolve_vtable_partypes, |
| 1083 |
|
| pdl_convolve_vtable_realdims_starts, pdl_convolve_vtable_realdims_ind_ids, 5, |
| 1084 |
|
| 4, pdl_convolve_vtable_indnames, |
| 1085 |
|
| pdl_convolve_redodims, pdl_convolve_readdata, NULL, |
| 1086 |
|
| NULL, |
| 1087 |
|
| 0,"PDL::ImageND::convolve" |
| 1088 |
|
| }; |
| 1089 |
|
| |
| 1090 |
|
| |
| 1091 |
1 |
| pdl_error pdl_run_convolve(pdl *a,pdl *b,pdl *adims,pdl *bdims,pdl *c) { |
| 1092 |
1 |
| pdl_error PDL_err = {0, NULL, 0}; |
| 1093 |
1 |
▶ | if (!PDL) return (pdl_error){PDL_EFATAL, "PDL core struct is NULL, can't continue",0}; |
Branch: 1 branch
| Branch | True | False | Total |
| if (!PDL) return (pdl_error){PDL_EFATAL, "PDL core struct is NULL, can't continue",0}; |
0 |
1 |
1 |
|
| 1094 |
1 |
| pdl_trans *__privtrans = PDL->create_trans(&pdl_convolve_vtable); |
| 1095 |
1 |
▶ | if (!__privtrans) return PDL->make_error_simple(PDL_EFATAL, "Couldn't create trans"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (!__privtrans) return PDL->make_error_simple(PDL_EFATAL, "Couldn't create trans"); |
0 |
1 |
1 |
|
| 1096 |
1 |
| __privtrans->pdls[0] = a; |
| 1097 |
1 |
| __privtrans->pdls[1] = b; |
| 1098 |
1 |
| __privtrans->pdls[2] = adims; |
| 1099 |
1 |
| __privtrans->pdls[3] = bdims; |
| 1100 |
1 |
| __privtrans->pdls[4] = c; |
| 1101 |
1 |
▶ | PDL_RETERROR(PDL_err, PDL->type_coerce(__privtrans)); |
Branch: 1 branch
| Branch | True | False | Total |
| PDL_RETERROR(PDL_err, PDL->type_coerce(__privtrans)); |
0 |
1 |
1 |
|
| 1102 |
1 |
▶ | PDL_RETERROR(PDL_err, PDL->make_trans_mutual(__privtrans)); |
Branch: 1 branch
| Branch | True | False | Total |
| PDL_RETERROR(PDL_err, PDL->make_trans_mutual(__privtrans)); |
0 |
1 |
1 |
|
| 1103 |
1 |
| return PDL_err; |
| 1104 |
|
| } |