twa: introduce the state_map template alias

* spot/twa/twa.hh: Introduce the type.
* spot/taalgos/emptinessta.cc, spot/taalgos/emptinessta.hh,
spot/taalgos/minimize.cc, spot/taalgos/reachiter.cc,
spot/taalgos/reachiter.hh, spot/taalgos/tgba2ta.cc,
spot/twa/twasafracomplement.cc, spot/twaalgos/dtwasat.cc,
spot/twaalgos/emptiness.cc, spot/twaalgos/gtec/status.cc,
spot/twaalgos/gtec/status.hh, spot/twaalgos/gv04.cc,
spot/twaalgos/magic.cc, spot/twaalgos/minimize.cc,
spot/twaalgos/minimize.hh, spot/twaalgos/reachiter.cc,
spot/twaalgos/reachiter.hh, spot/twaalgos/se05.cc,
spot/twaalgos/tau03.cc, spot/twaalgos/tau03opt.cc: Use it.
This commit is contained in:
Alexandre Duret-Lutz 2016-01-28 13:15:48 +01:00
parent 6230f320bf
commit 9b95b697a5
21 changed files with 89 additions and 117 deletions

View file

@ -172,9 +172,20 @@ namespace spot
}
};
/// \brief Unordered set of abstract states
///
/// Destroying each state if needed is the user's responsibility.
///
/// \see state_unicity_table
typedef std::unordered_set<const state*,
state_ptr_hash, state_ptr_equal> state_set;
/// \brief Unordered map of abstract states
///
/// Destroying each state if needed is the user's responsibility.
template<class val>
using state_map = std::unordered_map<const state*, val,
state_ptr_hash, state_ptr_equal>;
/// \ingroup twa_essentials
/// \brief Render state pointers unique via a hash table.
@ -270,7 +281,7 @@ namespace spot
/// (shared_ptr<const state*>).
///
/// This is meant to be used as a comparison functor for
/// un \c unordered_map whose key are of type \c shared_state.
/// an \c unordered_map whose key are of type \c shared_state.
///
/// For instance here is how one could declare
/// a map of \c shared_state
@ -280,6 +291,8 @@ namespace spot
/// state_shared_ptr_hash,
/// state_shared_ptr_equal> seen;
/// \endcode
///
/// \see shared_state_set
struct state_shared_ptr_equal
{
bool
@ -307,6 +320,8 @@ namespace spot
/// state_shared_ptr_hash,
/// state_shared_ptr_equal> seen;
/// \endcode
///
/// \see shared_state_set
struct state_shared_ptr_hash
{
size_t
@ -317,6 +332,7 @@ namespace spot
}
};
/// Unordered set of shared states
typedef std::unordered_set<shared_state,
state_shared_ptr_hash,
state_shared_ptr_equal> shared_state_set;

View file

@ -1,6 +1,6 @@
// -*- coding: utf-8 -*-
// Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014, 2015 Laboratoire
// de Recherche et Développement de l'Epita (LRDE).
// Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016
// Laboratoire de Recherche et Développement de l'Epita (LRDE).
//
// This file is part of Spot, a model checking library.
//
@ -719,8 +719,7 @@ namespace spot
//////////////////////////////
namespace test
{
typedef std::unordered_map<const state*, int,
state_ptr_hash, state_ptr_equal> stnum_t;
typedef state_map<int> stnum_t;
void print_safra_tree(const safra_tree* this_node,
stnum_t& node_names,