26 #ifndef CASADI_COLLOCATION_HPP
27 #define CASADI_COLLOCATION_HPP
29 #include "casadi/core/integrator_impl.hpp"
30 #include "casadi/core/integration_tools.hpp"
31 #include <casadi/solvers/casadi_integrator_collocation_export.h>
57 class Collocation :
public ImplicitFixedStepIntegrator {
61 Collocation(
const std::string& name,
const Function& dae,
62 double t0,
const std::vector<double>& tout);
65 static Integrator* creator(
const std::string& name,
const Function& dae,
66 double t0,
const std::vector<double>& tout) {
67 return new Collocation(name, dae, t0, tout);
71 ~Collocation()
override;
74 const char* plugin_name()
const override {
return "collocation";}
77 std::string class_name()
const override {
return "Collocation";}
81 static const Options options_;
82 const Options& get_options()
const override {
return options_;}
86 void init(
const Dict& opts)
override;
89 void setup_step()
override;
92 static double zeroIfSmall(
double x);
95 void reset(IntegratorMemory* mem,
96 const double* u,
const double* x,
const double* z,
const double* p)
const override;
98 MX algebraic_state_init(
const MX& x0,
const MX& z0)
const override;
99 MX algebraic_state_output(
const MX& Z)
const override;
105 std::string collocation_scheme_;
108 static const std::string meta_doc;
111 void serialize_body(SerializingStream &s)
const override;
114 static ProtoFunction* deserialize(DeserializingStream& s) {
return new Collocation(s); }
119 explicit Collocation(DeserializingStream& s);
GenericType::Dict Dict
C++ equivalent of Python's dict or MATLAB's struct.