passagemath-gap-pkg-cddinterface 10.6.32__cp312-abi3-macosx_13_0_x86_64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of passagemath-gap-pkg-cddinterface might be problematic. Click here for more details.
- gap/pkg/cddinterface/LICENSE +344 -0
- gap/pkg/cddinterface/PackageInfo.g +103 -0
- gap/pkg/cddinterface/README.md +129 -0
- gap/pkg/cddinterface/ToDo.txt +2 -0
- gap/pkg/cddinterface/bin/x86_64-apple-darwin24-default64-kv10/CddInterface.so +0 -0
- gap/pkg/cddinterface/etc/download.sh +86 -0
- gap/pkg/cddinterface/examples/30x30.g +5 -0
- gap/pkg/cddinterface/examples/FourierProjection.g +83 -0
- gap/pkg/cddinterface/examples/comparing_polyhedrons.g +32 -0
- gap/pkg/cddinterface/examples/demo.g +65 -0
- gap/pkg/cddinterface/examples/example1.g +115 -0
- gap/pkg/cddinterface/examples/intersection.g +35 -0
- gap/pkg/cddinterface/examples/linear_programs.g +64 -0
- gap/pkg/cddinterface/examples/minkuwski.g +35 -0
- gap/pkg/cddinterface/examples/new.g +5 -0
- gap/pkg/cddinterface/examples/new2.g +8 -0
- gap/pkg/cddinterface/gap/Julia.gd +3 -0
- gap/pkg/cddinterface/gap/Julia.gi +15 -0
- gap/pkg/cddinterface/gap/polyhedra.gd +268 -0
- gap/pkg/cddinterface/gap/polyhedra.gi +871 -0
- gap/pkg/cddinterface/gap/tools.gd +12 -0
- gap/pkg/cddinterface/gap/tools.gi +472 -0
- gap/pkg/cddinterface/init.g +17 -0
- gap/pkg/cddinterface/install.sh +64 -0
- gap/pkg/cddinterface/makedoc.g +19 -0
- gap/pkg/cddinterface/read.g +12 -0
- gap/pkg/cddinterface/tst/01.tst +37 -0
- gap/pkg/cddinterface/tst/02.tst +36 -0
- gap/pkg/cddinterface/tst/03.tst +50 -0
- gap/pkg/cddinterface/tst/04.tst +51 -0
- gap/pkg/cddinterface/tst/05.tst +41 -0
- gap/pkg/cddinterface/tst/06.tst +44 -0
- gap/pkg/cddinterface/tst/07.tst +46 -0
- gap/pkg/cddinterface/tst/08.tst +66 -0
- gap/pkg/cddinterface/tst/09.tst +28 -0
- gap/pkg/cddinterface/tst/10.tst +56 -0
- gap/pkg/cddinterface/tst/11.tst +70 -0
- gap/pkg/cddinterface/tst/etest_1.tst +6 -0
- gap/pkg/cddinterface/tst/etest_2.tst +33 -0
- gap/pkg/cddinterface/tst/testall.g +10 -0
- passagemath_gap_pkg_cddinterface-10.6.32.dist-info/METADATA +93 -0
- passagemath_gap_pkg_cddinterface-10.6.32.dist-info/METADATA.bak +94 -0
- passagemath_gap_pkg_cddinterface-10.6.32.dist-info/RECORD +50 -0
- passagemath_gap_pkg_cddinterface-10.6.32.dist-info/WHEEL +6 -0
- passagemath_gap_pkg_cddinterface-10.6.32.dist-info/top_level.txt +1 -0
- passagemath_gap_pkg_cddinterface.dylibs/libcddgmp.0.dylib +0 -0
- passagemath_gap_pkg_cddinterface.dylibs/libgmp.10.dylib +0 -0
- sage/all__sagemath_gap_pkg_cddinterface.py +1 -0
- sage/libs/all__sagemath_gap_pkg_cddinterface.py +1 -0
- sage/libs/gap_pkg_cddinterface.abi3.so +0 -0
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
LoadPackage( "CddInterface" );
|
|
2
|
+
|
|
3
|
+
#! @Chunk Fourier
|
|
4
|
+
#! To illustrate this projection, Let $P= \mathrm{conv}( (1,2), (4,5) )$ in $\mathbb{Q}^2$.
|
|
5
|
+
#! $\newline$
|
|
6
|
+
#! To find its projection on the subspace $(O, x_1)$, we apply the Fourier elemination to get rid of $x_2$
|
|
7
|
+
#! @Example
|
|
8
|
+
P := Cdd_PolyhedronByGenerators( [ [ 1, 1, 2 ], [ 1, 4, 5 ] ] );
|
|
9
|
+
#! <Polyhedron given by its V-representation>
|
|
10
|
+
H := Cdd_H_Rep( P );
|
|
11
|
+
#! <Polyhedron given by its H-representation>
|
|
12
|
+
Display( H );
|
|
13
|
+
#! H-representation
|
|
14
|
+
#! linearity 1, [ 3 ]
|
|
15
|
+
#! begin
|
|
16
|
+
#! 3 X 3 rational
|
|
17
|
+
#!
|
|
18
|
+
#! 4 -1 0
|
|
19
|
+
#! -1 1 0
|
|
20
|
+
#! -1 -1 1
|
|
21
|
+
#! end
|
|
22
|
+
P_x1 := Cdd_FourierProjection( H, 2);
|
|
23
|
+
#! <Polyhedron given by its H-representation>
|
|
24
|
+
Display( P_x1 );
|
|
25
|
+
#! H-representation
|
|
26
|
+
#! linearity 1, [ 3 ]
|
|
27
|
+
#! begin
|
|
28
|
+
#! 3 X 3 rational
|
|
29
|
+
#!
|
|
30
|
+
#! 4 -1 0
|
|
31
|
+
#! -1 1 0
|
|
32
|
+
#! 0 0 1
|
|
33
|
+
#! end
|
|
34
|
+
Display( Cdd_V_Rep( P_x1 ) );
|
|
35
|
+
#! V-representation
|
|
36
|
+
#! begin
|
|
37
|
+
#! 2 X 3 rational
|
|
38
|
+
#!
|
|
39
|
+
#! 1 1 0
|
|
40
|
+
#! 1 4 0
|
|
41
|
+
#! end
|
|
42
|
+
|
|
43
|
+
#! @EndExample
|
|
44
|
+
#! Let again $Q= Conv( (2,3,4), (2,4,5) )+ nonneg( (1,1,1) )$, and let us compute its projection on $(O,x_2,x_3)$
|
|
45
|
+
#! @Example
|
|
46
|
+
Q := Cdd_PolyhedronByGenerators( [ [ 1, 2, 3, 4 ],[ 1, 2, 4, 5 ], [ 0, 1, 1, 1 ] ] );
|
|
47
|
+
#! <Polyhedron given by its V-representation>
|
|
48
|
+
R := Cdd_H_Rep( Q );
|
|
49
|
+
#! <Polyhedron given by its H-representation>
|
|
50
|
+
Display( R );
|
|
51
|
+
#! H-representation
|
|
52
|
+
#! linearity 1, [ 4 ]
|
|
53
|
+
#! begin
|
|
54
|
+
#! 4 X 4 rational
|
|
55
|
+
#!
|
|
56
|
+
#! 2 1 -1 0
|
|
57
|
+
#! -2 1 0 0
|
|
58
|
+
#! -1 -1 1 0
|
|
59
|
+
#! -1 0 -1 1
|
|
60
|
+
#! end
|
|
61
|
+
P_x2_x3 := Cdd_FourierProjection( R, 1);
|
|
62
|
+
#! <Polyhedron given by its H-representation>
|
|
63
|
+
Display( P_x2_x3 );
|
|
64
|
+
#! H-representation
|
|
65
|
+
#! linearity 2, [ 1, 3 ]
|
|
66
|
+
#! begin
|
|
67
|
+
#! 3 X 4 rational
|
|
68
|
+
#!
|
|
69
|
+
#! -1 0 -1 1
|
|
70
|
+
#! -3 0 1 0
|
|
71
|
+
#! 0 1 0 0
|
|
72
|
+
#! end
|
|
73
|
+
Display( Cdd_V_Rep( last ) ) ;
|
|
74
|
+
#! V-representation
|
|
75
|
+
#! begin
|
|
76
|
+
#! 2 X 4 rational
|
|
77
|
+
#!
|
|
78
|
+
#! 0 0 1 1
|
|
79
|
+
#! 1 0 3 4
|
|
80
|
+
#! end
|
|
81
|
+
#! @EndExample
|
|
82
|
+
#! @EndChunk
|
|
83
|
+
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
|
|
2
|
+
LoadPackage( "CddInterface" );
|
|
3
|
+
|
|
4
|
+
#! @BeginChunk comparing_polyhedrons
|
|
5
|
+
#! @BeginExample
|
|
6
|
+
A := Cdd_PolyhedronByInequalities( [ [ 10, -1, 1, 0 ],
|
|
7
|
+
[ -24, 9, 2, 0 ], [ 1, 1, -1, 0 ], [ -23, -12, 1, 11 ] ], [ 4 ] );
|
|
8
|
+
#! <Polyhedron given by its H-representation>
|
|
9
|
+
B := Cdd_PolyhedronByInequalities( [ [ 1, 0, 0, 0 ],
|
|
10
|
+
[ -4, 1, 0, 0 ], [ 10, -1, 1, 0 ], [ -3, -1, 0, 1 ] ], [ 3, 4 ] );
|
|
11
|
+
#! <Polyhedron given by its H-representation>
|
|
12
|
+
Cdd_IsContained( B, A );
|
|
13
|
+
#! true
|
|
14
|
+
Display( Cdd_V_Rep( A ) );
|
|
15
|
+
#! V-representation
|
|
16
|
+
#! begin
|
|
17
|
+
#! 3 X 4 rational
|
|
18
|
+
#!
|
|
19
|
+
#! 1 2 3 4
|
|
20
|
+
#! 1 4 -6 7
|
|
21
|
+
#! 0 1 1 1
|
|
22
|
+
#! end
|
|
23
|
+
Display( Cdd_V_Rep( B ) );
|
|
24
|
+
#! V-representation
|
|
25
|
+
#! begin
|
|
26
|
+
#! 2 X 4 rational
|
|
27
|
+
#!
|
|
28
|
+
#! 1 4 -6 7
|
|
29
|
+
#! 0 1 1 1
|
|
30
|
+
#! end
|
|
31
|
+
#! @EndExample
|
|
32
|
+
#! @EndChunk
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
LoadPackage( "CddInterface" );
|
|
4
|
+
|
|
5
|
+
#! @Chunk demo
|
|
6
|
+
#! @Example
|
|
7
|
+
poly:= Cdd_PolyhedronByInequalities( [ [ 1, 3, 4, 5, 7 ], [ 1, 3, 5, 12, 34 ],
|
|
8
|
+
[ 9, 3, 0, 2, 13 ] ], [ 1 ] );
|
|
9
|
+
#! <Polyhedron given by its H-representation>
|
|
10
|
+
Cdd_InteriorPoint( poly );
|
|
11
|
+
#! [ -194/75, 46/25, -3/25, 0 ]
|
|
12
|
+
|
|
13
|
+
Cdd_FacesWithInteriorPoints( poly );
|
|
14
|
+
#! [ [ 3, [ 1 ], [ -194/75, 46/25, -3/25, 0 ] ], [ 2, [ 1, 2 ],
|
|
15
|
+
#! [ -62/25, 49/25, -7/25, 0 ] ], [ 1, [ 1, 2, 3 ],
|
|
16
|
+
#! [ -209/75, 56/25, -8/25, 0 ] ], [ 2, [ 1, 3 ], [ -217/75, 53/25, -4/25, 0 ] ] ]
|
|
17
|
+
|
|
18
|
+
Cdd_Dimension( poly );
|
|
19
|
+
#! 3
|
|
20
|
+
Cdd_IsPointed( poly );
|
|
21
|
+
#! false
|
|
22
|
+
Cdd_IsEmpty( poly );
|
|
23
|
+
#! false
|
|
24
|
+
Cdd_Faces( poly );
|
|
25
|
+
#! [ [ 3, [ 1 ] ], [ 2, [ 1, 2 ] ], [ 1, [ 1, 2, 3 ] ], [ 2, [ 1, 3 ] ] ]
|
|
26
|
+
poly1 := Cdd_ExtendLinearity( poly, [ 1, 2, 3 ] );
|
|
27
|
+
#! <Polyhedron given by its H-representation>
|
|
28
|
+
Display( poly1 );
|
|
29
|
+
#! H-representation
|
|
30
|
+
#! linearity 3, [ 1, 2, 3 ]
|
|
31
|
+
#! begin
|
|
32
|
+
#! 3 X 5 rational
|
|
33
|
+
#!
|
|
34
|
+
#! 1 3 4 5 7
|
|
35
|
+
#! 1 3 5 12 34
|
|
36
|
+
#! 9 3 0 2 13
|
|
37
|
+
#! end
|
|
38
|
+
Cdd_Dimension( poly1 );
|
|
39
|
+
#! 1
|
|
40
|
+
Cdd_Facets( poly );
|
|
41
|
+
#! [ [ 1, 2 ], [ 1, 3 ] ]
|
|
42
|
+
Cdd_GeneratingVertices( poly );
|
|
43
|
+
#! [ [ -209/75, 56/25, -8/25, 0 ] ]
|
|
44
|
+
Cdd_GeneratingRays( poly );
|
|
45
|
+
#! [ [ -97, 369, -342, 75 ], [ -8, -9, 12, 0 ],
|
|
46
|
+
#! [ 23, -21, 3, 0 ], [ 97, -369, 342, -75 ] ]
|
|
47
|
+
Cdd_Inequalities( poly );
|
|
48
|
+
#! [ [ 1, 3, 5, 12, 34 ], [ 9, 3, 0, 2, 13 ] ]
|
|
49
|
+
Cdd_Equalities( poly );
|
|
50
|
+
#! [ [ 1, 3, 4, 5, 7 ] ]
|
|
51
|
+
P := Cdd_FourierProjection( poly, 2);
|
|
52
|
+
#! <Polyhedron given by its H-representation>
|
|
53
|
+
Display( P );
|
|
54
|
+
#! H-representation
|
|
55
|
+
#! linearity 1, [ 3 ]
|
|
56
|
+
#! begin
|
|
57
|
+
#! 3 X 5 rational
|
|
58
|
+
#!
|
|
59
|
+
#! 9 3 0 2 13
|
|
60
|
+
#! -1 -3 0 23 101
|
|
61
|
+
#! 0 0 1 0 0
|
|
62
|
+
#! end
|
|
63
|
+
#! @EndExample
|
|
64
|
+
#! @EndChunk
|
|
65
|
+
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
LoadPackage("CddInterface");
|
|
2
|
+
|
|
3
|
+
#! @Chunk Example1
|
|
4
|
+
#! @Example
|
|
5
|
+
A:= Cdd_PolyhedronByInequalities( [ [ 0, 1, 0 ], [ 0, 1, -1 ] ] );
|
|
6
|
+
#! <Polyhedron given by its H-representation>
|
|
7
|
+
Display( A );
|
|
8
|
+
#! H-representation
|
|
9
|
+
#! begin
|
|
10
|
+
#! 2 X 3 rational
|
|
11
|
+
#!
|
|
12
|
+
#! 0 1 0
|
|
13
|
+
#! 0 1 -1
|
|
14
|
+
#! end
|
|
15
|
+
B:= Cdd_PolyhedronByInequalities( [ [ 0, 1, 0 ], [ 0, 1, -1 ] ], [ 2 ] );
|
|
16
|
+
#! <Polyhedron given by its H-representation>
|
|
17
|
+
Display( B );
|
|
18
|
+
#! H-representation
|
|
19
|
+
#! linearity 1, [ 2 ]
|
|
20
|
+
#! begin
|
|
21
|
+
#! 2 X 3 rational
|
|
22
|
+
#!
|
|
23
|
+
#! 0 1 0
|
|
24
|
+
#! 0 1 -1
|
|
25
|
+
#! end
|
|
26
|
+
#! @EndExample
|
|
27
|
+
#! @EndChunk
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
#! @Chunk Example2
|
|
31
|
+
#! @Example
|
|
32
|
+
A:= Cdd_PolyhedronByGenerators( [ [ 0, 1, 3 ], [ 1, 4, 5 ] ] );
|
|
33
|
+
#! <Polyhedron given by its V-representation>
|
|
34
|
+
Display( A );
|
|
35
|
+
#! V-representation
|
|
36
|
+
#! begin
|
|
37
|
+
#! 2 X 3 rational
|
|
38
|
+
#!
|
|
39
|
+
#! 0 1 3
|
|
40
|
+
#! 1 4 5
|
|
41
|
+
#! end
|
|
42
|
+
B:= Cdd_PolyhedronByGenerators( [ [ 0, 1, 3 ] ], [ 1 ] );
|
|
43
|
+
#! <Polyhedron given by its V-representation>
|
|
44
|
+
Display( B );
|
|
45
|
+
#! V-representation
|
|
46
|
+
#! linearity 1, [ 1 ]
|
|
47
|
+
#! begin
|
|
48
|
+
#! 1 X 3 rational
|
|
49
|
+
#!
|
|
50
|
+
#! 0 1 3
|
|
51
|
+
#! end
|
|
52
|
+
#! @EndExample
|
|
53
|
+
#! @EndChunk
|
|
54
|
+
|
|
55
|
+
#! @Chunk Example3
|
|
56
|
+
#! @Example
|
|
57
|
+
A:= Cdd_PolyhedronByInequalities( [ [ 0, 2, 6 ], [ 0, 1, 3 ], [1, 4, 10 ] ] );
|
|
58
|
+
#! <Polyhedron given by its H-representation>
|
|
59
|
+
B:= Cdd_Canonicalize( A );
|
|
60
|
+
#! <Polyhedron given by its H-representation>
|
|
61
|
+
Display( B );
|
|
62
|
+
#! H-representation
|
|
63
|
+
#! begin
|
|
64
|
+
#! 2 X 3 rational
|
|
65
|
+
#!
|
|
66
|
+
#! 0 1 3
|
|
67
|
+
#! 1 4 10
|
|
68
|
+
#! end
|
|
69
|
+
#! @EndExample
|
|
70
|
+
#! @EndChunk
|
|
71
|
+
|
|
72
|
+
#! @Chunk Example4
|
|
73
|
+
#! @Example
|
|
74
|
+
A:= Cdd_PolyhedronByInequalities( [ [ 0, 1, 1 ], [ 0, 5, 5 ] ] );
|
|
75
|
+
#! <Polyhedron given by its H-representation>
|
|
76
|
+
B:= Cdd_V_Rep( A );
|
|
77
|
+
#! <Polyhedron given by its V-representation>
|
|
78
|
+
Display( B );
|
|
79
|
+
#! V-representation
|
|
80
|
+
#! linearity 1, [ 2 ]
|
|
81
|
+
#! begin
|
|
82
|
+
#! 2 X 3 rational
|
|
83
|
+
#!
|
|
84
|
+
#! 0 1 0
|
|
85
|
+
#! 0 -1 1
|
|
86
|
+
#! end
|
|
87
|
+
C:= Cdd_H_Rep( B );
|
|
88
|
+
#! <Polyhedron given by its H-representation>
|
|
89
|
+
Display( C );
|
|
90
|
+
#! H-representation
|
|
91
|
+
#! begin
|
|
92
|
+
#! 1 X 3 rational
|
|
93
|
+
#!
|
|
94
|
+
#! 0 1 1
|
|
95
|
+
#! end
|
|
96
|
+
D:= Cdd_PolyhedronByInequalities( [ [ 0, 1, 1, 34, 22, 43 ],
|
|
97
|
+
[ 11, 2, 2, 54, 53, 221 ], [33, 23, 45, 2, 40, 11 ] ] );
|
|
98
|
+
#! <Polyhedron given by its H-representation>
|
|
99
|
+
Cdd_V_Rep( D );
|
|
100
|
+
#! <Polyhedron given by its V-representation>
|
|
101
|
+
Display( last );
|
|
102
|
+
#! V-representation
|
|
103
|
+
#! linearity 2, [ 5, 6 ]
|
|
104
|
+
#! begin
|
|
105
|
+
#! 6 X 6 rational
|
|
106
|
+
#!
|
|
107
|
+
#! 1 -743/14 369/14 11/14 0 0
|
|
108
|
+
#! 0 -1213 619 22 0 0
|
|
109
|
+
#! 0 -1 1 0 0 0
|
|
110
|
+
#! 0 764 -390 -11 0 0
|
|
111
|
+
#! 0 -13526 6772 99 154 0
|
|
112
|
+
#! 0 -116608 59496 1485 0 154
|
|
113
|
+
#! end
|
|
114
|
+
#! @EndExample
|
|
115
|
+
#! @EndChunk
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
LoadPackage( "CddInterface" );
|
|
2
|
+
|
|
3
|
+
#! @BeginChunk intersection
|
|
4
|
+
#! @BeginExample
|
|
5
|
+
A := Cdd_PolyhedronByInequalities( [ [ 3, 4, 5 ] ], [ 1 ] );;
|
|
6
|
+
B := Cdd_PolyhedronByInequalities( [ [ 9, 7, 2 ] ], [ 1 ] );;
|
|
7
|
+
C := Cdd_Intersection( A, B );;
|
|
8
|
+
Display( Cdd_V_Rep( A ) );
|
|
9
|
+
#! V-representation
|
|
10
|
+
#! linearity 1, [ 2 ]
|
|
11
|
+
#! begin
|
|
12
|
+
#! 2 X 3 rational
|
|
13
|
+
#!
|
|
14
|
+
#! 1 -3/4 0
|
|
15
|
+
#! 0 -5 4
|
|
16
|
+
#! end
|
|
17
|
+
Display( Cdd_V_Rep( B ) );
|
|
18
|
+
#! V-representation
|
|
19
|
+
#! linearity 1, [ 2 ]
|
|
20
|
+
#! begin
|
|
21
|
+
#! 2 X 3 rational
|
|
22
|
+
#!
|
|
23
|
+
#! 1 -9/7 0
|
|
24
|
+
#! 0 -2 7
|
|
25
|
+
#! end
|
|
26
|
+
Display( Cdd_V_Rep( C ) );
|
|
27
|
+
#! V-representation
|
|
28
|
+
#! begin
|
|
29
|
+
#! 1 X 3 rational
|
|
30
|
+
#!
|
|
31
|
+
#! 1 -13/9 5/9
|
|
32
|
+
#! end
|
|
33
|
+
#! @EndExample
|
|
34
|
+
#! @EndChunk
|
|
35
|
+
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
LoadPackage( "CddInterface" );
|
|
2
|
+
|
|
3
|
+
#! @Chunk Example5
|
|
4
|
+
#! To illustrate the using of these functions, let us solve the linear program given by:
|
|
5
|
+
#! $$\textbf{Maximize}\;\;P(x,y)= 1-2x+5y,\;\mathrm{with}$$
|
|
6
|
+
#! $$100\leq x \leq 200,80\leq y\leq 170,y \geq -x+200.$$
|
|
7
|
+
#! We bring the inequalities to the form $b+AX\geq 0$ and get:
|
|
8
|
+
#! $$-100+x\geq 0, 200-x \geq 0, -80+y \geq 0, 170 -y \geq 0,-200 +x+y \geq 0.$$
|
|
9
|
+
#! @Example
|
|
10
|
+
A:= Cdd_PolyhedronByInequalities( [ [ -100, 1, 0 ], [ 200, -1, 0 ],
|
|
11
|
+
[ -80, 0, 1 ], [ 170, 0, -1 ], [ -200, 1, 1 ] ] );
|
|
12
|
+
#! <Polyhedron given by its H-representation>
|
|
13
|
+
lp1:= Cdd_LinearProgram( A, "max", [1, -2, 5 ] );
|
|
14
|
+
#! <Linear program>
|
|
15
|
+
Display( lp1 );
|
|
16
|
+
#! Linear program given by:
|
|
17
|
+
#! H-representation
|
|
18
|
+
#! begin
|
|
19
|
+
#! 5 X 3 rational
|
|
20
|
+
#!
|
|
21
|
+
#! -100 1 0
|
|
22
|
+
#! 200 -1 0
|
|
23
|
+
#! -80 0 1
|
|
24
|
+
#! 170 0 -1
|
|
25
|
+
#! -200 1 1
|
|
26
|
+
#! end
|
|
27
|
+
#! max [ 1, -2, 5 ]
|
|
28
|
+
Cdd_SolveLinearProgram( lp1 );
|
|
29
|
+
#! [ [ 100, 170 ], 651 ]
|
|
30
|
+
lp2:= Cdd_LinearProgram( A, "min", [ 1, -2, 5 ] );
|
|
31
|
+
#! <Linear program>
|
|
32
|
+
Display( lp2 );
|
|
33
|
+
#! Linear program given by:
|
|
34
|
+
#! H-representation
|
|
35
|
+
#! begin
|
|
36
|
+
#! 5 X 3 rational
|
|
37
|
+
#!
|
|
38
|
+
#! -100 1 0
|
|
39
|
+
#! 200 -1 0
|
|
40
|
+
#! -80 0 1
|
|
41
|
+
#! 170 0 -1
|
|
42
|
+
#! -200 1 1
|
|
43
|
+
#! end
|
|
44
|
+
#! min [ 1, -2, 5 ]
|
|
45
|
+
Cdd_SolveLinearProgram( lp2 );
|
|
46
|
+
#! [ [ 200, 80 ], 1 ]
|
|
47
|
+
B:= Cdd_V_Rep( A );
|
|
48
|
+
#! <Polyhedron given by its V-representation>
|
|
49
|
+
Display( B );
|
|
50
|
+
#! V-representation
|
|
51
|
+
#! begin
|
|
52
|
+
#! 5 X 3 rational
|
|
53
|
+
#!
|
|
54
|
+
#! 1 100 170
|
|
55
|
+
#! 1 100 100
|
|
56
|
+
#! 1 120 80
|
|
57
|
+
#! 1 200 80
|
|
58
|
+
#! 1 200 170
|
|
59
|
+
#! end
|
|
60
|
+
#! @EndExample
|
|
61
|
+
#! So the optimal solution for $\texttt{lp1}$ is $(x=100,y=170)$ with optimal value $p=1-2(100)+5(170)=651$ and for $\texttt{lp2}$ is
|
|
62
|
+
#! $(x=200,y=80)$ with optimal value $p=1-2(200)+5(80)=1$.
|
|
63
|
+
#! @EndChunk
|
|
64
|
+
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
#! @Chunk minkuwski
|
|
2
|
+
#! @Example
|
|
3
|
+
P := Cdd_PolyhedronByGenerators( [ [ 1, 2, 5 ], [ 0, 1, 2 ] ] );
|
|
4
|
+
#! < Polyhedron given by its V-representation >
|
|
5
|
+
Q := Cdd_PolyhedronByGenerators( [ [ 1, 4, 6 ], [ 1, 3, 7 ], [ 0, 3, 1 ] ] );
|
|
6
|
+
#! < Polyhedron given by its V-representation >
|
|
7
|
+
S := P+Q;
|
|
8
|
+
#! < Polyhedron given by its H-representation >
|
|
9
|
+
V := Cdd_V_Rep( S );
|
|
10
|
+
#! < Polyhedron given by its V-representation >
|
|
11
|
+
Display( V );
|
|
12
|
+
#! V-representation
|
|
13
|
+
#! begin
|
|
14
|
+
#! 4 X 3 rational
|
|
15
|
+
#!
|
|
16
|
+
#! 0 3 1
|
|
17
|
+
#! 1 6 11
|
|
18
|
+
#! 1 5 12
|
|
19
|
+
#! 0 1 2
|
|
20
|
+
#! end
|
|
21
|
+
Cdd_GeneratingVertices( P );
|
|
22
|
+
#! [ [ 2, 5 ] ]
|
|
23
|
+
Cdd_GeneratingVertices( Q );
|
|
24
|
+
#! [ [ 3, 7 ], [ 4, 6 ] ]
|
|
25
|
+
Cdd_GeneratingVertices( S );
|
|
26
|
+
#! [ [ 5, 12 ], [ 6, 11 ] ]
|
|
27
|
+
Cdd_GeneratingRays( P );
|
|
28
|
+
#! [ [ 1, 2 ] ]
|
|
29
|
+
Cdd_GeneratingRays( Q );
|
|
30
|
+
#! [ [ 3, 1 ] ]
|
|
31
|
+
Cdd_GeneratingRays( S );
|
|
32
|
+
#! [ [ 1, 2 ], [ 3, 1 ] ]
|
|
33
|
+
#! @EndExample
|
|
34
|
+
#! @EndChunk
|
|
35
|
+
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
##
|
|
2
|
+
InstallGlobalFunction( cdd_PolyhedronByInequalities,
|
|
3
|
+
function( arg )
|
|
4
|
+
|
|
5
|
+
return CallFuncList( Cdd_PolyhedronByInequalities, ConvertJuliaToGAP( arg ) );
|
|
6
|
+
|
|
7
|
+
end );
|
|
8
|
+
|
|
9
|
+
##
|
|
10
|
+
InstallGlobalFunction( cdd_PolyhedronByGenerators,
|
|
11
|
+
function( arg )
|
|
12
|
+
|
|
13
|
+
return CallFuncList( Cdd_PolyhedronByGenerators, ConvertJuliaToGAP( arg ) );
|
|
14
|
+
|
|
15
|
+
end );
|