Changeset a7cb00 in git
- Timestamp:
- Sep 30, 2016, 1:32:51 PM (8 years ago)
- Branches:
- (u'spielwiese', '73c62e0961bcfc8f1a00420b41eec2ea3c0ef6e9')
- Children:
- 6b5e56f646727b9c59f35f2dddeaf888f39e5493
- Parents:
- 6dddc1749bb9cabb0076e15b222acb41142d9d8b
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/gfan.lib
r6dddc17 ra7cb00 40 40 linealitySpace(c); the lineality space of c 41 41 negatedCone(c); the negative of c 42 polytopeViaInequalities(); 43 polytopeViaPoints(); 42 44 quotientLatticeBasis(c); basis of Z^n intersected with the span of c modulo Z^n intersected with the lineality space of c 43 45 randomPoint(c); a random point in the relative interior of c … … 1540 1542 } 1541 1543 1544 proc polytopeViaPoints() 1545 "USAGE: polytopeViaPoints(V [, flags]); intmat V, int flags 1546 RETURN: polytope which is the intersection of the cone generated by the row vectors 1547 of V with the hyperplane, in which the first coordinate equals 1; 1548 flags may be 0 or 1,@* 1549 if flags is 1, then program assumes that each row vector of M generates a ray in the cone, 1550 if flags is 0, then program computes that information itself 1551 EXAMPLE: example polytopeViaPoints; shows an example 1552 " 1553 { 1554 1555 } 1556 example 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 1584 proc polytopeViaInequalities() 1585 "USAGE: polytopeViaInequalities(EV [, E [, flags]]); intmat EV,E, int flags 1586 RETURN: polytope consisting of all points x, such that IE*x >= 0 in each component 1587 and (if stated) E*x = 0; 1588 flags 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), 1590 if higher bit is 1, then program assumes each inequality yields a facet, 1591 if lower bit is 1, then program assumes the kernel of E is the span of the cone, 1592 if either bit is 0, then program computes the information itself. 1593 EXAMPLE: example polytopeViaPoints; shows an example 1594 " 1595 { 1596 1597 } 1598 example 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 1542 1610 proc vertices() 1543 1611 "USAGE: vertices(p); p polytope -
Singular/LIB/polymakeInterface.lib
r6dddc17 ra7cb00 43 43 nLatticePoints(); 44 44 normalFan(); 45 polytopeViaInequalities(); 46 polytopeViaPoints(); 45 47 vertexAdjacencyGraph(); 46 48 vertexEdgeGraph(); … … 957 959 } 958 960 961 proc polytopeViaPoints() 962 "USAGE: polytopeViaPoints(V [, flags]); intmat V, int flags 963 RETURN: polytope which is the intersection of the cone generated by the row vectors 964 of V with the hyperplane, in which the first coordinate equals 1; 965 flags may be 0 or 1,@* 966 if flags is 1, then program assumes that each row vector of M generates a ray in the cone, 967 if flags is 0, then program computes that information itself 968 EXAMPLE: example polytopeViaPoints; shows an example 969 " 970 { 971 972 } 973 example 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 1001 proc polytopeViaInequalities() 1002 "USAGE: polytopeViaInequalities(EV [, E [, flags]]); intmat EV,E, int flags 1003 RETURN: polytope consisting of all points x, such that IE*x >= 0 in each component 1004 and (if stated) E*x = 0; 1005 flags 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), 1007 if higher bit is 1, then program assumes each inequality yields a facet, 1008 if lower bit is 1, then program assumes the kernel of E is the span of the cone, 1009 if either bit is 0, then program computes the information itself. 1010 EXAMPLE: example polytopeViaPoints; shows an example 1011 " 1012 { 1013 1014 } 1015 example 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 959 1027 proc vertexAdjacencyGraph() 960 1028 "USAGE: vertexAdjacencyGraph(p); p polytope
Note: See TracChangeset
for help on using the changeset viewer.