| 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.xs" |
| 23 |
|
| pdl_error pdl_run_convolve(pdl *a,pdl *b,pdl *adims,pdl *bdims,pdl *c); |
| 24 |
|
| pdl_error pdl_run_rebin(pdl *a,pdl *b,int ns); |
| 25 |
|
| pdl_error pdl_run_convolveND(pdl *k0,pdl *k,pdl *aa,pdl *a); |
| 26 |
|
| pdl_error pdl_run_contour_segments(pdl *c,pdl *data,pdl *points,pdl *segs,pdl *cnt); |
| 27 |
|
| pdl_error pdl_run_contour_polylines(pdl *c,pdl *data,pdl *points,pdl *pathendindex,pdl *paths); |
| 28 |
|
| pdl_error pdl_run_path_join(pdl *e,pdl *pathendindex,pdl *paths,PDL_Indx d,int directed); |
| 29 |
|
| pdl_error pdl_run_combcoords(pdl *x,pdl *y,pdl *z,pdl *coords); |
| 30 |
|
| pdl_error pdl_run_repulse(pdl *coords,pdl *vecs,double boxsize,int dmult,double a,double b,double c,double d); |
| 31 |
|
| pdl_error pdl_run_attract(pdl *coords,pdl *from,pdl *to,pdl *strength,pdl *vecs,double m,double ms); |
| 32 |
|
| |
| 33 |
|
| #line 449 "lib/PDL/PP.pm" |
| 34 |
|
| #include "pdlperl.h" |
| 35 |
|
| #line 36 "lib/PDL/ImageND.xs" |
| 36 |
|
| |
| 37 |
|
| Core* PDL = NULL; /* Structure hold core C functions */ |
| 38 |
|
| |
| 39 |
|
| MODULE = PDL::ImageND PACKAGE = PDL PREFIX=pdl_run_ |
| 40 |
|
| |
| 41 |
|
| PROTOTYPES: DISABLE |
| 42 |
|
| |
| 43 |
|
| |
| 44 |
|
| void |
| 45 |
|
| _convolve_int(a,b,adims,bdims,c) |
| 46 |
|
| pdl *a |
| 47 |
|
| pdl *b |
| 48 |
|
| pdl *adims |
| 49 |
|
| pdl *bdims |
| 50 |
|
| pdl *c |
| 51 |
|
| CODE: |
| 52 |
1 |
| PDL->barf_if_error(pdl_run_convolve(a,b,adims,bdims,c)); |
| 53 |
|
| |
| 54 |
|
| void |
| 55 |
|
| _rebin_int(a,b,ns) |
| 56 |
|
| pdl *a |
| 57 |
|
| pdl *b |
| 58 |
|
| int ns |
| 59 |
|
| CODE: |
| 60 |
0 |
| PDL->barf_if_error(pdl_run_rebin(a,b,ns)); |
| 61 |
|
| |
| 62 |
|
| void |
| 63 |
|
| _convolveND_int(k0,k,aa,a) |
| 64 |
|
| pdl *k0 |
| 65 |
|
| pdl *k |
| 66 |
|
| pdl *aa |
| 67 |
|
| pdl *a |
| 68 |
|
| CODE: |
| 69 |
3 |
| PDL->barf_if_error(pdl_run_convolveND(k0,k,aa,a)); |
| 70 |
|
| |
| 71 |
|
| void |
| 72 |
|
| pdl_run_contour_segments(c, data, points, segs=PDL_XS_PERLINIT_initsv(segs_SV), cnt=PDL_XS_PERLINIT_initsv(cnt_SV)) |
| 73 |
|
| SV *segs_SV = items > 3 ? ST(3) : NULL; |
| 74 |
|
| SV *cnt_SV = items > 4 ? ST(4) : NULL; |
| 75 |
|
| PREINIT: |
| 76 |
2 |
▶ | PDL_XS_PREAMBLE((items == 5) ? 0 : 2); |
Branch: 11 branches
| Branch | True | False | Total |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 2); |
0 |
2 |
2 |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 2); |
1 |
1 |
2 |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 2); |
0 |
1 |
1 |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 2); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 2); |
1 |
0 |
1 |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 2); |
1 |
0 |
1 |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 2); |
1 |
0 |
1 |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 2); |
0 |
1 |
1 |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 2); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 2); |
1 |
0 |
1 |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 2); |
0 |
1 |
1 |
|
| 77 |
|
| INPUT: |
| 78 |
|
| pdl *c |
| 79 |
|
| pdl *data |
| 80 |
|
| pdl *points |
| 81 |
|
| pdl *segs |
| 82 |
|
| pdl *cnt |
| 83 |
|
| PPCODE: |
| 84 |
2 |
▶ | if (PDL_IS_INPLACE(c)) PDL->pdl_barf("contour_segments: c->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(c)) PDL->pdl_barf("contour_segments: c->inplace but not supported"); |
0 |
2 |
2 |
|
| 85 |
2 |
▶ | if (PDL_IS_INPLACE(data)) PDL->pdl_barf("contour_segments: data->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(data)) PDL->pdl_barf("contour_segments: data->inplace but not supported"); |
0 |
2 |
2 |
|
| 86 |
2 |
▶ | if (PDL_IS_INPLACE(points)) PDL->pdl_barf("contour_segments: points->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(points)) PDL->pdl_barf("contour_segments: points->inplace but not supported"); |
0 |
2 |
2 |
|
| 87 |
2 |
| PDL->barf_if_error(pdl_run_contour_segments(c,data,points,segs,cnt)); |
| 88 |
2 |
▶ | PDL_XS_RETURN(ST(0) = segs_SV;ST(1) = cnt_SV) |
Branch: 5 branches
| Branch | True | False | Total |
| PDL_XS_RETURN(ST(0) = segs_SV;ST(1) = cnt_SV) |
2 |
0 |
2 |
| PDL_XS_RETURN(ST(0) = segs_SV;ST(1) = cnt_SV) |
2 |
0 |
2 |
| PDL_XS_RETURN(ST(0) = segs_SV;ST(1) = cnt_SV) |
2 |
0 |
2 |
| PDL_XS_RETURN(ST(0) = segs_SV;ST(1) = cnt_SV) |
0 |
2 |
2 |
| PDL_XS_RETURN(ST(0) = segs_SV;ST(1) = cnt_SV) |
0 |
0 |
0 |
|
| 89 |
|
| |
| 90 |
|
| void |
| 91 |
|
| pdl_run_contour_polylines(c, data, points, pathendindex=PDL_XS_PERLINIT_initsv(pathendindex_SV), paths=PDL_XS_PERLINIT_initsv(paths_SV)) |
| 92 |
|
| SV *pathendindex_SV = items > 3 ? ST(3) : NULL; |
| 93 |
|
| SV *paths_SV = items > 4 ? ST(4) : NULL; |
| 94 |
|
| PREINIT: |
| 95 |
1 |
▶ | PDL_XS_PREAMBLE((items == 5) ? 0 : 2); |
Branch: 11 branches
| Branch | True | False | Total |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 2); |
0 |
1 |
1 |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 2); |
0 |
1 |
1 |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 2); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 2); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 2); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 2); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 2); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 2); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 2); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 2); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 2); |
0 |
0 |
0 |
|
| 96 |
|
| INPUT: |
| 97 |
|
| pdl *c |
| 98 |
|
| pdl *data |
| 99 |
|
| pdl *points |
| 100 |
|
| pdl *pathendindex |
| 101 |
|
| pdl *paths |
| 102 |
|
| PPCODE: |
| 103 |
1 |
▶ | if (PDL_IS_INPLACE(c)) PDL->pdl_barf("contour_polylines: c->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(c)) PDL->pdl_barf("contour_polylines: c->inplace but not supported"); |
0 |
1 |
1 |
|
| 104 |
1 |
▶ | if (PDL_IS_INPLACE(data)) PDL->pdl_barf("contour_polylines: data->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(data)) PDL->pdl_barf("contour_polylines: data->inplace but not supported"); |
0 |
1 |
1 |
|
| 105 |
1 |
▶ | if (PDL_IS_INPLACE(points)) PDL->pdl_barf("contour_polylines: points->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(points)) PDL->pdl_barf("contour_polylines: points->inplace but not supported"); |
0 |
1 |
1 |
|
| 106 |
1 |
| PDL->barf_if_error(pdl_run_contour_polylines(c,data,points,pathendindex,paths)); |
| 107 |
1 |
▶ | PDL_XS_RETURN(ST(0) = pathendindex_SV;ST(1) = paths_SV) |
Branch: 5 branches
| Branch | True | False | Total |
| PDL_XS_RETURN(ST(0) = pathendindex_SV;ST(1) = paths_SV) |
1 |
0 |
1 |
| PDL_XS_RETURN(ST(0) = pathendindex_SV;ST(1) = paths_SV) |
1 |
0 |
1 |
| PDL_XS_RETURN(ST(0) = pathendindex_SV;ST(1) = paths_SV) |
1 |
0 |
1 |
| PDL_XS_RETURN(ST(0) = pathendindex_SV;ST(1) = paths_SV) |
0 |
1 |
1 |
| PDL_XS_RETURN(ST(0) = pathendindex_SV;ST(1) = paths_SV) |
0 |
0 |
0 |
|
| 108 |
|
| |
| 109 |
|
| void |
| 110 |
|
| pdl_run_path_join(e, pathendindex=pathendindex, paths=paths, d=d, directed=directed) |
| 111 |
|
| SV *pathendindex_SV = (items == 5) ? ST(1) : NULL; |
| 112 |
|
| SV *paths_SV = (items == 5) ? ST(2) : NULL; |
| 113 |
|
| SV *d_SV = (items == 5) ? ST(3) : ST(1); |
| 114 |
|
| SV *directed_SV = (items == 5) ? ST(4) : !(items == (3-1)) ? ST(2) : NULL; |
| 115 |
|
| PREINIT: |
| 116 |
5 |
▶ | PDL_XS_PREAMBLE((items == 5) ? 0 : 2); |
Branch: 11 branches
| Branch | True | False | Total |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 2); |
0 |
5 |
5 |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 2); |
5 |
0 |
5 |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 2); |
0 |
5 |
5 |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 2); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 2); |
5 |
0 |
5 |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 2); |
5 |
0 |
5 |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 2); |
5 |
0 |
5 |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 2); |
0 |
5 |
5 |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 2); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 2); |
5 |
0 |
5 |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 2); |
0 |
5 |
5 |
|
| 117 |
5 |
▶ | if (!((items == (3-1)) || (items == 3) || (items == 5))) |
Branch: 3 branches
| Branch | True | False | Total |
| if (!((items == (3-1)) || (items == 3) || (items == 5))) |
5 |
0 |
5 |
| if (!((items == (3-1)) || (items == 3) || (items == 5))) |
0 |
5 |
5 |
| if (!((items == (3-1)) || (items == 3) || (items == 5))) |
0 |
0 |
0 |
|
| 118 |
0 |
| croak("Usage: PDL::path_join(e,[pathendindex],[paths],d,directed=1) (you may leave [outputs] and values with =defaults out of list)"); |
| 119 |
|
| INPUT: |
| 120 |
|
| pdl *e |
| 121 |
|
| pdl *pathendindex=NO_INIT |
| 122 |
|
| pdl *paths=NO_INIT |
| 123 |
|
| PDL_Indx d; { d = (PDL_Indx)SvIV(d_SV); } |
| 124 |
|
| int directed=NO_INIT |
| 125 |
|
| PPCODE: |
| 126 |
5 |
▶ | if (!directed_SV) { directed = (1); } else { directed = (int)SvIV(directed_SV); } |
Branch: 1 branch
| Branch | True | False | Total |
| if (!directed_SV) { directed = (1); } else { directed = (int)SvIV(directed_SV); } |
0 |
5 |
5 |
|
| 127 |
5 |
▶ | if (pathendindex_SV) { pathendindex = PDL_CORE_(SvPDLV)(pathendindex_SV); } else pathendindex = PDL_XS_PERLINIT_initsv(pathendindex_SV); |
Branch: 2 branches
| Branch | True | False | Total |
| if (pathendindex_SV) { pathendindex = PDL_CORE_(SvPDLV)(pathendindex_SV); } else pathendindex = PDL_XS_PERLINIT_initsv(pathendindex_SV); |
0 |
5 |
5 |
| if (pathendindex_SV) { pathendindex = PDL_CORE_(SvPDLV)(pathendindex_SV); } else pathendindex = PDL_XS_PERLINIT_initsv(pathendindex_SV); |
0 |
5 |
5 |
|
| 128 |
5 |
▶ | if (paths_SV) { paths = PDL_CORE_(SvPDLV)(paths_SV); } else paths = PDL_XS_PERLINIT_initsv(paths_SV); |
Branch: 2 branches
| Branch | True | False | Total |
| if (paths_SV) { paths = PDL_CORE_(SvPDLV)(paths_SV); } else paths = PDL_XS_PERLINIT_initsv(paths_SV); |
0 |
5 |
5 |
| if (paths_SV) { paths = PDL_CORE_(SvPDLV)(paths_SV); } else paths = PDL_XS_PERLINIT_initsv(paths_SV); |
0 |
5 |
5 |
|
| 129 |
5 |
▶ | if (PDL_IS_INPLACE(e)) PDL->pdl_barf("path_join: e->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(e)) PDL->pdl_barf("path_join: e->inplace but not supported"); |
0 |
5 |
5 |
|
| 130 |
5 |
| PDL->barf_if_error(pdl_run_path_join(e,pathendindex,paths,d,directed)); |
| 131 |
5 |
▶ | PDL_XS_RETURN(ST(0) = pathendindex_SV;ST(1) = paths_SV) |
Branch: 5 branches
| Branch | True | False | Total |
| PDL_XS_RETURN(ST(0) = pathendindex_SV;ST(1) = paths_SV) |
5 |
0 |
5 |
| PDL_XS_RETURN(ST(0) = pathendindex_SV;ST(1) = paths_SV) |
5 |
0 |
5 |
| PDL_XS_RETURN(ST(0) = pathendindex_SV;ST(1) = paths_SV) |
5 |
0 |
5 |
| PDL_XS_RETURN(ST(0) = pathendindex_SV;ST(1) = paths_SV) |
0 |
5 |
5 |
| PDL_XS_RETURN(ST(0) = pathendindex_SV;ST(1) = paths_SV) |
0 |
0 |
0 |
|
| 132 |
|
| |
| 133 |
|
| void |
| 134 |
|
| pdl_run_combcoords(x, y, z, coords=PDL_XS_PERLINIT_initsv(coords_SV)) |
| 135 |
|
| SV *coords_SV = items > 3 ? ST(3) : NULL; |
| 136 |
|
| PREINIT: |
| 137 |
1 |
▶ | PDL_XS_PREAMBLE((items == 4) ? 0 : 1); |
Branch: 10 branches
| Branch | True | False | Total |
| PDL_XS_PREAMBLE((items == 4) ? 0 : 1); |
1 |
0 |
1 |
| PDL_XS_PREAMBLE((items == 4) ? 0 : 1); |
0 |
1 |
1 |
| PDL_XS_PREAMBLE((items == 4) ? 0 : 1); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 4) ? 0 : 1); |
1 |
0 |
1 |
| PDL_XS_PREAMBLE((items == 4) ? 0 : 1); |
1 |
0 |
1 |
| PDL_XS_PREAMBLE((items == 4) ? 0 : 1); |
1 |
0 |
1 |
| PDL_XS_PREAMBLE((items == 4) ? 0 : 1); |
0 |
1 |
1 |
| PDL_XS_PREAMBLE((items == 4) ? 0 : 1); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 4) ? 0 : 1); |
1 |
0 |
1 |
| PDL_XS_PREAMBLE((items == 4) ? 0 : 1); |
0 |
1 |
1 |
|
| 138 |
|
| INPUT: |
| 139 |
|
| pdl *x |
| 140 |
|
| pdl *y |
| 141 |
|
| pdl *z |
| 142 |
|
| pdl *coords |
| 143 |
|
| PPCODE: |
| 144 |
1 |
▶ | if (PDL_IS_INPLACE(x)) PDL->pdl_barf("combcoords: x->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(x)) PDL->pdl_barf("combcoords: x->inplace but not supported"); |
0 |
1 |
1 |
|
| 145 |
1 |
▶ | if (PDL_IS_INPLACE(y)) PDL->pdl_barf("combcoords: y->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(y)) PDL->pdl_barf("combcoords: y->inplace but not supported"); |
0 |
1 |
1 |
|
| 146 |
1 |
▶ | if (PDL_IS_INPLACE(z)) PDL->pdl_barf("combcoords: z->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(z)) PDL->pdl_barf("combcoords: z->inplace but not supported"); |
0 |
1 |
1 |
|
| 147 |
1 |
| PDL->barf_if_error(pdl_run_combcoords(x,y,z,coords)); |
| 148 |
1 |
▶ | PDL_XS_RETURN(ST(0) = coords_SV) |
Branch: 5 branches
| Branch | True | False | Total |
| PDL_XS_RETURN(ST(0) = coords_SV) |
1 |
0 |
1 |
| PDL_XS_RETURN(ST(0) = coords_SV) |
1 |
0 |
1 |
| PDL_XS_RETURN(ST(0) = coords_SV) |
1 |
0 |
1 |
| PDL_XS_RETURN(ST(0) = coords_SV) |
0 |
1 |
1 |
| PDL_XS_RETURN(ST(0) = coords_SV) |
0 |
0 |
0 |
|
| 149 |
|
| |
| 150 |
|
| void |
| 151 |
|
| pdl_run_repulse(coords, vecs=vecs, boxsize=boxsize, dmult=dmult, a=a, b=b, c=c, d=d) |
| 152 |
|
| SV *vecs_SV = (items == 8) ? ST(1) : NULL; |
| 153 |
|
| SV *boxsize_SV = (items == 8) ? ST(2) : ST(1); |
| 154 |
|
| SV *dmult_SV = (items == 8) ? ST(3) : ST(2); |
| 155 |
|
| SV *a_SV = (items == 8) ? ST(4) : ST(3); |
| 156 |
|
| SV *b_SV = (items == 8) ? ST(5) : ST(4); |
| 157 |
|
| SV *c_SV = (items == 8) ? ST(6) : ST(5); |
| 158 |
|
| SV *d_SV = (items == 8) ? ST(7) : ST(6); |
| 159 |
|
| PREINIT: |
| 160 |
1 |
▶ | PDL_XS_PREAMBLE((items == 8) ? 0 : 1); |
Branch: 10 branches
| Branch | True | False | Total |
| PDL_XS_PREAMBLE((items == 8) ? 0 : 1); |
1 |
0 |
1 |
| PDL_XS_PREAMBLE((items == 8) ? 0 : 1); |
0 |
1 |
1 |
| PDL_XS_PREAMBLE((items == 8) ? 0 : 1); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 8) ? 0 : 1); |
1 |
0 |
1 |
| PDL_XS_PREAMBLE((items == 8) ? 0 : 1); |
1 |
0 |
1 |
| PDL_XS_PREAMBLE((items == 8) ? 0 : 1); |
1 |
0 |
1 |
| PDL_XS_PREAMBLE((items == 8) ? 0 : 1); |
0 |
1 |
1 |
| PDL_XS_PREAMBLE((items == 8) ? 0 : 1); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 8) ? 0 : 1); |
1 |
0 |
1 |
| PDL_XS_PREAMBLE((items == 8) ? 0 : 1); |
0 |
1 |
1 |
|
| 161 |
1 |
▶ | if (!((items == 7) || (items == 8))) |
Branch: 2 branches
| Branch | True | False | Total |
| if (!((items == 7) || (items == 8))) |
0 |
1 |
1 |
| if (!((items == 7) || (items == 8))) |
0 |
0 |
0 |
|
| 162 |
0 |
| croak("Usage: PDL::repulse(coords,[vecs],boxsize,dmult,a,b,c,d) (you may leave [outputs] and values with =defaults out of list)"); |
| 163 |
|
| INPUT: |
| 164 |
|
| pdl *coords |
| 165 |
|
| pdl *vecs=NO_INIT |
| 166 |
|
| double boxsize; { boxsize = (double)SvNV(boxsize_SV); } |
| 167 |
|
| int dmult; { dmult = (int)SvIV(dmult_SV); } |
| 168 |
|
| double a; { a = (double)SvNV(a_SV); } |
| 169 |
|
| double b; { b = (double)SvNV(b_SV); } |
| 170 |
|
| double c; { c = (double)SvNV(c_SV); } |
| 171 |
|
| double d; { d = (double)SvNV(d_SV); } |
| 172 |
|
| PPCODE: |
| 173 |
1 |
▶ | if (vecs_SV) { vecs = PDL_CORE_(SvPDLV)(vecs_SV); } else vecs = PDL_XS_PERLINIT_initsv(vecs_SV); |
Branch: 2 branches
| Branch | True | False | Total |
| if (vecs_SV) { vecs = PDL_CORE_(SvPDLV)(vecs_SV); } else vecs = PDL_XS_PERLINIT_initsv(vecs_SV); |
0 |
1 |
1 |
| if (vecs_SV) { vecs = PDL_CORE_(SvPDLV)(vecs_SV); } else vecs = PDL_XS_PERLINIT_initsv(vecs_SV); |
0 |
1 |
1 |
|
| 174 |
1 |
▶ | if (PDL_IS_INPLACE(coords)) PDL->pdl_barf("repulse: coords->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(coords)) PDL->pdl_barf("repulse: coords->inplace but not supported"); |
0 |
1 |
1 |
|
| 175 |
1 |
| PDL->barf_if_error(pdl_run_repulse(coords,vecs,boxsize,dmult,a,b,c,d)); |
| 176 |
1 |
▶ | PDL_XS_RETURN(ST(0) = vecs_SV) |
Branch: 5 branches
| Branch | True | False | Total |
| PDL_XS_RETURN(ST(0) = vecs_SV) |
1 |
0 |
1 |
| PDL_XS_RETURN(ST(0) = vecs_SV) |
1 |
0 |
1 |
| PDL_XS_RETURN(ST(0) = vecs_SV) |
1 |
0 |
1 |
| PDL_XS_RETURN(ST(0) = vecs_SV) |
0 |
1 |
1 |
| PDL_XS_RETURN(ST(0) = vecs_SV) |
0 |
0 |
0 |
|
| 177 |
|
| |
| 178 |
|
| void |
| 179 |
|
| pdl_run_attract(coords, from, to, strength, vecs=vecs, m=m, ms=ms) |
| 180 |
|
| SV *vecs_SV = (items == 7) ? ST(4) : NULL; |
| 181 |
|
| SV *m_SV = (items == 7) ? ST(5) : ST(4); |
| 182 |
|
| SV *ms_SV = (items == 7) ? ST(6) : ST(5); |
| 183 |
|
| PREINIT: |
| 184 |
1 |
▶ | PDL_XS_PREAMBLE((items == 7) ? 0 : 1); |
Branch: 10 branches
| Branch | True | False | Total |
| PDL_XS_PREAMBLE((items == 7) ? 0 : 1); |
1 |
0 |
1 |
| PDL_XS_PREAMBLE((items == 7) ? 0 : 1); |
0 |
1 |
1 |
| PDL_XS_PREAMBLE((items == 7) ? 0 : 1); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 7) ? 0 : 1); |
1 |
0 |
1 |
| PDL_XS_PREAMBLE((items == 7) ? 0 : 1); |
1 |
0 |
1 |
| PDL_XS_PREAMBLE((items == 7) ? 0 : 1); |
1 |
0 |
1 |
| PDL_XS_PREAMBLE((items == 7) ? 0 : 1); |
0 |
1 |
1 |
| PDL_XS_PREAMBLE((items == 7) ? 0 : 1); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 7) ? 0 : 1); |
1 |
0 |
1 |
| PDL_XS_PREAMBLE((items == 7) ? 0 : 1); |
0 |
1 |
1 |
|
| 185 |
1 |
▶ | if (!((items == 6) || (items == 7))) |
Branch: 2 branches
| Branch | True | False | Total |
| if (!((items == 6) || (items == 7))) |
0 |
1 |
1 |
| if (!((items == 6) || (items == 7))) |
0 |
0 |
0 |
|
| 186 |
0 |
| croak("Usage: PDL::attract(coords,from,to,strength,[vecs],m,ms) (you may leave [outputs] and values with =defaults out of list)"); |
| 187 |
|
| INPUT: |
| 188 |
|
| pdl *coords |
| 189 |
|
| pdl *from |
| 190 |
|
| pdl *to |
| 191 |
|
| pdl *strength |
| 192 |
|
| pdl *vecs=NO_INIT |
| 193 |
|
| double m; { m = (double)SvNV(m_SV); } |
| 194 |
|
| double ms; { ms = (double)SvNV(ms_SV); } |
| 195 |
|
| PPCODE: |
| 196 |
1 |
▶ | if (vecs_SV) { vecs = PDL_CORE_(SvPDLV)(vecs_SV); } else vecs = PDL_XS_PERLINIT_initsv(vecs_SV); |
Branch: 2 branches
| Branch | True | False | Total |
| if (vecs_SV) { vecs = PDL_CORE_(SvPDLV)(vecs_SV); } else vecs = PDL_XS_PERLINIT_initsv(vecs_SV); |
0 |
1 |
1 |
| if (vecs_SV) { vecs = PDL_CORE_(SvPDLV)(vecs_SV); } else vecs = PDL_XS_PERLINIT_initsv(vecs_SV); |
0 |
1 |
1 |
|
| 197 |
1 |
▶ | if (PDL_IS_INPLACE(coords)) PDL->pdl_barf("attract: coords->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(coords)) PDL->pdl_barf("attract: coords->inplace but not supported"); |
0 |
1 |
1 |
|
| 198 |
1 |
▶ | if (PDL_IS_INPLACE(from)) PDL->pdl_barf("attract: from->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(from)) PDL->pdl_barf("attract: from->inplace but not supported"); |
0 |
1 |
1 |
|
| 199 |
1 |
▶ | if (PDL_IS_INPLACE(to)) PDL->pdl_barf("attract: to->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(to)) PDL->pdl_barf("attract: to->inplace but not supported"); |
0 |
1 |
1 |
|
| 200 |
1 |
▶ | if (PDL_IS_INPLACE(strength)) PDL->pdl_barf("attract: strength->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(strength)) PDL->pdl_barf("attract: strength->inplace but not supported"); |
0 |
1 |
1 |
|
| 201 |
1 |
| PDL->barf_if_error(pdl_run_attract(coords,from,to,strength,vecs,m,ms)); |
| 202 |
1 |
▶ | PDL_XS_RETURN(ST(0) = vecs_SV) |
Branch: 5 branches
| Branch | True | False | Total |
| PDL_XS_RETURN(ST(0) = vecs_SV) |
1 |
0 |
1 |
| PDL_XS_RETURN(ST(0) = vecs_SV) |
1 |
0 |
1 |
| PDL_XS_RETURN(ST(0) = vecs_SV) |
1 |
0 |
1 |
| PDL_XS_RETURN(ST(0) = vecs_SV) |
0 |
1 |
1 |
| PDL_XS_RETURN(ST(0) = vecs_SV) |
0 |
0 |
0 |
|
| 203 |
|
| |
| 204 |
|
| |
| 205 |
|
| #line 483 "lib/PDL/PP.pm" |
| 206 |
|
| BOOT: |
| 207 |
|
| /* Get pointer to structure of core shared C routines */ |
| 208 |
|
| /* make sure PDL::Core is loaded */ |
| 209 |
|
| #line 210 "lib/PDL/ImageND.xs" |
| 210 |
5 |
| perl_require_pv ("PDL/Core.pm"); /* make sure PDL::Core is loaded */ |
| 211 |
|
| #ifndef aTHX_ |
| 212 |
|
| #define aTHX_ |
| 213 |
|
| #endif |
| 214 |
5 |
▶ | if (SvTRUE (ERRSV)) Perl_croak(aTHX_ "%s",SvPV_nolen (ERRSV)); |
Branch: 3 branches
| Branch | True | False | Total |
| if (SvTRUE (ERRSV)) Perl_croak(aTHX_ "%s",SvPV_nolen (ERRSV)); |
5 |
0 |
5 |
| if (SvTRUE (ERRSV)) Perl_croak(aTHX_ "%s",SvPV_nolen (ERRSV)); |
0 |
5 |
5 |
| if (SvTRUE (ERRSV)) Perl_croak(aTHX_ "%s",SvPV_nolen (ERRSV)); |
0 |
0 |
0 |
|
| 215 |
5 |
| SV* CoreSV = perl_get_sv("PDL::SHARE",FALSE); /* var with core structure */ |
| 216 |
5 |
▶ | if (!CoreSV) |
Branch: 1 branch
| Branch | True | False | Total |
| if (!CoreSV) |
0 |
5 |
5 |
|
| 217 |
0 |
| Perl_croak(aTHX_ "We require the PDL::Core module, which was not found"); |
| 218 |
5 |
▶ | if (!(PDL = INT2PTR(Core*,SvIV( CoreSV )))) /* Core* value */ |
Branch: 1 branch
| Branch | True | False | Total |
| if (!(PDL = INT2PTR(Core*,SvIV( CoreSV )))) /* Core* value */ |
0 |
5 |
5 |
|
| 219 |
0 |
| Perl_croak(aTHX_ "Got NULL pointer for PDL"); |
| 220 |
5 |
▶ | if (PDL->Version != PDL_CORE_VERSION) |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL->Version != PDL_CORE_VERSION) |
0 |
5 |
5 |
|
| 221 |
0 |
| Perl_croak(aTHX_ "[PDL->Version: %ld PDL_CORE_VERSION: %ld XS_VERSION: %s] PDL::ImageND needs to be recompiled against the newly installed PDL", (long int)PDL->Version, (long int)PDL_CORE_VERSION, XS_VERSION); |