I have a C++ application that can use indistinctly (vía polymorphism and virtual methods) CPLEX
, GUROBI
or COIN
to solve an LP, and now I'm adding support for SCIP
.
In the first three solvers I can add several constraints/variables at once, using the calls:
CPLEX = CPXXaddrows
GUROBI = GRBXaddconstrs
COIN = OsiSolverInterface::addRows
CPLEX = CPXXaddcols
GUROBI = GRBXaddvars
COIN = OsiSolverInterface::addCols
But for SCIP
, I've only figured out how to do it one by one:
SCIPcreateConsBasicLinear -> SCIPaddCoefLinear-> SCIPaddCons -> SCIPreleaseCons
SCIPcreateVarBasic -> SCIPaddVar -> SCIPreleaseVar
My question is: Is there a way in SCIP
to create several variables/constraints in one instruction? I ask because, at least for the other solvers, doing it that way is a lot faster than doing it one by one.
Thanks a lot in advance.
In SCIP you have to create variables and constraints one by one.