Go to the documentation of this file.
25 #ifndef SRC_OPTIMIZATION_INCLUDE_CORBO_OPTIMIZATION_SOLVER_NLP_SOLVER_INTERFACE_H_
26 #define SRC_OPTIMIZATION_INCLUDE_CORBO_OPTIMIZATION_SOLVER_NLP_SOLVER_INTERFACE_H_
33 #ifdef MESSAGE_SUPPORT
34 #include <corbo-communication/messages/optimization/nlp_solvers.pb.h>
67 class NlpSolverInterface
70 using Ptr = std::shared_ptr<NlpSolverInterface>;
71 using UPtr = std::unique_ptr<NlpSolverInterface>;
92 virtual bool initialize(OptimizationProblemInterface* problem =
nullptr) {
return true; }
105 virtual SolverStatus solve(OptimizationProblemInterface& problem,
bool new_structure,
bool new_run =
true,
double* obj_value =
nullptr) = 0;
108 virtual void clear() = 0;
110 #ifdef MESSAGE_SUPPORT
112 virtual void toMessage(corbo::messages::NlpSolver& message)
const {}
113 virtual void fromMessage(
const corbo::messages::NlpSolver& message, std::stringstream* issues =
nullptr) {}
118 #define FACTORY_REGISTER_NLP_SOLVER(type) FACTORY_REGISTER_OBJECT(type, NlpSolverInterface)
122 #endif // SRC_OPTIMIZATION_INCLUDE_CORBO_OPTIMIZATION_SOLVER_NLP_SOLVER_INTERFACE_H_
std::unique_ptr< NlpSolverInterface > UPtr
virtual ~NlpSolverInterface()
Virtual destructor.
virtual bool isLsqSolver() const =0
Return true if the solver onyl supports costs in lsq form.
std::shared_ptr< NlpSolverInterface > Ptr
virtual bool initialize(OptimizationProblemInterface *problem=nullptr)
Initialize the solver w.r.t. a given optimization problem.
virtual Ptr getInstance() const =0
Return a newly created instance of the current solver.
virtual void clear()=0
Clear internal caches.
virtual SolverStatus solve(OptimizationProblemInterface &problem, bool new_structure, bool new_run=true, double *obj_value=nullptr)=0
Solve the provided optimization problem.
control_box_rst
Author(s): Christoph Rösmann
autogenerated on Wed Mar 2 2022 00:05:58