Dear all,

I have a question about the memory handling of IntArgs and IntVarArgs, and I 
cannot find an answer in the MPG.

Let's start with the IntArgs: when I write a model, I often copy the input data 
inside some IntArgs objects, so that I can then use them through the matrix 
interface, or post element constraints on them. This is fine, because I am in 
the constructor, and I can access them until the end of the scope which is 
enough to post the model. Sometimes, however, I need to access the same set of 
data in the print method, or in a custom brancher. I seem to have two choices 
here: either I build them from scratch by reading the input again (which is 
verbose, expensive, and clutters the code), or I can store them somewhere so 
that they stay accessible even out of the constructor's scope. If I decide to 
store them, I can either store them as static members (which I don't like, but 
allows me to forget about updating them throughout the space copies) or I can 
update them in the copy constructor. My doubt is: what is the memory footprint 
of keeping the IntArgs in the space? Will they be deep- or shallow-copied if I 
use their copy constructor?

A similar question arises for IntVarArgs. I usually use them for temporary 
variables and the such, however sometimes I need to access them from a 
brancher. Should I just transform them in IntVarArrays in this case?

Thanks for the insight,


-

Dr. Tommaso Urli

Researcher, Optimisation Research Group

DATA61 | CSIRO
E [email protected]<mailto:[email protected]>
M +61 403 464 731
Tower A, Level 3
7 London Circuit,
Canberra ACT 2601
www.data61.csiro.au<http://www.data61.csiro.au/>

CSIRO's Digital Productivity business unit and NICTA have joined forces to 
create digital powerhouse Data61

[cid:[email protected]]
_______________________________________________
Gecode users mailing list
[email protected]
https://www.gecode.org/mailman/listinfo/gecode-users

Reply via email to