[Scip] Howto setup SCIP to solve LP change Matrix and resolve

Timo Berthold berthold at zib.de
Tue Jul 14 16:51:01 MEST 2009


Hi Fergal.

The method you are looking for is SCIPfreeTransform() (see 
http://scip.zib.de/doc/html/scip_8h.html#9c2399c2334680cd8ad14a1a5ac31622)
Some explanation on the role of the original and the transformed problem is 
given in Q/A 15 of the SCIP FAQ: http://scip.zib.de/faq.shtml#Q15

Furthermore, you might consider to use the SCIP_CALL() / SCIP_CALL_ABORT() 
macros for catching the SCIP_RETCODE's. See http://scip.zib.de/faq.shtml#Q17 
for an explanation and the end of 
http://scip.zib.de/doc/html/def_8h-source.html for their definition.

I hope that helps resolving your problem.

Best, Timo


Am Tuesday 14 July 2009 16:35:25 schrieb fergal mohan:
> Hi all, I'm getting on well with the implementation of the .NET wrapper to
> use SCIP instead of Soplex but am running into an exception when I try to
> change the Matrix after I've already Solved. If there anyting specific that
> needs to be called after solve before changeing a Matrix values. It could
> be one of the many parameters that I'm passing to Create the Constraint or
> Var but I'm hoping someone can confirm ? I wrote a small C++ Test App that
> I can attach if that helps but the jist of it is the below. BTW the
> getConstraint method calls
> SCIP_CALL_EXC(SCIPcreateConsLinear(m_pMySCIP, & newCons, namebuf,
> 0, NULL, NULL,
> MINUSINFINITY, PLUSINFINITY,
> TRUE, TRUE, TRUE, TRUE, TRUE, FALSE,
> FALSE, FALSE, FALSE, FALSE));
> SCIP_CALL_EXC( SCIPaddCons(m_pMySCIP, newCons) );
> the getValue method calls
> SCIP_CALL_EXC( SCIPcreateVar(scip, &newvar, name,
> 	0.0, SCIPinfinity(scip), 0.0, SCIP_VARTYPE_CONTINUOUS,
> 	TRUE/*initial*/, FALSE/*removable*/,
> 	NULL, NULL, NULL, NULL) );
> Any ideas would be appreciated.
> Fergal
> // Test App solves successfully with the following call
> oSCIPPenv->Solve();			// calls SCIPsolve
> std::cout << "Result is " << oSCIPPenv->GetObjValue() << std::endl;
> // change a matrix value (2, 0) = 2 and resolve
> dColValue = 2;
> if(oSCIPPenv->getConstraint(m_pMySCIP, 2, &cons, &wasCreated) == SCIP_OKAY)
>  if(oSCIPPenv->getVariable(m_pMySCIP, 0, &var, &wasCreated) == SCIP_OKAY)
>   SCIP_CALL_EXC(SCIPaddCoefLinear(m_pMySCIP, cons, var, dColValue));
> oSCIPPenv->Solve();			// calls SCIPsolve
> <<
> the call to SCIPaddCoefLinear fails down in the SCIPlockVarCons Routine
> when it appears to be in the wrong (Transformed) stage.
>
> _______________________________________________
> Scip mailing list
> Scip at zib.de
> http://listserv.zib.de/mailman/listinfo/scip




More information about the Scip mailing list