/** gives termination reason * * input: * - nlpi datastructure for solver interface * - problem datastructure for problem instance * * return: Termination Status */ static SCIP_DECL_NLPIGETTERMSTAT( nlpiGetTermstatXyz ) { SCIPerrorMessage("method of xyz nonlinear solver is not implemented\n"); SCIPABORT(); return SCIP_NLPTERMSTAT_OTHER; /*lint !e527*/ } /*lint !e715*/
/** gives primal and dual solution values * * solver can return NULL in dual values if not available * but if solver provides dual values for one side of variable bounds, then it must also provide those for the other side * * for a ranged constraint, the dual variable is positive if the right hand side is active and negative if the left hand side is active * * input: * - nlpi datastructure for solver interface * - problem datastructure for problem instance * - primalvalues buffer to store pointer to array to primal values, or NULL if not needed * - consdualvalues buffer to store pointer to array to dual values of constraints, or NULL if not needed * - varlbdualvalues buffer to store pointer to array to dual values of variable lower bounds, or NULL if not needed * - varubdualvalues buffer to store pointer to array to dual values of variable lower bounds, or NULL if not needed */ static SCIP_DECL_NLPIGETSOLUTION( nlpiGetSolutionXyz ) { SCIPerrorMessage("method of xyz nonlinear solver is not implemented\n"); SCIPABORT(); return SCIP_OKAY; /*lint !e527*/ } /*lint !e715*/
static SCIP_DECL_COMPRINIT(comprInitXyz) { /*lint --e{715}*/ SCIPerrorMessage("method of xyz tree compression not implemented yet\n"); SCIPABORT(); /*lint --e{527}*/ return SCIP_OKAY; }
/** gives solution status * * input: * - nlpi datastructure for solver interface * - problem datastructure for problem instance * * return: Solution Status */ static SCIP_DECL_NLPIGETSOLSTAT( nlpiGetSolstatXyz ) { SCIPerrorMessage("method of xyz nonlinear solver is not implemented\n"); SCIPABORT(); return SCIP_NLPSOLSTAT_UNKNOWN; /*lint !e527*/ } /*lint !e715*/
/** destructor of NLP interface to free nlpi data * * input: * - nlpi datastructure for solver interface */ static SCIP_DECL_NLPIFREE( nlpiFreeXyz ) { SCIPerrorMessage("method of xyz nonlinear solver is not implemented\n"); SCIPABORT(); return SCIP_OKAY; /*lint !e527*/ } /*lint !e715*/
static SCIP_DECL_CONSPARSE(consParseXyz) { /*lint --e{715}*/ SCIPerrorMessage("method of xyz constraint handler not implemented yet\n"); SCIPABORT(); /*lint --e{527}*/ return SCIP_OKAY; }
/** delete a set of constraints * * input: * - nlpi datastructure for solver interface * - problem datastructure for problem instance * - dstats deletion status of rows; 1 if row should be deleted, 0 if not * * output: * - dstats new position of row, -1 if row was deleted */ static SCIP_DECL_NLPIDELCONSSET( nlpiDelConstraintSetXyz ) { SCIPerrorMessage("method of xyz nonlinear solver is not implemented\n"); SCIPABORT(); return SCIP_OKAY; /*lint !e527*/ } /*lint !e715*/
/** gets floating point parameter of NLP * * input: * - nlpi NLP interface structure * - problem datastructure for problem instance, can be NULL only if type == SCIP_NLPPAR_INFINITY * - type parameter number * - dval pointer to store the parameter value * * output: * - dval parameter value */ static SCIP_DECL_NLPIGETREALPAR( nlpiGetRealParXyz ) { SCIPerrorMessage("method of xyz nonlinear solver is not implemented\n"); SCIPABORT(); return SCIP_OKAY; /*lint !e527*/ } /*lint !e715*/
/** change variable bounds * * input: * - nlpi datastructure for solver interface * - problem datastructure for problem instance * - nvars number of variables to change bounds * - indices indices of variables to change bounds * - lbs new lower bounds * - ubs new upper bounds */ static SCIP_DECL_NLPICHGVARBOUNDS( nlpiChgVarBoundsXyz ) { SCIPerrorMessage("method of xyz nonlinear solver is not implemented\n"); SCIPABORT(); return SCIP_OKAY; /*lint !e527*/ } /*lint !e715*/
/** change constraint bounds * * input: * - nlpi datastructure for solver interface * - problem datastructure for problem instance * - nconss number of constraints to change sides * - indices indices of constraints to change sides * - lhss new left hand sides * - rhss new right hand sides */ static SCIP_DECL_NLPICHGCONSSIDES( nlpiChgConsSidesXyz ) { SCIPerrorMessage("method of xyz nonlinear solver is not implemented\n"); SCIPABORT(); return SCIP_OKAY; /*lint !e527*/ } /*lint !e715*/
/** sets or overwrites objective, a minimization problem is expected * May change sparsity pattern. * * input: * - nlpi datastructure for solver interface * - problem datastructure for problem instance * - nlins number of linear variables * - lininds variable indices * may be NULL in case of no linear part * - linvals coefficient values * may be NULL in case of no linear part * - nquadcols number of columns in matrix of quadratic part * - quadcols indices of variables for which a quadratic part is specified * may be NULL in case of no quadratic part * - quadoffsets start index of each rows quadratic coefficients in quadinds and quadvals * quadoffsets[.][nquadcols] gives length of quadinds and quadvals * may be NULL in case of no quadratic part * - quadinds column indices * may be NULL in case of no quadratic part * - quadvals coefficient values * may be NULL in case of no quadratic part * - exprvaridxs indices of variables in expression tree, maps variable indices in expression tree to indices in nlp * may be NULL in case of no expression tree * - exprtree expression tree for nonquadratic part of objective function * may be NULL in case of no nonquadratic part * - constant objective value offset */ static SCIP_DECL_NLPISETOBJECTIVE( nlpiSetObjectiveXyz ) { SCIPerrorMessage("method of xyz nonlinear solver is not implemented\n"); SCIPABORT(); return SCIP_OKAY; /*lint !e527*/ } /*lint !e715*/
/** add constraints * quadratic coefficiens: row oriented matrix for each constraint * * input: * - nlpi datastructure for solver interface * - problem datastructure for problem instance * - ncons number of added constraints * - lhss left hand sides of constraints * - rhss right hand sides of constraints * - nlininds number of linear coefficients for each constraint * may be NULL in case of no linear part * - lininds indices of variables for linear coefficients for each constraint * may be NULL in case of no linear part * - linvals values of linear coefficient for each constraint * may be NULL in case of no linear part * - nquadrows number of columns in matrix of quadratic part for each constraint * may be NULL in case of no quadratic part in any constraint * - quadrowidxs indices of variables for which a quadratic part is specified * may be NULL in case of no quadratic part in any constraint * - quadoffsets start index of each rows quadratic coefficients in quadinds[.] and quadvals[.] * indices are given w.r.t. quadrowidxs., i.e., quadoffsets[.][i] gives the start index of row quadrowidxs[.][i] in quadvals[.] * quadoffsets[.][nquadrows[.]] gives length of quadinds[.] and quadvals[.] * entry of array may be NULL in case of no quadratic part * may be NULL in case of no quadratic part in any constraint * - quadinds column indices w.r.t. quadrowidxs, i.e., quadrowidxs[quadinds[.][i]] gives the index of the variable corresponding * to entry i, entry of array may be NULL in case of no quadratic part * may be NULL in case of no quadratic part in any constraint * - quadvals coefficient values * entry of array may be NULL in case of no quadratic part * may be NULL in case of no quadratic part in any constraint * - exprvaridxs indices of variables in expression tree, maps variable indices in expression tree to indices in nlp * entry of array may be NULL in case of no expression tree * may be NULL in case of no expression tree in any constraint * - exprtrees expression tree for nonquadratic part of constraints * entry of array may be NULL in case of no nonquadratic part * may be NULL in case of no nonquadratic part in any constraint * - names of constraints, may be NULL or entries may be NULL */ static SCIP_DECL_NLPIADDCONSTRAINTS( nlpiAddConstraintsXyz ) { SCIPerrorMessage("method of xyz nonlinear solver is not implemented\n"); SCIPABORT(); return SCIP_OKAY; /*lint !e527*/ } /*lint !e715*/
/** gets pointer to solver-internal problem instance * * to do dirty stuff * * input: * - nlpi datastructure for solver interface * - problem datastructure for problem instance * * return: void pointer to problem instance */ static SCIP_DECL_NLPIGETPROBLEMPOINTER(nlpiGetProblemPointerXyz) { SCIPerrorMessage("method of xyz nonlinear solver is not implemented\n"); SCIPABORT(); return NULL; /*lint !e527*/ } /*lint !e715*/
/** creates a problem instance * * input: * - nlpi datastructure for solver interface * - problem pointer to store the problem data * - name name of problem, can be NULL */ static SCIP_DECL_NLPICREATEPROBLEM(nlpiCreateProblemXyz) { SCIPerrorMessage("method of xyz nonlinear solver is not implemented\n"); SCIPABORT(); return SCIP_OKAY; /*lint !e527*/ } /*lint !e715*/
/** changes (or adds) coefficients in the quadratic part of a constraint or objective * * input: * - nlpi datastructure for solver interface * - problem datastructure for problem instance * - idx index of constraint or -1 for objective * - nentries number of entries in quadratic matrix to change * - rows row indices of entries in quadratic matrix where values should be changed * - cols column indices of entries in quadratic matrix where values should be changed * - values new values for entries in quadratic matrix */ static SCIP_DECL_NLPICHGQUADCOEFS( nlpiChgQuadraticCoefsXyz ) { SCIPerrorMessage("method of xyz nonlinear solver is not implemented\n"); SCIPABORT(); return SCIP_OKAY; /*lint !e527*/ } /*lint !e715*/
/** sets warmstart information in solver * * write warmstart to buffer * * input: * - nlpi datastructure for solver interface * - problem datastructure for problem instance * - buffer warmstart information */ static SCIP_DECL_NLPISETWARMSTARTMEMO( nlpiSetWarmstartMemoXyz ) { SCIPerrorMessage("method of xyz nonlinear solver is not implemented\n"); SCIPABORT(); return SCIP_OKAY; /*lint !e527*/ } /*lint !e715*/
/** change one coefficient in the nonlinear part * * input: * - nlpi datastructure for solver interface * - problem datastructure for problem instance * - idxcons index of constraint or -1 for objective * - idxparam index of parameter * - value new value for nonlinear parameter * * return: Error if parameter does not exist */ static SCIP_DECL_NLPICHGNONLINCOEF( nlpiChgNonlinCoefXyz ) { SCIPerrorMessage("method of xyz nonlinear solver is not implemented\n"); SCIPABORT(); return SCIP_OKAY; /*lint !e527*/ } /*lint !e715*/
/** sets string parameter of NLP * * input: * - nlpi NLP interface structure * - problem datastructure for problem instance * - type parameter number * - sval parameter value */ static SCIP_DECL_NLPISETSTRINGPAR( nlpiSetStringParXyz ) { SCIPerrorMessage("method of xyz nonlinear solver is not implemented\n"); SCIPABORT(); return SCIP_OKAY; /*lint !e527*/ } /*lint !e715*/
/** change the constant offset in the objective * * input: * - nlpi datastructure for solver interface * - problem datastructure for problem instance * - objconstant new value for objective constant */ static SCIP_DECL_NLPICHGOBJCONSTANT( nlpiChgObjConstantXyz ) { SCIPerrorMessage("method of xyz nonlinear solver is not implemented\n"); SCIPABORT(); return SCIP_OKAY; /*lint !e527*/ } /*lint !e715*/
static SCIP_DECL_CONSHDLRCOPY(conshdlrCopyXyz) { /*lint --e{715}*/ SCIPerrorMessage("method of xyz constraint handler not implemented yet\n"); SCIPABORT(); /*lint --e{527}*/ return SCIP_OKAY; }
/** sets initial guess for primal variables * * input: * - nlpi datastructure for solver interface * - problem datastructure for problem instance * - primalvalues initial primal values for variables, or NULL to clear previous values * - consdualvalues initial dual values for constraints, or NULL to clear previous values * - varlbdualvalues initial dual values for variable lower bounds, or NULL to clear previous values * - varubdualvalues initial dual values for variable upper bounds, or NULL to clear previous values */ static SCIP_DECL_NLPISETINITIALGUESS( nlpiSetInitialGuessXyz ) { SCIPerrorMessage("method of xyz nonlinear solver is not implemented\n"); SCIPABORT(); return SCIP_OKAY; /*lint !e527*/ } /*lint !e715*/
static SCIP_DECL_CONSGETDIVEBDCHGS(consGetDiveBdChgsXyz) { /*lint --e{715}*/ SCIPerrorMessage("method of xyz constraint handler not implemented yet\n"); SCIPABORT(); /*lint --e{527}*/ return SCIP_OKAY; }
/** gives solve statistics * * input: * - nlpi datastructure for solver interface * - problem datastructure for problem instance * - statistics pointer to store statistics * * output: * - statistics solve statistics */ static SCIP_DECL_NLPIGETSTATISTICS( nlpiGetStatisticsXyz ) { SCIPerrorMessage("method of xyz nonlinear solver is not implemented\n"); SCIPABORT(); return SCIP_OKAY; /*lint !e527*/ } /*lint !e715*/
static SCIP_DECL_CONSGETNVARS(consGetNVarsXyz) { /*lint --e{715}*/ SCIPerrorMessage("method of xyz power constraint handler not implemented yet\n"); SCIPABORT(); /*lint --e{527}*/ return SCIP_OKAY; }
static SCIP_DECL_SEPAEXITSOL(sepaExitsolXyz) { /*lint --e{715}*/ SCIPerrorMessage("method of xyz separator not implemented yet\n"); SCIPABORT(); /*lint --e{527}*/ return SCIP_OKAY; }
static SCIP_DECL_BRANCHEXECEXT(branchExecextMyfullstrong) { /*lint --e{715}*/ SCIPerrorMessage("method of myfullstrong branching rule not implemented yet\n"); SCIPABORT(); /*lint --e{527}*/ return SCIP_OKAY; }
static SCIP_DECL_BRANCHINITSOL(branchInitsolMyfullstrong) { /*lint --e{715}*/ SCIPerrorMessage("method of myfullstrong branching rule not implemented yet\n"); SCIPABORT(); /*lint --e{527}*/ return SCIP_OKAY; }
static SCIP_DECL_DIALOGDESC(dialogDescXyz) { /*lint --e{715}*/ SCIPerrorMessage("method of xyz dialog not implemented yet\n"); SCIPABORT(); /*lint --e{527}*/ return SCIP_OKAY; }
/** writes problem to file */ JNIEXPORT jint JNISCIPREADERPIP(writePip)( JNIEnv* env, /**< JNI environment variable */ jobject jobj, /**< JNI class pointer */ jlong jscip, /**< SCIP data structure */ jlong jfile, /**< output file, or NULL if standard output should be used */ jstring jname, /**< problem name */ jboolean jtransformed, /**< TRUE iff problem is the transformed problem */ jint jobjsense, /**< objective sense */ jdouble jobjscale, /**< scalar applied to objective function; external objective value is * extobj = objsense * objscale * (intobj + objoffset) */ jdouble jobjoffset, /**< objective offset from bound shifting and fixing */ jlongArray jvars, /**< array with active variables ordered binary, integer, implicit, continuous */ jint jnvars, /**< number of mutable variables in the problem */ jint jnbinvars, /**< number of binary variables */ jint jnintvars, /**< number of general integer variables */ jint jnimplvars, /**< number of implicit integer variables */ jint jncontvars, /**< number of continuous variables */ jlongArray jconss, /**< array with constraints of the problem */ jint jnconss /**< number of constraints in the problem */ ) { SCIP* scip; const char* name; SCIP_VAR** vars; SCIP_CONS** conss; SCIP_RESULT result; jboolean iscopy; /* convert JNI pointer into C pointer */ scip = (SCIP*) (size_t) jscip; assert(scip != NULL); JNISCIP_CALL( SCIPallocBufferArray(scip, &vars, (int)jnvars) ); JNISCIP_CALL( SCIPallocBufferArray(scip, &conss, (int)jnconss) ); (*env)->GetLongArrayRegion(env, jvars, 0, jnvars, (jlong*)(*vars)); (*env)->GetLongArrayRegion(env, jconss, 0, jnconss, (jlong*)(*conss)); /* convert JNI string into C const char* */ name = (*env)->GetStringUTFChars(env, jname, &iscopy); if( name == NULL ) SCIPABORT(); assert(iscopy); JNISCIP_CALL( SCIPwritePip(scip, (FILE*)(size_t) jfile, name, (SCIP_Bool)jtransformed, (SCIP_OBJSENSE)jobjsense, (SCIP_Real)jobjscale, (SCIP_Real)jobjoffset, vars, (int)jnvars, (int)jnbinvars, (int)jnintvars, (jint)jnimplvars, (int)jncontvars, conss, (int)jnconss, &result) ); SCIPfreeBufferArray(scip, &vars); SCIPfreeBufferArray(scip, &conss); (*env)->ReleaseStringUTFChars(env, jname, name); return (jint) result; }
/** execution method of dialog */ static SCIP_DECL_DIALOGEXEC(dialogExecXyz) { /*lint --e{715}*/ SCIPerrorMessage("method of xyz dialog not implemented yet\n"); SCIPABORT(); /*lint --e{827}*/ /* add your dialog to history of dialogs that have been executed */ SCIP_CALL( SCIPdialoghdlrAddHistory(dialoghdlr, dialog, NULL, FALSE) ); /* TODO: Implement execution of your dialog here. */ /* next dialog will be root dialog again */ *nextdialog = SCIPdialoghdlrGetRoot(dialoghdlr); return SCIP_OKAY; }