26 #ifndef CASADI_SUPERSCS_INTERFACE_HPP
27 #define CASADI_SUPERSCS_INTERFACE_HPP
29 #include "casadi/core/conic_impl.hpp"
30 #include <casadi/interfaces/superscs/casadi_conic_superscs_export.h>
32 #include <scs_parser.h>
49 struct SuperscsMemory :
public ConicMemory {
61 std::vector<casadi_int> at_colind, at_row, q;
62 std::vector<double> ldl_d, ldl_l, ldl_w, F_res, g;
77 class SuperscsInterface :
public Conic {
80 explicit SuperscsInterface(
const std::string& name,
81 const std::map<std::string, Sparsity>& st);
84 static Conic* creator(
const std::string& name,
85 const std::map<std::string, Sparsity>& st) {
86 return new SuperscsInterface(name, st);
90 ~SuperscsInterface()
override;
93 const char* plugin_name()
const override {
return "superscs";}
96 std::string class_name()
const override {
return "SuperscsInterface";}
100 static const Options options_;
101 const Options& get_options()
const override {
return options_;}
105 void init(
const Dict& opts)
override;
108 void* alloc_mem()
const override {
return new SuperscsMemory();}
111 int init_mem(
void* mem)
const override;
114 void free_mem(
void *mem)
const override {
delete static_cast<SuperscsMemory*
>(mem);}
117 int solve(
const double** arg,
double** res,
118 casadi_int* iw,
double* w,
void* mem)
const override;
121 bool integer_support()
const override {
return true;}
124 bool psd_support()
const override {
return true;}
127 static const std::string meta_doc;
130 Dict get_stats(
void* mem)
const override;
136 SDPToSOCPMem sdp_to_socp_mem_;
140 std::vector<casadi_int> lookup_;
143 std::vector<casadi_int> Hp_;
148 ScsSettings settings_;
151 std::vector<casadi_int> perturb_;
153 void serialize_body(SerializingStream &s)
const override;
156 static ProtoFunction* deserialize(DeserializingStream& s) {
return new SuperscsInterface(s); }
160 explicit SuperscsInterface(DeserializingStream& s);
GenericType::Dict Dict
C++ equivalent of Python's dict or MATLAB's struct.