#define DEBUG_LVL 1
typedef struct local_env_t {
- double time_limit;
int first_x_var, last_x_var;
int n_colors;
bitset_t *normal_colors;
static void ilp2_build(ilp_env_t *ienv)
{
- local_env_t *lenv = ienv->env;
int lower_bound;
ienv->lp = lpp_new(ienv->co->name, lpp_minimize);
lower_bound = co_get_lower_bound(ienv->co) - co_get_inevit_copy_costs(ienv->co);
lpp_set_bound(ienv->lp, lower_bound);
- lpp_set_time_limit(ienv->lp, lenv->time_limit);
}
static void ilp2_apply(ilp_env_t *ienv)
lpp_sol_state_t state = lpp_get_solution(ienv->lp, sol, lenv->first_x_var, lenv->last_x_var);
if (state != lpp_optimal) {
- printf("WARNING %s: Solution state is not 'optimal': %d\n", ienv->co->name, (int)state);
- assert(state >= lpp_feasible && "The solution should at least be feasible!");
+ printf("WARNING %s: Solution state is not 'optimal': %d\n",
+ ienv->co->name, (int)state);
+ if (state < lpp_feasible) {
+ panic("Copy coalescing solution not feasible!");
+ }
}
for (i=0; i<count; ++i) {
#endif
}
-BE_REGISTER_MODULE_CONSTRUCTOR(be_init_copyilp2)
-void be_init_copyilp2(void)
-{
- static co_algo_info copyheur = {
- co_solve_ilp2, 1
- };
-
- be_register_copyopt("ilp", ©heur);
-}
-
-int co_solve_ilp2(copy_opt_t *co)
+/**
+ * Solves the problem using mixed integer programming
+ * @returns 1 iff solution state was optimal
+ * Uses the OU and the GRAPH data structure
+ * Dependency of the OU structure can be removed
+ */
+static int co_solve_ilp2(copy_opt_t *co)
{
lpp_sol_state_t sol_state;
ilp_env_t *ienv;
ASSERT_OU_AVAIL(co); //See build_clique_st
ASSERT_GS_AVAIL(co);
- my.time_limit = 0;
my.first_x_var = -1;
my.last_x_var = -1;
my.nr_2_irn = pmap_create();
return sol_state == lpp_optimal;
}
+
+BE_REGISTER_MODULE_CONSTRUCTOR(be_init_copyilp2)
+void be_init_copyilp2(void)
+{
+ static co_algo_info copyheur = {
+ co_solve_ilp2, 1
+ };
+
+ be_register_copyopt("ilp", ©heur);
+}