DART  6.10.1
dart::constraint::DantzigBoxedLcpSolver Class Reference

#include <DantzigBoxedLcpSolver.hpp>

Inheritance diagram for dart::constraint::DantzigBoxedLcpSolver:
dart::constraint::BoxedLcpSolver

Public Member Functions

const std::string & getType () const override
 Returns the type. More...
 
bool solve (int n, double *A, double *x, double *b, int nub, double *lo, double *hi, int *findex, bool earlyTermination) override
 Solves constriant impulses for a constrained group. More...
 
bool canSolve (int n, const double *A) override
 
template<typename BoxedLcpSolverT >
bool is () const
 Returns true if this solver and the template parameter (a solver class) are the same type. More...
 

Static Public Member Functions

static const std::string & getStaticType ()
 Returns type for this class. More...
 

Member Function Documentation

◆ canSolve()

bool dart::constraint::DantzigBoxedLcpSolver::canSolve ( int  n,
const double *  A 
)
overridevirtual

◆ getStaticType()

const std::string & dart::constraint::DantzigBoxedLcpSolver::getStaticType ( )
static

Returns type for this class.

◆ getType()

const std::string & dart::constraint::DantzigBoxedLcpSolver::getType ( ) const
overridevirtual

Returns the type.

Implements dart::constraint::BoxedLcpSolver.

◆ is()

template<typename BoxedLcpSolverT >
bool dart::constraint::BoxedLcpSolver::is
inherited

Returns true if this solver and the template parameter (a solver class) are the same type.

This function is a syntactic sugar, which is identical to:

getType() == BoxedLcpSolver::getStaticType()
const std::string & getType() const override
Returns the type.
Definition: DantzigBoxedLcpSolver.cpp:41

.

Example code:

auto lcpSolver = constraintSolver->getBoxedLcpSolver();
if (shape->is<DantzigBoxedLcpSolver>())
std::cout << "The LCP solver type is Dantzig!\n";
See also
getType()

◆ solve()

bool dart::constraint::DantzigBoxedLcpSolver::solve ( int  n,
double *  A,
double *  x,
double *  b,
int  nub,
double *  lo,
double *  hi,
int *  findex,
bool  earlyTermination 
)
overridevirtual

Solves constriant impulses for a constrained group.

The LCP formulation setting that this function solve is A*x = b + w where each x[i], w[i] satisfies one of (1) x = lo, w >= 0 (2) x = hi, w <= 0 (3) lo < x < hi, w = 0

Parameters
[in]nDimension of constraints.
[in]AA term of the LCP formulation.
[in]xx term of the LCP formulation.
[in]bb term of the LCP formulation.
[in]nubNumber of the first unbounded constraints.
[in]loLower bound of x where it's restricted to be lo <= 0.
[in]hiUpper bound of x where it's enforced to be hi >= 0.
[in]findexIndices to corresponding normal contact constraint. Set the index to itself (e.g., findex[k] = k) for normal contacts or non-contact constraints. For friction constraint, set the cooresponding normal contact constraint.
[in]earlyTerminationSet true to return false as soon as the solver find the solution doesn't exist. Otherwise, the solver will continue to push hard to solve the problem using some hacks.
Returns
Success.

Implements dart::constraint::BoxedLcpSolver.