UnCoVer (Using Coverability for Verification)
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
MinGraphList.h
1 /***************************************************************************
2  * Copyright (C) 2014 by Jan Stückrath <jan.stueckrath@uni-due.de> *
3  * *
4  * This program is free software; you can redistribute it and/or modify *
5  * it under the terms of the GNU General Public License as published by *
6  * the Free Software Foundation; either version 2 of the License, or *
7  * (at your option) any later version. *
8  * *
9  * This program is distributed in the hope that it will be useful, *
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12  * GNU General Public License for more details. *
13  * *
14  * You should have received a copy of the GNU General Public License *
15  * along with this program; if not, write to the *
16  * Free Software Foundation, Inc., *
17  * 51 Franklin St, Fifth Floor, Boston, MA 02110, USA *
18  ***************************************************************************/
19 
20 #ifndef MINIMALGRAPHLIST_H_
21 #define MINIMALGRAPHLIST_H_
22 
23 #include "../basic_types/Order.h"
24 #include "../analysis/BackwardResultHandler.h"
25 
26 namespace uncover {
27  namespace graphs {
28 
36  class MinGraphList {
37 
38  public:
39 
48 
52  virtual ~MinGraphList();
53 
59  shared_ptr<vector<Hypergraph_sp>> getGraphs();
60 
68  bool addGraph(Hypergraph_sp graph, shared_ptr<vector<Hypergraph_sp>> deletedGraphs = nullptr);
69 
76  size_t addGraphs(vector<Hypergraph_sp> const& graphs);
77 
82  size_t size() const;
83 
89  bool contains(IDType graphID) const;
90 
91  private:
92 
97 
101  shared_ptr<vector<graphs::Hypergraph_sp>> graphs;
102 
107 
111  unordered_set<IDType> idsInList;
112 
113  };
114 
115  } /* namespace graphs */
116 } /* namespace uncover */
117 
118 #endif /* MINIMALGRAPHLIST_H_ */
size_t addGraphs(vector< Hypergraph_sp > const &graphs)
Adds the given collection of graphs to this MinGraphList.
Definition: MinGraphList.cpp:91
basic_types::Order_sp order
Stores the Order used for minimization.
Definition: MinGraphList.h:96
size_t size() const
Returns the number of minimal graphs stored in this list.
Definition: MinGraphList.cpp:101
MinGraphList(basic_types::Order_sp order, analysis::BackwardResultHandler_sp resHandler=nullptr)
Generates a new MinGraphList using the given Order for minimization and the given BackwardResultHandl...
Definition: MinGraphList.cpp:33
unordered_set< IDType > idsInList
Caches all IDs of graphs currently stored in this list.
Definition: MinGraphList.h:111
shared_ptr< BackwardResultHandler > BackwardResultHandler_sp
Alias for a shared pointer to a BackwardResultHandler.
Definition: BackwardResultHandler.h:105
This data structure stores a collection of graphs minimal to some given order.
Definition: MinGraphList.h:36
shared_ptr< vector< graphs::Hypergraph_sp > > graphs
Stores the minimal graphs.
Definition: MinGraphList.h:101
virtual ~MinGraphList()
Destroys this MinGraphList.
Definition: MinGraphList.cpp:40
shared_ptr< vector< Hypergraph_sp > > getGraphs()
Returns the minimal graphs stores in this MinGraphList as a vector of Hypergraphs.
Definition: MinGraphList.cpp:42
analysis::BackwardResultHandler_sp resHandler
Stores the BackwardResultHandler for handling intermediate results.
Definition: MinGraphList.h:106
shared_ptr< Order > Order_sp
Alias for a shared pointer to an Order object.
Definition: Order.h:62
bool addGraph(Hypergraph_sp graph, shared_ptr< vector< Hypergraph_sp >> deletedGraphs=nullptr)
Adds the given graph to this MinGraphList, if there is no graph already in the list which is smaller ...
Definition: MinGraphList.cpp:46
bool contains(IDType graphID) const
Checks whether a graph with the given ID is stored in this list.
Definition: MinGraphList.cpp:105
unsigned int IDType
IDType is an (unsigned) integer specifically used as an Identifier of graphs, elements of graphs or a...
Definition: globals.h:53
shared_ptr< Hypergraph > Hypergraph_sp
Alias for a shared pointer to a Hypergraph.
Definition: Hypergraph.h:85