Output:
#include "casadi/casadi.hpp"
class MyCallback : public Callback {
public:
MyCallback(
const std::string& name,
const Dict& opts=
Dict()) {
construct(name, opts);
}
casadi_int get_n_in() override { return 1;}
casadi_int get_n_out() override { return 1;}
std::vector<DM> eval(const std::vector<DM>& arg) const override {
return {sin(x)};
}
};
int main() {
MyCallback f("f");
std::vector<DM> arg = {2};
std::vector<DM> res = f(arg);
std::cout << res << std::endl;
return 0;
}
GenericType::Dict Dict
C++ equivalent of Python's dict or MATLAB's struct.