[Scip] How to access a subscip in ObjPricer::scip_redcost?
Sebastian Ruther
Sebastian.Ruther at uon.edu.au
Thu Dec 23 08:31:20 MET 2010
Hello,
well it works the way you suggested. However, I found out that the
general problem is with the PricerData. I can't access it anywhere but
the function in which I call the constructor:
PricerDataCG* pPricerDataCG = new PricerDataCG(iAc->second);
for which I define struct PricerDataCG : public SCIP_PricerData.
I guess I need to tell scip that a pricer data exists:
SCIPpricerSetData(pricer, pPricerDataCG);
However, if I do this I get an unexpected exception error for line
SCIP_CALL( pricerdata->objpricer->scip_redcost(scip, pricer, lowerbound,
result) ); in solve.c
the debugger tells me that objpricer doesn't know function scip_redcost.
If I exclude SCIPpricerSetData it compiles and runs fine but like I said
I can't use the pricerdata anywhere else.
So what's the correct way to initialize/add a pricerdata object?
BTW: is there an equivalent of SCIPpricerSetData probdata?
Merry christmas
Sebastian
On 22/12/2010 10:05 PM, Timo Berthold wrote:
> Hi Sebastian.
>
> In C, you would put this into the private data struct SCIP_PricerData. In C++,
> however, you can just define a SCIP* subscip as global object variables.
>
> Also see the doxygen HowTo for private data in pricers:
> http://scip.zib.de/doc/html/PRICER.html#PRICER_DATA
> and compare lines 122-131 of examples/VRP/src/priver_vrp.h
> which is written in C++
>
> Merry Xmas to downunder,
> Timo
>
>
> Am Mittwoch 22 Dezember 2010, 07:33:09 schrieb Sebastian Ruther:
>> Hello,
>>
>> I'm implementing a Branch-and-Price algorithm. In the examples the
>> variables are always generated by the subscip which is generated in the
>> ObjPricer::scip_redcost call. However, I don't want to generate the
>> subscip problem in every iteration so I generate my subscip in
>> ObjPricer::initsol by calling
>> SCIP* subscip = NULL;
>> SCIP_CALL( SCIPcreate(&subscip) );
>> SCIP_CALL( SCIPincludeDefaultPlugins(subscip) );
>> SCIP_CALL( SCIPcreateProb(subscip, PricingNameBuf.str().c_str(), 0, 0,
>> 0, 0, 0, 0, 0) );
>>
>> How do I access the SCIP* subscip in the ObjPricer::scip_redcost
>> function? The parameter list only gives me the SCIP* scip which refers
>> to the master problem.
>>
>> Thanks
>> Sebastian
>> _______________________________________________
>> Scip mailing list
>> Scip at zib.de
>> http://listserv.zib.de/mailman/listinfo/scip
> .
>
More information about the Scip
mailing list