RNAlib-2.3.1
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;
259  int **l_min_Q;
260  int **l_max_Q;
261  int *k_min_Q;
262  int *k_max_Q;
263 
264 
265  FLT_OR_DBL ***Q_B;
266  int **l_min_Q_B;
267  int **l_max_Q_B;
268  int *k_min_Q_B;
269  int *k_max_Q_B;
270 
271  FLT_OR_DBL ***Q_M;
272  int **l_min_Q_M;
273  int **l_max_Q_M;
274  int *k_min_Q_M;
275  int *k_max_Q_M;
276 
277  FLT_OR_DBL ***Q_M1;
278  int **l_min_Q_M1;
279  int **l_max_Q_M1;
280  int *k_min_Q_M1;
281  int *k_max_Q_M1;
282 
283  FLT_OR_DBL ***Q_M2;
284  int **l_min_Q_M2;
285  int **l_max_Q_M2;
286  int *k_min_Q_M2;
287  int *k_max_Q_M2;
288 
289  FLT_OR_DBL **Q_c;
290  int *l_min_Q_c;
291  int *l_max_Q_c;
292  int k_min_Q_c;
293  int k_max_Q_c;
294 
295  FLT_OR_DBL **Q_cH;
296  int *l_min_Q_cH;
297  int *l_max_Q_cH;
298  int k_min_Q_cH;
299  int k_max_Q_cH;
300 
301  FLT_OR_DBL **Q_cI;
302  int *l_min_Q_cI;
303  int *l_max_Q_cI;
304  int k_min_Q_cI;
305  int k_max_Q_cI;
306 
307  FLT_OR_DBL **Q_cM;
308  int *l_min_Q_cM;
309  int *l_max_Q_cM;
310  int k_min_Q_cM;
311  int k_max_Q_cM;
312 
313  /* auxilary arrays for remaining set of coarse graining (k,l) > (k_max, l_max) */
314  FLT_OR_DBL *Q_rem;
315  FLT_OR_DBL *Q_B_rem;
316  FLT_OR_DBL *Q_M_rem;
317  FLT_OR_DBL *Q_M1_rem;
318  FLT_OR_DBL *Q_M2_rem;
319 
320  FLT_OR_DBL Q_c_rem;
321  FLT_OR_DBL Q_cH_rem;
322  FLT_OR_DBL Q_cI_rem;
323  FLT_OR_DBL Q_cM_rem;
328 #ifndef VRNA_DISABLE_C11_FEATURES
329  /* C11 support for unnamed unions/structs */
330  };
331  };
332 #endif
333 };
334 
364 int
366  vrna_mx_type_e type,
367  unsigned int options);
368 
369 int
370 vrna_mx_mfe_add(vrna_fold_compound_t *vc,
371  vrna_mx_type_e mx_type,
372  unsigned int options);
373 
374 int
375 vrna_mx_pf_add( vrna_fold_compound_t *vc,
376  vrna_mx_type_e mx_type,
377  unsigned int options);
378 
379 int
380 vrna_mx_prepare(vrna_fold_compound_t *vc,
381  unsigned int options);
382 
390 void
392 
400 void
402 
407 #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: data_structures.h:48
The most basic data structure required by many functions throughout the RNAlib.
Definition: data_structures.h:454
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