-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathcoset.h
65 lines (50 loc) · 1.54 KB
/
coset.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
#pragma once
#include <iostream>
#include <ext.h>
class Coset;
#include "group.h"
#include "permutation.h"
// encodes a coset
class Coset {
Group _G;
Group _H;
bool _right;
Permutation _sigma;
public:
// returns a shared reference to the group the coset is contained in, i.e. G in G/H
Group supergroup() const;
// returns a shared reference to the divisor group, i.e. H in G/H
Group subgroup() const;
// checks whether the coset is a right coset
bool isRightCoset() const;
// returns a reference to a representative of the coset
const Permutation& representative() const;
// checks whether cosets are equal
bool operator==( const Coset& ) const;
// constructs a coset
Coset( Group G, Group H, Permutation sigma, bool right = true );
};
// prints the coset c to the output stream os
std::ostream& operator<<( std::ostream& os, const Coset& c );
// defines multiplication of permutations and cosets
Coset operator*( const Permutation& sigma, const Coset& tauH );
// encodes a set of isomorphisms, which is either a coset or empty
struct Iso : public Either<Coset,Empty> {
// checks whether it is empty
bool isEmpty() const;
// returns the coset
// WARNING: undefined behaviour if Iso is empty
const Coset& coset() const;
using Either::Either;
};
// defines multiplication of permutation and Iso sets
Iso operator*( const Permutation& sigma, const Iso& tauH );
// implements the union of cosets
class IsoJoiner {
Group _supergroup;
Group _subgroup;
std::deque<Permutation> elements;
public:
void join( Iso I );
explicit operator Iso();
};