20#ifndef NUMERICS_LINEAR_COMPLEMENTARITY_PROBLEM_H_
21#define NUMERICS_LINEAR_COMPLEMENTARITY_PROBLEM_H_
23#include <fmatvec/fmatvec.h>
25#include <mbsim/numerics/nonlinear_algebra/multi_dimensional_newton_method.h>
26#include <mbsim/numerics/nonlinear_algebra/multi_dimensional_fixpoint_solver.h>
27#include <mbsim/numerics/linear_complementarity_problem/lemke_algorithm.h>
29#include <mbsim/numerics/functions/lcp_reformulation_functions.h>
40 enum LCPSolvingStrategy {
43 ReformulatedNewtonOnly,
44 ReformulatedFixpointOnly,
67 LinearComplementarityProblem(
const fmatvec::SymMat & M_,
const fmatvec::Vec & q_,
const LCPSolvingStrategy & strategy_ = Standard,
const JacobianType & jacobianType_ = LCPSpecial);
72 void setSystem(
const fmatvec::SymMat & M_,
const fmatvec::Vec & q_);
73 void setStrategy(
const LCPSolvingStrategy & strategy_) {
77 void setJacobianType(
const JacobianType & jacobianType_) {
88 fmatvec::Vec solve(
const fmatvec::Vec & initialSolution = fmatvec::Vec(0, fmatvec::NONINIT));
109 void useNewton(fmatvec::Vec & solution,
bool & solved);
114 void useFixpoint(fmatvec::Vec & solution,
bool & solved);
187 std::ostream& operator <<(std::ostream & o,
const LinearComplementarityProblem::LCPSolvingStrategy &strategy);
189 std::ostream& operator <<(std::ostream & o,
const LinearComplementarityProblem::JacobianType &jacobianType);
Mother class for different criterias that are fulfilled or not.
Definition: criteria_functions.h:33
Definition: lemke_algorithm.h:28
class to solve a linear complementarity problem
Definition: linear_complementarity_problem.h:38
LCPFixpointReformulationFunction * fixpointFunction
reformulated LCP suited for a FixpointSolver
Definition: linear_complementarity_problem.h:179
LemkeAlgorithm lemkeSolver
LemkeSolver for the direct solution of the LCP.
Definition: linear_complementarity_problem.h:149
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
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 double computeMediumEigVal(const fmatvec::SqrMat &M)
compute the medium eigenvalue of a matrix (for guessing a initial solution for iterative schemes)
Definition: linear_complementarity_problem.cc:296
CriteriaFunction * criteriaFixedpoint
criteria function for Fixedpoint solver
Definition: linear_complementarity_problem.h:184
fmatvec::SqrMat M
linear coupling matrix of the LCP
Definition: linear_complementarity_problem.h:119
LCPSolvingStrategy strategy
algorithm strategy to solve the LCP
Definition: linear_complementarity_problem.h:129
fmatvec::Vec q
constant vector of the LCP
Definition: linear_complementarity_problem.h:124
void useFixpoint(fmatvec::Vec &solution, bool &solved)
change the incoming solution vector using the fixpoint scheme
Definition: linear_complementarity_problem.cc:383
JacobianType jacobianType
jacobian function for the solving with thew newton algorithm in the reformulated case
Definition: linear_complementarity_problem.h:144
MultiDimensionalFixpointSolver * fixpointSolver
FixpointSolver for reformulated system.
Definition: linear_complementarity_problem.h:174
double mediumEigenValue
parameter for finding the start solution for the reformulated system
Definition: linear_complementarity_problem.h:139
LCPNewtonReformulationFunction * newtonFunction
reformulated LCP suited for a Newton Solver
Definition: linear_complementarity_problem.h:159
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)
Definition: linear_complementarity_problem.cc:76
MBSim::MultiDimensionalNewtonMethod * newtonSolver
NewtonSolver for reformulated system.
Definition: linear_complementarity_problem.h:154
LCPSolvingStrategy oldStrategy
save old Strategy for switching...
Definition: linear_complementarity_problem.h:134
NewtonJacobianFunction * jacobianFunction
Jacobian Function for the reformulated LCP.
Definition: linear_complementarity_problem.h:164
CriteriaFunction * criteriaNewton
criteria function for Newton solver
Definition: linear_complementarity_problem.h:169
void useNewton(fmatvec::Vec &solution, bool &solved)
change the incoming solution vector using the fixpoint scheme
Definition: linear_complementarity_problem.cc:333
Fixpoint-Solver for multi-dimensional fixpoint-finding.
Definition: multi_dimensional_fixpoint_solver.h:34
Newton method for multidimensional root finding.
Definition: multi_dimensional_newton_method.h:41
base class for square Jacobians used for the newton method
Definition: newton_method_jacobian_functions.h:31
namespace MBSim
Definition: bilateral_constraint.cc:30