[Scip] SCIPgetTransformedCons

michael.winkler@zib.de michael.winkler at zib.de
Thu May 17 05:24:02 MEST 2012


Hi,

>  SCIP_CALL( SCIPallocBufferArray(scip, &triaCons, num_nodes) );
>     for( i = 0; i < num_nodes; i++)
>     {
>         SCIP_CALL( SCIPallocMemoryArray(scip, &(triaCons[i]), i) );
>         for ( j = 0; j<i; j++)
>         {
>             SCIP_CALL( SCIPallocMemoryArray(scip, &(triaCons[i][j]), j) );
>             for ( k = 0; k<j; k++)
>             {
>
please use for triaCons[i] and triaCons[i][j] SCIPallocBufferArray()
instead of SCIPallocMemoryArray().

> I am freeing the buffer as follows (assume the lines are not commented):
>
> //    for (i=0; i<num_nodes; ++i) {
> //        for (j=0; j<i; ++j) {
> //            SCIPfreeBufferArray(scip, &triaCons[i][j]);
> //        }
> //
> //        SCIPfreeBufferArray(scip, &triaCons[i]);
> //    }
>
>     SCIPfreeBufferArray(scip, &triaCons);
>
Then you can and should uncomment the code above. (In order to speed up
the freeing process you could free the buffers in the reverse way of the
allocation.)

Best, Michael



More information about the Scip mailing list