#include <BoxedLcpSolver.hpp>
|
virtual | ~BoxedLcpSolver ()=default |
| Destructor.
|
|
virtual const std::string & | getType () const =0 |
| Returns the type.
|
|
virtual bool | solve (int n, double *A, double *x, double *b, int nub, double *lo, double *hi, int *findex, bool earlyTermination=false)=0 |
| Solves constriant impulses for a constrained group.
|
|
virtual bool | canSolve (int n, const double *A)=0 |
|
bool | is () const |
| Returns true if the types of this Base and the template parameter (a base class) are identical.
|
|
const Derived * | as () const |
| Casts to pointer of Derived if Base is its base class.
|
|
Derived * | as () |
| Casts to pointer of Derived if Base is its base class.
|
|
const Derived & | asRef () const |
| Casts to reference of Derived if Base is its base class. UB otherwise.
|
|
Derived & | asRef () |
| Casts to reference of Derived if Base is its base class. UB otherwise.
|
|
◆ ~BoxedLcpSolver()
virtual dart::constraint::BoxedLcpSolver::~BoxedLcpSolver |
( |
| ) |
|
|
virtualdefault |
◆ as() [1/2]
Casts to pointer of Derived if Base is its base class.
Returns nullptr otherwise.
◆ as() [2/2]
Casts to pointer of Derived if Base is its base class.
Returns nullptr otherwise.
◆ asRef() [1/2]
Casts to reference of Derived if Base is its base class. UB otherwise.
◆ asRef() [2/2]
Casts to reference of Derived if Base is its base class. UB otherwise.
◆ base() [1/2]
◆ base() [2/2]
Casts to Base const-reference.
◆ canSolve()
virtual bool dart::constraint::BoxedLcpSolver::canSolve |
( |
int |
n, |
|
|
const double * |
A |
|
) |
| |
|
pure virtual |
◆ getType()
virtual const std::string & dart::constraint::BoxedLcpSolver::getType |
( |
| ) |
const |
|
pure virtual |
◆ is()
Returns true if the types of this Base
and the template parameter (a base class) are identical.
This function is a syntactic sugar, which is identical to: (getType() == ShapeType::getStaticType()).
Example code:
if (shape->is<Sphere>())
std::cout << "The shape type is sphere!\n";
◆ solve()
virtual bool dart::constraint::BoxedLcpSolver::solve |
( |
int |
n, |
|
|
double * |
A, |
|
|
double * |
x, |
|
|
double * |
b, |
|
|
int |
nub, |
|
|
double * |
lo, |
|
|
double * |
hi, |
|
|
int * |
findex, |
|
|
bool |
earlyTermination = false |
|
) |
| |
|
pure virtual |
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] | n | Dimension of constraints. |
[in] | A | A term of the LCP formulation. |
[in] | x | x term of the LCP formulation. |
[in] | b | b term of the LCP formulation. |
[in] | nub | Number of the first unbounded constraints. |
[in] | lo | Lower bound of x where it's restricted to be lo <= 0. |
[in] | hi | Upper bound of x where it's enforced to be hi >= 0. |
[in] | findex | Indices 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] | earlyTermination | Set 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.
Implemented in dart::constraint::DantzigBoxedLcpSolver, and dart::constraint::PgsBoxedLcpSolver.