File: MSCGConjugacyProblem.h

package info (click to toggle)
magnus 20060324-3
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 19,404 kB
  • ctags: 20,466
  • sloc: cpp: 130,118; ansic: 37,076; tcl: 10,970; perl: 1,109; makefile: 963; sh: 403; yacc: 372; csh: 57; awk: 33; asm: 10
file content (197 lines) | stat: -rw-r--r-- 7,230 bytes parent folder | download | duplicates (3)
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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
// Copyright (C) 1995 The New York Group Theory Cooperative
// See magnus/doc/COPYRIGHT for the full notice.

// Contents: Definition of MSCGConjugacyProblem class.
//           This is a solving of conjugacy problem for metric 
//           small cancellation groups with C'(1/6) condition.
//           
// Principal Authors: Dmitry Bormotov
//
// Status: in progress
//
// Revision History:
//
// Special Remarks:
//
//

#ifndef _MSCG_CONJUGACY_PROBLEM_H_
#define _MSCG_CONJUGACY_PROBLEM_H_

#include "MSCGroup.h"


// ------------------------ MSCGConjugacyProblem ---------------------------//


class MSCGConjugacyProblem {


public:

  
  /////////////////////////////////////////////////////////////////////////
  //                                                                     //
  // Constructors:                                                       //
  //                                                                     //
  /////////////////////////////////////////////////////////////////////////

  // No default constructor

  // Copy constructor provided by compiler (does logical deep copy).

  MSCGConjugacyProblem ( const MSCGroup& G, const Word& u, const Word& v ) : 
    MSCG ( G ), U( u.freelyReduce() ), V( v.freelyReduce() ), 
    areConjugate ( DONTKNOW ), theConjugator ( ), doneStatus ( false ),
    startStatus ( false ), UConjugator( ), VConjugator( ) { };
  // To construct a conjugacy problem class with given MSCGroup.


  /////////////////////////////////////////////////////////////////////////
  //                                                                     //
  // Activation members:                                                 //
  //                                                                     //
  /////////////////////////////////////////////////////////////////////////

  void startComputation( );
    // Start the computation.      
  // You shouldn't call this more than one time.
  
  bool continueComputation( );
  // Advance the computation of conjugacy problem.
  // You have to call startComputation() before.
  // This function returns true if the computation is done.


  /////////////////////////////////////////////////////////////////////////
  //                                                                     //
  // Status Queries:                                                     //
  //                                                                     //
  /////////////////////////////////////////////////////////////////////////

  bool done( ) const {
    return doneStatus;
  }
  // Is the conjugacy problem done ?

  /////////////////////////////////////////////////////////////////////////
  //                                                                     //
  // Accessors:                                                          //
  //                                                                     //
  /////////////////////////////////////////////////////////////////////////

  // You can call all these functions iff the computation is finished
  // ( when the done() functions returns true ).

  Trichotomy answer( ) const {

  #if SAFETY > 0
    if ( !doneStatus )
      error("tried to get answer of conjugate problem before solve it");
  #endif
    
    return areConjugate;
  }
  // Are the words conjugate ? 

  Word conjugator( ) const {

  #if SAFETY > 0
    if ( answer() != YES )
      if ( answer() == NO )
        error("tried to get conjugator when the words aren't conjugate");
      else 
        error("tried to get conjugator when result the conjugacy"
              " problem is unknown");
  #endif
    
    return theConjugator;
  }

 
private:


  /////////////////////////////////////////////////////////////////////////
  //                                                                     //
  // Private Functions:                                                  //
  //                                                                     //
  /////////////////////////////////////////////////////////////////////////

  MSCGConjugacyProblem( const MSCGConjugacyProblem& );
  // It is hidden, not implemented.

  MSCGConjugacyProblem& operator = ( const MSCGConjugacyProblem& );
  // It is hidden, not implemented.

  void setCPResult( Trichotomy result );
  // Set result of conjugacy problem and reset status variables.

  void finishCP( Trichotomy result );
  // Finish conjugacy problem ( delete all objects and set result).
  

  /////////////////////////////////////////////////////////////////////////
  //                                                                     //
  // Data Members:                                                       //
  //                                                                     //
  /////////////////////////////////////////////////////////////////////////

  const MSCGroup& MSCG;    // The MSC group in which we solve a 
                           // conjugacy problem
  bool doneStatus;         // TRUE if the computation is finished
  bool startStatus;        // TRUE if the computation is started
  Trichotomy areConjugate; // the result of conjugacy problem
  Word theConjugator;      // the conjugator if the words are conjugate
  int maxLen;              // maximal length of relators which we 
                           // need use for generating pieces
  Word UConjugator;
  Word VConjugator;

  // This variables contain information for iterations of conjugacy problem

  enum stateType{CYCLE_BY_RELATORS, CYCLE_BY_PIECES, CYCLE_BY_RELATORS2};

  stateType state;         // In what kind of cycle we are now ?
  bool firstPart;          // TRUE if we are in first part of algorithm: 
                           //   for C'(1/8) condition 
  Word U;                  // fisrt argument for conjugacy problem
  Word V;                  // second argument for conjugacy problem
  int ULen;                // length of U
  int VLen;                // length of V
  SetOf<Word> cycV;        // the set of cyclic permutations of V

  SymmetricRelators *shortRelators;      
  // The set of short relators.
  // Only this relators would be able to shorten given word

  SymmetricRelatorsIterator *shortIter;  // symmetric iterators over the
  SymmetricRelatorsIterator *shortIter2; // set of relators

  Word relator;        // current relator 
  int relatorLen;      // its length
  int pieceLen;        // tne length of current piece of current relator
  
  Word relatorOne;     // the first current relator
  int relatorOneLen;   // its length
  int pieceOneLen;     // the length of fisrt piece of relatorOne
  Word pieceOne;       // the fisrt piece of relatorOne 
  Word relatorTwo;     // the second current relator
  int relatorTwoLen;   // its length

  
  /////////////////////////////////////////////////////////////////////////
  //                                                                     //
  // Debugging stuff:                                                    //
  //                                                                     //
  /////////////////////////////////////////////////////////////////////////

#ifdef DEBUG

  friend int main(int, char**);

#endif

};

#endif