Main Page
Related Pages
Data Structures
Files
File List
Globals
src
libgfsm
gfsmArith.h
Go to the documentation of this file.
1
2
/*=============================================================================*\
3
* File: gfsmArith.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
24
#ifndef _GFSM_ARITH_H
25
#define _GFSM_ARITH_H
26
27
#include <
gfsmAutomaton.h
>
28
33
/*======================================================================
34
* Types
35
*/
37
typedef
enum
{
38
//-- real ops
39
gfsmAONone
,
40
gfsmAOExp
,
41
gfsmAOLog
,
42
gfsmAONoNeg
,
43
gfsmAOAdd
,
44
gfsmAOMult
,
45
//-- semiring ops
46
gfsmAOSRNoNeg
,
47
gfsmAOSRPlus
,
48
gfsmAOSRTimes
49
}
gfsmArithOp
;
50
52
typedef
struct
{
53
gfsmAutomaton
*
fsm
;
54
gfsmArithOp
op
;
55
gfsmWeight
arg
;
56
gboolean
do_zero
;
57
}
gfsmArithParams
;
58
59
60
/*======================================================================
61
* Methods: arithmetic: generic
62
*/
64
65
66
//------------------------------
81
gfsmAutomaton
*
gfsm_automaton_arith
(
gfsmAutomaton
*fsm,
82
gfsmArithOp
op,
83
gfsmWeight
arg,
84
gfsmLabelVal
lo,
85
gfsmLabelVal
hi,
86
gboolean do_arcs,
87
gboolean do_final,
88
gboolean do_zero);
89
90
//------------------------------
106
gfsmAutomaton
*
gfsm_automaton_arith_state
(
gfsmAutomaton
*fsm,
107
gfsmStateId
qid,
108
gfsmArithOp
op,
109
gfsmWeight
arg,
110
gfsmLabelVal
lo,
111
gfsmLabelVal
hi,
112
gboolean do_arcs,
113
gboolean do_final,
114
gboolean do_zero);
115
116
117
//------------------------------
121
gfsmAutomaton
*
gfsm_automaton_arith_final
(
gfsmAutomaton
*fsm,
122
gfsmArithOp
op,
123
gfsmWeight
arg,
124
gboolean do_zero);
125
126
//------------------------------
130
gfsmWeight
gfsm_weight_arith
(
gfsmSemiring
*sr,
131
gfsmArithOp
op,
132
gfsmWeight
w1,
133
gfsmWeight
w2,
134
gboolean do_zero);
135
137
#endif
/* _GFSM_ARITH_H */
Generated on Tue Oct 21 2014 09:44:47 for libgfsm by
1.8.1.2