RNAlib-2.4.10
dp_matrices.h
Go to the documentation of this file.
1 #ifndef VIENNA_RNA_PACKAGE_DP_MATRICES_H
2 #define VIENNA_RNA_PACKAGE_DP_MATRICES_H
3 
22 typedef struct vrna_mx_pf_s vrna_mx_pf_t;
23 
25 
31 typedef enum {
41 
45 struct vrna_mx_mfe_s {
49  vrna_mx_type_e type;
50  unsigned int length;
55 #ifndef VRNA_DISABLE_C11_FEATURES
56  /* C11 support for unnamed unions/structs */
57  union {
58  struct {
59 #endif
60 
65  int *c;
66  int *f5;
67  int *f3;
68  int *fc;
69  int *fML;
70  int *fM1;
71  int *fM2;
72  int *ggg;
73  int Fc;
74  int FcH;
75  int FcI;
76  int FcM;
81 #ifndef VRNA_DISABLE_C11_FEATURES
82  /* C11 support for unnamed unions/structs */
83 };
84 struct {
85 #endif
86 
91  int **c_local;
92  int *f3_local;
93  int **fML_local;
94  int **ggg_local;
98 #ifndef VRNA_DISABLE_C11_FEATURES
99  /* C11 support for unnamed unions/structs */
100 };
101 struct {
102 #endif
103 
109  int ***E_F5;
110  int **l_min_F5;
111  int **l_max_F5;
112  int *k_min_F5;
113  int *k_max_F5;
114 
115  int ***E_F3;
116  int **l_min_F3;
117  int **l_max_F3;
118  int *k_min_F3;
119  int *k_max_F3;
120 
121  int ***E_C;
122  int **l_min_C;
123  int **l_max_C;
124  int *k_min_C;
125  int *k_max_C;
126 
127  int ***E_M;
128  int **l_min_M;
129  int **l_max_M;
130  int *k_min_M;
131  int *k_max_M;
132 
133  int ***E_M1;
134  int **l_min_M1;
135  int **l_max_M1;
136  int *k_min_M1;
137  int *k_max_M1;
138 
139  int ***E_M2;
140  int **l_min_M2;
141  int **l_max_M2;
142  int *k_min_M2;
143  int *k_max_M2;
144 
145  int **E_Fc;
146  int *l_min_Fc;
147  int *l_max_Fc;
148  int k_min_Fc;
149  int k_max_Fc;
150 
151  int **E_FcH;
152  int *l_min_FcH;
153  int *l_max_FcH;
154  int k_min_FcH;
155  int k_max_FcH;
156 
157  int **E_FcI;
158  int *l_min_FcI;
159  int *l_max_FcI;
160  int k_min_FcI;
161  int k_max_FcI;
162 
163  int **E_FcM;
164  int *l_min_FcM;
165  int *l_max_FcM;
166  int k_min_FcM;
167  int k_max_FcM;
168 
169  /* auxilary arrays for remaining set of coarse graining (k,l) > (k_max, l_max) */
170  int *E_F5_rem;
171  int *E_F3_rem;
172  int *E_C_rem;
173  int *E_M_rem;
174  int *E_M1_rem;
175  int *E_M2_rem;
176 
177  int E_Fc_rem;
178  int E_FcH_rem;
179  int E_FcI_rem;
180  int E_FcM_rem;
181 
182 #ifdef COUNT_STATES
183  unsigned long ***N_F5;
184  unsigned long ***N_C;
185  unsigned long ***N_M;
186  unsigned long ***N_M1;
187 #endif
188 
193 #ifndef VRNA_DISABLE_C11_FEATURES
194  /* C11 support for unnamed unions/structs */
195 };
196 };
197 #endif
198 };
199 
203 struct vrna_mx_pf_s {
207  vrna_mx_type_e type;
208  unsigned int length;
209  FLT_OR_DBL *scale;
210  FLT_OR_DBL *expMLbase;
211 
212 
217 #ifndef VRNA_DISABLE_C11_FEATURES
218  /* C11 support for unnamed unions/structs */
219  union {
220  struct {
221 #endif
222 
228  FLT_OR_DBL *q;
229  FLT_OR_DBL *qb;
230  FLT_OR_DBL *qm;
231  FLT_OR_DBL *qm1;
232  FLT_OR_DBL *probs;
233  FLT_OR_DBL *q1k;
234  FLT_OR_DBL *qln;
235  FLT_OR_DBL *G;
236 
237  FLT_OR_DBL qo;
238  FLT_OR_DBL *qm2;
239  FLT_OR_DBL qho;
240  FLT_OR_DBL qio;
241  FLT_OR_DBL qmo;
242 
247 #ifndef VRNA_DISABLE_C11_FEATURES
248  /* C11 support for unnamed unions/structs */
249 };
250 struct {
251 #endif
252 
258  FLT_OR_DBL **q_local;
259  FLT_OR_DBL **qb_local;
260  FLT_OR_DBL **qm_local;
261  FLT_OR_DBL **pR;
262  FLT_OR_DBL **qm2_local;
263  FLT_OR_DBL **QI5;
264  FLT_OR_DBL **q2l;
265  FLT_OR_DBL **qmb;
266  FLT_OR_DBL **G_local;
271 #ifndef VRNA_DISABLE_C11_FEATURES
272  /* C11 support for unnamed unions/structs */
273 };
274 struct {
275 #endif
276 
282  FLT_OR_DBL ***Q;
283  int **l_min_Q;
284  int **l_max_Q;
285  int *k_min_Q;
286  int *k_max_Q;
287 
288 
289  FLT_OR_DBL ***Q_B;
290  int **l_min_Q_B;
291  int **l_max_Q_B;
292  int *k_min_Q_B;
293  int *k_max_Q_B;
294 
295  FLT_OR_DBL ***Q_M;
296  int **l_min_Q_M;
297  int **l_max_Q_M;
298  int *k_min_Q_M;
299  int *k_max_Q_M;
300 
301  FLT_OR_DBL ***Q_M1;
302  int **l_min_Q_M1;
303  int **l_max_Q_M1;
304  int *k_min_Q_M1;
305  int *k_max_Q_M1;
306 
307  FLT_OR_DBL ***Q_M2;
308  int **l_min_Q_M2;
309  int **l_max_Q_M2;
310  int *k_min_Q_M2;
311  int *k_max_Q_M2;
312 
313  FLT_OR_DBL **Q_c;
314  int *l_min_Q_c;
315  int *l_max_Q_c;
316  int k_min_Q_c;
317  int k_max_Q_c;
318 
319  FLT_OR_DBL **Q_cH;
320  int *l_min_Q_cH;
321  int *l_max_Q_cH;
322  int k_min_Q_cH;
323  int k_max_Q_cH;
324 
325  FLT_OR_DBL **Q_cI;
326  int *l_min_Q_cI;
327  int *l_max_Q_cI;
328  int k_min_Q_cI;
329  int k_max_Q_cI;
330 
331  FLT_OR_DBL **Q_cM;
332  int *l_min_Q_cM;
333  int *l_max_Q_cM;
334  int k_min_Q_cM;
335  int k_max_Q_cM;
336 
337  /* auxilary arrays for remaining set of coarse graining (k,l) > (k_max, l_max) */
338  FLT_OR_DBL *Q_rem;
339  FLT_OR_DBL *Q_B_rem;
340  FLT_OR_DBL *Q_M_rem;
341  FLT_OR_DBL *Q_M1_rem;
342  FLT_OR_DBL *Q_M2_rem;
343 
344  FLT_OR_DBL Q_c_rem;
345  FLT_OR_DBL Q_cH_rem;
346  FLT_OR_DBL Q_cI_rem;
347  FLT_OR_DBL Q_cM_rem;
352 #ifndef VRNA_DISABLE_C11_FEATURES
353  /* C11 support for unnamed unions/structs */
354 };
355 };
356 #endif
357 };
358 
388 int
390  vrna_mx_type_e type,
391  unsigned int options);
392 
393 
394 int
395 vrna_mx_mfe_add(vrna_fold_compound_t *vc,
396  vrna_mx_type_e mx_type,
397  unsigned int options);
398 
399 
400 int
401 vrna_mx_pf_add(vrna_fold_compound_t *vc,
402  vrna_mx_type_e mx_type,
403  unsigned int options);
404 
405 
406 int
407 vrna_mx_prepare(vrna_fold_compound_t *vc,
408  unsigned int options);
409 
410 
418 void
420 
421 
429 void
431 
432 
437 #endif
int * fc
Energy from i to cutpoint (and vice versa if i>cut)
Definition: dp_matrices.h:68
int vrna_mx_add(vrna_fold_compound_t *vc, vrna_mx_type_e type, unsigned int options)
Add Dynamic Programming (DP) matrices (allocate memory)
Minimum Free Energy (MFE) Dynamic Programming (DP) matrices data structure required within the vrna_f...
Definition: dp_matrices.h:45
int * fM1
Second ML array, only for unique multibrnach loop decomposition.
Definition: dp_matrices.h:70
int * fML
Multi-loop auxiliary energy array.
Definition: dp_matrices.h:69
double FLT_OR_DBL
Typename for floating point number in partition function computations.
Definition: basic.h:43
The most basic data structure required by many functions throughout the RNAlib.
Definition: fold_compound.h:132
unsigned int length
Length of the sequence, therefore an indicator of the size of the DP matrices.
Definition: dp_matrices.h:50
int * fM2
Energy for a multibranch loop region with exactly two stems, extending to 3' end. ...
Definition: dp_matrices.h:71
void vrna_mx_mfe_free(vrna_fold_compound_t *vc)
Free memory occupied by the Minimum Free Energy (MFE) Dynamic Programming (DP) matrices.
DP matrices suitable for local structure prediction using window approach.
Definition: dp_matrices.h:33
Various data structures and pre-processor macros.
int ** ggg_local
Energies of g-quadruplexes.
Definition: dp_matrices.h:94
void vrna_mx_pf_free(vrna_fold_compound_t *vc)
Free memory occupied by the Partition Function (PF) Dynamic Programming (DP) matrices.
int ** c_local
Energy array, given that i-j pair.
Definition: dp_matrices.h:91
Default DP matrices.
Definition: dp_matrices.h:32
int * f3
Energy of 3' end.
Definition: dp_matrices.h:67
DP matrices suitable for distance class partitioned structure prediction.
Definition: dp_matrices.h:37
int * f5
Energy of 5' end.
Definition: dp_matrices.h:66
int Fc
Minimum Free Energy of entire circular RNA.
Definition: dp_matrices.h:73
vrna_mx_type_e
An enumerator that is used to specify the type of a polymorphic Dynamic Programming (DP) matrix data ...
Definition: dp_matrices.h:31
int * c
Energy array, given that i-j pair.
Definition: dp_matrices.h:65
int ** fML_local
Multi-loop auxiliary energy array.
Definition: dp_matrices.h:93
int * f3_local
Energy of 5' end.
Definition: dp_matrices.h:92
int * ggg
Energies of g-quadruplexes.
Definition: dp_matrices.h:72
Partition function (PF) Dynamic Programming (DP) matrices data structure required within the vrna_fol...
Definition: dp_matrices.h:203