version 1.4, 2004/09/15 07:41:59 |
version 1.5, 2004/09/16 06:16:44 |
|
|
% $OpenXM: OpenXM/src/kan96xx/Doc/gfan.sm1,v 1.3 2004/09/14 08:30:47 takayama Exp $ |
% $OpenXM: OpenXM/src/kan96xx/Doc/gfan.sm1,v 1.4 2004/09/15 07:41:59 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 |
|
|
[(cones) [ ] cones] arrayToTree |
[(cones) [ ] cones] arrayToTree |
[(facets) [ ] facets] arrayToTree |
[(facets) [ ] facets] arrayToTree |
[(merged) [ ] merged] arrayToTree |
[(merged) [ ] merged] arrayToTree |
[(nextcid) [ ] merged] arrayToTree |
[(nextcid) [ ] nextcid] arrayToTree |
[(nextfid) [ ] merged] arrayToTree |
[(nextfid) [ ] nextfid] arrayToTree |
[(coneid) [ ] merged] arrayToTree |
[(coneid) [ ] coneid] arrayToTree |
] |
] |
] arrayToTree /arg1 set |
] arrayToTree /arg1 set |
] pop |
] pop |
|
|
dhcone.fan |
dhcone.fan |
} def |
} def |
|
|
% Todo: print, save functions. Representative of weight & init. |
%< |
|
% Usages: dhcone.rtable |
|
% dhcone $B$NHV9f$H(B cone $B$NHV9f$N(B $BCV49I=$r@8@.$7(B dhcone2.fan (merge $B$7$?(B cone $B$N>pJs(B) |
|
% $B$r(B dhcone.fan $B$+$i:n$k(B. dhcone2.gblist $B$b:n$kJd=u4X?t(B. |
|
% dhCones_h $B$7$F$+$i(B dhcone.rable $B$9$k(B. |
|
%> |
|
/dhcone.rtable { |
|
[/i /j /vv /cones /facets /facets2 /merged /nextcid /nextcid2 /ii /ww] pushVariables |
|
[ |
|
% $BCV49I=(B dhcone.h2dh $B$r:n$k(B. |
|
/dhcone.h2dh cone.fan length newVector.with-1 def |
|
0 1 , dhcone.fan length 1 sub { |
|
/i set |
|
dhcone.fan i get , (cones) getNode 2 get /vv set |
|
0 1 vv length 1 sub { |
|
/j set |
|
dhcone.h2dh , vv j get , i to_univNum , put |
|
} for |
|
} for |
|
% merge $B$7$?(B dhcone $B$r@0M}$7$?$b$N(B, dhcone2.fan $B$r:n$k(B. |
|
/dhcone2.fan dhcone.fan length newVector def |
|
0 1 , dhcone.fan length 1 sub { |
|
/i set |
|
dhcone.fan i get (facets) getNode 2 get /facets set |
|
dhcone.fan i get (merged) getNode 2 get /merged set |
|
dhcone.fan i get (nextcid) getNode 2 get /nextcid set |
|
dhcone.fan i get (cones) getNode 2 get /cones set |
|
/facets2 [ ] def |
|
/nextcid2 [ ] def |
|
0 1 , facets length 1 sub { |
|
/j set |
|
merged j get , (3).. eq { |
|
facets2 [ facets j get ] join /facets2 set |
|
% $B$H$J$j$N(B cone $B$,$"$k$H$-(B $BJQ49I=$K$7$?$,$$(B, cone $BHV9f$rJQ49(B |
|
nextcid2 [ dhcone.h2dh , nextcid j get , get ] join /nextcid2 set |
|
} { } ifelse |
|
merged j get , (2).. eq { |
|
facets2 [ facets j get ] join /facets2 set |
|
% $B6-3&$N$H$-(B -2 $B$rF~$l$k(B. |
|
nextcid2 [ (-2).. ] join /nextcid2 set |
|
} { } ifelse |
|
} for |
|
|
|
dhcone2.fan i , |
|
[(dhcone) [ ] |
|
[ |
|
[(facets) [ ] facets2] arrayToTree |
|
[(nextcid) [ ] nextcid2] arrayToTree |
|
[(cones) [ ] cones] arrayToTree |
|
] |
|
] arrayToTree , put |
|
|
|
} for |
|
|
|
% $B:G8e$K(B dhcone2.gblist $B$r:n$k(B. |
|
/dhcone2.gblist , dhcone2.fan length newVector , def |
|
0 1 , dhcone2.fan length 1 sub { |
|
/i set |
|
dhcone2.fan i get (cones) getNode 2 get /cones set |
|
cone.grGblist , cones 0 get , get , /ii set % GB of initial (H->1). |
|
cone.gblist i get , (weight) getNode , [ 2 0 2 ] get /ww set |
|
|
|
dhcone2.gblist i, |
|
[(gbasis) [ ] |
|
[ |
|
[(initial) [ ] ii] arrayToTree |
|
[(weight) [ ] ww] arrayToTree |
|
] |
|
] arrayToTree , put |
|
|
|
} for |
|
(dhcone2.fan, dhcone2.gblist, dhcone.h2dh are set.) message |
|
|
|
] pop |
|
popVariables |
|
} def |
|
|
|
%< |
|
% $BI=$N8+J}$N2r@b$r0u:~$9$k4X?t(B. |
|
% Usages: dhcone.explain |
|
%> |
|
/dhcone.explain { |
|
[ |
|
( ) nl |
|
(Data format in << dhcone2.fan >>, which is a dehomogenized Grobner fan.) nl nl |
|
(<< cone.vlist >> is the list of the variables.) nl |
|
@@@.Hsymbol ( is the homogenization variable to be dehomogenized.) nl nl |
|
(<< cone.input >> is generators of a given ideal.) nl nl |
|
(<< cone.d >> is the dimension of parametrization space of the weights P_w) nl |
|
( P_w is a cone in R^m where the number m is stored in << cone.m >>) nl |
|
( P_w --- W ---> R^n [weight space]. ) nl |
|
( W is stored in << cone.W >> ) nl |
|
( << u cone.W mul >> gives the weight vector standing for u) nl nl |
|
(All cones in the data lie in the weight parametrization space P_w.) nl |
|
( "facets" are the inner normal vector of the cone. ) nl |
|
( "nextcid" is a list of the cone id's of the adjacent cones.) nl |
|
( -2 in "nextcid" means that this facet lies on the border of the weight space.) nl |
|
( "cones" is a list of the cone id's of the NON-dehomonized Grobner fan) nl |
|
( stored in << cone.fan >>) nl |
|
] cat |
|
} def |
|
|
|
%< |
|
% dhcone.printGrobnerFan |
|
% dhcone $B$N0u:~4X?t(B |
|
%> |
|
/dhcone.printGrobnerFan { |
|
[/i] pushVariables |
|
[ |
|
(========== Grobner Fan (for dehomogenized cones) ============) message |
|
[ |
|
(cone.comment) |
|
(cone.vlist) (cone.vv) |
|
(cone.input) |
|
(cone.type) (cone.local) (cone.h0) |
|
(cone.n) (cone.m) (cone.d) |
|
(cone.W) (cone.Wpos) (cone.Wt) |
|
(cone.L) (cone.Lp) (cone.Lpt) |
|
(cone.weightBorder) |
|
(cone.incidence) |
|
] { printGrobnerFan.1 } map |
|
( ) message |
|
(The number of cones = ) messagen dhcone.fan length message |
|
( ) message |
|
0 1 dhcone2.fan length 1 sub { |
|
/ii set |
|
ii messagen ( : ) messagen |
|
dhcone2.fan ii get printTree |
|
} for |
|
1 { |
|
0 1 dhcone2.gblist length 1 sub { |
|
/ii set |
|
ii messagen ( : ) messagen |
|
dhcone2.gblist ii get printTree |
|
} for |
|
} { } ifelse |
|
|
|
|
|
(=========================================) message |
|
%(cone.withGblist = ) messagen cone.withGblist message |
|
dhcone.explain message |
|
( ) message |
|
] pop |
|
popVariables |
|
} def |
|
|
|
% |
|
% $B;n$7J}(B test14, 22, 25 |
|
% |
|
% (data/test14.sm1) run (data/test14-data.sm1) run |
|
% printGrobnerFan ; % H $BIU$-$G0u:~(B. |
|
% dhCones_h ; % dehomogenize Cones. |
|
% dhcone.rtable ; % dhcone2.fan $BEy$r@8@.(B. |
|
% dhcone.printGrobnerFan ; % $B0u:~(B. |
|
% $B0u:~$7$?$b$N$O(B test*-print.txt $B$X3JG<$7$F$"$k(B. |
|
% |
|
|
|
% Todo: save functions. |