[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Help-glpk] Re: How to create the copy of a node ?
From: |
Andrew Makhorin |
Subject: |
[Help-glpk] Re: How to create the copy of a node ? |
Date: |
Thu, 14 Aug 2003 19:30:11 +0400 |
>I need to permorm a heuristic in a node (glpbcs). I
>would like modify the node separately and
>not to modify the tree (IES).
>How to create the copy of a node or to revert the done
>operations (setting variables and addition of invalid
>cuts)?
I am sending you the routine lpx_copy_prob (please see the attachment),
which allows you creating a copy of the LPX problem object. Components
of basic solution are not copied, but they can be recovered with the
routine lpx_warm_up (if necessary).
Here is an example how to create a copy in your application procedure:
LPX *my_lp;
...
/* create a copy of internal problem object*/
my_lp = lpx_copy_prob(bcs_get_lp_object(bcs));
/* recover components of basic solution (if necessary) */
if (lpx_warm_up(my_lp) != LPX_E_OK) goto cannot_recover;
...
The order of rows and columns in the copy is the same as in the
original. So, in order to determine which constraints (BCSCON) and
variables (BCSVAR) correspond to rows and columns of the problem
object you can use routines bcs_get_ith_con and bcs_get_jth_var.
Do not forget to delete the copy via lpx_delete_prob before return
from the application procedure.
- Andrew Makhorin
lpxcopy.c
Description: Binary data
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Help-glpk] Re: How to create the copy of a node ?,
Andrew Makhorin <=