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

fergal mohan fergal at mohandigital.com
Tue Jul 14 16:35:25 MEST 2009


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.



More information about the Scip mailing list