Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion doc/Test.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1075,7 +1075,6 @@
<C>IsHapNonFreeResolution</C><Br/>
<C>NEATO_PATH</C><Br/>
<C>NerveOfCover</C><Br/>
<C>POLYMAKE_PATH</C><Br/>
<C>PseudoList</C><Br/>
<C>PseudoListFamily</C><Br/>
<C>QUASICATONEGROUP_DATA_NOT</C><Br/>
Expand Down
2 changes: 0 additions & 2 deletions doc/Undocumented.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7724,8 +7724,6 @@
<Br/>
<C>NerveOfCover</C>&nbsp;&nbsp;&nbsp;&nbsp;<B>Examples:</B> <Br/>
<Br/>
<C>POLYMAKE_PATH</C>&nbsp;&nbsp;&nbsp;&nbsp;<B>Examples:</B> <Br/>
<Br/>
<C>PseudoList</C>&nbsp;&nbsp;&nbsp;&nbsp;<B>Examples:</B> <Br/>
<Br/>
<C>PseudoListFamily</C>&nbsp;&nbsp;&nbsp;&nbsp;<B>Examples:</B> <Br/>
Expand Down
144 changes: 37 additions & 107 deletions lib/Polymake/orbitPoly.gi
Original file line number Diff line number Diff line change
Expand Up @@ -2,109 +2,65 @@
#####################################################################
InstallGlobalFunction(OrbitPolytope,
function(G,v,Props)
local
Points,p,x,i,w,Dim,tmp,input, tmpdir, tmpIn, tmp2dir, tmp2In,
a,b,c,d,U,V,W,AppendTo, PrintTo;

AppendTo:=HAP_AppendTo;
PrintTo:=HAP_PrintTo;

Dim:=Length(v);
Points:=[];

tmpdir := DirectoryTemporary();;
tmpIn:=Filename( tmpdir , "tmpIn.log" );
tmp2dir := DirectoryTemporary();;
tmp2In:=Filename( tmpdir , "tmp2In.log" );

local Points,poly, tmp, x, a, b, c, d, U, V, W, X;

############################CREATE POINTS###############
if IsPermGroup(G) then

for x in G do
w:=[];
for i in [1..Dim] do
Append(w,[v[i^x]]);
od;
Append(Points, [w]);
od;

Points := Orbit(G, v, Permuted);
else

for x in G do
w:=v*x;
Append(Points, [w]);
od;
Points := Orbit(G, v, OnRight);
fi;
######################POINTS CREATED###################


################## CALCULATE HULL POINTS ###############
AppendTo(tmpIn,"POINTS","\n");
for p in Points do
AppendTo(tmpIn,1);
for i in [1..Dim] do
AppendTo(tmpIn," ",p[i]);
od;
AppendTo(tmpIn,"\n");
od;

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


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


if "DIMENSION" in Props or "dimension" in Props then
Exec(Concatenation(POLYMAKE_PATH, tmpIn," DIM > ", tmp2In));
input:=InputTextFile(tmp2In);
tmp:=ReadLine(input);
tmp:=ReadLine(input);
Print("Dimension of orbit polytope is: ", tmp, "\n");
Exec(Concatenation("rm ", tmp2In));
tmp := Polymake(poly,"DIM");
Print("Dimension of orbit polytope is: ", tmp, "\n");
fi;

if "VERTEX_DEGREES" in Props or "vertex_degrees" in Props then
Exec(Concatenation(POLYMAKE_PATH,tmpIn, " VERTEX_DEGREES > ",tmp2In));
input:=InputTextFile(tmp2In);
tmp:=ReadLine(input);
tmp:=ReadLine(input);
Print("Vertex degree in graph of polytope is: ", Rat(Concatenation([tmp{[1..Position(tmp,' ')-1]}])), "\n");
#Exec(Concatenation("rm ",tmp2In));
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
Exec(Concatenation(POLYMAKE_PATH,tmpIn ," VISUAL_GRAPH"));
Polymake(poly,"VISUAL_GRAPH");
fi;

if "SCHLEGEL" in Props or "schlegel" in Props then
Exec(Concatenation(POLYMAKE_PATH,tmpIn ," SCHLEGEL"));
Polymake(poly,"SCHLEGEL");
fi;


if "VISUAL" in Props or "visual" in Props then

if IsPermGroup(G) and Length(v)=4 then
Exec(Concatenation("rm ",tmpIn));
AppendTo(tmpIn,"POINTS","\n");

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;
AppendTo (tmpIn,1," ",U, " ",V," ",W, "\n");
od;
fi;
Exec(Concatenation(POLYMAKE_PATH,tmpIn ," VISUAL"));
if IsPermGroup(G) and Length(v)=4 then
tmp := ShallowCopy(Points);
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, [1,U,V,W]);
od;
poly:=CreatePolymakeObject();
AppendPointlistToPolymakeObject(poly,tmp);
fi;
Polymake(poly,"VISUAL");
fi;

#Exec(Concatenation("rm ",tmpIn));



end);
#####################################################################
Expand All @@ -116,41 +72,15 @@ InstallOtherMethod(Display,
"method for displaying convex hulls of sets of points",
[IsPolymakeObject],
function(F)
local
Points,p,x,i,w,Dim,tmp,input, tmpdir, tmpIn, tmp2dir, tmp2In,
a,b,c,d,U,V,W,AppendTo, PrintTo;

AppendTo:=HAP_AppendTo;
PrintTo:=HAP_PrintTo;

Dim:=Length(Polymake(F,"F_VECTOR"));
Points:=Polymake(F,"VERTICES");

tmpdir := DirectoryTemporary();;
tmpIn:=Filename( tmpdir , "tmpIn.log" );
tmp2dir := DirectoryTemporary();;
tmp2In:=Filename( tmpdir , "tmp2In.log" );




################## CALCULATE HULL POINTS ###############
AppendTo(tmpIn,"POINTS","\n");
for p in Points do
AppendTo(tmpIn,1);
for i in [1..Dim] do
AppendTo(tmpIn," ",p[i]);
od;
AppendTo(tmpIn,"\n");
od;


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


Exec(Concatenation(POLYMAKE_PATH,tmpIn ," VISUAL"));

#Exec(Concatenation("rm ",tmpIn));
local Dim, Points,poly;

Dim:=Length(Polymake(F,"F_VECTOR"));
Points:=Polymake(F,"VERTICES");

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

Polymake(poly,"VISUAL");

end);
#####################################################################
Expand Down
Loading
Loading