File: Endomorphism.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 (155 lines) | stat: -rw-r--r-- 5,445 bytes parent folder | download | duplicates (5)
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
// Copyright (C) 1995 The New York Group Theory Cooperative
// See magnus/doc/COPYRIGHT for the full notice.

// Contents: Definition of the FreeGroup class.
//
// Principal Authors: Eugene Paderin, Dmitry Pechkin
//
// Status: in progress
//
// Revision History:
//
// Special Notes:
//
// * The class is primarily designed and used for solving
//   quadratic equations (in free groups).
//
// * The class methods need advanced consistency checking and
//   more manipulation with Map properties.
//

#ifndef _ENDOMORPHISM_H_
#define _ENDOMORPHISM_H_

#include "Map.h"

//---------------------- Endomorphism ---------------------------//


class Endomorphism : public Map {

public:

////////////////////////////////////////////////////////////////////
//                                                                //
// Constructors                                                   //
//                                                                //
////////////////////////////////////////////////////////////////////

	// no default constructor: a domain group must be given

	Endomorphism( const FGGroup& dom) : Map(dom, dom) {}
	// make trivial endomorphism on given group

	Endomorphism( const FGGroup& dom, const VectorOf<Word>& generatingImages ) 
		: Map(dom, dom, generatingImages) {}
	// an Endomorphism with explicit generatingImages

	Endomorphism( const Map& m ) : Map(m) {}
  // cast construtor: to cast an arbitrary map as an endomorphism.
  // NB. This rewraps the unchanged representation, hence is in general
  // only useful for casting a map known to be an actual endomorphism.

	// copy constructor, operator=, and destructor supplied by compiler

////////////////////////////////////////////////////////////////////
//                                                                //
// Accessors / Modifiers                                          //
//                                                                //
////////////////////////////////////////////////////////////////////

	// inherited from the base class

	// const FGGroup& domain( ) const;
	// const FGGroup& range( ) const;
	// const VectorOf<Word>& generatingImages( ) const;
	// Word generatingImages( int i ) const;
	// void setGeneratingImages( const VectorOf<Word>& gi );
	// void setGeneratingImages( int i, const Word& e  );

  void makeIdentity()
	{
		for(int i=0; i<domain().numberOfGenerators(); i++)
			setGeneratingImages(i, Generator(i+1));
	}
	// turns the endomorphism into the identity automorphism. 

  void reduceGenImages() 
	{
		for(int i = 0; i<generatingImages().length(); i++)
			setGeneratingImages(i, generatingImages(i).freelyReduce());
	}
	// freely reduce generating images to prevent its overgrowth 
	// in composition of maps. 
	//@ep Should be this done automatically?

////////////////////////////////////////////////////////////////////
//                                                                //
// Standard operations                                            //
//                                                                //
////////////////////////////////////////////////////////////////////

  bool operator ==(const Endomorphism& e) const {
    return ( look() == e.look() || *look() == *e.look() ); 
  }
	//@dp this operator should be defined in Map only. But now
	//    Map class has too simple of this one.

////////////////////////////////////////////////////////////////////
//                                                                //
// Mapping methods                                                //
//                                                                //
////////////////////////////////////////////////////////////////////

	// inherited from the base class

//    friend CondParamLvalue<Map,Word,Generator>::operator Word ( ) const;
//    friend Word& CondParamLvalue<Map,Word,Generator>::operator =
//        ( const Word& ) const;
//    Word imageOf( const Word& w ) const;
//    Word imageOf( const Generator& g ) const;
//    CondParamLvalue<Map,Word,Generator> imageOf( const Generator& g );
//    Word operator()( const Word& w ) const;
//    Word operator()( const Generator& g ) const;
//    CondParamLvalue<Map,Word,Generator> operator()( const Generator& g )
//        { return imageOf(g); }

// computing images:

//    Elt evalImage( const Word& w ) const;
//    Elt postEvalImage( const Word& w ) const;


////////////////////////////////////////////////////////////////////
//                                                                //
// Mapping properties                                             //
//                                                                //
////////////////////////////////////////////////////////////////////

//    Trichotomy extendsToHom( ) const;

//    Trichotomy isMono( ) const;
//    Trichotomy isEpi( ) const;
//    Trichotomy isIso( ) const;
//    Trichotomy isTrivialMap( ) const; // @stc impl. tmp.

////////////////////////////////////////////////////////////////////
//                                                                //
// Debugging stuff                                                //
//                                                                //
////////////////////////////////////////////////////////////////////

#ifdef DEBUG

//	friend int main( );

	bool consistent( ) {
		return Map::consistent() && domain() == range();
	}

#endif

};

#endif