PandA-2024.02
check_clique.hpp
Go to the documentation of this file.
1 /*
2  *
3  * _/_/_/ _/_/ _/ _/ _/_/_/ _/_/
4  * _/ _/ _/ _/ _/_/ _/ _/ _/ _/ _/
5  * _/_/_/ _/_/_/_/ _/ _/_/ _/ _/ _/_/_/_/
6  * _/ _/ _/ _/ _/ _/ _/ _/ _/
7  * _/ _/ _/ _/ _/ _/_/_/ _/ _/
8  *
9  * ***********************************************
10  * PandA Project
11  * URL: http://panda.dei.polimi.it
12  * Politecnico di Milano - DEIB
13  * System Architectures Group
14  * ***********************************************
15  * Copyright (C) 2004-2024 Politecnico di Milano
16  *
17  * This file is part of the PandA framework.
18  *
19  * The PandA framework is free software; you can redistribute it and/or modify
20  * it under the terms of the GNU General Public License as published by
21  * the Free Software Foundation; either version 3 of the License, or
22  * (at your option) any later version.
23  *
24  * This program is distributed in the hope that it will be useful,
25  * but WITHOUT ANY WARRANTY; without even the implied warranty of
26  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27  * GNU General Public License for more details.
28  *
29  * You should have received a copy of the GNU General Public License
30  * along with this program. If not, see <http://www.gnu.org/licenses/>.
31  *
32  */
38 #ifndef CHECK_CLIQUE_HPP
39 #define CHECK_CLIQUE_HPP
40 
42 #include "filter_clique.hpp"
43 
44 template <typename vertex_type>
46 {
47  virtual ~check_clique() = default;
48 
49  virtual bool check_edge_compatibility(C_vertex& rep, C_vertex& other) = 0;
50 
51  virtual bool check_no_mux_needed(C_vertex& rep, C_vertex& other) = 0;
52 
53  virtual check_clique* clone() const = 0;
54 
55  virtual double cost(size_t clique_count) = 0;
56 
57  virtual size_t num_mux() = 0;
58 
59  virtual void update_after_join(C_vertex&, C_vertex&) = 0;
60 
62 };
63 
64 template <typename vertex_type>
65 struct no_check_clique : public check_clique<vertex_type>
66 {
68  {
69  return true;
70  }
72  {
73  return true;
74  }
75  no_check_clique* clone() const override
76  {
77  return new no_check_clique(*this);
78  }
79  double cost(size_t clique_count) override
80  {
81  return static_cast<double>(clique_count);
82  }
83  size_t num_mux() override
84  {
85  return 0;
86  }
88  {
89  }
91  {
92  }
93 };
94 
95 #endif
virtual bool check_edge_compatibility(C_vertex &rep, C_vertex &other)=0
virtual ~check_clique()=default
bool check_edge_compatibility(C_vertex &, C_vertex &) override
bool check_no_mux_needed(C_vertex &, C_vertex &) override
virtual void update_after_join(C_vertex &, C_vertex &)=0
boost::adjacency_matrix< boost::undirectedS, boost::property< boost::vertex_index_t, std::size_t >, edge_compatibility_selector > boost_cc_compatibility_graph
bulk compatibility graph
virtual bool check_no_mux_needed(C_vertex &rep, C_vertex &other)=0
absl::flat_hash_map< T, U, Hash, Eq, Alloc > CustomUnorderedMap
Definition: custom_map.hpp:148
virtual double cost(size_t clique_count)=0
double cost(size_t clique_count) override
virtual check_clique * clone() const =0
void initialize_structures(boost_cc_compatibility_graph &, CustomUnorderedMap< C_vertex, vertex_type > &) override
size_t num_mux() override
virtual void initialize_structures(boost_cc_compatibility_graph &, CustomUnorderedMap< C_vertex, vertex_type > &)=0
no_check_clique * clone() const override
virtual size_t num_mux()=0
void update_after_join(C_vertex &, C_vertex &) override
boost::graph_traits< cc_compatibility_graph >::vertex_descriptor C_vertex
cc_compatibility_graph vertex

Generated on Mon Feb 12 2024 13:02:50 for PandA-2024.02 by doxygen 1.8.13