[Scip] Memory management (in a column generation method)

Luigi Malagò luigi.malago at gmail.com
Fri Aug 19 15:45:14 MEST 2011


Hi list (again),
i have a question about how to correctly handle memory allocation in SCIP.

in the binpacking example, i found this code,

SCIP_CALL( SCIPduplicateMemoryArray(scip, &pricerdata->conss, conss, nitems)
);

to duplicate data structure from master problem to the pricing problem.
in my code i have to copy just a single conss, not an array.

i tryed something like

SCIP_CALL( SCIPduplicateMemoryscip, &pricerdata->myConss, myConss) );

but i didnt work, i debugged the code and some pointers screwed up.
so i think i solved with just ana assignment

pricerdata->myConss = myConss;

what is wrong with this? it is safe?
same problem when i moved the datastructures from array and matrix of
pointers
to vectors of pointers and vectors of vectors of pointers.
is it safe to just copy pointers with an assignment as above?

as to good working practice:
in my pricing datastructure, i have pointers to all variables and
constraints of the pricer and also of the master,
since i need these to create new constraints when the variable is added to
the master.
i suppose this is the correct way and place to modify the master problem in
SCIP_DECL_PRICERREDCOST(pricerRedcostBinpacking)
when i new column is added. can somebody confirm this, please?

thanks a lot for your help,
luigi


-
Luigi Malagò, Ph.D. Student
AIRLab - Artificial Intelligence and Robotics Laboratory
Dipartimento di Elettronica e Informazione
Politecnico di Milano, Italy
Office:    +39 02 2399 4031
Lab:       +39 02 2399 9606
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listserv.zib.de/mailman/private/scip/attachments/20110819/06a1280c/attachment.html


More information about the Scip mailing list