X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=polytope_scan.c;h=959451585fefcfd4c113e701da8bb70bd5511f9d;hb=de51a9bc4da5dd3f1f9f57c2362da6f9752c44e0;hp=d6b477e14c8a253ae459cd8021d25dd4e3cecff8;hpb=309036cf4fb6d77a3287a8de8a9098c0a1211778;p=platform%2Fupstream%2Fisl.git diff --git a/polytope_scan.c b/polytope_scan.c index d6b477e..9594515 100644 --- a/polytope_scan.c +++ b/polytope_scan.c @@ -1,16 +1,18 @@ /* * Copyright 2008-2009 Katholieke Universiteit Leuven * - * Use of this software is governed by the GNU LGPLv2.1 license + * Use of this software is governed by the MIT license * * Written by Sven Verdoolaege, K.U.Leuven, Departement * Computerwetenschappen, Celestijnenlaan 200A, B-3001 Leuven, Belgium */ #include +#include #include "isl_equalities.h" -#include "isl_seq.h" +#include #include "isl_scan.h" +#include /* The input of this program is the same as that of the "polytope_scan" * program from the barvinok distribution. @@ -47,12 +49,14 @@ error: static struct isl_mat *isl_basic_set_scan_samples(struct isl_basic_set *bset) { + isl_ctx *ctx; unsigned dim; struct scan_samples ss; + ctx = isl_basic_set_get_ctx(bset); dim = isl_basic_set_total_dim(bset); ss.callback.add = scan_samples_add_sample; - ss.samples = isl_mat_alloc(bset->ctx, 0, 1 + dim); + ss.samples = isl_mat_alloc(ctx, 0, 1 + dim); if (!ss.samples) goto error; @@ -72,6 +76,9 @@ static struct isl_mat *isl_basic_set_samples(struct isl_basic_set *bset) struct isl_mat *T; struct isl_mat *samples; + if (!bset) + return NULL; + if (bset->n_eq == 0) return isl_basic_set_scan_samples(bset); @@ -86,9 +93,9 @@ int main(int argc, char **argv) struct isl_basic_set *bset; struct isl_mat *samples; - bset = isl_basic_set_read_from_file(ctx, stdin, 0, ISL_FORMAT_POLYLIB); + bset = isl_basic_set_read_from_file(ctx, stdin); samples = isl_basic_set_samples(bset); - isl_mat_dump(samples, stdout, 0); + isl_mat_print_internal(samples, stdout, 0); isl_mat_free(samples); isl_ctx_free(ctx);