From 451dfb9623a0cadeafce515fb6eb6e043bd3facf Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Mon, 7 Apr 2008 22:22:37 +0200 Subject: [PATCH] evalue_convert: export as application --- Makefile.am | 9 ++++++++- evalue_convert_main.c | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 evalue_convert_main.c diff --git a/Makefile.am b/Makefile.am index cc6182e..f24b0b0 100644 --- a/Makefile.am +++ b/Makefile.am @@ -68,7 +68,7 @@ noinst_PROGRAMS = test testlib randomtest \ @bv_cone_hilbert_basis@ cone_integer_hull \ polytope_lattice_width polytope_minimize \ polyhedron_integer_hull vector_partition_chambers \ - semigroup_holes + semigroup_holes evalue_convert EXTRA_PROGRAMS = barvinok_bound test_bound cone_hilbert_basis pkginclude_HEADERS = \ barvinok/NTL_QQ.h \ @@ -357,6 +357,13 @@ EXTRA_test_bound_SOURCES = fdstream.cc fdstream.h test_bound_LDADD = \ libbarvinok-core.la libbarvinok.la @ISL_POLYLIB_LIBS@ @ISL_LIBS@ \ @POLYLIB_LIBS@ @PIPLIB_LIBS@ +evalue_convert_SOURCES = \ + evalue_convert_main.c \ + evalue_convert.cc \ + evalue_convert.h \ + evalue_read.c \ + evalue_read.h \ + $(FDSTREAM) TESTFILES = $(shell find $(top_srcdir)/tests -type f ! -path '*CVS*') diff --git a/evalue_convert_main.c b/evalue_convert_main.c new file mode 100644 index 0000000..43e147a --- /dev/null +++ b/evalue_convert_main.c @@ -0,0 +1,32 @@ +#include "argp.h" +#include +#include "evalue_convert.h" +#include "evalue_read.h" + +int main(int argc, char **argv) +{ + evalue *EP; + const char **all_vars = NULL; + unsigned nvar; + unsigned nparam; + struct barvinok_options *options = barvinok_options_new_with_defaults(); + struct convert_options convert; + int printed; + + set_program_name(argv[0]); + argp_parse(&convert_argp, argc, argv, 0, 0, &convert); + + EP = evalue_read_from_file(stdin, NULL, &all_vars, + &nvar, &nparam, options->MaxRays); + assert(EP); + + printed = + evalue_convert(EP, &convert, options->verbose, nvar+nparam, all_vars); + + if (!printed) + print_evalue(stdout, EP, all_vars); + + evalue_free(EP); + Free_ParamNames(all_vars, nvar+nparam); + barvinok_options_free(options); +} -- 2.11.4.GIT