Main Page
Related Pages
Data Structures
Files
File List
Globals
src
libgfsm
gfsmEncode.h
Go to the documentation of this file.
1
2
/*=============================================================================*\
3
* File: gfsmEncode.h
4
* Author: Bryan Jurish <moocow.bovine@gmail.com>
5
* Description: finite state machine library: debugging
6
*
7
* Copyright (c) 2014 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_ENCODE_H
29
#define _GFSM_ENCODE_H
30
31
#include <
gfsmAutomaton.h
>
32
#include <
gfsmAlphabet.h
>
33
34
35
/*======================================================================
36
* Types
37
*/
39
40
42
typedef
struct
{
43
gfsmLabelId
lo
;
44
gfsmLabelId
hi
;
45
gfsmWeight
w
;
46
}
gfsmArcLabel
;
47
50
typedef
gfsmAlphabet
gfsmArcLabelKey
;
51
53
54
/*======================================================================
55
* gfsmArcLabel: Methods
56
*/
58
59
61
GFSM_INLINE
62
gfsmArcLabel
*
gfsm_arclabel_new
(
gfsmLabelVal
lo,
gfsmLabelVal
hi,
gfsmWeight
w);
63
65
GFSM_INLINE
66
void
gfsm_arclabel_set
(
gfsmArcLabel
*al,
gfsmLabelVal
lo,
gfsmLabelVal
hi,
gfsmWeight
w);
67
69
GFSM_INLINE
70
gfsmArcLabel
*
gfsm_arclabel_clone
(
gfsmArcLabel
*al);
71
73
GFSM_INLINE
74
void
gfsm_arclabel_free
(
gfsmArcLabel
*al);
75
77
guint
gfsm_arclabel_hash
(
gfsmArcLabel
*al);
78
80
guint
gfsm_arclabel_equal
(
const
gfsmArcLabel
*al1,
const
gfsmArcLabel
*al2);
81
83
84
/*======================================================================
85
* gfsmArcLabelKey
86
*/
88
89
93
GFSM_INLINE
94
gfsmArcLabelKey
*
gfsm_arclabel_key_new
(
void
);
95
97
#define gfsm_arclabel_key_clear gfsm_alphabet_clear
98
100
#define gfsm_arclabel_key_free gfsm_alphabet_free
101
107
gfsmAutomaton
*
gfsm_arclabel_key_to_fsm
(
gfsmArcLabelKey
*key,
gfsmAutomaton
*fsm);
108
114
gfsmArcLabelKey
*
gfsm_arclabel_fsm_to_key
(
gfsmAutomaton
*fsm,
gfsmArcLabelKey
*key);
115
117
118
/*======================================================================
119
* Top-Level Methods
120
*/
122
123
131
gfsmArcLabelKey
*
gfsm_automaton_encode
(
gfsmAutomaton
*fsm,
gfsmArcLabelKey
*key, gboolean encode_labels, gboolean encode_weights);
132
140
gfsmAutomaton
*
gfsm_automaton_decode
(
gfsmAutomaton
*fsm,
gfsmArcLabelKey
*key, gboolean encode_labels, gboolean encode_weights);
141
143
144
//-- inline definitions
145
#ifdef GFSM_INLINE_ENABLED
146
# include <gfsmEncode.hi>
147
#endif
148
149
#endif
/* _GFSM_ENCODE_H */
Generated on Tue Oct 21 2014 09:44:47 for libgfsm by
1.8.1.2