26 #ifndef CASADI_SLICOT_DPLE_HPP
27 #define CASADI_SLICOT_DPLE_HPP
29 #include "../../core/dple_impl.hpp"
30 #include "../../core/linsol.hpp"
31 #include <casadi/interfaces/slicot/casadi_dple_slicot_export.h>
58 struct SlicotDpleMemory :
public ProtoFunctionMemory {
74 double *VZ, *T, *Z, *X, *Xbar, *nnKa, *nnKb, *eig_real, *eig_imag, *F, *FF, *A, *B;
75 double *dwork, *wruntime;
76 casadi_int* partition, *iwruntime;
79 std::vector< std::vector< Linsol> > dpse_solvers;
85 ~SlicotDpleMemory() {}
99 class SlicotDple :
public Dple {
102 explicit SlicotDple();
107 SlicotDple(
const std::string& name,
const SpDict & st);
110 static Dple* creator(
const std::string& name,
112 return new SlicotDple(name, st);
116 ~SlicotDple()
override;
119 const char* plugin_name()
const override {
return "slicot";}
122 std::string class_name()
const override {
return "SlicotDple";}
126 static const Options options_;
127 const Options& get_options()
const override {
return options_;}
131 void init(
const Dict& opts)
override;
134 void* alloc_mem()
const override {
return new SlicotDpleMemory();}
137 int init_mem(
void* mem)
const override;
140 void free_mem(
void *mem)
const override {
delete static_cast<SlicotDpleMemory*
>(mem);}
143 void set_work(
void* mem,
const double**& arg,
double**& res,
144 casadi_int*& iw,
double*& w)
const override;
147 int eval(
const double** arg,
double** res, casadi_int* iw,
double* w,
void* mem)
const override;
150 static const std::string meta_doc;
152 SlicotDple(
const SpDict & st);
158 inline casadi_int partindex(
const SlicotDpleMemory* m, casadi_int i, casadi_int j, casadi_int k,
159 casadi_int r, casadi_int c)
const;
162 double psd_num_zero_;
165 std::string linear_solver_;
168 Dict linear_solver_options_;
171 static bool has_loaded_;
176 void slicot_periodic_schur(casadi_int n, casadi_int K,
const double* a,
177 double* t,
double * z,
178 double* dwork,
double* eig_real,
179 double *eig_imag,
double num_zero=0);
GenericType::Dict Dict
C++ equivalent of Python's dict or MATLAB's struct.
std::map< std::string, Sparsity > SpDict