Refactor CollInt to allow reuse of all but constant inputs and parameters
For many optimization problems, the only thing that ever changes are constant inputs and parameters. All other things, constraints, goals, etc, do not change. We can gain a significant speed up for certain large problems (or low latency problems) if we can reuse the discretized problem as e.g. an MXFunction, and then call it with the new set of constant inputs and parameters.
I am not sure if this is at all possible, desirable, or worth the effort (time saved in collocating).
For large (linear) problems we might even want to cache part of the Jacobian, but I'm not sure if it makes sense to express it as a function of the constant inputs/parameters.