[Scip] Is there a safe way to setName on Cons and Var after creation

Tobias Achterberg achterberg at zib.de
Wed Jul 29 09:40:27 MEST 2009


Hi Fergal,

the SCIPconsSetNamePoiter() method is private and you should not use it: it is defined in
cons.h and not in pub_cons.h.

At the moment, there is no way to change a variable's or constraint's name after it has
been created. We should add this functionality for the upcoming SCIP 1.2 release.

SCIP Team: I suggest that you add methods SCIPconsSetName() to pub_cons.h and
SCIPvarSetName() to pub_var.h, which take a const char* as input, free the old name,
allocate new memory (or alternatively: reallocate the name string array), and copy the new
name. Obviously, these methods need to return a SCIP_RETCODE as the memory allocation may
fail.


Tobias


fergal mohan wrote:
> Hi guys, I was hoping to be able to set names on Cons and Vars after the creation stage. I was looking into using SCIPconsSetNamePointer and SCIPvarSetNamePointer but apart from leaking the old name I think I need to do some BMSallocBlockMemory call to prevent Asserts from firing (I tried a few things  but nothing works so far). Is this supported and is there a way to get the old pointer and free it as part of the setName steps ?
> Fergal
> _______________________________________________
> Scip mailing list
> Scip at zib.de
> http://listserv.zib.de/mailman/listinfo/scip


More information about the Scip mailing list