Changeset 1f36cef in git


Ignore:
Timestamp:
Sep 29, 2016, 11:48:55 AM (8 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'b4f17ed1d25f93d46dbe29e4b499baecc2fd51bb')
Children:
1cca2257b0e482d23bff22027d4e66c3c8f4c508
Parents:
a163b285f10edfeeb40f2314bfc7233a710282c5
Message:
chg: new doc for gfanlib and polymake, p2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • Singular/LIB/gfan.lib

    ra163b2 r1f36cef  
    1515       canonicalizeCone(c); a unique representation of the cone c
    1616       codimension(c);      the codimension of the input
     17       coneViaPoints();     define a cone
     18       coneViaInequalities(); define a cone
    1719       coneLink(c,w);       the link of c around w
    1820       containsAsFace(c,d); is d a face of c
    1921       containsInSupport(c,d); is d contained in c
    2022       containsPositiveVector(c); contains a vector with only positive entries?
     23       containsRelatively(c,p); p in c?
    2124       convexHull(c1,c2);   convex hull
    2225       convexIntersection(c1,c2); convex hull
     
    3033       getLinearForms(c);    linear forms previously stored in c
    3134       getMultiplicity(c);   multiplicity previously stored in c
    32        inequalities(c);      inequalities of c 
     35       inequalities(c);      inequalities of c
    3336       isFullSpace(c);       is the entire ambient space?
    3437       isOrigin(c);          is the origin?
     
    222225}
    223226
     227proc coneViaPoints()
     228"USAGE:   coneViaPoints(HL); intmat HL
     229          coneViaPoints(HL,L); intmat HL, intmat L
     230          coneViaPoints(HL,L,flags); intmat HL, intmat L, int flags
     231RETURN:  cone
     232PURPOSE: cone generated by half lines generated by the row vectors of HL
     233  and (if stated) by lines generated by the row vectors of L;
     234  flags may range between 0,..,3 defining an upper and lower bit
     235  (0=0*2+0, 1=0*2+1, 2=1*2+0, 3=1*2+1),
     236  if upper bit is 1, then program assumes that each row vector in HL
     237  generates a ray of the cone,
     238  if lower bit is 1, then program assumes that the span of the row
     239  vectors of L is the lineality space of the cone,
     240  if either bit is 0, then program computes the information itself.
     241EXAMPLE: example coneViaPoints; shows an example
     242"
     243{
     244
     245}
     246example
     247{
     248  "EXAMPLE:"; echo = 2;
     249  // Let's define a cone in R^3 generated by the following half lines:
     250  intmat HL[5][3]=
     251   1,0, 0,
     252  -1,0, 0,
     253   0,1, 1,
     254   0,1,-1,
     255   0,0, 1;
     256  cone c=coneViaPoints(HL);
     257  c;
     258  kill HL,c;
     259  // Note that (1,0,0) and (-1,0,0) form a line, hence also possible:
     260  intmat HL[3][3]=
     261  0,1, 1,
     262  0,1,-1,
     263  0,0, 1;
     264  intmat L[1][3]=
     265  1,0,0;
     266  cone c=coneViaPoints(HL,L);
     267  c;
     268  kill HL,L,c;
     269  // lineality space is exactly Lin(1,0,0)
     270  intmat HL[3][3]=
     271  0,1, 1,
     272  0,1,-1,
     273  0,0, 1;
     274  intmat L[1][3]=
     275  1,0,0;
     276  cone c=coneViaPoints(HL,L,1);
     277  c;
     278  kill HL,L,c;
     279  // and that (0,1,-1), (0,1,1) generate rays
     280  intmat HL[3][3]=
     281  0,1, 1,
     282  0,1,-1;
     283  intmat L[1][3]=
     284  1,0,0;
     285  cone c=coneViaPoints(HL,L,1);
     286  c;
     287  kill HL,L,c;
     288  // and that (0,1,-1), (0,1,1) generate rays
     289  intmat HL[3][3]=
     290  0,1, 1,
     291  0,1,-1;
     292  intmat L[1][3]=
     293  1,0,0;
     294  cone c=coneViaPoints(HL,L,3);
     295  c;
     296}
     297
     298proc coneViaInequalities()
     299"USAGE:   coneViaInequalities(IE); intmat IE
     300          coneViaInequalities(IE,E); intmat IE, intmat E
     301          coneViaInequalities(IE,E,flags); intmat IE, intmat E, int flags
     302RETURN:  cone
     303PURPOSE: cone consisting of all points x, such that IE*x >= 0 in each component
     304  and (if stated) E*x = 0;
     305  inequalities and (if stated) equations will be transformed, getting rid of
     306  redundancies;
     307  flags may range between 0,..,3 defining an upper and lower bit
     308  (0=0*2+0, 1=0*2+1, 2=1*2+0, 3=1*2+1),
     309  if higher bit is 1, then program assumes each inequality yields a facet,
     310  if lower bit is 1, then program assumes the kernel of E is the span of the cone,
     311  if either bit is 0, then program computes the information itself.
     312EXAMPLE: example coneViaInequalities; shows an example
     313"
     314{
     315
     316}
     317example
     318{
     319  "EXAMPLE:"; echo = 2;
     320  // Let's define a cone in R^3 given by the following inequalities:
     321  intmat IE[6][3]=
     322  1,3,5,
     323  1,5,3,
     324  0,1,-1,
     325  0,1,1,
     326  1,0,0,
     327  -1,0,0;
     328  cone c=coneViaInequalities(IE);
     329  c;
     330  // Note that the last two inequalities yield x1 = 0, hence also possible:
     331  intmat IE[4][3]=
     332  0,1,-1,
     333  0,1,1;
     334  intmat E[1][3]=
     335  1,0,0;
     336  cone c=coneViaInequalities(IE,E);
     337  c;
     338  // each inequalities gives rise to a facet
     339  intmat IE[2][3]=
     340  0,1,-1,
     341  0,1,1;
     342  intmat E[1][3]=
     343  1,0,0;
     344  cone c=coneViaInequalities(IE,E,1);
     345  c;
     346  // and the kernel of E is the span of the cone
     347  intmat IE[2][3]=
     348  0,1,-1,
     349  0,1,1;
     350  intmat E[1][3]=
     351  1,0,0;
     352  cone c=coneViaInequalities(IE,E,3);
     353  c;
     354}
     355
    224356proc coneLink()
    225357"USAGE:   coneLink(c,w);  c cone, w intvec/bigintmat
     
    273405  containsInSupport(c,d2);
    274406  containsAsFace(c,d2);
     407}
     408
     409proc containsRelatively()
     410"USAGE:   containsRelatively(c,p);  c cone, intvec p
     411RETURN:  1 iff the given cone contains the given point in its relative interior; 0 otherwise
     412EXAMPLE: example containsRelatively; shows an example
     413"
     414{
     415
     416}
     417example
     418{
     419  "EXAMPLE:"; echo = 2;
     420  intmat M[2][2]=
     421  1,0,
     422  0,1;
     423  cone c=coneViaPoints(M);
     424  intvec p1=1,1;
     425  containsRelatively(c,p1);
     426  intvec p2=0,1;
     427  containsRelatively(c,p2);
    275428}
    276429
Note: See TracChangeset for help on using the changeset viewer.