From 8c83c8a81eab076729e3ad9e497b9f09cea29bd6 Mon Sep 17 00:00:00 2001 From: Alexandre Duret-Lutz Date: Mon, 19 Jan 2015 18:16:23 +0100 Subject: [PATCH] dupexp: remove the version that fills a vector Fixes #45. * src/tgbaalgos/dupexp.cc, src/tgbaalgos/dupexp.hh: Remove unused code. --- src/tgbaalgos/dupexp.cc | 58 ++--------------------------------------- src/tgbaalgos/dupexp.hh | 22 +--------------- 2 files changed, 3 insertions(+), 77 deletions(-) diff --git a/src/tgbaalgos/dupexp.cc b/src/tgbaalgos/dupexp.cc index 6d17d2641..37fd19704 100644 --- a/src/tgbaalgos/dupexp.cc +++ b/src/tgbaalgos/dupexp.cc @@ -1,6 +1,6 @@ // -*- coding: utf-8 -*- -// Copyright (C) 2009, 2011, 2012, 2014 Laboratoire de Recherche et -// Développement de l'Epita (LRDE). +// Copyright (C) 2009, 2011, 2012, 2014, 2015 Laboratoire de Recherche +// et Développement de l'Epita (LRDE). // Copyright (C) 2003, 2004 Laboratoire d'Informatique de Paris 6 (LIP6), // département Systèmes Répartis Coopératifs (SRC), Université Pierre // et Marie Curie. @@ -72,28 +72,6 @@ namespace spot tgba_digraph_ptr out_; }; - template - class dupexp_iter_save: public dupexp_iter - { - public: - dupexp_iter_save(const const_tgba_ptr& a, - tgba::prop_set p, - std::vector& relation) - : dupexp_iter(a, p), relation_(relation) - { - } - - virtual void - end() - { - relation_.resize(this->seen.size()); - for (auto s: this->seen) - relation_[s.second - 1] = const_cast(s.first); - } - - std::vector& relation_; - }; - } // anonymous tgba_digraph_ptr @@ -111,36 +89,4 @@ namespace spot di.run(); return di.result(); } - - tgba_digraph_ptr - tgba_dupexp_bfs(const const_tgba_ptr& aut, tgba::prop_set p, - std::vector& rel) - { - dupexp_iter_save di(aut, p, rel); - di.run(); - return di.result(); - } - - tgba_digraph_ptr - tgba_dupexp_dfs(const const_tgba_ptr& aut, tgba::prop_set p, - std::vector& rel) - { - auto aa = std::dynamic_pointer_cast(aut); - if (aa) - { - aa->get_init_state_number(); // Create an initial state if needed. - auto res = make_tgba_digraph(aa, p); - unsigned ns = aa->num_states(); - rel.reserve(ns); - // The state numbers are common to both automata, but - // the state pointers are to the older one. - for (unsigned n = 0; n < ns; ++n) - rel.push_back(aa->state_from_number(n)); - return res; - } - - dupexp_iter_save di(aut, p, rel); - di.run(); - return di.result(); - } } diff --git a/src/tgbaalgos/dupexp.hh b/src/tgbaalgos/dupexp.hh index 7ddbe4492..18fabb560 100644 --- a/src/tgbaalgos/dupexp.hh +++ b/src/tgbaalgos/dupexp.hh @@ -1,5 +1,5 @@ // -*- coding: utf-8 -*- -// Copyright (C) 2012, 2013, 2014 Laboratoire de Recherche et +// Copyright (C) 2012, 2013, 2014, 2015 Laboratoire de Recherche et // Développement de l'Epita (LRDE). // Copyright (C) 2003, 2004, 2005 Laboratoire d'Informatique de Paris // 6 (LIP6), département Systèmes Répartis Coopératifs (SRC), @@ -40,26 +40,6 @@ namespace spot /// numbering states in depth first order as they are processed. SPOT_API tgba_digraph_ptr tgba_dupexp_dfs(const const_tgba_ptr& aut, tgba::prop_set p); - - /// \ingroup tgba_misc - /// \brief Build an explicit automaton from all states of \a aut, - /// numbering states in bread first order as they are processed. - /// \a aut the automaton to duplicate - /// \a relation a map of all the new states (represented by - /// their number) to the old states. - SPOT_API tgba_digraph_ptr - tgba_dupexp_bfs(const const_tgba_ptr& aut, tgba::prop_set p, - std::vector& relation); - - /// \ingroup tgba_misc - /// \brief Build an explicit automata from all states of \a aut, - /// numbering states in depth first order as they are processed. - /// \a aut the automaton to duplicate - /// \a relation a map of all the new states (represented by - /// their number) to the old states. - SPOT_API tgba_digraph_ptr - tgba_dupexp_dfs(const const_tgba_ptr& aut, tgba::prop_set p, - std::vector& relation); } #endif // SPOT_TGBAALGOS_DUPEXP_HH