SurgSim::Math::MlcpProblem Struct Reference

A description of an MLCP (mixed linear complementarity problem, or mixed LCP) system to be solved. More...

#include <SurgSim/Math/MlcpProblem.h>

Inheritance diagram for SurgSim::Math::MlcpProblem:
[legend]
Collaboration diagram for SurgSim::Math::MlcpProblem:
[legend]

## Public Types

typedef Eigen::Matrix< double,
Eigen::Dynamic, Eigen::Dynamic >
Matrix

typedef Eigen::Matrix< double,
Eigen::Dynamic, 1 >
Vector

## Public Member Functions

virtual ~MlcpProblem ()
Destructor. More...

size_t getSize () const
Gets the size of the system. More...

bool isConsistent () const
Checks if the sizes of various elements of the system are consistent with each other. More...

virtual void setZero (size_t numDof, size_t numConstraintDof, size_t numConstraints)
Resize an MlcpProblem and set to zero. More...

## Static Public Member Functions

static MlcpProblem Zero (size_t numDof, size_t numConstraintDof, size_t numConstraints)
Initialize an MlcpProblem with zero values. More...

## Public Attributes

Matrix A
Matrix $$\mathbf{A}$$ used to describe the mixed LCP problem. More...

Vector b
Vector $$b$$ used to describe the mixed LCP problem. More...

Vector mu
A vector of friction coefficients used to describe the mixed LCP problem. More...

std::vector< MlcpConstraintTypeconstraintTypes
A vector of constraint types used to describe the mixed LCP problem. More...

## Detailed Description

A description of an MLCP (mixed linear complementarity problem, or mixed LCP) system to be solved.

A traditional (not mixed!) LCP problem is expressed as $$\mathbf{A}x + b = c$$, where $$x$$ is the vector of variables of interest to be determined, $$c$$ is the vector of slack variables (transforming a system of inequalities into a system of equalities), and $$x$$ and $$c$$ are subject to the inequality conditions $$x_i \ge 0$$, $$c_i \ge 0$$, and $$x \perp c$$ (i.e., $$x \cdot c = 0$$). Thus for each row $$i$$, either

• $$(\mathbf{A}x+b)_i = \mathbf{A}_{i,*}\cdot x+b_i = c_i \ge 0$$ and $$x_i = 0$$ (the constraint is non-binding, so the variable of interest enforcing the constraint is zero); or
• $$(\mathbf{A}x+b)_i = \mathbf{A}_{i,*}\cdot x+b_i = c_i = 0$$ and $$x_i > 0$$ (the constraint is binding, so the variable of interest is nonzero to enforce the constraint).

Solving the problem produces the vector $$x$$, from which $$c$$ can also be computed if needed.

A mixed LCP problem is defined in the same way, except that for a certain subset of indices, the conditions are restricted further to require $$c_i$$ to be zero, $$\mathbf{A}_{i,*}\cdot x+b_i = 0$$. These are referred to as bilateral constraints, as opposed to the unilateral constraints in the LCP problem.

Friction is integrated directly into the problem, using the general approach described e.g. in:
Duriez, Christian; Dubois, F.; Kheddar, A.; Andriot, C., "Realistic haptic rendering of interacting deformable objects in virtual environments," IEEE Transactions on Visualization and Computer Graphics, vol.12, no.1, pp.36,47, Jan.-Feb. 2006.

SurgSim::Physics::MlcpPhysicsProblem, MlcpSolution, MlcpSolver

## Member Typedef Documentation

 typedef Eigen::Matrix SurgSim::Math::MlcpProblem::Matrix
 typedef Eigen::Matrix SurgSim::Math::MlcpProblem::Vector

## Constructor & Destructor Documentation

 SurgSim::Math::MlcpProblem::~MlcpProblem ( )
virtual

Destructor.

## Member Function Documentation

 size_t SurgSim::Math::MlcpProblem::getSize ( ) const
inline

Gets the size of the system.

Returns
the number of degrees of freedom of the system.
 bool SurgSim::Math::MlcpProblem::isConsistent ( ) const
inline

Checks if the sizes of various elements of the system are consistent with each other.

Returns
true if consistent, false otherwise.
 void SurgSim::Math::MlcpProblem::setZero ( size_t numDof, size_t numConstraintDof, size_t numConstraints )
virtual

Resize an MlcpProblem and set to zero.

Parameters
 numDof the total degrees of freedom. numConstraintDof the total constrained degrees of freedom. numConstraints the number of constraints.

Reimplemented in SurgSim::Physics::MlcpPhysicsProblem.

 MlcpProblem SurgSim::Math::MlcpProblem::Zero ( size_t numDof, size_t numConstraintDof, size_t numConstraints )
static

Initialize an MlcpProblem with zero values.

Parameters
 numDof the total degrees of freedom for the MlcpProblem to be constructed. numConstraintDof the total constrained degrees of freedom for the MlcpProblem to be constructed. numConstraints the number of constraints for the MlcpProblem to be constructed.
Returns
An MlcpProblem appropriately sized and initialized to zero.

## Member Data Documentation

 Matrix SurgSim::Math::MlcpProblem::A

Matrix $$\mathbf{A}$$ used to describe the mixed LCP problem.

 Vector SurgSim::Math::MlcpProblem::b

Vector $$b$$ used to describe the mixed LCP problem.

 std::vector SurgSim::Math::MlcpProblem::constraintTypes

A vector of constraint types used to describe the mixed LCP problem.

Todo:
This API will change in the future to something more independent of physics.
 Vector SurgSim::Math::MlcpProblem::mu

A vector of friction coefficients used to describe the mixed LCP problem.

Todo:
This API will change in the future to something more independent of physics.

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