[SCIP] Getting address of transformed variables

Marc Pfetsch pfetsch at mathematik.tu-darmstadt.de
Mon May 2 19:39:47 CEST 2022



Dear Stefan,

I don't think that I can solve your problem, but I will try to give some 
hints.

> However, when I try to get the addresses of the transformed variables 
> like this
> 
> 
> SCIPgetTransformedVar( _scip, p_dicbapsolver->_vars_usageLinks[ 
> *(_d->link_it) ], &(p_dicbapsolver->_vars_usageLinks[ *(_d->link_it) ])
> 
> which seems to be perfectly analogous, I get a segmentation fault.

Have you checked whether the problem lies in you data structures by 
using a debugger? It could also be that at some other place of you code 
memory is corrupted and the segmentation fault is only a secondary sign 
that some problem occurred. Under Linux you might want to run valgrind 
to check whether something strange happens.

> As a consequence, those auxiliary variables to enforce branching 
> decisions which I added initially to the master problem do not get 
> automatically released ,even though I set the “true” flag for this 
> option when I created the pricer in the first place (as well as for the 
> branching rule and the constraint handler, of course).

What do you mean by setting the option to "true"? I do not think that 
such an option exists. You need to release these variables by yourself 
in any case.

> So to get rid of 
> the warning, I release all those variables “manually” right before I 
> free the SCIP object itself, which works.

Yes, this should be the right way.

> Would it be better to add those auxiliary variables to the constraints 
> of the transformed master problem when the pricer is initialized (as 
> opposed to adding them intially to the “original” master problem before 
> the transformation takes place)? That should also work, I think, even 
> though I have not yet tried it.

In principle, this should not make a difference, but there might be a 
bug somewhere.

Best

Marc


More information about the Scip mailing list