4 #include <polylib/polylibgmp.h>
7 isl_ctx *isl_ctx_alloc_with_options(struct isl_options *opt)
9 struct isl_ctx *ctx = NULL;
14 ctx = isl_calloc_type(NULL, struct isl_ctx);
18 if (isl_hash_table_init(ctx, &ctx->name_hash, 0))
21 ctx->stats = isl_calloc_type(ctx, struct isl_stats);
28 isl_int_init(ctx->one);
29 isl_int_set_si(ctx->one, 1);
31 isl_int_init(ctx->negone);
32 isl_int_set_si(ctx->negone, -1);
34 isl_int_init(ctx->normalize_gcd);
39 ctx->MaxRays = POL_NO_DUAL | POL_INTEGER;
48 struct isl_ctx *isl_ctx_alloc()
50 struct isl_options *opt;
52 opt = isl_options_new_with_defaults();
54 return isl_ctx_alloc_with_options(opt);
57 void isl_ctx_ref(struct isl_ctx *ctx)
62 void isl_ctx_deref(struct isl_ctx *ctx)
64 isl_assert(ctx, ctx->ref > 0, return);
68 void isl_ctx_free(struct isl_ctx *ctx)
72 isl_assert(ctx, ctx->ref == 0, return);
73 isl_hash_table_clear(&ctx->name_hash);
74 isl_blk_clear_cache(ctx);
75 isl_int_clear(ctx->one);
76 isl_int_clear(ctx->negone);
77 isl_int_clear(ctx->normalize_gcd);
83 struct isl_options *isl_ctx_options(isl_ctx *ctx)