26 #ifndef CASADI_SYMBOLIC_QR_HPP
27 #define CASADI_SYMBOLIC_QR_HPP
29 #include "casadi/core/linsol_internal.hpp"
30 #include <casadi/solvers/casadi_linsol_symbolicqr_export.h>
46 typedef std::vector<SXPtr> SXPtrV;
49 struct SymbolicQrMemory :
public LinsolMemory {
51 std::vector<const double*> arg;
52 std::vector<double*> res;
53 std::vector<casadi_int> iw;
54 std::vector<double> w;
57 void alloc(
const Function& f);
60 std::vector<double> q, r;
70 class SymbolicQr :
public LinsolInternal {
73 SymbolicQr(
const std::string& name,
const Sparsity& sp);
76 ~SymbolicQr()
override;
79 const char* plugin_name()
const override {
return "symbolicqr";}
82 std::string class_name()
const override {
return "SymbolicQr";}
85 static LinsolInternal* creator(
const std::string& name,
const Sparsity& sp) {
86 return new SymbolicQr(name, sp);
91 static const Options options_;
92 const Options& get_options()
const override {
return options_;}
96 void init(
const Dict& opts)
override;
99 void* alloc_mem()
const override {
return new SymbolicQrMemory();}
102 int init_mem(
void* mem)
const override;
105 void free_mem(
void *mem)
const override {
delete static_cast<SymbolicQrMemory*
>(mem);}
108 int nfact(
void* mem,
const double* A)
const override;
111 int solve(
void* mem,
const double* A,
double* x, casadi_int nrhs,
bool tr)
const override;
114 void linsol_eval_sx(
const SXElem** arg, SXElem** res, casadi_int* iw, SXElem* w,
void* mem,
115 bool tr, casadi_int nrhs)
const override;
118 static const std::string meta_doc;
121 Function factorize_, solve_, solveT_;
127 void serialize_body(SerializingStream &s)
const override;
130 static ProtoFunction* deserialize(DeserializingStream& s) {
return new SymbolicQr(s); }
134 explicit SymbolicQr(DeserializingStream& s);
GenericType::Dict Dict
C++ equivalent of Python's dict or MATLAB's struct.