File numerics/src/NCP/NonlinearComplementarityProblem.h

Go to the source code of this file

data structure to formalize a Nonlinear Complementarity Problem (NCP)


typedef void (*ptrFunctionJacNCP)(void *env, int n, double *z, NumericsMatrix *jacF)
typedef void (*ptrFunctionNCP)(void *env, int n, double *z, double *F)

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


void freeNCP(NonlinearComplementarityProblem *ncp)

free an NCP problem

  • ncp: structure to free

NonlinearComplementarityProblem *newNCP(void)

create an empty NCP problem

an MixedComplementarityProblem instance

struct NonlinearComplementarityProblem
#include <NonlinearComplementarityProblem.h>

The structure that defines a Nonlinear Complementarity Problem (NCP) : Find two vectors \((z,w \in {{\mathrm{I\!R}}}^{n})\) such that:

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

Public Members

ptrFunctionNCP compute_F

pointer to the function used to compute \(F(z)\)

ptrFunctionJacNCP compute_nabla_F

pointer to the function used to compute \(\nabla_z F(z)\)

void *env

environment for the compute_Fmcp and compute_nabla_F function.

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

unsigned n

size of the problem

NumericsMatrix *nabla_F

storage for \(\nabla_z F\)