5 #include <polylib/polylibgmp.h>
9 static void time_diff(struct tms
*before
, struct tms
*after
)
11 long ticks
= sysconf(_SC_CLK_TCK
);
12 printf("User: %g; Sys: %g\n",
13 (0.0 + after
->tms_utime
- before
->tms_utime
) / ticks
,
14 (0.0 + after
->tms_stime
- before
->tms_stime
) / ticks
);
19 int i
, nbPol
, nbVec
, func
, j
;
20 Polyhedron
*A
, *B
, *C
, *D
, *E
, *F
, *G
;
26 ((sscanf(s
, "D %d", &nbPol
)<1) && (sscanf(s
, "V %d", &nbVec
)<1)) )
29 for (i
= 0; i
< nbPol
; ++i
) {
30 Matrix
*M
= Matrix_Read();
31 A
= Constraints2Polyhedron(M
, 600);
34 while ((*s
=='#') || (sscanf(s
, "F %d", &func
)<1))
43 while ((*s
=='#') || (value_read(ck
, s
) != 0))
45 barvinok_count(A
, &cb
, 100);
53 Polyhedron_Print(stdout
, P_VALUE_FMT
, A
);
54 B
= Polyhedron_Polar(A
, 600);
55 Polyhedron_Print(stdout
, P_VALUE_FMT
, B
);
56 C
= Polyhedron_Polar(B
, 600);
57 Polyhedron_Print(stdout
, P_VALUE_FMT
, C
);
62 Polyhedron_Print(stdout
, P_VALUE_FMT
, A
);
63 for (j
= 0; j
< A
->NbRays
; ++j
) {
64 B
= supporting_cone(A
, j
);
65 Polyhedron_Print(stdout
, P_VALUE_FMT
, B
);
70 Polyhedron_Print(stdout
, P_VALUE_FMT
, A
);
72 barvinok_decompose(A
,&B
,&C
);
74 Polyhedron_Print(stdout
, P_VALUE_FMT
, B
);
76 Polyhedron_Print(stdout
, P_VALUE_FMT
, C
);
82 struct tms tms_before
, tms_between
, tms_after
;
85 Polyhedron_Print(stdout
, P_VALUE_FMT
, A
);
89 barvinok_count(A
, &cb
, 100);
92 value_print(stdout
, P_VALUE_FMT
, cm
);
94 time_diff(&tms_before
, &tms_between
);
96 value_print(stdout
, P_VALUE_FMT
, cb
);
98 time_diff(&tms_between
, &tms_after
);
104 Polyhedron_Print(stdout
, P_VALUE_FMT
, A
);
105 B
= triangularize_cone(A
, 100);
106 Polyhedron_Print(stdout
, P_VALUE_FMT
, B
);
107 check_triangulization(A
, B
);
111 Polyhedron_Print(stdout
, P_VALUE_FMT
, A
);
112 B
= remove_equalities(A
);
113 Polyhedron_Print(stdout
, P_VALUE_FMT
, B
);
119 Polyhedron_Print(stdout
, P_VALUE_FMT
, A
);
120 B
= Polyhedron_Reduce(A
, &f
);
121 Polyhedron_Print(stdout
, P_VALUE_FMT
, B
);
124 value_print(stdout
, P_VALUE_FMT
, f
);
131 Matrix
*M
= Matrix_Read();
133 C
= Constraints2Polyhedron(M
, 600);
135 Polyhedron_Print(stdout
, P_VALUE_FMT
, A
);
136 Polyhedron_Print(stdout
, P_VALUE_FMT
, C
);
137 en
= barvinok_enumerate(A
, C
, 600);
138 param_name
= Read_ParamNames(stdin
, C
->Dimension
);
139 print_evalue(stdout
, &en
->EP
, param_name
);
140 Enumeration_Free(en
);
144 Polyhedron_Print(stdout
, P_VALUE_FMT
, A
);
145 Polyhedron_Polarize(A
);
147 barvinok_decompose(A
,&B
,&C
);
148 for (D
= B
; D
; D
= D
->next
)
149 Polyhedron_Polarize(D
);
150 for (D
= C
; D
; D
= D
->next
)
151 Polyhedron_Polarize(D
);
153 Polyhedron_Print(stdout
, P_VALUE_FMT
, B
);
155 Polyhedron_Print(stdout
, P_VALUE_FMT
, C
);
162 for (i
= 0; i
< nbVec
; ++i
) {
163 Vector
*V
= Vector_Read();
164 Matrix
*M
= unimodular_complete(V
);
165 Matrix_Print(stdout
, P_VALUE_FMT
, M
);