Hi Seb,
Yes! I think this auto
feature is only available in Matlab/Octave for now.
Using directly some matrices to define the cost function instead of generated CasADi functions should speed up the linearization part of the SQP algorithm.
But this is only possible for linear least squares cost terms.
The cost is a less convenient interface, the advantage some computational speedup.
For constraints, it is similar. You could define all constraints as nonlinear constraints h, then those are generated as CasADi functions.
It is computationally more beneficial to define linear constraints or bound constraints as such.
You can assess before making such changes the percentage of computation time spent in the linearization step (time_lin), vs time_tot.
Best,
Jonathan