26 #ifndef CASADI_AMPL_INTERFACE_HPP
27 #define CASADI_AMPL_INTERFACE_HPP
29 #include <casadi/interfaces/ampl/casadi_nlpsol_ampl_export.h>
30 #include "casadi/core/nlpsol_impl.hpp"
49 struct AmplInterfaceMemory :
public NlpsolMemory {
56 class AmplInterface :
public Nlpsol {
58 explicit AmplInterface(
const std::string& name,
const Function& nlp);
59 ~AmplInterface()
override;
62 const char* plugin_name()
const override {
return "ampl";}
65 std::string class_name()
const override {
return "AmplInterface";}
68 static Nlpsol* creator(
const std::string& name,
const Function& nlp) {
69 return new AmplInterface(name, nlp);
74 static const Options options_;
75 const Options& get_options()
const override {
return options_;}
79 void init(
const Dict& opts)
override;
82 void* alloc_mem()
const override {
return new AmplInterfaceMemory();}
85 int init_mem(
void* mem)
const override;
88 void free_mem(
void *mem)
const override {
delete static_cast<AmplInterfaceMemory*
>(mem);}
91 void set_work(
void* mem,
const double**& arg,
double**& res,
92 casadi_int*& iw,
double*& w)
const override;
95 int solve(
void* mem)
const override;
98 static const std::string meta_doc;
104 std::stringstream nl_init_;
GenericType::Dict Dict
C++ equivalent of Python's dict or MATLAB's struct.