Skip to content

Commit

Permalink
Moved files from /reformulation to /ingredients/constraint_relaxation…
Browse files Browse the repository at this point in the history
…_strategies, and from /solvers to /ingredients/subproblem_solvers
  • Loading branch information
cvanaret committed Dec 2, 2024
1 parent 79b7f95 commit 5134069
Show file tree
Hide file tree
Showing 54 changed files with 71 additions and 75 deletions.
14 changes: 7 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ file(GLOB UNO_SOURCE_FILES
uno/ingredients/inequality_handling_methods/*.cpp
uno/ingredients/inequality_handling_methods/inequality_constrained_methods/*.cpp
uno/ingredients/inequality_handling_methods/interior_point_methods/*.cpp
uno/ingredients/subproblems/*.cpp
uno/model/*.cpp
uno/optimization/*.cpp
uno/options/*.cpp
uno/preprocessing/*.cpp
uno/reformulation/*.cpp
uno/solvers/*.cpp
uno/ingredients/subproblem_solvers/*.cpp
uno/tools/*.cpp
)

Expand Down Expand Up @@ -115,14 +115,14 @@ else()
endif()
endif()
if(HSL OR MA57)
list(APPEND UNO_SOURCE_FILES uno/solvers/MA57/MA57Solver.cpp)
list(APPEND UNO_SOURCE_FILES uno/ingredients/subproblem_solvers/MA57/MA57Solver.cpp)
list(APPEND TESTS_UNO_SOURCE_FILES unotest/functional_tests/MA57SolverTests.cpp)

find_package(BLAS REQUIRED)
list(APPEND LIBRARIES ${BLAS_LIBRARIES})
endif()
if(HSL OR MA27)
list(APPEND UNO_SOURCE_FILES uno/solvers/MA27/MA27Solver.cpp)
list(APPEND UNO_SOURCE_FILES uno/ingredients/subproblem_solvers/MA27/MA27Solver.cpp)
list(APPEND TESTS_UNO_SOURCE_FILES unotest/functional_tests/MA27SolverTests.cpp)

find_package(BLAS REQUIRED)
Expand All @@ -142,7 +142,7 @@ find_library(BQPD bqpd)
if(NOT BQPD)
message(WARNING "Optional library BQPD was not found.")
else()
list(APPEND UNO_SOURCE_FILES uno/solvers/BQPD/BQPDSolver.cpp uno/solvers/BQPD/wdotd.f)
list(APPEND UNO_SOURCE_FILES uno/ingredients/subproblem_solvers/BQPD/BQPDSolver.cpp uno/ingredients/subproblem_solvers/BQPD/wdotd.f)
list(APPEND TESTS_UNO_SOURCE_FILES unotest/functional_tests/BQPDSolverTests.cpp)
link_to_uno(bqpd ${BQPD})
endif()
Expand All @@ -152,7 +152,7 @@ find_package(HIGHS)
if(NOT HIGHS)
message(WARNING "Optional library HiGHS was not found.")
else()
list(APPEND UNO_SOURCE_FILES uno/solvers/HiGHS/HiGHSSolver.cpp)
list(APPEND UNO_SOURCE_FILES uno/ingredients/subproblem_solvers/HiGHS/HiGHSSolver.cpp)
list(APPEND TESTS_UNO_SOURCE_FILES unotest/functional_tests/HiGHSSolverTests.cpp)
link_to_uno(highs ${HIGHS})
list(APPEND LIBRARIES highs::highs)
Expand All @@ -163,7 +163,7 @@ find_package(MUMPS)
if(NOT MUMPS_LIBRARY)
message(WARNING "Optional library MUMPS was not found.")
else()
list(APPEND UNO_SOURCE_FILES uno/solvers/MUMPS/MUMPSSolver.cpp)
list(APPEND UNO_SOURCE_FILES uno/ingredients/subproblem_solvers/MUMPS/MUMPSSolver.cpp)
list(APPEND TESTS_UNO_SOURCE_FILES unotest/functional_tests/MUMPSSolverTests.cpp)
list(APPEND LIBRARIES ${MUMPS_LIBRARY} ${MUMPS_COMMON_LIBRARY} ${MUMPS_PORD_LIBRARY})

Expand Down
6 changes: 3 additions & 3 deletions uno/Uno.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
#include "ingredients/globalization_mechanisms/GlobalizationMechanismFactory.hpp"
#include "ingredients/globalization_strategies/GlobalizationStrategyFactory.hpp"
#include "ingredients/inequality_handling_methods/InequalityHandlingMethodFactory.hpp"
#include "ingredients/subproblem_solvers/QPSolverFactory.hpp"
#include "ingredients/subproblem_solvers/LPSolverFactory.hpp"
#include "ingredients/subproblem_solvers/SymmetricIndefiniteLinearSolverFactory.hpp"
#include "linear_algebra/Vector.hpp"
#include "model/Model.hpp"
#include "optimization/Iterate.hpp"
#include "optimization/WarmstartInformation.hpp"
#include "solvers/QPSolverFactory.hpp"
#include "solvers/LPSolverFactory.hpp"
#include "solvers/SymmetricIndefiniteLinearSolverFactory.hpp"
#include "tools/Logger.hpp"
#include "optimization/OptimizationStatus.hpp"
#include "options/Options.hpp"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Licensed under the MIT license. See LICENSE file in the project directory for details.

#include "ConstraintRelaxationStrategy.hpp"
#include "OptimizationProblem.hpp"
#include "ingredients/globalization_strategies/GlobalizationStrategy.hpp"
#include "ingredients/globalization_strategies/GlobalizationStrategyFactory.hpp"
#include "optimization/Direction.hpp"
Expand All @@ -11,7 +12,6 @@
#include "model/Model.hpp"
#include "optimization/Iterate.hpp"
#include "optimization/Multipliers.hpp"
#include "reformulation/OptimizationProblem.hpp"
#include "symbolic/VectorView.hpp"
#include "symbolic/Expression.hpp"
#include "options/Options.hpp"
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ namespace uno {
};
} // namespace

#endif // UNO_ELASTICVARIABLES_H
#endif // UNO_ELASTICVARIABLES_H
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
#include <memory>
#include "ConstraintRelaxationStrategy.hpp"
#include "ingredients/globalization_strategies/ProgressMeasures.hpp"
#include "reformulation/OptimalityProblem.hpp"
#include "reformulation/l1RelaxedProblem.hpp"
#include "OptimalityProblem.hpp"
#include "l1RelaxedProblem.hpp"

namespace uno {
enum class Phase {FEASIBILITY_RESTORATION = 1, OPTIMALITY = 2};
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ namespace uno {
};
} // namespace

#endif // UNO_OPTIMALITYPROBLEM_H
#endif // UNO_OPTIMALITYPROBLEM_H
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include "ConstraintRelaxationStrategy.hpp"
#include "ingredients/globalization_strategies/ProgressMeasures.hpp"
#include "optimization/Multipliers.hpp"
#include "reformulation/l1RelaxedProblem.hpp"
#include "l1RelaxedProblem.hpp"

namespace uno {
struct l1RelaxationParameters {
Expand Down
File renamed without changes.
File renamed without changes.
7 changes: 3 additions & 4 deletions uno/ingredients/hessian_models/ConvexifiedHessian.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@
#include <stdexcept>
#include "ConvexifiedHessian.hpp"
#include "ingredients/hessian_models/UnstableRegularization.hpp"
#include "reformulation/OptimizationProblem.hpp"
#include "solvers/DirectSymmetricIndefiniteLinearSolver.hpp"
#include "solvers/SymmetricIndefiniteLinearSolverFactory.hpp"
#include "ingredients/constraint_relaxation_strategies/OptimizationProblem.hpp"
#include "ingredients/subproblem_solvers/DirectSymmetricIndefiniteLinearSolver.hpp"
#include "ingredients/subproblem_solvers/SymmetricIndefiniteLinearSolverFactory.hpp"
#include "tools/Logger.hpp"
#include "options/Options.hpp"
#include "tools/Infinity.hpp"
#include "tools/Statistics.hpp"

namespace uno {
Expand Down
2 changes: 1 addition & 1 deletion uno/ingredients/hessian_models/ExactHessian.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Licensed under the MIT license. See LICENSE file in the project directory for details.

#include "ExactHessian.hpp"
#include "reformulation/OptimizationProblem.hpp"
#include "ingredients/constraint_relaxation_strategies/OptimizationProblem.hpp"
#include "options/Options.hpp"

namespace uno {
Expand Down
2 changes: 1 addition & 1 deletion uno/ingredients/hessian_models/HessianModelFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include "ConvexifiedHessian.hpp"
#include "ExactHessian.hpp"
#include "ZeroHessian.hpp"
#include "solvers/DirectSymmetricIndefiniteLinearSolver.hpp"
#include "ingredients/subproblem_solvers/DirectSymmetricIndefiniteLinearSolver.hpp"

namespace uno {
std::unique_ptr<HessianModel> HessianModelFactory::create(const std::string& hessian_model, size_t dimension, size_t maximum_number_nonzeros,
Expand Down
2 changes: 1 addition & 1 deletion uno/ingredients/hessian_models/ZeroHessian.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Licensed under the MIT license. See LICENSE file in the project directory for details.

#include "ZeroHessian.hpp"
#include "reformulation/OptimizationProblem.hpp"
#include "ingredients/constraint_relaxation_strategies/OptimizationProblem.hpp"
#include "options/Options.hpp"

namespace uno {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
#include "inequality_constrained_methods/QPSubproblem.hpp"
#include "inequality_constrained_methods/LPSubproblem.hpp"
#include "interior_point_methods/PrimalDualInteriorPointMethod.hpp"
#include "solvers/QPSolverFactory.hpp"
#include "solvers/SymmetricIndefiniteLinearSolverFactory.hpp"
#include "ingredients/subproblem_solvers/QPSolverFactory.hpp"
#include "ingredients/subproblem_solvers/SymmetricIndefiniteLinearSolverFactory.hpp"
#include "options/Options.hpp"

namespace uno {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include "optimization/Direction.hpp"
#include "optimization/Iterate.hpp"
#include "linear_algebra/Vector.hpp"
#include "reformulation/l1RelaxedProblem.hpp"
#include "ingredients/constraint_relaxation_strategies/l1RelaxedProblem.hpp"
#include "options/Options.hpp"
#include "symbolic/VectorView.hpp"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
#include "LPSubproblem.hpp"
#include "optimization/Direction.hpp"
#include "optimization/WarmstartInformation.hpp"
#include "reformulation/OptimizationProblem.hpp"
#include "solvers/LPSolver.hpp"
#include "solvers/LPSolverFactory.hpp"
#include "ingredients/constraint_relaxation_strategies/OptimizationProblem.hpp"
#include "ingredients/subproblem_solvers/LPSolver.hpp"
#include "ingredients/subproblem_solvers/LPSolverFactory.hpp"
#include "options/Options.hpp"

namespace uno {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,13 @@

#include "QPSubproblem.hpp"
#include "optimization/Direction.hpp"
#include "ingredients/hessian_models/HessianModelFactory.hpp"
#include "linear_algebra/SymmetricMatrix.hpp"
#include "optimization/Iterate.hpp"
#include "optimization/WarmstartInformation.hpp"
#include "preprocessing/Preprocessing.hpp"
#include "reformulation/OptimizationProblem.hpp"
#include "solvers/DirectSymmetricIndefiniteLinearSolver.hpp"
#include "solvers/QPSolver.hpp"
#include "solvers/QPSolverFactory.hpp"
#include "ingredients/constraint_relaxation_strategies/OptimizationProblem.hpp"
#include "ingredients/subproblem_solvers/DirectSymmetricIndefiniteLinearSolver.hpp"
#include "ingredients/subproblem_solvers/QPSolver.hpp"
#include "ingredients/subproblem_solvers/QPSolverFactory.hpp"
#include "options/Options.hpp"
#include "tools/Statistics.hpp"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <cmath>
#include "BarrierParameterUpdateStrategy.hpp"
#include "optimization/Iterate.hpp"
#include "reformulation/OptimizationProblem.hpp"
#include "ingredients/constraint_relaxation_strategies/OptimizationProblem.hpp"
#include "symbolic/VectorExpression.hpp"
#include "tools/Logger.hpp"
#include "options/Options.hpp"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@
#include <cmath>
#include "PrimalDualInteriorPointMethod.hpp"
#include "PrimalDualInteriorPointProblem.hpp"
#include "ingredients/constraint_relaxation_strategies/l1RelaxedProblem.hpp"
#include "ingredients/subproblem_solvers/DirectSymmetricIndefiniteLinearSolver.hpp"
#include "ingredients/subproblem_solvers/SymmetricIndefiniteLinearSolverFactory.hpp"
#include "linear_algebra/SparseStorageFactory.hpp"
#include "optimization/Direction.hpp"
#include "optimization/Iterate.hpp"
#include "ingredients/hessian_models/HessianModelFactory.hpp"
#include "linear_algebra/SparseStorageFactory.hpp"
#include "solvers/DirectSymmetricIndefiniteLinearSolver.hpp"
#include "solvers/SymmetricIndefiniteLinearSolverFactory.hpp"
#include "optimization/WarmstartInformation.hpp"
#include "preprocessing/Preprocessing.hpp"
#include "reformulation/l1RelaxedProblem.hpp"
#include "symbolic/VectorView.hpp"
#include "tools/Infinity.hpp"

Expand Down Expand Up @@ -187,7 +186,7 @@ namespace uno {

// check the inertia
[[maybe_unused]] auto [number_pos_eigenvalues, number_neg_eigenvalues, number_zero_eigenvalues] = this->linear_solver->get_inertia();
assert(number_pos_eigenvalues == problem.number_variables && number_neg_eigenvalues == problem.number_constraints && number_zero_eigenvalues == 0);
assert(number_pos_eigenvalues == number_variables && number_neg_eigenvalues == number_constraints && number_zero_eigenvalues == 0);

// rhs
this->assemble_augmented_rhs(current_multipliers, number_variables, number_constraints);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#ifndef UNO_PRIMALDUALINTERIORPOINTPROBLEM_H
#define UNO_PRIMALDUALINTERIORPOINTPROBLEM_H

#include "reformulation/OptimizationProblem.hpp"
#include "ingredients/constraint_relaxation_strategies/OptimizationProblem.hpp"

namespace uno {
class PrimalDualInteriorPointProblem : public OptimizationProblem {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include <vector>
#include "ingredients/subproblems/SubproblemStatus.hpp"
#include "linear_algebra/Vector.hpp"
#include "solvers/QPSolver.hpp"
#include "ingredients/subproblem_solvers/QPSolver.hpp"

namespace uno {
// forward declaration
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#ifndef UNO_DIRECTSYMMETRICINDEFINITELINEARSOLVER_H
#define UNO_DIRECTSYMMETRICINDEFINITELINEARSOLVER_H

#include "solvers/SymmetricIndefiniteLinearSolver.hpp"
#include "SymmetricIndefiniteLinearSolver.hpp"

namespace uno {
template <typename IndexType, typename ElementType>
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef UNO_HIGHSSOLVER_H
#define UNO_HIGHSSOLVER_H

#include "solvers/LPSolver.hpp"
#include "ingredients/subproblem_solvers/LPSolver.hpp"
#include "Highs.h"

namespace uno {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
#include "LPSolverFactory.hpp"
#include "linear_algebra/Vector.hpp"
#include "options/Options.hpp"
#include "solvers/LPSolver.hpp"
#include "LPSolver.hpp"

#ifdef HAS_BQPD
#include "solvers/BQPD/BQPDSolver.hpp"
#include "ingredients/subproblem_solvers/BQPD/BQPDSolver.hpp"
#endif
#ifdef HAS_HIGHS
#include "solvers/HiGHS/HiGHSSolver.hpp"
#include "ingredients/subproblem_solvers/HiGHS/HiGHSSolver.hpp"
#endif

namespace uno {
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#include <array>
#include <vector>
#include "solvers/DirectSymmetricIndefiniteLinearSolver.hpp"
#include "../DirectSymmetricIndefiniteLinearSolver.hpp"

namespace uno {
// forward declaration
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#include <array>
#include <vector>
#include "solvers/DirectSymmetricIndefiniteLinearSolver.hpp"
#include "ingredients/subproblem_solvers/DirectSymmetricIndefiniteLinearSolver.hpp"

namespace uno {
// forward declaration
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#define UNO_MUMPSSOLVER_H

#include <vector>
#include "solvers/DirectSymmetricIndefiniteLinearSolver.hpp"
#include "../DirectSymmetricIndefiniteLinearSolver.hpp"
#include "dmumps_c.h"

namespace uno {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#define UNO_QPSOLVER_H

#include <vector>
#include "solvers/LPSolver.hpp"
#include "LPSolver.hpp"

namespace uno {
// forward declarations
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
#include "QPSolverFactory.hpp"
#include "linear_algebra/Vector.hpp"
#include "options/Options.hpp"
#include "solvers/QPSolver.hpp"
#include "QPSolver.hpp"

#ifdef HAS_BQPD
#include "solvers/BQPD/BQPDSolver.hpp"
#include "ingredients/subproblem_solvers/BQPD/BQPDSolver.hpp"
#endif

namespace uno {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
#include "options/Options.hpp"

#if defined(HAS_HSL) || defined(HAS_MA57)
#include "solvers/MA57/MA57Solver.hpp"
#include "ingredients/subproblem_solvers/MA57/MA57Solver.hpp"
#endif

#if defined(HAS_HSL) || defined(HAS_MA27)
#include "solvers/MA27/MA27Solver.hpp"
#include "ingredients/subproblem_solvers/MA27/MA27Solver.hpp"
#endif

#ifdef HAS_HSL
Expand All @@ -25,7 +25,7 @@ namespace uno {
#endif

#ifdef HAS_MUMPS
#include "solvers/MUMPS/MUMPSSolver.hpp"
#include "ingredients/subproblem_solvers/MUMPS/MUMPSSolver.hpp"
#endif

namespace uno {
Expand Down
2 changes: 1 addition & 1 deletion uno/linear_algebra/SymmetricIndefiniteLinearSystem.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
#include "SparseStorageFactory.hpp"
#include "RectangularMatrix.hpp"
#include "ingredients/hessian_models/UnstableRegularization.hpp"
#include "ingredients/subproblem_solvers/DirectSymmetricIndefiniteLinearSolver.hpp"
#include "model/Model.hpp"
#include "solvers/DirectSymmetricIndefiniteLinearSolver.hpp"
#include "options/Options.hpp"
#include "tools/Statistics.hpp"

Expand Down
Loading

0 comments on commit 5134069

Please sign in to comment.