infinity: Fix memory corruption
This commit is contained in:
@@ -365,10 +365,6 @@ static int create_tight_rays_lp(int nrows,
|
|||||||
rval = LP_relax(lp);
|
rval = LP_relax(lp);
|
||||||
abort_if(rval, "LP_relax failed");
|
abort_if(rval, "LP_relax failed");
|
||||||
|
|
||||||
//rval = LP_write(lp, "tight-rays.lp");
|
|
||||||
//abort_if(rval, "LP_write failed");
|
|
||||||
|
|
||||||
|
|
||||||
CLEANUP:
|
CLEANUP:
|
||||||
if(rmatind) free(rmatind);
|
if(rmatind) free(rmatind);
|
||||||
if(rmatval) free(rmatval);
|
if(rmatval) free(rmatval);
|
||||||
|
|||||||
@@ -187,7 +187,7 @@ static int filter_model(const struct MultiRowModel *original_model,
|
|||||||
struct RayList *filtered_rays = &filtered_model->rays;
|
struct RayList *filtered_rays = &filtered_model->rays;
|
||||||
const struct RayList *original_rays = &original_model->rays;
|
const struct RayList *original_rays = &original_model->rays;
|
||||||
|
|
||||||
memcpy(f, original_model->f, 2 * sizeof(double));
|
memcpy(f, original_model->f, nrows * sizeof(double));
|
||||||
|
|
||||||
r = (double*) malloc(nrows * sizeof(double));
|
r = (double*) malloc(nrows * sizeof(double));
|
||||||
abort_if(!r, "could not allocate r");
|
abort_if(!r, "could not allocate r");
|
||||||
@@ -412,6 +412,9 @@ int INFINITY_generate_cut(const struct Tableau *tableau, struct Row *cut)
|
|||||||
rval = CG_init_map(&original_map, max_nrays, tableau->nrows);
|
rval = CG_init_map(&original_map, max_nrays, tableau->nrows);
|
||||||
abort_if(rval, "CG_init_map failed");
|
abort_if(rval, "CG_init_map failed");
|
||||||
|
|
||||||
|
rval = LFREE_init_conv(&lfree, tableau->nrows, max_nrays);
|
||||||
|
abort_if(rval, "LFREE_init_conv failed");
|
||||||
|
|
||||||
rval = extract_models(tableau, &original_model, &filtered_model,
|
rval = extract_models(tableau, &original_model, &filtered_model,
|
||||||
&original_map);
|
&original_map);
|
||||||
abort_if(rval, "extract_models failed");
|
abort_if(rval, "extract_models failed");
|
||||||
@@ -422,9 +425,6 @@ int INFINITY_generate_cut(const struct Tableau *tableau, struct Row *cut)
|
|||||||
goto CLEANUP;
|
goto CLEANUP;
|
||||||
}
|
}
|
||||||
|
|
||||||
rval = LFREE_init_conv(&lfree, tableau->nrows, max_nrays);
|
|
||||||
abort_if(rval, "LFREE_init_conv failed");
|
|
||||||
|
|
||||||
rval = append_extra_rays(&filtered_model);
|
rval = append_extra_rays(&filtered_model);
|
||||||
abort_if(rval, "append_extra_rays failed");
|
abort_if(rval, "append_extra_rays failed");
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user