File: SMList.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 (290 lines) | stat: -rw-r--r-- 9,273 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
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
// Copyright (C) 1997 The New York Group Theory Cooperative
// See magnus/doc/COPYRIGHT for the full notice.

// Contents: Declaration of class SMEnumerator
//
// Principal Author: Alexei Myasnikov
//
// Status: in progress
//
// Revision History:
//

#ifndef _SMLIST_H_
#define _SMLIST_H_

#include "AlgebraicObject.h"
#include "SMFPGroup.h"
#include "Word.h"
#include "Associations.h"
#include "SMEnumerator.h"

template <class T> class SMList;


//--------------------------------------------------------------------------//
//---------------------------- SMListType ----------------------------------//
//--------------------------------------------------------------------------//


template <class T> class SMList;

template <class T>  class SMListType {
public:
  SMListType() {
    //@njz
    //    ostrstream ostr;
    std::ostrstream ostr;
    //
    ostr << "SMList" << T::type() << '\0' << flush;
    strcpy(s, ostr.str());
  }
private:
  friend class SMList<T>;
  char s[100];
};

// ------------------------------- LIC -------------------------------- //


class LIC : protected FEData
{  
public:
  
  /////////////////////////////////////////////////////////////////////////
  //                                                                     //
  // Constructors:                                                       //
  //                                                                     //
  /////////////////////////////////////////////////////////////////////////
  
  LIC( OID, int );

  ~LIC( );

  /////////////////////////////////////////////////////////////////////////
  //                                                                     //
  // Trivality information:                                              //
  //                                                                     //
  /////////////////////////////////////////////////////////////////////////

  Trichotomy getTrivialStatus( int, GIC::AlgorithmID&, Chars& ) const;
  Trichotomy getTrivialStatus( int i ) const {
    GIC::AlgorithmID al;
    Chars s;
    return getTrivialStatus( i, al, s );
  }

  void setTrivialStatus( int i, Trichotomy is_trivial, 
			 GIC::AlgorithmID al = GIC::NONE  );
  
  bool IsTrivialChecked() const;

  bool hasTrivialStatusBuffer() const;

  void putIsTrivialFiles( const Chars& is_trivial,
			const Chars& is_not_trivial ){
    isTrivialFName = is_trivial;
    isNonTrivialFName = is_not_trivial;
  }


  Chars getListOfTrivial() const { return isTrivialFName; }
  Chars getListOfNonTrivial() const { return isNonTrivialFName; }

  /////////////////////////////////////////////////////////////////////////
  //                                                                     //
  // ''Is abelian'' information:                                         //
  //                                                                     //
  /////////////////////////////////////////////////////////////////////////

  Trichotomy getAbelianStatus( int, GIC::AlgorithmID&, Chars& ) const;

  Trichotomy getAbelianStatus( int i ) const {
    GIC::AlgorithmID al;
    Chars s;
    return getAbelianStatus( i, al, s );
  }

  void setAbelianStatus( int i, Trichotomy is_abelian, 
			 GIC::AlgorithmID al = GIC::NONE  );
  
  bool IsAbelianChecked() const;

  bool hasAbelianStatusBuffer( ) const;

  void putAbelianFiles( const Chars& is_abelian,
			const Chars& is_not_abelian ){
    isAbelianFName = is_abelian;
    isNonAbelianFName = is_not_abelian;
  }


  Chars getListOfAbelian() const { return isAbelianFName; }
  Chars getListOfNonAbelian() const { return isNonAbelianFName; }

  /////////////////////////////////////////////////////////////////////////
  //                                                                     //
  // ''Is central'' information:                                         //
  //                                                                     //
  /////////////////////////////////////////////////////////////////////////

  Trichotomy getIsCentralStatus( int, GIC::AlgorithmID&, Chars& ) const;

  Trichotomy getIsCentralStatus( int i ) const {
    GIC::AlgorithmID al;
    Chars s;
    return getIsCentralStatus( i, al, s );
  }

  void setIsCentralStatus( int i, Trichotomy is_abelian, 
			 GIC::AlgorithmID al = GIC::NONE  );
  
  bool IsCentralChecked() const;

  bool hasIsCentralStatusBuffer( ) const;

  void putIsCentralFiles( const Chars& is_central,
			  const Chars& is_not_central ){
    isCentralFName = is_central;
    isNonCentralFName = is_not_central;
  }


  Chars getListOfCentral() const { return isCentralFName; }
  Chars getListOfNonCentral() const { return isNonCentralFName; }

  /////////////////////////////////////////////////////////////////////////
  //                                                                     //
  // General accessors:                                                  //
  //                                                                     //
  /////////////////////////////////////////////////////////////////////////

  int numberOfElements() const { return number_of_elements; }

private:

  struct status_type {
    status_type( int );
    ~status_type();

    Trichotomy getStatus( int, GIC::AlgorithmID& ) const;
    void setStatus( int i, Trichotomy is_abelian, 
		    GIC::AlgorithmID al = GIC::NONE  );
  
    bool isChecked() const;

  private:
    char* status_buffer;
    int status_file;    
    int size;
  };
  
  Chars explanation( GIC::AlgorithmID ) const;
  
  /////////////////////////////////////////////////////////////////////////
  //                                                                     //
  // Data Members:                                                       //
  //                                                                     //
  /////////////////////////////////////////////////////////////////////////

  OID listOID;
  // Need this for composing messages about what has been found.
			       
  int number_of_elements;

  status_type* abStatus;
  status_type* wpStatus;
  status_type* centStatus;
  
  Chars isAbelianFName;
  Chars isNonAbelianFName;

  Chars isTrivialFName;
  Chars isNonTrivialFName;

  Chars isCentralFName;
  Chars isNonCentralFName;
};

//--------------------------------------------------------------------------//
//-------------------------- SMList ----------------------------------------//
//--------------------------------------------------------------------------//

template <class T> class SMList : public AlgebraicObject
{
public:

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

  SMList( class EnumeratorProblem< T >& P, const Chars heritage);

  SMList( const SMFPGroup& ao, const SMListData& d, const Chars heritage );
  
//  SMList( EnumeratorProblem< T >& P) : AlgebraicObject(""), 
//    theParent(P.getBoss().getParentObject())
//    theGroup(){ }
  
  //@Rn Bogus ctor; see But no  comment in Menu.h.
  

  ~SMList();

  /////////////////////////////////////////////////////////////////////////
  //                                                                     //
  // Accessors:                                                          //
  //                                                                     //
  /////////////////////////////////////////////////////////////////////////
  
  const SMListData& getData() const { return theData; }

  const SMFPGroup& getGroup() const;

  const AlgebraicObject& getParent()const { return theParent; }

  LIC& lic() { return *theLic; }
 
  /////////////////////////////////////////////////////////////////////////
  //                                                                     //
  // Front End Interfacing:                                              //
  //                                                                     //
  /////////////////////////////////////////////////////////////////////////
  
  static const char* type( )  { return theType.s; } 
  
  const char* typeID( ) const { return type(); };        // overrides SMObject
  
  const IconID iconID( ) const { return IconID::list_object; };
  // overrides SMObject
  
  void printProperties(ostream& ostr) const;
  
  void viewStructure(ostream& ostr) const;
  
  void printDefinition(ostream& ostr) const;            // overrides SMObject
  

public:
 
protected:

  void readMessage(istream&) { };                     // overrides SMObject

  /////////////////////////////////////////////////////////////////////////
  //                                                                     //
  // Restricted Access:                                                  //
  //                                                                     //
  /////////////////////////////////////////////////////////////////////////
  const AlgebraicObject& theParent;							    
  static SMListType<T> theType;
  
  SMListData theData;
  LIC* theLic;

};


#endif