2 This file is part of PolyLib.
4 PolyLib is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 3 of the License, or
7 (at your option) any later version.
9 PolyLib is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with PolyLib. If not, see <http://www.gnu.org/licenses/>.
21 #include <polylib/polylib.h>
33 const char **param_name
;
36 if(!a
|| a
->NbColumns
== 0) {
37 fprintf(stderr
,"Input error: empty matrix\n");
40 A
= Constraints2Polyhedron(a
, WS
);
44 if(!b
|| b
->NbColumns
== 0) {
45 fprintf(stderr
, "Input error: empty matrix\n");
48 B
= Constraints2Polyhedron(b
, WS
);
51 /* Read the name of the parameters */
52 param_name
= Read_ParamNames(stdin
, B
->Dimension
);
53 PA
= Polyhedron2Param_Domain(A
,B
,WS
);
54 if(!PA
|| PA
->D
==NULL
) {
55 printf("---------------------------------------\n");
56 printf("Empty polyhedron\n");
63 if (PA
->Rays
->NbRows
> 0) {
64 printf( "---------------------------------------\n" );
65 printf( "Overall rays :\n");
66 for (i
= 0; i
< PA
->Rays
->NbRows
; i
++) {
67 if (value_zero_p(PA
->Rays
->p
[i
][0]))
71 for (j
= 1; j
< PA
->Rays
->NbColumns
-1; j
++) {
72 value_print(stdout
,P_VALUE_FMT
,PA
->Rays
->p
[i
][j
]);
78 /*****************************/
79 /* Scan the validity domains */
80 for(P
=PA
->D
;P
;P
=P
->next
) {
82 /* prints current val. dom. */
83 printf( "---------------------------------------\n" );
84 printf( "Domain :\n");
85 Print_Domain( stdout
, P
->Domain
, param_name
);
87 /* scan the vertices */
88 printf( "Vertices :\n");
89 FORALL_PVertex_in_ParamPolyhedron(V
,P
,PA
) {
91 /* prints each vertex */
92 Print_Vertex( stdout
, V
->Vertex
, param_name
);
95 END_FORALL_PVertex_in_ParamPolyhedron
;
97 /*****************************/
99 Param_Polyhedron_Free( PA
);