mbsim  4.0.0
MBSim Kernel
MBSim::LinearComplementarityProblem Class Reference

class to solve a linear complementarity problem More...

#include <linear_complementarity_problem.h>

Inheritance diagram for MBSim::LinearComplementarityProblem:
[legend]

Public Types

enum  LCPSolvingStrategy {
  Standard , ReformulatedStandard , ReformulatedNewtonOnly , ReformulatedFixpointOnly ,
  LemkeOnly
}
 
enum  JacobianType { Numerical , LCPSpecial }
 
enum  CriteriaType { Global , Local }
 

Public Member Functions

 LinearComplementarityProblem (const fmatvec::SymMat &M_, const fmatvec::Vec &q_, const LCPSolvingStrategy &strategy_=Standard, const JacobianType &jacobianType_=LCPSpecial)
 solves a linear complementarity problem (w = M z + q) More...
 
void setSystem (const fmatvec::SymMat &M_, const fmatvec::Vec &q_)
 
void setStrategy (const LCPSolvingStrategy &strategy_)
 
void setJacobianType (const JacobianType &jacobianType_)
 
void setNewtonCriteriaFunction (CriteriaFunction *criteriaFunction_)
 
void setFixpointCriteriaFunction (CriteriaFunction *criteriaFunction_)
 
fmatvec::Vec solve (const fmatvec::Vec &initialSolution=fmatvec::Vec(0, fmatvec::NONINIT))
 

Static Public Member Functions

static double computeMediumEigVal (const fmatvec::SqrMat &M)
 compute the medium eigenvalue of a matrix (for guessing a initial solution for iterative schemes)
 
static fmatvec::Vec createInitialSolution (const fmatvec::SymMat &M, const fmatvec::Vec &q, double mediumEigVal=0)
 creates an initial solution for the iterative schemes that use a reformulated system
 
static fmatvec::Vec createInitialSolution (const fmatvec::SqrMat &M, const fmatvec::Vec &q, double mediumEigVal=0)
 creates an initial solution for the iterative schemes that use a reformulated system
 

Protected Member Functions

void useNewton (fmatvec::Vec &solution, bool &solved)
 change the incoming solution vector using the fixpoint scheme
 
void useFixpoint (fmatvec::Vec &solution, bool &solved)
 change the incoming solution vector using the fixpoint scheme
 

Protected Attributes

fmatvec::SqrMat M
 linear coupling matrix of the LCP
 
fmatvec::Vec q
 constant vector of the LCP
 
LCPSolvingStrategy strategy
 algorithm strategy to solve the LCP
 
LCPSolvingStrategy oldStrategy
 save old Strategy for switching...
 
double mediumEigenValue
 parameter for finding the start solution for the reformulated system
 
JacobianType jacobianType
 jacobian function for the solving with thew newton algorithm in the reformulated case
 
LemkeAlgorithm lemkeSolver
 LemkeSolver for the direct solution of the LCP.
 
MBSim::MultiDimensionalNewtonMethodnewtonSolver
 NewtonSolver for reformulated system.
 
LCPNewtonReformulationFunctionnewtonFunction
 reformulated LCP suited for a Newton Solver
 
NewtonJacobianFunctionjacobianFunction
 Jacobian Function for the reformulated LCP.
 
CriteriaFunctioncriteriaNewton
 criteria function for Newton solver
 
MultiDimensionalFixpointSolverfixpointSolver
 FixpointSolver for reformulated system.
 
LCPFixpointReformulationFunctionfixpointFunction
 reformulated LCP suited for a FixpointSolver
 
CriteriaFunctioncriteriaFixedpoint
 criteria function for Fixedpoint solver
 

Detailed Description

class to solve a linear complementarity problem

Todo:
: find a better concept for the properties of the used solving algorithms (maybe single "option" - classes)

Constructor & Destructor Documentation

◆ LinearComplementarityProblem()

MBSim::LinearComplementarityProblem::LinearComplementarityProblem ( const fmatvec::SymMat &  M_,
const fmatvec::Vec &  q_,
const LCPSolvingStrategy &  strategy_ = Standard,
const JacobianType &  jacobianType_ = LCPSpecial 
)

solves a linear complementarity problem (w = M z + q)

Parameters
Mlinear coupling matrix of the LCP
qconstant vector of the LCP
LCPSolvingStrategyalgorithm strategy to solve the LCP
mediumEigValparameter for finding the start solution for the reformulated system

The documentation for this class was generated from the following files: