26 #ifndef CASADI_CONIC_IMPL_HPP
27 #define CASADI_CONIC_IMPL_HPP
30 #include "function_internal.hpp"
31 #include "plugin_interface.hpp"
50 Conic(
const std::string& name,
const std::map<std::string, Sparsity> &st);
53 ~
Conic()
override = 0;
67 Sparsity get_sparsity_in(casadi_int i)
override;
68 Sparsity get_sparsity_out(casadi_int i)
override;
88 int eval(
const double** arg,
double** res, casadi_int* iw,
double* w,
void* mem)
const final;
91 virtual int solve(
const double** arg,
double** res,
92 casadi_int* iw,
double* w,
void* mem)
const = 0;
95 void init(
const Dict& opts)
override;
98 void finalize()
override;
103 int init_mem(
void* mem)
const override;
108 void set_work(
void* mem,
const double**& arg,
double**& res,
109 casadi_int*& iw,
double*& w)
const override;
112 virtual void check_inputs(
const double* lbx,
const double* ubx,
113 const double* lba,
const double* uba)
const;
116 virtual void generateNativeCode(std::ostream& file)
const;
119 typedef Conic* (*Creator)(
const std::string& name,
120 const std::map<std::string, Sparsity>& st);
128 #ifdef CASADI_WITH_THREADSAFE_SYMBOLICS
129 static std::mutex mutex_solvers_;
141 bool is_a(
const std::string& type,
bool recursive)
const override;
146 double get_default_in(casadi_int ind)
const override;
155 Dict get_stats(
void* mem)
const override;
158 static MX sens_kkt(
const MX& H,
const MX& A,
const MX& lam_x,
const MX& lam_a,
159 const MX& lbx,
const MX& ubx,
const MX& lba,
const MX& uba,
160 double min_lam,
bool force_equality,
161 MX& lbIx,
MX& ubIx,
MX& lbIa,
MX& ubIa);
173 Function get_forward(casadi_int nfwd,
const std::string& name,
174 const std::vector<std::string>& inames,
175 const std::vector<std::string>& onames,
176 const Dict& opts)
const override;
184 Function get_reverse(casadi_int nadj,
const std::string& name,
185 const std::vector<std::string>& inames,
186 const std::vector<std::string>& onames,
187 const Dict& opts)
const override;
221 std::vector<casadi_int>
r;
Helper class for C code generation.
Dict sens_linsol_options_
static const Options options_
Options.
casadi_int nx_
Number of decision variables.
bool uses_output() const override
Do the derivative functions need nondifferentiated outputs?
virtual int solve(const double **arg, double **res, casadi_int *iw, double *w, void *mem) const =0
Solve the QP.
casadi_int np_
The shape of psd constraint matrix.
size_t get_n_in() override
Number of function inputs and outputs.
casadi_int na_
The number of constraints (counting both equality and inequality) == A.size1()
static std::map< std::string, Plugin > solvers_
Collection of solvers.
size_t get_n_out() override
Number of function inputs and outputs.
std::string serialize_base_function() const override
String used to identify the immediate FunctionInternal subclass.
std::vector< bool > discrete_
Options.
const Options & get_options() const override
Options.
std::vector< bool > equality_
virtual bool psd_support() const
Can psd constraints be treated.
bool sens_force_equality_
bool solver_version_check_
static std::string shortname()
Short name.
static const std::string infix_
Infix.
casadi_qp_prob< double > p_qp_
bool has_reverse(casadi_int nadj) const override
Generate a function that calculates reverse mode derivatives.
std::string get_name_out(casadi_int i) override
Names of function input and outputs.
std::string get_name_in(casadi_int i) override
Names of function input and outputs.
virtual bool integer_support() const
Can discrete variables be treated.
bool has_forward(casadi_int nfwd) const override
Generate a function that calculates forward mode derivatives.
Helper class for Serialization.
Internal class for Function.
Interface for accessing input and output data structures.
Base class for FunctionInternal and LinsolInternal.
Helper class for Serialization.
std::vector< std::string > conic_out()
Get the output scheme of QP solvers.
std::vector< std::string > conic_in()
Get the input scheme of QP solvers.
GenericType::Dict Dict
C++ equivalent of Python's dict or MATLAB's struct.
casadi_qp_data< double > d_qp
SDP to SOCP conversion memory.
std::vector< casadi_int > r
std::vector< casadi_int > A_mapping
std::vector< casadi_int > map_P
Function memory with temporary work vectors.
Options metadata for a class.