| 1 |
|
| |
| 2 |
|
| #line 453 "lib/PDL/PP.pm" |
| 3 |
|
| /* |
| 4 |
|
| * THIS FILE WAS GENERATED BY PDL::PP from lib/PDL/MatrixOps.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_MatrixOps |
| 21 |
|
| extern Core* PDL; /* Structure hold core C functions */ |
| 22 |
|
| #line 23 "lib/PDL/MatrixOps.xs" |
| 23 |
|
| |
| 24 |
|
| #include <math.h> |
| 25 |
|
| pdl_error pdl_run_eigens_sym(pdl *a,pdl *ev,pdl *e); |
| 26 |
|
| pdl_error pdl_run_eigens(pdl *a,pdl *ev,pdl *e); |
| 27 |
|
| pdl_error pdl_run_svd(pdl *a,pdl *u,pdl *s,pdl *v,int full); |
| 28 |
|
| pdl_error pdl_run_simq(pdl *a,pdl *b,pdl *x,pdl *ips,int flag); |
| 29 |
|
| pdl_error pdl_run_squaretotri(pdl *a,pdl *b); |
| 30 |
|
| pdl_error pdl_run_tritosquare(pdl *a,pdl *b); |
| 31 |
|
| pdl_error pdl_run_tricpy(pdl *A,pdl *C,int uplo); |
| 32 |
|
| pdl_error pdl_run_mstack(pdl *x,pdl *y,pdl *out); |
| 33 |
|
| pdl_error pdl_run_augment(pdl *x,pdl *y,pdl *out); |
| 34 |
|
| |
| 35 |
|
| #line 449 "lib/PDL/PP.pm" |
| 36 |
|
| #include "pdlperl.h" |
| 37 |
|
| #line 38 "lib/PDL/MatrixOps.xs" |
| 38 |
|
| |
| 39 |
|
| Core* PDL = NULL; /* Structure hold core C functions */ |
| 40 |
|
| |
| 41 |
|
| MODULE = PDL::MatrixOps PACKAGE = PDL PREFIX=pdl_run_ |
| 42 |
|
| |
| 43 |
|
| PROTOTYPES: DISABLE |
| 44 |
|
| |
| 45 |
|
| |
| 46 |
|
| void |
| 47 |
|
| _eigens_sym_int(a,ev,e) |
| 48 |
|
| pdl *a |
| 49 |
|
| pdl *ev |
| 50 |
|
| pdl *e |
| 51 |
|
| CODE: |
| 52 |
5 |
| PDL->barf_if_error(pdl_run_eigens_sym(a,ev,e)); |
| 53 |
|
| |
| 54 |
|
| void |
| 55 |
|
| _eigens_int(a,ev,e) |
| 56 |
|
| pdl *a |
| 57 |
|
| pdl *ev |
| 58 |
|
| pdl *e |
| 59 |
|
| CODE: |
| 60 |
4 |
| PDL->barf_if_error(pdl_run_eigens(a,ev,e)); |
| 61 |
|
| |
| 62 |
|
| void |
| 63 |
|
| pdl_run_svd(a, u=u, s=s, v=v, full=full) |
| 64 |
|
| SV *u_SV = (items == 5) ? ST(1) : NULL; |
| 65 |
|
| SV *s_SV = (items == 5) ? ST(2) : NULL; |
| 66 |
|
| SV *v_SV = (items == 5) ? ST(3) : NULL; |
| 67 |
|
| SV *full_SV = (items == 5) ? ST(4) : !(items == (2-1)) ? ST(1) : NULL; |
| 68 |
|
| PREINIT: |
| 69 |
30 |
▶ | PDL_XS_PREAMBLE((items == 5) ? 0 : 3); |
Branch: 11 branches
| Branch | True | False | Total |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 3); |
0 |
30 |
30 |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 3); |
30 |
0 |
30 |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 3); |
0 |
30 |
30 |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 3); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 3); |
30 |
0 |
30 |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 3); |
30 |
0 |
30 |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 3); |
30 |
0 |
30 |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 3); |
0 |
30 |
30 |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 3); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 3); |
30 |
0 |
30 |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 3); |
0 |
30 |
30 |
|
| 70 |
30 |
▶ | if (!((items == (2-1)) || (items == 2) || (items == 5))) |
Branch: 3 branches
| Branch | True | False | Total |
| if (!((items == (2-1)) || (items == 2) || (items == 5))) |
7 |
23 |
30 |
| if (!((items == (2-1)) || (items == 2) || (items == 5))) |
0 |
7 |
7 |
| if (!((items == (2-1)) || (items == 2) || (items == 5))) |
0 |
0 |
0 |
|
| 71 |
0 |
| croak("Usage: PDL::svd(a,[u],[s],[v],full=0) (you may leave [outputs] and values with =defaults out of list)"); |
| 72 |
|
| INPUT: |
| 73 |
|
| pdl *a |
| 74 |
|
| pdl *u=NO_INIT |
| 75 |
|
| pdl *s=NO_INIT |
| 76 |
|
| pdl *v=NO_INIT |
| 77 |
|
| int full=NO_INIT |
| 78 |
|
| PPCODE: |
| 79 |
30 |
▶ | if (!full_SV) { full = (0); } else { full = (int)SvIV(full_SV); } |
Branch: 1 branch
| Branch | True | False | Total |
| if (!full_SV) { full = (0); } else { full = (int)SvIV(full_SV); } |
23 |
7 |
30 |
|
| 80 |
30 |
▶ | if (u_SV) { u = PDL_CORE_(SvPDLV)(u_SV); } else u = PDL_XS_PERLINIT_initsv(u_SV); |
Branch: 2 branches
| Branch | True | False | Total |
| if (u_SV) { u = PDL_CORE_(SvPDLV)(u_SV); } else u = PDL_XS_PERLINIT_initsv(u_SV); |
0 |
30 |
30 |
| if (u_SV) { u = PDL_CORE_(SvPDLV)(u_SV); } else u = PDL_XS_PERLINIT_initsv(u_SV); |
0 |
30 |
30 |
|
| 81 |
30 |
▶ | if (s_SV) { s = PDL_CORE_(SvPDLV)(s_SV); } else s = PDL_XS_PERLINIT_initsv(s_SV); |
Branch: 2 branches
| Branch | True | False | Total |
| if (s_SV) { s = PDL_CORE_(SvPDLV)(s_SV); } else s = PDL_XS_PERLINIT_initsv(s_SV); |
0 |
30 |
30 |
| if (s_SV) { s = PDL_CORE_(SvPDLV)(s_SV); } else s = PDL_XS_PERLINIT_initsv(s_SV); |
0 |
30 |
30 |
|
| 82 |
30 |
▶ | if (v_SV) { v = PDL_CORE_(SvPDLV)(v_SV); } else v = PDL_XS_PERLINIT_initsv(v_SV); |
Branch: 2 branches
| Branch | True | False | Total |
| if (v_SV) { v = PDL_CORE_(SvPDLV)(v_SV); } else v = PDL_XS_PERLINIT_initsv(v_SV); |
0 |
30 |
30 |
| if (v_SV) { v = PDL_CORE_(SvPDLV)(v_SV); } else v = PDL_XS_PERLINIT_initsv(v_SV); |
0 |
30 |
30 |
|
| 83 |
30 |
▶ | if (PDL_IS_INPLACE(a)) PDL->pdl_barf("svd: a->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(a)) PDL->pdl_barf("svd: a->inplace but not supported"); |
0 |
30 |
30 |
|
| 84 |
30 |
| PDL->barf_if_error(pdl_run_svd(a,u,s,v,full)); |
| 85 |
30 |
▶ | PDL_XS_RETURN(ST(0) = u_SV;ST(1) = s_SV;ST(2) = v_SV) |
Branch: 5 branches
| Branch | True | False | Total |
| PDL_XS_RETURN(ST(0) = u_SV;ST(1) = s_SV;ST(2) = v_SV) |
30 |
0 |
30 |
| PDL_XS_RETURN(ST(0) = u_SV;ST(1) = s_SV;ST(2) = v_SV) |
30 |
0 |
30 |
| PDL_XS_RETURN(ST(0) = u_SV;ST(1) = s_SV;ST(2) = v_SV) |
30 |
0 |
30 |
| PDL_XS_RETURN(ST(0) = u_SV;ST(1) = s_SV;ST(2) = v_SV) |
0 |
30 |
30 |
| PDL_XS_RETURN(ST(0) = u_SV;ST(1) = s_SV;ST(2) = v_SV) |
0 |
0 |
0 |
|
| 86 |
|
| |
| 87 |
|
| void |
| 88 |
|
| pdl_run_simq(a, b, x=x, ips=ips, flag=flag) |
| 89 |
|
| SV *x_SV = (items == 5) ? ST(2) : NULL; |
| 90 |
|
| SV *ips_SV = (items == 5) ? ST(3) : NULL; |
| 91 |
|
| SV *flag_SV = (items == 5) ? ST(4) : ST(2); |
| 92 |
|
| PREINIT: |
| 93 |
7 |
▶ | PDL_XS_PREAMBLE((items == 5) ? 0 : 2); |
Branch: 11 branches
| Branch | True | False | Total |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 2); |
3 |
4 |
7 |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 2); |
7 |
0 |
7 |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 2); |
0 |
7 |
7 |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 2); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 2); |
7 |
0 |
7 |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 2); |
7 |
0 |
7 |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 2); |
7 |
0 |
7 |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 2); |
0 |
7 |
7 |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 2); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 2); |
7 |
0 |
7 |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 2); |
0 |
7 |
7 |
|
| 94 |
7 |
▶ | if (!((items == 3) || (items == 5))) |
Branch: 2 branches
| Branch | True | False | Total |
| if (!((items == 3) || (items == 5))) |
3 |
4 |
7 |
| if (!((items == 3) || (items == 5))) |
0 |
3 |
3 |
|
| 95 |
0 |
| croak("Usage: PDL::simq(a,b,[x],[ips],flag) (you may leave [outputs] and values with =defaults out of list)"); |
| 96 |
|
| INPUT: |
| 97 |
|
| pdl *a |
| 98 |
|
| pdl *b |
| 99 |
|
| pdl *x=NO_INIT |
| 100 |
|
| pdl *ips=NO_INIT |
| 101 |
|
| int flag; { flag = (int)SvIV(flag_SV); } |
| 102 |
|
| PPCODE: |
| 103 |
7 |
▶ | if (x_SV) { x = PDL_CORE_(SvPDLV)(x_SV); } else x = PDL_XS_PERLINIT_initsv(x_SV); |
Branch: 2 branches
| Branch | True | False | Total |
| if (x_SV) { x = PDL_CORE_(SvPDLV)(x_SV); } else x = PDL_XS_PERLINIT_initsv(x_SV); |
3 |
4 |
7 |
| if (x_SV) { x = PDL_CORE_(SvPDLV)(x_SV); } else x = PDL_XS_PERLINIT_initsv(x_SV); |
0 |
4 |
4 |
|
| 104 |
7 |
▶ | if (ips_SV) { ips = PDL_CORE_(SvPDLV)(ips_SV); } else ips = PDL_XS_PERLINIT_initsv(ips_SV); |
Branch: 2 branches
| Branch | True | False | Total |
| if (ips_SV) { ips = PDL_CORE_(SvPDLV)(ips_SV); } else ips = PDL_XS_PERLINIT_initsv(ips_SV); |
3 |
4 |
7 |
| if (ips_SV) { ips = PDL_CORE_(SvPDLV)(ips_SV); } else ips = PDL_XS_PERLINIT_initsv(ips_SV); |
0 |
4 |
4 |
|
| 105 |
7 |
▶ | if (PDL_IS_INPLACE(a)) PDL->pdl_barf("simq: a->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(a)) PDL->pdl_barf("simq: a->inplace but not supported"); |
0 |
7 |
7 |
|
| 106 |
7 |
▶ | if (PDL_IS_INPLACE(b)) PDL->pdl_barf("simq: b->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(b)) PDL->pdl_barf("simq: b->inplace but not supported"); |
0 |
7 |
7 |
|
| 107 |
7 |
| PDL->barf_if_error(pdl_run_simq(a,b,x,ips,flag)); |
| 108 |
4 |
▶ | PDL_XS_RETURN(ST(0) = x_SV;ST(1) = ips_SV) |
Branch: 5 branches
| Branch | True | False | Total |
| PDL_XS_RETURN(ST(0) = x_SV;ST(1) = ips_SV) |
3 |
1 |
4 |
| PDL_XS_RETURN(ST(0) = x_SV;ST(1) = ips_SV) |
3 |
0 |
3 |
| PDL_XS_RETURN(ST(0) = x_SV;ST(1) = ips_SV) |
3 |
0 |
3 |
| PDL_XS_RETURN(ST(0) = x_SV;ST(1) = ips_SV) |
0 |
3 |
3 |
| PDL_XS_RETURN(ST(0) = x_SV;ST(1) = ips_SV) |
0 |
1 |
1 |
|
| 109 |
|
| |
| 110 |
|
| void |
| 111 |
|
| pdl_run_squaretotri(a, b=PDL_XS_PERLINIT_initsv(b_SV)) |
| 112 |
|
| SV *b_SV = items > 1 ? ST(1) : NULL; |
| 113 |
|
| PREINIT: |
| 114 |
9 |
▶ | PDL_XS_PREAMBLE((items == 2) ? 0 : 1); |
Branch: 10 branches
| Branch | True | False | Total |
| PDL_XS_PREAMBLE((items == 2) ? 0 : 1); |
9 |
0 |
9 |
| PDL_XS_PREAMBLE((items == 2) ? 0 : 1); |
0 |
9 |
9 |
| PDL_XS_PREAMBLE((items == 2) ? 0 : 1); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 2) ? 0 : 1); |
9 |
0 |
9 |
| PDL_XS_PREAMBLE((items == 2) ? 0 : 1); |
9 |
0 |
9 |
| PDL_XS_PREAMBLE((items == 2) ? 0 : 1); |
9 |
0 |
9 |
| PDL_XS_PREAMBLE((items == 2) ? 0 : 1); |
0 |
9 |
9 |
| PDL_XS_PREAMBLE((items == 2) ? 0 : 1); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 2) ? 0 : 1); |
9 |
0 |
9 |
| PDL_XS_PREAMBLE((items == 2) ? 0 : 1); |
0 |
9 |
9 |
|
| 115 |
|
| INPUT: |
| 116 |
|
| pdl *a |
| 117 |
|
| pdl *b |
| 118 |
|
| PPCODE: |
| 119 |
9 |
▶ | if (PDL_IS_INPLACE(a)) PDL->pdl_barf("squaretotri: a->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(a)) PDL->pdl_barf("squaretotri: a->inplace but not supported"); |
0 |
9 |
9 |
|
| 120 |
9 |
| PDL->barf_if_error(pdl_run_squaretotri(a,b)); |
| 121 |
8 |
▶ | PDL_XS_RETURN(ST(0) = b_SV) |
Branch: 5 branches
| Branch | True | False | Total |
| PDL_XS_RETURN(ST(0) = b_SV) |
7 |
1 |
8 |
| PDL_XS_RETURN(ST(0) = b_SV) |
7 |
0 |
7 |
| PDL_XS_RETURN(ST(0) = b_SV) |
7 |
0 |
7 |
| PDL_XS_RETURN(ST(0) = b_SV) |
0 |
7 |
7 |
| PDL_XS_RETURN(ST(0) = b_SV) |
0 |
1 |
1 |
|
| 122 |
|
| |
| 123 |
|
| void |
| 124 |
|
| pdl_run_tritosquare(a, b=PDL_XS_PERLINIT_initsv(b_SV)) |
| 125 |
|
| SV *b_SV = items > 1 ? ST(1) : NULL; |
| 126 |
|
| PREINIT: |
| 127 |
1 |
▶ | PDL_XS_PREAMBLE((items == 2) ? 0 : 1); |
Branch: 10 branches
| Branch | True | False | Total |
| PDL_XS_PREAMBLE((items == 2) ? 0 : 1); |
1 |
0 |
1 |
| PDL_XS_PREAMBLE((items == 2) ? 0 : 1); |
0 |
1 |
1 |
| PDL_XS_PREAMBLE((items == 2) ? 0 : 1); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 2) ? 0 : 1); |
1 |
0 |
1 |
| PDL_XS_PREAMBLE((items == 2) ? 0 : 1); |
1 |
0 |
1 |
| PDL_XS_PREAMBLE((items == 2) ? 0 : 1); |
1 |
0 |
1 |
| PDL_XS_PREAMBLE((items == 2) ? 0 : 1); |
0 |
1 |
1 |
| PDL_XS_PREAMBLE((items == 2) ? 0 : 1); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 2) ? 0 : 1); |
1 |
0 |
1 |
| PDL_XS_PREAMBLE((items == 2) ? 0 : 1); |
0 |
1 |
1 |
|
| 128 |
|
| INPUT: |
| 129 |
|
| pdl *a |
| 130 |
|
| pdl *b |
| 131 |
|
| PPCODE: |
| 132 |
1 |
▶ | if (PDL_IS_INPLACE(a)) PDL->pdl_barf("tritosquare: a->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(a)) PDL->pdl_barf("tritosquare: a->inplace but not supported"); |
0 |
1 |
1 |
|
| 133 |
1 |
| PDL->barf_if_error(pdl_run_tritosquare(a,b)); |
| 134 |
1 |
▶ | PDL_XS_RETURN(ST(0) = b_SV) |
Branch: 5 branches
| Branch | True | False | Total |
| PDL_XS_RETURN(ST(0) = b_SV) |
1 |
0 |
1 |
| PDL_XS_RETURN(ST(0) = b_SV) |
1 |
0 |
1 |
| PDL_XS_RETURN(ST(0) = b_SV) |
1 |
0 |
1 |
| PDL_XS_RETURN(ST(0) = b_SV) |
0 |
1 |
1 |
| PDL_XS_RETURN(ST(0) = b_SV) |
0 |
0 |
0 |
|
| 135 |
|
| |
| 136 |
|
| void |
| 137 |
|
| pdl_run_tricpy(A, uplo=0, C=PDL_XS_PERLINIT_initsv(C_SV)) |
| 138 |
|
| SV *C_SV = items > 2 ? ST(2) : NULL; |
| 139 |
|
| PREINIT: |
| 140 |
13 |
▶ | PDL_XS_PREAMBLE(1); |
Branch: 10 branches
| Branch | True | False | Total |
| PDL_XS_PREAMBLE(1); |
13 |
0 |
13 |
| PDL_XS_PREAMBLE(1); |
0 |
13 |
13 |
| PDL_XS_PREAMBLE(1); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE(1); |
13 |
0 |
13 |
| PDL_XS_PREAMBLE(1); |
13 |
0 |
13 |
| PDL_XS_PREAMBLE(1); |
13 |
0 |
13 |
| PDL_XS_PREAMBLE(1); |
0 |
13 |
13 |
| PDL_XS_PREAMBLE(1); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE(1); |
13 |
0 |
13 |
| PDL_XS_PREAMBLE(1); |
0 |
13 |
13 |
|
| 141 |
|
| INPUT: |
| 142 |
|
| pdl *A |
| 143 |
|
| int uplo |
| 144 |
|
| pdl *C |
| 145 |
|
| PPCODE: |
| 146 |
13 |
▶ | if (PDL_IS_INPLACE(A)) PDL->pdl_barf("tricpy: A->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(A)) PDL->pdl_barf("tricpy: A->inplace but not supported"); |
0 |
13 |
13 |
|
| 147 |
13 |
| PDL->barf_if_error(pdl_run_tricpy(A,C,uplo)); |
| 148 |
13 |
▶ | PDL_XS_RETURN(ST(0) = C_SV) |
Branch: 5 branches
| Branch | True | False | Total |
| PDL_XS_RETURN(ST(0) = C_SV) |
13 |
0 |
13 |
| PDL_XS_RETURN(ST(0) = C_SV) |
13 |
0 |
13 |
| PDL_XS_RETURN(ST(0) = C_SV) |
13 |
0 |
13 |
| PDL_XS_RETURN(ST(0) = C_SV) |
0 |
13 |
13 |
| PDL_XS_RETURN(ST(0) = C_SV) |
0 |
0 |
0 |
|
| 149 |
|
| |
| 150 |
|
| void |
| 151 |
|
| pdl_run_mstack(x, y, out=PDL_XS_PERLINIT_initsv(out_SV)) |
| 152 |
|
| SV *out_SV = items > 2 ? ST(2) : NULL; |
| 153 |
|
| PREINIT: |
| 154 |
1 |
▶ | PDL_XS_PREAMBLE((items == 3) ? 0 : 1); |
Branch: 10 branches
| Branch | True | False | Total |
| PDL_XS_PREAMBLE((items == 3) ? 0 : 1); |
1 |
0 |
1 |
| PDL_XS_PREAMBLE((items == 3) ? 0 : 1); |
0 |
1 |
1 |
| PDL_XS_PREAMBLE((items == 3) ? 0 : 1); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 3) ? 0 : 1); |
1 |
0 |
1 |
| PDL_XS_PREAMBLE((items == 3) ? 0 : 1); |
1 |
0 |
1 |
| PDL_XS_PREAMBLE((items == 3) ? 0 : 1); |
1 |
0 |
1 |
| PDL_XS_PREAMBLE((items == 3) ? 0 : 1); |
0 |
1 |
1 |
| PDL_XS_PREAMBLE((items == 3) ? 0 : 1); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 3) ? 0 : 1); |
1 |
0 |
1 |
| PDL_XS_PREAMBLE((items == 3) ? 0 : 1); |
0 |
1 |
1 |
|
| 155 |
|
| INPUT: |
| 156 |
|
| pdl *x |
| 157 |
|
| pdl *y |
| 158 |
|
| pdl *out |
| 159 |
|
| PPCODE: |
| 160 |
1 |
▶ | if (PDL_IS_INPLACE(x)) PDL->pdl_barf("mstack: x->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(x)) PDL->pdl_barf("mstack: x->inplace but not supported"); |
0 |
1 |
1 |
|
| 161 |
1 |
▶ | if (PDL_IS_INPLACE(y)) PDL->pdl_barf("mstack: y->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(y)) PDL->pdl_barf("mstack: y->inplace but not supported"); |
0 |
1 |
1 |
|
| 162 |
1 |
| PDL->barf_if_error(pdl_run_mstack(x,y,out)); |
| 163 |
1 |
▶ | PDL_XS_RETURN(ST(0) = out_SV) |
Branch: 5 branches
| Branch | True | False | Total |
| PDL_XS_RETURN(ST(0) = out_SV) |
1 |
0 |
1 |
| PDL_XS_RETURN(ST(0) = out_SV) |
1 |
0 |
1 |
| PDL_XS_RETURN(ST(0) = out_SV) |
1 |
0 |
1 |
| PDL_XS_RETURN(ST(0) = out_SV) |
0 |
1 |
1 |
| PDL_XS_RETURN(ST(0) = out_SV) |
0 |
0 |
0 |
|
| 164 |
|
| |
| 165 |
|
| void |
| 166 |
|
| pdl_run_augment(x, y, out=PDL_XS_PERLINIT_initsv(out_SV)) |
| 167 |
|
| SV *out_SV = items > 2 ? ST(2) : NULL; |
| 168 |
|
| PREINIT: |
| 169 |
1 |
▶ | PDL_XS_PREAMBLE((items == 3) ? 0 : 1); |
Branch: 10 branches
| Branch | True | False | Total |
| PDL_XS_PREAMBLE((items == 3) ? 0 : 1); |
1 |
0 |
1 |
| PDL_XS_PREAMBLE((items == 3) ? 0 : 1); |
0 |
1 |
1 |
| PDL_XS_PREAMBLE((items == 3) ? 0 : 1); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 3) ? 0 : 1); |
1 |
0 |
1 |
| PDL_XS_PREAMBLE((items == 3) ? 0 : 1); |
1 |
0 |
1 |
| PDL_XS_PREAMBLE((items == 3) ? 0 : 1); |
1 |
0 |
1 |
| PDL_XS_PREAMBLE((items == 3) ? 0 : 1); |
0 |
1 |
1 |
| PDL_XS_PREAMBLE((items == 3) ? 0 : 1); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 3) ? 0 : 1); |
1 |
0 |
1 |
| PDL_XS_PREAMBLE((items == 3) ? 0 : 1); |
0 |
1 |
1 |
|
| 170 |
|
| INPUT: |
| 171 |
|
| pdl *x |
| 172 |
|
| pdl *y |
| 173 |
|
| pdl *out |
| 174 |
|
| PPCODE: |
| 175 |
1 |
▶ | if (PDL_IS_INPLACE(x)) PDL->pdl_barf("augment: x->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(x)) PDL->pdl_barf("augment: x->inplace but not supported"); |
0 |
1 |
1 |
|
| 176 |
1 |
▶ | if (PDL_IS_INPLACE(y)) PDL->pdl_barf("augment: y->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(y)) PDL->pdl_barf("augment: y->inplace but not supported"); |
0 |
1 |
1 |
|
| 177 |
1 |
| PDL->barf_if_error(pdl_run_augment(x,y,out)); |
| 178 |
1 |
▶ | PDL_XS_RETURN(ST(0) = out_SV) |
Branch: 5 branches
| Branch | True | False | Total |
| PDL_XS_RETURN(ST(0) = out_SV) |
1 |
0 |
1 |
| PDL_XS_RETURN(ST(0) = out_SV) |
1 |
0 |
1 |
| PDL_XS_RETURN(ST(0) = out_SV) |
1 |
0 |
1 |
| PDL_XS_RETURN(ST(0) = out_SV) |
0 |
1 |
1 |
| PDL_XS_RETURN(ST(0) = out_SV) |
0 |
0 |
0 |
|
| 179 |
|
| |
| 180 |
|
| |
| 181 |
|
| #line 483 "lib/PDL/PP.pm" |
| 182 |
|
| BOOT: |
| 183 |
|
| /* Get pointer to structure of core shared C routines */ |
| 184 |
|
| /* make sure PDL::Core is loaded */ |
| 185 |
|
| #line 186 "lib/PDL/MatrixOps.xs" |
| 186 |
71 |
| perl_require_pv ("PDL/Core.pm"); /* make sure PDL::Core is loaded */ |
| 187 |
|
| #ifndef aTHX_ |
| 188 |
|
| #define aTHX_ |
| 189 |
|
| #endif |
| 190 |
71 |
▶ | 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)); |
71 |
0 |
71 |
| if (SvTRUE (ERRSV)) Perl_croak(aTHX_ "%s",SvPV_nolen (ERRSV)); |
0 |
71 |
71 |
| if (SvTRUE (ERRSV)) Perl_croak(aTHX_ "%s",SvPV_nolen (ERRSV)); |
0 |
0 |
0 |
|
| 191 |
71 |
| SV* CoreSV = perl_get_sv("PDL::SHARE",FALSE); /* var with core structure */ |
| 192 |
71 |
▶ | if (!CoreSV) |
Branch: 1 branch
| Branch | True | False | Total |
| if (!CoreSV) |
0 |
71 |
71 |
|
| 193 |
0 |
| Perl_croak(aTHX_ "We require the PDL::Core module, which was not found"); |
| 194 |
71 |
▶ | if (!(PDL = INT2PTR(Core*,SvIV( CoreSV )))) /* Core* value */ |
Branch: 1 branch
| Branch | True | False | Total |
| if (!(PDL = INT2PTR(Core*,SvIV( CoreSV )))) /* Core* value */ |
0 |
71 |
71 |
|
| 195 |
0 |
| Perl_croak(aTHX_ "Got NULL pointer for PDL"); |
| 196 |
71 |
▶ | if (PDL->Version != PDL_CORE_VERSION) |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL->Version != PDL_CORE_VERSION) |
0 |
71 |
71 |
|
| 197 |
0 |
| Perl_croak(aTHX_ "[PDL->Version: %ld PDL_CORE_VERSION: %ld XS_VERSION: %s] PDL::MatrixOps needs to be recompiled against the newly installed PDL", (long int)PDL->Version, (long int)PDL_CORE_VERSION, XS_VERSION); |
| 198 |
71 |
| char *package = "PDL"; |
| 199 |
71 |
| HV* stash = gv_stashpvn(package, strlen(package), TRUE); |
| 200 |
71 |
| char *meths[] = {"mstack","augment",NULL}, **methsptr = meths; |
| 201 |
213 |
▶ | for (; *methsptr; methsptr++) { |
Branch: 1 branch
| Branch | True | False | Total |
| for (; *methsptr; methsptr++) { |
142 |
71 |
213 |
|
| 202 |
142 |
| SV **meth = hv_fetch(stash, *methsptr, strlen(*methsptr), 0); |
| 203 |
142 |
▶ | if (!meth) croak("No found method '%s' in '%s'", *methsptr, package); |
Branch: 1 branch
| Branch | True | False | Total |
| if (!meth) croak("No found method '%s' in '%s'", *methsptr, package); |
0 |
142 |
142 |
|
| 204 |
142 |
| CV *cv = GvCV(*meth); |
| 205 |
142 |
▶ | if (!cv) croak("No found CV for '%s' in '%s'", *methsptr, package); |
Branch: 1 branch
| Branch | True | False | Total |
| if (!cv) croak("No found CV for '%s' in '%s'", *methsptr, package); |
0 |
142 |
142 |
|
| 206 |
142 |
| CvLVALUE_on(cv); |
| 207 |
|
| } |