-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy patharithmeticity.h
133 lines (109 loc) · 3.44 KB
/
arithmeticity.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
/*
Copyright (C) 2013-2017
Rafael Guglielmetti, [email protected]
*/
/*
This file is part of CoxIter.
CoxIter is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
CoxIter is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with CoxIter. If not, see <http://www.gnu.org/licenses/>.
*/
/*!
* \file arithmeticity.h
* \author Rafael Guglielmetti
*
* \class Arithmeticity
* \brief This class tests the arithmeticity of a graph which has no dotted edge
* and which is non-cocompact. It uses Vinberg's criteria.
*/
#ifndef ARITHMETICITY_H
#define ARITHMETICITY_H
#include "coxiter.h"
class Arithmeticity {
private:
string error; ///< If an error occured, small text.
CoxIter *ci; ///< Pointer to the CoxIter object
unsigned int verticesCount; ///< Number of generators of the group
vector<vector<unsigned int>> coxeterMatrix; ///< Coxeter matrix of the group
vector<unsigned int> referencesToLabels; ///< Correspondence for the new
///< indices to the old ones
// For the DFS
vector<vector<bool>> visitedEdges; ///< Traversed edges
vector<bool> visitedVertices; ///< Taversed vertices
vector<unsigned int> path; ///< Current path
bool notArithmetic; ///< True if not arithmetic (i.e. we have to quit the
///< algorithm)
bool listCycles; ///< If true, will list the cycles to be manually tested
vector<string> allCycles; ///< The list
public:
/*! \fn Arithmeticity()
* \brief Basic constructor
*/
Arithmeticity();
/*! \fn ~Arithmeticity()
* \brief Destructor
*/
~Arithmeticity();
/*! \fn test
* \brief Test the arithmeticity of a graph
*
* \param ci(CoxIter&) The graph
* \param listCycles_(const bool&) If true, will list the cycles to be
*manually tested \return True if success, false otherwise. Then, use
*ci.get_isArithmetic()
*/
void test(CoxIter &ci, const bool &listCycles_);
/*! \fn get_allCycles
* \brief Return the list of cycles
*
* \return List (vector<string>)
*/
vector<string> get_allCycles();
/*! \fn get_error
* \brief Return the error code
*
* \return Error code (string)
*/
string get_error();
private:
/*! \fn collapseQueues
* \brief Try to collapse queues of the graph
*
* \return Number of vertices removed
*/
unsigned int collapseQueues();
/*! \fn testCycles
* \brief Test the cycles
*/
void testCycles();
/*! \fn findCycles
* \brief Look for cycles
*
* Update the vector path to find cycles
*
* \param root(unsigned int&) Starting vertex
* \param from(unsigned int&) Previoud vertex (if recursive call); root
* otherwise
*/
void findCycles(const unsigned int &root, const unsigned int &from);
/*! \fn testCycle
* \brief Test the cycle in path
*
* This function is called by findCycles. Eventually, set notArithmetic to
* true
*/
void testCycle();
};
struct CycleElement {
unsigned int first;
unsigned int second;
};
struct Cycles {};
#endif // ARITHMETICITY_H