Data Structures
gfsmEncode.h File Reference

Arc-label and/or -weight encoding utilities. More...

#include <gfsmAutomaton.h>
#include <gfsmAlphabet.h>
#include <gfsmEncode.hi>
Include dependency graph for gfsmEncode.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  gfsmArcLabel
 Weighted pair of gfsmLabelId , used by gfsm_automaton_encode() More...

Typedefs

Types
typedef gfsmAlphabet gfsmArcLabelKey

Functions

gfsmArcLabel Methods
static gfsmArcLabelgfsm_arclabel_new (gfsmLabelVal lo, gfsmLabelVal hi, gfsmWeight w)
static void gfsm_arclabel_set (gfsmArcLabel *al, gfsmLabelVal lo, gfsmLabelVal hi, gfsmWeight w)
static gfsmArcLabelgfsm_arclabel_clone (gfsmArcLabel *al)
static void gfsm_arclabel_free (gfsmArcLabel *al)
guint gfsm_arclabel_hash (gfsmArcLabel *al)
guint gfsm_arclabel_equal (const gfsmArcLabel *al1, const gfsmArcLabel *al2)
Top-Level Methods
gfsmArcLabelKeygfsm_automaton_encode (gfsmAutomaton *fsm, gfsmArcLabelKey *key, gboolean encode_labels, gboolean encode_weights)
gfsmAutomatongfsm_automaton_decode (gfsmAutomaton *fsm, gfsmArcLabelKey *key, gboolean encode_labels, gboolean encode_weights)

gfsmArcLabelKey Methods

#define gfsm_arclabel_key_clear   gfsm_alphabet_clear
#define gfsm_arclabel_key_free   gfsm_alphabet_free
static gfsmArcLabelKeygfsm_arclabel_key_new (void)
gfsmAutomatongfsm_arclabel_key_to_fsm (gfsmArcLabelKey *key, gfsmAutomaton *fsm)
gfsmArcLabelKeygfsm_arclabel_fsm_to_key (gfsmAutomaton *fsm, gfsmArcLabelKey *key)

Detailed Description

Macro Definition Documentation

#define gfsm_arclabel_key_clear   gfsm_alphabet_clear

Alias

See Also
gfsm_alphabet_clear()
#define gfsm_arclabel_key_free   gfsm_alphabet_free

Alias;

See Also
gfsm_alphabet_free()

Typedef Documentation

Typedef for mapping (gfsmArcLabel)s to and/or from atomic (gfsmLabelVal)s, used by gfsm_automaton_encode(). Really implemented as a ::gfsmPointerKey

Function Documentation

static gfsmArcLabel* gfsm_arclabel_new ( gfsmLabelVal  lo,
gfsmLabelVal  hi,
gfsmWeight  w 
)
inlinestatic

Create a ::gsfmArcLabel

static void gfsm_arclabel_set ( gfsmArcLabel al,
gfsmLabelVal  lo,
gfsmLabelVal  hi,
gfsmWeight  w 
)
inlinestatic

Assign values to a ::gsfmArcLabel , like *al={lo,hi,w}

static gfsmArcLabel* gfsm_arclabel_clone ( gfsmArcLabel al)
inlinestatic

Clone an existing gfsmArcLabel

static void gfsm_arclabel_free ( gfsmArcLabel al)
inlinestatic

Free a gfsmArcLabel

guint gfsm_arclabel_hash ( gfsmArcLabel al)

Hash function alias for gfsmArcLabel

guint gfsm_arclabel_equal ( const gfsmArcLabel al1,
const gfsmArcLabel al2 
)

Equal function alias for gfsmArcLabel

static gfsmArcLabelKey* gfsm_arclabel_key_new ( void  )
inlinestatic

create a new gfsmArcLabelKey (copies & frees keys)

See Also
gfsmPointerAlphabet
gfsmAutomaton* gfsm_arclabel_key_to_fsm ( gfsmArcLabelKey key,
gfsmAutomaton fsm 
)

Convert a gfsmArcLabelKey to a gfsmAutomaton "key", a la fsmencode(1)

Parameters
keylabel-pair enumeration to be converted
fsmoutput automaton, may be passed as NULL to create a new automaton
Returns
fsm representing key
gfsmArcLabelKey* gfsm_arclabel_fsm_to_key ( gfsmAutomaton fsm,
gfsmArcLabelKey key 
)

Convert a gfsmAutomaton "key" to a gfsmArcLabelKey , a la fsmencode(1) in decoding mode.

Parameters
fsminput "key" automaton
keyoutput label-pair enumeration, may be passed as NULL to create a new one
Returns
key represented by fsm
gfsmArcLabelKey* gfsm_automaton_encode ( gfsmAutomaton fsm,
gfsmArcLabelKey key,
gboolean  encode_labels,
gboolean  encode_weights 
)

Encode arc-labels and/or weights to a gfsmArcLabelKey

Parameters
fsmautomaton to encode (destructively altered)
keystores label-pair enumeration, may be passed as NULL to allocate a new enum
encode_labelswhether to encode labels
encode_weightswhether to encode weights
Returns
key or new enum
gfsmAutomaton* gfsm_automaton_decode ( gfsmAutomaton fsm,
gfsmArcLabelKey key,
gboolean  encode_labels,
gboolean  encode_weights 
)

Decode arc-labels and/or weights as specified in a gfsmArcLabelKey in an automaton fsm

Parameters
fsmencoded automaton to decode (destructively altered)
keystores label-pair enumeration
decode_labelswhether to decode labels
decode_weightswhether to decode weights
Returns
decoded fsm