Skip to content

Commit

Permalink
Fix issue with POA bound tightening
Browse files Browse the repository at this point in the history
  • Loading branch information
andreaslundell committed Sep 16, 2021
1 parent 1dbf797 commit a146a13
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Tasks/TaskPerformBoundTightening.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ void TaskPerformBoundTightening::run()
{
env->timing->startTimer("BoundTightening");

if(env->settings->getSetting<bool>("BoundTightening.InitialPOA.Use", "Model")
if(env->settings->getSetting<bool>("BoundTightening.InitialPOA.Use", "Model") && env->reformulatedProblem
&& (sourceProblem->properties.numberOfNonlinearConstraints > 0
|| sourceProblem->objectiveFunction->properties.classification
> E_ObjectiveFunctionClassification::Quadratic))
Expand Down
6 changes: 3 additions & 3 deletions src/Tasks/TaskReformulateProblem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -245,9 +245,6 @@ TaskReformulateProblem::TaskReformulateProblem(EnvironmentPtr envPtr) : TaskBase
reformulatedProblem->properties.numberOfAddedLinearizations = env->problem->properties.numberOfAddedLinearizations;
reformulatedProblem->finalize();

auto taskPerformBoundTightening = std::make_unique<TaskPerformBoundTightening>(env, reformulatedProblem);
taskPerformBoundTightening->run();

// Fixing that a quadratic objective changed into a nonlinear objective is correctly identified
if(!(useConvexQuadraticObjective || useNonconvexQuadraticObjective)
&& reformulatedProblem->objectiveFunction->properties.classification
Expand Down Expand Up @@ -281,6 +278,9 @@ TaskReformulateProblem::TaskReformulateProblem(EnvironmentPtr envPtr) : TaskBase
Utilities::writeStringToFile(filename.str(), problem.str());
}

auto taskPerformBoundTightening = std::make_unique<TaskPerformBoundTightening>(env, reformulatedProblem);
taskPerformBoundTightening->run();

env->timing->stopTimer("ProblemReformulation");
}

Expand Down

0 comments on commit a146a13

Please sign in to comment.