Example #1
0
LP::OPTSTAT OsiIF::_approx()
{
	lpSolverTime_.start();

	// switch the interface, if necessary
	if (currentSolverType() != Approx){
		currentSolverType_ = Approx;
		osiLP_ = switchInterfaces(Approx);
	}
	osiLP_->resolve();

	lpSolverTime_.stop();

	// check for solver statuses
	if (osiLP_->isAbandoned()){
		Logger::ifout() << "OsiIF::_approx():\nWarning: solver Interface reports staus isAbandoned\nThere have been numerical difficulties, aborting...\n";
		OGDF_THROW_PARAM(AlgorithmFailureException, ogdf::afcOsiIf);
	}

	// get information about the solution
	getSol();

	// The order is important here
	if (osiLP_->isProvenOptimal()) return Optimal;
	if (osiLP_->isProvenPrimalInfeasible()) return Infeasible;
	if (osiLP_->isProvenDualInfeasible()) return Unbounded;
	if (osiLP_->isIterationLimitReached()) return LimitReached;
	else {
		Logger::ifout() << "OsiIF::_approx(): ";
		Logger::ifout() << "unable to determine status of LP, assume the solution is optimal..." << endl;
		return Optimal;
	}
}
Example #2
0
JNIEXPORT jint JNICALL Java_EnumAccel_getSolO(JNIEnv *env, jobject jobj){
  int sol = getSol();
  //(*env)->ReleaseFloatArrayElements(env, upper, c, 0);
  return (jint)sol;
  
}