| 1 |
|
| |
| 2 |
|
| #line 453 "lib/PDL/PP.pm" |
| 3 |
|
| /* |
| 4 |
|
| * THIS FILE WAS GENERATED BY PDL::PP from HMM.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_HMM |
| 21 |
|
| extern Core* PDL; /* Structure hold core C functions */ |
| 22 |
|
| #line 23 "HMM.xs" |
| 23 |
|
| |
| 24 |
|
| #include <math.h> |
| 25 |
|
| |
| 26 |
|
| /*#define DEBUG_ALPHA*/ |
| 27 |
|
| /*#define DEBUG_BETA*/ |
| 28 |
|
| /*#define DEBUG_VITERBI*/ |
| 29 |
|
| |
| 30 |
|
| |
| 31 |
|
| /* logadd(x,y) = log(exp(x)+exp(y)) |
| 32 |
|
| * + Code from Manning & Schütze (1997), Sec. 9.4, page 337 |
| 33 |
|
| * |
| 34 |
|
| * LOG_BIG = log(1E31) |
| 35 |
|
| */ |
| 36 |
|
| #define LOG_BIG 71.3801378828154 |
| 37 |
|
| #define LOG_ZERO -1E+38 |
| 38 |
|
| #define LOG_ONE 0 |
| 39 |
|
| #define LOG_NONE 1 |
| 40 |
|
| static inline double logadd1(double x, double y) { |
| 41 |
|
| if (y-x > LOG_BIG) return y; |
| 42 |
|
| else if (x-y > LOG_BIG) return x; |
| 43 |
|
| /*else return min(x,y) + log(exp(x-min(x,y)) + exp(y-min(x,y))); */ |
| 44 |
|
| else if (x<y) return x + log( 1 + exp(y-x)); |
| 45 |
|
| else return y + log(exp(x-y) + 1); |
| 46 |
|
| } |
| 47 |
|
| static inline double logadd0(double x, double y) { |
| 48 |
|
| return log(exp(x)+exp(y)); |
| 49 |
|
| } |
| 50 |
|
| |
| 51 |
|
| /* logdiff(x,y) = log(exp(x)-exp(y)) |
| 52 |
|
| * + adapted from above |
| 53 |
|
| * + always returns positive (i.e. symmetric difference) |
| 54 |
|
| */ |
| 55 |
|
| static inline double logdiff1(double x, double y) { |
| 56 |
|
| if (y-x > LOG_BIG) { return y; } |
| 57 |
|
| else if (x-y > LOG_BIG) { return x; } |
| 58 |
|
| /*else { return max(x,y) + log(exp(max(x,y)-max(x,y)) - exp(min(x,y)-max(x,y))); } */ |
| 59 |
|
| /* = max(x,y) + log( 1 - exp(min(x,y)-max(x,y))); } */ |
| 60 |
|
| else if (x>y) { return x + log( 1 - exp(y-x)); } |
| 61 |
|
| else { return y + log( 1 - exp(x-y)); } |
| 62 |
|
| } |
| 63 |
|
| static inline double logdiff0(double x, double y) { |
| 64 |
|
| return log(x>y ? (exp(x)-exp(y)) : (exp(y)-exp(x))); |
| 65 |
|
| } |
| 66 |
|
| |
| 67 |
|
| /* |
| 68 |
|
| #define logadd(x,y) logadd0(x,y) |
| 69 |
|
| #define logdiff(x,y) logdiff0(x,y) |
| 70 |
|
| */ |
| 71 |
|
| |
| 72 |
|
| #define logadd(x,y) logadd1(x,y) |
| 73 |
|
| #define logdiff(x,y) logdiff1(x,y) |
| 74 |
|
| |
| 75 |
|
| pdl_error pdl_run_logzero(pdl *a); |
| 76 |
|
| pdl_error pdl_run_logadd(pdl *a,pdl *b,pdl *c); |
| 77 |
|
| pdl_error pdl_run_logdiff(pdl *a,pdl *b,pdl *c); |
| 78 |
|
| pdl_error pdl_run_logsumover(pdl *a,pdl *b); |
| 79 |
|
| pdl_error pdl_run_hmmfw(pdl *a,pdl *b,pdl *pi,pdl *o,pdl *alpha); |
| 80 |
|
| pdl_error pdl_run_hmmfwq(pdl *a,pdl *b,pdl *pi,pdl *o,pdl *oq,pdl *alphaq); |
| 81 |
|
| pdl_error pdl_run_hmmbw(pdl *a,pdl *b,pdl *omega,pdl *o,pdl *beta); |
| 82 |
|
| pdl_error pdl_run_hmmbwq(pdl *a,pdl *b,pdl *omega,pdl *o,pdl *oq,pdl *betaq); |
| 83 |
|
| pdl_error pdl_run_hmmexpect(pdl *a,pdl *b,pdl *pi,pdl *omega,pdl *o,pdl *alpha,pdl *beta,pdl *ea,pdl *eb,pdl *epi,pdl *eomega); |
| 84 |
|
| pdl_error pdl_run_hmmexpectq(pdl *a,pdl *b,pdl *pi,pdl *omega,pdl *o,pdl *oq,pdl *alphaq,pdl *betaq,pdl *ea,pdl *eb,pdl *epi,pdl *eomega); |
| 85 |
|
| pdl_error pdl_run_hmmviterbi(pdl *a,pdl *b,pdl *pi,pdl *o,pdl *delta,pdl *psi); |
| 86 |
|
| pdl_error pdl_run_hmmviterbiq(pdl *a,pdl *b,pdl *pi,pdl *o,pdl *oq,pdl *deltaq,pdl *psiq); |
| 87 |
|
| pdl_error pdl_run_hmmpath(pdl *psi,pdl *qfinal,pdl *path); |
| 88 |
|
| pdl_error pdl_run_hmmpathq(pdl *oq,pdl *psiq,pdl *qfinalq,pdl *path); |
| 89 |
|
| |
| 90 |
|
| #line 449 "lib/PDL/PP.pm" |
| 91 |
|
| #include "pdlperl.h" |
| 92 |
|
| #line 93 "HMM.xs" |
| 93 |
|
| |
| 94 |
|
| Core* PDL = NULL; /* Structure hold core C functions */ |
| 95 |
|
| |
| 96 |
|
| MODULE = PDL::HMM PACKAGE = PDL PREFIX=pdl_run_ |
| 97 |
|
| |
| 98 |
|
| PROTOTYPES: DISABLE |
| 99 |
|
| |
| 100 |
|
| |
| 101 |
|
| void |
| 102 |
|
| pdl_run_logzero(a=PDL_XS_PERLINIT_initsv(a_SV)) |
| 103 |
|
| SV *a_SV = items > 0 ? ST(0) : NULL; |
| 104 |
|
| PREINIT: |
| 105 |
11 |
▶ | PDL_XS_PREAMBLE((items == 1) ? 0 : 1); |
Branch: 10 branches
| Branch | True | False | Total |
| PDL_XS_PREAMBLE((items == 1) ? 0 : 1); |
0 |
11 |
11 |
| PDL_XS_PREAMBLE((items == 1) ? 0 : 1); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 1) ? 0 : 1); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 1) ? 0 : 1); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 1) ? 0 : 1); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 1) ? 0 : 1); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 1) ? 0 : 1); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 1) ? 0 : 1); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 1) ? 0 : 1); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 1) ? 0 : 1); |
0 |
0 |
0 |
|
| 106 |
|
| INPUT: |
| 107 |
|
| pdl *a |
| 108 |
|
| PPCODE: |
| 109 |
11 |
| PDL->barf_if_error(pdl_run_logzero(a)); |
| 110 |
11 |
▶ | PDL_XS_RETURN(ST(0) = a_SV) |
Branch: 5 branches
| Branch | True | False | Total |
| PDL_XS_RETURN(ST(0) = a_SV) |
11 |
0 |
11 |
| PDL_XS_RETURN(ST(0) = a_SV) |
11 |
0 |
11 |
| PDL_XS_RETURN(ST(0) = a_SV) |
11 |
0 |
11 |
| PDL_XS_RETURN(ST(0) = a_SV) |
0 |
11 |
11 |
| PDL_XS_RETURN(ST(0) = a_SV) |
0 |
0 |
0 |
|
| 111 |
|
| |
| 112 |
|
| void |
| 113 |
|
| pdl_run_logadd(a, b, c=c) |
| 114 |
|
| SV *c_SV = items > 2 ? ST(2) : NULL; |
| 115 |
|
| PREINIT: |
| 116 |
15 |
▶ | PDL_XS_PREAMBLE((items == 3) ? 0 : 1); |
Branch: 10 branches
| Branch | True | False | Total |
| PDL_XS_PREAMBLE((items == 3) ? 0 : 1); |
15 |
0 |
15 |
| PDL_XS_PREAMBLE((items == 3) ? 0 : 1); |
0 |
15 |
15 |
| PDL_XS_PREAMBLE((items == 3) ? 0 : 1); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 3) ? 0 : 1); |
15 |
0 |
15 |
| PDL_XS_PREAMBLE((items == 3) ? 0 : 1); |
15 |
0 |
15 |
| PDL_XS_PREAMBLE((items == 3) ? 0 : 1); |
15 |
0 |
15 |
| PDL_XS_PREAMBLE((items == 3) ? 0 : 1); |
0 |
15 |
15 |
| PDL_XS_PREAMBLE((items == 3) ? 0 : 1); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 3) ? 0 : 1); |
15 |
0 |
15 |
| PDL_XS_PREAMBLE((items == 3) ? 0 : 1); |
0 |
15 |
15 |
|
| 117 |
|
| INPUT: |
| 118 |
|
| pdl *a |
| 119 |
|
| pdl *b |
| 120 |
|
| pdl *c=NO_INIT |
| 121 |
|
| PPCODE: |
| 122 |
15 |
▶ | PDL_XS_INPLACE(a, c) |
Branch: 4 branches
| Branch | True | False | Total |
| PDL_XS_INPLACE(a, c) |
13 |
2 |
15 |
| PDL_XS_INPLACE(a, c) |
0 |
13 |
13 |
| PDL_XS_INPLACE(a, c) |
0 |
2 |
2 |
| PDL_XS_INPLACE(a, c) |
0 |
2 |
2 |
|
| 123 |
15 |
| PDL->barf_if_error(pdl_run_logadd(a,b,c)); |
| 124 |
15 |
▶ | PDL_XS_RETURN(ST(0) = c_SV) |
Branch: 5 branches
| Branch | True | False | Total |
| PDL_XS_RETURN(ST(0) = c_SV) |
15 |
0 |
15 |
| PDL_XS_RETURN(ST(0) = c_SV) |
15 |
0 |
15 |
| PDL_XS_RETURN(ST(0) = c_SV) |
15 |
0 |
15 |
| PDL_XS_RETURN(ST(0) = c_SV) |
0 |
15 |
15 |
| PDL_XS_RETURN(ST(0) = c_SV) |
0 |
0 |
0 |
|
| 125 |
|
| |
| 126 |
|
| void |
| 127 |
|
| pdl_run_logdiff(a, b, c=c) |
| 128 |
|
| SV *c_SV = items > 2 ? ST(2) : NULL; |
| 129 |
|
| PREINIT: |
| 130 |
7 |
▶ | PDL_XS_PREAMBLE((items == 3) ? 0 : 1); |
Branch: 10 branches
| Branch | True | False | Total |
| PDL_XS_PREAMBLE((items == 3) ? 0 : 1); |
7 |
0 |
7 |
| PDL_XS_PREAMBLE((items == 3) ? 0 : 1); |
0 |
7 |
7 |
| PDL_XS_PREAMBLE((items == 3) ? 0 : 1); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 3) ? 0 : 1); |
7 |
0 |
7 |
| PDL_XS_PREAMBLE((items == 3) ? 0 : 1); |
7 |
0 |
7 |
| PDL_XS_PREAMBLE((items == 3) ? 0 : 1); |
7 |
0 |
7 |
| PDL_XS_PREAMBLE((items == 3) ? 0 : 1); |
0 |
7 |
7 |
| PDL_XS_PREAMBLE((items == 3) ? 0 : 1); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 3) ? 0 : 1); |
7 |
0 |
7 |
| PDL_XS_PREAMBLE((items == 3) ? 0 : 1); |
0 |
7 |
7 |
|
| 131 |
|
| INPUT: |
| 132 |
|
| pdl *a |
| 133 |
|
| pdl *b |
| 134 |
|
| pdl *c=NO_INIT |
| 135 |
|
| PPCODE: |
| 136 |
7 |
▶ | PDL_XS_INPLACE(a, c) |
Branch: 4 branches
| Branch | True | False | Total |
| PDL_XS_INPLACE(a, c) |
0 |
7 |
7 |
| PDL_XS_INPLACE(a, c) |
0 |
0 |
0 |
| PDL_XS_INPLACE(a, c) |
0 |
7 |
7 |
| PDL_XS_INPLACE(a, c) |
0 |
7 |
7 |
|
| 137 |
7 |
| PDL->barf_if_error(pdl_run_logdiff(a,b,c)); |
| 138 |
7 |
▶ | PDL_XS_RETURN(ST(0) = c_SV) |
Branch: 5 branches
| Branch | True | False | Total |
| PDL_XS_RETURN(ST(0) = c_SV) |
7 |
0 |
7 |
| PDL_XS_RETURN(ST(0) = c_SV) |
7 |
0 |
7 |
| PDL_XS_RETURN(ST(0) = c_SV) |
7 |
0 |
7 |
| PDL_XS_RETURN(ST(0) = c_SV) |
0 |
7 |
7 |
| PDL_XS_RETURN(ST(0) = c_SV) |
0 |
0 |
0 |
|
| 139 |
|
| |
| 140 |
|
| void |
| 141 |
|
| pdl_run_logsumover(a, b=PDL_XS_PERLINIT_initsv(b_SV)) |
| 142 |
|
| SV *b_SV = items > 1 ? ST(1) : NULL; |
| 143 |
|
| PREINIT: |
| 144 |
19 |
▶ | PDL_XS_PREAMBLE((items == 2) ? 0 : 1); |
Branch: 10 branches
| Branch | True | False | Total |
| PDL_XS_PREAMBLE((items == 2) ? 0 : 1); |
19 |
0 |
19 |
| PDL_XS_PREAMBLE((items == 2) ? 0 : 1); |
0 |
19 |
19 |
| PDL_XS_PREAMBLE((items == 2) ? 0 : 1); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 2) ? 0 : 1); |
19 |
0 |
19 |
| PDL_XS_PREAMBLE((items == 2) ? 0 : 1); |
19 |
0 |
19 |
| PDL_XS_PREAMBLE((items == 2) ? 0 : 1); |
19 |
0 |
19 |
| PDL_XS_PREAMBLE((items == 2) ? 0 : 1); |
0 |
19 |
19 |
| PDL_XS_PREAMBLE((items == 2) ? 0 : 1); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 2) ? 0 : 1); |
19 |
0 |
19 |
| PDL_XS_PREAMBLE((items == 2) ? 0 : 1); |
0 |
19 |
19 |
|
| 145 |
|
| INPUT: |
| 146 |
|
| pdl *a |
| 147 |
|
| pdl *b |
| 148 |
|
| PPCODE: |
| 149 |
19 |
▶ | if (PDL_IS_INPLACE(a)) PDL->pdl_barf("logsumover: a->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(a)) PDL->pdl_barf("logsumover: a->inplace but not supported"); |
0 |
19 |
19 |
|
| 150 |
19 |
| PDL->barf_if_error(pdl_run_logsumover(a,b)); |
| 151 |
19 |
▶ | PDL_XS_RETURN(ST(0) = b_SV) |
Branch: 5 branches
| Branch | True | False | Total |
| PDL_XS_RETURN(ST(0) = b_SV) |
19 |
0 |
19 |
| PDL_XS_RETURN(ST(0) = b_SV) |
19 |
0 |
19 |
| PDL_XS_RETURN(ST(0) = b_SV) |
19 |
0 |
19 |
| PDL_XS_RETURN(ST(0) = b_SV) |
0 |
19 |
19 |
| PDL_XS_RETURN(ST(0) = b_SV) |
0 |
0 |
0 |
|
| 152 |
|
| |
| 153 |
|
| void |
| 154 |
|
| pdl_run_hmmfw(a, b, pi, o, alpha=PDL_XS_PERLINIT_initsv(alpha_SV)) |
| 155 |
|
| SV *alpha_SV = items > 4 ? ST(4) : NULL; |
| 156 |
|
| PREINIT: |
| 157 |
13 |
▶ | PDL_XS_PREAMBLE((items == 5) ? 0 : 1); |
Branch: 10 branches
| Branch | True | False | Total |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 1); |
13 |
0 |
13 |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 1); |
0 |
13 |
13 |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 1); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 1); |
13 |
0 |
13 |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 1); |
13 |
0 |
13 |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 1); |
13 |
0 |
13 |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 1); |
0 |
13 |
13 |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 1); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 1); |
13 |
0 |
13 |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 1); |
0 |
13 |
13 |
|
| 158 |
|
| INPUT: |
| 159 |
|
| pdl *a |
| 160 |
|
| pdl *b |
| 161 |
|
| pdl *pi |
| 162 |
|
| pdl *o |
| 163 |
|
| pdl *alpha |
| 164 |
|
| PPCODE: |
| 165 |
13 |
▶ | if (PDL_IS_INPLACE(a)) PDL->pdl_barf("hmmfw: a->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(a)) PDL->pdl_barf("hmmfw: a->inplace but not supported"); |
0 |
13 |
13 |
|
| 166 |
13 |
▶ | if (PDL_IS_INPLACE(b)) PDL->pdl_barf("hmmfw: b->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(b)) PDL->pdl_barf("hmmfw: b->inplace but not supported"); |
0 |
13 |
13 |
|
| 167 |
13 |
▶ | if (PDL_IS_INPLACE(pi)) PDL->pdl_barf("hmmfw: pi->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(pi)) PDL->pdl_barf("hmmfw: pi->inplace but not supported"); |
0 |
13 |
13 |
|
| 168 |
13 |
▶ | if (PDL_IS_INPLACE(o)) PDL->pdl_barf("hmmfw: o->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(o)) PDL->pdl_barf("hmmfw: o->inplace but not supported"); |
0 |
13 |
13 |
|
| 169 |
13 |
| PDL->barf_if_error(pdl_run_hmmfw(a,b,pi,o,alpha)); |
| 170 |
13 |
▶ | PDL_XS_RETURN(ST(0) = alpha_SV) |
Branch: 5 branches
| Branch | True | False | Total |
| PDL_XS_RETURN(ST(0) = alpha_SV) |
13 |
0 |
13 |
| PDL_XS_RETURN(ST(0) = alpha_SV) |
13 |
0 |
13 |
| PDL_XS_RETURN(ST(0) = alpha_SV) |
13 |
0 |
13 |
| PDL_XS_RETURN(ST(0) = alpha_SV) |
0 |
13 |
13 |
| PDL_XS_RETURN(ST(0) = alpha_SV) |
0 |
0 |
0 |
|
| 171 |
|
| |
| 172 |
|
| void |
| 173 |
|
| pdl_run_hmmfwq(a, b, pi, o, oq, alphaq=PDL_XS_PERLINIT_initsv(alphaq_SV)) |
| 174 |
|
| SV *alphaq_SV = items > 5 ? ST(5) : NULL; |
| 175 |
|
| PREINIT: |
| 176 |
0 |
▶ | PDL_XS_PREAMBLE((items == 6) ? 0 : 1); |
Branch: 10 branches
| Branch | True | False | Total |
| PDL_XS_PREAMBLE((items == 6) ? 0 : 1); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 6) ? 0 : 1); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 6) ? 0 : 1); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 6) ? 0 : 1); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 6) ? 0 : 1); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 6) ? 0 : 1); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 6) ? 0 : 1); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 6) ? 0 : 1); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 6) ? 0 : 1); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 6) ? 0 : 1); |
0 |
0 |
0 |
|
| 177 |
|
| INPUT: |
| 178 |
|
| pdl *a |
| 179 |
|
| pdl *b |
| 180 |
|
| pdl *pi |
| 181 |
|
| pdl *o |
| 182 |
|
| pdl *oq |
| 183 |
|
| pdl *alphaq |
| 184 |
|
| PPCODE: |
| 185 |
0 |
▶ | if (PDL_IS_INPLACE(a)) PDL->pdl_barf("hmmfwq: a->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(a)) PDL->pdl_barf("hmmfwq: a->inplace but not supported"); |
0 |
0 |
0 |
|
| 186 |
0 |
▶ | if (PDL_IS_INPLACE(b)) PDL->pdl_barf("hmmfwq: b->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(b)) PDL->pdl_barf("hmmfwq: b->inplace but not supported"); |
0 |
0 |
0 |
|
| 187 |
0 |
▶ | if (PDL_IS_INPLACE(pi)) PDL->pdl_barf("hmmfwq: pi->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(pi)) PDL->pdl_barf("hmmfwq: pi->inplace but not supported"); |
0 |
0 |
0 |
|
| 188 |
0 |
▶ | if (PDL_IS_INPLACE(o)) PDL->pdl_barf("hmmfwq: o->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(o)) PDL->pdl_barf("hmmfwq: o->inplace but not supported"); |
0 |
0 |
0 |
|
| 189 |
0 |
▶ | if (PDL_IS_INPLACE(oq)) PDL->pdl_barf("hmmfwq: oq->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(oq)) PDL->pdl_barf("hmmfwq: oq->inplace but not supported"); |
0 |
0 |
0 |
|
| 190 |
0 |
| PDL->barf_if_error(pdl_run_hmmfwq(a,b,pi,o,oq,alphaq)); |
| 191 |
0 |
▶ | PDL_XS_RETURN(ST(0) = alphaq_SV) |
Branch: 5 branches
| Branch | True | False | Total |
| PDL_XS_RETURN(ST(0) = alphaq_SV) |
0 |
0 |
0 |
| PDL_XS_RETURN(ST(0) = alphaq_SV) |
0 |
0 |
0 |
| PDL_XS_RETURN(ST(0) = alphaq_SV) |
0 |
0 |
0 |
| PDL_XS_RETURN(ST(0) = alphaq_SV) |
0 |
0 |
0 |
| PDL_XS_RETURN(ST(0) = alphaq_SV) |
0 |
0 |
0 |
|
| 192 |
|
| |
| 193 |
|
| void |
| 194 |
|
| pdl_run_hmmbw(a, b, omega, o, beta=PDL_XS_PERLINIT_initsv(beta_SV)) |
| 195 |
|
| SV *beta_SV = items > 4 ? ST(4) : NULL; |
| 196 |
|
| PREINIT: |
| 197 |
7 |
▶ | PDL_XS_PREAMBLE((items == 5) ? 0 : 1); |
Branch: 10 branches
| Branch | True | False | Total |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 1); |
7 |
0 |
7 |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 1); |
0 |
7 |
7 |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 1); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 1); |
7 |
0 |
7 |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 1); |
7 |
0 |
7 |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 1); |
7 |
0 |
7 |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 1); |
0 |
7 |
7 |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 1); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 1); |
7 |
0 |
7 |
| PDL_XS_PREAMBLE((items == 5) ? 0 : 1); |
0 |
7 |
7 |
|
| 198 |
|
| INPUT: |
| 199 |
|
| pdl *a |
| 200 |
|
| pdl *b |
| 201 |
|
| pdl *omega |
| 202 |
|
| pdl *o |
| 203 |
|
| pdl *beta |
| 204 |
|
| PPCODE: |
| 205 |
7 |
▶ | if (PDL_IS_INPLACE(a)) PDL->pdl_barf("hmmbw: a->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(a)) PDL->pdl_barf("hmmbw: a->inplace but not supported"); |
0 |
7 |
7 |
|
| 206 |
7 |
▶ | if (PDL_IS_INPLACE(b)) PDL->pdl_barf("hmmbw: b->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(b)) PDL->pdl_barf("hmmbw: b->inplace but not supported"); |
0 |
7 |
7 |
|
| 207 |
7 |
▶ | if (PDL_IS_INPLACE(omega)) PDL->pdl_barf("hmmbw: omega->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(omega)) PDL->pdl_barf("hmmbw: omega->inplace but not supported"); |
0 |
7 |
7 |
|
| 208 |
7 |
▶ | if (PDL_IS_INPLACE(o)) PDL->pdl_barf("hmmbw: o->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(o)) PDL->pdl_barf("hmmbw: o->inplace but not supported"); |
0 |
7 |
7 |
|
| 209 |
7 |
| PDL->barf_if_error(pdl_run_hmmbw(a,b,omega,o,beta)); |
| 210 |
7 |
▶ | PDL_XS_RETURN(ST(0) = beta_SV) |
Branch: 5 branches
| Branch | True | False | Total |
| PDL_XS_RETURN(ST(0) = beta_SV) |
7 |
0 |
7 |
| PDL_XS_RETURN(ST(0) = beta_SV) |
7 |
0 |
7 |
| PDL_XS_RETURN(ST(0) = beta_SV) |
7 |
0 |
7 |
| PDL_XS_RETURN(ST(0) = beta_SV) |
0 |
7 |
7 |
| PDL_XS_RETURN(ST(0) = beta_SV) |
0 |
0 |
0 |
|
| 211 |
|
| |
| 212 |
|
| void |
| 213 |
|
| pdl_run_hmmbwq(a, b, omega, o, oq, betaq=PDL_XS_PERLINIT_initsv(betaq_SV)) |
| 214 |
|
| SV *betaq_SV = items > 5 ? ST(5) : NULL; |
| 215 |
|
| PREINIT: |
| 216 |
0 |
▶ | PDL_XS_PREAMBLE((items == 6) ? 0 : 1); |
Branch: 10 branches
| Branch | True | False | Total |
| PDL_XS_PREAMBLE((items == 6) ? 0 : 1); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 6) ? 0 : 1); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 6) ? 0 : 1); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 6) ? 0 : 1); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 6) ? 0 : 1); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 6) ? 0 : 1); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 6) ? 0 : 1); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 6) ? 0 : 1); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 6) ? 0 : 1); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 6) ? 0 : 1); |
0 |
0 |
0 |
|
| 217 |
|
| INPUT: |
| 218 |
|
| pdl *a |
| 219 |
|
| pdl *b |
| 220 |
|
| pdl *omega |
| 221 |
|
| pdl *o |
| 222 |
|
| pdl *oq |
| 223 |
|
| pdl *betaq |
| 224 |
|
| PPCODE: |
| 225 |
0 |
▶ | if (PDL_IS_INPLACE(a)) PDL->pdl_barf("hmmbwq: a->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(a)) PDL->pdl_barf("hmmbwq: a->inplace but not supported"); |
0 |
0 |
0 |
|
| 226 |
0 |
▶ | if (PDL_IS_INPLACE(b)) PDL->pdl_barf("hmmbwq: b->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(b)) PDL->pdl_barf("hmmbwq: b->inplace but not supported"); |
0 |
0 |
0 |
|
| 227 |
0 |
▶ | if (PDL_IS_INPLACE(omega)) PDL->pdl_barf("hmmbwq: omega->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(omega)) PDL->pdl_barf("hmmbwq: omega->inplace but not supported"); |
0 |
0 |
0 |
|
| 228 |
0 |
▶ | if (PDL_IS_INPLACE(o)) PDL->pdl_barf("hmmbwq: o->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(o)) PDL->pdl_barf("hmmbwq: o->inplace but not supported"); |
0 |
0 |
0 |
|
| 229 |
0 |
▶ | if (PDL_IS_INPLACE(oq)) PDL->pdl_barf("hmmbwq: oq->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(oq)) PDL->pdl_barf("hmmbwq: oq->inplace but not supported"); |
0 |
0 |
0 |
|
| 230 |
0 |
| PDL->barf_if_error(pdl_run_hmmbwq(a,b,omega,o,oq,betaq)); |
| 231 |
0 |
▶ | PDL_XS_RETURN(ST(0) = betaq_SV) |
Branch: 5 branches
| Branch | True | False | Total |
| PDL_XS_RETURN(ST(0) = betaq_SV) |
0 |
0 |
0 |
| PDL_XS_RETURN(ST(0) = betaq_SV) |
0 |
0 |
0 |
| PDL_XS_RETURN(ST(0) = betaq_SV) |
0 |
0 |
0 |
| PDL_XS_RETURN(ST(0) = betaq_SV) |
0 |
0 |
0 |
| PDL_XS_RETURN(ST(0) = betaq_SV) |
0 |
0 |
0 |
|
| 232 |
|
| |
| 233 |
|
| void |
| 234 |
|
| pdl_run_hmmexpect(a, b, pi, omega, o, alpha, beta, ea=PDL_XS_PERLINIT_initsv(ea_SV), eb=PDL_XS_PERLINIT_initsv(eb_SV), epi=PDL_XS_PERLINIT_initsv(epi_SV), eomega=PDL_XS_PERLINIT_initsv(eomega_SV)) |
| 235 |
|
| SV *ea_SV = items > 7 ? ST(7) : NULL; |
| 236 |
|
| SV *eb_SV = items > 8 ? ST(8) : NULL; |
| 237 |
|
| SV *epi_SV = items > 9 ? ST(9) : NULL; |
| 238 |
|
| SV *eomega_SV = items > 10 ? ST(10) : NULL; |
| 239 |
|
| PREINIT: |
| 240 |
6 |
▶ | PDL_XS_PREAMBLE((items == 11) ? 0 : 4); |
Branch: 11 branches
| Branch | True | False | Total |
| PDL_XS_PREAMBLE((items == 11) ? 0 : 4); |
6 |
0 |
6 |
| PDL_XS_PREAMBLE((items == 11) ? 0 : 4); |
6 |
0 |
6 |
| PDL_XS_PREAMBLE((items == 11) ? 0 : 4); |
0 |
6 |
6 |
| PDL_XS_PREAMBLE((items == 11) ? 0 : 4); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 11) ? 0 : 4); |
6 |
0 |
6 |
| PDL_XS_PREAMBLE((items == 11) ? 0 : 4); |
6 |
0 |
6 |
| PDL_XS_PREAMBLE((items == 11) ? 0 : 4); |
6 |
0 |
6 |
| PDL_XS_PREAMBLE((items == 11) ? 0 : 4); |
0 |
6 |
6 |
| PDL_XS_PREAMBLE((items == 11) ? 0 : 4); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 11) ? 0 : 4); |
6 |
0 |
6 |
| PDL_XS_PREAMBLE((items == 11) ? 0 : 4); |
0 |
6 |
6 |
|
| 241 |
|
| INPUT: |
| 242 |
|
| pdl *a |
| 243 |
|
| pdl *b |
| 244 |
|
| pdl *pi |
| 245 |
|
| pdl *omega |
| 246 |
|
| pdl *o |
| 247 |
|
| pdl *alpha |
| 248 |
|
| pdl *beta |
| 249 |
|
| pdl *ea |
| 250 |
|
| pdl *eb |
| 251 |
|
| pdl *epi |
| 252 |
|
| pdl *eomega |
| 253 |
|
| PPCODE: |
| 254 |
6 |
▶ | if (PDL_IS_INPLACE(a)) PDL->pdl_barf("hmmexpect: a->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(a)) PDL->pdl_barf("hmmexpect: a->inplace but not supported"); |
0 |
6 |
6 |
|
| 255 |
6 |
▶ | if (PDL_IS_INPLACE(b)) PDL->pdl_barf("hmmexpect: b->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(b)) PDL->pdl_barf("hmmexpect: b->inplace but not supported"); |
0 |
6 |
6 |
|
| 256 |
6 |
▶ | if (PDL_IS_INPLACE(pi)) PDL->pdl_barf("hmmexpect: pi->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(pi)) PDL->pdl_barf("hmmexpect: pi->inplace but not supported"); |
0 |
6 |
6 |
|
| 257 |
6 |
▶ | if (PDL_IS_INPLACE(omega)) PDL->pdl_barf("hmmexpect: omega->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(omega)) PDL->pdl_barf("hmmexpect: omega->inplace but not supported"); |
0 |
6 |
6 |
|
| 258 |
6 |
▶ | if (PDL_IS_INPLACE(o)) PDL->pdl_barf("hmmexpect: o->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(o)) PDL->pdl_barf("hmmexpect: o->inplace but not supported"); |
0 |
6 |
6 |
|
| 259 |
6 |
▶ | if (PDL_IS_INPLACE(alpha)) PDL->pdl_barf("hmmexpect: alpha->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(alpha)) PDL->pdl_barf("hmmexpect: alpha->inplace but not supported"); |
0 |
6 |
6 |
|
| 260 |
6 |
▶ | if (PDL_IS_INPLACE(beta)) PDL->pdl_barf("hmmexpect: beta->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(beta)) PDL->pdl_barf("hmmexpect: beta->inplace but not supported"); |
0 |
6 |
6 |
|
| 261 |
6 |
| PDL->barf_if_error(pdl_run_hmmexpect(a,b,pi,omega,o,alpha,beta,ea,eb,epi,eomega)); |
| 262 |
6 |
▶ | PDL_XS_RETURN(ST(0) = ea_SV;ST(1) = eb_SV;ST(2) = epi_SV;ST(3) = eomega_SV) |
Branch: 5 branches
| Branch | True | False | Total |
| PDL_XS_RETURN(ST(0) = ea_SV;ST(1) = eb_SV;ST(2) = epi_SV;ST(3) = eomega_SV) |
0 |
6 |
6 |
| PDL_XS_RETURN(ST(0) = ea_SV;ST(1) = eb_SV;ST(2) = epi_SV;ST(3) = eomega_SV) |
0 |
0 |
0 |
| PDL_XS_RETURN(ST(0) = ea_SV;ST(1) = eb_SV;ST(2) = epi_SV;ST(3) = eomega_SV) |
0 |
0 |
0 |
| PDL_XS_RETURN(ST(0) = ea_SV;ST(1) = eb_SV;ST(2) = epi_SV;ST(3) = eomega_SV) |
0 |
0 |
0 |
| PDL_XS_RETURN(ST(0) = ea_SV;ST(1) = eb_SV;ST(2) = epi_SV;ST(3) = eomega_SV) |
0 |
6 |
6 |
|
| 263 |
|
| |
| 264 |
|
| void |
| 265 |
|
| pdl_run_hmmexpectq(a, b, pi, omega, o, oq, alphaq, betaq, ea=PDL_XS_PERLINIT_initsv(ea_SV), eb=PDL_XS_PERLINIT_initsv(eb_SV), epi=PDL_XS_PERLINIT_initsv(epi_SV), eomega=PDL_XS_PERLINIT_initsv(eomega_SV)) |
| 266 |
|
| SV *ea_SV = items > 8 ? ST(8) : NULL; |
| 267 |
|
| SV *eb_SV = items > 9 ? ST(9) : NULL; |
| 268 |
|
| SV *epi_SV = items > 10 ? ST(10) : NULL; |
| 269 |
|
| SV *eomega_SV = items > 11 ? ST(11) : NULL; |
| 270 |
|
| PREINIT: |
| 271 |
0 |
▶ | PDL_XS_PREAMBLE((items == 12) ? 0 : 4); |
Branch: 11 branches
| Branch | True | False | Total |
| PDL_XS_PREAMBLE((items == 12) ? 0 : 4); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 12) ? 0 : 4); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 12) ? 0 : 4); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 12) ? 0 : 4); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 12) ? 0 : 4); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 12) ? 0 : 4); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 12) ? 0 : 4); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 12) ? 0 : 4); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 12) ? 0 : 4); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 12) ? 0 : 4); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 12) ? 0 : 4); |
0 |
0 |
0 |
|
| 272 |
|
| INPUT: |
| 273 |
|
| pdl *a |
| 274 |
|
| pdl *b |
| 275 |
|
| pdl *pi |
| 276 |
|
| pdl *omega |
| 277 |
|
| pdl *o |
| 278 |
|
| pdl *oq |
| 279 |
|
| pdl *alphaq |
| 280 |
|
| pdl *betaq |
| 281 |
|
| pdl *ea |
| 282 |
|
| pdl *eb |
| 283 |
|
| pdl *epi |
| 284 |
|
| pdl *eomega |
| 285 |
|
| PPCODE: |
| 286 |
0 |
▶ | if (PDL_IS_INPLACE(a)) PDL->pdl_barf("hmmexpectq: a->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(a)) PDL->pdl_barf("hmmexpectq: a->inplace but not supported"); |
0 |
0 |
0 |
|
| 287 |
0 |
▶ | if (PDL_IS_INPLACE(b)) PDL->pdl_barf("hmmexpectq: b->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(b)) PDL->pdl_barf("hmmexpectq: b->inplace but not supported"); |
0 |
0 |
0 |
|
| 288 |
0 |
▶ | if (PDL_IS_INPLACE(pi)) PDL->pdl_barf("hmmexpectq: pi->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(pi)) PDL->pdl_barf("hmmexpectq: pi->inplace but not supported"); |
0 |
0 |
0 |
|
| 289 |
0 |
▶ | if (PDL_IS_INPLACE(omega)) PDL->pdl_barf("hmmexpectq: omega->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(omega)) PDL->pdl_barf("hmmexpectq: omega->inplace but not supported"); |
0 |
0 |
0 |
|
| 290 |
0 |
▶ | if (PDL_IS_INPLACE(o)) PDL->pdl_barf("hmmexpectq: o->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(o)) PDL->pdl_barf("hmmexpectq: o->inplace but not supported"); |
0 |
0 |
0 |
|
| 291 |
0 |
▶ | if (PDL_IS_INPLACE(oq)) PDL->pdl_barf("hmmexpectq: oq->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(oq)) PDL->pdl_barf("hmmexpectq: oq->inplace but not supported"); |
0 |
0 |
0 |
|
| 292 |
0 |
▶ | if (PDL_IS_INPLACE(alphaq)) PDL->pdl_barf("hmmexpectq: alphaq->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(alphaq)) PDL->pdl_barf("hmmexpectq: alphaq->inplace but not supported"); |
0 |
0 |
0 |
|
| 293 |
0 |
▶ | if (PDL_IS_INPLACE(betaq)) PDL->pdl_barf("hmmexpectq: betaq->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(betaq)) PDL->pdl_barf("hmmexpectq: betaq->inplace but not supported"); |
0 |
0 |
0 |
|
| 294 |
0 |
| PDL->barf_if_error(pdl_run_hmmexpectq(a,b,pi,omega,o,oq,alphaq,betaq,ea,eb,epi,eomega)); |
| 295 |
0 |
▶ | PDL_XS_RETURN(ST(0) = ea_SV;ST(1) = eb_SV;ST(2) = epi_SV;ST(3) = eomega_SV) |
Branch: 5 branches
| Branch | True | False | Total |
| PDL_XS_RETURN(ST(0) = ea_SV;ST(1) = eb_SV;ST(2) = epi_SV;ST(3) = eomega_SV) |
0 |
0 |
0 |
| PDL_XS_RETURN(ST(0) = ea_SV;ST(1) = eb_SV;ST(2) = epi_SV;ST(3) = eomega_SV) |
0 |
0 |
0 |
| PDL_XS_RETURN(ST(0) = ea_SV;ST(1) = eb_SV;ST(2) = epi_SV;ST(3) = eomega_SV) |
0 |
0 |
0 |
| PDL_XS_RETURN(ST(0) = ea_SV;ST(1) = eb_SV;ST(2) = epi_SV;ST(3) = eomega_SV) |
0 |
0 |
0 |
| PDL_XS_RETURN(ST(0) = ea_SV;ST(1) = eb_SV;ST(2) = epi_SV;ST(3) = eomega_SV) |
0 |
0 |
0 |
|
| 296 |
|
| |
| 297 |
|
| void |
| 298 |
|
| pdl_run_hmmviterbi(a, b, pi, o, delta=PDL_XS_PERLINIT_initsv(delta_SV), psi=PDL_XS_PERLINIT_initsv(psi_SV)) |
| 299 |
|
| SV *delta_SV = items > 4 ? ST(4) : NULL; |
| 300 |
|
| SV *psi_SV = items > 5 ? ST(5) : NULL; |
| 301 |
|
| PREINIT: |
| 302 |
2 |
▶ | PDL_XS_PREAMBLE((items == 6) ? 0 : 2); |
Branch: 11 branches
| Branch | True | False | Total |
| PDL_XS_PREAMBLE((items == 6) ? 0 : 2); |
0 |
2 |
2 |
| PDL_XS_PREAMBLE((items == 6) ? 0 : 2); |
2 |
0 |
2 |
| PDL_XS_PREAMBLE((items == 6) ? 0 : 2); |
0 |
2 |
2 |
| PDL_XS_PREAMBLE((items == 6) ? 0 : 2); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 6) ? 0 : 2); |
2 |
0 |
2 |
| PDL_XS_PREAMBLE((items == 6) ? 0 : 2); |
2 |
0 |
2 |
| PDL_XS_PREAMBLE((items == 6) ? 0 : 2); |
2 |
0 |
2 |
| PDL_XS_PREAMBLE((items == 6) ? 0 : 2); |
0 |
2 |
2 |
| PDL_XS_PREAMBLE((items == 6) ? 0 : 2); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 6) ? 0 : 2); |
2 |
0 |
2 |
| PDL_XS_PREAMBLE((items == 6) ? 0 : 2); |
0 |
2 |
2 |
|
| 303 |
|
| INPUT: |
| 304 |
|
| pdl *a |
| 305 |
|
| pdl *b |
| 306 |
|
| pdl *pi |
| 307 |
|
| pdl *o |
| 308 |
|
| pdl *delta |
| 309 |
|
| pdl *psi |
| 310 |
|
| PPCODE: |
| 311 |
2 |
▶ | if (PDL_IS_INPLACE(a)) PDL->pdl_barf("hmmviterbi: a->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(a)) PDL->pdl_barf("hmmviterbi: a->inplace but not supported"); |
0 |
2 |
2 |
|
| 312 |
2 |
▶ | if (PDL_IS_INPLACE(b)) PDL->pdl_barf("hmmviterbi: b->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(b)) PDL->pdl_barf("hmmviterbi: b->inplace but not supported"); |
0 |
2 |
2 |
|
| 313 |
2 |
▶ | if (PDL_IS_INPLACE(pi)) PDL->pdl_barf("hmmviterbi: pi->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(pi)) PDL->pdl_barf("hmmviterbi: pi->inplace but not supported"); |
0 |
2 |
2 |
|
| 314 |
2 |
▶ | if (PDL_IS_INPLACE(o)) PDL->pdl_barf("hmmviterbi: o->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(o)) PDL->pdl_barf("hmmviterbi: o->inplace but not supported"); |
0 |
2 |
2 |
|
| 315 |
2 |
| PDL->barf_if_error(pdl_run_hmmviterbi(a,b,pi,o,delta,psi)); |
| 316 |
2 |
▶ | PDL_XS_RETURN(ST(0) = delta_SV;ST(1) = psi_SV) |
Branch: 5 branches
| Branch | True | False | Total |
| PDL_XS_RETURN(ST(0) = delta_SV;ST(1) = psi_SV) |
2 |
0 |
2 |
| PDL_XS_RETURN(ST(0) = delta_SV;ST(1) = psi_SV) |
2 |
0 |
2 |
| PDL_XS_RETURN(ST(0) = delta_SV;ST(1) = psi_SV) |
2 |
0 |
2 |
| PDL_XS_RETURN(ST(0) = delta_SV;ST(1) = psi_SV) |
0 |
2 |
2 |
| PDL_XS_RETURN(ST(0) = delta_SV;ST(1) = psi_SV) |
0 |
0 |
0 |
|
| 317 |
|
| |
| 318 |
|
| void |
| 319 |
|
| pdl_run_hmmviterbiq(a, b, pi, o, oq, deltaq=PDL_XS_PERLINIT_initsv(deltaq_SV), psiq=PDL_XS_PERLINIT_initsv(psiq_SV)) |
| 320 |
|
| SV *deltaq_SV = items > 5 ? ST(5) : NULL; |
| 321 |
|
| SV *psiq_SV = items > 6 ? ST(6) : NULL; |
| 322 |
|
| PREINIT: |
| 323 |
0 |
▶ | PDL_XS_PREAMBLE((items == 7) ? 0 : 2); |
Branch: 11 branches
| Branch | True | False | Total |
| PDL_XS_PREAMBLE((items == 7) ? 0 : 2); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 7) ? 0 : 2); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 7) ? 0 : 2); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 7) ? 0 : 2); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 7) ? 0 : 2); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 7) ? 0 : 2); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 7) ? 0 : 2); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 7) ? 0 : 2); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 7) ? 0 : 2); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 7) ? 0 : 2); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 7) ? 0 : 2); |
0 |
0 |
0 |
|
| 324 |
|
| INPUT: |
| 325 |
|
| pdl *a |
| 326 |
|
| pdl *b |
| 327 |
|
| pdl *pi |
| 328 |
|
| pdl *o |
| 329 |
|
| pdl *oq |
| 330 |
|
| pdl *deltaq |
| 331 |
|
| pdl *psiq |
| 332 |
|
| PPCODE: |
| 333 |
0 |
▶ | if (PDL_IS_INPLACE(a)) PDL->pdl_barf("hmmviterbiq: a->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(a)) PDL->pdl_barf("hmmviterbiq: a->inplace but not supported"); |
0 |
0 |
0 |
|
| 334 |
0 |
▶ | if (PDL_IS_INPLACE(b)) PDL->pdl_barf("hmmviterbiq: b->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(b)) PDL->pdl_barf("hmmviterbiq: b->inplace but not supported"); |
0 |
0 |
0 |
|
| 335 |
0 |
▶ | if (PDL_IS_INPLACE(pi)) PDL->pdl_barf("hmmviterbiq: pi->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(pi)) PDL->pdl_barf("hmmviterbiq: pi->inplace but not supported"); |
0 |
0 |
0 |
|
| 336 |
0 |
▶ | if (PDL_IS_INPLACE(o)) PDL->pdl_barf("hmmviterbiq: o->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(o)) PDL->pdl_barf("hmmviterbiq: o->inplace but not supported"); |
0 |
0 |
0 |
|
| 337 |
0 |
▶ | if (PDL_IS_INPLACE(oq)) PDL->pdl_barf("hmmviterbiq: oq->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(oq)) PDL->pdl_barf("hmmviterbiq: oq->inplace but not supported"); |
0 |
0 |
0 |
|
| 338 |
0 |
| PDL->barf_if_error(pdl_run_hmmviterbiq(a,b,pi,o,oq,deltaq,psiq)); |
| 339 |
0 |
▶ | PDL_XS_RETURN(ST(0) = deltaq_SV;ST(1) = psiq_SV) |
Branch: 5 branches
| Branch | True | False | Total |
| PDL_XS_RETURN(ST(0) = deltaq_SV;ST(1) = psiq_SV) |
0 |
0 |
0 |
| PDL_XS_RETURN(ST(0) = deltaq_SV;ST(1) = psiq_SV) |
0 |
0 |
0 |
| PDL_XS_RETURN(ST(0) = deltaq_SV;ST(1) = psiq_SV) |
0 |
0 |
0 |
| PDL_XS_RETURN(ST(0) = deltaq_SV;ST(1) = psiq_SV) |
0 |
0 |
0 |
| PDL_XS_RETURN(ST(0) = deltaq_SV;ST(1) = psiq_SV) |
0 |
0 |
0 |
|
| 340 |
|
| |
| 341 |
|
| void |
| 342 |
|
| pdl_run_hmmpath(psi, qfinal, path=PDL_XS_PERLINIT_initsv(path_SV)) |
| 343 |
|
| SV *path_SV = items > 2 ? ST(2) : NULL; |
| 344 |
|
| PREINIT: |
| 345 |
2 |
▶ | PDL_XS_PREAMBLE((items == 3) ? 0 : 1); |
Branch: 10 branches
| Branch | True | False | Total |
| PDL_XS_PREAMBLE((items == 3) ? 0 : 1); |
2 |
0 |
2 |
| PDL_XS_PREAMBLE((items == 3) ? 0 : 1); |
0 |
2 |
2 |
| PDL_XS_PREAMBLE((items == 3) ? 0 : 1); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 3) ? 0 : 1); |
2 |
0 |
2 |
| PDL_XS_PREAMBLE((items == 3) ? 0 : 1); |
2 |
0 |
2 |
| PDL_XS_PREAMBLE((items == 3) ? 0 : 1); |
2 |
0 |
2 |
| PDL_XS_PREAMBLE((items == 3) ? 0 : 1); |
0 |
2 |
2 |
| PDL_XS_PREAMBLE((items == 3) ? 0 : 1); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 3) ? 0 : 1); |
2 |
0 |
2 |
| PDL_XS_PREAMBLE((items == 3) ? 0 : 1); |
0 |
2 |
2 |
|
| 346 |
|
| INPUT: |
| 347 |
|
| pdl *psi |
| 348 |
|
| pdl *qfinal |
| 349 |
|
| pdl *path |
| 350 |
|
| PPCODE: |
| 351 |
2 |
▶ | if (PDL_IS_INPLACE(psi)) PDL->pdl_barf("hmmpath: psi->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(psi)) PDL->pdl_barf("hmmpath: psi->inplace but not supported"); |
0 |
2 |
2 |
|
| 352 |
2 |
▶ | if (PDL_IS_INPLACE(qfinal)) PDL->pdl_barf("hmmpath: qfinal->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(qfinal)) PDL->pdl_barf("hmmpath: qfinal->inplace but not supported"); |
0 |
2 |
2 |
|
| 353 |
2 |
| PDL->barf_if_error(pdl_run_hmmpath(psi,qfinal,path)); |
| 354 |
2 |
▶ | PDL_XS_RETURN(ST(0) = path_SV) |
Branch: 5 branches
| Branch | True | False | Total |
| PDL_XS_RETURN(ST(0) = path_SV) |
2 |
0 |
2 |
| PDL_XS_RETURN(ST(0) = path_SV) |
2 |
0 |
2 |
| PDL_XS_RETURN(ST(0) = path_SV) |
2 |
0 |
2 |
| PDL_XS_RETURN(ST(0) = path_SV) |
0 |
2 |
2 |
| PDL_XS_RETURN(ST(0) = path_SV) |
0 |
0 |
0 |
|
| 355 |
|
| |
| 356 |
|
| void |
| 357 |
|
| pdl_run_hmmpathq(oq, psiq, qfinalq, path=PDL_XS_PERLINIT_initsv(path_SV)) |
| 358 |
|
| SV *path_SV = items > 3 ? ST(3) : NULL; |
| 359 |
|
| PREINIT: |
| 360 |
0 |
▶ | PDL_XS_PREAMBLE((items == 4) ? 0 : 1); |
Branch: 10 branches
| Branch | True | False | Total |
| PDL_XS_PREAMBLE((items == 4) ? 0 : 1); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 4) ? 0 : 1); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 4) ? 0 : 1); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 4) ? 0 : 1); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 4) ? 0 : 1); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 4) ? 0 : 1); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 4) ? 0 : 1); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 4) ? 0 : 1); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 4) ? 0 : 1); |
0 |
0 |
0 |
| PDL_XS_PREAMBLE((items == 4) ? 0 : 1); |
0 |
0 |
0 |
|
| 361 |
|
| INPUT: |
| 362 |
|
| pdl *oq |
| 363 |
|
| pdl *psiq |
| 364 |
|
| pdl *qfinalq |
| 365 |
|
| pdl *path |
| 366 |
|
| PPCODE: |
| 367 |
0 |
▶ | if (PDL_IS_INPLACE(oq)) PDL->pdl_barf("hmmpathq: oq->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(oq)) PDL->pdl_barf("hmmpathq: oq->inplace but not supported"); |
0 |
0 |
0 |
|
| 368 |
0 |
▶ | if (PDL_IS_INPLACE(psiq)) PDL->pdl_barf("hmmpathq: psiq->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(psiq)) PDL->pdl_barf("hmmpathq: psiq->inplace but not supported"); |
0 |
0 |
0 |
|
| 369 |
0 |
▶ | if (PDL_IS_INPLACE(qfinalq)) PDL->pdl_barf("hmmpathq: qfinalq->inplace but not supported"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL_IS_INPLACE(qfinalq)) PDL->pdl_barf("hmmpathq: qfinalq->inplace but not supported"); |
0 |
0 |
0 |
|
| 370 |
0 |
| PDL->barf_if_error(pdl_run_hmmpathq(oq,psiq,qfinalq,path)); |
| 371 |
0 |
▶ | PDL_XS_RETURN(ST(0) = path_SV) |
Branch: 5 branches
| Branch | True | False | Total |
| PDL_XS_RETURN(ST(0) = path_SV) |
0 |
0 |
0 |
| PDL_XS_RETURN(ST(0) = path_SV) |
0 |
0 |
0 |
| PDL_XS_RETURN(ST(0) = path_SV) |
0 |
0 |
0 |
| PDL_XS_RETURN(ST(0) = path_SV) |
0 |
0 |
0 |
| PDL_XS_RETURN(ST(0) = path_SV) |
0 |
0 |
0 |
|
| 372 |
|
| |
| 373 |
|
| |
| 374 |
|
| #line 483 "lib/PDL/PP.pm" |
| 375 |
|
| BOOT: |
| 376 |
|
| /* Get pointer to structure of core shared C routines */ |
| 377 |
|
| /* make sure PDL::Core is loaded */ |
| 378 |
|
| #line 379 "HMM.xs" |
| 379 |
5 |
| perl_require_pv ("PDL/Core.pm"); /* make sure PDL::Core is loaded */ |
| 380 |
|
| #ifndef aTHX_ |
| 381 |
|
| #define aTHX_ |
| 382 |
|
| #endif |
| 383 |
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 |
|
| 384 |
5 |
| SV* CoreSV = perl_get_sv("PDL::SHARE",FALSE); /* var with core structure */ |
| 385 |
5 |
▶ | if (!CoreSV) |
Branch: 1 branch
| Branch | True | False | Total |
| if (!CoreSV) |
0 |
5 |
5 |
|
| 386 |
0 |
| Perl_croak(aTHX_ "We require the PDL::Core module, which was not found"); |
| 387 |
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 |
|
| 388 |
0 |
| Perl_croak(aTHX_ "Got NULL pointer for PDL"); |
| 389 |
5 |
▶ | if (PDL->Version != PDL_CORE_VERSION) |
Branch: 1 branch
| Branch | True | False | Total |
| if (PDL->Version != PDL_CORE_VERSION) |
0 |
5 |
5 |
|
| 390 |
0 |
| Perl_croak(aTHX_ "[PDL->Version: %ld PDL_CORE_VERSION: %ld XS_VERSION: %s] PDL::HMM needs to be recompiled against the newly installed PDL", (long int)PDL->Version, (long int)PDL_CORE_VERSION, XS_VERSION); |