gfsmIndexed.h
Go to the documentation of this file.
1 
2 /*=============================================================================*\
3  * File: gfsmIndexed.h
4  * Author: Bryan Jurish <moocow.bovine@gmail.com>
5  * Description: finite state machine library: arc indices
6  *
7  * Copyright (c) 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_INDEXED_H
29 #define _GFSM_INDEXED_H
30 
31 #include <gfsmArcIndex.h>
32 
33 /*======================================================================
34  * Types
35  */
36 
38 typedef struct {
39  //-- gfsmAutomaton compatibility
43  //
44  //-- Basic data
45  //gfsmBitVector *state_is_valid; /* per-state validity flags */
49 
50 /*======================================================================
51  * Methods: gfsmIndexedAutomaton: constructors, etc.
52  */
54 
55 
59  gfsmSRType srtype,
60  gfsmStateId n_states,
61  guint n_arcs);
62 
66 
69 
73 
77 
81 
83 
84 /*======================================================================
85  * Methods: Import & Export
86  */
88 
89 
98 
107 
109 
110 /*======================================================================
111  * Methods: Accessors: gfsmIndexedAutomaton
112  */
114 
115 
119 
123 
127 
129 
130 /*======================================================================
131  * gfsmAutomaton API: Automaton properties
132  */
134 
135 
137 #define gfsm_indexed_automaton_get_semiring(xfsm) (xfsm->sr)
138 
142 
146 
150 
154 
158 
162 
164 
165 /*======================================================================
166  * Methods: Accessors: gfsmAutomaton API: States
167  */
169 
170 
174 
178 
179 /* Remove the state with id \a qid, if any.
180  * Currently does nothing.
181  */
184 
186 #define gfsm_indexed_automaton_set_final_state(xfsm,qid,is_final) \
187  gfsm_indexed_automaton_set_final_state_full((xfsm),(qid),(is_final),(xfsm)->sr->one)
188 
192  gfsmStateId qid,
193  gboolean is_final,
194  gfsmWeight final_weight);
195 
199 
203 
207 
211 
213 
214 /*======================================================================
215  * ArcRange
216  */
218 
219 
223 
225 
226 //-- inline definitions
227 #ifdef GFSM_INLINE_ENABLED
228 # include <gfsmIndexed.hi>
229 #endif
230 
231 #endif /* _GFSM_INDEXED_H */