-
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.
Suggestion for implementing user callbacks
- Loading branch information
Showing
17 changed files
with
108 additions
and
24 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Copyright (c) 2024 Charlie Vanaret | ||
// Licensed under the MIT license. See LICENSE file in the project directory for details. | ||
|
||
#include "AMPLUserCallbacks.hpp" | ||
#include "linear_algebra/Vector.hpp" | ||
#include "optimization/Multipliers.hpp" | ||
|
||
namespace uno { | ||
AMPLUserCallbacks::AMPLUserCallbacks(): UserCallbacks() { } | ||
|
||
void AMPLUserCallbacks::notify_acceptable_iterate(const Vector<double>& /*primals*/, const Multipliers& /*multipliers*/, | ||
double /*objective_multiplier*/) { | ||
} | ||
|
||
void AMPLUserCallbacks::notify_new_primals(const Vector<double>& /*primals*/) { | ||
} | ||
|
||
void AMPLUserCallbacks::notify_new_multipliers(const Multipliers& /*multipliers*/) { | ||
} | ||
} // 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,20 @@ | ||
// Copyright (c) 2024 Charlie Vanaret | ||
// Licensed under the MIT license. See LICENSE file in the project directory for details. | ||
|
||
#ifndef UNO_AMPLUSERCALLBACKS_H | ||
#define UNO_AMPLUSERCALLBACKS_H | ||
|
||
#include "tools/UserCallbacks.hpp" | ||
|
||
namespace uno { | ||
class AMPLUserCallbacks: public UserCallbacks { | ||
public: | ||
AMPLUserCallbacks(); | ||
|
||
void notify_acceptable_iterate(const Vector<double>& primals, const Multipliers& multipliers, double objective_multiplier) override; | ||
void notify_new_primals(const Vector<double>& primals) override; | ||
void notify_new_multipliers(const Multipliers& multipliers) override; | ||
}; | ||
} // namespace | ||
|
||
#endif //UNO_AMPLUSERCALLBACKS_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
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) 2024 Charlie Vanaret | ||
// Licensed under the MIT license. See LICENSE file in the project directory for details. | ||
|
||
#ifndef UNO_USERCALLBACKS_H | ||
#define UNO_USERCALLBACKS_H | ||
|
||
namespace uno { | ||
// forward declarations | ||
class Multipliers; | ||
template <class ElementType> | ||
class Vector; | ||
|
||
class UserCallbacks { | ||
public: | ||
UserCallbacks() = default; | ||
virtual ~UserCallbacks() = default; | ||
|
||
virtual void notify_acceptable_iterate(const Vector<double>& primals, const Multipliers& multipliers, double objective_multiplier) = 0; | ||
virtual void notify_new_primals(const Vector<double>& primals) = 0; | ||
virtual void notify_new_multipliers(const Multipliers& multipliers) = 0; | ||
}; | ||
} // namespace | ||
|
||
#endif //UNO_USERCALLBACKS_H |