25 #ifndef CASADI_CALLBACK_HPP
26 #define CASADI_CALLBACK_HPP
28 #include "function.hpp"
32 class CallbackInternal;
106 virtual std::vector<DM>
eval(
const std::vector<DM>& arg)
const;
116 virtual int eval_buffer(
const double **arg,
const std::vector<casadi_int>& sizes_arg,
117 double **res,
const std::vector<casadi_int>& sizes_res)
const;
177 const std::vector<std::string>& inames,
178 const std::vector<std::string>& onames,
179 const Dict& opts)
const;
192 const std::vector<std::string>& inames,
193 const std::vector<std::string>& onames,
194 const Dict& opts)
const;
207 const std::vector<std::string>& inames,
208 const std::vector<std::string>& onames,
209 const Dict& opts)
const;
Callback function functionality.
virtual void finalize()
Finalize the object.
virtual Sparsity get_sparsity_in(casadi_int i)
Get the sparsity of an input.
virtual void init()
Initialize the object.
virtual 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
Return function that calculates forward derivatives.
void construct(const std::string &name, const Dict &opts=Dict())
Construct internal object.
virtual bool has_jac_sparsity(casadi_int oind, casadi_int iind) const
Return sparsity of Jacobian of all input elements.
virtual bool has_reverse(casadi_int nadj) const
Return function that calculates adjoint derivatives.
static std::string type_name()
Get type name.
Callback()
Default constructor.
Callback(const Callback &obj)
Copy constructor (throws an error)
virtual casadi_int get_n_out()
Get the number of outputs.
virtual Sparsity get_sparsity_out(casadi_int i)
Get the sparsity of an output.
virtual bool has_eval_buffer() const
Does the Callback class support a copy-free low level interface ?
virtual int eval_buffer(const double **arg, const std::vector< casadi_int > &sizes_arg, double **res, const std::vector< casadi_int > &sizes_res) const
A copy-free low level interface.
virtual Function get_jacobian(const std::string &name, const std::vector< std::string > &inames, const std::vector< std::string > &onames, const Dict &opts) const
Return Jacobian of all input elements with respect to all output elements.
virtual bool has_jacobian() const
Return Jacobian of all input elements with respect to all output elements.
virtual std::vector< DM > eval(const std::vector< DM > &arg) const
Evaluate numerically, using temporary matrices and work vectors.
virtual std::string get_name_out(casadi_int i)
Get the name of an output.
virtual Sparsity get_jac_sparsity(casadi_int oind, casadi_int iind, bool symmetric) const
Return sparsity of Jacobian of all input elements.
virtual bool uses_output() const
Do the derivative functions need nondifferentiated outputs?
virtual casadi_int get_n_in()
Get the number of inputs.
virtual bool has_forward(casadi_int nfwd) const
Return function that calculates forward derivatives.
virtual std::string get_name_in(casadi_int i)
Get the name of an input.
virtual ~Callback()
Destructor.
virtual 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
Return function that calculates adjoint derivatives.
GenericType::Dict Dict
C++ equivalent of Python's dict or MATLAB's struct.