File: piZero.gi

package info (click to toggle)
gap-hap 1.74%2Bds-1
  • links: PTS
  • area: main
  • in suites: sid
  • size: 58,664 kB
  • sloc: xml: 16,678; sh: 197; javascript: 155; makefile: 121; ansic: 47; perl: 24
file content (129 lines) | stat: -rw-r--r-- 2,968 bytes parent folder | download | duplicates (2)
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
#########################################
#########################################
InstallGlobalFunction(TruncatedRegularCWComplex,
function(Y,nn)
local B, n;

n:=Minimum(nn,Dimension(Y));
B:=Y!.boundaries;
B:=B{[1..n+1]};
B[n+2]:=[];

return RegularCWComplex(B);
end);
#########################################
#########################################

#########################################
#########################################
InstallGlobalFunction(PiZeroOfRegularCWComplex,
function(Y)
local T, cells, C, fn;

if Dimension(Y)=0 then 

###########################
fn:=function(i)
return i;
end;
###########################
return [[1..Y!.nrCells(0)], fn];
fi;

T:=TruncatedRegularCWComplex(Y,2);
cells:=CocriticalCellsOfRegularCWComplex(T,2);
cells:=Filtered(cells,x->x[1]=0);
cells:=List(cells,x->x[2]);

C:=ChainComplex(T);

###########################
fn:=function(i)
return C!.deform(0,i)[1];
end;
###########################

return [cells,fn];

end);
#########################################
#########################################

#########################################
#########################################
InstallMethod(PiZero,
"PiZero for RegularCWComplexes",
[IsHapRegularCWComplex],

function(Y)
return PiZeroOfRegularCWComplex(Y);
end);
#########################################
#########################################

#########################################
#########################################
InstallMethod(PiZero,
"PiZero for SimplicialComplexes",
[IsHapSimplicialComplex],

function(K)
local Y;
Y:=SimplicialComplexToRegularCWComplex(K);
return PiZeroOfRegularCWComplex(Y);
end);
#########################################
#########################################

#########################################
#########################################
InstallMethod(PiZero,
"PiZero for graphs",
[IsHapGraph],

function(G)
local Y;
Y:=SimplicialNerveOfGraph(G,2);
Y:=SimplicialComplexToRegularCWComplex(Y);
return PiZeroOfRegularCWComplex(Y);
end);
#########################################
#########################################

##################################################
##################################################
InstallGlobalFunction(DisplayDendrogramMat,
function(A,t,n)


DisplayDendrogram(DendrogramMat(A,t,n));

end);
##################################################
##################################################

##################################################
##################################################
InstallGlobalFunction(DendrogramMat,
function(A,tt,n)
local L, Inv, D, i, t;

t:=tt+1;

L:=[];
for i in [1..t+1] do
L[i]:=PiZero(SymmetricMatrixToGraph(A,(i-1)*n));;
od;

Inv:=List(L,l->function(i) return l[2](i); end);
L:=List(Inv,x->Classify([1..5],x));

D:=List([1..Length(L)-1],l->
        List(L[l],x->PositionProperty(L[l+1],y->x[1] in y)));

return D;

end);
##################################################
##################################################