CoxIter  1.3
CoxIter - Computing invariants of hyperbolic Coxeter groups
graph.h
Go to the documentation of this file.
1 /*
2 Copyright (C) 2013-2017
3 Rafael Guglielmetti, rafael.guglielmetti@unifr.ch
4 */
5 
6 /*
7 This file is part of CoxIter.
8 
9 CoxIter is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as
11 published by the Free Software Foundation, either version 3 of the
12 License, or (at your option) any later version.
13 
14 CoxIter is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18 
19 You should have received a copy of the GNU General Public License
20 along with CoxIter. If not, see <http://www.gnu.org/licenses/>.
21 */
22 
31 #ifndef GRAPH_H
32 #define GRAPH_H
33 
34 #include <algorithm>
35 #include <iostream>
36 #include <iterator>
37 #include <string>
38 #include <vector>
39 
40 using namespace std;
41 
42 class Graph {
43 public:
44  vector<short unsigned int> vertices;
45  vector<bool>
48 
49  unsigned int type;
50 
51  unsigned int dataSupp;
52 
53  bool isSpherical;
54 
55 private:
56  vector<string>
59 
60 public:
72  Graph(const vector<short unsigned int> &vertices,
73  vector<string> *ptr_map_vertices_indexToLabel,
74  const vector<bool> &linkableVertices, const unsigned int &type,
75  const bool &isSpherical, const unsigned int &dataSupp = 0);
76 
85  bool isSubgraphOf(const Graph *grBig) const;
86 
95  bool isSubgraphOf_spherical_spherical(const Graph *grBig) const;
96 
105  bool isSubgraphOf_spherical_euclidean(const Graph *grBig) const;
106 
107  friend bool operator==(const Graph &g1, const Graph &g2);
108  friend bool operator<(const Graph &g1, const Graph &g2);
109 
110 private:
111  static bool isAnSubAm(const vector<short unsigned int> &subGraphVertices,
112  const vector<short unsigned int> &bigGraphVertices);
113 
114 public:
115  friend ostream &operator<<(ostream &, Graph const &);
116 };
117 
118 struct GraphPtrComp {
119  bool operator()(const Graph *g1, const Graph *g2) const {
120  return (*g1 < *g2);
121  }
122 };
123 
124 #endif // GRAPH_H
This class represents one graph.
Definition: graph.h:42
vector< short unsigned int > vertices
Vertices of the graph.
Definition: graph.h:44
vector< string > * ptr_map_vertices_indexToLabel
Pointeur vers la correspondance.
Definition: graph.h:57
unsigned int type
Type of the graph: A=0, B=1, ...
Definition: graph.h:49
vector< bool > linkableVertices
Definition: graph.h:46
bool b_map_vertices_indexToLabelIsEmpty
Definition: graph.h:58
unsigned int dataSupp
In the case of G_2^n, the weight.
Definition: graph.h:51
bool isSpherical
True if spherical, false if euclidean.
Definition: graph.h:53
bool operator==(const Graph &g1, const Graph &g2)
Definition: graph.cpp:991
bool operator<(const Graph &g1, const Graph &g2)
Definition: graph.cpp:996
ostream & operator<<(ostream &o, const Graph &g)
Definition: graph.cpp:36
Definition: graph.h:118
bool operator()(const Graph *g1, const Graph *g2) const
Definition: graph.h:119