csnlp.core.data#

A collection of functions for manipulating data in CasADi, in particular, on how to convert to and from numpy arrays and CasADi symbolic variables, and how to find the indices of a symbolic variable in a vector of symbols.

Functions

array2cs(x)

Converts the numpy array x containing scalar symbolic variables to a single symbolic variable (see cs2array for the opposite functionality).

cs2array(x)

Converts the symbolic variable x to a numpy array of scalar symbolic variables (see array2cs for the opposite functionality).

find_index_in_vector(V, a)

Finds the indices of a in V.