26 #ifndef CASADI_SOLVE_HPP
27 #define CASADI_SOLVE_HPP
29 #include "mx_node.hpp"
30 #include "casadi_call.hpp"
62 std::string disp(
const std::vector<std::string>& arg)
const override;
77 void eval_mx(
const std::vector<MX>& arg, std::vector<MX>& res)
const override;
82 void ad_forward(
const std::vector<std::vector<MX> >& fseed,
83 std::vector<std::vector<MX> >& fsens)
const override;
88 void ad_reverse(
const std::vector<std::vector<MX> >& aseed,
89 std::vector<std::vector<MX> >& asens)
const override;
97 int sp_forward(
const bvec_t** arg, bvec_t** res, casadi_int* iw, bvec_t* w)
const override;
102 int sp_reverse(bvec_t** arg, bvec_t** res, casadi_int* iw, bvec_t* w)
const override;
107 casadi_int
op()
const override {
return OP_SOLVE;}
162 int eval(
const double** arg,
double** res, casadi_int* iw,
double* w)
const override;
165 int eval_sx(
const SXElem** arg,
SXElem** res, casadi_int* iw,
SXElem* w)
const override;
170 size_t sz_w()
const override;
176 const std::vector<casadi_int>& arg,
177 const std::vector<casadi_int>& res)
const override;
184 return linsol_.
solve(A, B, tr);
229 int eval(
const double** arg,
double** res, casadi_int* iw,
double* w)
const override;
232 int eval_sx(
const SXElem** arg,
SXElem** res, casadi_int* iw,
SXElem* w)
const override;
236 return A->get_solve_triu(B, tr);
242 void generate(
CodeGenerator& g,
const std::vector<casadi_int>& arg,
243 const std::vector<casadi_int>& res)
const override;
267 int eval(
const double** arg,
double** res, casadi_int* iw,
double* w)
const override;
270 int eval_sx(
const SXElem** arg,
SXElem** res, casadi_int* iw,
SXElem* w)
const override;
274 return A->get_solve_tril(B, tr);
280 void generate(
CodeGenerator& g,
const std::vector<casadi_int>& arg,
281 const std::vector<casadi_int>& res)
const override;
315 const Sparsity& A_sp()
const override;
342 int eval(
const double** arg,
double** res, casadi_int* iw,
double* w)
const override;
345 int eval_sx(
const SXElem** arg,
SXElem** res, casadi_int* iw,
SXElem* w)
const override;
349 return A->get_solve_triu_unity(B, tr);
355 void generate(
CodeGenerator& g,
const std::vector<casadi_int>& arg,
356 const std::vector<casadi_int>& res)
const override;
380 int eval(
const double** arg,
double** res, casadi_int* iw,
double* w)
const override;
383 int eval_sx(
const SXElem** arg,
SXElem** res, casadi_int* iw,
SXElem* w)
const override;
387 return A->get_solve_tril_unity(B, tr);
393 void generate(
CodeGenerator& g,
const std::vector<casadi_int>& arg,
394 const std::vector<casadi_int>& res)
const override;
Helper class for C code generation.
Helper class for Serialization.
Linear solve operation with a linear solver instance.
~LinsolCall() override
Destructor.
MX solve(const MX &A, const MX &B, bool tr) const override
Solve another system with the same factorization.
Linsol linsol_
Linear solver (may be shared between multiple nodes)
DM solve(const DM &A, const DM &B, bool tr=false) const
Node class for MX objects.
Helper class for Serialization.
Linear solve with unity diagonal added.
~SolveUnity() override
Destructor.
std::string mod_suffix() const override
Modifier for linear system, after argument.
std::string mod_prefix() const override
Modifier for linear system, before argument.
An MX atomic for linear solver solution: x = r * A^-1 or x = r * A^-T.
Dict info() const override
virtual const Sparsity & A_sp() const
Sparsity pattern for the linear system.
virtual std::string mod_prefix() const
Modifier for linear system, before argument.
casadi_int op() const override
Get the operation.
virtual std::string mod_suffix() const
Modifier for linear system, after argument.
virtual MX solve(const MX &A, const MX &B, bool tr) const =0
Solve another system with the same factorization.
~Solve() override
Destructor.
casadi_int n_inplace() const override
Can the operation be performed inplace (i.e. overwrite the result)
Linear solve with an upper triangular matrix.
~TrilSolveUnity() override
Destructor.
MX solve(const MX &A, const MX &B, bool tr) const override
Solve another system with the same factorization.
Linear solve with an upper triangular matrix.
MX solve(const MX &A, const MX &B, bool tr) const override
Solve another system with the same factorization.
~TrilSolve() override
Destructor.
Linear solve with an upper triangular matrix, unity diagonal.
~TriuSolveUnity() override
Destructor.
MX solve(const MX &A, const MX &B, bool tr) const override
Solve another system with the same factorization.
Linear solve with an upper triangular matrix.
~TriuSolve() override
Destructor.
MX solve(const MX &A, const MX &B, bool tr) const override
Solve another system with the same factorization.
GenericType::Dict Dict
C++ equivalent of Python's dict or MATLAB's struct.