45 #include "blockmemshell/memory.h"
47 #include "scip/pub_misc.h"
48 #include "scip/pub_message.h"
56 #define BMS_CALL(x) do \
60 SCIPerrorMessage("No memory in function call.\n"); \
61 return SCIP_NOMEMORY; \
67 struct SCIP_SDPiSolver
69 SCIP_MESSAGEHDLR* messagehdlr;
75 SCIP_Real sdpsolverfeastol;
90 SCIPerrorMessage(
"No SDP-solver available (SDP=none).\n");
91 SCIPerrorMessage(
"Ensure <relaxing/SDP/freq = -1>.\n");
101 SCIPerrorMessage(
"No SDP-solver available (SDP=none).\n");
102 SCIPerrorMessage(
"Ensure <relaxing/SDP/freq = -1>.\n");
126 return "no SDP-Solver linked currently";
139 assert( sdpisolver != NULL );
188 SCIP_MESSAGEHDLR* messagehdlr,
193 assert( sdpisolver != NULL );
194 assert( blkmem != NULL );
195 assert( bufmem != NULL );
196 SCIPdebugMessage(
"Calling SCIPsdpiCreate \n");
197 SCIPdebugMessage(
"Note that currently no SDP-Solver is linked to the binary. Ensure <relaxing/SDP/freq = -1>. \n");
199 BMS_CALL( BMSallocBlockMemory(blkmem, sdpisolver) );
201 (*sdpisolver)->messagehdlr = messagehdlr;
202 (*sdpisolver)->blkmem = blkmem;
203 (*sdpisolver)->bufmem = bufmem;
213 assert( sdpisolver != NULL );
214 assert( *sdpisolver != NULL );
215 SCIPdebugMessage(
"Freeing SDPISolver\n");
217 BMSfreeBlockMemory((*sdpisolver)->blkmem, sdpisolver);
227 SCIPdebugMessage(
"SDPs aren't counted as there is no SDP-solver.\n");
237 SCIPdebugMessage(
"SDPs aren't counted as there is no SDP-solver.\n");
277 int* sdpconstnblocknonz,
281 SCIP_Real** sdpconstval,
283 int** sdpnblockvarnonz,
293 int* blockindchanges,
305 int* startZnblocknonz,
311 SCIP_Real** startZval,
313 int* startXnblocknonz,
319 SCIP_Real** startXval,
355 SCIP_Real penaltyparam,
366 int* sdpconstnblocknonz,
370 SCIP_Real** sdpconstval,
372 int** sdpnblockvarnonz,
382 int* blockindchanges,
394 int* startZnblocknonz,
400 SCIP_Real** startZval,
402 int* startXnblocknonz,
408 SCIP_Real** startXval,
415 SCIP_Bool* penaltybound
463 SCIP_Bool* primalfeasible,
464 SCIP_Bool* dualfeasible
469 return SCIP_PLUGINNOTFOUND;
634 return SCIP_PLUGINNOTFOUND;
645 return SCIP_PLUGINNOTFOUND;
662 return SCIP_PLUGINNOTFOUND;
670 int* startXnblocknonz
676 return SCIP_PLUGINNOTFOUND;
693 int* startXnblocknonz,
697 SCIP_Real** startXval
702 return SCIP_PLUGINNOTFOUND;
722 return SCIP_PLUGINNOTFOUND;
729 int* startXnblocknonz
734 return SCIP_PLUGINNOTFOUND;
746 int* startXnblocknonz,
750 SCIP_Real** startXval
755 return SCIP_PLUGINNOTFOUND;
776 return SCIP_PLUGINNOTFOUND;
787 return SCIP_PLUGINNOTFOUND;
798 return SCIP_PLUGINNOTFOUND;
837 assert( sdpisolver != NULL );
838 assert( dval != NULL );
843 *dval = sdpisolver->epsilon;
846 *dval = sdpisolver->gaptol;
849 *dval = sdpisolver->feastol;
852 *dval = sdpisolver->sdpsolverfeastol;
855 *dval = sdpisolver->objlimit;
858 return SCIP_PARAMETERUNKNOWN;
871 assert( sdpisolver != NULL );
876 sdpisolver->epsilon = dval;
877 SCIPdebugMessage(
"Setting sdpisolver epsilon to %f.\n", dval);
880 sdpisolver->gaptol = dval;
881 SCIPdebugMessage(
"Setting sdpisolver gaptol to %f.\n", dval);
884 sdpisolver->feastol = dval;
885 SCIPdebugMessage(
"Setting sdpisolver feastol to %f.\n", dval);
888 sdpisolver->sdpsolverfeastol = dval;
889 SCIPdebugMessage(
"Setting sdpisolver sdpsolverfeastol to %f.\n", dval);
892 SCIPdebugMessage(
"Setting sdpisolver objlimit to %f.\n", dval);
893 sdpisolver->objlimit = dval;
896 return SCIP_PARAMETERUNKNOWN;
909 assert( sdpisolver != NULL );
914 *ival = (int) sdpisolver->sdpinfo;
915 SCIPdebugMessage(
"Getting sdpisolver information output (%d).\n", *ival);
918 return SCIP_PARAMETERUNKNOWN;
931 assert( sdpisolver != NULL );
936 sdpisolver->sdpinfo = (SCIP_Bool) ival;
937 SCIPdebugMessage(
"Setting sdpisolver information output (%d).\n", ival);
940 return SCIP_PARAMETERUNKNOWN;
952 SCIPdebugMessage(
"Lambdastar parameter only used by SDPA.");
961 SCIP_Real* penaltyparam
964 assert( penaltyparam != NULL );
966 *penaltyparam = 1E+10;
974 SCIP_Real penaltyparam,
975 SCIP_Real* maxpenaltyparam
978 assert( maxpenaltyparam != NULL );
980 *maxpenaltyparam = 1E+10;
1005 return SCIP_PLUGINNOTFOUND;
1016 return SCIP_PLUGINNOTFOUND;
SCIP_Bool SCIPsdpiSolverDoesWarmstartNeedPrimal(void)
SCIP_RETCODE SCIPsdpiSolverIgnoreInstability(SCIP_SDPISOLVER *sdpisolver, SCIP_Bool *success)
SCIP_Bool SCIPsdpiSolverIsOptimal(SCIP_SDPISOLVER *sdpisolver)
SCIP_Real SCIPsdpiSolverGetMaxPrimalEntry(SCIP_SDPISOLVER *sdpisolver)
SCIP_RETCODE SCIPsdpiSolverGetPrimalBoundVars(SCIP_SDPISOLVER *sdpisolver, SCIP_Real *lbvars, SCIP_Real *ubvars, int *arraylength)
SCIP_Bool SCIPsdpiSolverIsAcceptable(SCIP_SDPISOLVER *sdpisolver)
SCIP_Bool SCIPsdpiSolverIsDualFeasible(SCIP_SDPISOLVER *sdpisolver)
SCIP_RETCODE SCIPsdpiSolverGetPrimalNonzeros(SCIP_SDPISOLVER *sdpisolver, int nblocks, int *startXnblocknonz)
const char * SCIPsdpiSolverGetSolverDesc(void)
SCIP_RETCODE SCIPsdpiSolverGetPrimalMatrix(SCIP_SDPISOLVER *sdpisolver, int nblocks, int *startXnblocknonz, int **startXrow, int **startXcol, SCIP_Real **startXval)
SCIP_Bool SCIPsdpiSolverIsPrimalInfeasible(SCIP_SDPISOLVER *sdpisolver)
enum SCIP_SDPSolverSetting SCIP_SDPSOLVERSETTING
SCIP_RETCODE SCIPsdpiSolverReadSDP(SCIP_SDPISOLVER *sdpisolver, const char *fname)
SCIP_Bool SCIPsdpiSolverFeasibilityKnown(SCIP_SDPISOLVER *sdpisolver)
SCIP_Real SCIPsdpiSolverInfinity(SCIP_SDPISOLVER *sdpisolver)
SCIP_Bool SCIPsdpiSolverIsPrimalUnbounded(SCIP_SDPISOLVER *sdpisolver)
int SCIPsdpiSolverGetInternalStatus(SCIP_SDPISOLVER *sdpisolver)
interface methods for specific SDP-solvers
SCIP_Real SCIPsdpiSolverGetDefaultSdpiSolverFeastol(void)
SCIP_Bool SCIPsdpiSolverIsDualInfeasible(SCIP_SDPISOLVER *sdpisolver)
SCIP_Bool SCIPsdpiSolverIsObjlimExc(SCIP_SDPISOLVER *sdpisolver)
SCIP_Bool SCIPsdpiSolverIsTimelimExc(SCIP_SDPISOLVER *sdpisolver)
SCIP_RETCODE SCIPsdpiSolverResetCounter(SCIP_SDPISOLVER *sdpisolver)
const char * SCIPsdpiSolverGetSolverName(void)
SCIP_RETCODE SCIPsdpiSolverLoadAndSolve(SCIP_SDPISOLVER *sdpisolver, int nvars, SCIP_Real *obj, SCIP_Real *lb, SCIP_Real *ub, int nsdpblocks, int *sdpblocksizes, int *sdpnblockvars, int sdpconstnnonz, int *sdpconstnblocknonz, int **sdpconstrow, int **sdpconstcol, SCIP_Real **sdpconstval, int sdpnnonz, int **sdpnblockvarnonz, int **sdpvar, int ***sdprow, int ***sdpcol, SCIP_Real ***sdpval, int **indchanges, int *nremovedinds, int *blockindchanges, int nremovedblocks, int nlpcons, int noldlpcons, SCIP_Real *lplhs, SCIP_Real *lprhs, int *rownactivevars, int lpnnonz, int *lprow, int *lpcol, SCIP_Real *lpval, SCIP_Real *starty, int *startZnblocknonz, int **startZrow, int **startZcol, SCIP_Real **startZval, int *startXnblocknonz, int **startXrow, int **startXcol, SCIP_Real **startXval, SCIP_SDPSOLVERSETTING startsettings, SCIP_Real timelimit)
int SCIPsdpiSolverGetDefaultSdpiSolverNpenaltyIncreases(void)
SCIP_RETCODE SCIPsdpiSolverComputeMaxPenaltyparam(SCIP_SDPISOLVER *sdpisolver, SCIP_Real penaltyparam, SCIP_Real *maxpenaltyparam)
SCIP_RETCODE SCIPsdpiSolverFree(SCIP_SDPISOLVER **sdpisolver)
SCIP_RETCODE SCIPsdpiSolverGetSolFeasibility(SCIP_SDPISOLVER *sdpisolver, SCIP_Bool *primalfeasible, SCIP_Bool *dualfeasible)
SCIP_RETCODE SCIPsdpiSolverGetIterations(SCIP_SDPISOLVER *sdpisolver, int *iterations)
SCIP_RETCODE SCIPsdpiSolverGetRealpar(SCIP_SDPISOLVER *sdpisolver, SCIP_SDPPARAM type, SCIP_Real *dval)
SCIP_RETCODE SCIPsdpiSolverSettingsUsed(SCIP_SDPISOLVER *sdpisolver, SCIP_SDPSOLVERSETTING *usedsetting)
SCIP_RETCODE SCIPsdpiSolverGetObjval(SCIP_SDPISOLVER *sdpisolver, SCIP_Real *objval)
SCIP_RETCODE SCIPsdpiSolverGetSdpCalls(SCIP_SDPISOLVER *sdpisolver, int *calls)
void * SCIPsdpiSolverGetSolverPointer(SCIP_SDPISOLVER *sdpisolver)
SCIP_RETCODE SCIPsdpiSolverLoadAndSolveWithPenalty(SCIP_SDPISOLVER *sdpisolver, SCIP_Real penaltyparam, SCIP_Bool withobj, SCIP_Bool rbound, int nvars, SCIP_Real *obj, SCIP_Real *lb, SCIP_Real *ub, int nsdpblocks, int *sdpblocksizes, int *sdpnblockvars, int sdpconstnnonz, int *sdpconstnblocknonz, int **sdpconstrow, int **sdpconstcol, SCIP_Real **sdpconstval, int sdpnnonz, int **sdpnblockvarnonz, int **sdpvar, int ***sdprow, int ***sdpcol, SCIP_Real ***sdpval, int **indchanges, int *nremovedinds, int *blockindchanges, int nremovedblocks, int nlpcons, int noldlpcons, SCIP_Real *lplhs, SCIP_Real *lprhs, int *rownactivevars, int lpnnonz, int *lprow, int *lpcol, SCIP_Real *lpval, SCIP_Real *starty, int *startZnblocknonz, int **startZrow, int **startZcol, SCIP_Real **startZval, int *startXnblocknonz, int **startXrow, int **startXcol, SCIP_Real **startXval, SCIP_SDPSOLVERSETTING startsettings, SCIP_Real timelimit, SCIP_Bool *feasorig, SCIP_Bool *penaltybound)
SCIP_Bool SCIPsdpiSolverIsPrimalFeasible(SCIP_SDPISOLVER *sdpisolver)
SCIP_RETCODE SCIPsdpiSolverSetIntpar(SCIP_SDPISOLVER *sdpisolver, SCIP_SDPPARAM type, int ival)
SCIP_RETCODE SCIPsdpiSolverCreate(SCIP_SDPISOLVER **sdpisolver, SCIP_MESSAGEHDLR *messagehdlr, BMS_BLKMEM *blkmem, BMS_BUFMEM *bufmem)
SCIP_Real SCIPsdpiSolverGetDefaultSdpiSolverGaptol(void)
SCIP_RETCODE SCIPsdpiSolverSetRealpar(SCIP_SDPISOLVER *sdpisolver, SCIP_SDPPARAM type, SCIP_Real dval)
SCIP_RETCODE SCIPsdpiSolverWriteSDP(SCIP_SDPISOLVER *sdpisolver, const char *fname)
SCIP_Bool SCIPsdpiSolverIsInfinity(SCIP_SDPISOLVER *sdpisolver, SCIP_Real val)
SCIP_RETCODE SCIPsdpiSolverComputeLambdastar(SCIP_SDPISOLVER *sdpisolver, SCIP_Real maxguess)
SCIP_RETCODE SCIPsdpiSolverGetPreoptimalPrimalNonzeros(SCIP_SDPISOLVER *sdpisolver, int nblocks, int *startXnblocknonz)
SCIP_RETCODE SCIPsdpiSolverGetIntpar(SCIP_SDPISOLVER *sdpisolver, SCIP_SDPPARAM type, int *ival)
SCIP_Bool SCIPsdpiSolverWasSolved(SCIP_SDPISOLVER *sdpisolver)
SCIP_RETCODE SCIPsdpiSolverIncreaseCounter(SCIP_SDPISOLVER *sdpisolver)
SCIP_Bool SCIPsdpiSolverIsDualUnbounded(SCIP_SDPISOLVER *sdpisolver)
struct SCIP_SDPiSolver SCIP_SDPISOLVER
SCIP_Bool SCIPsdpiSolverIsConverged(SCIP_SDPISOLVER *sdpisolver)
static void errorMessageAbort(void)
SCIP_RETCODE SCIPsdpiSolverGetSol(SCIP_SDPISOLVER *sdpisolver, SCIP_Real *objval, SCIP_Real *dualsol, int *dualsollength)
SCIP_RETCODE SCIPsdpiSolverGetPreoptimalSol(SCIP_SDPISOLVER *sdpisolver, SCIP_Bool *success, SCIP_Real *dualsol, int *dualsollength, int nblocks, int *startXnblocknonz, int **startXrow, int **startXcol, SCIP_Real **startXval)
enum SCIP_SDPParam SCIP_SDPPARAM
static void errorMessage(void)
SCIP_RETCODE SCIPsdpiSolverComputePenaltyparam(SCIP_SDPISOLVER *sdpisolver, SCIP_Real maxcoeff, SCIP_Real *penaltyparam)
SCIP_Bool SCIPsdpiSolverIsIterlimExc(SCIP_SDPISOLVER *sdpisolver)