[Scip] getting column coefficients and realloc error

Mattia Barbieri barbieri.mattia at gmail.com
Tue May 11 16:26:31 MEST 2010


Hi all,
  I am developing a Branch&Price application in SCIP (1.2.0, linked with
Soplex 1.4.2b , gcc version 4.3.3 on Ubuntu SMP x86_64), with a column
generation approach. Simply I defined plugin Pricer that is a shortest path
problem (in accord to my model decomposition), and a new constraint handler
to store branching decision (like explained in SCIP: FAQ). A variable in my
model represent a path of a given commodity from a source to a destination.
What I want to do is to obtain the column coefficient of a given variable,
without storing this information in SCIP_VARDATA, too expensive for my
purpose (path o f hundred nodes for over 10e6 variables). I try this
procedure:
  SCIP_VAR** vars = SCIPgetVars(scip);
  SCIP_COL* col = SCIPvarGetCol(vars[0]);
  SCIP_Real* vals = SCIPcolGetVals(col);
But what I get is a set of 1's and 0's in positions that do not match
generated path (clearly, when new priced var is found, it is added to the
problem, and coefficients of the constraints involved are updated in order).
May be because I relate whit transformed variable and not whit original
variable? But I read that priced var don't have an original counterpart. So how
can I solve this problem?

I have a second problem. when creating a new constraint handler (as
mentioned before), I get sometimes a segmentation fault error when I put a
new constraint on the stack (more precisely when the program try to
Reallocate memory for new constraint). The code used is the same as in the
Coloring example provided with the default SCIP installation.

/* put constraint on the stack */
   if ( conshdlrData->nstack >= conshdlrData->maxstacksize )
   {
      SCIPreallocMemoryArray(scip, &(conshdlrData->stack),
2*(conshdlrData->maxstacksize));
      conshdlrData->maxstacksize = 2*(conshdlrData->maxstacksize);
      SCIPdebugMessage("reallocating Memory for stack! %d --> %d\n",
conshdlrData->maxstacksize/2, conshdlrData->maxstacksize);
   }
   conshdlrData->stack[conshdlrData->nstack] = cons;
   ++(conshdlrData->nstack);

May be the problem is elsewhere, but the backtrace I obtain is as follow:

*** glibc detected *** ./gse1/bin/gse: realloc(): invalid next size:
0x000000000243bfb0 ***
======= Backtrace: =========
/lib/libc.so.6[0x7f22d49b0a58]
/lib/libc.so.6[0x7f22d49b4d51]
/lib/libc.so.6(realloc+0x12e)[0x7f22d49b5bde]
./gse1/bin/gse[0x6034e9]
./gse1/bin/gse[0x5f1445]
./gse1/bin/gse[0x5f12a8]
./gse1/bin/gse[0x5f918b]
./gse1/bin/gse[0x5b48ae]
./gse1/bin/gse[0x5af200]
./gse1/bin/gse[0x596a41]
./gse1/bin/gse[0x5a1f8d]
./gse1/bin/gse[0x5a25dc]
./gse1/bin/gse[0x45df04]
./gse1/bin/gse[0x45f456]
./gse1/bin/gse[0x4627d9]
./gse1/bin/gse[0x464256]
./gse1/bin/gse[0x44bf5c]
./gse1/bin/gse[0x4046d6]
/lib/libc.so.6(__libc_start_main+0xe6)[0x7f22d4955466]
./gse1/bin/gse[0x404479]
======= Memory map: ========
[...]
[...]


How can I solve this problem?

Thank you for the time you will spend to read and answer my questions.

-- 
Mattia
barbieri.mattia at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listserv.zib.de/mailman/private/scip/attachments/20100511/11e6ddd8/attachment.html


More information about the Scip mailing list