Skip to content
Joris Gillis edited this page Apr 4, 2023 · 2 revisions

Standard documentation for conditional:

 Create a switch.

::

 conditional(DM ind, [DM] x, DM x_default, bool short_circuit) -> DM
 conditional(SX ind, [SX] x, SX x_default, bool short_circuit) -> SX
 conditional(MX ind, [MX] x, MX x_default, bool short_circuit) -> MX

If the condition

Parameters:

ind: evaluates to the integer k, where 0<=k<f.size(), then x[k] will be

returned, otherwise

x_default: will be returned.

Extra doc: https://github.com/casadi/casadi/wiki/L_1cj

Doc source: https://github.com/casadi/casadi/blob/develop/casadi/core/generic_matrix.hpp#L647

Implementation: https://github.com/casadi/casadi/blob/develop/casadi/core/generic_matrix.hpp#L647-L650

Extra documentation

To edit, see writing tips.

Clone this wiki locally