Main Page | Modules | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

spot::numbered_state_heap_hash_map Class Reference

A straightforward implementation of numbered_state_heap with a hash map. More...

#include <tgbaalgos/gtec/nsheap.hh>

Inheritance diagram for spot::numbered_state_heap_hash_map:

Inheritance graph
[legend]
Collaboration diagram for spot::numbered_state_heap_hash_map:

Collaboration graph
[legend]
List of all members.

Public Types

typedef Sgi::hash_map< const
state *, int, state_ptr_hash,
state_ptr_equal
hash_type
typedef std::pair< const state *,
int * > 
state_index_p
typedef std::pair< const state *,
int > 
state_index

Public Member Functions

virtual ~numbered_state_heap_hash_map ()
virtual state_index find (const state *s) const
 Is state in the heap?
virtual state_index_p find (const state *s)
virtual state_index index (const state *s) const
 Return the index of an existing state.
virtual state_index_p index (const state *s)
virtual int & index_and_insert (const state *&s)
 Get the index of a state, and insert that state if it is missing.
virtual void insert (const state *s, int index)
 Add a new state s with index index.
virtual int size () const
 The number of stored states.
virtual numbered_state_heap_const_iteratoriterator () const
 Return an iterator on the states/indexes pairs.

Protected Attributes

hash_type h
 Map of visited states.

Detailed Description

A straightforward implementation of numbered_state_heap with a hash map.


Member Typedef Documentation

typedef Sgi::hash_map<const state*, int, state_ptr_hash, state_ptr_equal> spot::numbered_state_heap_hash_map::hash_type
 

typedef std::pair<const state*, int> spot::numbered_state_heap::state_index [inherited]
 

typedef std::pair<const state*, int*> spot::numbered_state_heap::state_index_p [inherited]
 


Constructor & Destructor Documentation

virtual spot::numbered_state_heap_hash_map::~numbered_state_heap_hash_map  )  [virtual]
 


Member Function Documentation

virtual state_index_p spot::numbered_state_heap_hash_map::find const state s  )  [virtual]
 

Implements spot::numbered_state_heap.

virtual state_index spot::numbered_state_heap_hash_map::find const state s  )  const [virtual]
 

Is state in the heap?

Returns a pair (0,0) if s is not in the heap. or a pair (p, i) if there is a clone p of s i in the heap with index. If s is in the heap and is different from p it will be freed.

These functions are called by the algorithm to check whether a successor is a new state to explore or an already visited state.

These functions can be redefined to search for more than an equal match. For example we could redefine it to check state inclusion.

Implements spot::numbered_state_heap.

virtual state_index_p spot::numbered_state_heap_hash_map::index const state s  )  [virtual]
 

Implements spot::numbered_state_heap.

virtual state_index spot::numbered_state_heap_hash_map::index const state s  )  const [virtual]
 

Return the index of an existing state.

This is mostly similar to find(), except it will be called for state which we know are already in the heap, or for state which may not be in the heap but for which it is always OK to do equality checks.

Implements spot::numbered_state_heap.

virtual int& spot::numbered_state_heap_hash_map::index_and_insert const state *&  s  )  [virtual]
 

Get the index of a state, and insert that state if it is missing.

If a clone of s is already in the hash table, s will be deleted and replaced by the address of the clone used.

Implements spot::numbered_state_heap.

virtual void spot::numbered_state_heap_hash_map::insert const state s,
int  index
[virtual]
 

Add a new state s with index index.

Implements spot::numbered_state_heap.

virtual numbered_state_heap_const_iterator* spot::numbered_state_heap_hash_map::iterator  )  const [virtual]
 

Return an iterator on the states/indexes pairs.

Implements spot::numbered_state_heap.

virtual int spot::numbered_state_heap_hash_map::size  )  const [virtual]
 

The number of stored states.

Implements spot::numbered_state_heap.


Member Data Documentation

hash_type spot::numbered_state_heap_hash_map::h [protected]
 

Map of visited states.


The documentation for this class was generated from the following file:
Please comment this page and report errors about it on the RefDocComments page.
Generated on Mon Jan 31 12:55:54 2005 for spot by doxygen 1.4.0