# File kernel/src/simulationTools/LCP.hpp¶

Go to the source code of this file

Linear Complementarity Problem formulation and solving

class LCP : public LinearOSNS
#include <>

Formalization and Resolution of a Linear Complementarity Problem (LCP)

This class is devoted to the formalization and the resolution of the Linear Complementarity Problem (LCP) defined by :

$\begin{split} w = q + M z \\ w \geq 0, z \geq 0, z^{T} w =0 \end{split}$

where

• $$w \in R^{n}$$ and $$z \in R^{n}$$ are the unknowns,

• $$M \in R^{n \times n }$$ and $$q \in R^{n}$$

The LCP main components are:

• a problem (variables M,q and size of the problem), which directly corresponds to the LinearComplementarityProblem structure of Numerics

• the unknowns z and w

For details regarding the available options, see Nonsmooth problems formulations and available solvers in users’ guide.

Public Functions

LCP(int numericsSolverId = SICONOS_LCP_LEMKE)

constructor from numerics solver id

Parameters

numericsSolverId – id of numerics solver, default = SICONOS_LCP_LEMKE

LCP(SP::SolverOptions options)

constructor from a pre-defined solver options set

Parameters

options – the options set

~LCP() noexcept = default

destructor

int solve()

Call numerics solver.

Returns

int information about the solver convergence (output from numerics driver, linearComplementarity_driver, check numerics doc. for details).

virtual int compute(double time) override

Compute the unknowns z and w and update the corresponding Interactions (y and lambda )

Parameters

time – : current time

Returns

int, information about the solver convergence (output from numerics driver, linearComplementarity_driver, check numerics doc. for details).

virtual bool checkCompatibleNSLaw(NonSmoothLaw &nslaw) override
ACCEPT_STD_VISITORS()

Protected Functions

ACCEPT_SERIALIZATION(LCP)

Protected Attributes

SP::LinearComplementarityProblem _numerics_problem

Structure (for Numerics component) that describes the problem to solve.