Graph Class Template Reference

Graph. More...

List of all members.

Geometry access

typedef vcsn::geometry< hstate_t,
hedge_t, GeometryCoords > 
geometry_t
geometry_tgeometry ()
const geometry_tgeometry () const

Public Types

typedef Graph< K, WordValue,
WeightValue, SeriesValue,
Letter, Tag, GeometryCoords > 
self_t
 Self type definition.
typedef WeightValue semiring_elt_value_t
typedef WordValue monoid_elt_value_t
typedef WordValue word_value_t
typedef SeriesValue series_set_elt_value_t
typedef Letter letter_t
typedef Tag tag_t
typedef LabelOf< K, WordValue,
WeightValue, SeriesValue,
Letter >::ret 
label_t
 Typedefs on automaton related graphs elements.
typedef unsigned hstate_value_t
typedef unsigned hedge_value_t
typedef handler< state_h,
hstate_value_t
hstate_t
typedef handler< transition_h,
hedge_value_t
htransition_t
typedef htransition_t hedge_t
typedef misc::SparseInterval<
hstate_t, std::set< hstate_t > > 
StateContainer
 Needed containers.
typedef misc::SparseInterval<
hedge_t, std::set< hedge_t > > 
EdgeContainer
typedef state_value state_value_t
typedef edge_value< label_tedge_value_t
typedef std::vector< state_value_tstate_data_t
typedef std::vector< edge_value_tedge_data_t
typedef StateContainer states_t
typedef EdgeContainer edges_t
typedef std::map< hstate_t,
series_set_elt_value_t
initial_t
typedef std::map< hstate_t,
series_set_elt_value_t
final_t
typedef misc::Support< initial_tinitial_support_t
typedef misc::Support< final_tfinal_support_t
typedef ::vcsn::listg::DeltaConstIterator<
self_t, hstate_t,::vcsn::listg::forward_iterator
delta_state_iterator
typedef ::vcsn::listg::DeltaConstIterator<
self_t, htransition_t,::vcsn::listg::forward_iterator
delta_transition_iterator
typedef ::vcsn::listg::DeltaConstIterator<
self_t, hstate_t,::vcsn::listg::backward_iterator
rdelta_state_iterator
typedef ::vcsn::listg::DeltaConstIterator<
self_t, htransition_t,::vcsn::listg::backward_iterator
rdelta_transition_iterator

Public Member Functions

 Graph ()
 Graph (unsigned initial_number_of_state, unsigned number_of_edge_initially_allocated)
states_t states () const
 Return states set.
edges_t edges () const
 Return edges set.
initial_support_t initial () const
 Initial/final state supports.
final_support_t final () const
self_tclone () const
 FIXME: Not implemented.
State's manipulation
hstate_t get_state (int n) const
bool has_state (const hstate_t &n) const
hstate_t add_state ()
void del_state (const hstate_t &n)
 Remove state n.
void set_initial (const hstate_t &s, const series_set_elt_value_t &v, const series_set_elt_value_t &z)
 Change whether a state is initial or not.
const series_set_elt_value_tget_initial (const hstate_t &, const series_set_elt_value_t &) const
bool is_initial (const hstate_t &s, const series_set_elt_value_t &) const
void clear_initial ()
void set_final (const hstate_t &, const series_set_elt_value_t &, const series_set_elt_value_t &)
 Change whether a state is final or not.
const series_set_elt_value_tget_final (const hstate_t &, const series_set_elt_value_t &) const
bool is_final (const hstate_t &s, const series_set_elt_value_t &) const
void clear_final ()
Edge's manipulation
bool has_edge (const hedge_t &n) const
hedge_t add_edge (const hstate_t &h1, const hstate_t &h2, const label_t &v)
void del_edge (const hedge_t &e)
hstate_t src_of (const hedge_t &e1) const
hstate_t dst_of (const hedge_t &e2) const
const label_tlabel_of (const hedge_t &n) const
void update (const hedge_t &, label_t)
Only automaton related methods
template<class S>
bool exists (const AutomataBase< S > &s) const
 Check the consistency of an automata.
template<class OutputIterator, typename Query>
void delta (OutputIterator res, const hstate_t &from, const Query &q,::vcsn::delta_kind::states) const
 Check the consistency of an automata.
template<class OutputIterator, typename Query>
void delta (OutputIterator res, const hstate_t &from, const Query &q,::vcsn::delta_kind::transitions) const
 Check the consistency of an automata.
template<class OutputIterator, typename Query>
void rdelta (OutputIterator res, const hstate_t &from, const Query &q,::vcsn::delta_kind::states) const
 Check the consistency of an automata.
template<class OutputIterator, typename Query>
void rdelta (OutputIterator res, const hstate_t &from, const Query &q,::vcsn::delta_kind::transitions) const
 Check the consistency of an automata.
template<class Functor, typename Query>
void deltaf (Functor &fun, const hstate_t &from, const Query &q,::vcsn::delta_kind::states, misc::true_t) const
 Check the consistency of an automata.
template<class Functor, typename Query>
void deltaf (Functor &fun, const hstate_t &from, const Query &q,::vcsn::delta_kind::states, misc::false_t) const
 Check the consistency of an automata.
template<class Functor, typename Query>
void deltaf (Functor &fun, const hstate_t &from, const Query &q,::vcsn::delta_kind::transitions, misc::true_t) const
 Check the consistency of an automata.
template<class Functor, typename Query>
void deltaf (Functor &fun, const hstate_t &from, const Query &q,::vcsn::delta_kind::transitions, misc::false_t) const
 Check the consistency of an automata.
template<class Functor, typename Query>
void rdeltaf (Functor &fun, const hstate_t &from, const Query &q,::vcsn::delta_kind::states, misc::true_t) const
 Check the consistency of an automata.
template<class Functor, typename Query>
void rdeltaf (Functor &fun, const hstate_t &from, const Query &q,::vcsn::delta_kind::states, misc::false_t) const
 Check the consistency of an automata.
template<class Functor, typename Query>
void rdeltaf (Functor &fun, const hstate_t &from, const Query &q,::vcsn::delta_kind::transitions, misc::true_t) const
 Check the consistency of an automata.
template<class Functor, typename Query>
void rdeltaf (Functor &fun, const hstate_t &from, const Query &q,::vcsn::delta_kind::transitions, misc::false_t) const
 Check the consistency of an automata.
template<class Functor, typename Query, typename DKind>
void deltaf (Functor &fun, const hstate_t &from, const Query &q,::vcsn::delta_kind::kind< DKind >) const
 Check the consistency of an automata.
template<class Functor, typename Query, typename DKind>
void rdeltaf (Functor &fun, const hstate_t &from, const Query &q,::vcsn::delta_kind::kind< DKind >) const
 Check the consistency of an automata.
Tag access
tag_ttag ()
const tag_ttag () const

Public Attributes

geometry_t geometry_
state_data_t states_
edge_data_t edges_
std::set< hstate_tremoved_states_
std::set< hedge_tremoved_edges_
tag_t tag_
final_t final_
initial_t initial_

Classes

struct  edge_value
 Edge decorator. More...
struct  state_value
 State decorator. More...


Detailed Description

template<class K, class WordValue, class WeightValue, class SeriesValue, class Letter, class Tag, class GeometryCoords>
class vcsn::listg::Graph< K, WordValue, WeightValue, SeriesValue, Letter, Tag, GeometryCoords >

Graph.

Definition at line 47 of file listg_graph_impl.hh.


Member Typedef Documentation

typedef misc::SparseInterval<hstate_t, std::set<hstate_t> > StateContainer

Needed containers.

FIXME: How about using std::vector instead of std::set?

Definition at line 105 of file listg_graph_impl.hh.


Member Function Documentation

void del_state ( const hstate_t n  ) 

Remove state n.

Precondition:
n is a state of this graph.

Definition at line 155 of file listg_graph_impl.hxx.

References SparseInterval::begin(), Graph::del_edge(), SparseInterval::end(), Graph::final_, Graph::has_state(), Graph::initial_, Graph::state_value::input_edges, Graph::state_value::output_edges, postcondition, precondition, Graph::removed_states_, and Graph::states_.

void set_initial ( const hstate_t s,
const series_set_elt_value_t v,
const series_set_elt_value_t z 
)

Change whether a state is initial or not.

Parameters:
s the state
v its associated label
z the zero for the labels
Note:
If v == z then state is removed from the set of initial states. Because of this, one cannot simply write
 typename automaton_t::series_set_elt_t some_weight = ...;
 for_all_final_states(f, aut)
   lhs.set_final(*f, aut.get_final(*f) * some_weight);
because if some_weight is equal to z, then the state is removed from the set of final states, and invalidates all the iterators: the loop is broken.

Definition at line 186 of file listg_graph_impl.hxx.

References Graph::has_state(), Graph::initial_, and precondition.

void set_final ( const hstate_t ,
const series_set_elt_value_t ,
const series_set_elt_value_t  
)

Change whether a state is final or not.

Parameters:
s the state
v its associated label
z the zero for the labels
See also:
set_initial().

Definition at line 223 of file listg_graph_impl.hxx.

References Graph::final_, Graph::has_state(), and precondition.


Generated on Thu Oct 9 20:26:00 2008 for Vaucanson by  doxygen 1.5.1