gfsmTrie.h
Go to the documentation of this file.
1 
2 /*=============================================================================*\
3  * File: gfsmTrie.h
4  * Author: Bryan Jurish <moocow.bovine@gmail.com>
5  * Description: finite state machine library
6  *
7  * Copyright (c) 2005-2007 Bryan Jurish.
8  *
9  * This library is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Lesser General Public
11  * License as published by the Free Software Foundation; either
12  * version 3 of the License, or (at your option) any later version.
13  *
14  * This library is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  * Lesser General Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public
20  * License along with this library; if not, write to the Free Software
21  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22  *=============================================================================*/
23 
28 #ifndef _GFSM_TRIE_H
29 #define _GFSM_TRIE_H
30 
31 #include <gfsmAutomaton.h>
32 
33 /*======================================================================
34  * Types: Trie
35  */
38 
39 /*======================================================================
40  * Constants
41  */
44 
47 
48 
49 /*======================================================================
50  * Methods: Constructors etc.
51  */
53 
54 
55 //------------------------------
57 #define gfsm_trie_new() \
58  gfsm_automaton_new_full(gfsmTrieDefaultFlags, gfsmTrieDefaultSRType, gfsmAutomatonDefaultSize)
59 
61 
62 
63 /*======================================================================
64  * Methods: Manipulation
65  */
67 
68 
69 //------------------------------
81  gfsmLabelVector *lo,
82  gfsmLabelVector *hi,
83  gfsmWeight w);
84 
85 //------------------------------
100  gfsmLabelVector *lo,
101  gfsmLabelVector *hi,
102  gfsmWeight w,
103  gboolean add_to_arcs,
104  gboolean add_to_state_final,
105  gboolean add_to_path_final,
106  gfsmStateIdVector *path_states
107  );
108 
109 /*======================================================================
110  * Methods: find path
111  */
123  gfsmLabelVector *lo,
124  gfsmLabelVector *hi,
125  guint *lo_i,
126  guint *hi_i,
127  gfsmWeight *w_last,
128  gfsmStateIdVector *path_states
129  );
130 
131 
132 /*======================================================================
133  * Methods: find arcs
134  */
142 
150 
159 
160 
161 /*======================================================================
162  * Methods: find or insert arcs
163  */
173 gfsmStateId gfsm_trie_get_arc_lower(gfsmTrie *trie, gfsmStateId qid, gfsmLabelVal lab, gfsmWeight w, gboolean add_weight);
174 
184 gfsmStateId gfsm_trie_get_arc_upper(gfsmTrie *trie, gfsmStateId qid, gfsmLabelVal lab, gfsmWeight w, gboolean add_weight);
185 
197 
199 
200 
201 #endif /* _GFSM_LOOKUP_H */