File numerics/src/MCP/MixedComplementarityProblem.h

Go to the source code of this file


typedef void (*ptrFunctionMCP)(int size, double *z, double *F)

type for user defined function used to compute Fmcp and its jacobian.

TODO : set properly the list of arguments for this function, when things will be clearer …

typedef void (*ptrFunctionMCP2)(void *env, int n, double *z, double *F)
typedef void (*ptrFunctionMCP_nabla)(void *env, int n, double *z, NumericsMatrix *F)


void mixedComplementarityProblem_free(MixedComplementarityProblem *mcp)

free a MCP problem


mcp – structure to free

MixedComplementarityProblem *mixedComplementarityProblem_new(void)

an empty MixedComplementarityProblem instance

void mixedComplementarityProblem_old_free(MixedComplementarityProblem_old *problem)

Delete a MixedComplementarityProblem_old.


problem – pointer to a MixedComplementarityProblem_old to delete

struct MixedComplementarityProblem
#include <>

Structure that contains and defines a MixedComplementarityProblem.

Public Members

int n1

number of equalities constraints

int n2

size of complementarity variables

ptrFunctionMCP2 compute_Fmcp

pointer to the function used to compute \( F_{mcp}(z) = (G(z), H(z)) \)

ptrFunctionMCP_nabla compute_nabla_Fmcp

pointer to the function used to compute \( \nabla_z F_{mcp} \)

NumericsMatrix *nabla_Fmcp

storage for \( \nabla_z F_{mcp} \)

void *env

environment for the compute_Fmcp and compute_nabla_Fmcp function.

When called from Python, it contains an object with compute_Fmcp and compute_nabla_Fmcp as methods. When called from C, it can reference a data struct containing variables needed for the computations.

struct MixedComplementarityProblem_old
#include <>

The structure that defines a Mixed Complementarity problem (MCP) : find two vectors \( (z,w \in {{\mathrm{I\!R}}}^{n+m}) \) such that:

\[\begin{split} w &= \begin{pmatrix}w_e\\w_i\end{pmatrix} = F(z) \ \ w_e &=0 \ \ 0 &\le w_i \perp z_i \ge 0 \end{split}\]

where “i” (resp. “e”) stands for inequalities (resp. equalities). The vector \( z \) is splitted like \( w \):

\[\begin{split} z =\begin{pmatrix}z_e\\z_i\end{pmatrix} \end{split}\]

\( z_i,w_i \) are vectors of size sizeEqualities, \( z_e,w_e \) vectors of size sizeInequalities

and \( F \) is a non linear function that must be user-defined.

Public Members

int sizeEqualities

size of equalities \( z_e, w_e \) size

int sizeInequalities

size of inequalities \( z_i,w_i \) size

ptrFunctionMCP computeFmcp

pointer to the function to compute F(z)

ptrFunctionMCP computeNablaFmcp
double *Fmcp

pointer to the function to compute the jacobian of F(z)

The value F(z)

double *nablaFmcp

jacobian of F(z)