25 #ifndef CASADI_CALLBACK_INTERNAL_HPP
26 #define CASADI_CALLBACK_INTERNAL_HPP
28 #include "callback.hpp"
29 #include "function_internal.hpp"
34 friend class CallbackFunction;
50 std::string
class_name()
const override {
return "CallbackInternal";}
90 std::vector<DM>
eval_dm(
const std::vector<DM>& arg)
const override;
91 bool has_eval_dm()
const override {
return !has_eval_buffer_;}
97 virtual int eval(
const double** arg,
double** res,
98 casadi_int* iw,
double* w,
void* mem)
const override;
112 const std::vector<std::string>& inames,
113 const std::vector<std::string>& onames,
114 const Dict& opts)
const override;
131 const std::vector<std::string>& inames,
132 const std::vector<std::string>& onames,
133 const Dict& opts)
const override;
142 const std::vector<std::string>& inames,
143 const std::vector<std::string>& onames,
144 const Dict& opts)
const override;
void finalize() override
Finalize the object creation.
bool has_jacobian() const override
Return Jacobian of all input elements with respect to all output elements.
void init(const Dict &opts) override
Initialize.
std::string get_name_out(casadi_int i) override
Names of function input and outputs.
std::string get_name_in(casadi_int i) override
Names of function input and outputs.
size_t get_n_out() override
Number of function inputs and outputs.
Callback * self_
Pointer to the public class.
bool has_forward(casadi_int nfwd) const override
Return function that calculates forward derivatives.
std::vector< casadi_int > sizes_arg_
bool has_jac_sparsity(casadi_int oind, casadi_int iind) const override
Return sparsity of Jacobian of an output respect to an input.
Function get_jacobian(const std::string &name, const std::vector< std::string > &inames, const std::vector< std::string > &onames, const Dict &opts) const override
Return Jacobian of all input elements with respect to all output elements.
~CallbackInternal() override
Destructor.
size_t get_n_in() override
Number of function inputs and outputs.
virtual int eval(const double **arg, double **res, casadi_int *iw, double *w, void *mem) const override
Evaluate numerically.
std::vector< DM > eval_dm(const std::vector< DM > &arg) const override
Evaluate with DM matrices.
bool has_eval_dm() const override
Evaluate with DM matrices.
bool uses_output() const override
Do the derivative functions need nondifferentiated outputs?
Function get_reverse(casadi_int nadj, const std::string &name, const std::vector< std::string > &inames, const std::vector< std::string > &onames, const Dict &opts) const override
Return function that calculates adjoint derivatives.
Function get_forward(casadi_int nfwd, const std::string &name, const std::vector< std::string > &inames, const std::vector< std::string > &onames, const Dict &opts) const override
Return function that calculates forward derivatives.
Sparsity get_sparsity_out(casadi_int i) override
Sparsities of function inputs and outputs.
bool has_reverse(casadi_int nadj) const override
Return function that calculates adjoint derivatives.
std::string class_name() const override
Get type name.
Sparsity get_jac_sparsity(casadi_int oind, casadi_int iind, bool symmetric) const override
Return sparsity of Jacobian of an output respect to an input.
Sparsity get_sparsity_in(casadi_int i) override
Sparsities of function inputs and outputs.
bool has_eval_buffer() const
CallbackInternal(const std::string &name, Callback *self)
Constructor.
Callback function functionality.
GenericType::Dict Dict
C++ equivalent of Python's dict or MATLAB's struct.