4 #include <polylib/polylibgmp.h>
7 struct isl_ctx
*isl_ctx_alloc()
9 struct isl_ctx
*ctx
= NULL
;
11 ctx
= isl_calloc_type(NULL
, struct isl_ctx
);
15 if (isl_hash_table_init(ctx
, &ctx
->name_hash
, 0))
18 ctx
->stats
= isl_calloc_type(ctx
, struct isl_stats
);
24 isl_int_init(ctx
->one
);
25 isl_int_set_si(ctx
->one
, 1);
27 isl_int_init(ctx
->negone
);
28 isl_int_set_si(ctx
->negone
, -1);
33 ctx
->MaxRays
= POL_NO_DUAL
| POL_INTEGER
;
36 ctx
->lp_solver
= ISL_LP_TAB
;
37 ctx
->ilp_solver
= ISL_ILP_GBR
;
38 ctx
->pip
= ISL_PIP_TAB
;
40 ctx
->gbr
= ISL_GBR_ONCE
;
41 ctx
->gbr_only_first
= 0;
49 void isl_ctx_ref(struct isl_ctx
*ctx
)
54 void isl_ctx_deref(struct isl_ctx
*ctx
)
56 isl_assert(ctx
, ctx
->ref
> 0, return);
60 void isl_ctx_free(struct isl_ctx
*ctx
)
64 isl_assert(ctx
, ctx
->ref
== 0, return);
65 isl_hash_table_clear(&ctx
->name_hash
);
66 isl_blk_clear_cache(ctx
);
67 isl_int_clear(ctx
->one
);
68 isl_int_clear(ctx
->negone
);