-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduced LagrangeNewtonSubproblem class that is created in QPMethod…
…/LPMethod and passed on to the QP/LP solver
- Loading branch information
Showing
22 changed files
with
264 additions
and
196 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 11 additions & 9 deletions
20
...lity_constrained_methods/LPSubproblem.cpp → ...equality_constrained_methods/LPMethod.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,39 @@ | ||
// Copyright (c) 2018-2024 Charlie Vanaret | ||
// Licensed under the MIT license. See LICENSE file in the project directory for details. | ||
|
||
#include "LPSubproblem.hpp" | ||
#include "optimization/Direction.hpp" | ||
#include "optimization/WarmstartInformation.hpp" | ||
#include "LPMethod.hpp" | ||
#include "ingredients/constraint_relaxation_strategies/OptimizationProblem.hpp" | ||
#include "ingredients/subproblem_solvers/LPSolver.hpp" | ||
#include "ingredients/subproblem_solvers/LPSolverFactory.hpp" | ||
#include "ingredients/subproblems/LagrangeNewtonSubproblem.hpp" | ||
#include "optimization/Direction.hpp" | ||
#include "optimization/WarmstartInformation.hpp" | ||
#include "options/Options.hpp" | ||
|
||
namespace uno { | ||
LPSubproblem::LPSubproblem(size_t number_variables, size_t number_constraints, size_t number_objective_gradient_nonzeros, | ||
LPMethod::LPMethod(size_t number_variables, size_t number_constraints, size_t number_objective_gradient_nonzeros, | ||
size_t number_jacobian_nonzeros, const Options& options) : | ||
InequalityConstrainedMethod("zero", number_variables, number_constraints, 0, false, options), | ||
solver(LPSolverFactory::create(number_variables, number_constraints, | ||
number_objective_gradient_nonzeros, number_jacobian_nonzeros, options)) { | ||
} | ||
|
||
LPSubproblem::~LPSubproblem() { } | ||
LPMethod::~LPMethod() { } | ||
|
||
void LPSubproblem::generate_initial_iterate(const OptimizationProblem& /*problem*/, Iterate& /*initial_iterate*/) { | ||
void LPMethod::generate_initial_iterate(const OptimizationProblem& /*problem*/, Iterate& /*initial_iterate*/) { | ||
} | ||
|
||
void LPSubproblem::solve(Statistics& /*statistics*/, const OptimizationProblem& problem, Iterate& current_iterate, | ||
void LPMethod::solve(Statistics& statistics, const OptimizationProblem& problem, Iterate& current_iterate, | ||
const Multipliers& current_multipliers, Direction& direction, WarmstartInformation& warmstart_information) { | ||
this->solver->solve_LP(problem, current_iterate, this->initial_point, direction, this->trust_region_radius, warmstart_information); | ||
LagrangeNewtonSubproblem subproblem(problem, current_iterate, current_multipliers.constraints, *this->hessian_model, this->trust_region_radius); | ||
this->solver->solve_LP(statistics, subproblem, this->initial_point, direction, warmstart_information); | ||
InequalityConstrainedMethod::compute_dual_displacements(current_multipliers, direction.multipliers); | ||
this->number_subproblems_solved++; | ||
// reset the initial point | ||
this->initial_point.fill(0.); | ||
} | ||
|
||
double LPSubproblem::hessian_quadratic_product(const Vector<double>& /*primal_direction*/) const { | ||
double LPMethod::hessian_quadratic_product(const Vector<double>& /*primal_direction*/) const { | ||
return 0.; | ||
} | ||
} // namespace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.