-
Notifications
You must be signed in to change notification settings - Fork 0
/
automorphisms.m
66 lines (62 loc) · 1.49 KB
/
automorphisms.m
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
function Ms = automorphisms( Morig,cones ,iterates)
%generate the automorphisms of the group associated with the orbifold
if nargin<3
iterates=1;
end
if size(cones,2)==2
c=cones(:,1)+1i*cones(:,2);
else
c=cones;
end
for i=1:length(Morig)
Morig{end+1}=Morig{i}.inverse();
end
Morig{end+1}=MobiusTrans(1,0,0,1);
for i=1:length(Morig)
A(i,1:4)=[Morig{i}.a Morig{i}.b Morig{i}.c Morig{i}.d];
end
Ms=Morig;
for i=1:length(Morig)
Mcur=Morig{i}.inverse();
d=sum(abs(bsxfun(@minus,A,[Mcur.a Mcur.b Mcur.c Mcur.d])),2);
if min(d)<1e-8
continue;
end
Ms{end+1}+Mcur;
end
Ms=helper( Ms,c,A ,iterates);
end
function Ms=helper( Morig,c,A ,iterates)
if iterates==0
Ms=Morig;
return;
end
Ms=Morig;
for iter=1:1000
curLen=length(Ms);
for i=1:length(Morig)
for j=1:length(Ms)
Mcur=Morig{i}.compose(Ms{j});
d=sum(abs(bsxfun(@minus,A,[Mcur.a Mcur.b Mcur.c Mcur.d])),2);
if min(d)<1e-8
continue;
end
d=abs(c-Mcur.map(c));
if min(d)>1e-8
continue;
end
Ms{end+1}=Mcur;
A(end+1,1:4)=[Mcur.a Mcur.b Mcur.c Mcur.d];
end
end
if curLen==length(Ms)
break;
end
end
newCones=c;
for i=1:length(Ms)
newCones=[newCones;Ms{i}.map(c)];
end
% temp_comp = builtin('_mergesimpts',newcones,[tol tol tol tol tol tol tol tol],'first');
Ms=helper( Ms,newCones,A ,iterates-1);
end