26 #ifndef CASADI_WORHP_INTERFACE_HPP
27 #define CASADI_WORHP_INTERFACE_HPP
29 #include "casadi/core/nlpsol_impl.hpp"
30 #include <casadi/interfaces/worhp/casadi_nlpsol_worhp_export.h>
50 struct WorhpMemory :
public NlpsolMemory {
62 casadi_int return_code;
63 const char* return_status;
78 class WorhpInterface :
public Nlpsol {
85 explicit WorhpInterface(
const std::string& name,
const Function& nlp);
88 ~WorhpInterface()
override;
91 const char* plugin_name()
const override {
return "worhp";}
94 std::string class_name()
const override {
return "WorhpInterface";}
97 static Nlpsol* creator(
const std::string& name,
const Function& nlp) {
98 return new WorhpInterface(name, nlp);
106 static const Options options_;
107 const Options& get_options()
const override {
return options_;}
111 void init(
const Dict& opts)
override;
114 void* alloc_mem()
const override {
return new WorhpMemory();}
117 int init_mem(
void* mem)
const override;
120 void free_mem(
void *mem)
const override {
delete static_cast<WorhpMemory*
>(mem);}
123 Dict get_stats(
void* mem)
const override;
126 void set_work(
void* mem,
const double**& arg,
double**& res,
127 casadi_int*& iw,
double*& w)
const override;
130 int solve(
void* mem)
const override;
133 std::map<std::string, bool> bool_opts_;
134 std::map<std::string, casadi_int> int_opts_;
135 std::map<std::string, double> double_opts_;
139 static const char* return_codes(casadi_int flag);
142 static const std::string meta_doc;
145 void serialize_body(SerializingStream &s)
const override;
148 static ProtoFunction* deserialize(DeserializingStream& s) {
return new WorhpInterface(s); }
152 explicit WorhpInterface(DeserializingStream& s);
GenericType::Dict Dict
C++ equivalent of Python's dict or MATLAB's struct.