# MLCP_Solvers (functions)¶

siconos.numerics.mixedLinearComplementarity_default_setDefaultSolverOptions(MixedLinearComplementarityProblem *problem, SolverOptions *pOptions) → None[source]

siconos.numerics.mixedLinearComplementarity_deleteDefaultSolverOptions(MixedLinearComplementarityProblem *problem, SolverOptions *pOptions) → None[source]

siconos.numerics.mixedLinearComplementarity_directEnum_setDefaultSolverOptions(MixedLinearComplementarityProblem *problem, SolverOptions *pSolver) → int[source]

siconos.numerics.mixedLinearComplementarity_directFB_setDefaultSolverOptions(MixedLinearComplementarityProblem *problem, SolverOptions *pSolver) → int[source]

siconos.numerics.mixedLinearComplementarity_directPathEnum_setDefaultSolverOptions(MixedLinearComplementarityProblem *problem, SolverOptions *pSolver) → int[source]

siconos.numerics.mixedLinearComplementarity_directPath_setDefaultSolverOptions(MixedLinearComplementarityProblem *problem, SolverOptions *pSolver) → int[source]

siconos.numerics.mixedLinearComplementarity_directSimplex_setDefaultSolverOptions(MixedLinearComplementarityProblem *problem, SolverOptions *pSolver) → int[source]

siconos.numerics.mixedLinearComplementarity_enum_setDefaultSolverOptions(MixedLinearComplementarityProblem *problem, SolverOptions *pSolver) → int[source]

siconos.numerics.mixedLinearComplementarity_fb_setDefaultSolverOptions(MixedLinearComplementarityProblem *problem, SolverOptions *pSolver) → int[source]

siconos.numerics.mixedLinearComplementarity_pathEnum_setDefaultSolverOptions(MixedLinearComplementarityProblem *problem, SolverOptions *pSolver) → int[source]

siconos.numerics.mixedLinearComplementarity_path_setDefaultSolverOptions(MixedLinearComplementarityProblem *problem, SolverOptions *pSolver) → int[source]

siconos.numerics.mixedLinearComplementarity_pgs_SBM_setDefaultSolverOptions(MixedLinearComplementarityProblem *problem, SolverOptions *options) → int[source]

set the default solver parameters and perform memory allocation for LinearComplementarity

Parameters: problem – structure that represents the MLCP (M, q…). M must be a SparseBlockStructuredMatrix options – the pointer to the array of options to set

siconos.numerics.mixedLinearComplementarity_pgs_setDefaultSolverOptions(MixedLinearComplementarityProblem *problem, SolverOptions *pSolver) → int[source]

siconos.numerics.mixedLinearComplementarity_psor_setDefaultSolverOptions(MixedLinearComplementarityProblem *problem, SolverOptions *pSolver) → int[source]

siconos.numerics.mixedLinearComplementarity_rpgs_setDefaultSolverOptions(MixedLinearComplementarityProblem *problem, SolverOptions *pSolver) → int[source]

siconos.numerics.mixedLinearComplementarity_rpsor_setDefaultSolverOptions(MixedLinearComplementarityProblem *problem, SolverOptions *pSolver) → int[source]

siconos.numerics.mixedLinearComplementarity_setDefaultSolverOptions(MixedLinearComplementarityProblem *problem, SolverOptions *pOptions) → int[source]

set the default solver parameters and perform memory allocation for MixedLinearComplementarity

Parameters: problem – the pointer to the array of options to set. pOptions – SolverOptions * the pointer to option.

siconos.numerics.mixedLinearComplementarity_simplex_setDefaultSolverOptions(MixedLinearComplementarityProblem *problem, SolverOptions *pSolver) → int[source]

siconos.numerics.mlcp_FB(MixedLinearComplementarityProblem *problem, array_like (np.float64, 1D)z, array_like (np.float64, 1D)w, int *info, SolverOptions *options) → None[source]

Fischer Burmeister solver.

Parameters: problem – structure that represents the MLCP (n,mM, q…) z – a m+n-vector of doubles which contains the initial solution and returns the solution of the problem. w – a m+n-vector of doubles which returns the solution of the problem. info – an integer which returns the termination value: 0 : success,it found a solution 1 : failure,it did not find any solution options – structure used to define the solver and its parameters.

siconos.numerics.mlcp_alloc_working_memory(MixedLinearComplementarityProblem *problem, SolverOptions *options) → int[source]

siconos.numerics.mlcp_compute_error(MixedLinearComplementarityProblem *problem, array_like (np.float64, 1D)z, array_like (np.float64, 1D)w, double tolerance, array_like (np.float64, 1D)error) → int[source]

This function checks the validity of the vector z as a solution of the MLCP :

\left\lbrace \begin{array}{l} A u + Cv +a =w1\\ D u + Bv +b = w2\\ 0 \le v \perp w2 \ge 0\\ w1=0\\ \end{array} \right. w = \left\lbrace \begin{array}{c} w1\\ w2\\ \end{array} \right\rbrace

The criterion is based on $$\sum [ (z[i]*(Mz+q)[i])_{pos} + (z[i])_{neg} + (Mz+q)[i])_{neg} ]$$ with $$x_{pos} = max(0,x)$$ and $$xneg = max(0,-x)$$. This sum is divided by $$\|q\|$$ and then compared to tol. It changes the input vector w by storing $$Mz + q$$ in it.

Parameters: problem – structure that represents the MLCP (n,m,M, q… or (A,B,C…)) z – a m+n-vector of doubles which contains the initial solution and returns the solution of the problem. w – a m+n-vector of doubles which returns the solution of the problem. tolerance – threshold used to validate the solution: if the error is less than this value, the solution is accepted error – status (0 : convergence, 1: error > tolerance)

siconos.numerics.mlcp_direct(MixedLinearComplementarityProblem *problem, array_like (np.float64, 1D)z, array_like (np.float64, 1D)w, int *info, SolverOptions *options) → None[source]

direct solver

Parameters: problem – MixedLinearComplementarityProblem* problem structure that represents the MLCP (n,mM, q…) z – a m+n-vector of doubles which contains the initial solution and returns the solution of the problem. w – a m+n-vector of doubles which returns the solution of the problem. info – an integer which returns the termination value: 0 : success,it found a solution 1 : failure,it did not find any solution options – structure used to define the solver and its parameters.

siconos.numerics.mlcp_direct_FB(MixedLinearComplementarityProblem *problem, array_like (np.float64, 1D)z, array_like (np.float64, 1D)w, int *info, SolverOptions *options) → None[source]

Direct Fischer Burmeister solver.

Parameters: problem – structure that represents the MLCP (n,mM, q…) z – a m+n-vector of doubles which contains the initial solution and returns the solution of the problem. w – a m+n-vector of doubles which returns the solution of the problem. info – an integer which returns the termination value: 0 : success,it found a solution 1 : failure,it did not find any solution options – structure used to define the solver and its parameters.

siconos.numerics.mlcp_direct_enum(MixedLinearComplementarityProblem *problem, array_like (np.float64, 1D)z, array_like (np.float64, 1D)w, int *info, SolverOptions *options) → None[source]

direct-enum solver

Parameters: problem – structure that represents the MLCP (n,mM, q…) z – a m+n-vector of doubles which contains the initial solution and returns the solution of the problem. w – a m+n-vector of doubles which returns the solution of the problem. info – an integer which returns the termination value: 0 : success,it found a solution 1 : failure,it did not find any solution options – structure used to define the solver and its parameters.

siconos.numerics.mlcp_direct_path(MixedLinearComplementarityProblem *problem, array_like (np.float64, 1D)z, array_like (np.float64, 1D)w, int *info, SolverOptions *options) → None[source]

direct-path solver

Parameters: problem – structure that represents the MLCP (n,mM, q…) z – a m+n-vector of doubles which contains the initial solution and returns the solution of the problem. w – a m+n-vector of doubles which returns the solution of the problem. info – an integer which returns the termination value: 0 : success,it found a solution 1 : failure,it did not find any solution options – structure used to define the solver and its parameters.

siconos.numerics.mlcp_direct_simplex(MixedLinearComplementarityProblem *problem, array_like (np.float64, 1D)z, array_like (np.float64, 1D)w, int *info, SolverOptions *options) → None[source]

direct-simplex solver

Parameters: problem – structure that represents the MLCP (n,mM, q…) z – a m+n-vector of doubles which contains the initial solution and returns the solution of the problem. w – a m+n-vector of doubles which returns the solution of the problem. info – an integer which returns the termination value: 0 : success,it found a solution 1 : failure,it did not find any solution options – structure used to define the solver and its parameters.

siconos.numerics.mlcp_driver_get_dwork(MixedLinearComplementarityProblem *problem, SolverOptions *options) → int[source]

General interface to get the number of doubles that must be allocated for the solver.

Must be use for the following solvers:

• mlcp_enum
• mlcp_path
• mlcp_simplex
• mlcp_direct_enum
• mlcp_direct_path
• mlcp_direct_simplex
Parameters: problem – the MixedLinearComplementarityProblem structure which handles the problem (M,q) options – structure used to define the solver(s) and their parameters the number of doubles that must be allocated by the user.

siconos.numerics.mlcp_driver_get_iwork(MixedLinearComplementarityProblem *problem, SolverOptions *options) → int[source]

General interface to get the number of integers that must be allocated for the solver.

Must be use for the following solvers:

• mlcp_enum
• mlcp_path
• mlcp_simplex
• mlcp_direct_enum
• mlcp_direct_path
• mlcp_direct_simplex
Parameters: problem – the MixedLinearComplementarityProblem structure which handles the problem (M,q) options – structure used to define the solver(s) and their parameters the number of integers that must be allocated by the user.

siconos.numerics.mlcp_driver_init(MixedLinearComplementarityProblem *problem, SolverOptions *options) → None[source]

General interface to initialize a solver.

Must be call for the following solvers:

• mlcp_enum
• mlcp_path
• mlcp_simplex
• mlcp_direct_enum
• mlcp_direct_path
• mlcp_direct_simplex
Parameters: problem – the MixedLinearComplementarityProblem structure which handles the problem (M,q) options – structure used to define the solver(s) and their parameters

siconos.numerics.mlcp_driver_reset(MixedLinearComplementarityProblem *problem, SolverOptions *options) → None[source]

General interface to reset a solver.

Must be call for the following solvers:

• mlcp_enum
• mlcp_path
• mlcp_simplex
• mlcp_direct_enum
• mlcp_direct_path
• mlcp_direct_simplex
Parameters: problem – the MixedLinearComplementarityProblem structure which handles the problem (M,q) options – structure used to define the solver(s) and their parameters

siconos.numerics.mlcp_enum(MixedLinearComplementarityProblem *problem, array_like (np.float64, 1D)z, array_like (np.float64, 1D)w, int *info, SolverOptions *options) → None[source]

enum solver

Parameters: problem – structure that represents the MLCP (n,mM, q…) z – a m+n-vector of doubles which contains the initial solution and returns the solution of the problem. w – a m+n-vector of doubles which returns the solution of the problem. info – an integer which returns the termination value: 0 : success,it found a solution 1 : failure,it did not find any solution options – structure used to define the solver and its parameters.

siconos.numerics.mlcp_free_working_memory(MixedLinearComplementarityProblem *problem, SolverOptions *options) → None[source]

siconos.numerics.mlcp_path(MixedLinearComplementarityProblem *problem, array_like (np.float64, 1D)z, array_like (np.float64, 1D)w, int *info, SolverOptions *options) → None[source]

path solver

Parameters: problem – structure that represents the MLCP (n,m,M, q…) z – a m+n-vector of doubles which contains the initial solution and returns the solution of the problem. w – a m+n-vector of doubles which returns the solution of the problem. info – an integer which returns the termination value: 0 : convergence 1 : iter = itermax 2 : negative diagonal term options – structure used to define the solver and its parameters.

siconos.numerics.mlcp_pgs(MixedLinearComplementarityProblem *problem, array_like (np.float64, 1D)z, array_like (np.float64, 1D)w, int *info, SolverOptions *options) → None[source]

mlcp_pgs (Projected Gauss-Seidel) is a basic Projected Gauss-Seidel solver for MLCP.

Parameters: problem – structure that represents the MLCP (n,m,M, q…) z – a m+n-vector of doubles which contains the initial solution and returns the solution of the problem. w – a m+n-vector of doubles which returns the solution of the problem. info – an integer which returns the termination value: 0 : convergence 1 : iter = itermax 2 : negative diagonal term options – structure used to define the solver and its parameters.

siconos.numerics.mlcp_pgs_SBM(MixedLinearComplementarityProblem *problem, array_like (np.float64, 1D)z, array_like (np.float64, 1D)w, int *info, SolverOptions *options) → None[source]

generic interface used to call any MLCP solver applied on a Sparse-Block structured matrix M, with a Gauss-Seidel process to solve the global problem (formulation/solving of local problems for each row of blocks)

Parameters: problem – structure that represents the LCP (M, q…). M must be a SparseBlockStructuredMatrix z – a n-vector of doubles which contains the initial solution and returns the solution of the problem. w – a n-vector of doubles which returns the solution of the problem. info – an integer which returns the termination value: 0 : convergence >0 : failed, depends on local solver options – structure used to define the solver and its parameters.

siconos.numerics.mlcp_psor(MixedLinearComplementarityProblem *problem, array_like (np.float64, 1D)z, array_like (np.float64, 1D)w, int *info, SolverOptions *options) → None[source]

mlcp_psor (projected successive overrelaxation method) is a solver for MLCP.

Parameters: problem – structure that represents the MLCP (n,m,M, q…) z – a m+n-vector of doubles which contains the initial solution and returns the solution of the problem. w – a m+n-vector of doubles which returns the solution of the problem. info – an integer which returns the termination value: 0 : convergence 1 : iter = itermax 2 : negative diagonal term options – structure used to define the solver and its parameters.

siconos.numerics.mlcp_rpgs(MixedLinearComplementarityProblem *problem, array_like (np.float64, 1D)z, array_like (np.float64, 1D)w, int *info, SolverOptions *options) → None[source]

mlcp_rpgs (Projected Gauss-Seidel) is a basic Projected Gauss-Seidel solver for MLCP.

Parameters: problem – structure that represents the MLCP (n,m,M, q…) z – a m+n-vector of doubles which contains the initial solution and returns the solution of the problem. w – a m+n-vector of doubles which returns the solution of the problem. info – an integer which returns the termination value: 0 : convergence 1 : iter = itermax 2 : negative diagonal term options – structure used to define the solver and its parameters.

siconos.numerics.mlcp_rpsor(MixedLinearComplementarityProblem *problem, array_like (np.float64, 1D)z, array_like (np.float64, 1D)w, int *info, SolverOptions *options) → None[source]

mlcp_rpsor (regularized projected successive overrelaxation method) is a solver for MLCP.

Parameters: problem – structure that represents the MLCP (n,m,M, q…) z – a m+n-vector of doubles which contains the initial solution and returns the solution of the problem. w – a m+n-vector of doubles which returns the solution of the problem. info – an integer which returns the termination value: 0 : convergence 1 : iter = itermax 2 : negative diagonal term options – structure used to define the solver and its parameters.

siconos.numerics.mlcp_simplex(MixedLinearComplementarityProblem *problem, array_like (np.float64, 1D)z, array_like (np.float64, 1D)w, int *info, SolverOptions *options) → None[source]

simplex solver

Parameters: problem – structure that represents the MLCP (n,mM, q…) z – a m+n-vector of doubles which contains the initial solution and returns the solution of the problem. w – a m+n-vector of doubles which returns the solution of the problem. info – an integer which returns the termination value: 0 : success,it found a solution 1 : failure,it did not find any solution options – structure used to define the solver and its parameters.