help-glpk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-glpk] Re: Problem


From: Andrew Makhorin
Subject: [Help-glpk] Re: Problem
Date: Thu, 18 Dec 2003 21:34:56 +0300

>I use API to solve an Integer Problem using lpx_simplex folowed by
>lpx_integer.
>
>After lpx_simplex has runned, if I relaunch it, I get the same solution to 
>my problem: Correct
>BUT
>after lpx_simplex AND lpx_integer have runned, if I relaunch lpx_simplex, 
>I get a different solution !

This may happen only if you change something in the problem object
between calls to lpx_simplex. If you do not change anything, there must
be identical results reported by lpx_simplex independently on calls to
lpx_integer, because the latter rouitine does not change LP basis
created by lpx_simplex.

>lib_free_env and lib_init_env are called between the two runs but it seems 
>it's not enough and some variables are not correctly re-initialized. Any 
>idea ?

Note that lib_free_env frees all memory internally allocated by glpk
routines and thereby invalidates *all* glpk program objects which still
exist. In particular, if you create LP problem object (using
lpx_create_prob, lpx_read_mps, etc.) and then call lib_free_env, the LP
problem object is automatically destroyed.






reply via email to

[Prev in Thread] Current Thread [Next in Thread]