26 #ifndef CASADI_MUMPS_INTERFACE_HPP
27 #define CASADI_MUMPS_INTERFACE_HPP
29 #include "casadi/core/linsol_internal.hpp"
30 #include <casadi/interfaces/mumps/casadi_linsol_mumps_export.h>
32 #include <mumps/mumps_mpi.h>
33 #include <mumps/dmumps_c.h>
48 struct MumpsMemory :
public LinsolMemory {
59 std::vector<int> irn, jcn;
62 std::vector<double> nz;
69 class MumpsInterface :
public LinsolInternal {
73 MumpsInterface(
const std::string& name,
const Sparsity& sp);
76 static LinsolInternal* creator(
const std::string& name,
const Sparsity& sp) {
77 return new MumpsInterface(name, sp);
81 ~MumpsInterface()
override;
85 static const Options options_;
86 const Options& get_options()
const override {
return options_;}
90 void init(
const Dict& opts)
override;
93 void* alloc_mem()
const override {
return new MumpsMemory();}
96 int init_mem(
void* mem)
const override;
99 void free_mem(
void *mem)
const override {
delete static_cast<MumpsMemory*
>(mem);}
102 int nfact(
void* mem,
const double* A)
const override;
105 int solve(
void* mem,
const double* A,
double* x, casadi_int nrhs,
bool tr)
const override;
108 static const std::string meta_doc;
111 const char* plugin_name()
const override {
return "mumps";}
114 std::string class_name()
const override {
return "MumpsInterface";}
117 void serialize_body(SerializingStream &s)
const override;
120 static ProtoFunction* deserialize(DeserializingStream& s) {
return new MumpsInterface(s); }
124 bool symmetric_, posdef_;
129 explicit MumpsInterface(DeserializingStream& s);
GenericType::Dict Dict
C++ equivalent of Python's dict or MATLAB's struct.