1\hypertarget{gquad_8h_source}{}\doxysection{gquad.\+h}
2\label{gquad_8h_source}\index{ViennaRNA/gquad.h@{ViennaRNA/gquad.h}}
3
4\begin{DoxyCode}{0}
5\DoxyCodeLine{00001 \textcolor{preprocessor}{\#ifndef VIENNA\_RNA\_PACKAGE\_GQUAD\_H}}
6\DoxyCodeLine{00002 \textcolor{preprocessor}{\#define VIENNA\_RNA\_PACKAGE\_GQUAD\_H}}
7\DoxyCodeLine{00003 }
8\DoxyCodeLine{00004 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{datastructures_2basic_8h}{ViennaRNA/datastructures/basic.h}}>}}
9\DoxyCodeLine{00005 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{fold__compound_8h}{ViennaRNA/fold\_compound.h}}>}}
10\DoxyCodeLine{00006 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{params_2basic_8h}{ViennaRNA/params/basic.h}}>}}
11\DoxyCodeLine{00007 }
12\DoxyCodeLine{00008 \textcolor{preprocessor}{\#ifndef INLINE}}
13\DoxyCodeLine{00009 \textcolor{preprocessor}{\#ifdef \_\_GNUC\_\_}}
14\DoxyCodeLine{00010 \textcolor{preprocessor}{\# define INLINE inline}}
15\DoxyCodeLine{00011 \textcolor{preprocessor}{\#else}}
16\DoxyCodeLine{00012 \textcolor{preprocessor}{\# define INLINE}}
17\DoxyCodeLine{00013 \textcolor{preprocessor}{\#endif}}
18\DoxyCodeLine{00014 \textcolor{preprocessor}{\#endif}}
19\DoxyCodeLine{00015 }
20\DoxyCodeLine{00030 \textcolor{keywordtype}{int}         E\_gquad(\textcolor{keywordtype}{int}           L,}
21\DoxyCodeLine{00031                     \textcolor{keywordtype}{int}           l[3],}
22\DoxyCodeLine{00032                     \mbox{\hyperlink{group__energy__parameters_structvrna__param__s}{vrna\_param\_t}}  *P);}
23\DoxyCodeLine{00033 }
24\DoxyCodeLine{00034 }
25\DoxyCodeLine{00035 \mbox{\hyperlink{group__data__structures_ga31125aeace516926bf7f251f759b6126}{FLT\_OR\_DBL}}  exp\_E\_gquad(\textcolor{keywordtype}{int}               L,}
26\DoxyCodeLine{00036                         \textcolor{keywordtype}{int}               l[3],}
27\DoxyCodeLine{00037                         \mbox{\hyperlink{group__energy__parameters_structvrna__exp__param__s}{vrna\_exp\_param\_t}}  *pf);}
28\DoxyCodeLine{00038 }
29\DoxyCodeLine{00039 }
30\DoxyCodeLine{00040 \textcolor{keywordtype}{void} E\_gquad\_ali\_en(\textcolor{keywordtype}{int}           i,}
31\DoxyCodeLine{00041                     \textcolor{keywordtype}{int}           L,}
32\DoxyCodeLine{00042                     \textcolor{keywordtype}{int}           l[3],}
33\DoxyCodeLine{00043                     \textcolor{keyword}{const} \textcolor{keywordtype}{short}   **S,}
34\DoxyCodeLine{00044                     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int}  **a2s,}
35\DoxyCodeLine{00045                     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int}  n\_seq,}
36\DoxyCodeLine{00046                     \mbox{\hyperlink{group__energy__parameters_structvrna__param__s}{vrna\_param\_t}}  *P,}
37\DoxyCodeLine{00047                     \textcolor{keywordtype}{int}           en[2]);}
38\DoxyCodeLine{00048 }
39\DoxyCodeLine{00049 }
40\DoxyCodeLine{\Hypertarget{gquad_8h_source_l00066}\mbox{\hyperlink{group__gquads_ga392e45c9615aa123737671603fa4203c}{00066}} \textcolor{keywordtype}{int} *\mbox{\hyperlink{group__gquads_ga392e45c9615aa123737671603fa4203c}{get\_gquad\_matrix}}(\textcolor{keywordtype}{short}         *S,}
41\DoxyCodeLine{00067                       \mbox{\hyperlink{group__energy__parameters_structvrna__param__s}{vrna\_param\_t}}  *P);}
42\DoxyCodeLine{00068 }
43\DoxyCodeLine{00069 }
44\DoxyCodeLine{00070 \textcolor{keywordtype}{int} *get\_gquad\_ali\_matrix(\textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int}  n,}
45\DoxyCodeLine{00071                           \textcolor{keywordtype}{short}         *S\_cons,}
46\DoxyCodeLine{00072                           \textcolor{keywordtype}{short}         **S,}
47\DoxyCodeLine{00073                           \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int}  **a2s,}
48\DoxyCodeLine{00074                           \textcolor{keywordtype}{int}           n\_seq,}
49\DoxyCodeLine{00075                           \mbox{\hyperlink{group__energy__parameters_structvrna__param__s}{vrna\_param\_t}}  *P);}
50\DoxyCodeLine{00076 }
51\DoxyCodeLine{00077 }
52\DoxyCodeLine{00078 \mbox{\hyperlink{group__data__structures_ga31125aeace516926bf7f251f759b6126}{FLT\_OR\_DBL}} *get\_gquad\_pf\_matrix(\textcolor{keywordtype}{short}             *S,}
53\DoxyCodeLine{00079                                 \mbox{\hyperlink{group__data__structures_ga31125aeace516926bf7f251f759b6126}{FLT\_OR\_DBL}}        *scale,}
54\DoxyCodeLine{00080                                 \mbox{\hyperlink{group__energy__parameters_structvrna__exp__param__s}{vrna\_exp\_param\_t}}  *pf);}
55\DoxyCodeLine{00081 }
56\DoxyCodeLine{00082 }
57\DoxyCodeLine{00083 \mbox{\hyperlink{group__data__structures_ga31125aeace516926bf7f251f759b6126}{FLT\_OR\_DBL}} *get\_gquad\_pf\_matrix\_comparative(\textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int}  n,}
58\DoxyCodeLine{00084                                             \textcolor{keywordtype}{short}             *S\_cons,}
59\DoxyCodeLine{00085                                             \textcolor{keywordtype}{short}             **S,}
60\DoxyCodeLine{00086                                             \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int}      **a2s,}
61\DoxyCodeLine{00087                                             \mbox{\hyperlink{group__data__structures_ga31125aeace516926bf7f251f759b6126}{FLT\_OR\_DBL}}        *scale,}
62\DoxyCodeLine{00088                                             \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int}      n\_seq,}
63\DoxyCodeLine{00089                                             \mbox{\hyperlink{group__energy__parameters_structvrna__exp__param__s}{vrna\_exp\_param\_t}}  *pf);}
64\DoxyCodeLine{00090 }
65\DoxyCodeLine{00091 }
66\DoxyCodeLine{00092 \textcolor{keywordtype}{int} **get\_gquad\_L\_matrix(\textcolor{keywordtype}{short}        *S,}
67\DoxyCodeLine{00093                          \textcolor{keywordtype}{int}          start,}
68\DoxyCodeLine{00094                          \textcolor{keywordtype}{int}          maxdist,}
69\DoxyCodeLine{00095                          \textcolor{keywordtype}{int}          n,}
70\DoxyCodeLine{00096                          \textcolor{keywordtype}{int}          **g,}
71\DoxyCodeLine{00097                          \mbox{\hyperlink{group__energy__parameters_structvrna__param__s}{vrna\_param\_t}} *P);}
72\DoxyCodeLine{00098 }
73\DoxyCodeLine{00099 }
74\DoxyCodeLine{00100 \textcolor{keywordtype}{void}        vrna\_gquad\_mx\_local\_update(\mbox{\hyperlink{group__fold__compound_structvrna__fc__s}{vrna\_fold\_compound\_t}} *vc,}
75\DoxyCodeLine{00101                                        \textcolor{keywordtype}{int}                  start);}
76\DoxyCodeLine{00102 }
77\DoxyCodeLine{00103 }
78\DoxyCodeLine{00104 \textcolor{keywordtype}{void} get\_gquad\_pattern\_mfe(\textcolor{keywordtype}{short}        *S,}
79\DoxyCodeLine{00105                            \textcolor{keywordtype}{int}          i,}
80\DoxyCodeLine{00106                            \textcolor{keywordtype}{int}          j,}
81\DoxyCodeLine{00107                            \mbox{\hyperlink{group__energy__parameters_structvrna__param__s}{vrna\_param\_t}} *P,}
82\DoxyCodeLine{00108                            \textcolor{keywordtype}{int}          *L,}
83\DoxyCodeLine{00109                            \textcolor{keywordtype}{int}          l[3]);}
84\DoxyCodeLine{00110 }
85\DoxyCodeLine{00111 }
86\DoxyCodeLine{00112 \textcolor{keywordtype}{void}}
87\DoxyCodeLine{00113 get\_gquad\_pattern\_exhaustive(\textcolor{keywordtype}{short}        *S,}
88\DoxyCodeLine{00114                              \textcolor{keywordtype}{int}          i,}
89\DoxyCodeLine{00115                              \textcolor{keywordtype}{int}          j,}
90\DoxyCodeLine{00116                              \mbox{\hyperlink{group__energy__parameters_structvrna__param__s}{vrna\_param\_t}} *P,}
91\DoxyCodeLine{00117                              \textcolor{keywordtype}{int}          *L,}
92\DoxyCodeLine{00118                              \textcolor{keywordtype}{int}          *l,}
93\DoxyCodeLine{00119                              \textcolor{keywordtype}{int}          threshold);}
94\DoxyCodeLine{00120 }
95\DoxyCodeLine{00121 }
96\DoxyCodeLine{00122 \textcolor{keywordtype}{void} get\_gquad\_pattern\_pf(\textcolor{keywordtype}{short}             *S,}
97\DoxyCodeLine{00123                           \textcolor{keywordtype}{int}               i,}
98\DoxyCodeLine{00124                           \textcolor{keywordtype}{int}               j,}
99\DoxyCodeLine{00125                           \mbox{\hyperlink{group__energy__parameters_structvrna__exp__param__s}{vrna\_exp\_param\_t}}  *pf,}
100\DoxyCodeLine{00126                           \textcolor{keywordtype}{int}               *L,}
101\DoxyCodeLine{00127                           \textcolor{keywordtype}{int}               l[3]);}
102\DoxyCodeLine{00128 }
103\DoxyCodeLine{00129 }
104\DoxyCodeLine{00130 \mbox{\hyperlink{group__struct__utils__plist_structvrna__elem__prob__s}{plist}} *get\_plist\_gquad\_from\_pr(\textcolor{keywordtype}{short}            *S,}
105\DoxyCodeLine{00131                                \textcolor{keywordtype}{int}              gi,}
106\DoxyCodeLine{00132                                \textcolor{keywordtype}{int}              gj,}
107\DoxyCodeLine{00133                                \mbox{\hyperlink{group__data__structures_ga31125aeace516926bf7f251f759b6126}{FLT\_OR\_DBL}}       *G,}
108\DoxyCodeLine{00134                                \mbox{\hyperlink{group__data__structures_ga31125aeace516926bf7f251f759b6126}{FLT\_OR\_DBL}}       *probs,}
109\DoxyCodeLine{00135                                \mbox{\hyperlink{group__data__structures_ga31125aeace516926bf7f251f759b6126}{FLT\_OR\_DBL}}       *scale,}
110\DoxyCodeLine{00136                                \mbox{\hyperlink{group__energy__parameters_structvrna__exp__param__s}{vrna\_exp\_param\_t}} *pf);}
111\DoxyCodeLine{00137 }
112\DoxyCodeLine{00138 }
113\DoxyCodeLine{00139 \mbox{\hyperlink{group__struct__utils__plist_structvrna__elem__prob__s}{plist}} *get\_plist\_gquad\_from\_pr\_max(\textcolor{keywordtype}{short}            *S,}
114\DoxyCodeLine{00140                                    \textcolor{keywordtype}{int}              gi,}
115\DoxyCodeLine{00141                                    \textcolor{keywordtype}{int}              gj,}
116\DoxyCodeLine{00142                                    \mbox{\hyperlink{group__data__structures_ga31125aeace516926bf7f251f759b6126}{FLT\_OR\_DBL}}       *G,}
117\DoxyCodeLine{00143                                    \mbox{\hyperlink{group__data__structures_ga31125aeace516926bf7f251f759b6126}{FLT\_OR\_DBL}}       *probs,}
118\DoxyCodeLine{00144                                    \mbox{\hyperlink{group__data__structures_ga31125aeace516926bf7f251f759b6126}{FLT\_OR\_DBL}}       *scale,}
119\DoxyCodeLine{00145                                    \textcolor{keywordtype}{int}              *L,}
120\DoxyCodeLine{00146                                    \textcolor{keywordtype}{int}              l[3],}
121\DoxyCodeLine{00147                                    \mbox{\hyperlink{group__energy__parameters_structvrna__exp__param__s}{vrna\_exp\_param\_t}} *pf);}
122\DoxyCodeLine{00148 }
123\DoxyCodeLine{00149 }
124\DoxyCodeLine{00150 \mbox{\hyperlink{group__struct__utils__plist_structvrna__elem__prob__s}{plist}} *get\_plist\_gquad\_from\_db(\textcolor{keyword}{const} \textcolor{keywordtype}{char} *structure,}
125\DoxyCodeLine{00151                                \textcolor{keywordtype}{float}      \mbox{\hyperlink{fold__vars_8h_ac98ec419070aee6831b44e5c700f090f}{pr}});}
126\DoxyCodeLine{00152 }
127\DoxyCodeLine{00153 }
128\DoxyCodeLine{00154 \mbox{\hyperlink{group__struct__utils__plist_structvrna__elem__prob__s}{plist}} *}
129\DoxyCodeLine{00155 vrna\_get\_plist\_gquad\_from\_pr(\mbox{\hyperlink{group__fold__compound_structvrna__fc__s}{vrna\_fold\_compound\_t}} *fc,}
130\DoxyCodeLine{00156                              \textcolor{keywordtype}{int}                  gi,}
131\DoxyCodeLine{00157                              \textcolor{keywordtype}{int}                  gj);}
132\DoxyCodeLine{00158 }
133\DoxyCodeLine{00159 }
134\DoxyCodeLine{00160 \mbox{\hyperlink{group__struct__utils__plist_structvrna__elem__prob__s}{plist}} *}
135\DoxyCodeLine{00161 vrna\_get\_plist\_gquad\_from\_pr\_max(\mbox{\hyperlink{group__fold__compound_structvrna__fc__s}{vrna\_fold\_compound\_t}} *fc,}
136\DoxyCodeLine{00162                                  \textcolor{keywordtype}{int}                  gi,}
137\DoxyCodeLine{00163                                  \textcolor{keywordtype}{int}                  gj,}
138\DoxyCodeLine{00164                                  \textcolor{keywordtype}{int}                  *Lmax,}
139\DoxyCodeLine{00165                                  \textcolor{keywordtype}{int}                  lmax[3]);}
140\DoxyCodeLine{00166 }
141\DoxyCodeLine{00167 }
142\DoxyCodeLine{00168 \textcolor{keywordtype}{int}         get\_gquad\_count(\textcolor{keywordtype}{short} *S,}
143\DoxyCodeLine{00169                             \textcolor{keywordtype}{int}   i,}
144\DoxyCodeLine{00170                             \textcolor{keywordtype}{int}   j);}
145\DoxyCodeLine{00171 }
146\DoxyCodeLine{00172 }
147\DoxyCodeLine{00173 \textcolor{keywordtype}{int}         get\_gquad\_layer\_count(\textcolor{keywordtype}{short} *S,}
148\DoxyCodeLine{00174                                   \textcolor{keywordtype}{int}   i,}
149\DoxyCodeLine{00175                                   \textcolor{keywordtype}{int}   j);}
150\DoxyCodeLine{00176 }
151\DoxyCodeLine{00177 }
152\DoxyCodeLine{00178 \textcolor{keywordtype}{void} get\_gquad\_pattern\_mfe\_ali(\textcolor{keywordtype}{short}        **S,}
153\DoxyCodeLine{00179                                \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} **a2s,}
154\DoxyCodeLine{00180                                \textcolor{keywordtype}{short}        *S\_cons,}
155\DoxyCodeLine{00181                                \textcolor{keywordtype}{int}          n\_seq,}
156\DoxyCodeLine{00182                                \textcolor{keywordtype}{int}          i,}
157\DoxyCodeLine{00183                                \textcolor{keywordtype}{int}          j,}
158\DoxyCodeLine{00184                                \mbox{\hyperlink{group__energy__parameters_structvrna__param__s}{vrna\_param\_t}} *P,}
159\DoxyCodeLine{00185                                \textcolor{keywordtype}{int}          *L,}
160\DoxyCodeLine{00186                                \textcolor{keywordtype}{int}          l[3]);}
161\DoxyCodeLine{00187 }
162\DoxyCodeLine{00188 }
163\DoxyCodeLine{\Hypertarget{gquad_8h_source_l00199}\mbox{\hyperlink{group__gquads_gae41763215b9c64d2a7b67f0df8a28078}{00199}} \textcolor{keywordtype}{int} \mbox{\hyperlink{group__gquads_gae41763215b9c64d2a7b67f0df8a28078}{parse\_gquad}}(\textcolor{keyword}{const} \textcolor{keywordtype}{char}  *struc,}
164\DoxyCodeLine{00200                 \textcolor{keywordtype}{int}         *L,}
165\DoxyCodeLine{00201                 \textcolor{keywordtype}{int}         l[3]);}
166\DoxyCodeLine{00202 }
167\DoxyCodeLine{00203 }
168\DoxyCodeLine{00204 INLINE PRIVATE \textcolor{keywordtype}{int} \mbox{\hyperlink{group__gquads_ga220c41e8dbcee940ac975b8ce88e55c5}{backtrack\_GQuad\_IntLoop}}(\textcolor{keywordtype}{int}          c,}
169\DoxyCodeLine{00205                                            \textcolor{keywordtype}{int}          i,}
170\DoxyCodeLine{00206                                            \textcolor{keywordtype}{int}          j,}
171\DoxyCodeLine{00207                                            \textcolor{keywordtype}{int}          type,}
172\DoxyCodeLine{00208                                            \textcolor{keywordtype}{short}        *S,}
173\DoxyCodeLine{00209                                            \textcolor{keywordtype}{int}          *ggg,}
174\DoxyCodeLine{00210                                            \textcolor{keywordtype}{int}          *index,}
175\DoxyCodeLine{00211                                            \textcolor{keywordtype}{int}          *p,}
176\DoxyCodeLine{00212                                            \textcolor{keywordtype}{int}          *q,}
177\DoxyCodeLine{00213                                            \mbox{\hyperlink{group__energy__parameters_structvrna__param__s}{vrna\_param\_t}} *P);}
178\DoxyCodeLine{00214 }
179\DoxyCodeLine{00215 }
180\DoxyCodeLine{00216 INLINE PRIVATE \textcolor{keywordtype}{int} backtrack\_GQuad\_IntLoop\_comparative(\textcolor{keywordtype}{int}          c,}
181\DoxyCodeLine{00217                                                        \textcolor{keywordtype}{int}          i,}
182\DoxyCodeLine{00218                                                        \textcolor{keywordtype}{int}          j,}
183\DoxyCodeLine{00219                                                        \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} *type,}
184\DoxyCodeLine{00220                                                        \textcolor{keywordtype}{short}        *S\_cons,}
185\DoxyCodeLine{00221                                                        \textcolor{keywordtype}{short}        **S5,}
186\DoxyCodeLine{00222                                                        \textcolor{keywordtype}{short}        **S3,}
187\DoxyCodeLine{00223                                                        \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} **a2s,}
188\DoxyCodeLine{00224                                                        \textcolor{keywordtype}{int}          *ggg,}
189\DoxyCodeLine{00225                                                        \textcolor{keywordtype}{int}          *index,}
190\DoxyCodeLine{00226                                                        \textcolor{keywordtype}{int}          *p,}
191\DoxyCodeLine{00227                                                        \textcolor{keywordtype}{int}          *q,}
192\DoxyCodeLine{00228                                                        \textcolor{keywordtype}{int}          n\_seq,}
193\DoxyCodeLine{00229                                                        \mbox{\hyperlink{group__energy__parameters_structvrna__param__s}{vrna\_param\_t}} *P);}
194\DoxyCodeLine{00230 }
195\DoxyCodeLine{00231 }
196\DoxyCodeLine{00232 INLINE PRIVATE \textcolor{keywordtype}{int} \mbox{\hyperlink{group__gquads_ga7b371308fa5a45c7ac353ef6ed1014de}{backtrack\_GQuad\_IntLoop\_L}}(\textcolor{keywordtype}{int}          c,}
197\DoxyCodeLine{00233                                              \textcolor{keywordtype}{int}          i,}
198\DoxyCodeLine{00234                                              \textcolor{keywordtype}{int}          j,}
199\DoxyCodeLine{00235                                              \textcolor{keywordtype}{int}          type,}
200\DoxyCodeLine{00236                                              \textcolor{keywordtype}{short}        *S,}
201\DoxyCodeLine{00237                                              \textcolor{keywordtype}{int}          **ggg,}
202\DoxyCodeLine{00238                                              \textcolor{keywordtype}{int}          maxdist,}
203\DoxyCodeLine{00239                                              \textcolor{keywordtype}{int}          *p,}
204\DoxyCodeLine{00240                                              \textcolor{keywordtype}{int}          *q,}
205\DoxyCodeLine{00241                                              \mbox{\hyperlink{group__energy__parameters_structvrna__param__s}{vrna\_param\_t}} *P);}
206\DoxyCodeLine{00242 }
207\DoxyCodeLine{00243 }
208\DoxyCodeLine{00244 PRIVATE INLINE \textcolor{keywordtype}{int}}
209\DoxyCodeLine{00245 vrna\_BT\_gquad\_int(\mbox{\hyperlink{group__fold__compound_structvrna__fc__s}{vrna\_fold\_compound\_t}}  *vc,}
210\DoxyCodeLine{00246                   \textcolor{keywordtype}{int}                   i,}
211\DoxyCodeLine{00247                   \textcolor{keywordtype}{int}                   j,}
212\DoxyCodeLine{00248                   \textcolor{keywordtype}{int}                   en,}
213\DoxyCodeLine{00249                   \mbox{\hyperlink{group__data__structures_structvrna__bp__stack__s}{vrna\_bp\_stack\_t}}       *bp\_stack,}
214\DoxyCodeLine{00250                   \textcolor{keywordtype}{int}                   *stack\_count);}
215\DoxyCodeLine{00251 }
216\DoxyCodeLine{00252 }
217\DoxyCodeLine{00253 PRIVATE INLINE \textcolor{keywordtype}{int}}
218\DoxyCodeLine{00254 vrna\_BT\_gquad\_mfe(\mbox{\hyperlink{group__fold__compound_structvrna__fc__s}{vrna\_fold\_compound\_t}}  *vc,}
219\DoxyCodeLine{00255                   \textcolor{keywordtype}{int}                   i,}
220\DoxyCodeLine{00256                   \textcolor{keywordtype}{int}                   j,}
221\DoxyCodeLine{00257                   \mbox{\hyperlink{group__data__structures_structvrna__bp__stack__s}{vrna\_bp\_stack\_t}}       *bp\_stack,}
222\DoxyCodeLine{00258                   \textcolor{keywordtype}{int}                   *stack\_count)}
223\DoxyCodeLine{00259 \{}
224\DoxyCodeLine{00260   \textcolor{comment}{/*}}
225\DoxyCodeLine{00261 \textcolor{comment}{   * here we do some fancy stuff to backtrace the stacksize and linker lengths}}
226\DoxyCodeLine{00262 \textcolor{comment}{   * of the g-\/quadruplex that should reside within position i,j}}
227\DoxyCodeLine{00263 \textcolor{comment}{   */}}
228\DoxyCodeLine{00264   \textcolor{keywordtype}{short}         *S;}
229\DoxyCodeLine{00265   \textcolor{keywordtype}{int}           l[3], L, a, n\_seq;}
230\DoxyCodeLine{00266   \mbox{\hyperlink{group__energy__parameters_structvrna__param__s}{vrna\_param\_t}}  *P;}
231\DoxyCodeLine{00267 }
232\DoxyCodeLine{00268   \textcolor{keywordflow}{if} (vc) \{}
233\DoxyCodeLine{00269     P = vc-\/>\mbox{\hyperlink{group__fold__compound_a19b8720c2c5321c1b97c830bd17566ea}{params}};}
234\DoxyCodeLine{00270     \textcolor{keywordflow}{switch} (vc-\/>\mbox{\hyperlink{group__fold__compound_a391bcf8ac5997784aaf780cdd251c464}{type}}) \{}
235\DoxyCodeLine{00271       \textcolor{keywordflow}{case} \mbox{\hyperlink{group__fold__compound_gga01a4ff86fa71deaaa5d1abbd95a1447da7e264dd3cf2dc9b6448caabcb7763cd6}{VRNA\_FC\_TYPE\_SINGLE}}:}
236\DoxyCodeLine{00272         S = vc-\/>sequence\_encoding2;}
237\DoxyCodeLine{00273         L = -\/1;}
238\DoxyCodeLine{00274 }
239\DoxyCodeLine{00275         get\_gquad\_pattern\_mfe(S, i, j, P, \&L, l);}
240\DoxyCodeLine{00276         \textcolor{keywordflow}{break};}
241\DoxyCodeLine{00277 }
242\DoxyCodeLine{00278       \textcolor{keywordflow}{case} \mbox{\hyperlink{group__fold__compound_gga01a4ff86fa71deaaa5d1abbd95a1447dab821ce46ea3cf665be97df22a76f5023}{VRNA\_FC\_TYPE\_COMPARATIVE}}:}
243\DoxyCodeLine{00279         n\_seq = vc-\/>\mbox{\hyperlink{group__fold__compound_a614702ab74478e786272be44f8cebfe3}{n\_seq}};}
244\DoxyCodeLine{00280         L     = -\/1;}
245\DoxyCodeLine{00281         get\_gquad\_pattern\_mfe\_ali(vc-\/>\mbox{\hyperlink{group__fold__compound_aebb37297f92c7bd22aac6343f8f61d61}{S}}, vc-\/>a2s, vc-\/>\mbox{\hyperlink{group__fold__compound_aa3fab7ae38ebfed2028375221d295686}{S\_cons}}, n\_seq, i, j, P, \&L, l);}
246\DoxyCodeLine{00282         \textcolor{keywordflow}{break};}
247\DoxyCodeLine{00283     \}}
248\DoxyCodeLine{00284 }
249\DoxyCodeLine{00285     \textcolor{keywordflow}{if} (L != -\/1) \{}
250\DoxyCodeLine{00286       \textcolor{comment}{/* fill the G's of the quadruplex into base\_pair2 */}}
251\DoxyCodeLine{00287       \textcolor{keywordflow}{for} (a = 0; a < L; a++) \{}
252\DoxyCodeLine{00288         bp\_stack[++(*stack\_count)].i  = i + a;}
253\DoxyCodeLine{00289         bp\_stack[(*stack\_count)].j    = i + a;}
254\DoxyCodeLine{00290         bp\_stack[++(*stack\_count)].i  = i + L + l[0] + a;}
255\DoxyCodeLine{00291         bp\_stack[(*stack\_count)].j    = i + L + l[0] + a;}
256\DoxyCodeLine{00292         bp\_stack[++(*stack\_count)].i  = i + L + l[0] + L + l[1] + a;}
257\DoxyCodeLine{00293         bp\_stack[(*stack\_count)].j    = i + L + l[0] + L + l[1] + a;}
258\DoxyCodeLine{00294         bp\_stack[++(*stack\_count)].i  = i + L + l[0] + L + l[1] + L + l[2] + a;}
259\DoxyCodeLine{00295         bp\_stack[(*stack\_count)].j    = i + L + l[0] + L + l[1] + L + l[2] + a;}
260\DoxyCodeLine{00296       \}}
261\DoxyCodeLine{00297       \textcolor{keywordflow}{return} 1;}
262\DoxyCodeLine{00298     \} \textcolor{keywordflow}{else} \{}
263\DoxyCodeLine{00299       \textcolor{keywordflow}{return} 0;}
264\DoxyCodeLine{00300     \}}
265\DoxyCodeLine{00301   \}}
266\DoxyCodeLine{00302 }
267\DoxyCodeLine{00303   \textcolor{keywordflow}{return} 0;}
268\DoxyCodeLine{00304 \}}
269\DoxyCodeLine{00305 }
270\DoxyCodeLine{00306 }
271\DoxyCodeLine{00307 PRIVATE INLINE \textcolor{keywordtype}{int}}
272\DoxyCodeLine{00308 vrna\_BT\_gquad\_int(\mbox{\hyperlink{group__fold__compound_structvrna__fc__s}{vrna\_fold\_compound\_t}}  *vc,}
273\DoxyCodeLine{00309                   \textcolor{keywordtype}{int}                   i,}
274\DoxyCodeLine{00310                   \textcolor{keywordtype}{int}                   j,}
275\DoxyCodeLine{00311                   \textcolor{keywordtype}{int}                   en,}
276\DoxyCodeLine{00312                   \mbox{\hyperlink{group__data__structures_structvrna__bp__stack__s}{vrna\_bp\_stack\_t}}       *bp\_stack,}
277\DoxyCodeLine{00313                   \textcolor{keywordtype}{int}                   *stack\_count)}
278\DoxyCodeLine{00314 \{}
279\DoxyCodeLine{00315   \textcolor{keywordtype}{int}           energy, \mbox{\hyperlink{group__model__details_ga72b511ed1201f7e23ec437e468790d74}{dangles}}, *idx, ij, p, q, maxl, minl, c0, l1, *ggg;}
280\DoxyCodeLine{00316   \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} type;}
281\DoxyCodeLine{00317   \textcolor{keywordtype}{char}          *ptype;}
282\DoxyCodeLine{00318   \textcolor{keywordtype}{short}         si, sj, *S, *S1;}
283\DoxyCodeLine{00319 }
284\DoxyCodeLine{00320   \mbox{\hyperlink{group__energy__parameters_structvrna__param__s}{vrna\_param\_t}}  *P;}
285\DoxyCodeLine{00321   \mbox{\hyperlink{group__model__details_structvrna__md__s}{vrna\_md\_t}}     *md;}
286\DoxyCodeLine{00322 }
287\DoxyCodeLine{00323   idx     = vc-\/>\mbox{\hyperlink{group__fold__compound_a5037235dee512efd85ca543780bbca1a}{jindx}};}
288\DoxyCodeLine{00324   ij      = idx[j] + i;}
289\DoxyCodeLine{00325   P       = vc-\/>\mbox{\hyperlink{group__fold__compound_a19b8720c2c5321c1b97c830bd17566ea}{params}};}
290\DoxyCodeLine{00326   md      = \&(P-\/>\mbox{\hyperlink{group__energy__parameters_a7b84353eb9075c595bad4ceb871bcae7}{model\_details}});}
291\DoxyCodeLine{00327   ptype   = vc-\/>\mbox{\hyperlink{group__fold__compound_a3fbea559f1d1976b2d67c215cdeee0b2}{ptype}};}
292\DoxyCodeLine{00328   type    = (\textcolor{keywordtype}{unsigned} char)ptype[ij];}
293\DoxyCodeLine{00329   S1      = vc-\/>\mbox{\hyperlink{group__fold__compound_a9934bdb695d35a3544285cbcc19f9763}{sequence\_encoding}};}
294\DoxyCodeLine{00330   S       = vc-\/>sequence\_encoding2;}
295\DoxyCodeLine{00331   \mbox{\hyperlink{group__model__details_ga72b511ed1201f7e23ec437e468790d74}{dangles}} = md-\/>\mbox{\hyperlink{group__model__details_adcda4ff2ea77748ae0e8700288282efc}{dangles}};}
296\DoxyCodeLine{00332   si      = S1[i + 1];}
297\DoxyCodeLine{00333   sj      = S1[j -\/ 1];}
298\DoxyCodeLine{00334   ggg     = vc-\/>\mbox{\hyperlink{group__fold__compound_aca8be7bdc65bafe2172c6ee777f18568}{matrices}}-\/>\mbox{\hyperlink{group__dp__matrices_a0b7b86a5c75c96eabb89eb53a13e7164}{ggg}};}
299\DoxyCodeLine{00335   energy  = 0;}
300\DoxyCodeLine{00336 }
301\DoxyCodeLine{00337   \textcolor{keywordflow}{if} (\mbox{\hyperlink{group__model__details_ga72b511ed1201f7e23ec437e468790d74}{dangles}} == 2)}
302\DoxyCodeLine{00338     energy += P-\/>mismatchI[type][si][sj];}
303\DoxyCodeLine{00339 }
304\DoxyCodeLine{00340   \textcolor{keywordflow}{if} (type > 2)}
305\DoxyCodeLine{00341     energy += P-\/>TerminalAU;}
306\DoxyCodeLine{00342 }
307\DoxyCodeLine{00343   p = i + 1;}
308\DoxyCodeLine{00344   \textcolor{keywordflow}{if} (S1[p] == 3) \{}
309\DoxyCodeLine{00345     \textcolor{keywordflow}{if} (p < j -\/ VRNA\_GQUAD\_MIN\_BOX\_SIZE) \{}
310\DoxyCodeLine{00346       minl  = j -\/ i + p -\/ \mbox{\hyperlink{constants_8h_ad1bd6eabac419670ddd3c9ed82145988}{MAXLOOP}} -\/ 2;}
311\DoxyCodeLine{00347       c0    = p + VRNA\_GQUAD\_MIN\_BOX\_SIZE -\/ 1;}
312\DoxyCodeLine{00348       minl  = \mbox{\hyperlink{group__utils_ga33297b3679c713b0c4d897cd0fe3b122}{MAX2}}(c0, minl);}
313\DoxyCodeLine{00349       c0    = j -\/ 3;}
314\DoxyCodeLine{00350       maxl  = p + VRNA\_GQUAD\_MAX\_BOX\_SIZE + 1;}
315\DoxyCodeLine{00351       maxl  = \mbox{\hyperlink{group__utils_gae0b9cd0ce090bd69b951aa73e8fa4f7d}{MIN2}}(c0, maxl);}
316\DoxyCodeLine{00352       \textcolor{keywordflow}{for} (q = minl; q < maxl; q++) \{}
317\DoxyCodeLine{00353         \textcolor{keywordflow}{if} (S[q] != 3)}
318\DoxyCodeLine{00354           \textcolor{keywordflow}{continue};}
319\DoxyCodeLine{00355 }
320\DoxyCodeLine{00356         \textcolor{keywordflow}{if} (en == energy + ggg[idx[q] + p] + P-\/>internal\_loop[j -\/ q -\/ 1])}
321\DoxyCodeLine{00357           \textcolor{keywordflow}{return} vrna\_BT\_gquad\_mfe(vc, p, q, bp\_stack, stack\_count);}
322\DoxyCodeLine{00358       \}}
323\DoxyCodeLine{00359     \}}
324\DoxyCodeLine{00360   \}}
325\DoxyCodeLine{00361 }
326\DoxyCodeLine{00362   \textcolor{keywordflow}{for} (p = i + 2;}
327\DoxyCodeLine{00363        p < j -\/ VRNA\_GQUAD\_MIN\_BOX\_SIZE;}
328\DoxyCodeLine{00364        p++) \{}
329\DoxyCodeLine{00365     l1 = p -\/ i -\/ 1;}
330\DoxyCodeLine{00366     \textcolor{keywordflow}{if} (l1 > \mbox{\hyperlink{constants_8h_ad1bd6eabac419670ddd3c9ed82145988}{MAXLOOP}})}
331\DoxyCodeLine{00367       \textcolor{keywordflow}{break};}
332\DoxyCodeLine{00368 }
333\DoxyCodeLine{00369     \textcolor{keywordflow}{if} (S1[p] != 3)}
334\DoxyCodeLine{00370       \textcolor{keywordflow}{continue};}
335\DoxyCodeLine{00371 }
336\DoxyCodeLine{00372     minl  = j -\/ i + p -\/ \mbox{\hyperlink{constants_8h_ad1bd6eabac419670ddd3c9ed82145988}{MAXLOOP}} -\/ 2;}
337\DoxyCodeLine{00373     c0    = p + VRNA\_GQUAD\_MIN\_BOX\_SIZE -\/ 1;}
338\DoxyCodeLine{00374     minl  = \mbox{\hyperlink{group__utils_ga33297b3679c713b0c4d897cd0fe3b122}{MAX2}}(c0, minl);}
339\DoxyCodeLine{00375     c0    = j -\/ 1;}
340\DoxyCodeLine{00376     maxl  = p + VRNA\_GQUAD\_MAX\_BOX\_SIZE + 1;}
341\DoxyCodeLine{00377     maxl  = \mbox{\hyperlink{group__utils_gae0b9cd0ce090bd69b951aa73e8fa4f7d}{MIN2}}(c0, maxl);}
342\DoxyCodeLine{00378     \textcolor{keywordflow}{for} (q = minl; q < maxl; q++) \{}
343\DoxyCodeLine{00379       \textcolor{keywordflow}{if} (S1[q] != 3)}
344\DoxyCodeLine{00380         \textcolor{keywordflow}{continue};}
345\DoxyCodeLine{00381 }
346\DoxyCodeLine{00382       \textcolor{keywordflow}{if} (en == energy + ggg[idx[q] + p] + P-\/>internal\_loop[l1 + j -\/ q -\/ 1])}
347\DoxyCodeLine{00383         \textcolor{keywordflow}{return} vrna\_BT\_gquad\_mfe(vc, p, q, bp\_stack, stack\_count);}
348\DoxyCodeLine{00384     \}}
349\DoxyCodeLine{00385   \}}
350\DoxyCodeLine{00386 }
351\DoxyCodeLine{00387   q = j -\/ 1;}
352\DoxyCodeLine{00388   \textcolor{keywordflow}{if} (S1[q] == 3)}
353\DoxyCodeLine{00389     \textcolor{keywordflow}{for} (p = i + 4;}
354\DoxyCodeLine{00390          p < j -\/ VRNA\_GQUAD\_MIN\_BOX\_SIZE;}
355\DoxyCodeLine{00391          p++) \{}
356\DoxyCodeLine{00392       l1 = p -\/ i -\/ 1;}
357\DoxyCodeLine{00393       \textcolor{keywordflow}{if} (l1 > \mbox{\hyperlink{constants_8h_ad1bd6eabac419670ddd3c9ed82145988}{MAXLOOP}})}
358\DoxyCodeLine{00394         \textcolor{keywordflow}{break};}
359\DoxyCodeLine{00395 }
360\DoxyCodeLine{00396       \textcolor{keywordflow}{if} (S1[p] != 3)}
361\DoxyCodeLine{00397         \textcolor{keywordflow}{continue};}
362\DoxyCodeLine{00398 }
363\DoxyCodeLine{00399       \textcolor{keywordflow}{if} (en == energy + ggg[idx[q] + p] + P-\/>internal\_loop[l1])}
364\DoxyCodeLine{00400         \textcolor{keywordflow}{return} vrna\_BT\_gquad\_mfe(vc, p, q, bp\_stack, stack\_count);}
365\DoxyCodeLine{00401     \}}
366\DoxyCodeLine{00402 }
367\DoxyCodeLine{00403   \textcolor{keywordflow}{return} 0;}
368\DoxyCodeLine{00404 \}}
369\DoxyCodeLine{00405 }
370\DoxyCodeLine{00406 }
371\DoxyCodeLine{00424 INLINE PRIVATE \textcolor{keywordtype}{int}}
372\DoxyCodeLine{\Hypertarget{gquad_8h_source_l00425}\mbox{\hyperlink{group__gquads_ga220c41e8dbcee940ac975b8ce88e55c5}{00425}} \mbox{\hyperlink{group__gquads_ga220c41e8dbcee940ac975b8ce88e55c5}{backtrack\_GQuad\_IntLoop}}(\textcolor{keywordtype}{int}           c,}
373\DoxyCodeLine{00426                         \textcolor{keywordtype}{int}           i,}
374\DoxyCodeLine{00427                         \textcolor{keywordtype}{int}           j,}
375\DoxyCodeLine{00428                         \textcolor{keywordtype}{int}           type,}
376\DoxyCodeLine{00429                         \textcolor{keywordtype}{short}         *S,}
377\DoxyCodeLine{00430                         \textcolor{keywordtype}{int}           *ggg,}
378\DoxyCodeLine{00431                         \textcolor{keywordtype}{int}           *index,}
379\DoxyCodeLine{00432                         \textcolor{keywordtype}{int}           *p,}
380\DoxyCodeLine{00433                         \textcolor{keywordtype}{int}           *q,}
381\DoxyCodeLine{00434                         \mbox{\hyperlink{group__energy__parameters_structvrna__param__s}{vrna\_param\_t}}  *P)}
382\DoxyCodeLine{00435 \{}
383\DoxyCodeLine{00436   \textcolor{keywordtype}{int}   energy, \mbox{\hyperlink{group__model__details_ga72b511ed1201f7e23ec437e468790d74}{dangles}}, k, l, maxl, minl, c0, l1;}
384\DoxyCodeLine{00437   \textcolor{keywordtype}{short} si, sj;}
385\DoxyCodeLine{00438 }
386\DoxyCodeLine{00439   \mbox{\hyperlink{group__model__details_ga72b511ed1201f7e23ec437e468790d74}{dangles}} = P-\/>\mbox{\hyperlink{group__energy__parameters_a7b84353eb9075c595bad4ceb871bcae7}{model\_details}}.\mbox{\hyperlink{group__model__details_adcda4ff2ea77748ae0e8700288282efc}{dangles}};}
387\DoxyCodeLine{00440   si      = S[i + 1];}
388\DoxyCodeLine{00441   sj      = S[j -\/ 1];}
389\DoxyCodeLine{00442   energy  = 0;}
390\DoxyCodeLine{00443 }
391\DoxyCodeLine{00444   \textcolor{keywordflow}{if} (\mbox{\hyperlink{group__model__details_ga72b511ed1201f7e23ec437e468790d74}{dangles}} == 2)}
392\DoxyCodeLine{00445     energy += P-\/>mismatchI[type][si][sj];}
393\DoxyCodeLine{00446 }
394\DoxyCodeLine{00447   \textcolor{keywordflow}{if} (type > 2)}
395\DoxyCodeLine{00448     energy += P-\/>TerminalAU;}
396\DoxyCodeLine{00449 }
397\DoxyCodeLine{00450   k = i + 1;}
398\DoxyCodeLine{00451   \textcolor{keywordflow}{if} (S[k] == 3) \{}
399\DoxyCodeLine{00452     \textcolor{keywordflow}{if} (k < j -\/ VRNA\_GQUAD\_MIN\_BOX\_SIZE) \{}
400\DoxyCodeLine{00453       minl  = j -\/ i + k -\/ \mbox{\hyperlink{constants_8h_ad1bd6eabac419670ddd3c9ed82145988}{MAXLOOP}} -\/ 2;}
401\DoxyCodeLine{00454       c0    = k + VRNA\_GQUAD\_MIN\_BOX\_SIZE -\/ 1;}
402\DoxyCodeLine{00455       minl  = \mbox{\hyperlink{group__utils_ga33297b3679c713b0c4d897cd0fe3b122}{MAX2}}(c0, minl);}
403\DoxyCodeLine{00456       c0    = j -\/ 3;}
404\DoxyCodeLine{00457       maxl  = k + VRNA\_GQUAD\_MAX\_BOX\_SIZE + 1;}
405\DoxyCodeLine{00458       maxl  = \mbox{\hyperlink{group__utils_gae0b9cd0ce090bd69b951aa73e8fa4f7d}{MIN2}}(c0, maxl);}
406\DoxyCodeLine{00459       \textcolor{keywordflow}{for} (l = minl; l < maxl; l++) \{}
407\DoxyCodeLine{00460         \textcolor{keywordflow}{if} (S[l] != 3)}
408\DoxyCodeLine{00461           \textcolor{keywordflow}{continue};}
409\DoxyCodeLine{00462 }
410\DoxyCodeLine{00463         \textcolor{keywordflow}{if} (c == energy + ggg[index[l] + k] + P-\/>internal\_loop[j -\/ l -\/ 1]) \{}
411\DoxyCodeLine{00464           *p  = k;}
412\DoxyCodeLine{00465           *q  = l;}
413\DoxyCodeLine{00466           \textcolor{keywordflow}{return} 1;}
414\DoxyCodeLine{00467         \}}
415\DoxyCodeLine{00468       \}}
416\DoxyCodeLine{00469     \}}
417\DoxyCodeLine{00470   \}}
418\DoxyCodeLine{00471 }
419\DoxyCodeLine{00472   \textcolor{keywordflow}{for} (k = i + 2;}
420\DoxyCodeLine{00473        k < j -\/ VRNA\_GQUAD\_MIN\_BOX\_SIZE;}
421\DoxyCodeLine{00474        k++) \{}
422\DoxyCodeLine{00475     l1 = k -\/ i -\/ 1;}
423\DoxyCodeLine{00476     \textcolor{keywordflow}{if} (l1 > \mbox{\hyperlink{constants_8h_ad1bd6eabac419670ddd3c9ed82145988}{MAXLOOP}})}
424\DoxyCodeLine{00477       \textcolor{keywordflow}{break};}
425\DoxyCodeLine{00478 }
426\DoxyCodeLine{00479     \textcolor{keywordflow}{if} (S[k] != 3)}
427\DoxyCodeLine{00480       \textcolor{keywordflow}{continue};}
428\DoxyCodeLine{00481 }
429\DoxyCodeLine{00482     minl  = j -\/ i + k -\/ \mbox{\hyperlink{constants_8h_ad1bd6eabac419670ddd3c9ed82145988}{MAXLOOP}} -\/ 2;}
430\DoxyCodeLine{00483     c0    = k + VRNA\_GQUAD\_MIN\_BOX\_SIZE -\/ 1;}
431\DoxyCodeLine{00484     minl  = \mbox{\hyperlink{group__utils_ga33297b3679c713b0c4d897cd0fe3b122}{MAX2}}(c0, minl);}
432\DoxyCodeLine{00485     c0    = j -\/ 1;}
433\DoxyCodeLine{00486     maxl  = k + VRNA\_GQUAD\_MAX\_BOX\_SIZE + 1;}
434\DoxyCodeLine{00487     maxl  = \mbox{\hyperlink{group__utils_gae0b9cd0ce090bd69b951aa73e8fa4f7d}{MIN2}}(c0, maxl);}
435\DoxyCodeLine{00488     \textcolor{keywordflow}{for} (l = minl; l < maxl; l++) \{}
436\DoxyCodeLine{00489       \textcolor{keywordflow}{if} (S[l] != 3)}
437\DoxyCodeLine{00490         \textcolor{keywordflow}{continue};}
438\DoxyCodeLine{00491 }
439\DoxyCodeLine{00492       \textcolor{keywordflow}{if} (c == energy + ggg[index[l] + k] + P-\/>internal\_loop[l1 + j -\/ l -\/ 1]) \{}
440\DoxyCodeLine{00493         *p  = k;}
441\DoxyCodeLine{00494         *q  = l;}
442\DoxyCodeLine{00495         \textcolor{keywordflow}{return} 1;}
443\DoxyCodeLine{00496       \}}
444\DoxyCodeLine{00497     \}}
445\DoxyCodeLine{00498   \}}
446\DoxyCodeLine{00499 }
447\DoxyCodeLine{00500   l = j -\/ 1;}
448\DoxyCodeLine{00501   \textcolor{keywordflow}{if} (S[l] == 3)}
449\DoxyCodeLine{00502     \textcolor{keywordflow}{for} (k = i + 4;}
450\DoxyCodeLine{00503          k < j -\/ VRNA\_GQUAD\_MIN\_BOX\_SIZE;}
451\DoxyCodeLine{00504          k++) \{}
452\DoxyCodeLine{00505       l1 = k -\/ i -\/ 1;}
453\DoxyCodeLine{00506       \textcolor{keywordflow}{if} (l1 > \mbox{\hyperlink{constants_8h_ad1bd6eabac419670ddd3c9ed82145988}{MAXLOOP}})}
454\DoxyCodeLine{00507         \textcolor{keywordflow}{break};}
455\DoxyCodeLine{00508 }
456\DoxyCodeLine{00509       \textcolor{keywordflow}{if} (S[k] != 3)}
457\DoxyCodeLine{00510         \textcolor{keywordflow}{continue};}
458\DoxyCodeLine{00511 }
459\DoxyCodeLine{00512       \textcolor{keywordflow}{if} (c == energy + ggg[index[l] + k] + P-\/>internal\_loop[l1]) \{}
460\DoxyCodeLine{00513         *p  = k;}
461\DoxyCodeLine{00514         *q  = l;}
462\DoxyCodeLine{00515         \textcolor{keywordflow}{return} 1;}
463\DoxyCodeLine{00516       \}}
464\DoxyCodeLine{00517     \}}
465\DoxyCodeLine{00518 }
466\DoxyCodeLine{00519   \textcolor{keywordflow}{return} 0;}
467\DoxyCodeLine{00520 \}}
468\DoxyCodeLine{00521 }
469\DoxyCodeLine{00522 }
470\DoxyCodeLine{00523 INLINE PRIVATE \textcolor{keywordtype}{int}}
471\DoxyCodeLine{00524 backtrack\_GQuad\_IntLoop\_comparative(\textcolor{keywordtype}{int}           c,}
472\DoxyCodeLine{00525                                     \textcolor{keywordtype}{int}           i,}
473\DoxyCodeLine{00526                                     \textcolor{keywordtype}{int}           j,}
474\DoxyCodeLine{00527                                     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int}  *type,}
475\DoxyCodeLine{00528                                     \textcolor{keywordtype}{short}         *S\_cons,}
476\DoxyCodeLine{00529                                     \textcolor{keywordtype}{short}         **S5,}
477\DoxyCodeLine{00530                                     \textcolor{keywordtype}{short}         **S3,}
478\DoxyCodeLine{00531                                     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int}  **a2s,}
479\DoxyCodeLine{00532                                     \textcolor{keywordtype}{int}           *ggg,}
480\DoxyCodeLine{00533                                     \textcolor{keywordtype}{int}           *index,}
481\DoxyCodeLine{00534                                     \textcolor{keywordtype}{int}           *p,}
482\DoxyCodeLine{00535                                     \textcolor{keywordtype}{int}           *q,}
483\DoxyCodeLine{00536                                     \textcolor{keywordtype}{int}           n\_seq,}
484\DoxyCodeLine{00537                                     \mbox{\hyperlink{group__energy__parameters_structvrna__param__s}{vrna\_param\_t}}  *P)}
485\DoxyCodeLine{00538 \{}
486\DoxyCodeLine{00539   \textcolor{keywordtype}{int} energy, \mbox{\hyperlink{group__model__details_ga72b511ed1201f7e23ec437e468790d74}{dangles}}, k, l, maxl, minl, c0, l1, ss, tt, u1, u2, eee;}
487\DoxyCodeLine{00540 }
488\DoxyCodeLine{00541   \mbox{\hyperlink{group__model__details_ga72b511ed1201f7e23ec437e468790d74}{dangles}} = P-\/>\mbox{\hyperlink{group__energy__parameters_a7b84353eb9075c595bad4ceb871bcae7}{model\_details}}.\mbox{\hyperlink{group__model__details_adcda4ff2ea77748ae0e8700288282efc}{dangles}};}
489\DoxyCodeLine{00542   energy  = 0;}
490\DoxyCodeLine{00543 }
491\DoxyCodeLine{00544   \textcolor{keywordflow}{for} (ss = 0; ss < n\_seq; ss++) \{}
492\DoxyCodeLine{00545     tt = type[ss];}
493\DoxyCodeLine{00546     \textcolor{keywordflow}{if} (tt == 0)}
494\DoxyCodeLine{00547       tt = 7;}
495\DoxyCodeLine{00548 }
496\DoxyCodeLine{00549     \textcolor{keywordflow}{if} (\mbox{\hyperlink{group__model__details_ga72b511ed1201f7e23ec437e468790d74}{dangles}} == 2)}
497\DoxyCodeLine{00550       energy += P-\/>mismatchI[tt][S3[ss][i]][S5[ss][j]];}
498\DoxyCodeLine{00551 }
499\DoxyCodeLine{00552     \textcolor{keywordflow}{if} (tt > 2)}
500\DoxyCodeLine{00553       energy += P-\/>TerminalAU;}
501\DoxyCodeLine{00554   \}}
502\DoxyCodeLine{00555 }
503\DoxyCodeLine{00556   k = i + 1;}
504\DoxyCodeLine{00557   \textcolor{keywordflow}{if} (S\_cons[k] == 3) \{}
505\DoxyCodeLine{00558     \textcolor{keywordflow}{if} (k < j -\/ VRNA\_GQUAD\_MIN\_BOX\_SIZE) \{}
506\DoxyCodeLine{00559       minl  = j -\/ i + k -\/ \mbox{\hyperlink{constants_8h_ad1bd6eabac419670ddd3c9ed82145988}{MAXLOOP}} -\/ 2;}
507\DoxyCodeLine{00560       c0    = k + VRNA\_GQUAD\_MIN\_BOX\_SIZE -\/ 1;}
508\DoxyCodeLine{00561       minl  = \mbox{\hyperlink{group__utils_ga33297b3679c713b0c4d897cd0fe3b122}{MAX2}}(c0, minl);}
509\DoxyCodeLine{00562       c0    = j -\/ 3;}
510\DoxyCodeLine{00563       maxl  = k + VRNA\_GQUAD\_MAX\_BOX\_SIZE + 1;}
511\DoxyCodeLine{00564       maxl  = \mbox{\hyperlink{group__utils_gae0b9cd0ce090bd69b951aa73e8fa4f7d}{MIN2}}(c0, maxl);}
512\DoxyCodeLine{00565       \textcolor{keywordflow}{for} (l = minl; l < maxl; l++) \{}
513\DoxyCodeLine{00566         \textcolor{keywordflow}{if} (S\_cons[l] != 3)}
514\DoxyCodeLine{00567           \textcolor{keywordflow}{continue};}
515\DoxyCodeLine{00568 }
516\DoxyCodeLine{00569         eee = 0;}
517\DoxyCodeLine{00570 }
518\DoxyCodeLine{00571         \textcolor{keywordflow}{for} (ss = 0; ss < n\_seq; ss++) \{}
519\DoxyCodeLine{00572           u1  = a2s[ss][j -\/ 1] -\/ a2s[ss][l];}
520\DoxyCodeLine{00573           eee += P-\/>internal\_loop[u1];}
521\DoxyCodeLine{00574         \}}
522\DoxyCodeLine{00575 }
523\DoxyCodeLine{00576         \textcolor{keywordflow}{if} (c == energy + ggg[index[l] + k] + eee) \{}
524\DoxyCodeLine{00577           *p  = k;}
525\DoxyCodeLine{00578           *q  = l;}
526\DoxyCodeLine{00579           \textcolor{keywordflow}{return} 1;}
527\DoxyCodeLine{00580         \}}
528\DoxyCodeLine{00581       \}}
529\DoxyCodeLine{00582     \}}
530\DoxyCodeLine{00583   \}}
531\DoxyCodeLine{00584 }
532\DoxyCodeLine{00585   \textcolor{keywordflow}{for} (k = i + 2;}
533\DoxyCodeLine{00586        k < j -\/ VRNA\_GQUAD\_MIN\_BOX\_SIZE;}
534\DoxyCodeLine{00587        k++) \{}
535\DoxyCodeLine{00588     l1 = k -\/ i -\/ 1;}
536\DoxyCodeLine{00589     \textcolor{keywordflow}{if} (l1 > \mbox{\hyperlink{constants_8h_ad1bd6eabac419670ddd3c9ed82145988}{MAXLOOP}})}
537\DoxyCodeLine{00590       \textcolor{keywordflow}{break};}
538\DoxyCodeLine{00591 }
539\DoxyCodeLine{00592     \textcolor{keywordflow}{if} (S\_cons[k] != 3)}
540\DoxyCodeLine{00593       \textcolor{keywordflow}{continue};}
541\DoxyCodeLine{00594 }
542\DoxyCodeLine{00595     minl  = j -\/ i + k -\/ \mbox{\hyperlink{constants_8h_ad1bd6eabac419670ddd3c9ed82145988}{MAXLOOP}} -\/ 2;}
543\DoxyCodeLine{00596     c0    = k + VRNA\_GQUAD\_MIN\_BOX\_SIZE -\/ 1;}
544\DoxyCodeLine{00597     minl  = \mbox{\hyperlink{group__utils_ga33297b3679c713b0c4d897cd0fe3b122}{MAX2}}(c0, minl);}
545\DoxyCodeLine{00598     c0    = j -\/ 1;}
546\DoxyCodeLine{00599     maxl  = k + VRNA\_GQUAD\_MAX\_BOX\_SIZE + 1;}
547\DoxyCodeLine{00600     maxl  = \mbox{\hyperlink{group__utils_gae0b9cd0ce090bd69b951aa73e8fa4f7d}{MIN2}}(c0, maxl);}
548\DoxyCodeLine{00601     \textcolor{keywordflow}{for} (l = minl; l < maxl; l++) \{}
549\DoxyCodeLine{00602       \textcolor{keywordflow}{if} (S\_cons[l] != 3)}
550\DoxyCodeLine{00603         \textcolor{keywordflow}{continue};}
551\DoxyCodeLine{00604 }
552\DoxyCodeLine{00605       eee = 0;}
553\DoxyCodeLine{00606 }
554\DoxyCodeLine{00607       \textcolor{keywordflow}{for} (ss = 0; ss < n\_seq; ss++) \{}
555\DoxyCodeLine{00608         u1  = a2s[ss][k -\/ 1] -\/ a2s[ss][i];}
556\DoxyCodeLine{00609         u2  = a2s[ss][j -\/ 1] -\/ a2s[ss][l];}
557\DoxyCodeLine{00610         eee += P-\/>internal\_loop[u1 + u2];}
558\DoxyCodeLine{00611       \}}
559\DoxyCodeLine{00612 }
560\DoxyCodeLine{00613       \textcolor{keywordflow}{if} (c == energy + ggg[index[l] + k] + eee) \{}
561\DoxyCodeLine{00614         *p  = k;}
562\DoxyCodeLine{00615         *q  = l;}
563\DoxyCodeLine{00616         \textcolor{keywordflow}{return} 1;}
564\DoxyCodeLine{00617       \}}
565\DoxyCodeLine{00618     \}}
566\DoxyCodeLine{00619   \}}
567\DoxyCodeLine{00620 }
568\DoxyCodeLine{00621   l = j -\/ 1;}
569\DoxyCodeLine{00622   \textcolor{keywordflow}{if} (S\_cons[l] == 3)}
570\DoxyCodeLine{00623     \textcolor{keywordflow}{for} (k = i + 4;}
571\DoxyCodeLine{00624          k < j -\/ VRNA\_GQUAD\_MIN\_BOX\_SIZE;}
572\DoxyCodeLine{00625          k++) \{}
573\DoxyCodeLine{00626       l1 = k -\/ i -\/ 1;}
574\DoxyCodeLine{00627       \textcolor{keywordflow}{if} (l1 > \mbox{\hyperlink{constants_8h_ad1bd6eabac419670ddd3c9ed82145988}{MAXLOOP}})}
575\DoxyCodeLine{00628         \textcolor{keywordflow}{break};}
576\DoxyCodeLine{00629 }
577\DoxyCodeLine{00630       \textcolor{keywordflow}{if} (S\_cons[k] != 3)}
578\DoxyCodeLine{00631         \textcolor{keywordflow}{continue};}
579\DoxyCodeLine{00632 }
580\DoxyCodeLine{00633       eee = 0;}
581\DoxyCodeLine{00634 }
582\DoxyCodeLine{00635       \textcolor{keywordflow}{for} (ss = 0; ss < n\_seq; ss++) \{}
583\DoxyCodeLine{00636         u1  = a2s[ss][k -\/ 1] -\/ a2s[ss][i];}
584\DoxyCodeLine{00637         eee += P-\/>internal\_loop[u1];}
585\DoxyCodeLine{00638       \}}
586\DoxyCodeLine{00639 }
587\DoxyCodeLine{00640       \textcolor{keywordflow}{if} (c == energy + ggg[index[l] + k] + eee) \{}
588\DoxyCodeLine{00641         *p  = k;}
589\DoxyCodeLine{00642         *q  = l;}
590\DoxyCodeLine{00643         \textcolor{keywordflow}{return} 1;}
591\DoxyCodeLine{00644       \}}
592\DoxyCodeLine{00645     \}}
593\DoxyCodeLine{00646 }
594\DoxyCodeLine{00647   \textcolor{keywordflow}{return} 0;}
595\DoxyCodeLine{00648 \}}
596\DoxyCodeLine{00649 }
597\DoxyCodeLine{00650 }
598\DoxyCodeLine{00667 INLINE PRIVATE \textcolor{keywordtype}{int}}
599\DoxyCodeLine{\Hypertarget{gquad_8h_source_l00668}\mbox{\hyperlink{group__gquads_ga7b371308fa5a45c7ac353ef6ed1014de}{00668}} \mbox{\hyperlink{group__gquads_ga7b371308fa5a45c7ac353ef6ed1014de}{backtrack\_GQuad\_IntLoop\_L}}(\textcolor{keywordtype}{int}           c,}
600\DoxyCodeLine{00669                           \textcolor{keywordtype}{int}           i,}
601\DoxyCodeLine{00670                           \textcolor{keywordtype}{int}           j,}
602\DoxyCodeLine{00671                           \textcolor{keywordtype}{int}           type,}
603\DoxyCodeLine{00672                           \textcolor{keywordtype}{short}         *S,}
604\DoxyCodeLine{00673                           \textcolor{keywordtype}{int}           **ggg,}
605\DoxyCodeLine{00674                           \textcolor{keywordtype}{int}           maxdist,}
606\DoxyCodeLine{00675                           \textcolor{keywordtype}{int}           *p,}
607\DoxyCodeLine{00676                           \textcolor{keywordtype}{int}           *q,}
608\DoxyCodeLine{00677                           \mbox{\hyperlink{group__energy__parameters_structvrna__param__s}{vrna\_param\_t}}  *P)}
609\DoxyCodeLine{00678 \{}
610\DoxyCodeLine{00679   \textcolor{keywordtype}{int}   energy, \mbox{\hyperlink{group__model__details_ga72b511ed1201f7e23ec437e468790d74}{dangles}}, k, l, maxl, minl, c0, l1;}
611\DoxyCodeLine{00680   \textcolor{keywordtype}{short} si, sj;}
612\DoxyCodeLine{00681 }
613\DoxyCodeLine{00682   \mbox{\hyperlink{group__model__details_ga72b511ed1201f7e23ec437e468790d74}{dangles}} = P-\/>\mbox{\hyperlink{group__energy__parameters_a7b84353eb9075c595bad4ceb871bcae7}{model\_details}}.\mbox{\hyperlink{group__model__details_adcda4ff2ea77748ae0e8700288282efc}{dangles}};}
614\DoxyCodeLine{00683   si      = S[i + 1];}
615\DoxyCodeLine{00684   sj      = S[j -\/ 1];}
616\DoxyCodeLine{00685   energy  = 0;}
617\DoxyCodeLine{00686 }
618\DoxyCodeLine{00687   \textcolor{keywordflow}{if} (\mbox{\hyperlink{group__model__details_ga72b511ed1201f7e23ec437e468790d74}{dangles}} == 2)}
619\DoxyCodeLine{00688     energy += P-\/>mismatchI[type][si][sj];}
620\DoxyCodeLine{00689 }
621\DoxyCodeLine{00690   \textcolor{keywordflow}{if} (type > 2)}
622\DoxyCodeLine{00691     energy += P-\/>TerminalAU;}
623\DoxyCodeLine{00692 }
624\DoxyCodeLine{00693   k = i + 1;}
625\DoxyCodeLine{00694   \textcolor{keywordflow}{if} (S[k] == 3) \{}
626\DoxyCodeLine{00695     \textcolor{keywordflow}{if} (k < j -\/ VRNA\_GQUAD\_MIN\_BOX\_SIZE) \{}
627\DoxyCodeLine{00696       minl  = j -\/ i + k -\/ \mbox{\hyperlink{constants_8h_ad1bd6eabac419670ddd3c9ed82145988}{MAXLOOP}} -\/ 2;}
628\DoxyCodeLine{00697       c0    = k + VRNA\_GQUAD\_MIN\_BOX\_SIZE -\/ 1;}
629\DoxyCodeLine{00698       minl  = \mbox{\hyperlink{group__utils_ga33297b3679c713b0c4d897cd0fe3b122}{MAX2}}(c0, minl);}
630\DoxyCodeLine{00699       c0    = j -\/ 3;}
631\DoxyCodeLine{00700       maxl  = k + VRNA\_GQUAD\_MAX\_BOX\_SIZE + 1;}
632\DoxyCodeLine{00701       maxl  = \mbox{\hyperlink{group__utils_gae0b9cd0ce090bd69b951aa73e8fa4f7d}{MIN2}}(c0, maxl);}
633\DoxyCodeLine{00702       \textcolor{keywordflow}{for} (l = minl; l < maxl; l++) \{}
634\DoxyCodeLine{00703         \textcolor{keywordflow}{if} (S[l] != 3)}
635\DoxyCodeLine{00704           \textcolor{keywordflow}{continue};}
636\DoxyCodeLine{00705 }
637\DoxyCodeLine{00706         \textcolor{keywordflow}{if} (c == energy + ggg[k][l -\/ k] + P-\/>internal\_loop[j -\/ l -\/ 1]) \{}
638\DoxyCodeLine{00707           *p  = k;}
639\DoxyCodeLine{00708           *q  = l;}
640\DoxyCodeLine{00709           \textcolor{keywordflow}{return} 1;}
641\DoxyCodeLine{00710         \}}
642\DoxyCodeLine{00711       \}}
643\DoxyCodeLine{00712     \}}
644\DoxyCodeLine{00713   \}}
645\DoxyCodeLine{00714 }
646\DoxyCodeLine{00715   \textcolor{keywordflow}{for} (k = i + 2;}
647\DoxyCodeLine{00716        k < j -\/ VRNA\_GQUAD\_MIN\_BOX\_SIZE;}
648\DoxyCodeLine{00717        k++) \{}
649\DoxyCodeLine{00718     l1 = k -\/ i -\/ 1;}
650\DoxyCodeLine{00719     \textcolor{keywordflow}{if} (l1 > \mbox{\hyperlink{constants_8h_ad1bd6eabac419670ddd3c9ed82145988}{MAXLOOP}})}
651\DoxyCodeLine{00720       \textcolor{keywordflow}{break};}
652\DoxyCodeLine{00721 }
653\DoxyCodeLine{00722     \textcolor{keywordflow}{if} (S[k] != 3)}
654\DoxyCodeLine{00723       \textcolor{keywordflow}{continue};}
655\DoxyCodeLine{00724 }
656\DoxyCodeLine{00725     minl  = j -\/ i + k -\/ \mbox{\hyperlink{constants_8h_ad1bd6eabac419670ddd3c9ed82145988}{MAXLOOP}} -\/ 2;}
657\DoxyCodeLine{00726     c0    = k + VRNA\_GQUAD\_MIN\_BOX\_SIZE -\/ 1;}
658\DoxyCodeLine{00727     minl  = \mbox{\hyperlink{group__utils_ga33297b3679c713b0c4d897cd0fe3b122}{MAX2}}(c0, minl);}
659\DoxyCodeLine{00728     c0    = j -\/ 1;}
660\DoxyCodeLine{00729     maxl  = k + VRNA\_GQUAD\_MAX\_BOX\_SIZE + 1;}
661\DoxyCodeLine{00730     maxl  = \mbox{\hyperlink{group__utils_gae0b9cd0ce090bd69b951aa73e8fa4f7d}{MIN2}}(c0, maxl);}
662\DoxyCodeLine{00731     \textcolor{keywordflow}{for} (l = minl; l < maxl; l++) \{}
663\DoxyCodeLine{00732       \textcolor{keywordflow}{if} (S[l] != 3)}
664\DoxyCodeLine{00733         \textcolor{keywordflow}{continue};}
665\DoxyCodeLine{00734 }
666\DoxyCodeLine{00735       \textcolor{keywordflow}{if} (c == energy + ggg[k][l -\/ k] + P-\/>internal\_loop[l1 + j -\/ l -\/ 1]) \{}
667\DoxyCodeLine{00736         *p  = k;}
668\DoxyCodeLine{00737         *q  = l;}
669\DoxyCodeLine{00738         \textcolor{keywordflow}{return} 1;}
670\DoxyCodeLine{00739       \}}
671\DoxyCodeLine{00740     \}}
672\DoxyCodeLine{00741   \}}
673\DoxyCodeLine{00742 }
674\DoxyCodeLine{00743   l = j -\/ 1;}
675\DoxyCodeLine{00744   \textcolor{keywordflow}{if} (S[l] == 3)}
676\DoxyCodeLine{00745     \textcolor{keywordflow}{for} (k = i + 4;}
677\DoxyCodeLine{00746          k < j -\/ VRNA\_GQUAD\_MIN\_BOX\_SIZE;}
678\DoxyCodeLine{00747          k++) \{}
679\DoxyCodeLine{00748       l1 = k -\/ i -\/ 1;}
680\DoxyCodeLine{00749       \textcolor{keywordflow}{if} (l1 > \mbox{\hyperlink{constants_8h_ad1bd6eabac419670ddd3c9ed82145988}{MAXLOOP}})}
681\DoxyCodeLine{00750         \textcolor{keywordflow}{break};}
682\DoxyCodeLine{00751 }
683\DoxyCodeLine{00752       \textcolor{keywordflow}{if} (S[k] != 3)}
684\DoxyCodeLine{00753         \textcolor{keywordflow}{continue};}
685\DoxyCodeLine{00754 }
686\DoxyCodeLine{00755       \textcolor{keywordflow}{if} (c == energy + ggg[k][l -\/ k] + P-\/>internal\_loop[l1]) \{}
687\DoxyCodeLine{00756         *p  = k;}
688\DoxyCodeLine{00757         *q  = l;}
689\DoxyCodeLine{00758         \textcolor{keywordflow}{return} 1;}
690\DoxyCodeLine{00759       \}}
691\DoxyCodeLine{00760     \}}
692\DoxyCodeLine{00761 }
693\DoxyCodeLine{00762   \textcolor{keywordflow}{return} 0;}
694\DoxyCodeLine{00763 \}}
695\DoxyCodeLine{00764 }
696\DoxyCodeLine{00765 }
697\DoxyCodeLine{00766 INLINE PRIVATE \textcolor{keywordtype}{int}}
698\DoxyCodeLine{00767 backtrack\_GQuad\_IntLoop\_L\_comparative(\textcolor{keywordtype}{int}           c,}
699\DoxyCodeLine{00768                                       \textcolor{keywordtype}{int}           i,}
700\DoxyCodeLine{00769                                       \textcolor{keywordtype}{int}           j,}
701\DoxyCodeLine{00770                                       \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int}  *type,}
702\DoxyCodeLine{00771                                       \textcolor{keywordtype}{short}         *S\_cons,}
703\DoxyCodeLine{00772                                       \textcolor{keywordtype}{short}         **S5,}
704\DoxyCodeLine{00773                                       \textcolor{keywordtype}{short}         **S3,}
705\DoxyCodeLine{00774                                       \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int}  **a2s,}
706\DoxyCodeLine{00775                                       \textcolor{keywordtype}{int}           **ggg,}
707\DoxyCodeLine{00776                                       \textcolor{keywordtype}{int}           *p,}
708\DoxyCodeLine{00777                                       \textcolor{keywordtype}{int}           *q,}
709\DoxyCodeLine{00778                                       \textcolor{keywordtype}{int}           n\_seq,}
710\DoxyCodeLine{00779                                       \mbox{\hyperlink{group__energy__parameters_structvrna__param__s}{vrna\_param\_t}}  *P)}
711\DoxyCodeLine{00780 \{}
712\DoxyCodeLine{00781   \textcolor{comment}{/*}}
713\DoxyCodeLine{00782 \textcolor{comment}{   * The case that is handled here actually resembles something like}}
714\DoxyCodeLine{00783 \textcolor{comment}{   * an interior loop where the enclosing base pair is of regular}}
715\DoxyCodeLine{00784 \textcolor{comment}{   * kind and the enclosed pair is not a canonical one but a g-\/quadruplex}}
716\DoxyCodeLine{00785 \textcolor{comment}{   * that should then be decomposed further...}}
717\DoxyCodeLine{00786 \textcolor{comment}{   */}}
718\DoxyCodeLine{00787   \textcolor{keywordtype}{int} mm, dangle\_model, k, l, maxl, minl, c0, l1, ss, tt, eee, u1, u2;}
719\DoxyCodeLine{00788 }
720\DoxyCodeLine{00789   dangle\_model = P-\/>\mbox{\hyperlink{group__energy__parameters_a7b84353eb9075c595bad4ceb871bcae7}{model\_details}}.\mbox{\hyperlink{group__model__details_adcda4ff2ea77748ae0e8700288282efc}{dangles}};}
721\DoxyCodeLine{00790 }
722\DoxyCodeLine{00791   mm = 0;}
723\DoxyCodeLine{00792   \textcolor{keywordflow}{for} (ss = 0; ss < n\_seq; ss++) \{}
724\DoxyCodeLine{00793     tt = type[ss];}
725\DoxyCodeLine{00794 }
726\DoxyCodeLine{00795     \textcolor{keywordflow}{if} (dangle\_model == 2)}
727\DoxyCodeLine{00796       mm += P-\/>mismatchI[tt][S3[ss][i]][S5[ss][j]];}
728\DoxyCodeLine{00797 }
729\DoxyCodeLine{00798     \textcolor{keywordflow}{if} (tt > 2)}
730\DoxyCodeLine{00799       mm += P-\/>TerminalAU;}
731\DoxyCodeLine{00800   \}}
732\DoxyCodeLine{00801 }
733\DoxyCodeLine{00802   \textcolor{keywordflow}{for} (k = i + 2;}
734\DoxyCodeLine{00803        k < j -\/ VRNA\_GQUAD\_MIN\_BOX\_SIZE;}
735\DoxyCodeLine{00804        k++) \{}
736\DoxyCodeLine{00805     \textcolor{keywordflow}{if} (S\_cons[k] != 3)}
737\DoxyCodeLine{00806       \textcolor{keywordflow}{continue};}
738\DoxyCodeLine{00807 }
739\DoxyCodeLine{00808     l1 = k -\/ i -\/ 1;}
740\DoxyCodeLine{00809     \textcolor{keywordflow}{if} (l1 > \mbox{\hyperlink{constants_8h_ad1bd6eabac419670ddd3c9ed82145988}{MAXLOOP}})}
741\DoxyCodeLine{00810       \textcolor{keywordflow}{break};}
742\DoxyCodeLine{00811 }
743\DoxyCodeLine{00812     minl  = j -\/ i + k -\/ \mbox{\hyperlink{constants_8h_ad1bd6eabac419670ddd3c9ed82145988}{MAXLOOP}} -\/ 2;}
744\DoxyCodeLine{00813     c0    = k + VRNA\_GQUAD\_MIN\_BOX\_SIZE -\/ 1;}
745\DoxyCodeLine{00814     minl  = \mbox{\hyperlink{group__utils_ga33297b3679c713b0c4d897cd0fe3b122}{MAX2}}(c0, minl);}
746\DoxyCodeLine{00815     c0    = j -\/ 1;}
747\DoxyCodeLine{00816     maxl  = k + VRNA\_GQUAD\_MAX\_BOX\_SIZE + 1;}
748\DoxyCodeLine{00817     maxl  = \mbox{\hyperlink{group__utils_gae0b9cd0ce090bd69b951aa73e8fa4f7d}{MIN2}}(c0, maxl);}
749\DoxyCodeLine{00818     \textcolor{keywordflow}{for} (l = minl; l < maxl; l++) \{}
750\DoxyCodeLine{00819       \textcolor{keywordflow}{if} (S\_cons[l] != 3)}
751\DoxyCodeLine{00820         \textcolor{keywordflow}{continue};}
752\DoxyCodeLine{00821 }
753\DoxyCodeLine{00822       eee = 0;}
754\DoxyCodeLine{00823 }
755\DoxyCodeLine{00824       \textcolor{keywordflow}{for} (ss = 0; ss < n\_seq; ss++) \{}
756\DoxyCodeLine{00825         u1  = a2s[ss][k -\/ 1] -\/ a2s[ss][i];}
757\DoxyCodeLine{00826         u2  = a2s[ss][j -\/ 1] -\/ a2s[ss][l];}
758\DoxyCodeLine{00827         eee += P-\/>internal\_loop[u1 + u2];}
759\DoxyCodeLine{00828       \}}
760\DoxyCodeLine{00829 }
761\DoxyCodeLine{00830       c0 = mm +}
762\DoxyCodeLine{00831            ggg[k][l -\/ k] +}
763\DoxyCodeLine{00832            eee;}
764\DoxyCodeLine{00833 }
765\DoxyCodeLine{00834       \textcolor{keywordflow}{if} (c == c0) \{}
766\DoxyCodeLine{00835         *p  = k;}
767\DoxyCodeLine{00836         *q  = l;}
768\DoxyCodeLine{00837         \textcolor{keywordflow}{return} 1;}
769\DoxyCodeLine{00838       \}}
770\DoxyCodeLine{00839     \}}
771\DoxyCodeLine{00840   \}}
772\DoxyCodeLine{00841   k = i + 1;}
773\DoxyCodeLine{00842   \textcolor{keywordflow}{if} (S\_cons[k] == 3) \{}
774\DoxyCodeLine{00843     \textcolor{keywordflow}{if} (k < j -\/ VRNA\_GQUAD\_MIN\_BOX\_SIZE) \{}
775\DoxyCodeLine{00844       minl  = j -\/ i + k -\/ \mbox{\hyperlink{constants_8h_ad1bd6eabac419670ddd3c9ed82145988}{MAXLOOP}} -\/ 2;}
776\DoxyCodeLine{00845       c0    = k + VRNA\_GQUAD\_MIN\_BOX\_SIZE -\/ 1;}
777\DoxyCodeLine{00846       minl  = \mbox{\hyperlink{group__utils_ga33297b3679c713b0c4d897cd0fe3b122}{MAX2}}(c0, minl);}
778\DoxyCodeLine{00847       c0    = j -\/ 3;}
779\DoxyCodeLine{00848       maxl  = k + VRNA\_GQUAD\_MAX\_BOX\_SIZE + 1;}
780\DoxyCodeLine{00849       maxl  = \mbox{\hyperlink{group__utils_gae0b9cd0ce090bd69b951aa73e8fa4f7d}{MIN2}}(c0, maxl);}
781\DoxyCodeLine{00850       \textcolor{keywordflow}{for} (l = minl; l < maxl; l++) \{}
782\DoxyCodeLine{00851         \textcolor{keywordflow}{if} (S\_cons[l] != 3)}
783\DoxyCodeLine{00852           \textcolor{keywordflow}{continue};}
784\DoxyCodeLine{00853 }
785\DoxyCodeLine{00854         eee = 0;}
786\DoxyCodeLine{00855 }
787\DoxyCodeLine{00856         \textcolor{keywordflow}{for} (ss = 0; ss < n\_seq; ss++) \{}
788\DoxyCodeLine{00857           u1  = a2s[ss][j -\/ 1] -\/ a2s[ss][l];}
789\DoxyCodeLine{00858           eee += P-\/>internal\_loop[u1];}
790\DoxyCodeLine{00859         \}}
791\DoxyCodeLine{00860 }
792\DoxyCodeLine{00861         \textcolor{keywordflow}{if} (c == mm + ggg[k][l -\/ k] + eee) \{}
793\DoxyCodeLine{00862           *p  = k;}
794\DoxyCodeLine{00863           *q  = l;}
795\DoxyCodeLine{00864           \textcolor{keywordflow}{return} 1;}
796\DoxyCodeLine{00865         \}}
797\DoxyCodeLine{00866       \}}
798\DoxyCodeLine{00867     \}}
799\DoxyCodeLine{00868   \}}
800\DoxyCodeLine{00869 }
801\DoxyCodeLine{00870   l = j -\/ 1;}
802\DoxyCodeLine{00871   \textcolor{keywordflow}{if} (S\_cons[l] == 3) \{}
803\DoxyCodeLine{00872     \textcolor{keywordflow}{for} (k = i + 4; k < j -\/ VRNA\_GQUAD\_MIN\_BOX\_SIZE; k++) \{}
804\DoxyCodeLine{00873       l1 = k -\/ i -\/ 1;}
805\DoxyCodeLine{00874       \textcolor{keywordflow}{if} (l1 > \mbox{\hyperlink{constants_8h_ad1bd6eabac419670ddd3c9ed82145988}{MAXLOOP}})}
806\DoxyCodeLine{00875         \textcolor{keywordflow}{break};}
807\DoxyCodeLine{00876 }
808\DoxyCodeLine{00877       \textcolor{keywordflow}{if} (S\_cons[k] != 3)}
809\DoxyCodeLine{00878         \textcolor{keywordflow}{continue};}
810\DoxyCodeLine{00879 }
811\DoxyCodeLine{00880       eee = 0;}
812\DoxyCodeLine{00881 }
813\DoxyCodeLine{00882       \textcolor{keywordflow}{for} (ss = 0; ss < n\_seq; ss++) \{}
814\DoxyCodeLine{00883         u1  = a2s[ss][k -\/ 1] -\/ a2s[ss][i];}
815\DoxyCodeLine{00884         eee += P-\/>internal\_loop[u1];}
816\DoxyCodeLine{00885       \}}
817\DoxyCodeLine{00886 }
818\DoxyCodeLine{00887       \textcolor{keywordflow}{if} (c == mm + ggg[k][l -\/ k] + eee) \{}
819\DoxyCodeLine{00888         *p  = k;}
820\DoxyCodeLine{00889         *q  = l;}
821\DoxyCodeLine{00890         \textcolor{keywordflow}{return} 1;}
822\DoxyCodeLine{00891       \}}
823\DoxyCodeLine{00892     \}}
824\DoxyCodeLine{00893   \}}
825\DoxyCodeLine{00894 }
826\DoxyCodeLine{00895   \textcolor{keywordflow}{return} 0;}
827\DoxyCodeLine{00896 \}}
828\DoxyCodeLine{00897 }
829\DoxyCodeLine{00898 }
830\DoxyCodeLine{00899 PRIVATE INLINE}
831\DoxyCodeLine{00900 \textcolor{keywordtype}{int}}
832\DoxyCodeLine{00901 E\_GQuad\_IntLoop(\textcolor{keywordtype}{int}           i,}
833\DoxyCodeLine{00902                 \textcolor{keywordtype}{int}           j,}
834\DoxyCodeLine{00903                 \textcolor{keywordtype}{int}           type,}
835\DoxyCodeLine{00904                 \textcolor{keywordtype}{short}         *S,}
836\DoxyCodeLine{00905                 \textcolor{keywordtype}{int}           *ggg,}
837\DoxyCodeLine{00906                 \textcolor{keywordtype}{int}           *index,}
838\DoxyCodeLine{00907                 \mbox{\hyperlink{group__energy__parameters_structvrna__param__s}{vrna\_param\_t}}  *P)}
839\DoxyCodeLine{00908 \{}
840\DoxyCodeLine{00909   \textcolor{keywordtype}{int}   energy, ge, \mbox{\hyperlink{group__model__details_ga72b511ed1201f7e23ec437e468790d74}{dangles}}, p, q, l1, minq, maxq, c0;}
841\DoxyCodeLine{00910   \textcolor{keywordtype}{short} si, sj;}
842\DoxyCodeLine{00911 }
843\DoxyCodeLine{00912   \mbox{\hyperlink{group__model__details_ga72b511ed1201f7e23ec437e468790d74}{dangles}} = P-\/>\mbox{\hyperlink{group__energy__parameters_a7b84353eb9075c595bad4ceb871bcae7}{model\_details}}.\mbox{\hyperlink{group__model__details_adcda4ff2ea77748ae0e8700288282efc}{dangles}};}
844\DoxyCodeLine{00913   si      = S[i + 1];}
845\DoxyCodeLine{00914   sj      = S[j -\/ 1];}
846\DoxyCodeLine{00915   energy  = 0;}
847\DoxyCodeLine{00916 }
848\DoxyCodeLine{00917   \textcolor{keywordflow}{if} (\mbox{\hyperlink{group__model__details_ga72b511ed1201f7e23ec437e468790d74}{dangles}} == 2)}
849\DoxyCodeLine{00918     energy += P-\/>mismatchI[type][si][sj];}
850\DoxyCodeLine{00919 }
851\DoxyCodeLine{00920   \textcolor{keywordflow}{if} (type > 2)}
852\DoxyCodeLine{00921     energy += P-\/>TerminalAU;}
853\DoxyCodeLine{00922 }
854\DoxyCodeLine{00923   ge = \mbox{\hyperlink{constants_8h_a12c2040f25d8e3a7b9e1c2024c618cb6}{INF}};}
855\DoxyCodeLine{00924 }
856\DoxyCodeLine{00925   p = i + 1;}
857\DoxyCodeLine{00926   \textcolor{keywordflow}{if} (S[p] == 3) \{}
858\DoxyCodeLine{00927     \textcolor{keywordflow}{if} (p < j -\/ VRNA\_GQUAD\_MIN\_BOX\_SIZE) \{}
859\DoxyCodeLine{00928       minq  = j -\/ i + p -\/ \mbox{\hyperlink{constants_8h_ad1bd6eabac419670ddd3c9ed82145988}{MAXLOOP}} -\/ 2;}
860\DoxyCodeLine{00929       c0    = p + VRNA\_GQUAD\_MIN\_BOX\_SIZE -\/ 1;}
861\DoxyCodeLine{00930       minq  = \mbox{\hyperlink{group__utils_ga33297b3679c713b0c4d897cd0fe3b122}{MAX2}}(c0, minq);}
862\DoxyCodeLine{00931       c0    = j -\/ 3;}
863\DoxyCodeLine{00932       maxq  = p + VRNA\_GQUAD\_MAX\_BOX\_SIZE + 1;}
864\DoxyCodeLine{00933       maxq  = \mbox{\hyperlink{group__utils_gae0b9cd0ce090bd69b951aa73e8fa4f7d}{MIN2}}(c0, maxq);}
865\DoxyCodeLine{00934       \textcolor{keywordflow}{for} (q = minq; q < maxq; q++) \{}
866\DoxyCodeLine{00935         \textcolor{keywordflow}{if} (S[q] != 3)}
867\DoxyCodeLine{00936           \textcolor{keywordflow}{continue};}
868\DoxyCodeLine{00937 }
869\DoxyCodeLine{00938         c0  = energy + ggg[index[q] + p] + P-\/>internal\_loop[j -\/ q -\/ 1];}
870\DoxyCodeLine{00939         ge  = \mbox{\hyperlink{group__utils_gae0b9cd0ce090bd69b951aa73e8fa4f7d}{MIN2}}(ge, c0);}
871\DoxyCodeLine{00940       \}}
872\DoxyCodeLine{00941     \}}
873\DoxyCodeLine{00942   \}}
874\DoxyCodeLine{00943 }
875\DoxyCodeLine{00944   \textcolor{keywordflow}{for} (p = i + 2;}
876\DoxyCodeLine{00945        p < j -\/ VRNA\_GQUAD\_MIN\_BOX\_SIZE;}
877\DoxyCodeLine{00946        p++) \{}
878\DoxyCodeLine{00947     l1 = p -\/ i -\/ 1;}
879\DoxyCodeLine{00948     \textcolor{keywordflow}{if} (l1 > \mbox{\hyperlink{constants_8h_ad1bd6eabac419670ddd3c9ed82145988}{MAXLOOP}})}
880\DoxyCodeLine{00949       \textcolor{keywordflow}{break};}
881\DoxyCodeLine{00950 }
882\DoxyCodeLine{00951     \textcolor{keywordflow}{if} (S[p] != 3)}
883\DoxyCodeLine{00952       \textcolor{keywordflow}{continue};}
884\DoxyCodeLine{00953 }
885\DoxyCodeLine{00954     minq  = j -\/ i + p -\/ \mbox{\hyperlink{constants_8h_ad1bd6eabac419670ddd3c9ed82145988}{MAXLOOP}} -\/ 2;}
886\DoxyCodeLine{00955     c0    = p + VRNA\_GQUAD\_MIN\_BOX\_SIZE -\/ 1;}
887\DoxyCodeLine{00956     minq  = \mbox{\hyperlink{group__utils_ga33297b3679c713b0c4d897cd0fe3b122}{MAX2}}(c0, minq);}
888\DoxyCodeLine{00957     c0    = j -\/ 1;}
889\DoxyCodeLine{00958     maxq  = p + VRNA\_GQUAD\_MAX\_BOX\_SIZE + 1;}
890\DoxyCodeLine{00959     maxq  = \mbox{\hyperlink{group__utils_gae0b9cd0ce090bd69b951aa73e8fa4f7d}{MIN2}}(c0, maxq);}
891\DoxyCodeLine{00960     \textcolor{keywordflow}{for} (q = minq; q < maxq; q++) \{}
892\DoxyCodeLine{00961       \textcolor{keywordflow}{if} (S[q] != 3)}
893\DoxyCodeLine{00962         \textcolor{keywordflow}{continue};}
894\DoxyCodeLine{00963 }
895\DoxyCodeLine{00964       c0  = energy + ggg[index[q] + p] + P-\/>internal\_loop[l1 + j -\/ q -\/ 1];}
896\DoxyCodeLine{00965       ge  = \mbox{\hyperlink{group__utils_gae0b9cd0ce090bd69b951aa73e8fa4f7d}{MIN2}}(ge, c0);}
897\DoxyCodeLine{00966     \}}
898\DoxyCodeLine{00967   \}}
899\DoxyCodeLine{00968 }
900\DoxyCodeLine{00969   q = j -\/ 1;}
901\DoxyCodeLine{00970   \textcolor{keywordflow}{if} (S[q] == 3)}
902\DoxyCodeLine{00971     \textcolor{keywordflow}{for} (p = i + 4;}
903\DoxyCodeLine{00972          p < j -\/ VRNA\_GQUAD\_MIN\_BOX\_SIZE;}
904\DoxyCodeLine{00973          p++) \{}
905\DoxyCodeLine{00974       l1 = p -\/ i -\/ 1;}
906\DoxyCodeLine{00975       \textcolor{keywordflow}{if} (l1 > \mbox{\hyperlink{constants_8h_ad1bd6eabac419670ddd3c9ed82145988}{MAXLOOP}})}
907\DoxyCodeLine{00976         \textcolor{keywordflow}{break};}
908\DoxyCodeLine{00977 }
909\DoxyCodeLine{00978       \textcolor{keywordflow}{if} (S[p] != 3)}
910\DoxyCodeLine{00979         \textcolor{keywordflow}{continue};}
911\DoxyCodeLine{00980 }
912\DoxyCodeLine{00981       c0  = energy + ggg[index[q] + p] + P-\/>internal\_loop[l1];}
913\DoxyCodeLine{00982       ge  = \mbox{\hyperlink{group__utils_gae0b9cd0ce090bd69b951aa73e8fa4f7d}{MIN2}}(ge, c0);}
914\DoxyCodeLine{00983     \}}
915\DoxyCodeLine{00984 }
916\DoxyCodeLine{00985 \textcolor{preprocessor}{\#if 0}}
917\DoxyCodeLine{00986   \textcolor{comment}{/* here comes the additional stuff for the odd dangle models */}}
918\DoxyCodeLine{00987   \textcolor{keywordflow}{if} (\mbox{\hyperlink{group__model__details_ga72b511ed1201f7e23ec437e468790d74}{dangles}} \% 1) \{}
919\DoxyCodeLine{00988     en1 = energy + P-\/>dangle5[type][si];}
920\DoxyCodeLine{00989     en2 = energy + P-\/>dangle5[type][sj];}
921\DoxyCodeLine{00990     en3 = energy + P-\/>mismatchI[type][si][sj];}
922\DoxyCodeLine{00991 }
923\DoxyCodeLine{00992     \textcolor{comment}{/* first case with 5' dangle (i.e. j-\/1) onto enclosing pair */}}
924\DoxyCodeLine{00993     p = i + 1;}
925\DoxyCodeLine{00994     \textcolor{keywordflow}{if} (S[p] == 3) \{}
926\DoxyCodeLine{00995       \textcolor{keywordflow}{if} (p < j -\/ VRNA\_GQUAD\_MIN\_BOX\_SIZE) \{}
927\DoxyCodeLine{00996         minq  = j -\/ i + p -\/ \mbox{\hyperlink{constants_8h_ad1bd6eabac419670ddd3c9ed82145988}{MAXLOOP}} -\/ 2;}
928\DoxyCodeLine{00997         c0    = p + VRNA\_GQUAD\_MIN\_BOX\_SIZE -\/ 1;}
929\DoxyCodeLine{00998         minq  = \mbox{\hyperlink{group__utils_ga33297b3679c713b0c4d897cd0fe3b122}{MAX2}}(c0, minq);}
930\DoxyCodeLine{00999         c0    = j -\/ 4;}
931\DoxyCodeLine{01000         maxq  = p + VRNA\_GQUAD\_MAX\_BOX\_SIZE + 1;}
932\DoxyCodeLine{01001         maxq  = \mbox{\hyperlink{group__utils_gae0b9cd0ce090bd69b951aa73e8fa4f7d}{MIN2}}(c0, maxq);}
933\DoxyCodeLine{01002         \textcolor{keywordflow}{for} (q = minq; q < maxq; q++) \{}
934\DoxyCodeLine{01003           \textcolor{keywordflow}{if} (S[q] != 3)}
935\DoxyCodeLine{01004             \textcolor{keywordflow}{continue};}
936\DoxyCodeLine{01005 }
937\DoxyCodeLine{01006           c0  = en1 + ggg[index[q] + p] + P-\/>internal\_loop[j -\/ q -\/ 1];}
938\DoxyCodeLine{01007           ge  = \mbox{\hyperlink{group__utils_gae0b9cd0ce090bd69b951aa73e8fa4f7d}{MIN2}}(ge, c0);}
939\DoxyCodeLine{01008         \}}
940\DoxyCodeLine{01009       \}}
941\DoxyCodeLine{01010     \}}
942\DoxyCodeLine{01011 }
943\DoxyCodeLine{01012     \textcolor{keywordflow}{for} (p = i + 2; p < j -\/ VRNA\_GQUAD\_MIN\_BOX\_SIZE; p++) \{}
944\DoxyCodeLine{01013       l1 = p -\/ i -\/ 1;}
945\DoxyCodeLine{01014       \textcolor{keywordflow}{if} (l1 > \mbox{\hyperlink{constants_8h_ad1bd6eabac419670ddd3c9ed82145988}{MAXLOOP}})}
946\DoxyCodeLine{01015         \textcolor{keywordflow}{break};}
947\DoxyCodeLine{01016 }
948\DoxyCodeLine{01017       \textcolor{keywordflow}{if} (S[p] != 3)}
949\DoxyCodeLine{01018         \textcolor{keywordflow}{continue};}
950\DoxyCodeLine{01019 }
951\DoxyCodeLine{01020       minq  = j -\/ i + p -\/ \mbox{\hyperlink{constants_8h_ad1bd6eabac419670ddd3c9ed82145988}{MAXLOOP}} -\/ 2;}
952\DoxyCodeLine{01021       c0    = p + VRNA\_GQUAD\_MIN\_BOX\_SIZE -\/ 1;}
953\DoxyCodeLine{01022       minq  = \mbox{\hyperlink{group__utils_ga33297b3679c713b0c4d897cd0fe3b122}{MAX2}}(c0, minq);}
954\DoxyCodeLine{01023       c0    = j -\/ 2;}
955\DoxyCodeLine{01024       maxq  = p + VRNA\_GQUAD\_MAX\_BOX\_SIZE + 1;}
956\DoxyCodeLine{01025       maxq  = \mbox{\hyperlink{group__utils_gae0b9cd0ce090bd69b951aa73e8fa4f7d}{MIN2}}(c0, maxq);}
957\DoxyCodeLine{01026       \textcolor{keywordflow}{for} (q = minq; q < maxq; q++) \{}
958\DoxyCodeLine{01027         \textcolor{keywordflow}{if} (S[q] != 3)}
959\DoxyCodeLine{01028           \textcolor{keywordflow}{continue};}
960\DoxyCodeLine{01029 }
961\DoxyCodeLine{01030         c0  = en1 + ggg[index[q] + p] + P-\/>internal\_loop[l1 + j -\/ q -\/ 1];}
962\DoxyCodeLine{01031         ge  = \mbox{\hyperlink{group__utils_gae0b9cd0ce090bd69b951aa73e8fa4f7d}{MIN2}}(ge, c0);}
963\DoxyCodeLine{01032       \}}
964\DoxyCodeLine{01033     \}}
965\DoxyCodeLine{01034 }
966\DoxyCodeLine{01035     q = j -\/ 2;}
967\DoxyCodeLine{01036     \textcolor{keywordflow}{if} (S[q] == 3)}
968\DoxyCodeLine{01037       \textcolor{keywordflow}{for} (p = i + 4; p < j -\/ VRNA\_GQUAD\_MIN\_BOX\_SIZE; p++) \{}
969\DoxyCodeLine{01038         l1 = p -\/ i -\/ 1;}
970\DoxyCodeLine{01039         \textcolor{keywordflow}{if} (l1 > \mbox{\hyperlink{constants_8h_ad1bd6eabac419670ddd3c9ed82145988}{MAXLOOP}})}
971\DoxyCodeLine{01040           \textcolor{keywordflow}{break};}
972\DoxyCodeLine{01041 }
973\DoxyCodeLine{01042         \textcolor{keywordflow}{if} (S[p] != 3)}
974\DoxyCodeLine{01043           \textcolor{keywordflow}{continue};}
975\DoxyCodeLine{01044 }
976\DoxyCodeLine{01045         c0  = en1 + ggg[index[q] + p] + P-\/>internal\_loop[l1 + 1];}
977\DoxyCodeLine{01046         ge  = \mbox{\hyperlink{group__utils_gae0b9cd0ce090bd69b951aa73e8fa4f7d}{MIN2}}(ge, c0);}
978\DoxyCodeLine{01047       \}}
979\DoxyCodeLine{01048 }
980\DoxyCodeLine{01049     \textcolor{comment}{/* second case with 3' dangle (i.e. i+1) onto enclosing pair */}}
981\DoxyCodeLine{01050   \}}
982\DoxyCodeLine{01051 }
983\DoxyCodeLine{01052 \textcolor{preprocessor}{\#endif}}
984\DoxyCodeLine{01053   \textcolor{keywordflow}{return} ge;}
985\DoxyCodeLine{01054 \}}
986\DoxyCodeLine{01055 }
987\DoxyCodeLine{01056 }
988\DoxyCodeLine{01057 PRIVATE INLINE}
989\DoxyCodeLine{01058 \textcolor{keywordtype}{int}}
990\DoxyCodeLine{01059 E\_GQuad\_IntLoop\_comparative(\textcolor{keywordtype}{int}           i,}
991\DoxyCodeLine{01060                             \textcolor{keywordtype}{int}           j,}
992\DoxyCodeLine{01061                             \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int}  *tt,}
993\DoxyCodeLine{01062                             \textcolor{keywordtype}{short}         *S\_cons,}
994\DoxyCodeLine{01063                             \textcolor{keywordtype}{short}         **S5,}
995\DoxyCodeLine{01064                             \textcolor{keywordtype}{short}         **S3,}
996\DoxyCodeLine{01065                             \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int}  **a2s,}
997\DoxyCodeLine{01066                             \textcolor{keywordtype}{int}           *ggg,}
998\DoxyCodeLine{01067                             \textcolor{keywordtype}{int}           *index,}
999\DoxyCodeLine{01068                             \textcolor{keywordtype}{int}           n\_seq,}
1000\DoxyCodeLine{01069                             \mbox{\hyperlink{group__energy__parameters_structvrna__param__s}{vrna\_param\_t}}  *P)}
1001\DoxyCodeLine{01070 \{}
1002\DoxyCodeLine{01071   \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int}  type;}
1003\DoxyCodeLine{01072   \textcolor{keywordtype}{int}           eee, energy, ge, p, q, l1, u1, u2, minq, maxq, c0, s;}
1004\DoxyCodeLine{01073   \mbox{\hyperlink{group__model__details_structvrna__md__s}{vrna\_md\_t}}     *md;}
1005\DoxyCodeLine{01074 }
1006\DoxyCodeLine{01075   md      = \&(P-\/>\mbox{\hyperlink{group__energy__parameters_a7b84353eb9075c595bad4ceb871bcae7}{model\_details}});}
1007\DoxyCodeLine{01076   energy  = 0;}
1008\DoxyCodeLine{01077 }
1009\DoxyCodeLine{01078   \textcolor{keywordflow}{for} (s = 0; s < n\_seq; s++) \{}
1010\DoxyCodeLine{01079     type = tt[s];}
1011\DoxyCodeLine{01080     \textcolor{keywordflow}{if} (md-\/>\mbox{\hyperlink{group__model__details_adcda4ff2ea77748ae0e8700288282efc}{dangles}} == 2)}
1012\DoxyCodeLine{01081       energy += P-\/>mismatchI[type][S3[s][i]][S5[s][j]];}
1013\DoxyCodeLine{01082 }
1014\DoxyCodeLine{01083     \textcolor{keywordflow}{if} (type > 2)}
1015\DoxyCodeLine{01084       energy += P-\/>TerminalAU;}
1016\DoxyCodeLine{01085   \}}
1017\DoxyCodeLine{01086 }
1018\DoxyCodeLine{01087   ge = \mbox{\hyperlink{constants_8h_a12c2040f25d8e3a7b9e1c2024c618cb6}{INF}};}
1019\DoxyCodeLine{01088 }
1020\DoxyCodeLine{01089   p = i + 1;}
1021\DoxyCodeLine{01090   \textcolor{keywordflow}{if} (S\_cons[p] == 3) \{}
1022\DoxyCodeLine{01091     \textcolor{keywordflow}{if} (p < j -\/ VRNA\_GQUAD\_MIN\_BOX\_SIZE) \{}
1023\DoxyCodeLine{01092       minq  = j -\/ i + p -\/ \mbox{\hyperlink{constants_8h_ad1bd6eabac419670ddd3c9ed82145988}{MAXLOOP}} -\/ 2;}
1024\DoxyCodeLine{01093       c0    = p + VRNA\_GQUAD\_MIN\_BOX\_SIZE -\/ 1;}
1025\DoxyCodeLine{01094       minq  = \mbox{\hyperlink{group__utils_ga33297b3679c713b0c4d897cd0fe3b122}{MAX2}}(c0, minq);}
1026\DoxyCodeLine{01095       c0    = j -\/ 3;}
1027\DoxyCodeLine{01096       maxq  = p + VRNA\_GQUAD\_MAX\_BOX\_SIZE + 1;}
1028\DoxyCodeLine{01097       maxq  = \mbox{\hyperlink{group__utils_gae0b9cd0ce090bd69b951aa73e8fa4f7d}{MIN2}}(c0, maxq);}
1029\DoxyCodeLine{01098       \textcolor{keywordflow}{for} (q = minq; q < maxq; q++) \{}
1030\DoxyCodeLine{01099         \textcolor{keywordflow}{if} (S\_cons[q] != 3)}
1031\DoxyCodeLine{01100           \textcolor{keywordflow}{continue};}
1032\DoxyCodeLine{01101 }
1033\DoxyCodeLine{01102         eee = 0;}
1034\DoxyCodeLine{01103 }
1035\DoxyCodeLine{01104         \textcolor{keywordflow}{for} (s = 0; s < n\_seq; s++) \{}
1036\DoxyCodeLine{01105           u1  = a2s[s][j -\/ 1] -\/ a2s[s][q];}
1037\DoxyCodeLine{01106           eee += P-\/>internal\_loop[u1];}
1038\DoxyCodeLine{01107         \}}
1039\DoxyCodeLine{01108 }
1040\DoxyCodeLine{01109         c0 = energy +}
1041\DoxyCodeLine{01110              ggg[index[q] + p] +}
1042\DoxyCodeLine{01111              eee;}
1043\DoxyCodeLine{01112         ge = \mbox{\hyperlink{group__utils_gae0b9cd0ce090bd69b951aa73e8fa4f7d}{MIN2}}(ge, c0);}
1044\DoxyCodeLine{01113       \}}
1045\DoxyCodeLine{01114     \}}
1046\DoxyCodeLine{01115   \}}
1047\DoxyCodeLine{01116 }
1048\DoxyCodeLine{01117   \textcolor{keywordflow}{for} (p = i + 2;}
1049\DoxyCodeLine{01118        p < j -\/ VRNA\_GQUAD\_MIN\_BOX\_SIZE;}
1050\DoxyCodeLine{01119        p++) \{}
1051\DoxyCodeLine{01120     l1 = p -\/ i -\/ 1;}
1052\DoxyCodeLine{01121     \textcolor{keywordflow}{if} (l1 > \mbox{\hyperlink{constants_8h_ad1bd6eabac419670ddd3c9ed82145988}{MAXLOOP}})}
1053\DoxyCodeLine{01122       \textcolor{keywordflow}{break};}
1054\DoxyCodeLine{01123 }
1055\DoxyCodeLine{01124     \textcolor{keywordflow}{if} (S\_cons[p] != 3)}
1056\DoxyCodeLine{01125       \textcolor{keywordflow}{continue};}
1057\DoxyCodeLine{01126 }
1058\DoxyCodeLine{01127     minq  = j -\/ i + p -\/ \mbox{\hyperlink{constants_8h_ad1bd6eabac419670ddd3c9ed82145988}{MAXLOOP}} -\/ 2;}
1059\DoxyCodeLine{01128     c0    = p + VRNA\_GQUAD\_MIN\_BOX\_SIZE -\/ 1;}
1060\DoxyCodeLine{01129     minq  = \mbox{\hyperlink{group__utils_ga33297b3679c713b0c4d897cd0fe3b122}{MAX2}}(c0, minq);}
1061\DoxyCodeLine{01130     c0    = j -\/ 1;}
1062\DoxyCodeLine{01131     maxq  = p + VRNA\_GQUAD\_MAX\_BOX\_SIZE + 1;}
1063\DoxyCodeLine{01132     maxq  = \mbox{\hyperlink{group__utils_gae0b9cd0ce090bd69b951aa73e8fa4f7d}{MIN2}}(c0, maxq);}
1064\DoxyCodeLine{01133     \textcolor{keywordflow}{for} (q = minq; q < maxq; q++) \{}
1065\DoxyCodeLine{01134       \textcolor{keywordflow}{if} (S\_cons[q] != 3)}
1066\DoxyCodeLine{01135         \textcolor{keywordflow}{continue};}
1067\DoxyCodeLine{01136 }
1068\DoxyCodeLine{01137       eee = 0;}
1069\DoxyCodeLine{01138 }
1070\DoxyCodeLine{01139       \textcolor{keywordflow}{for} (s = 0; s < n\_seq; s++) \{}
1071\DoxyCodeLine{01140         u1  = a2s[s][p -\/ 1] -\/ a2s[s][i];}
1072\DoxyCodeLine{01141         u2  = a2s[s][j -\/ 1] -\/ a2s[s][q];}
1073\DoxyCodeLine{01142         eee += P-\/>internal\_loop[u1 + u2];}
1074\DoxyCodeLine{01143       \}}
1075\DoxyCodeLine{01144 }
1076\DoxyCodeLine{01145       c0 = energy +}
1077\DoxyCodeLine{01146            ggg[index[q] + p] +}
1078\DoxyCodeLine{01147            eee;}
1079\DoxyCodeLine{01148       ge = \mbox{\hyperlink{group__utils_gae0b9cd0ce090bd69b951aa73e8fa4f7d}{MIN2}}(ge, c0);}
1080\DoxyCodeLine{01149     \}}
1081\DoxyCodeLine{01150   \}}
1082\DoxyCodeLine{01151 }
1083\DoxyCodeLine{01152   q = j -\/ 1;}
1084\DoxyCodeLine{01153   \textcolor{keywordflow}{if} (S\_cons[q] == 3)}
1085\DoxyCodeLine{01154     \textcolor{keywordflow}{for} (p = i + 4;}
1086\DoxyCodeLine{01155          p < j -\/ VRNA\_GQUAD\_MIN\_BOX\_SIZE;}
1087\DoxyCodeLine{01156          p++) \{}
1088\DoxyCodeLine{01157       l1 = p -\/ i -\/ 1;}
1089\DoxyCodeLine{01158       \textcolor{keywordflow}{if} (l1 > \mbox{\hyperlink{constants_8h_ad1bd6eabac419670ddd3c9ed82145988}{MAXLOOP}})}
1090\DoxyCodeLine{01159         \textcolor{keywordflow}{break};}
1091\DoxyCodeLine{01160 }
1092\DoxyCodeLine{01161       \textcolor{keywordflow}{if} (S\_cons[p] != 3)}
1093\DoxyCodeLine{01162         \textcolor{keywordflow}{continue};}
1094\DoxyCodeLine{01163 }
1095\DoxyCodeLine{01164       eee = 0;}
1096\DoxyCodeLine{01165 }
1097\DoxyCodeLine{01166       \textcolor{keywordflow}{for} (s = 0; s < n\_seq; s++) \{}
1098\DoxyCodeLine{01167         u1  = a2s[s][p -\/ 1] -\/ a2s[s][i];}
1099\DoxyCodeLine{01168         eee += P-\/>internal\_loop[u1];}
1100\DoxyCodeLine{01169       \}}
1101\DoxyCodeLine{01170 }
1102\DoxyCodeLine{01171       c0 = energy +}
1103\DoxyCodeLine{01172            ggg[index[q] + p] +}
1104\DoxyCodeLine{01173            eee;}
1105\DoxyCodeLine{01174       ge = \mbox{\hyperlink{group__utils_gae0b9cd0ce090bd69b951aa73e8fa4f7d}{MIN2}}(ge, c0);}
1106\DoxyCodeLine{01175     \}}
1107\DoxyCodeLine{01176 }
1108\DoxyCodeLine{01177   \textcolor{keywordflow}{return} ge;}
1109\DoxyCodeLine{01178 \}}
1110\DoxyCodeLine{01179 }
1111\DoxyCodeLine{01180 }
1112\DoxyCodeLine{01181 PRIVATE INLINE}
1113\DoxyCodeLine{01182 \textcolor{keywordtype}{int}}
1114\DoxyCodeLine{01183 E\_GQuad\_IntLoop\_L\_comparative(\textcolor{keywordtype}{int}           i,}
1115\DoxyCodeLine{01184                               \textcolor{keywordtype}{int}           j,}
1116\DoxyCodeLine{01185                               \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int}  *tt,}
1117\DoxyCodeLine{01186                               \textcolor{keywordtype}{short}         *S\_cons,}
1118\DoxyCodeLine{01187                               \textcolor{keywordtype}{short}         **S5,}
1119\DoxyCodeLine{01188                               \textcolor{keywordtype}{short}         **S3,}
1120\DoxyCodeLine{01189                               \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int}  **a2s,}
1121\DoxyCodeLine{01190                               \textcolor{keywordtype}{int}           **ggg,}
1122\DoxyCodeLine{01191                               \textcolor{keywordtype}{int}           n\_seq,}
1123\DoxyCodeLine{01192                               \mbox{\hyperlink{group__energy__parameters_structvrna__param__s}{vrna\_param\_t}}  *P)}
1124\DoxyCodeLine{01193 \{}
1125\DoxyCodeLine{01194   \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int}  type;}
1126\DoxyCodeLine{01195   \textcolor{keywordtype}{int}           eee, energy, ge, p, q, l1, u1, u2, minq, maxq, c0, s;}
1127\DoxyCodeLine{01196   \mbox{\hyperlink{group__model__details_structvrna__md__s}{vrna\_md\_t}}     *md;}
1128\DoxyCodeLine{01197 }
1129\DoxyCodeLine{01198   md      = \&(P-\/>\mbox{\hyperlink{group__energy__parameters_a7b84353eb9075c595bad4ceb871bcae7}{model\_details}});}
1130\DoxyCodeLine{01199   energy  = 0;}
1131\DoxyCodeLine{01200 }
1132\DoxyCodeLine{01201   \textcolor{keywordflow}{for} (s = 0; s < n\_seq; s++) \{}
1133\DoxyCodeLine{01202     type = tt[s];}
1134\DoxyCodeLine{01203     \textcolor{keywordflow}{if} (md-\/>\mbox{\hyperlink{group__model__details_adcda4ff2ea77748ae0e8700288282efc}{dangles}} == 2)}
1135\DoxyCodeLine{01204       energy += P-\/>mismatchI[type][S3[s][i]][S5[s][j]];}
1136\DoxyCodeLine{01205 }
1137\DoxyCodeLine{01206     \textcolor{keywordflow}{if} (type > 2)}
1138\DoxyCodeLine{01207       energy += P-\/>TerminalAU;}
1139\DoxyCodeLine{01208   \}}
1140\DoxyCodeLine{01209 }
1141\DoxyCodeLine{01210   ge = \mbox{\hyperlink{constants_8h_a12c2040f25d8e3a7b9e1c2024c618cb6}{INF}};}
1142\DoxyCodeLine{01211 }
1143\DoxyCodeLine{01212   p = i + 1;}
1144\DoxyCodeLine{01213   \textcolor{keywordflow}{if} (S\_cons[p] == 3) \{}
1145\DoxyCodeLine{01214     \textcolor{keywordflow}{if} (p < j -\/ VRNA\_GQUAD\_MIN\_BOX\_SIZE) \{}
1146\DoxyCodeLine{01215       minq  = j -\/ i + p -\/ \mbox{\hyperlink{constants_8h_ad1bd6eabac419670ddd3c9ed82145988}{MAXLOOP}} -\/ 2;}
1147\DoxyCodeLine{01216       c0    = p + VRNA\_GQUAD\_MIN\_BOX\_SIZE -\/ 1;}
1148\DoxyCodeLine{01217       minq  = \mbox{\hyperlink{group__utils_ga33297b3679c713b0c4d897cd0fe3b122}{MAX2}}(c0, minq);}
1149\DoxyCodeLine{01218       c0    = j -\/ 3;}
1150\DoxyCodeLine{01219       maxq  = p + VRNA\_GQUAD\_MAX\_BOX\_SIZE + 1;}
1151\DoxyCodeLine{01220       maxq  = \mbox{\hyperlink{group__utils_gae0b9cd0ce090bd69b951aa73e8fa4f7d}{MIN2}}(c0, maxq);}
1152\DoxyCodeLine{01221       \textcolor{keywordflow}{for} (q = minq; q < maxq; q++) \{}
1153\DoxyCodeLine{01222         \textcolor{keywordflow}{if} (S\_cons[q] != 3)}
1154\DoxyCodeLine{01223           \textcolor{keywordflow}{continue};}
1155\DoxyCodeLine{01224 }
1156\DoxyCodeLine{01225         eee = 0;}
1157\DoxyCodeLine{01226 }
1158\DoxyCodeLine{01227         \textcolor{keywordflow}{for} (s = 0; s < n\_seq; s++) \{}
1159\DoxyCodeLine{01228           u1  = a2s[s][j -\/ 1] -\/ a2s[s][q];}
1160\DoxyCodeLine{01229           eee += P-\/>internal\_loop[u1];}
1161\DoxyCodeLine{01230         \}}
1162\DoxyCodeLine{01231 }
1163\DoxyCodeLine{01232         c0 = energy +}
1164\DoxyCodeLine{01233              ggg[p][q -\/ p] +}
1165\DoxyCodeLine{01234              eee;}
1166\DoxyCodeLine{01235         ge = \mbox{\hyperlink{group__utils_gae0b9cd0ce090bd69b951aa73e8fa4f7d}{MIN2}}(ge, c0);}
1167\DoxyCodeLine{01236       \}}
1168\DoxyCodeLine{01237     \}}
1169\DoxyCodeLine{01238   \}}
1170\DoxyCodeLine{01239 }
1171\DoxyCodeLine{01240   \textcolor{keywordflow}{for} (p = i + 2;}
1172\DoxyCodeLine{01241        p < j -\/ VRNA\_GQUAD\_MIN\_BOX\_SIZE;}
1173\DoxyCodeLine{01242        p++) \{}
1174\DoxyCodeLine{01243     l1 = p -\/ i -\/ 1;}
1175\DoxyCodeLine{01244     \textcolor{keywordflow}{if} (l1 > \mbox{\hyperlink{constants_8h_ad1bd6eabac419670ddd3c9ed82145988}{MAXLOOP}})}
1176\DoxyCodeLine{01245       \textcolor{keywordflow}{break};}
1177\DoxyCodeLine{01246 }
1178\DoxyCodeLine{01247     \textcolor{keywordflow}{if} (S\_cons[p] != 3)}
1179\DoxyCodeLine{01248       \textcolor{keywordflow}{continue};}
1180\DoxyCodeLine{01249 }
1181\DoxyCodeLine{01250     minq  = j -\/ i + p -\/ \mbox{\hyperlink{constants_8h_ad1bd6eabac419670ddd3c9ed82145988}{MAXLOOP}} -\/ 2;}
1182\DoxyCodeLine{01251     c0    = p + VRNA\_GQUAD\_MIN\_BOX\_SIZE -\/ 1;}
1183\DoxyCodeLine{01252     minq  = \mbox{\hyperlink{group__utils_ga33297b3679c713b0c4d897cd0fe3b122}{MAX2}}(c0, minq);}
1184\DoxyCodeLine{01253     c0    = j -\/ 1;}
1185\DoxyCodeLine{01254     maxq  = p + VRNA\_GQUAD\_MAX\_BOX\_SIZE + 1;}
1186\DoxyCodeLine{01255     maxq  = \mbox{\hyperlink{group__utils_gae0b9cd0ce090bd69b951aa73e8fa4f7d}{MIN2}}(c0, maxq);}
1187\DoxyCodeLine{01256     \textcolor{keywordflow}{for} (q = minq; q < maxq; q++) \{}
1188\DoxyCodeLine{01257       \textcolor{keywordflow}{if} (S\_cons[q] != 3)}
1189\DoxyCodeLine{01258         \textcolor{keywordflow}{continue};}
1190\DoxyCodeLine{01259 }
1191\DoxyCodeLine{01260       eee = 0;}
1192\DoxyCodeLine{01261 }
1193\DoxyCodeLine{01262       \textcolor{keywordflow}{for} (s = 0; s < n\_seq; s++) \{}
1194\DoxyCodeLine{01263         u1  = a2s[s][p -\/ 1] -\/ a2s[s][i];}
1195\DoxyCodeLine{01264         u2  = a2s[s][j -\/ 1] -\/ a2s[s][q];}
1196\DoxyCodeLine{01265         eee += P-\/>internal\_loop[u1 + u2];}
1197\DoxyCodeLine{01266       \}}
1198\DoxyCodeLine{01267 }
1199\DoxyCodeLine{01268       c0 = energy +}
1200\DoxyCodeLine{01269            ggg[p][q -\/ p] +}
1201\DoxyCodeLine{01270            eee;}
1202\DoxyCodeLine{01271       ge = \mbox{\hyperlink{group__utils_gae0b9cd0ce090bd69b951aa73e8fa4f7d}{MIN2}}(ge, c0);}
1203\DoxyCodeLine{01272     \}}
1204\DoxyCodeLine{01273   \}}
1205\DoxyCodeLine{01274 }
1206\DoxyCodeLine{01275   q = j -\/ 1;}
1207\DoxyCodeLine{01276   \textcolor{keywordflow}{if} (S\_cons[q] == 3)}
1208\DoxyCodeLine{01277     \textcolor{keywordflow}{for} (p = i + 4;}
1209\DoxyCodeLine{01278          p < j -\/ VRNA\_GQUAD\_MIN\_BOX\_SIZE;}
1210\DoxyCodeLine{01279          p++) \{}
1211\DoxyCodeLine{01280       l1 = p -\/ i -\/ 1;}
1212\DoxyCodeLine{01281       \textcolor{keywordflow}{if} (l1 > \mbox{\hyperlink{constants_8h_ad1bd6eabac419670ddd3c9ed82145988}{MAXLOOP}})}
1213\DoxyCodeLine{01282         \textcolor{keywordflow}{break};}
1214\DoxyCodeLine{01283 }
1215\DoxyCodeLine{01284       \textcolor{keywordflow}{if} (S\_cons[p] != 3)}
1216\DoxyCodeLine{01285         \textcolor{keywordflow}{continue};}
1217\DoxyCodeLine{01286 }
1218\DoxyCodeLine{01287       eee = 0;}
1219\DoxyCodeLine{01288 }
1220\DoxyCodeLine{01289       \textcolor{keywordflow}{for} (s = 0; s < n\_seq; s++) \{}
1221\DoxyCodeLine{01290         u1  = a2s[s][p -\/ 1] -\/ a2s[s][i];}
1222\DoxyCodeLine{01291         eee += P-\/>internal\_loop[u1];}
1223\DoxyCodeLine{01292       \}}
1224\DoxyCodeLine{01293 }
1225\DoxyCodeLine{01294       c0 = energy +}
1226\DoxyCodeLine{01295            ggg[p][q -\/ p] +}
1227\DoxyCodeLine{01296            eee;}
1228\DoxyCodeLine{01297       ge = \mbox{\hyperlink{group__utils_gae0b9cd0ce090bd69b951aa73e8fa4f7d}{MIN2}}(ge, c0);}
1229\DoxyCodeLine{01298     \}}
1230\DoxyCodeLine{01299 }
1231\DoxyCodeLine{01300   \textcolor{keywordflow}{return} ge;}
1232\DoxyCodeLine{01301 \}}
1233\DoxyCodeLine{01302 }
1234\DoxyCodeLine{01303 }
1235\DoxyCodeLine{01304 PRIVATE INLINE}
1236\DoxyCodeLine{01305 \textcolor{keywordtype}{int} *}
1237\DoxyCodeLine{01306 E\_GQuad\_IntLoop\_exhaustive(\textcolor{keywordtype}{int}          i,}
1238\DoxyCodeLine{01307                            \textcolor{keywordtype}{int}          j,}
1239\DoxyCodeLine{01308                            \textcolor{keywordtype}{int}          **p\_p,}
1240\DoxyCodeLine{01309                            \textcolor{keywordtype}{int}          **q\_p,}
1241\DoxyCodeLine{01310                            \textcolor{keywordtype}{int}          type,}
1242\DoxyCodeLine{01311                            \textcolor{keywordtype}{short}        *S,}
1243\DoxyCodeLine{01312                            \textcolor{keywordtype}{int}          *ggg,}
1244\DoxyCodeLine{01313                            \textcolor{keywordtype}{int}          threshold,}
1245\DoxyCodeLine{01314                            \textcolor{keywordtype}{int}          *index,}
1246\DoxyCodeLine{01315                            \mbox{\hyperlink{group__energy__parameters_structvrna__param__s}{vrna\_param\_t}} *P)}
1247\DoxyCodeLine{01316 \{}
1248\DoxyCodeLine{01317   \textcolor{keywordtype}{int}   energy, *ge, \mbox{\hyperlink{group__model__details_ga72b511ed1201f7e23ec437e468790d74}{dangles}}, p, q, l1, minq, maxq, c0;}
1249\DoxyCodeLine{01318   \textcolor{keywordtype}{short} si, sj;}
1250\DoxyCodeLine{01319   \textcolor{keywordtype}{int}   cnt = 0;}
1251\DoxyCodeLine{01320 }
1252\DoxyCodeLine{01321   \mbox{\hyperlink{group__model__details_ga72b511ed1201f7e23ec437e468790d74}{dangles}} = P-\/>\mbox{\hyperlink{group__energy__parameters_a7b84353eb9075c595bad4ceb871bcae7}{model\_details}}.\mbox{\hyperlink{group__model__details_adcda4ff2ea77748ae0e8700288282efc}{dangles}};}
1253\DoxyCodeLine{01322   si      = S[i + 1];}
1254\DoxyCodeLine{01323   sj      = S[j -\/ 1];}
1255\DoxyCodeLine{01324   energy  = 0;}
1256\DoxyCodeLine{01325 }
1257\DoxyCodeLine{01326   \textcolor{keywordflow}{if} (\mbox{\hyperlink{group__model__details_ga72b511ed1201f7e23ec437e468790d74}{dangles}} == 2)}
1258\DoxyCodeLine{01327     energy += P-\/>mismatchI[type][si][sj];}
1259\DoxyCodeLine{01328 }
1260\DoxyCodeLine{01329   \textcolor{keywordflow}{if} (type > 2)}
1261\DoxyCodeLine{01330     energy += P-\/>TerminalAU;}
1262\DoxyCodeLine{01331 }
1263\DoxyCodeLine{01332   \textcolor{comment}{/* guess how many gquads are possible in interval [i+1,j-\/1] */}}
1264\DoxyCodeLine{01333   *p\_p  = (\textcolor{keywordtype}{int} *)\mbox{\hyperlink{group__utils_gaf37a0979367c977edfb9da6614eebe99}{vrna\_alloc}}(\textcolor{keyword}{sizeof}(\textcolor{keywordtype}{int}) * 256);}
1265\DoxyCodeLine{01334   *q\_p  = (\textcolor{keywordtype}{int} *)\mbox{\hyperlink{group__utils_gaf37a0979367c977edfb9da6614eebe99}{vrna\_alloc}}(\textcolor{keyword}{sizeof}(\textcolor{keywordtype}{int}) * 256);}
1266\DoxyCodeLine{01335   ge    = (\textcolor{keywordtype}{int} *)\mbox{\hyperlink{group__utils_gaf37a0979367c977edfb9da6614eebe99}{vrna\_alloc}}(\textcolor{keyword}{sizeof}(\textcolor{keywordtype}{int}) * 256);}
1267\DoxyCodeLine{01336 }
1268\DoxyCodeLine{01337   p = i + 1;}
1269\DoxyCodeLine{01338   \textcolor{keywordflow}{if} (S[p] == 3) \{}
1270\DoxyCodeLine{01339     \textcolor{keywordflow}{if} (p < j -\/ VRNA\_GQUAD\_MIN\_BOX\_SIZE) \{}
1271\DoxyCodeLine{01340       minq  = j -\/ i + p -\/ \mbox{\hyperlink{constants_8h_ad1bd6eabac419670ddd3c9ed82145988}{MAXLOOP}} -\/ 2;}
1272\DoxyCodeLine{01341       c0    = p + VRNA\_GQUAD\_MIN\_BOX\_SIZE -\/ 1;}
1273\DoxyCodeLine{01342       minq  = \mbox{\hyperlink{group__utils_ga33297b3679c713b0c4d897cd0fe3b122}{MAX2}}(c0, minq);}
1274\DoxyCodeLine{01343       c0    = j -\/ 3;}
1275\DoxyCodeLine{01344       maxq  = p + VRNA\_GQUAD\_MAX\_BOX\_SIZE + 1;}
1276\DoxyCodeLine{01345       maxq  = \mbox{\hyperlink{group__utils_gae0b9cd0ce090bd69b951aa73e8fa4f7d}{MIN2}}(c0, maxq);}
1277\DoxyCodeLine{01346       \textcolor{keywordflow}{for} (q = minq; q < maxq; q++) \{}
1278\DoxyCodeLine{01347         \textcolor{keywordflow}{if} (S[q] != 3)}
1279\DoxyCodeLine{01348           \textcolor{keywordflow}{continue};}
1280\DoxyCodeLine{01349 }
1281\DoxyCodeLine{01350         c0 = energy + ggg[index[q] + p] + P-\/>internal\_loop[j -\/ q -\/ 1];}
1282\DoxyCodeLine{01351         \textcolor{keywordflow}{if} (c0 <= threshold) \{}
1283\DoxyCodeLine{01352           ge[cnt]       = energy + P-\/>internal\_loop[j -\/ q -\/ 1];}
1284\DoxyCodeLine{01353           (*p\_p)[cnt]   = p;}
1285\DoxyCodeLine{01354           (*q\_p)[cnt++] = q;}
1286\DoxyCodeLine{01355         \}}
1287\DoxyCodeLine{01356       \}}
1288\DoxyCodeLine{01357     \}}
1289\DoxyCodeLine{01358   \}}
1290\DoxyCodeLine{01359 }
1291\DoxyCodeLine{01360   \textcolor{keywordflow}{for} (p = i + 2;}
1292\DoxyCodeLine{01361        p < j -\/ VRNA\_GQUAD\_MIN\_BOX\_SIZE;}
1293\DoxyCodeLine{01362        p++) \{}
1294\DoxyCodeLine{01363     l1 = p -\/ i -\/ 1;}
1295\DoxyCodeLine{01364     \textcolor{keywordflow}{if} (l1 > \mbox{\hyperlink{constants_8h_ad1bd6eabac419670ddd3c9ed82145988}{MAXLOOP}})}
1296\DoxyCodeLine{01365       \textcolor{keywordflow}{break};}
1297\DoxyCodeLine{01366 }
1298\DoxyCodeLine{01367     \textcolor{keywordflow}{if} (S[p] != 3)}
1299\DoxyCodeLine{01368       \textcolor{keywordflow}{continue};}
1300\DoxyCodeLine{01369 }
1301\DoxyCodeLine{01370     minq  = j -\/ i + p -\/ \mbox{\hyperlink{constants_8h_ad1bd6eabac419670ddd3c9ed82145988}{MAXLOOP}} -\/ 2;}
1302\DoxyCodeLine{01371     c0    = p + VRNA\_GQUAD\_MIN\_BOX\_SIZE -\/ 1;}
1303\DoxyCodeLine{01372     minq  = \mbox{\hyperlink{group__utils_ga33297b3679c713b0c4d897cd0fe3b122}{MAX2}}(c0, minq);}
1304\DoxyCodeLine{01373     c0    = j -\/ 1;}
1305\DoxyCodeLine{01374     maxq  = p + VRNA\_GQUAD\_MAX\_BOX\_SIZE + 1;}
1306\DoxyCodeLine{01375     maxq  = \mbox{\hyperlink{group__utils_gae0b9cd0ce090bd69b951aa73e8fa4f7d}{MIN2}}(c0, maxq);}
1307\DoxyCodeLine{01376     \textcolor{keywordflow}{for} (q = minq; q < maxq; q++) \{}
1308\DoxyCodeLine{01377       \textcolor{keywordflow}{if} (S[q] != 3)}
1309\DoxyCodeLine{01378         \textcolor{keywordflow}{continue};}
1310\DoxyCodeLine{01379 }
1311\DoxyCodeLine{01380       c0 = energy + ggg[index[q] + p] + P-\/>internal\_loop[l1 + j -\/ q -\/ 1];}
1312\DoxyCodeLine{01381       \textcolor{keywordflow}{if} (c0 <= threshold) \{}
1313\DoxyCodeLine{01382         ge[cnt]       = energy + P-\/>internal\_loop[l1 + j -\/ q -\/ 1];}
1314\DoxyCodeLine{01383         (*p\_p)[cnt]   = p;}
1315\DoxyCodeLine{01384         (*q\_p)[cnt++] = q;}
1316\DoxyCodeLine{01385       \}}
1317\DoxyCodeLine{01386     \}}
1318\DoxyCodeLine{01387   \}}
1319\DoxyCodeLine{01388 }
1320\DoxyCodeLine{01389   q = j -\/ 1;}
1321\DoxyCodeLine{01390   \textcolor{keywordflow}{if} (S[q] == 3)}
1322\DoxyCodeLine{01391     \textcolor{keywordflow}{for} (p = i + 4;}
1323\DoxyCodeLine{01392          p < j -\/ VRNA\_GQUAD\_MIN\_BOX\_SIZE;}
1324\DoxyCodeLine{01393          p++) \{}
1325\DoxyCodeLine{01394       l1 = p -\/ i -\/ 1;}
1326\DoxyCodeLine{01395       \textcolor{keywordflow}{if} (l1 > \mbox{\hyperlink{constants_8h_ad1bd6eabac419670ddd3c9ed82145988}{MAXLOOP}})}
1327\DoxyCodeLine{01396         \textcolor{keywordflow}{break};}
1328\DoxyCodeLine{01397 }
1329\DoxyCodeLine{01398       \textcolor{keywordflow}{if} (S[p] != 3)}
1330\DoxyCodeLine{01399         \textcolor{keywordflow}{continue};}
1331\DoxyCodeLine{01400 }
1332\DoxyCodeLine{01401       c0 = energy + ggg[index[q] + p] + P-\/>internal\_loop[l1];}
1333\DoxyCodeLine{01402       \textcolor{keywordflow}{if} (c0 <= threshold) \{}
1334\DoxyCodeLine{01403         ge[cnt]       = energy + P-\/>internal\_loop[l1];}
1335\DoxyCodeLine{01404         (*p\_p)[cnt]   = p;}
1336\DoxyCodeLine{01405         (*q\_p)[cnt++] = q;}
1337\DoxyCodeLine{01406       \}}
1338\DoxyCodeLine{01407     \}}
1339\DoxyCodeLine{01408 }
1340\DoxyCodeLine{01409   (*p\_p)[cnt] = -\/1;}
1341\DoxyCodeLine{01410 }
1342\DoxyCodeLine{01411   \textcolor{keywordflow}{return} ge;}
1343\DoxyCodeLine{01412 \}}
1344\DoxyCodeLine{01413 }
1345\DoxyCodeLine{01414 }
1346\DoxyCodeLine{01415 PRIVATE INLINE}
1347\DoxyCodeLine{01416 \textcolor{keywordtype}{int}}
1348\DoxyCodeLine{01417 E\_GQuad\_IntLoop\_L(\textcolor{keywordtype}{int}           i,}
1349\DoxyCodeLine{01418                   \textcolor{keywordtype}{int}           j,}
1350\DoxyCodeLine{01419                   \textcolor{keywordtype}{int}           type,}
1351\DoxyCodeLine{01420                   \textcolor{keywordtype}{short}         *S,}
1352\DoxyCodeLine{01421                   \textcolor{keywordtype}{int}           **ggg,}
1353\DoxyCodeLine{01422                   \textcolor{keywordtype}{int}           maxdist,}
1354\DoxyCodeLine{01423                   \mbox{\hyperlink{group__energy__parameters_structvrna__param__s}{vrna\_param\_t}}  *P)}
1355\DoxyCodeLine{01424 \{}
1356\DoxyCodeLine{01425   \textcolor{keywordtype}{int}   energy, ge, \mbox{\hyperlink{group__model__details_ga72b511ed1201f7e23ec437e468790d74}{dangles}}, p, q, l1, minq, maxq, c0;}
1357\DoxyCodeLine{01426   \textcolor{keywordtype}{short} si, sj;}
1358\DoxyCodeLine{01427 }
1359\DoxyCodeLine{01428   \mbox{\hyperlink{group__model__details_ga72b511ed1201f7e23ec437e468790d74}{dangles}} = P-\/>\mbox{\hyperlink{group__energy__parameters_a7b84353eb9075c595bad4ceb871bcae7}{model\_details}}.\mbox{\hyperlink{group__model__details_adcda4ff2ea77748ae0e8700288282efc}{dangles}};}
1360\DoxyCodeLine{01429   si      = S[i + 1];}
1361\DoxyCodeLine{01430   sj      = S[j -\/ 1];}
1362\DoxyCodeLine{01431   energy  = 0;}
1363\DoxyCodeLine{01432 }
1364\DoxyCodeLine{01433   \textcolor{keywordflow}{if} (\mbox{\hyperlink{group__model__details_ga72b511ed1201f7e23ec437e468790d74}{dangles}} == 2)}
1365\DoxyCodeLine{01434     energy += P-\/>mismatchI[type][si][sj];}
1366\DoxyCodeLine{01435 }
1367\DoxyCodeLine{01436   \textcolor{keywordflow}{if} (type > 2)}
1368\DoxyCodeLine{01437     energy += P-\/>TerminalAU;}
1369\DoxyCodeLine{01438 }
1370\DoxyCodeLine{01439   ge = \mbox{\hyperlink{constants_8h_a12c2040f25d8e3a7b9e1c2024c618cb6}{INF}};}
1371\DoxyCodeLine{01440 }
1372\DoxyCodeLine{01441   p = i + 1;}
1373\DoxyCodeLine{01442   \textcolor{keywordflow}{if} (S[p] == 3) \{}
1374\DoxyCodeLine{01443     \textcolor{keywordflow}{if} (p < j -\/ VRNA\_GQUAD\_MIN\_BOX\_SIZE) \{}
1375\DoxyCodeLine{01444       minq  = j -\/ i + p -\/ \mbox{\hyperlink{constants_8h_ad1bd6eabac419670ddd3c9ed82145988}{MAXLOOP}} -\/ 2;}
1376\DoxyCodeLine{01445       c0    = p + VRNA\_GQUAD\_MIN\_BOX\_SIZE -\/ 1;}
1377\DoxyCodeLine{01446       minq  = \mbox{\hyperlink{group__utils_ga33297b3679c713b0c4d897cd0fe3b122}{MAX2}}(c0, minq);}
1378\DoxyCodeLine{01447       c0    = j -\/ 3;}
1379\DoxyCodeLine{01448       maxq  = p + VRNA\_GQUAD\_MAX\_BOX\_SIZE + 1;}
1380\DoxyCodeLine{01449       maxq  = \mbox{\hyperlink{group__utils_gae0b9cd0ce090bd69b951aa73e8fa4f7d}{MIN2}}(c0, maxq);}
1381\DoxyCodeLine{01450       \textcolor{keywordflow}{for} (q = minq; q < maxq; q++) \{}
1382\DoxyCodeLine{01451         \textcolor{keywordflow}{if} (S[q] != 3)}
1383\DoxyCodeLine{01452           \textcolor{keywordflow}{continue};}
1384\DoxyCodeLine{01453 }
1385\DoxyCodeLine{01454         c0  = energy + ggg[p][q -\/ p] + P-\/>internal\_loop[j -\/ q -\/ 1];}
1386\DoxyCodeLine{01455         ge  = \mbox{\hyperlink{group__utils_gae0b9cd0ce090bd69b951aa73e8fa4f7d}{MIN2}}(ge, c0);}
1387\DoxyCodeLine{01456       \}}
1388\DoxyCodeLine{01457     \}}
1389\DoxyCodeLine{01458   \}}
1390\DoxyCodeLine{01459 }
1391\DoxyCodeLine{01460   \textcolor{keywordflow}{for} (p = i + 2;}
1392\DoxyCodeLine{01461        p < j -\/ VRNA\_GQUAD\_MIN\_BOX\_SIZE;}
1393\DoxyCodeLine{01462        p++) \{}
1394\DoxyCodeLine{01463     l1 = p -\/ i -\/ 1;}
1395\DoxyCodeLine{01464     \textcolor{keywordflow}{if} (l1 > \mbox{\hyperlink{constants_8h_ad1bd6eabac419670ddd3c9ed82145988}{MAXLOOP}})}
1396\DoxyCodeLine{01465       \textcolor{keywordflow}{break};}
1397\DoxyCodeLine{01466 }
1398\DoxyCodeLine{01467     \textcolor{keywordflow}{if} (S[p] != 3)}
1399\DoxyCodeLine{01468       \textcolor{keywordflow}{continue};}
1400\DoxyCodeLine{01469 }
1401\DoxyCodeLine{01470     minq  = j -\/ i + p -\/ \mbox{\hyperlink{constants_8h_ad1bd6eabac419670ddd3c9ed82145988}{MAXLOOP}} -\/ 2;}
1402\DoxyCodeLine{01471     c0    = p + VRNA\_GQUAD\_MIN\_BOX\_SIZE -\/ 1;}
1403\DoxyCodeLine{01472     minq  = \mbox{\hyperlink{group__utils_ga33297b3679c713b0c4d897cd0fe3b122}{MAX2}}(c0, minq);}
1404\DoxyCodeLine{01473     c0    = j -\/ 1;}
1405\DoxyCodeLine{01474     maxq  = p + VRNA\_GQUAD\_MAX\_BOX\_SIZE + 1;}
1406\DoxyCodeLine{01475     maxq  = \mbox{\hyperlink{group__utils_gae0b9cd0ce090bd69b951aa73e8fa4f7d}{MIN2}}(c0, maxq);}
1407\DoxyCodeLine{01476     \textcolor{keywordflow}{for} (q = minq; q < maxq; q++) \{}
1408\DoxyCodeLine{01477       \textcolor{keywordflow}{if} (S[q] != 3)}
1409\DoxyCodeLine{01478         \textcolor{keywordflow}{continue};}
1410\DoxyCodeLine{01479 }
1411\DoxyCodeLine{01480       c0  = energy + ggg[p][q -\/ p] + P-\/>internal\_loop[l1 + j -\/ q -\/ 1];}
1412\DoxyCodeLine{01481       ge  = \mbox{\hyperlink{group__utils_gae0b9cd0ce090bd69b951aa73e8fa4f7d}{MIN2}}(ge, c0);}
1413\DoxyCodeLine{01482     \}}
1414\DoxyCodeLine{01483   \}}
1415\DoxyCodeLine{01484 }
1416\DoxyCodeLine{01485   q = j -\/ 1;}
1417\DoxyCodeLine{01486   \textcolor{keywordflow}{if} (S[q] == 3)}
1418\DoxyCodeLine{01487     \textcolor{keywordflow}{for} (p = i + 4;}
1419\DoxyCodeLine{01488          p < j -\/ VRNA\_GQUAD\_MIN\_BOX\_SIZE;}
1420\DoxyCodeLine{01489          p++) \{}
1421\DoxyCodeLine{01490       l1 = p -\/ i -\/ 1;}
1422\DoxyCodeLine{01491       \textcolor{keywordflow}{if} (l1 > \mbox{\hyperlink{constants_8h_ad1bd6eabac419670ddd3c9ed82145988}{MAXLOOP}})}
1423\DoxyCodeLine{01492         \textcolor{keywordflow}{break};}
1424\DoxyCodeLine{01493 }
1425\DoxyCodeLine{01494       \textcolor{keywordflow}{if} (S[p] != 3)}
1426\DoxyCodeLine{01495         \textcolor{keywordflow}{continue};}
1427\DoxyCodeLine{01496 }
1428\DoxyCodeLine{01497       c0  = energy + ggg[p][q -\/ p] + P-\/>internal\_loop[l1];}
1429\DoxyCodeLine{01498       ge  = \mbox{\hyperlink{group__utils_gae0b9cd0ce090bd69b951aa73e8fa4f7d}{MIN2}}(ge, c0);}
1430\DoxyCodeLine{01499     \}}
1431\DoxyCodeLine{01500 }
1432\DoxyCodeLine{01501   \textcolor{keywordflow}{return} ge;}
1433\DoxyCodeLine{01502 \}}
1434\DoxyCodeLine{01503 }
1435\DoxyCodeLine{01504 }
1436\DoxyCodeLine{01505 PRIVATE INLINE}
1437\DoxyCodeLine{01506 \mbox{\hyperlink{group__data__structures_ga31125aeace516926bf7f251f759b6126}{FLT\_OR\_DBL}}}
1438\DoxyCodeLine{01507 exp\_E\_GQuad\_IntLoop(\textcolor{keywordtype}{int}               i,}
1439\DoxyCodeLine{01508                     \textcolor{keywordtype}{int}               j,}
1440\DoxyCodeLine{01509                     \textcolor{keywordtype}{int}               type,}
1441\DoxyCodeLine{01510                     \textcolor{keywordtype}{short}             *S,}
1442\DoxyCodeLine{01511                     \mbox{\hyperlink{group__data__structures_ga31125aeace516926bf7f251f759b6126}{FLT\_OR\_DBL}}        *G,}
1443\DoxyCodeLine{01512                     \mbox{\hyperlink{group__data__structures_ga31125aeace516926bf7f251f759b6126}{FLT\_OR\_DBL}}        *scale,}
1444\DoxyCodeLine{01513                     \textcolor{keywordtype}{int}               *index,}
1445\DoxyCodeLine{01514                     \mbox{\hyperlink{group__energy__parameters_structvrna__exp__param__s}{vrna\_exp\_param\_t}}  *pf)}
1446\DoxyCodeLine{01515 \{}
1447\DoxyCodeLine{01516   \textcolor{keywordtype}{int}         k, l, minl, maxl, u, r;}
1448\DoxyCodeLine{01517   \mbox{\hyperlink{group__data__structures_ga31125aeace516926bf7f251f759b6126}{FLT\_OR\_DBL}}  q, qe;}
1449\DoxyCodeLine{01518   \textcolor{keywordtype}{double}      *expintern;}
1450\DoxyCodeLine{01519   \textcolor{keywordtype}{short}       si, sj;}
1451\DoxyCodeLine{01520 }
1452\DoxyCodeLine{01521   q         = 0;}
1453\DoxyCodeLine{01522   si        = S[i + 1];}
1454\DoxyCodeLine{01523   sj        = S[j -\/ 1];}
1455\DoxyCodeLine{01524   qe        = (\mbox{\hyperlink{group__data__structures_ga31125aeace516926bf7f251f759b6126}{FLT\_OR\_DBL}})pf-\/>expmismatchI[type][si][sj];}
1456\DoxyCodeLine{01525   expintern = \&(pf-\/>expinternal[0]);}
1457\DoxyCodeLine{01526 }
1458\DoxyCodeLine{01527   \textcolor{keywordflow}{if} (type > 2)}
1459\DoxyCodeLine{01528     qe *= (\mbox{\hyperlink{group__data__structures_ga31125aeace516926bf7f251f759b6126}{FLT\_OR\_DBL}})pf-\/>expTermAU;}
1460\DoxyCodeLine{01529 }
1461\DoxyCodeLine{01530   k = i + 1;}
1462\DoxyCodeLine{01531   if (S[k] == 3) \{}
1463\DoxyCodeLine{01532     \textcolor{keywordflow}{if} (k < j -\/ VRNA\_GQUAD\_MIN\_BOX\_SIZE) \{}
1464\DoxyCodeLine{01533       minl  = j -\/ \mbox{\hyperlink{constants_8h_ad1bd6eabac419670ddd3c9ed82145988}{MAXLOOP}} -\/ 1;}
1465\DoxyCodeLine{01534       u     = k + VRNA\_GQUAD\_MIN\_BOX\_SIZE -\/ 1;}
1466\DoxyCodeLine{01535       minl  = \mbox{\hyperlink{group__utils_ga33297b3679c713b0c4d897cd0fe3b122}{MAX2}}(u, minl);}
1467\DoxyCodeLine{01536       u     = j -\/ 3;}
1468\DoxyCodeLine{01537       maxl  = k + VRNA\_GQUAD\_MAX\_BOX\_SIZE + 1;}
1469\DoxyCodeLine{01538       maxl  = \mbox{\hyperlink{group__utils_gae0b9cd0ce090bd69b951aa73e8fa4f7d}{MIN2}}(u, maxl);}
1470\DoxyCodeLine{01539       \textcolor{keywordflow}{for} (l = minl; l < maxl; l++) \{}
1471\DoxyCodeLine{01540         \textcolor{keywordflow}{if} (S[l] != 3)}
1472\DoxyCodeLine{01541           \textcolor{keywordflow}{continue};}
1473\DoxyCodeLine{01542 }
1474\DoxyCodeLine{01543         \textcolor{keywordflow}{if} (G[index[k] -\/ l] == 0.)}
1475\DoxyCodeLine{01544           \textcolor{keywordflow}{continue};}
1476\DoxyCodeLine{01545 }
1477\DoxyCodeLine{01546         q += qe}
1478\DoxyCodeLine{01547              * G[index[k] -\/ l]}
1479\DoxyCodeLine{01548              * (\mbox{\hyperlink{group__data__structures_ga31125aeace516926bf7f251f759b6126}{FLT\_OR\_DBL}})expintern[j -\/ l -\/ 1]}
1480\DoxyCodeLine{01549              * scale[j -\/ l + 1];}
1481\DoxyCodeLine{01550       \}}
1482\DoxyCodeLine{01551     \}}
1483\DoxyCodeLine{01552   \}}
1484\DoxyCodeLine{01553 }
1485\DoxyCodeLine{01554   \textcolor{keywordflow}{for} (k = i + 2;}
1486\DoxyCodeLine{01555        k <= j -\/ VRNA\_GQUAD\_MIN\_BOX\_SIZE;}
1487\DoxyCodeLine{01556        k++) \{}
1488\DoxyCodeLine{01557     u = k -\/ i -\/ 1;}
1489\DoxyCodeLine{01558     \textcolor{keywordflow}{if} (u > \mbox{\hyperlink{constants_8h_ad1bd6eabac419670ddd3c9ed82145988}{MAXLOOP}})}
1490\DoxyCodeLine{01559       \textcolor{keywordflow}{break};}
1491\DoxyCodeLine{01560 }
1492\DoxyCodeLine{01561     \textcolor{keywordflow}{if} (S[k] != 3)}
1493\DoxyCodeLine{01562       \textcolor{keywordflow}{continue};}
1494\DoxyCodeLine{01563 }
1495\DoxyCodeLine{01564     minl  = j -\/ i + k -\/ \mbox{\hyperlink{constants_8h_ad1bd6eabac419670ddd3c9ed82145988}{MAXLOOP}} -\/ 2;}
1496\DoxyCodeLine{01565     r     = k + VRNA\_GQUAD\_MIN\_BOX\_SIZE -\/ 1;}
1497\DoxyCodeLine{01566     minl  = \mbox{\hyperlink{group__utils_ga33297b3679c713b0c4d897cd0fe3b122}{MAX2}}(r, minl);}
1498\DoxyCodeLine{01567     maxl  = k + VRNA\_GQUAD\_MAX\_BOX\_SIZE + 1;}
1499\DoxyCodeLine{01568     r     = j -\/ 1;}
1500\DoxyCodeLine{01569     maxl  = \mbox{\hyperlink{group__utils_gae0b9cd0ce090bd69b951aa73e8fa4f7d}{MIN2}}(r, maxl);}
1501\DoxyCodeLine{01570     \textcolor{keywordflow}{for} (l = minl; l < maxl; l++) \{}
1502\DoxyCodeLine{01571       \textcolor{keywordflow}{if} (S[l] != 3)}
1503\DoxyCodeLine{01572         \textcolor{keywordflow}{continue};}
1504\DoxyCodeLine{01573 }
1505\DoxyCodeLine{01574       \textcolor{keywordflow}{if} (G[index[k] -\/ l] == 0.)}
1506\DoxyCodeLine{01575         \textcolor{keywordflow}{continue};}
1507\DoxyCodeLine{01576 }
1508\DoxyCodeLine{01577       q += qe}
1509\DoxyCodeLine{01578            * G[index[k] -\/ l]}
1510\DoxyCodeLine{01579            * (\mbox{\hyperlink{group__data__structures_ga31125aeace516926bf7f251f759b6126}{FLT\_OR\_DBL}})expintern[u + j -\/ l -\/ 1]}
1511\DoxyCodeLine{01580            * scale[u + j -\/ l + 1];}
1512\DoxyCodeLine{01581     \}}
1513\DoxyCodeLine{01582   \}}
1514\DoxyCodeLine{01583 }
1515\DoxyCodeLine{01584   l = j -\/ 1;}
1516\DoxyCodeLine{01585   \textcolor{keywordflow}{if} (S[l] == 3)}
1517\DoxyCodeLine{01586     \textcolor{keywordflow}{for} (k = i + 4; k <= j -\/ VRNA\_GQUAD\_MIN\_BOX\_SIZE; k++) \{}
1518\DoxyCodeLine{01587       u = k -\/ i -\/ 1;}
1519\DoxyCodeLine{01588       \textcolor{keywordflow}{if} (u > \mbox{\hyperlink{constants_8h_ad1bd6eabac419670ddd3c9ed82145988}{MAXLOOP}})}
1520\DoxyCodeLine{01589         \textcolor{keywordflow}{break};}
1521\DoxyCodeLine{01590 }
1522\DoxyCodeLine{01591       \textcolor{keywordflow}{if} (S[k] != 3)}
1523\DoxyCodeLine{01592         \textcolor{keywordflow}{continue};}
1524\DoxyCodeLine{01593 }
1525\DoxyCodeLine{01594       \textcolor{keywordflow}{if} (G[index[k] -\/ l] == 0.)}
1526\DoxyCodeLine{01595         \textcolor{keywordflow}{continue};}
1527\DoxyCodeLine{01596 }
1528\DoxyCodeLine{01597       q += qe}
1529\DoxyCodeLine{01598            * G[index[k] -\/ l]}
1530\DoxyCodeLine{01599            * (\mbox{\hyperlink{group__data__structures_ga31125aeace516926bf7f251f759b6126}{FLT\_OR\_DBL}})expintern[u]}
1531\DoxyCodeLine{01600            * scale[u + 2];}
1532\DoxyCodeLine{01601     \}}
1533\DoxyCodeLine{01602 }
1534\DoxyCodeLine{01603   \textcolor{keywordflow}{return} q;}
1535\DoxyCodeLine{01604 \}}
1536\DoxyCodeLine{01605 }
1537\DoxyCodeLine{01606 }
1538\DoxyCodeLine{01607 PRIVATE INLINE}
1539\DoxyCodeLine{01608 \mbox{\hyperlink{group__data__structures_ga31125aeace516926bf7f251f759b6126}{FLT\_OR\_DBL}}}
1540\DoxyCodeLine{01609 exp\_E\_GQuad\_IntLoop\_comparative(\textcolor{keywordtype}{int}               i,}
1541\DoxyCodeLine{01610                                 \textcolor{keywordtype}{int}               j,}
1542\DoxyCodeLine{01611                                 \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int}      *tt,}
1543\DoxyCodeLine{01612                                 \textcolor{keywordtype}{short}             *S\_cons,}
1544\DoxyCodeLine{01613                                 \textcolor{keywordtype}{short}             **S5,}
1545\DoxyCodeLine{01614                                 \textcolor{keywordtype}{short}             **S3,}
1546\DoxyCodeLine{01615                                 \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int}      **a2s,}
1547\DoxyCodeLine{01616                                 \mbox{\hyperlink{group__data__structures_ga31125aeace516926bf7f251f759b6126}{FLT\_OR\_DBL}}        *G,}
1548\DoxyCodeLine{01617                                 \mbox{\hyperlink{group__data__structures_ga31125aeace516926bf7f251f759b6126}{FLT\_OR\_DBL}}        *scale,}
1549\DoxyCodeLine{01618                                 \textcolor{keywordtype}{int}               *index,}
1550\DoxyCodeLine{01619                                 \textcolor{keywordtype}{int}               n\_seq,}
1551\DoxyCodeLine{01620                                 \mbox{\hyperlink{group__energy__parameters_structvrna__exp__param__s}{vrna\_exp\_param\_t}}  *pf)}
1552\DoxyCodeLine{01621 \{}
1553\DoxyCodeLine{01622   \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int}  type;}
1554\DoxyCodeLine{01623   \textcolor{keywordtype}{int}           k, l, minl, maxl, u, u1, u2, r, s;}
1555\DoxyCodeLine{01624   \mbox{\hyperlink{group__data__structures_ga31125aeace516926bf7f251f759b6126}{FLT\_OR\_DBL}}    q, qe, qqq;}
1556\DoxyCodeLine{01625   \textcolor{keywordtype}{double}        *expintern;}
1557\DoxyCodeLine{01626   \mbox{\hyperlink{group__model__details_structvrna__md__s}{vrna\_md\_t}}     *md;}
1558\DoxyCodeLine{01627 }
1559\DoxyCodeLine{01628   q         = 0;}
1560\DoxyCodeLine{01629   qe        = 1.;}
1561\DoxyCodeLine{01630   md        = \&(pf-\/>\mbox{\hyperlink{group__energy__parameters_ac18055127bccc27c1223f1d2f3b01b53}{model\_details}});}
1562\DoxyCodeLine{01631   expintern = \&(pf-\/>expinternal[0]);}
1563\DoxyCodeLine{01632 }
1564\DoxyCodeLine{01633   \textcolor{keywordflow}{for} (s = 0; s < n\_seq; s++) \{}
1565\DoxyCodeLine{01634     type = tt[s];}
1566\DoxyCodeLine{01635     \textcolor{keywordflow}{if} (md-\/>\mbox{\hyperlink{group__model__details_adcda4ff2ea77748ae0e8700288282efc}{dangles}} == 2)}
1567\DoxyCodeLine{01636       qe *= (\mbox{\hyperlink{group__data__structures_ga31125aeace516926bf7f251f759b6126}{FLT\_OR\_DBL}})pf-\/>expmismatchI[type][S3[s][i]][S5[s][j]];}
1568\DoxyCodeLine{01637 }
1569\DoxyCodeLine{01638     if (type > 2)}
1570\DoxyCodeLine{01639       qe *= (\mbox{\hyperlink{group__data__structures_ga31125aeace516926bf7f251f759b6126}{FLT\_OR\_DBL}})pf-\/>expTermAU;}
1571\DoxyCodeLine{01640   \}}
1572\DoxyCodeLine{01641 }
1573\DoxyCodeLine{01642   k = i + 1;}
1574\DoxyCodeLine{01643   \textcolor{keywordflow}{if} (S\_cons[k] == 3) \{}
1575\DoxyCodeLine{01644     \textcolor{keywordflow}{if} (k < j -\/ VRNA\_GQUAD\_MIN\_BOX\_SIZE) \{}
1576\DoxyCodeLine{01645       minl  = j -\/ \mbox{\hyperlink{constants_8h_ad1bd6eabac419670ddd3c9ed82145988}{MAXLOOP}} -\/ 1;}
1577\DoxyCodeLine{01646       u     = k + VRNA\_GQUAD\_MIN\_BOX\_SIZE -\/ 1;}
1578\DoxyCodeLine{01647       minl  = \mbox{\hyperlink{group__utils_ga33297b3679c713b0c4d897cd0fe3b122}{MAX2}}(u, minl);}
1579\DoxyCodeLine{01648       u     = j -\/ 3;}
1580\DoxyCodeLine{01649       maxl  = k + VRNA\_GQUAD\_MAX\_BOX\_SIZE + 1;}
1581\DoxyCodeLine{01650       maxl  = \mbox{\hyperlink{group__utils_gae0b9cd0ce090bd69b951aa73e8fa4f7d}{MIN2}}(u, maxl);}
1582\DoxyCodeLine{01651       \textcolor{keywordflow}{for} (l = minl; l < maxl; l++) \{}
1583\DoxyCodeLine{01652         \textcolor{keywordflow}{if} (S\_cons[l] != 3)}
1584\DoxyCodeLine{01653           \textcolor{keywordflow}{continue};}
1585\DoxyCodeLine{01654 }
1586\DoxyCodeLine{01655         \textcolor{keywordflow}{if} (G[index[k] -\/ l] == 0.)}
1587\DoxyCodeLine{01656           \textcolor{keywordflow}{continue};}
1588\DoxyCodeLine{01657 }
1589\DoxyCodeLine{01658         qqq = 1.;}
1590\DoxyCodeLine{01659 }
1591\DoxyCodeLine{01660         \textcolor{keywordflow}{for} (s = 0; s < n\_seq; s++) \{}
1592\DoxyCodeLine{01661           u1  = a2s[s][j -\/ 1] -\/ a2s[s][l];}
1593\DoxyCodeLine{01662           qqq *= expintern[u1];}
1594\DoxyCodeLine{01663         \}}
1595\DoxyCodeLine{01664 }
1596\DoxyCodeLine{01665         q += qe *}
1597\DoxyCodeLine{01666              G[index[k] -\/ l] *}
1598\DoxyCodeLine{01667              qqq *}
1599\DoxyCodeLine{01668              scale[j -\/ l + 1];}
1600\DoxyCodeLine{01669       \}}
1601\DoxyCodeLine{01670     \}}
1602\DoxyCodeLine{01671   \}}
1603\DoxyCodeLine{01672 }
1604\DoxyCodeLine{01673   \textcolor{keywordflow}{for} (k = i + 2;}
1605\DoxyCodeLine{01674        k <= j -\/ VRNA\_GQUAD\_MIN\_BOX\_SIZE;}
1606\DoxyCodeLine{01675        k++) \{}
1607\DoxyCodeLine{01676     u = k -\/ i -\/ 1;}
1608\DoxyCodeLine{01677     \textcolor{keywordflow}{if} (u > \mbox{\hyperlink{constants_8h_ad1bd6eabac419670ddd3c9ed82145988}{MAXLOOP}})}
1609\DoxyCodeLine{01678       \textcolor{keywordflow}{break};}
1610\DoxyCodeLine{01679 }
1611\DoxyCodeLine{01680     \textcolor{keywordflow}{if} (S\_cons[k] != 3)}
1612\DoxyCodeLine{01681       \textcolor{keywordflow}{continue};}
1613\DoxyCodeLine{01682 }
1614\DoxyCodeLine{01683     minl  = j -\/ i + k -\/ \mbox{\hyperlink{constants_8h_ad1bd6eabac419670ddd3c9ed82145988}{MAXLOOP}} -\/ 2;}
1615\DoxyCodeLine{01684     r     = k + VRNA\_GQUAD\_MIN\_BOX\_SIZE -\/ 1;}
1616\DoxyCodeLine{01685     minl  = \mbox{\hyperlink{group__utils_ga33297b3679c713b0c4d897cd0fe3b122}{MAX2}}(r, minl);}
1617\DoxyCodeLine{01686     maxl  = k + VRNA\_GQUAD\_MAX\_BOX\_SIZE + 1;}
1618\DoxyCodeLine{01687     r     = j -\/ 1;}
1619\DoxyCodeLine{01688     maxl  = \mbox{\hyperlink{group__utils_gae0b9cd0ce090bd69b951aa73e8fa4f7d}{MIN2}}(r, maxl);}
1620\DoxyCodeLine{01689     \textcolor{keywordflow}{for} (l = minl; l < maxl; l++) \{}
1621\DoxyCodeLine{01690       \textcolor{keywordflow}{if} (S\_cons[l] != 3)}
1622\DoxyCodeLine{01691         \textcolor{keywordflow}{continue};}
1623\DoxyCodeLine{01692 }
1624\DoxyCodeLine{01693       \textcolor{keywordflow}{if} (G[index[k] -\/ l] == 0.)}
1625\DoxyCodeLine{01694         \textcolor{keywordflow}{continue};}
1626\DoxyCodeLine{01695 }
1627\DoxyCodeLine{01696       qqq = 1.;}
1628\DoxyCodeLine{01697 }
1629\DoxyCodeLine{01698       \textcolor{keywordflow}{for} (s = 0; s < n\_seq; s++) \{}
1630\DoxyCodeLine{01699         u1  = a2s[s][k -\/ 1] -\/ a2s[s][i];}
1631\DoxyCodeLine{01700         u2  = a2s[s][j -\/ 1] -\/ a2s[s][l];}
1632\DoxyCodeLine{01701         qqq *= expintern[u1 + u2];}
1633\DoxyCodeLine{01702       \}}
1634\DoxyCodeLine{01703 }
1635\DoxyCodeLine{01704       q += qe *}
1636\DoxyCodeLine{01705            G[index[k] -\/ l] *}
1637\DoxyCodeLine{01706            qqq *}
1638\DoxyCodeLine{01707            scale[u + j -\/ l + 1];}
1639\DoxyCodeLine{01708     \}}
1640\DoxyCodeLine{01709   \}}
1641\DoxyCodeLine{01710 }
1642\DoxyCodeLine{01711   l = j -\/ 1;}
1643\DoxyCodeLine{01712   \textcolor{keywordflow}{if} (S\_cons[l] == 3)}
1644\DoxyCodeLine{01713     \textcolor{keywordflow}{for} (k = i + 4; k <= j -\/ VRNA\_GQUAD\_MIN\_BOX\_SIZE; k++) \{}
1645\DoxyCodeLine{01714       u = k -\/ i -\/ 1;}
1646\DoxyCodeLine{01715       \textcolor{keywordflow}{if} (u > \mbox{\hyperlink{constants_8h_ad1bd6eabac419670ddd3c9ed82145988}{MAXLOOP}})}
1647\DoxyCodeLine{01716         \textcolor{keywordflow}{break};}
1648\DoxyCodeLine{01717 }
1649\DoxyCodeLine{01718       \textcolor{keywordflow}{if} (S\_cons[k] != 3)}
1650\DoxyCodeLine{01719         \textcolor{keywordflow}{continue};}
1651\DoxyCodeLine{01720 }
1652\DoxyCodeLine{01721       \textcolor{keywordflow}{if} (G[index[k] -\/ l] == 0.)}
1653\DoxyCodeLine{01722         \textcolor{keywordflow}{continue};}
1654\DoxyCodeLine{01723 }
1655\DoxyCodeLine{01724       qqq = 1.;}
1656\DoxyCodeLine{01725 }
1657\DoxyCodeLine{01726       \textcolor{keywordflow}{for} (s = 0; s < n\_seq; s++) \{}
1658\DoxyCodeLine{01727         u1  = a2s[s][k -\/ 1] -\/ a2s[s][i];}
1659\DoxyCodeLine{01728         qqq *= expintern[u1];}
1660\DoxyCodeLine{01729       \}}
1661\DoxyCodeLine{01730 }
1662\DoxyCodeLine{01731       q += qe *}
1663\DoxyCodeLine{01732            G[index[k] -\/ l] *}
1664\DoxyCodeLine{01733            qqq *}
1665\DoxyCodeLine{01734            scale[u + 2];}
1666\DoxyCodeLine{01735     \}}
1667\DoxyCodeLine{01736 }
1668\DoxyCodeLine{01737   \textcolor{keywordflow}{return} q;}
1669\DoxyCodeLine{01738 \}}
1670\DoxyCodeLine{01739 }
1671\DoxyCodeLine{01740 }
1672\DoxyCodeLine{01746 \textcolor{preprocessor}{\#endif}}
1673
1674\end{DoxyCode}
1675