Changeset a7cb00 in git


Ignore:
Timestamp:
Sep 30, 2016, 1:32:51 PM (8 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', '73c62e0961bcfc8f1a00420b41eec2ea3c0ef6e9')
Children:
6b5e56f646727b9c59f35f2dddeaf888f39e5493
Parents:
6dddc1749bb9cabb0076e15b222acb41142d9d8b
Message:
doc: polytopeVia... -> gfan.lib
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • Singular/LIB/gfan.lib

    r6dddc17 ra7cb00  
    4040       linealitySpace(c);    the lineality space of c
    4141       negatedCone(c);       the negative of c
     42       polytopeViaInequalities();
     43       polytopeViaPoints();
    4244       quotientLatticeBasis(c);  basis of Z^n intersected with the span of c modulo Z^n intersected with the lineality space of c
    4345       randomPoint(c);       a random point in the relative interior of c
     
    15401542}
    15411543
     1544proc polytopeViaPoints()
     1545"USAGE: polytopeViaPoints(V [, flags]);  intmat V, int flags
     1546RETURN: polytope which is the intersection of the cone generated by the row vectors
     1547of V with the hyperplane, in which the first coordinate equals 1;
     1548flags may be 0 or 1,@*
     1549if flags is 1, then program assumes that each row vector of M generates a ray in the cone,
     1550if flags is 0, then program computes that information itself
     1551EXAMPLE: example polytopeViaPoints; shows an example
     1552"
     1553{
     1554
     1555}
     1556example
     1557{
     1558  "EXAMPLE:"; echo = 2;
     1559  // This is a polytope in R^2 generated by (0,0), (1,0), (0,1), (0,0);
     1560  intmat V[4][3]=
     1561  1,0,0,
     1562  1,1,0,
     1563  1,0,1,
     1564  1,1,1;
     1565  polytope p1=polytopeViaPoints(V);
     1566  p1;
     1567  // This is a polytope in R^2 generated by (1/2,2/3), (3/4,4/5), (5/6,6/7):
     1568  intmat V[3][3]=
     1569  6,3,4,
     1570  20,15,16,
     1571  42,35,36;
     1572  polytope p2=polytopeViaPoints(V);
     1573  p2;
     1574  // This polytope is the positive orthant in R^2:
     1575  // (0,1,0) and (0,0,1) imply that the polytope is unbounded in that direction
     1576  intmat V[3][3]=
     1577  1,0,0,
     1578  0,1,0,
     1579  0,0,1;
     1580  polytope p3=polytopeViaPoints(V);
     1581  p3;
     1582}
     1583
     1584proc polytopeViaInequalities()
     1585"USAGE: polytopeViaInequalities(EV [, E [, flags]]);  intmat EV,E, int flags
     1586RETURN: polytope consisting of all points x, such that IE*x >= 0 in each component
     1587and (if stated) E*x = 0;
     1588flags may range between 0,..,3 defining an upper and lower bit
     1589(0=0*2+0, 1=0*2+1, 2=1*2+0, 3=1*2+1),
     1590if higher bit is 1, then program assumes each inequality yields a facet,
     1591if lower bit is 1, then program assumes the kernel of E is the span of the cone,
     1592if either bit is 0, then program computes the information itself.
     1593EXAMPLE: example polytopeViaPoints; shows an example
     1594"
     1595{
     1596
     1597}
     1598example
     1599{
     1600  "EXAMPLE:"; echo = 2;
     1601  intmat IE[2][3]=
     1602  1,0,0,
     1603  0,1,0;
     1604  intmat E[1][3]=
     1605  0,0,1;
     1606  polytope p=polytopeViaInequalities(IE,E);
     1607  p;
     1608}
     1609
    15421610proc vertices()
    15431611"USAGE:   vertices(p);  p polytope
  • Singular/LIB/polymakeInterface.lib

    r6dddc17 ra7cb00  
    4343    nLatticePoints();
    4444    normalFan();
     45    polytopeViaInequalities();
     46    polytopeViaPoints();
    4547    vertexAdjacencyGraph();
    4648    vertexEdgeGraph();
     
    957959}
    958960
     961proc polytopeViaPoints()
     962"USAGE: polytopeViaPoints(V [, flags]);  intmat V, int flags
     963RETURN: polytope which is the intersection of the cone generated by the row vectors
     964of V with the hyperplane, in which the first coordinate equals 1;
     965flags may be 0 or 1,@*
     966if flags is 1, then program assumes that each row vector of M generates a ray in the cone,
     967if flags is 0, then program computes that information itself
     968EXAMPLE: example polytopeViaPoints; shows an example
     969"
     970{
     971
     972}
     973example
     974{
     975  "EXAMPLE:"; echo = 2;
     976  // This is a polytope in R^2 generated by (0,0), (1,0), (0,1), (0,0);
     977  intmat V[4][3]=
     978  1,0,0,
     979  1,1,0,
     980  1,0,1,
     981  1,1,1;
     982  polytope p1=polytopeViaPoints(V);
     983  p1;
     984  // This is a polytope in R^2 generated by (1/2,2/3), (3/4,4/5), (5/6,6/7):
     985  intmat V[3][3]=
     986  6,3,4,
     987  20,15,16,
     988  42,35,36;
     989  polytope p2=polytopeViaPoints(V);
     990  p2;
     991  // This polytope is the positive orthant in R^2:
     992  // (0,1,0) and (0,0,1) imply that the polytope is unbounded in that direction
     993  intmat V[3][3]=
     994  1,0,0,
     995  0,1,0,
     996  0,0,1;
     997  polytope p3=polytopeViaPoints(V);
     998  p3;
     999}
     1000
     1001proc polytopeViaInequalities()
     1002"USAGE: polytopeViaInequalities(EV [, E [, flags]]);  intmat EV,E, int flags
     1003RETURN: polytope consisting of all points x, such that IE*x >= 0 in each component
     1004and (if stated) E*x = 0;
     1005flags may range between 0,..,3 defining an upper and lower bit
     1006(0=0*2+0, 1=0*2+1, 2=1*2+0, 3=1*2+1),
     1007if higher bit is 1, then program assumes each inequality yields a facet,
     1008if lower bit is 1, then program assumes the kernel of E is the span of the cone,
     1009if either bit is 0, then program computes the information itself.
     1010EXAMPLE: example polytopeViaPoints; shows an example
     1011"
     1012{
     1013
     1014}
     1015example
     1016{
     1017  "EXAMPLE:"; echo = 2;
     1018  intmat IE[2][3]=
     1019  1,0,0,
     1020  0,1,0;
     1021  intmat E[1][3]=
     1022  0,0,1;
     1023  polytope p=polytopeViaInequalities(IE,E);
     1024  p;
     1025}
     1026
    9591027proc vertexAdjacencyGraph()
    9601028"USAGE:   vertexAdjacencyGraph(p);  p polytope
Note: See TracChangeset for help on using the changeset viewer.