1 /****************************************************************\
2 *                                                                *
3 *  C4 dynamic programming library - Seeded Dynamic Programming   *
4 *                                                                *
5 *  Guy St.C. Slater..   mailto:guy@ebi.ac.uk                     *
6 *  Copyright (C) 2000-2009.  All Rights Reserved.                *
7 *                                                                *
8 *  This source code is distributed under the terms of the        *
9 *  GNU General Public License, version 3. See the file COPYING   *
10 *  or http://www.gnu.org/licenses/gpl.txt for details            *
11 *                                                                *
12 *  If you use this code, please keep this notice intact.         *
13 *                                                                *
14 \****************************************************************/
15 
16 #ifndef INCLUDED_SDP_H
17 #define INCLUDED_SDP_H
18 
19 #ifdef __cplusplus
20 extern "C" {
21 #endif /* __cplusplus */
22 
23 #include <glib.h>
24 
25 #include "c4.h"
26 #include "comparison.h"
27 #include "slist.h"
28 #include "recyclebin.h"
29 #include "alignment.h"
30 #include "lookahead.h"
31 #include "subopt.h"
32 #include "region.h"
33 #include "sparsecache.h"
34 #include "boundary.h"
35 #include "scheduler.h"
36 #include "threadref.h"
37 
38 /**/
39 
40 typedef struct {
41         gint dropoff;
42     gboolean single_pass_subopt;
43 } SDP_ArgumentSet;
44 
45 SDP_ArgumentSet *SDP_ArgumentSet_create(Argument *arg);
46 
47 /**/
48 
49 typedef struct {
50                 gint  query_pos;
51                 gint  target_pos;
52             C4_Score  score;
53      STraceback_Cell *cell;
54 } SDP_Terminal;
55 
56 typedef struct SDP_Seed {
57                 gint  seed_id;
58                  HSP *hsp;
59         SDP_Terminal *max_start;     /* Best start from this HSP */
60         SDP_Terminal *max_end;       /* Best end from this HSP   */
61          PQueue_Node *pq_node;       /* To allow raising in PQ   */
62 } SDP_Seed;
63 
64 /* first_pre->*->last_pre->[INDEX]->first_post->*->last_post
65  */
66 
67 /**/
68 
69 typedef struct {
70           ThreadRef *thread_ref;
71     SDP_ArgumentSet *sas;
72            C4_Model *model;
73            gboolean  use_boundary;
74           Scheduler *find_starts_scheduler;
75           Scheduler *find_ends_scheduler;
76 } SDP;
77 
78 SDP *SDP_create(C4_Model *model);
79 SDP *SDP_share(SDP *sdp);
80 void SDP_destroy(SDP *sdp);
81 GPtrArray *SDP_get_codegen_list(SDP *sdp);
82 
83 /**/
84 
85 typedef struct {
86               SDP *sdp;
87        Comparison *comparison;
88              gint  alignment_count; /* Number reported so far */
89          gpointer  user_data;
90            SubOpt *subopt;
91         GPtrArray *seed_list;
92          gpointer *seed_list_by_score; /* Sorted in score order */
93              gint  single_pass_pos;
94          Boundary *boundary;
95          C4_Score  last_score;
96        STraceback *fwd_straceback;
97        STraceback *rev_straceback;
98 } SDP_Pair;
99 
100 SDP_Pair *SDP_Pair_create(SDP *sdp, SubOpt *subopt,
101                           Comparison *comparison, gpointer user_data);
102 void SDP_Pair_destroy(SDP_Pair *sdp_pair);
103 
104 /**/
105 
106 Alignment *SDP_Pair_next_path(SDP_Pair *sdp_pair, C4_Score threshold);
107 
108 /**/
109 
110 #ifdef __cplusplus
111 }
112 #endif /* __cplusplus */
113 
114 #endif /* INCLUDED_SDP_H */
115 
116