27 #ifndef CASADI_LINSOL_TRIDIAG_HPP
28 #define CASADI_LINSOL_TRIDIAG_HPP
40 #include "casadi/core/linsol_internal.hpp"
41 #include <casadi/solvers/casadi_linsol_tridiag_export.h>
44 struct LinsolTridiagMemory :
public LinsolMemory {
45 bool have_c, have_ctr;
46 std::vector<double> c, ctr, d;
53 class LinsolTridiag :
public LinsolInternal {
57 LinsolTridiag(
const std::string& name,
const Sparsity& sp);
60 static LinsolInternal* creator(
const std::string& name,
const Sparsity& sp) {
61 return new LinsolTridiag(name, sp);
65 ~LinsolTridiag()
override;
68 void init(
const Dict& opts)
override;
71 void* alloc_mem()
const override {
return new LinsolTridiagMemory();}
74 int init_mem(
void* mem)
const override;
77 void free_mem(
void *mem)
const override {
delete static_cast<LinsolTridiagMemory*
>(mem);}
80 int nfact(
void* mem,
const double* A)
const override;
83 int sfact(
void* mem,
const double* A)
const override;
86 int solve(
void* mem,
const double* A,
double* x, casadi_int nrhs,
bool tr)
const override;
89 void generate(CodeGenerator& g,
const std::string& A,
const std::string& x,
90 casadi_int nrhs,
bool tr)
const override;
93 const char* plugin_name()
const override {
return "tridiag";}
96 std::string class_name()
const override {
return "LinsolTridiag";}
99 static const std::string meta_doc;
GenericType::Dict Dict
C++ equivalent of Python's dict or MATLAB's struct.