-
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.
Restored Preprocessing::compute_least_square_multipliers (uses a new …
…IdentityMatrix)
- Loading branch information
Showing
18 changed files
with
125 additions
and
86 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Copyright (c) 2025 Charlie Vanaret | ||
// Licensed under the MIT license. See LICENSE file in the project directory for details. | ||
|
||
#include "IdentityHessian.hpp" | ||
#include "optimization/OptimizationProblem.hpp" | ||
#include "linear_algebra/SymmetricMatrix.hpp" | ||
#include "options/Options.hpp" | ||
|
||
namespace uno { | ||
// identity Hessian | ||
IdentityHessian::IdentityHessian(): HessianModel() { | ||
} | ||
|
||
void IdentityHessian::initialize_statistics(Statistics& /*statistics*/, const Options& /*options*/) const { } | ||
|
||
void IdentityHessian::evaluate(Statistics& /*statistics*/, const OptimizationProblem& problem, const Vector<double>& /*primal_variables*/, | ||
const Vector<double>& /*constraint_multipliers*/, SymmetricMatrix<size_t, double>& hessian) { | ||
// evaluate Lagrangian Hessian | ||
hessian.set_dimension(problem.number_variables); | ||
for (size_t variable_index: Range(problem.number_variables)) { | ||
hessian.insert(1., variable_index, variable_index); | ||
} | ||
} | ||
} // 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Copyright (c) 2024 Charlie Vanaret | ||
// Licensed under the MIT license. See LICENSE file in the project directory for details. | ||
|
||
#ifndef UNO_IDENTITYHESSIAN_H | ||
#define UNO_IDENTITYHESSIAN_H | ||
|
||
#include "HessianModel.hpp" | ||
|
||
namespace uno { | ||
// exact Hessian | ||
class IdentityHessian : public HessianModel { | ||
public: | ||
IdentityHessian(); | ||
|
||
void initialize_statistics(Statistics& statistics, const Options& options) const override; | ||
void evaluate(Statistics& statistics, const OptimizationProblem& problem, const Vector<double>& primal_variables, | ||
const Vector<double>& constraint_multipliers, SymmetricMatrix<size_t, double>& hessian) override; | ||
}; | ||
} // namespace | ||
|
||
#endif // UNO_IDENTITYHESSIAN_H |
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
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.