[Scip] Is there a SCIPconsSetData()?

Gerald Gamrath gamrath at zib.de
Thu Jan 27 15:10:25 MET 2011


Hi Martin,

the difference between the two is, that the vardata is normally not used 
by SCIP, and can thus be set or changed by the user as he wants. In 
contrast to that, the consdata is used by the constraint handlers to 
store data for a specific constraint of that type, e.g. the array of 
variables and corresponding coefficients for a linear constraint. So 
this data should be used only by the constraint handler itself.

If you want to store data for a constraint of a given constraint handler 
that you did not implement and do not want to change, you can do 
something like you suggested. However, I would suggest that you use two 
arrays, one to store the constraint pointers and one to store the 
corresponding data, because keeping this array in sync with SCIP's 
constraint array seems to be a tough job. As an alternative, you could 
use a hashmap (have a look at pub_misc.h for the needed methods).

Best,
Gerald

Am 27.01.2011 13:34, schrieb Martin Bergner:
> Hi all,
>
> somehow, I'm confused. While there exists a function SCIPvarSetData() to
> set some variable data, this function does not seem to exist for
> constraints. Is there a reason for this? A SCIPconsGetData() function
> exists.
>
> And if so, what is the canonical way to attach data to given (=existing)
> constraints? The only thing that comes to my mind is an array sorted and
> kept in sync with the constraints array. Is this the way to go?
>
> Regards,
> Martin
>
> _______________________________________________
> Scip mailing list
> Scip at zib.de
> http://listserv.zib.de/mailman/listinfo/scip



More information about the Scip mailing list