CasADi in C++: How do I set the numerical values of MX symbols?

38 views
Skip to first unread message

YZ He

unread,
Mar 27, 2023, 5:11:35 PM3/27/23
to CasADi
Hello all,

In Python I managed to access and modify the numerical value of MX symbols like:
self.opt_p = struct_symMX(...)
self.opti_vars = struct_symMX(...)

self.opti_vars_num = self.opti_vars(0)
self.opt_p_num = self.opt_p(0)

...

# modify the values in opt_p
self.opt_p_num['u_ini'] = vertsplit(u_ini)
self.opt_p_num['y_ini'] = vertsplit(y_ini)
self.opt_p_num['ref'] = vertsplit(r)

What is the equivalent way of doing so in C++? Thanks!


Reply all
Reply to author
Forward
0 new messages