File numerics/src/MCP/MixedComplementarityProblem.h

Go to the source code of this file

Typedefs

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)

Functions

void freeMCP(MixedComplementarityProblem2 *mcp)

free an MCP problem

Parameters
  • mcp: structure to free

void freeMixedComplementarityProblem(MixedComplementarityProblem *problem)

function to delete a MixedComplementarityProblem

Parameters

MixedComplementarityProblem2 *newMCP(void)

create an empty MCP problem

Return
an MixedComplementarityProblem instance

struct MixedComplementarityProblem
#include <MixedComplementarityProblem.h>

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

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)

int sizeEqualities

size of equalities $z_e, w_e$ size

int sizeInequalities

size of inequalities $z_i,w_i$ size

struct MixedComplementarityProblem2
#include <MixedComplementarityProblem.h>

Structure that contains and defines a MixedComplementarityProblem.

Public Members

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}\)

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.

int n1

number of equalities constraints

int n2

size of complementary variables

NumericsMatrix *nabla_Fmcp

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