spot 2.16
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)
 Return the state data for state s.
 
const internal::boxed_label< State_Data >::data_t & state_data (unsigned s) const
 Return the state data for state s.
 
void new_edge (unsigned src, unsigned dst)
 Add a new edge between two states.
 
successor_range out (unsigned state) const
 Return successor range for state.
 
unsigned num_states () const
 Return the number of states.
 
unsigned num_edges () const
 Return the number of edges.
 

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
argsArguments forwarded to each state's data constructor
Returns
The index of the first newly created state

◆ num_edges()

template<class State_Data >
unsigned spot::adjlist< State_Data >::num_edges ( ) const
inline

Return the number of edges.

◆ num_states()

template<class State_Data >
unsigned spot::adjlist< State_Data >::num_states ( ) const
inline

Return the number of states.

◆ out()

template<class State_Data >
successor_range spot::adjlist< State_Data >::out ( unsigned  state) const
inline

Return successor range for state.

◆ state_data() [1/2]

template<class State_Data >
internal::boxed_label< State_Data >::data_t & spot::adjlist< State_Data >::state_data ( unsigned  s)
inline

Return the state data for state s.

◆ state_data() [2/2]

template<class State_Data >
const internal::boxed_label< State_Data >::data_t & spot::adjlist< State_Data >::state_data ( unsigned  s) const
inline

Return the state data for state s.


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