| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
#line 453 "lib/PDL/PP.pm" |
|
3
|
|
|
|
|
|
|
/* |
|
4
|
|
|
|
|
|
|
* THIS FILE WAS GENERATED BY PDL::PP from 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 "pp-hmmpathq.c" |
|
23
|
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
#include |
|
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
|
|
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
|
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
#line 1857 "lib/PDL/PP.pm" |
|
77
|
|
|
|
|
|
|
pdl_error pdl_hmmpathq_readdata(pdl_trans *__privtrans) { |
|
78
|
|
|
|
|
|
|
pdl_error PDL_err = {0, NULL, 0}; |
|
79
|
|
|
|
|
|
|
#line 80 "pp-hmmpathq.c" |
|
80
|
0
|
|
|
|
|
|
register PDL_Indx __T_size = __privtrans->ind_sizes[1]; |
|
81
|
0
|
0
|
|
|
|
|
if (!__privtrans->broadcast.incs) return PDL->make_error(PDL_EUSERERROR, "Error in hmmpathq:" "broadcast.incs NULL"); |
|
82
|
|
|
|
|
|
|
/* broadcastloop declarations */ |
|
83
|
|
|
|
|
|
|
int __brcloopval; |
|
84
|
|
|
|
|
|
|
register PDL_Indx __tind0,__tind1; /* counters along dim */ |
|
85
|
0
|
|
|
|
|
|
register PDL_Indx __tnpdls = __privtrans->broadcast.npdls; |
|
86
|
|
|
|
|
|
|
/* dims here are how many steps along those dims */ |
|
87
|
0
|
|
|
|
|
|
register PDL_Indx __tinc0_oq = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,0,0); |
|
88
|
0
|
|
|
|
|
|
register PDL_Indx __tinc0_psiq = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,1,0); |
|
89
|
0
|
|
|
|
|
|
register PDL_Indx __tinc0_qfinalq = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,2,0); |
|
90
|
0
|
|
|
|
|
|
register PDL_Indx __tinc0_path = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,3,0); |
|
91
|
0
|
|
|
|
|
|
register PDL_Indx __tinc1_oq = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,0,1); |
|
92
|
0
|
|
|
|
|
|
register PDL_Indx __tinc1_psiq = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,1,1); |
|
93
|
0
|
|
|
|
|
|
register PDL_Indx __tinc1_qfinalq = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,2,1); |
|
94
|
0
|
|
|
|
|
|
register PDL_Indx __tinc1_path = PDL_BRC_INC(__privtrans->broadcast.incs,__tnpdls,3,1); |
|
95
|
|
|
|
|
|
|
#define PDL_BROADCASTLOOP_START_hmmpathq_readdata PDL_BROADCASTLOOP_START( \ |
|
96
|
|
|
|
|
|
|
readdata, \ |
|
97
|
|
|
|
|
|
|
__privtrans->broadcast, \ |
|
98
|
|
|
|
|
|
|
__privtrans->vtable, \ |
|
99
|
|
|
|
|
|
|
oq_datap += __offsp[0]; \ |
|
100
|
|
|
|
|
|
|
psiq_datap += __offsp[1]; \ |
|
101
|
|
|
|
|
|
|
qfinalq_datap += __offsp[2]; \ |
|
102
|
|
|
|
|
|
|
path_datap += __offsp[3]; \ |
|
103
|
|
|
|
|
|
|
, \ |
|
104
|
|
|
|
|
|
|
( ,oq_datap += __tinc1_oq - __tinc0_oq * __tdims0 \ |
|
105
|
|
|
|
|
|
|
,psiq_datap += __tinc1_psiq - __tinc0_psiq * __tdims0 \ |
|
106
|
|
|
|
|
|
|
,qfinalq_datap += __tinc1_qfinalq - __tinc0_qfinalq * __tdims0 \ |
|
107
|
|
|
|
|
|
|
,path_datap += __tinc1_path - __tinc0_path * __tdims0 \ |
|
108
|
|
|
|
|
|
|
), \ |
|
109
|
|
|
|
|
|
|
( ,oq_datap += __tinc0_oq \ |
|
110
|
|
|
|
|
|
|
,psiq_datap += __tinc0_psiq \ |
|
111
|
|
|
|
|
|
|
,qfinalq_datap += __tinc0_qfinalq \ |
|
112
|
|
|
|
|
|
|
,path_datap += __tinc0_path \ |
|
113
|
|
|
|
|
|
|
) \ |
|
114
|
|
|
|
|
|
|
) |
|
115
|
|
|
|
|
|
|
#define PDL_BROADCASTLOOP_END_hmmpathq_readdata PDL_BROADCASTLOOP_END( \ |
|
116
|
|
|
|
|
|
|
__privtrans->broadcast, \ |
|
117
|
|
|
|
|
|
|
oq_datap -= __tinc1_oq * __tdims1 + __offsp[0]; \ |
|
118
|
|
|
|
|
|
|
psiq_datap -= __tinc1_psiq * __tdims1 + __offsp[1]; \ |
|
119
|
|
|
|
|
|
|
qfinalq_datap -= __tinc1_qfinalq * __tdims1 + __offsp[2]; \ |
|
120
|
|
|
|
|
|
|
path_datap -= __tinc1_path * __tdims1 + __offsp[3]; \ |
|
121
|
|
|
|
|
|
|
) |
|
122
|
0
|
|
|
|
|
|
register PDL_Indx __inc_oq_Q = __privtrans->inc_sizes[PDL_INC_ID(__privtrans->vtable,0,0)]; (void)__inc_oq_Q;register PDL_Indx __inc_oq_T = __privtrans->inc_sizes[PDL_INC_ID(__privtrans->vtable,0,1)]; (void)__inc_oq_T; |
|
123
|
0
|
|
|
|
|
|
register PDL_Indx __inc_path_T = __privtrans->inc_sizes[PDL_INC_ID(__privtrans->vtable,3,0)]; (void)__inc_path_T; |
|
124
|
0
|
|
|
|
|
|
register PDL_Indx __inc_psiq_Q = __privtrans->inc_sizes[PDL_INC_ID(__privtrans->vtable,1,0)]; (void)__inc_psiq_Q;register PDL_Indx __inc_psiq_T = __privtrans->inc_sizes[PDL_INC_ID(__privtrans->vtable,1,1)]; (void)__inc_psiq_T; |
|
125
|
|
|
|
|
|
|
#ifndef PDL_DECLARE_PARAMS_hmmpathq_1 |
|
126
|
|
|
|
|
|
|
#define PDL_DECLARE_PARAMS_hmmpathq_1(PDL_TYPE_OP,PDL_PPSYM_OP,PDL_TYPE_PARAM_oq,PDL_PPSYM_PARAM_oq,PDL_TYPE_PARAM_qfinalq,PDL_PPSYM_PARAM_qfinalq,PDL_TYPE_PARAM_path,PDL_PPSYM_PARAM_path) \ |
|
127
|
|
|
|
|
|
|
PDL_DECLARE_PARAMETER(PDL_TYPE_PARAM_oq, oq, (__privtrans->pdls[0]), 1, PDL_PPSYM_PARAM_oq) \ |
|
128
|
|
|
|
|
|
|
PDL_DECLARE_PARAMETER(PDL_TYPE_OP, psiq, (__privtrans->pdls[1]), 1, PDL_PPSYM_OP) \ |
|
129
|
|
|
|
|
|
|
PDL_DECLARE_PARAMETER(PDL_TYPE_PARAM_qfinalq, qfinalq, (__privtrans->pdls[2]), 1, PDL_PPSYM_PARAM_qfinalq) \ |
|
130
|
|
|
|
|
|
|
PDL_DECLARE_PARAMETER(PDL_TYPE_PARAM_path, path, (__privtrans->pdls[3]), 1, PDL_PPSYM_PARAM_path) |
|
131
|
|
|
|
|
|
|
#endif |
|
132
|
|
|
|
|
|
|
#define PDL_IF_BAD(t,f) f |
|
133
|
0
|
|
|
|
|
|
switch (__privtrans->__datatype) { /* Start generic switch */ |
|
134
|
0
|
|
|
|
|
|
case PDL_F: { |
|
135
|
0
|
0
|
|
|
|
|
PDL_DECLARE_PARAMS_hmmpathq_1(PDL_Float,F,PDL_Indx,N,PDL_Indx,N,PDL_Indx,N) |
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
136
|
0
|
0
|
|
|
|
|
PDL_BROADCASTLOOP_START_hmmpathq_readdata { |
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
/*-- Initialize: t==T-1: state_(t)==final() --*/ |
|
138
|
0
|
|
|
|
|
|
int t = __privtrans->ind_sizes[1]-1; |
|
139
|
0
|
|
|
|
|
|
(path_datap)[0+(__inc_path_T*(t))] = (qfinalq_datap)[0]; |
|
140
|
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
/*-- Get index backtrace --*/ |
|
142
|
0
|
0
|
|
|
|
|
for (t--; t>=0; t--) { |
|
143
|
0
|
|
|
|
|
|
int qi_tp1 = (path_datap)[0+(__inc_path_T*(t+1))]; |
|
144
|
0
|
|
|
|
|
|
(path_datap)[0+(__inc_path_T*(t))] = (psiq_datap)[0+(__inc_psiq_Q*(qi_tp1))+(__inc_psiq_T*(t+1))]; |
|
145
|
|
|
|
|
|
|
} |
|
146
|
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
/*-- Convert indices to state ids --*/ |
|
148
|
0
|
0
|
|
|
|
|
{/* Open T */ PDL_EXPAND2(register PDL_Indx T=0, __T_stop=(__T_size)); for(; T<__T_stop; T+=1) { |
|
149
|
0
|
|
|
|
|
|
int qi = (path_datap)[0+(__inc_path_T*(T))]; |
|
150
|
0
|
|
|
|
|
|
(path_datap)[0+(__inc_path_T*(T))] = (oq_datap)[0+(__inc_oq_Q*(qi))+(__inc_oq_T*(T))]; |
|
151
|
|
|
|
|
|
|
}} /* Close T */ |
|
152
|
0
|
0
|
|
|
|
|
}PDL_BROADCASTLOOP_END_hmmpathq_readdata |
|
|
|
0
|
|
|
|
|
|
|
153
|
0
|
|
|
|
|
|
} break; |
|
154
|
0
|
|
|
|
|
|
case PDL_D: { |
|
155
|
0
|
0
|
|
|
|
|
PDL_DECLARE_PARAMS_hmmpathq_1(PDL_Double,D,PDL_Indx,N,PDL_Indx,N,PDL_Indx,N) |
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
156
|
0
|
0
|
|
|
|
|
PDL_BROADCASTLOOP_START_hmmpathq_readdata { |
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
/*-- Initialize: t==T-1: state_(t)==final() --*/ |
|
158
|
0
|
|
|
|
|
|
int t = __privtrans->ind_sizes[1]-1; |
|
159
|
0
|
|
|
|
|
|
(path_datap)[0+(__inc_path_T*(t))] = (qfinalq_datap)[0]; |
|
160
|
|
|
|
|
|
|
|
|
161
|
|
|
|
|
|
|
/*-- Get index backtrace --*/ |
|
162
|
0
|
0
|
|
|
|
|
for (t--; t>=0; t--) { |
|
163
|
0
|
|
|
|
|
|
int qi_tp1 = (path_datap)[0+(__inc_path_T*(t+1))]; |
|
164
|
0
|
|
|
|
|
|
(path_datap)[0+(__inc_path_T*(t))] = (psiq_datap)[0+(__inc_psiq_Q*(qi_tp1))+(__inc_psiq_T*(t+1))]; |
|
165
|
|
|
|
|
|
|
} |
|
166
|
|
|
|
|
|
|
|
|
167
|
|
|
|
|
|
|
/*-- Convert indices to state ids --*/ |
|
168
|
0
|
0
|
|
|
|
|
{/* Open T */ PDL_EXPAND2(register PDL_Indx T=0, __T_stop=(__T_size)); for(; T<__T_stop; T+=1) { |
|
169
|
0
|
|
|
|
|
|
int qi = (path_datap)[0+(__inc_path_T*(T))]; |
|
170
|
0
|
|
|
|
|
|
(path_datap)[0+(__inc_path_T*(T))] = (oq_datap)[0+(__inc_oq_Q*(qi))+(__inc_oq_T*(T))]; |
|
171
|
|
|
|
|
|
|
}} /* Close T */ |
|
172
|
0
|
0
|
|
|
|
|
}PDL_BROADCASTLOOP_END_hmmpathq_readdata |
|
|
|
0
|
|
|
|
|
|
|
173
|
0
|
|
|
|
|
|
} break; |
|
174
|
0
|
|
|
|
|
|
case PDL_LD: { |
|
175
|
0
|
0
|
|
|
|
|
PDL_DECLARE_PARAMS_hmmpathq_1(PDL_LDouble,E,PDL_Indx,N,PDL_Indx,N,PDL_Indx,N) |
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
176
|
0
|
0
|
|
|
|
|
PDL_BROADCASTLOOP_START_hmmpathq_readdata { |
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
177
|
|
|
|
|
|
|
/*-- Initialize: t==T-1: state_(t)==final() --*/ |
|
178
|
0
|
|
|
|
|
|
int t = __privtrans->ind_sizes[1]-1; |
|
179
|
0
|
|
|
|
|
|
(path_datap)[0+(__inc_path_T*(t))] = (qfinalq_datap)[0]; |
|
180
|
|
|
|
|
|
|
|
|
181
|
|
|
|
|
|
|
/*-- Get index backtrace --*/ |
|
182
|
0
|
0
|
|
|
|
|
for (t--; t>=0; t--) { |
|
183
|
0
|
|
|
|
|
|
int qi_tp1 = (path_datap)[0+(__inc_path_T*(t+1))]; |
|
184
|
0
|
|
|
|
|
|
(path_datap)[0+(__inc_path_T*(t))] = (psiq_datap)[0+(__inc_psiq_Q*(qi_tp1))+(__inc_psiq_T*(t+1))]; |
|
185
|
|
|
|
|
|
|
} |
|
186
|
|
|
|
|
|
|
|
|
187
|
|
|
|
|
|
|
/*-- Convert indices to state ids --*/ |
|
188
|
0
|
0
|
|
|
|
|
{/* Open T */ PDL_EXPAND2(register PDL_Indx T=0, __T_stop=(__T_size)); for(; T<__T_stop; T+=1) { |
|
189
|
0
|
|
|
|
|
|
int qi = (path_datap)[0+(__inc_path_T*(T))]; |
|
190
|
0
|
|
|
|
|
|
(path_datap)[0+(__inc_path_T*(T))] = (oq_datap)[0+(__inc_oq_Q*(qi))+(__inc_oq_T*(T))]; |
|
191
|
|
|
|
|
|
|
}} /* Close T */ |
|
192
|
0
|
0
|
|
|
|
|
}PDL_BROADCASTLOOP_END_hmmpathq_readdata |
|
|
|
0
|
|
|
|
|
|
|
193
|
0
|
|
|
|
|
|
} break; |
|
194
|
0
|
|
|
|
|
|
default: return PDL->make_error(PDL_EUSERERROR, "PP INTERNAL ERROR in hmmpathq: unhandled datatype(%d), only handles (FDE)! PLEASE MAKE A BUG REPORT\n", __privtrans->__datatype); |
|
195
|
|
|
|
|
|
|
} |
|
196
|
|
|
|
|
|
|
#undef PDL_IF_BAD |
|
197
|
0
|
|
|
|
|
|
return PDL_err; |
|
198
|
|
|
|
|
|
|
} |
|
199
|
|
|
|
|
|
|
|
|
200
|
|
|
|
|
|
|
static pdl_datatypes pdl_hmmpathq_vtable_gentypes[] = { PDL_F, PDL_D, PDL_LD, -1 }; |
|
201
|
|
|
|
|
|
|
static PDL_Indx pdl_hmmpathq_vtable_realdims[] = { 2, 2, 0, 1 }; |
|
202
|
|
|
|
|
|
|
static char *pdl_hmmpathq_vtable_parnames[] = { "oq","psiq","qfinalq","path" }; |
|
203
|
|
|
|
|
|
|
static short pdl_hmmpathq_vtable_parflags[] = { |
|
204
|
|
|
|
|
|
|
PDL_PARAM_ISTYPED, |
|
205
|
|
|
|
|
|
|
0, |
|
206
|
|
|
|
|
|
|
PDL_PARAM_ISTYPED, |
|
207
|
|
|
|
|
|
|
PDL_PARAM_ISCREAT|PDL_PARAM_ISOUT|PDL_PARAM_ISTYPED|PDL_PARAM_ISWRITE |
|
208
|
|
|
|
|
|
|
}; |
|
209
|
|
|
|
|
|
|
static pdl_datatypes pdl_hmmpathq_vtable_partypes[] = { PDL_IND, -1, PDL_IND, PDL_IND }; |
|
210
|
|
|
|
|
|
|
static PDL_Indx pdl_hmmpathq_vtable_realdims_starts[] = { 0, 2, 4, 4 }; |
|
211
|
|
|
|
|
|
|
static PDL_Indx pdl_hmmpathq_vtable_realdims_ind_ids[] = { 0, 1, 0, 1, 1 }; |
|
212
|
|
|
|
|
|
|
static char *pdl_hmmpathq_vtable_indnames[] = { "Q","T" }; |
|
213
|
|
|
|
|
|
|
pdl_transvtable pdl_hmmpathq_vtable = { |
|
214
|
|
|
|
|
|
|
PDL_TRANS_DO_BROADCAST, 0, pdl_hmmpathq_vtable_gentypes, 3, 4, NULL /*CORE21*/, |
|
215
|
|
|
|
|
|
|
pdl_hmmpathq_vtable_realdims, pdl_hmmpathq_vtable_parnames, |
|
216
|
|
|
|
|
|
|
pdl_hmmpathq_vtable_parflags, pdl_hmmpathq_vtable_partypes, |
|
217
|
|
|
|
|
|
|
pdl_hmmpathq_vtable_realdims_starts, pdl_hmmpathq_vtable_realdims_ind_ids, 5, |
|
218
|
|
|
|
|
|
|
2, pdl_hmmpathq_vtable_indnames, |
|
219
|
|
|
|
|
|
|
NULL, pdl_hmmpathq_readdata, NULL, |
|
220
|
|
|
|
|
|
|
NULL, |
|
221
|
|
|
|
|
|
|
0,"PDL::HMM::hmmpathq" |
|
222
|
|
|
|
|
|
|
}; |
|
223
|
|
|
|
|
|
|
|
|
224
|
|
|
|
|
|
|
|
|
225
|
0
|
|
|
|
|
|
pdl_error pdl_run_hmmpathq(pdl *oq,pdl *psiq,pdl *qfinalq,pdl *path) { |
|
226
|
0
|
|
|
|
|
|
pdl_error PDL_err = {0, NULL, 0}; |
|
227
|
0
|
0
|
|
|
|
|
if (!PDL) return (pdl_error){PDL_EFATAL, "PDL core struct is NULL, can't continue",0}; |
|
228
|
0
|
|
|
|
|
|
pdl_trans *__privtrans = PDL->create_trans(&pdl_hmmpathq_vtable); |
|
229
|
0
|
0
|
|
|
|
|
if (!__privtrans) return PDL->make_error_simple(PDL_EFATAL, "Couldn't create trans"); |
|
230
|
0
|
|
|
|
|
|
__privtrans->pdls[0] = oq; |
|
231
|
0
|
|
|
|
|
|
__privtrans->pdls[1] = psiq; |
|
232
|
0
|
|
|
|
|
|
__privtrans->pdls[2] = qfinalq; |
|
233
|
0
|
|
|
|
|
|
__privtrans->pdls[3] = path; |
|
234
|
0
|
0
|
|
|
|
|
PDL_RETERROR(PDL_err, PDL->type_coerce(__privtrans)); |
|
235
|
0
|
0
|
|
|
|
|
PDL_RETERROR(PDL_err, PDL->make_trans_mutual(__privtrans)); |
|
236
|
0
|
|
|
|
|
|
return PDL_err; |
|
237
|
|
|
|
|
|
|
} |