spot  1.2.1a
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Classes | Public Types | Public Member Functions | Protected Types | Protected Attributes | List of all members
spot::setOfDisjointSetsIPC_LRPC_MS_Dead Class Reference

this class propose an union find based on a deadstore. The idea is to used a dedicated map for the storage of dead state but this storage is done in a lazy way. A counter maintain the realsize of the union find structure when a make dead is realized : this is possible with the assumption that make dead is performed on the dfs root of the SCC. So the structure maintain the real size of the structure which is the size of Alive states. Adding a new state only checks if this size is the size of the structure to avoid extra memory allocation. If it is not true this means that there are dead states insides the alive structure. Just pick one a insert it inside the dead store. Otherwise it's a classic insert. More...

#include <fasttgbaalgos/ec/union_find.hh>

Inheritance diagram for spot::setOfDisjointSetsIPC_LRPC_MS_Dead:
Inheritance graph
Collaboration diagram for spot::setOfDisjointSetsIPC_LRPC_MS_Dead:
Collaboration graph

Public Types

enum  color { Alive, Dead, Unknown }
 The color for a new State. More...
 

Public Member Functions

 setOfDisjointSetsIPC_LRPC_MS_Dead (acc_dict &acc)
 
virtual bool add (const fasttgba_state *e)
 Add a partition that contains only s Suppose a clone() has been done and the union-find is in charge to perform the destroy() More...
 
virtual unsigned int size ()
 The current size of the union find. More...
 
virtual unsigned int dead_size ()
 
virtual void unite (const fasttgba_state *e1, const fasttgba_state *e2)
 Perform the union of the two partition containing left and right. No assumptions over the resulting parent can be do. More...
 
virtual void make_dead (const fasttgba_state *e)
 perform a union with dead More...
 
virtual bool contains (const fasttgba_state *e)
 Return wether a state belong to the Union-Find structure. More...
 
virtual bool same_partition (const fasttgba_state *e1, const fasttgba_state *e2)
 Return true if the partition of left is the same that the partition of right. More...
 
virtual bool is_dead (const fasttgba_state *e)
 check wether the root of the set containing this scc is dead. More...
 
int nbPart () const
 
int maxDepth () const
 
int maxPart () const
 
void clear ()
 
virtual void add_acc (const fasttgba_state *, markset)
 Add the acceptance set to the partition that contains the state s. More...
 
virtual markset get_acc (const fasttgba_state *)
 return the acceptance set of the partition containing s More...
 
virtual color get_color (const fasttgba_state *)
 
virtual int max_alive ()
 
virtual int max_dead ()
 

Protected Types

typedef Sgi::hash_map< const
fasttgba_state *, int,
fasttgba_state_ptr_hash,
fasttgba_state_ptr_equal
uf_map
 

Protected Attributes

std::vector< int > idneg
 For each element store the id of the parent. More...
 
std::vector< markset * > accp
 Acceptance associated to each element. More...
 
acc_dictacc_
 The acceptance dictionary. More...
 
markset empty
 Avoid to re-create some elements. More...
 

Detailed Description

this class propose an union find based on a deadstore. The idea is to used a dedicated map for the storage of dead state but this storage is done in a lazy way. A counter maintain the realsize of the union find structure when a make dead is realized : this is possible with the assumption that make dead is performed on the dfs root of the SCC. So the structure maintain the real size of the structure which is the size of Alive states. Adding a new state only checks if this size is the size of the structure to avoid extra memory allocation. If it is not true this means that there are dead states insides the alive structure. Just pick one a insert it inside the dead store. Otherwise it's a classic insert.

Note that this class doesn't support contains since get_color is the most efficient way to check wheter a state is available

Member Enumeration Documentation

enum spot::union_find::color
inherited

The color for a new State.

Member Function Documentation

virtual bool spot::setOfDisjointSetsIPC_LRPC_MS_Dead::add ( const fasttgba_state s)
virtual

Add a partition that contains only s Suppose a clone() has been done and the union-find is in charge to perform the destroy()

Reimplemented from spot::union_find.

virtual void spot::setOfDisjointSetsIPC_LRPC_MS_Dead::add_acc ( const fasttgba_state s,
markset  m 
)
virtual

Add the acceptance set to the partition that contains the state s.

Reimplemented from spot::union_find.

virtual bool spot::setOfDisjointSetsIPC_LRPC_MS_Dead::contains ( const fasttgba_state s)
virtual

Return wether a state belong to the Union-Find structure.

Reimplemented from spot::union_find.

virtual markset spot::setOfDisjointSetsIPC_LRPC_MS_Dead::get_acc ( const fasttgba_state s)
virtual

return the acceptance set of the partition containing s

Reimplemented from spot::union_find.

virtual bool spot::setOfDisjointSetsIPC_LRPC_MS_Dead::is_dead ( const fasttgba_state s)
virtual

check wether the root of the set containing this scc is dead.

Reimplemented from spot::union_find.

virtual void spot::setOfDisjointSetsIPC_LRPC_MS_Dead::make_dead ( const fasttgba_state s)
virtual

perform a union with dead

Reimplemented from spot::union_find.

virtual int spot::setOfDisjointSetsIPC_LRPC_MS_Dead::max_alive ( )
virtual

The size of alive elements i-e elements stored in the union find.

Reimplemented from spot::union_find.

virtual int spot::setOfDisjointSetsIPC_LRPC_MS_Dead::max_dead ( )
virtual

The size of dead elements i-e elements stored outside the union find

Reimplemented from spot::union_find.

virtual bool spot::setOfDisjointSetsIPC_LRPC_MS_Dead::same_partition ( const fasttgba_state left,
const fasttgba_state right 
)
virtual

Return true if the partition of left is the same that the partition of right.

Reimplemented from spot::union_find.

virtual unsigned int spot::setOfDisjointSetsIPC_LRPC_MS_Dead::size ( )
virtual

The current size of the union find.

Reimplemented from spot::union_find.

virtual void spot::setOfDisjointSetsIPC_LRPC_MS_Dead::unite ( const fasttgba_state left,
const fasttgba_state right 
)
virtual

Perform the union of the two partition containing left and right. No assumptions over the resulting parent can be do.

Reimplemented from spot::union_find.

Member Data Documentation

acc_dict& spot::union_find::acc_
protectedinherited

The acceptance dictionary.

std::vector<markset *> spot::union_find::accp
protectedinherited

Acceptance associated to each element.

markset spot::union_find::empty
protectedinherited

Avoid to re-create some elements.

std::vector<int> spot::union_find::idneg
protectedinherited

For each element store the id of the parent.


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 Tue Jan 21 2014 16:52:02 for spot by doxygen 1.8.5