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;
175 const std::vector<std::string>& s_in,
176 const std::vector<std::string>& s_out,
178 const Dict& opts)
const;
186 const std::vector<std::string>& inames,
187 const std::vector<std::string>& onames,
188 const Dict& opts)
const;
201 const std::vector<std::string>& inames,
202 const std::vector<std::string>& onames,
203 const Dict& opts)
const;
216 const std::vector<std::string>& inames,
217 const std::vector<std::string>& onames,
218 const Dict& opts)
const;
Callback function functionality.
virtual Function get_factory(const std::string &name, const std::vector< std::string > &s_in, const std::vector< std::string > &s_out, const Function::AuxOut &aux, const Dict &opts) const
Customize calls to the function factory.
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.
std::map< std::string, std::vector< std::string > > AuxOut
GenericType::Dict Dict
C++ equivalent of Python's dict or MATLAB's struct.