CoxIter  1.2
CoxIter - Computing invariants of hyperbolic Coxeter groups
graph.h
Go to the documentation of this file.
1 /*
2 Copyright (C) 2013, 2014, 2015, 2016
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 <vector>
35 #include <iostream>
36 #include <algorithm>
37 #include <iterator>
38 #include <string>
39 
40 using namespace std;
41 
42 class Graph
43 {
44  public:
45  vector< short unsigned int > iVertices;
46  vector< bool > bVerticesLinkable;
47 
48  unsigned int iGraphType;
49 
50  unsigned int iDataSupp;
51 
52  bool bSpherical;
53 
54  private:
55  vector< string > *ptr_map_vertices_indexToLabel;
57 
58  public:
68  Graph( const vector< short unsigned int >& iVertices, vector< string > *ptr_map_vertices_indexToLabel, const vector< bool >& bVerticesLinkable, const unsigned int &iType, const bool& bSpherical, const unsigned int &iDataSupp = 0 );
69 
76  bool bIsSubgraphOf( const Graph* grBig ) const;
77 
84  bool bIsSubgraphOf_spherical_spherical( const Graph* grBig ) const;
85 
92  bool bIsSubgraphOf_spherical_euclidean( const Graph* grBig ) const;
93 
94  friend bool operator==( const Graph &g1, const Graph &g2 );
95  friend bool operator<( const Graph &g1, const Graph &g2 );
96 
97  private:
98  static bool bAnSubAm( const vector<short unsigned int>& iSubV, const vector<short unsigned int>& iBigV );
99 
100  public:
101  friend ostream& operator<<( ostream& , Graph const & );
102 };
103 
105 {
106  bool operator() ( const Graph* g1, const Graph* g2 ) const { return ( *g1 < *g2 ); }
107 };
108 
109 #endif // GRAPH_H
bool operator<(const Graph &g1, const Graph &g2)
Definition: graph.cpp:923
unsigned int iGraphType
Type of the graph: A=0, B=1, ...
Definition: graph.h:48
This class represents one graph.
Definition: graph.h:42
Definition: graph.h:104
bool operator==(const Graph &g1, const Graph &g2)
Definition: graph.cpp:918
bool b_map_vertices_indexToLabelIsEmpty
Definition: graph.h:56
vector< bool > bVerticesLinkable
A quels sommets on peut lier le graphe { sommets } \ { sommets du graphes et leurs voisins ) ...
Definition: graph.h:46
unsigned int iDataSupp
In the case of G_2^n, the weight.
Definition: graph.h:50
bool bSpherical
True if spherical, false if euclidean.
Definition: graph.h:52
ostream & operator<<(ostream &o, const CoxIter &g)
Definition: coxiter.cpp:1313
vector< string > * ptr_map_vertices_indexToLabel
Pointeur vers la correspondance.
Definition: graph.h:55
vector< short unsigned int > iVertices
Vertices of the graph.
Definition: graph.h:45