File numerics/src/MLCP/MLCP_Solvers.h¶

Go to the source code of this file

Solvers for Mixed Linear Complementary Problems (MCLP)

Functions

void mixedLinearComplementarity_default_setDefaultSolverOptions(MixedLinearComplementarityProblem *problem, SolverOptions *pOptions)
void mixedLinearComplementarity_deleteDefaultSolverOptions(MixedLinearComplementarityProblem *problem, SolverOptions *pOptions)
int mixedLinearComplementarity_directEnum_setDefaultSolverOptions(MixedLinearComplementarityProblem *problem, SolverOptions *pSolver)
int mixedLinearComplementarity_directFB_setDefaultSolverOptions(MixedLinearComplementarityProblem *problem, SolverOptions *pSolver)
int mixedLinearComplementarity_directPath_setDefaultSolverOptions(MixedLinearComplementarityProblem *problem, SolverOptions *pSolver)
int mixedLinearComplementarity_directPathEnum_setDefaultSolverOptions(MixedLinearComplementarityProblem *problem, SolverOptions *pSolver)
int mixedLinearComplementarity_directSimplex_setDefaultSolverOptions(MixedLinearComplementarityProblem *problem, SolverOptions *pSolver)
int mixedLinearComplementarity_enum_setDefaultSolverOptions(MixedLinearComplementarityProblem *problem, SolverOptions *pSolver)
int mixedLinearComplementarity_fb_setDefaultSolverOptions(MixedLinearComplementarityProblem *problem, SolverOptions *pSolver)
int mixedLinearComplementarity_path_setDefaultSolverOptions(MixedLinearComplementarityProblem *problem, SolverOptions *pSolver)
int mixedLinearComplementarity_pathEnum_setDefaultSolverOptions(MixedLinearComplementarityProblem *problem, SolverOptions *pSolver)
int mixedLinearComplementarity_pgs_SBM_setDefaultSolverOptions(MixedLinearComplementarityProblem *problem, SolverOptions *options)

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

int mixedLinearComplementarity_pgs_setDefaultSolverOptions(MixedLinearComplementarityProblem *problem, SolverOptions *pSolver)
int mixedLinearComplementarity_psor_setDefaultSolverOptions(MixedLinearComplementarityProblem *problem, SolverOptions *pSolver)
int mixedLinearComplementarity_rpgs_setDefaultSolverOptions(MixedLinearComplementarityProblem *problem, SolverOptions *pSolver)
int mixedLinearComplementarity_rpsor_setDefaultSolverOptions(MixedLinearComplementarityProblem *problem, SolverOptions *pSolver)
int mixedLinearComplementarity_setDefaultSolverOptions(MixedLinearComplementarityProblem *problem, SolverOptions *pOptions)

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.

int mixedLinearComplementarity_simplex_setDefaultSolverOptions(MixedLinearComplementarityProblem *problem, SolverOptions *pSolver)
int mlcp_alloc_working_memory(MixedLinearComplementarityProblem *problem, SolverOptions *options)
int mlcp_compute_error(MixedLinearComplementarityProblem *problem, double *z, double *w, double tolerance, double *error)

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.

Return
status: 0 : convergence, 1: error > tolerance
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:

void mlcp_direct(MixedLinearComplementarityProblem *problem, double *z, double *w, int *info, SolverOptions *options)

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.

void mlcp_direct_enum(MixedLinearComplementarityProblem *problem, double *z, double *w, int *info, SolverOptions *options)

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.

void mlcp_direct_FB(MixedLinearComplementarityProblem *problem, double *z, double *w, int *info, SolverOptions *options)

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.

void mlcp_direct_path(MixedLinearComplementarityProblem *problem, double *z, double *w, int *info, SolverOptions *options)

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.

void mlcp_direct_simplex(MixedLinearComplementarityProblem *problem, double *z, double *w, int *info, SolverOptions *options)

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.

int mlcp_driver_get_dwork(MixedLinearComplementarityProblem *problem, SolverOptions *options)

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

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

int mlcp_driver_get_iwork(MixedLinearComplementarityProblem *problem, SolverOptions *options)

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

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

void mlcp_driver_init(MixedLinearComplementarityProblem *problem, SolverOptions *options)

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

void mlcp_driver_reset(MixedLinearComplementarityProblem *problem, SolverOptions *options)

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

void mlcp_enum(MixedLinearComplementarityProblem *problem, double *z, double *w, int *info, SolverOptions *options)

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.

void mlcp_FB(MixedLinearComplementarityProblem *problem, double *z, double *w, int *info, SolverOptions *options)

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.

void mlcp_free_working_memory(MixedLinearComplementarityProblem *problem, SolverOptions *options)
void mlcp_path(MixedLinearComplementarityProblem *problem, double *z, double *w, int *info, SolverOptions *options)

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.

void mlcp_pgs(MixedLinearComplementarityProblem *problem, double *z, double *w, int *info, SolverOptions *options)

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.

void mlcp_pgs_SBM(MixedLinearComplementarityProblem *problem, double *z, double *w, int *info, SolverOptions *options)

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.

void mlcp_psor(MixedLinearComplementarityProblem *problem, double *z, double *w, int *info, SolverOptions *options)

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.

void mlcp_rpgs(MixedLinearComplementarityProblem *problem, double *z, double *w, int *info, SolverOptions *options)

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.

void mlcp_rpsor(MixedLinearComplementarityProblem *problem, double *z, double *w, int *info, SolverOptions *options)

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.

void mlcp_simplex(MixedLinearComplementarityProblem *problem, double *z, double *w, int *info, SolverOptions *options)

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.