25 #ifndef CASADI_CONOPT_INTERFACE_HPP
26 #define CASADI_CONOPT_INTERFACE_HPP
28 #include "casadi/core/nlpsol_impl.hpp"
29 #include <casadi/interfaces/conopt/casadi_nlpsol_conopt_export.h>
37 class ConoptInterface;
100 std::atomic<bool> cache_valid{
false};
101 std::atomic<bool> cache_valid_jac{
false};
145 std::string
class_name()
const override {
return "ConoptInterface"; }
157 void init(
const Dict& opts)
override;
159 int init_mem(
void* mem)
const override;
160 void free_mem(
void* mem)
const override;
161 void set_work(
void* mem,
const double**& arg,
double**& res,
162 casadi_int*& iw,
double*& w)
const override;
163 int solve(
void* mem)
const override;
164 Dict get_stats(
void* mem)
const override;
168 void ensure_row_capacity(
ConoptMemory* m, casadi_int remaining_rows)
const;
203 static int COI_CALLCONV cb_read_matrix(
double LOWER[],
double CURR[],
double UPPER[],
204 int VSTA[],
int TYPEX[],
double RHS[],
205 int ESTA[],
int COLSTA[],
int ROWNO[],
206 double VALUE[],
int NLFLAG[],
int NUMVAR,
207 int NUMCON,
int NUMNZ,
void* USRMEM);
208 static int COI_CALLCONV cb_fdevalini(
const double X[],
const int ROWLIST[],
int MODE,
209 int LISTSIZE,
int NUMTHREAD,
int IGNERR,
210 int* ERRCNT,
int NUMVAR,
void* USRMEM);
211 static int COI_CALLCONV cb_fd_eval(
const double X[],
double* G,
double JAC[],
212 int ROWNO,
const int JACNUM[],
int MODE,
int IGNERR,
213 int* ERRCNT,
int NUMVAR,
int NUMJAC,
int THREAD,
215 static int COI_CALLCONV cb_fdevalend(
int IGNERR,
int* ERRCNT,
void* USRMEM);
216 static int COI_CALLCONV cb_status(
int MODSTA,
int SOLSTA,
int ITER,
double OBJVAL,
218 static int COI_CALLCONV cb_solution(
const double XVAL[],
const double XMAR[],
219 const int XBAS[],
const int XSTA[],
220 const double YVAL[],
const double YMAR[],
221 const int YBAS[],
const int YSTA[],
222 int NUMVAR,
int NUMCON,
void* USRMEM);
225 static int COI_CALLCONV cb_message(
int SMSG,
int DMSG,
int NMSG,
char* MSGV[],
227 static int COI_CALLCONV cb_errmsg(
int ROWNO,
int COLNO,
int POSNO,
const char* MSG,
231 static int COI_CALLCONV cb_option(
int NCALL,
double* RVAL,
int* IVAL,
int* LVAL,
232 char* NAME,
void* USRMEM);
233 static int COI_CALLCONV cb_progress(
int LEN_INT,
const int INTX[],
int LEN_RL,
234 const double RL[],
const double X[],
void* USRMEM);
237 static int COI_CALLCONV cb_2dlagrstr(
int HSRW[],
int HSCL[],
int* NODRV,
int NUMVAR,
238 int NUMCON,
int NHESS,
void* USRMEM);
239 static int COI_CALLCONV cb_2dlagrval(
const double X[],
const double U[],
240 const int HSRW[],
const int HSCL[],
double HSVL[],
241 int* NODRV,
int NUMVAR,
int NUMCON,
int NHESS,
std::vector< int > jacg_nlflag_
void * alloc_mem() const override
Create memory block.
const Options & get_options() const override
Options.
std::vector< bool > gradf_col_flag_
std::vector< int > jacg_rowstart_
std::string class_name() const override
Get type name.
std::vector< casadi_int > gradf_col_to_nz_
std::vector< int > gradf_nlflag_
static const Options options_
std::vector< int > jacg_nzidx_
static Nlpsol * creator(const std::string &name, const Function &nlp)
static const std::string meta_doc
A documentation string.
static ProtoFunction * deserialize(DeserializingStream &s)
const char * plugin_name() const override
std::vector< int > jacg_col_
Helper class for Serialization.
NLP solver storage class.
Base class for FunctionInternal and LinsolInternal.
Helper class for Serialization.
GenericType::Dict Dict
C++ equivalent of Python's dict or MATLAB's struct.
std::vector< int > casadi_to_conopt_lb_row
std::vector< double > cached_grad_f
std::string return_status
std::vector< int > casadi_to_conopt_ub_row
std::vector< std::pair< std::string, GenericType > > custom_options
std::vector< double > cached_g
std::vector< double > row_const_
std::vector< int > row_nnz
std::vector< double > hess_lam_g_
std::vector< double > const_jac_vals
std::vector< double > conopt_rhs
std::vector< double > gradf_const_vals
std::vector< ConoptRowType > conopt_type
std::vector< int > conopt_to_casadi
std::vector< double > cached_x
ConoptSolverStatus solsta
std::vector< double > linear_at_x0
std::vector< double > cached_jac_g
Options metadata for a class.