spot 2.15
Loading...
Searching...
No Matches
Classes | Public Member Functions | List of all members
spot::adjlist< State_Data > Class Template Reference

A compact adjacency list representation for directed graphs. More...

#include <spot/graph/adjlist.hh>

Inheritance diagram for spot::adjlist< State_Data >:
Collaboration diagram for spot::adjlist< State_Data >:

Classes

class  successor_iterator
 Iterator for traversing successors of a state. More...
 
class  successor_range
 Range wrapper for successor iteration. More...
 

Public Member Functions

 adjlist (unsigned max_states=10, unsigned max_trans=0)
 Constructor for adjacency list.
 
template<typename... Args>
unsigned new_state (Args &&... args)
 Create a new state with given data.
 
template<typename... Args>
unsigned new_states (unsigned n, Args &&... args)
 Create multiple new states with the same data.
 
internal::boxed_label< State_Data >::data_t & state_data (unsigned s)
 
const internal::boxed_label< State_Data >::data_t & state_data (unsigned s) const
 
void new_edge (unsigned src, unsigned dst)
 Add a new edge between two states.
 
successor_range out (unsigned state) const
 
unsigned num_states () const
 
unsigned num_edges () const
 

Detailed Description

template<class State_Data>
class spot::adjlist< State_Data >

A compact adjacency list representation for directed graphs.

This class works almost like a digraph, but it does not support removal of edges, does not support data on edges, prepend edges instead of appending them, and only stores the destinations of edges, not their source. So this is a more compact memory representation.

Constructor & Destructor Documentation

◆ adjlist()

template<class State_Data >
spot::adjlist< State_Data >::adjlist ( unsigned  max_states = 10,
unsigned  max_trans = 0 
)
inline

Constructor for adjacency list.

Parameters
max_statesInitial capacity for states vector
max_transInitial capacity for edges vector (default: max_states * 2)

References spot::U.

Member Function Documentation

◆ new_edge()

template<class State_Data >
void spot::adjlist< State_Data >::new_edge ( unsigned  src,
unsigned  dst 
)
inline

Add a new edge between two states.

Parameters
srcSource state index
dstDestination state index

◆ new_state()

template<class State_Data >
template<typename... Args>
unsigned spot::adjlist< State_Data >::new_state ( Args &&...  args)
inline

Create a new state with given data.

Returns
The index of the newly created state

◆ new_states()

template<class State_Data >
template<typename... Args>
unsigned spot::adjlist< State_Data >::new_states ( unsigned  n,
Args &&...  args 
)
inline

Create multiple new states with the same data.

Parameters
nNumber of states to create
Returns
The index of the first newly created state

The documentation for this class was generated from the following file:

Please direct any question, comment, or bug report to the Spot mailing list at spot@lrde.epita.fr.
Generated on Fri Feb 27 2015 10:00:07 for spot by doxygen 1.9.8