/** creates the message handler for the given message handler object */ SCIP_RETCODE SCIPcreateObjMessagehdlr( SCIP_MESSAGEHDLR** messagehdlr, /**< pointer to store the message handler */ scip::ObjMessagehdlr* objmessagehdlr, /**< message handler object */ SCIP_Bool deleteobject /**< should the message handler object be deleted when message handler is freed? */ ) { SCIP_MESSAGEHDLRDATA* messagehdlrdata; SCIP_RETCODE retcode; /* create file messagehdlr data */ messagehdlrdata = new SCIP_MESSAGEHDLRDATA; messagehdlrdata->objmessagehdlr = objmessagehdlr; messagehdlrdata->deleteobject = deleteobject; /* create message handler */ retcode = SCIPmessagehdlrCreate(messagehdlr, objmessagehdlr->scip_bufferedoutput_, (const char*)NULL, FALSE, messagehdlrWarningObj, messagehdlrDialogObj, messagehdlrInfoObj, messagehdlrFree, messagehdlrdata); /*lint !e429*/ if( retcode != SCIP_OKAY ) { /* free message handler object */ if( messagehdlrdata->deleteobject ) delete messagehdlrdata->objmessagehdlr; delete messagehdlrdata; SCIP_CALL( retcode ); } return SCIP_OKAY; /*lint !e429 !e593*/ }
/** Create default message handler. To free the message handler use SCIPmessagehdlrFree() */ SCIP_RETCODE SCIPcreateMessagehdlrDefault( SCIP_MESSAGEHDLR** messagehdlr, /**< pointer to store message handler */ SCIP_Bool bufferedoutput, /**< should the output be buffered up to the next newline? */ const char* filename, /**< name of log file, or NULL (stdout) */ SCIP_Bool quiet /**< should screen messages be suppressed? */ ) { /* create message handler */ SCIP_CALL( SCIPmessagehdlrCreate(messagehdlr, bufferedoutput, filename, quiet, messageWarningDefault, messageDialogDefault, messageInfoDefault, NULL, NULL) ); return SCIP_OKAY; }
SCIP_RETCODE GamsScip::setupSCIP() { /* #ifdef COIN_HAS_OSICPX // change default LP solver to CPLEX, if license available if( gmo != NULL && checkCplexLicense(gmo, pal) ) { SCIP_CALL( SCIPlpiSwitchSetSolver(SCIP_LPISW_CPLEX) ); } #endif */ if( scip == NULL ) { // if called first time, create a new SCIP instance and include all plugins that we need and setup interface parameters SCIP_MESSAGEHDLR* messagehdlr; SCIP_NLPI* nlpiipopt; SCIP_CALL( SCIPcreate(&scip) ); // create and install our message handler SCIP_CALL( SCIPmessagehdlrCreate(&messagehdlr, FALSE, NULL, FALSE, GamsScipPrintLogStat, GamsScipPrintLog, GamsScipPrintLog, NULL, (SCIP_MESSAGEHDLRDATA*)gev) ); SCIP_CALL( SCIPsetMessagehdlr(scip, messagehdlr) ); SCIP_CALL( SCIPmessagehdlrRelease(&messagehdlr) ); SCIP_CALL( SCIPincludeDefaultPlugins(scip) ); SCIP_CALL( SCIPincludeReaderGmo(scip) ); SCIP_CALL( SCIPincludeEventHdlrSolveTrace(scip, gmo) ); /* SCIP_CALL( SCIPincludePropDefaultBounds(scip) ); */ if( ipoptlicensed ) { nlpiipopt = SCIPfindNlpi(scip, "ipopt"); if( nlpiipopt != NULL ) { SCIPsetModifiedDefaultSettingsIpopt(nlpiipopt, "linear_solver ma27\nlinear_system_scaling mc19\n"); SCIP_CALL( SCIPincludeExternalCodeInformation(scip, "HSL MA27 and MC19", "Harwell Subroutine Libraries (www.hsl.rl.ac.uk) from commercially supported Ipopt") ); } } /* else { nlpiipopt = SCIPfindNlpi(scip, "ipopt"); if( nlpiipopt != NULL ) { SCIPsetModifiedDefaultSettingsIpopt(nlpiipopt, "linear_solver mumps\n"); } } */ /* SCIP_CALL( SCIPaddBoolParam(scip, "gams/solvefinal", * "whether the problem should be solved with fixed discrete variables to get dual values", * NULL, FALSE, TRUE, NULL, NULL) ); */ SCIP_CALL( SCIPaddBoolParam(scip, "display/statistics", "whether to print statistics on a solve", NULL, FALSE, FALSE, NULL, NULL) ); SCIP_CALL( SCIPaddStringParam(scip, "gams/interactive", "command to be issued to the SCIP shell instead of issuing a solve command", NULL, FALSE, "", NULL, NULL) ); #if 0 SCIP_CALL( SCIPaddStringParam(scip, "constraints/attrfile", "name of file that specifies constraint attributes", NULL, FALSE, "", NULL, NULL) ); #endif /* SCIP_CALL( SCIPaddStringParam(scip, "lp/solver", "LP solver to use (clp, cplex, mosek, soplex, gurobi, xpress)", NULL, FALSE, SCIP_LPISW_SOLVERNAMES[SCIPlpiSwitchGetCurrentSolver()], GamsScipParamChgdLpSolver, NULL) ); */ } else { // if called before, only clear up problem and reset parameters SCIP_CALL( SCIPfreeProb(scip) ); SCIP_CALL( SCIPresetParams(scip) ); } /** pass current GMO into GMO reader, so it does not read instance from file */ SCIPsetGMOReaderGmo(scip, gmo); return SCIP_OKAY; }