version 1.14, 2009/08/26 05:03:49 |
version 1.20, 2018/05/02 02:28:13 |
|
|
% $OpenXM: OpenXM/src/kan96xx/Doc/gfan.sm1,v 1.13 2009/08/26 04:54:17 takayama Exp $ |
% $OpenXM: OpenXM/src/kan96xx/Doc/gfan.sm1,v 1.19 2013/10/11 01:08:35 takayama Exp $ |
% cp cone.sm1 $OpenXM_HOME/src/kan96xx/Doc/gfan.sm1 |
% cp cone.sm1 $OpenXM_HOME/src/kan96xx/Doc/gfan.sm1 |
% $Id$ |
% $Id$ |
% iso-2022-jp |
% iso-2022-jp |
%%Ref: @s/2004/08/21-note.pdf |
%%Ref: @s/2004/08/21-note.pdf |
|
|
|
%% gfan.sm1 works only for polymake 2.0 Use webservice of 2.0. |
|
[(gfan) |
|
[ |
|
(gfan.sm1 is a package to compute global and local Grobner fans.) |
|
(See R.Bahloul and N.Takayama, arxiv, math.AG/0412044 and references as to algorithms.) |
|
(At the beginning of the source code gfan.sm1, there are sample inputs cone.sample and cone.sample2.) |
|
( ) |
|
(gfan.sm1 works only with polymake 2.0. We provide a web service of computing ) |
|
(with polymake 2.0. /@@@polymake.web 1 def is set by default in gfan.sm1.) |
|
(See changelog-ja.tex as to details on the difference between 2.0 and later versions.) |
|
( ) |
|
(*cone.sample ; is an example. See the source code. The state polytope is the hexagon.) |
|
( ) |
|
(*cone.Wt cone.Lpt {vertices in the output} are weights on the rays of the Grobner cone.) |
|
(*cone.L gives a basis of the linearity space.) |
|
(*cone.Lp gives a basis of the pointed cone. cone.Lpt is the transpose of cone.Lp.) |
|
$*When v is a row vector in an ouput cone, (v cone.Lp cone.W) gives $ |
|
( the corresponding weight vector in the full variable space in D) |
|
(*cone.incidence is a list of [[cone num1,facet num1], [cone num2,facet num2]]) |
|
( which means that cone num1 and cone num2 are adjacent and shares ) |
|
( the facet num1 and the facet num2) |
|
(*/cone.withGblist 1 def saves the Grobner basis standing for each cone.) |
|
( ) |
|
(*Cone descriptions: cone.fan) |
|
(**A facet is given by its normal vector n of a cone. It gives facet num of the cone.) |
|
(**A cone is defined by facet normal vectors n1, n2, ... as n1.x>=0 and n2.x >=0 and ...) |
|
(**facetsv is a list of facets expressed by generators.) |
|
(**nextcid is a list of the adjacent cone numbers.) |
|
(**nextfid is a list of the shared facet numbers.) |
|
(**vertices is the generators of a cone.) |
|
(**inequalities are not necessarily unique.) |
|
] |
|
] putUsages |
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
%% Two examples are given below to get a global Grobner fan and |
%% Two examples are given below to get a global Grobner fan and |
%% a local Grobner fan ; cone.sample and cone.sample2 |
%% a local Grobner fan ; cone.sample and cone.sample2 |
|
|
cone.comment message |
cone.comment message |
(cone.input = ) message |
(cone.input = ) message |
cone.input message |
cone.input message |
|
%%% Step 0. If you want to output Grobner basis standing for each cone, then uncomment |
|
% /cone.withGblist 1 def |
|
|
%%%% Step 1. Enumerating the Grobner Cones in a global ring. |
%%%% Step 1. Enumerating the Grobner Cones in a global ring. |
%%%% The result is stored in cone.fan |
%%%% The result is stored in cone.fan |
getGrobnerFan |
getGrobnerFan |
|
|
printGrobnerFan |
printGrobnerFan |
|
|
%%%% If you want to save the data to the file sm1out.txt, then uncomment. |
%%%% If you want to save the data to the file sm1out.txt, then uncomment. |
% /cone.withGblist 1 def saveGrobnerFan /ff set ff output |
%saveGrobnerFan /ff set ff output |
|
|
%%%% Step 2. Dehomogenize the Grobner Cones |
%%%% Step 2. Dehomogenize the Grobner Cones |
%%%% by the equivalence relation in a local ring (uncomment). |
%%%% by the equivalence relation in a local ring (uncomment). |
Line 250 dhcone.printGrobnerFan |
|
Line 287 dhcone.printGrobnerFan |
|
% If you use the cgi/polymake on the net, then uncomment out. |
% If you use the cgi/polymake on the net, then uncomment out. |
%/doPolymake {doPolymake.OoHG} def (Using doPolymake.OoHG ) message |
%/doPolymake {doPolymake.OoHG} def (Using doPolymake.OoHG ) message |
%/polymake.start {polymake.start.OoHG} def (Using polymake.start.OoHG ) message |
%/polymake.start {polymake.start.OoHG} def (Using polymake.start.OoHG ) message |
|
/@@@polymake.web 1 def |
%% Choose it automatically. |
%% Choose it automatically. |
[(which) (polymake)] oxshell tag 0 eq { |
[(which) (polymake)] oxshell tag 0 eq |
(Polymake is not installed in this system.) message |
@@@polymake.web 1 eq |
/doPolymake {doPolymake.OoHG} def |
or |
(Using doPolymake.OoHG ) message |
{ |
/polymake.start {polymake.start.OoHG} def |
(Polymake is not installed in this system or @@@polymake.web is set.) message |
(Using polymake.start.OoHG ) message |
usePolymake.OoHG.curl |
} { (Local polymake will be used.) message } ifelse |
(Using doPolymake.OoHG.curl ) message |
|
} { usePolymake.local (Local polymake will be used.) message } ifelse |
|
|
/cone.debug 1 def |
/cone.debug 1 def |
|
|
|
|
%> |
%> |
/getConeInfo { |
/getConeInfo { |
/arg1 set |
/arg1 set |
[/ww /g /ceq /ceq2 /cdim /mmc /mmL /rr /ineq /ppt] pushVariables |
[/ww /g /ceq /ceq2 /cdim /mmc /mmL /rr /ineq /ppt /rr0 /mm0 /mm1] pushVariables |
[ |
[ |
/ceq arg1 def |
/ceq arg1 def |
ceq pruneZeroVector /ceq set |
ceq pruneZeroVector /ceq set |
|
|
(Monomial ideal is not accepted as an input.) cone_ir_input |
(Monomial ideal is not accepted as an input.) cone_ir_input |
} { } ifelse |
} { } ifelse |
|
|
|
/mm1 |
|
( Use [(keep_tmp_files) 1] oxshell to check the input to polymake2tfb. See /tmp or $TMP ) |
|
def |
|
|
ceq genPo2 /ceq2 set |
ceq genPo2 /ceq2 set |
% ceq2 $B$O(B polymake.data(polymake.INEQUALITIES(...)) $B7A<0(B |
% ceq2 $B$O(B polymake.data(polymake.INEQUALITIES(...)) $B7A<0(B |
% polymake $B$G(B ceq2 $B$N<!85$N7W;;(B. |
% polymake $B$G(B ceq2 $B$N<!85$N7W;;(B. |
/getConeInfo.ceq ceq def /getConeInfo.ceq2 ceq2 def |
/getConeInfo.ceq ceq def /getConeInfo.ceq2 ceq2 def |
|
|
cone.debug { (Calling polymake DIM.) message } { } ifelse |
cone.debug { (Calling polymake DIM.) message } { } ifelse |
[(DIM) ceq2] doPolymake 1 get /rr set |
[(DIM) ceq2] doPolymake /rr0 set |
|
% rr0 2 get message |
|
rr0 2 get 1 get 0 get /mm0 set |
|
mm0 length 0 eq { } |
|
{ [mm0 mm1] cat error } ifelse |
|
rr0 1 get /rr set |
cone.debug {(Done.) message } { } ifelse |
cone.debug {(Done.) message } { } ifelse |
% test5 $B$K$O<!$N%3%a%s%H$H$j$5$k(B. $B>e$N9T$r%3%a%s%H%"%&%H(B. |
% test5 $B$K$O<!$N%3%a%s%H$H$j$5$k(B. $B>e$N9T$r%3%a%s%H%"%&%H(B. |
% test5.data tfbToTree /rr set |
% test5.data tfbToTree /rr set |
|
|
% FACETS $B$r;}$C$F$$$J$$$J$i:FEY7W;;$9$k(B. |
% FACETS $B$r;}$C$F$$$J$$$J$i:FEY7W;;$9$k(B. |
% POINTED, NOT__POINTED $B$bF@$i$l$k(B |
% POINTED, NOT__POINTED $B$bF@$i$l$k(B |
cone.debug { (Calling polymake FACETS.) message } { } ifelse |
cone.debug { (Calling polymake FACETS.) message } { } ifelse |
[(FACETS) ceq2] doPolymake 1 get /rr set |
[(FACETS) ceq2] doPolymake /rr0 set |
|
|
|
% rr0 2 get message |
|
rr0 2 get 1 get 0 get /mm0 set |
|
mm0 length 0 eq { } |
|
{ [mm0 mm1] cat error } ifelse |
|
|
|
rr0 1 get /rr set |
cone.debug { (Done.) message } { } ifelse |
cone.debug { (Done.) message } { } ifelse |
} { } ifelse |
} { } ifelse |
|
|
rr (VERTICES) getNode tag 0 eq { |
rr (VERTICES) getNode tag 0 eq { |
(internal error: VERTICES is not found.) error |
(internal error: VERTICES is not found.) error |
} { } ifelse |
} { |
|
rr (VERTICES) getNode |
|
(UNDEF) getNode tag 0 eq { } |
|
{ (internal error: VERTICES is UNDEF. See rr. Set /@@@polymake.web 1 def) error } ifelse |
|
} ifelse |
|
|
/cone.getConeInfo.rr1 rr def |
/cone.getConeInfo.rr1 rr def |
|
|
|
|
/printGrobnerFan { |
/printGrobnerFan { |
[/i] pushVariables |
[/i] pushVariables |
[ |
[ |
|
$(gfan) usage to find explanations on variables.$ message |
(========== Grobner Fan ====================) message |
(========== Grobner Fan ====================) message |
[ |
[ |
(cone.comment) |
(cone.comment) |