1 /****************************************************************\ 2 * * 3 * C4 dynamic programming library - optimal alignment code * 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_OPTIMAL_H 17 #define INCLUDED_OPTIMAL_H 18 19 #ifdef __cplusplus 20 extern "C" { 21 #endif /* __cplusplus */ 22 23 #include <glib.h> 24 25 #include "viterbi.h" 26 #include "subopt.h" 27 28 /**/ 29 30 typedef enum { 31 Optimal_Type_SCORE = (1 << 0), 32 Optimal_Type_PATH = (1 << 1), 33 Optimal_Type_REDUCED_SPACE = (1 << 2) 34 } Optimal_Type; 35 36 typedef struct { 37 gchar *name; 38 gint ref_count; 39 Optimal_Type type; 40 Viterbi *find_score; 41 Viterbi *find_path; 42 Viterbi *find_region; 43 Viterbi *find_checkpoint_continuation; 44 Viterbi *find_path_continuation; 45 } Optimal; 46 47 /**/ 48 49 Optimal *Optimal_create(C4_Model *model, gchar *name, 50 Optimal_Type type, gboolean use_codegen); 51 52 /* If name is NULL, "optimal:model->name" is used */ 53 void Optimal_destroy(Optimal *optimal); 54 Optimal *Optimal_share(Optimal *optimal); 55 56 GPtrArray *Optimal_make_Codegen_list(Optimal *optimal); 57 /* Returns a list of the Codegen objects created */ 58 59 C4_Score Optimal_find_score(Optimal *optimal, Region *region, 60 gpointer user_data, SubOpt *subopt); 61 /* Subopt is required for Optimal_find_score() in BSDP */ 62 63 Alignment *Optimal_find_path(Optimal *optimal, Region *region, 64 gpointer user_data, C4_Score threshold, 65 SubOpt *subopt); 66 67 #ifdef __cplusplus 68 } 69 #endif /* __cplusplus */ 70 71 #endif /* INCLUDED_OPTIMAL_H */ 72 73