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> 70 using Ptr = std::shared_ptr<NlpSolverInterface>;
71 using UPtr = std::unique_ptr<NlpSolverInterface>;
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_
virtual Ptr getInstance() const =0
Return a newly created instance of the current solver.
std::unique_ptr< NlpSolverInterface > UPtr
virtual void clear()=0
Clear internal caches.
Generic interface for optimization problem definitions.
virtual SolverStatus solve(OptimizationProblemInterface &problem, bool new_structure, bool new_run=true, double *obj_value=nullptr)=0
Solve the provided optimization problem.
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
Generic interface for solver implementations.
virtual bool initialize(OptimizationProblemInterface *problem=nullptr)
Initialize the solver w.r.t. a given optimization problem.