evalue.c: reduce_evalue: reduce floor with constant argument
[barvinok.git] / Makefile.am
blob28cb02b7153dcaf7530a39091b9be79127d58437
1 if HAVE_GINAC
2     MAYBE_BERNSTEIN = bernstein
3 endif
4 if BUNDLED_POLYLIB
5     MAYBE_POLYLIB = polylib
6 endif
7 if BUNDLED_PIPLIB
8     MAYBE_PIPLIB = piplib
9 endif
10 if USE_ZSOLVE
11     MAYBE_ZSOLVE = zsolve
12 endif
13 if USE_PARKER
14     MAYBE_PARKER = parker
15 endif
16 SUBDIRS = $(MAYBE_PIPLIB) $(MAYBE_POLYLIB) $(MAYBE_BERNSTEIN) \
17                 lib $(MAYBE_ZSOLVE) $(MAYBE_PARKER) . omega doc
19 FORCE:
20 lib/libgnu.la: FORCE
21         $(MAKE) $(AM_MAKEFLAGS) -C lib libgnu.la
22 bernstein/libbernstein.la: FORCE
23         $(MAKE) $(AM_MAKEFLAGS) -C bernstein libbernstein.la
24 polylib/libpolylibgmp.la: FORCE
25         $(MAKE) $(AM_MAKEFLAGS) -C polylib libpolylibgmp.la
26 piplib/libpiplibMP.la: FORCE
27         $(MAKE) $(AM_MAKEFLAGS) -C piplib libpiplibMP.la
28 zsolve/libzsolve.la: FORCE
29         $(MAKE) $(AM_MAKEFLAGS) -C zsolve libzsolve.la
30 parker/libparker.la: FORCE
31         $(MAKE) $(AM_MAKEFLAGS) -C parker libparker.la
33 AM_CPPFLAGS = -I$(srcdir)/bernstein/include -I$(srcdir)/lib \
34               @POLYLIB_CPPFLAGS@ @PIPLIB_CPPFLAGS@ @ginac_CFLAGS@
35 AM_LDFLAGS = -Llib @POLYLIB_LDFLAGS@ @PIPLIB_LDFLAGS@
37 lib_LTLIBRARIES = libbarvinok-core.la libbarvinok.la
38 bin_PROGRAMS = barvinok_count barvinok_enumerate barvinok_enumerate_e \
39                   barvinok_ehrhart polytope_scan
40 noinst_PROGRAMS = test testlib randomtest \
41                   remove_redundant_equalities \
42                   barvinok_union polytope_volume test_approx \
43                   barvinok_summate verify_lexsmaller piptest \
44                   polyhedron_sample 4coins lexmin @bv_barvinok_bound@ \
45                   @bv_cone_hilbert_basis@ cone_integer_hull \
46                   polytope_lattice_width polytope_minimize \
47                   polyhedron_integer_hull
48 EXTRA_PROGRAMS = barvinok_bound test_bound cone_hilbert_basis
49 pkginclude_HEADERS = \
50     barvinok/NTL_QQ.h \
51     barvinok/barvinok.h \
52     barvinok/util.h \
53     barvinok/evalue.h \
54     barvinok/genfun.h \
55     barvinok/options.h \
56     barvinok/polylib.h \
57     barvinok/sample.h \
58     barvinok/basis_reduction.h \
59     barvinok/bernstein.h
60 nodist_pkginclude_HEADERS = \
61     barvinok/NTL.h \
62     barvinok/set.h
63 LINK = $(CXXLINK)
65 if HAVE_CDDLIB
66     BR_CDD = basis_reduction_cdd.cc initcdd.cc
67     POLYSIGN_CDD = polysign_cddf.cc polysign_cdd.cc
68 endif
69 if HAVE_GLPK
70     BR_GLPK = basis_reduction_glpk.c
71     POLYSIGN_GLPK = polysign_glpk.c
72 endif
73 if HAVE_TOPCOM
74     TOPCOM = topcom.c topcom.h
75 endif
76 if USE_ZSOLVE
77     HILBERT_C = hilbert.c
78 endif
79 libbarvinok_core_la_SOURCES = \
80     barvinok/evalue.h \
81     barvinok/genfun.h \
82     barvinok/util.h \
83     barvinok/barvinok.h \
84     NTL_QQ.cc \
85     basis_reduction.c \
86     basis_reduction_pip.c \
87     basis_reduction_pip_dual.c \
88     evalue.c \
89     genfun.cc \
90     util.c \
91     version.c \
92     bernoulli.c \
93     bernoulli.h \
94     bfcounter.cc \
95     bfcounter.h \
96     binomial.c \
97     binomial.h \
98     conversion.cc \
99     conversion.h \
100     counter.cc \
101     counter.h \
102     decomposer.cc \
103     decomposer.h \
104     dpoly.cc \
105     dpoly.h \
106     euler.cc \
107     euler.h \
108     genfun_constructor.cc \
109     genfun_constructor.h \
110     $(HILBERT_C) \
111     hilbert.h \
112     hull.c \
113     hull.h \
114     ilp.c \
115     ilp.h \
116     lattice_point.cc \
117     lattice_point.h \
118     lattice_width.c \
119     lattice_width.h \
120     laurent.cc \
121     laurent.h \
122     normalization.c \
123     normalization.h \
124     options.c \
125     param_util.c \
126     param_util.h \
127     piputil.h \
128     piputil.c \
129     $(POLYSIGN_CDD) \
130     $(POLYSIGN_GLPK) \
131     polysign.c \
132     polysign_pip.c \
133     polysign_polylib.c \
134     polysign.h \
135     power.h \
136     reduce_domain.c \
137     reduce_domain.h \
138     reducer.cc \
139     reducer.h \
140     remove_equalities.h \
141     remove_equalities.c \
142     sample.c \
143     scale.c \
144     scale.h \
145     scarf.cc \
146     series.cc \
147     $(TOPCOM) \
148     volume.c \
149     volume.h \
150     mat_util.cc \
151     mat_util.h \
152     matrix_read.cc \
153     matrix_read.h \
154     barvinok.cc \
155     barvinok_e.cc \
156     $(BR_CDD) \
157     $(BR_GLPK)
158 EXTRA_libbarvinok_la_SOURCES = \
159     basis_reduction_cdd.cc \
160     basis_reduction_glpk.c \
161     range.cc \
162     range.h \
163     bernstein.cc \
164     hilbert.c \
165     polysign_cddf.cc \
166     polysign_cdd.cc \
167     polysign.c \
168     initcdd.cc \
169     initcdd.h \
170     topcom.c \
171     topcom.h
172 if BUNDLED_POLYLIB
173     POLYLIB_LA = $(top_builddir)/polylib/libpolylibgmp.la
174 endif
175 if BUNDLED_PIPLIB
176     PIPLIB_LA = $(top_builddir)/piplib/libpiplibMP.la
177 endif
178 if USE_ZSOLVE
179     ZSOLVE_LA = zsolve/libzsolve.la
180 endif
181 libbarvinok_core_la_LIBADD = @LTLIBOBJS@ $(POLYLIB_LA) @POLYLIB_LIBS@ \
182                              $(PIPLIB_LA) @PIPLIB_LIBS@ \
183                              $(ZSOLVE_LA) lib/libgnu.la
184 libbarvinok_core_la_LDFLAGS = @BV_LDFLAGS@ -version-info @versioninfo@
185 if HAVE_GINAC
186     BERNSTEIN_CC = bernstein.cc range.cc
187 endif
188 libbarvinok_la_SOURCES = \
189     $(BERNSTEIN_CC)
190 if HAVE_GINAC
191     BERNSTEIN_LA = $(top_builddir)/bernstein/libbernstein.la
192 endif
193 libbarvinok_la_LIBADD = libbarvinok-core.la $(BERNSTEIN_LA)
194 libbarvinok_la_LDFLAGS = @BV_LDFLAGS@ -version-info @versioninfo@
195 LDADD = libbarvinok-core.la @POLYLIB_LIBS@ @PIPLIB_LIBS@
197 test_SOURCES = \
198         evalue_read.c \
199         evalue_read.h \
200         test.c
201 testlib_SOURCES = \
202         evalue_read.c \
203         evalue_read.h \
204         testlib.cc
205 barvinok_count_SOURCES = barvinok_count.c
206 barvinok_ehrhart_SOURCES = barvinok_ehrhart.cc
207 barvinok_union_SOURCES = barvinok_union.cc
208 if HAVE_OMEGA
209 BEEO_SOURCES = omega/Exit.cc omega/convert.cc omega/count.cc
210 else
211 BEEO_SOURCES = 
212 endif
213 if USE_FDSTREAM
214 FDSTREAM = fdstream.cc fdstream.h
215 endif
216 barvinok_enumerate_SOURCES = \
217         barvinok_enumerate.cc \
218         evalue_convert.cc \
219         evalue_convert.h \
220         $(FDSTREAM) \
221         skewed_genfun.cc \
222         skewed_genfun.h \
223         verify.h \
224         verify.c \
225         verif_ehrhart.h \
226         verif_ehrhart.c \
227         verify_series.h \
228         verify_series.cc
229 EXTRA_barvinok_enumerate_SOURCES = fdstream.cc fdstream.h
230 barvinok_enumerate_e_SOURCES = \
231         barvinok_enumerate_e.cc \
232         evalue_convert.cc \
233         evalue_convert.h \
234         $(FDSTREAM) \
235         skewed_genfun.cc \
236         skewed_genfun.h \
237         verify.h \
238         verify.c \
239         verif_ehrhart.h \
240         verif_ehrhart.c \
241         verify_series.h \
242         verify_series.cc \
243         $(BEEO_SOURCES)
244 EXTRA_barvinok_enumerate_e_SOURCES = fdstream.cc fdstream.h
245 if USE_PARKER
246     MONA_LIBS = -ldfa -lbdd -lmem
247     PARKER_LA = parker/libparker.la
248     PARKERLDFLAGS = -L$(MONAPATH)/DFA -L$(MONAPATH)/BDD -L$(MONAPATH)/Mem
249     PARKERCPPFLAGS = -I$(MONAPATH)/Mem -I$(MONAPATH)/DFA -I$(MONAPATH)/BDD
250 endif
251 barvinok_enumerate_e_CPPFLAGS = \
252         $(PARKERCPPFLAGS) @OMEGA_CPPFLAGS@ $(AM_CPPFLAGS)
253 barvinok_enumerate_e_LDFLAGS = $(PARKERLDFLAGS) @OMEGA_LDFLAGS@ @LDFLAGS@
254 barvinok_enumerate_e_LDADD = \
255         $(PARKER_LA) $(MONA_LIBS) @OMEGA_LIBS@ libbarvinok-core.la \
256         @POLYLIB_LIBS@ @PIPLIB_LIBS@
257 barvinok_bound_SOURCES = \
258         evalue_convert.cc \
259         evalue_convert.h \
260         evalue_read.c \
261         evalue_read.h \
262         $(FDSTREAM) \
263         bound.cc \
264         verify.h \
265         verify.c
266 EXTRA_barvinok_bound_SOURCES = fdstream.cc fdstream.h
267 barvinok_bound_LDADD = \
268         libbarvinok-core.la libbarvinok.la @POLYLIB_LIBS@ @PIPLIB_LIBS@
269 barvinok_summate_SOURCES = \
270         evalue_convert.cc \
271         evalue_convert.h \
272         evalue_read.c \
273         evalue_read.h \
274         $(FDSTREAM) \
275         summate.cc \
276         verify.h \
277         verify.c
278 EXTRA_barvinok_summate_SOURCES = fdstream.cc fdstream.h
279 4coins_SOURCES = 4coins.cc
280 lexmin_SOURCES = \
281         lexmin.h \
282         lexmin.cc \
283         combine.c \
284         combine.h \
285         edomain.cc \
286         edomain.h \
287         evalue_util.cc \
288         evalue_util.h \
289         verify.h \
290         verify.c
291 test_approx_SOURCES = \
292         test_approx.c \
293         verify.h \
294         verify.c
295 test_bound_SOURCES = \
296         test_bound.cc \
297         evalue_convert.cc \
298         evalue_convert.h \
299         evalue_read.c \
300         evalue_read.h \
301         $(FDSTREAM) \
302         verify.h \
303         verify.c
304 EXTRA_test_bound_SOURCES = fdstream.cc fdstream.h
305 test_bound_LDADD = \
306         libbarvinok-core.la libbarvinok.la @POLYLIB_LIBS@ @PIPLIB_LIBS@
308 TESTFILES = $(shell find $(top_srcdir)/tests -type f ! -path '*CVS*')
310 EXTRA_DIST = \
311     ChangeLog \
312     $(TESTFILES) \
313     latte2polylib.pl \
314     NTL_5_3_2.patch \
315     basis_reduction_templ.c \
316     cdd94e-test \
317     polysign_cdd_template.cc \
318     barvinok/NTL.h.broken \
319     barvinok/NTL.h.normal \
320     barvinok/set.h.broken \
321     barvinok/set.h.normal \
322     doc/Internal.tex \
323     doc/applications.tex \
324     doc/barvinok.tex \
325     doc/omega.tex \
326     doc/polymake.tex \
327     doc/reports.tex \
328     doc/barvinok.bib \
329     doc/barvinok.gdf \
330     doc/chicago.bst \
331     doc/chicago.sty \
332     doc/mydefs.sty \
333     polymake/Makefile.in \
334     polymake/README \
335     polymake/autogen.sh \
336     polymake/configure.in \
337     polymake/convert.cc \
338     polymake/convert.h \
339     polymake/h_star_vector.cc \
340     polymake/lattice_points.cc
342 ACLOCAL_AMFLAGS = -I m4
344 install-data-local:
345         @test -z "$(pkgconfig_libdir)" || $(mkdir_p) "$(DESTDIR)$(pkgconfig_libdir)"
346         $(INSTALL_DATA) $(pkgconfig_libfile) "$(DESTDIR)$(pkgconfig_libdir)/$(pkgconfig_libfile)"
348 uninstall-local:
349         rm -f "$(DESTDIR)$(pkgconfig_libdir)/$(pkgconfig_libfile)"
351 dist-hook:
352         (cd $(distdir)/polymake; \
353             ./autogen.sh; rm -rf autogen.sh autom4te.cache)
354         (cd doc; make barvinok.pdf)
355         cp doc/barvinok.pdf $(distdir)/doc/
356         if test -f $(top_srcdir)/.git/HEAD; then \
357             echo @GIT_HEAD_VERSION@ > $(distdir)/GIT_HEAD_ID; \
358         else \
359             echo $(GIT_HEAD_ID) > $(distdir)/GIT_HEAD_ID; \
360         fi
362 dist-git: dist
363         mv $(distdir).tar.gz @GIT_HEAD_VERSION@.tar.gz
365 BEE_TESTDIRS = ehrhart_e ehrhart_e/scarf ehrhart_e/piplib
367 check: check-testlib check-enumerate check-enumerate_e check-test \
368         check-lexmin check-approx check-evalue check-euler check-lw
369 check-testlib: testlib$(EXEEXT)
370         ./testlib$(EXEEXT)
371 check-approx: test_approx$(EXEEXT)
372         @for i in $(top_srcdir)/tests/ehrhart/*; do \
373             if test -f $$i; then \
374                 echo $$i | ./test_approx$(EXEEXT) -q -r 10 || exit; \
375             fi \
376         done
377 check-evalue: @bv_barvinok_bound@ barvinok_summate$(EXEEXT)
378         @for i in $(top_srcdir)/tests/evalue/*; do \
379             if test -f $$i; then \
380                 echo $$i; \
381                 if test -n "@bv_barvinok_bound@"; then \
382                     ./barvinok_bound$(EXEEXT) -T < $$i || exit; \
383                     echo $$i | ./test_bound$(EXEEXT) -q || exit; \
384                 fi; \
385                 ./barvinok_summate$(EXEEXT) -T < $$i || exit; \
386             fi \
387         done
388 check-euler: barvinok_summate$(EXEEXT)
389         @for i in $(top_srcdir)/tests/euler/*; do \
390             if test -f $$i; then \
391                 echo $$i; \
392                 ./barvinok_summate$(EXEEXT) -T --summation=euler < $$i || exit; \
393             fi \
394         done
395 if HAVE_TOPCOM
396     TOPCOM_CD = '--chamber-decomposition=topcom'
397 endif
398 check-enumerate: barvinok_enumerate$(EXEEXT)
399         @for i in $(top_srcdir)/tests/ehrhart/*; do \
400             if test -f $$i; then \
401                 echo $$i; \
402                 for options in '' '--series' '--series --primal' $(TOPCOM_CD); do \
403                     for spec in 'random' 'bf' 'df'; do \
404                         opt="--specialization=$$spec $$options"; \
405                         echo "        $$opt"; \
406                         ./barvinok_enumerate$(EXEEXT) --verify $$opt < $$i || exit; \
407                     done \
408                 done; \
409                 opt="--summation=bernoulli"; \
410                 echo "        $$opt"; \
411                 ./barvinok_enumerate$(EXEEXT) --verify $$opt < $$i || exit; \
412             fi \
413         done
414 check-enumerate_e: barvinok_enumerate_e$(EXEEXT)
415         @for dir in $(BEE_TESTDIRS); do \
416             for i in $(top_srcdir)/tests/$$dir/*; do \
417                 if test -f $$i; then \
418                     for options in '' '--pip' '--pip --omega'; do \
419                         for spec in 'random' 'bf' 'df'; do \
420                             opt="--specialization=$$spec $$options"; \
421                             echo $$i $$opt; \
422                             ./barvinok_enumerate_e$(EXEEXT) --verify $$opt < $$i || exit; \
423                         done \
424                     done \
425                 fi \
426             done \
427         done
428         @for i in $(top_srcdir)/tests/ehrhart_e/scarf/*; do \
429             if test -f $$i; then \
430                 for spec in 'random' 'bf' 'df'; do \
431                     opt="--specialization=$$spec --scarf"; \
432                     echo $$i $$opt; \
433                     ./barvinok_enumerate_e$(EXEEXT) --verify $$opt < $$i || exit; \
434                 done; \
435                 echo $$i --series; \
436                 ./barvinok_enumerate_e$(EXEEXT) --verify --series < $$i || exit; \
437             fi \
438         done
439 check-test: test$(EXEEXT)
440         @for i in $(top_srcdir)/tests/*; do \
441             if test -f $$i; then \
442                 for options in '--index=10' '--primal --index=10'; do \
443                     for spec in 'random' 'bf' 'df' 'todd'; do \
444                         opt="--specialization=$$spec $$options"; \
445                         echo -n $$i $$opt; \
446                         ./test$(EXEEXT) $$opt < $$i || echo -n " NOT"; \
447                         echo " ok"; \
448                     done \
449                 done \
450             fi \
451         done
452 check-lw: test$(EXEEXT)
453         @for i in $(top_srcdir)/tests/lattice_width/*; do \
454             if test -f $$i; then \
455                 echo -n $$i; \
456                 ./test$(EXEEXT) < $$i || echo -n " NOT"; \
457                 echo " ok"; \
458             fi \
459         done
460 if HAVE_GLPK
461 check-lexmin: lexmin$(EXEEXT)
462         @for i in $(top_srcdir)/tests/lexmin/*; do \
463             if test -f $$i; then \
464                 for spec in 'random' 'bf' 'df'; do \
465                     opt="--specialization=$$spec"; \
466                     echo $$i $$opt; \
467                     ./lexmin$(EXEEXT) --verify $$opt < $$i || exit; \
468                 done \
469             fi \
470         done
471 else
472 check-lexmin:
473 endif
475 version.h: @GIT_HEAD@
476         echo '#define GIT_HEAD_ID "'@GIT_HEAD_VERSION@'"' > $@