25 #ifndef CASADI_DAQP_INTERFACE_HPP
26 #define CASADI_DAQP_INTERFACE_HPP
28 #include "casadi/core/conic_impl.hpp"
29 #include <casadi/interfaces/daqp/casadi_conic_daqp_export.h>
35 #include "daqp_runtime.hpp"
54 struct DaqpMemory :
public ConicMemory {
69 class DaqpInterface :
public Conic {
72 static Conic* creator(
const std::string& name,
73 const std::map<std::string, Sparsity>& st) {
74 return new DaqpInterface(name, st);
78 explicit DaqpInterface(
const std::string& name,
79 const std::map<std::string, Sparsity>& st);
82 ~DaqpInterface()
override;
85 const char* plugin_name()
const override {
return "daqp";}
88 std::string class_name()
const override {
return "DaqpInterface";}
92 static const Options options_;
93 const Options& get_options()
const override {
return options_;}
97 void set_daqp_prob(CodeGenerator& g)
const;
100 void codegen_body(CodeGenerator& g)
const override;
103 void codegen_init_mem(CodeGenerator& g)
const override;
106 void codegen_free_mem(CodeGenerator& g)
const override;
109 std::string codegen_mem_type()
const override {
return "struct casadi_daqp_data"; }
112 void init(
const Dict& opts)
override;
115 void init_dependent();
118 void* alloc_mem()
const override {
return new DaqpMemory();}
121 int init_mem(
void* mem)
const override;
124 void free_mem(
void *mem)
const override;
127 void set_work(
void* mem,
const double**& arg,
double**& res,
128 casadi_int*& iw,
double*& w)
const override;
131 Dict get_stats(
void* mem)
const override;
134 int solve(
const double** arg,
double** res,
135 casadi_int* iw,
double* w,
void* mem)
const override;
138 static const std::string meta_doc;
143 void serialize_body(SerializingStream &s)
const override;
146 static ProtoFunction* deserialize(DeserializingStream& s) {
return new DaqpInterface(s); }
149 bool integer_support()
const override {
return true; }
153 explicit DaqpInterface(DeserializingStream& s);
GenericType::Dict Dict
C++ equivalent of Python's dict or MATLAB's struct.