template<class T>
class drake::solvers::UnrevisedLemkeSolver< T >
A class for the Unrevised Implementation of Lemke Algorithm's for solving Linear Complementarity Problems (LCPs).
See MobyLcpSolver for a description of LCPs. This code makes extensive use of the following document: [Dai 2018] Dai, H. and Drumwright, E. Computing the Principal Pivoting Transform for Solving Linear Complementarity Problems with Lemke's Algorithm. (2018, located in doc/pivot_column.pdf).
|
| UnrevisedLemkeSolver () |
|
| ~UnrevisedLemkeSolver () final |
|
bool | SolveLcpLemke (const MatrixX< T > &M, const VectorX< T > &q, VectorX< T > *z, int *num_pivots, const T &zero_tol=T(-1)) const |
| Lemke's Algorithm for solving LCPs in the matrix class E, which contains all strictly semimonotone matrices, all P-matrices, and all strictly copositive matrices. More...
|
|
MathematicalProgramResult | Solve (const MathematicalProgram &prog, const std::optional< Eigen::VectorXd > &initial_guess=std::nullopt, const std::optional< SolverOptions > &solver_options=std::nullopt) const |
| Like SolverInterface::Solve(), but the result is a return value instead of an output argument. More...
|
|
void | Solve (const MathematicalProgram &, const std::optional< Eigen::VectorXd > &, const std::optional< SolverOptions > &, MathematicalProgramResult *) const override |
|
|
| UnrevisedLemkeSolver (const UnrevisedLemkeSolver &)=delete |
|
UnrevisedLemkeSolver & | operator= (const UnrevisedLemkeSolver &)=delete |
|
| UnrevisedLemkeSolver (UnrevisedLemkeSolver &&)=delete |
|
UnrevisedLemkeSolver & | operator= (UnrevisedLemkeSolver &&)=delete |
|
| ~SolverBase () override |
|
MathematicalProgramResult | Solve (const MathematicalProgram &prog, const std::optional< Eigen::VectorXd > &initial_guess=std::nullopt, const std::optional< SolverOptions > &solver_options=std::nullopt) const |
| Like SolverInterface::Solve(), but the result is a return value instead of an output argument. More...
|
|
void | Solve (const MathematicalProgram &, const std::optional< Eigen::VectorXd > &, const std::optional< SolverOptions > &, MathematicalProgramResult *) const override |
| Solves an optimization program with optional initial guess and solver options. More...
|
|
bool | available () const override |
| Returns true iff support for this solver has been compiled into Drake. More...
|
|
bool | enabled () const override |
| Returns true iff this solver is properly configured for use at runtime. More...
|
|
SolverId | solver_id () const final |
| Returns the identifier of this solver. More...
|
|
bool | AreProgramAttributesSatisfied (const MathematicalProgram &) const override |
| Returns true iff the program's attributes are compatible with this solver's capabilities. More...
|
|
std::string | ExplainUnsatisfiedProgramAttributes (const MathematicalProgram &) const override |
| Describes the reasons (if any) why the program is incompatible with this solver's capabilities. More...
|
|
| SolverBase (const SolverBase &)=delete |
|
SolverBase & | operator= (const SolverBase &)=delete |
|
| SolverBase (SolverBase &&)=delete |
|
SolverBase & | operator= (SolverBase &&)=delete |
|
virtual | ~SolverInterface () |
|
| SolverInterface (const SolverInterface &)=delete |
|
SolverInterface & | operator= (const SolverInterface &)=delete |
|
| SolverInterface (SolverInterface &&)=delete |
|
SolverInterface & | operator= (SolverInterface &&)=delete |
|
bool SolveLcpLemke |
( |
const MatrixX< T > & |
M, |
|
|
const VectorX< T > & |
q, |
|
|
VectorX< T > * |
z, |
|
|
int * |
num_pivots, |
|
|
const T & |
zero_tol = T(-1) |
|
) |
| const |
Lemke's Algorithm for solving LCPs in the matrix class E, which contains all strictly semimonotone matrices, all P-matrices, and all strictly copositive matrices.
The solver can be applied with occasional success to problems outside of its guaranteed matrix classes. Lemke's Algorithm is described in [Cottle 1992], Section 4.4.
The solver will denote failure on return if it exceeds a problem-size dependent number of iterations.
- Parameters
-
[in] | M | the LCP matrix. |
[in] | q | the LCP vector. |
[in,out] | z | the solution to the LCP on return (if the solver succeeds). If the length of z is equal to the length of q, the solver will attempt to use the basis from the last solution. This strategy can prove exceptionally fast if solutions differ little between successive calls. If the solver fails (returns false ), z will be set to the zero vector on return. |
[out] | num_pivots | the number of pivots used, on return. |
[in] | zero_tol | The tolerance for testing against zero. If the tolerance is negative (default) the solver will determine a generally reasonable tolerance. |
- Returns
true
if the solver computes a solution to floating point tolerances (i.e., if IsSolution() returns true
on the problem) and false
otherwise.
- Exceptions
-
std::exception | if M is not square or the dimensions of M do not match the length of q. |
- [Cottle 1992] R. Cottle, J.-S. Pang, and R. Stone. The Linear Complementarity Problem. Academic Press, 1992.