File: orbitPoly.gi

package info (click to toggle)
gap-hap 1.74%2Bds-1
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 58,664 kB
  • sloc: xml: 16,678; sh: 197; javascript: 155; makefile: 121; ansic: 47; perl: 24
file content (88 lines) | stat: -rw-r--r-- 2,471 bytes parent folder | download
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
#####################################################################
#####################################################################
InstallGlobalFunction(OrbitPolytope,
function(G,v,Props)
local Points,poly, tmp, x, a, b, c, d, U, V, W, X;

############################CREATE POINTS###############
if IsPermGroup(G) then
    Points := Orbit(G, v, Permuted);
else
    Points := Orbit(G, v, OnRight);
fi;
######################POINTS CREATED###################


################## CALCULATE HULL POINTS ###############

poly:=CreatePolymakeObject();
AppendPointlistToPolymakeObject(poly,Points);


################# HULL CALCULATED ###################################


if "DIMENSION" in Props or "dimension" in Props then
    tmp := Polymake(poly,"DIM");
    Print("Dimension of orbit polytope is: ", tmp, "\n");
fi;

if "VERTEX_DEGREES" in Props or "vertex_degrees" in Props then
    tmp:=Set(Polymake(poly,"VERTEX_DEGREES"));
    Print("Vertex degree in graph of polytope is: ", tmp[1], "\n");
fi;


if "VISUAL_GRAPH" in Props or "visual_graph" in Props then
    Polymake(poly,"VISUAL_GRAPH");
fi;

if "SCHLEGEL" in Props or "schlegel" in Props then
    Polymake(poly,"SCHLEGEL");
fi;


if "VISUAL" in Props or "visual" in Props then
    if IsPermGroup(G) and Length(v)=4 then
        tmp := [];
        for x in G do
            a:=v[1^x]-v[1];
            b:=v[2^x]-v[2];
            c:=v[3^x]-v[3];
            d:=v[4^x]-v[4];
            U:=2*a-2*b;
            V:=2*c-2*d;
            W:=a+b-c-d;
            Add(tmp, [U,V,W]);
        od;
        poly:=CreatePolymakeObject();
        AppendPointlistToPolymakeObject(poly,tmp);
    fi;
    Polymake(poly,"VISUAL");
fi;


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

#####################################################################
#####################################################################
InstallOtherMethod(Display,
"method for displaying convex hulls of sets of points",
[IsPolymakeObject],
function(F)
    local Dim, Points,poly;
    
    Dim:=Length(Polymake(F,"F_VECTOR"));
    Points:=Polymake(F,"VERTICES");
    
    poly:=CreatePolymakeObject();
    AppendPointlistToPolymakeObject(poly,Points);
    
    Polymake(poly,"VISUAL");

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