26#undef BT_DEBUG_OSTREAM
27#ifdef BT_DEBUG_OSTREAM
70#ifdef BT_DEBUG_OSTREAM
72 cout <<
"Dimension = " << dim <<
endl;
83#ifdef BT_DEBUG_OSTREAM
91 A.setSubMatrix(0, 0, dim - 1, dim - 1,
ident);
92 A.setSubMatrix(0, dim, dim - 1, 2 * dim - 1,
mNeg);
93 A.setSubMatrix(0, 2 * dim, dim - 1, 2 * dim, -1.f);
94 A.setSubMatrix(0, 2 * dim + 1, dim - 1, 2 * dim + 1,
m_q);
96#ifdef BT_DEBUG_OSTREAM
97 cout <<
A << std::endl;
106 for (
int i = 0; i < dim; i++)
112 for (
int i=0;i<dim;i++)
130#ifdef BT_DEBUG_OSTREAM
137 for (
int i = 0; i <
basis.size(); i++)
155#ifdef BT_DEBUG_OSTREAM
161 for (
int i = 0; i <
basis.size(); i++)
188#ifdef BT_DEBUG_OSTREAM
197#ifdef BT_DEBUG_OSTREAM
199 cerr <<
"Lemke-Algorithm ended with Ray-Termination (no valid solution)." <<
endl;
206#ifdef BT_DEBUG_OSTREAM
214 for (
int i = 0; i <
basis.size(); i++)
238 for (
int j = 2;
j < dim + 1;
j++)
241#ifdef BT_DEBUG_OSTREAM
249 for (
int i = 0; i <
Rows.size(); i++)
251 if (
Rows[i].nrm2() > 0.) {
254 for (;
j <
Rows.size();
j++)
258 if(
Rows[
j].nrm2() > 0.)
261 for (
int ii=0;
ii<dim+1;
ii++)
273 if (
j ==
Rows.size())
302#ifdef BT_DEBUG_OSTREAM
303 cout <<
A << std::endl;
306 for (
int i = 0; i <
A.rows(); i++)
310 for (
int j = 0;
j <
A.cols();
j++)
322#ifdef BT_DEBUG_OSTREAM
323 cout <<
A << std::endl;
325 for (
int i = 0; i <
A.cols(); i++)
329#ifdef BT_DEBUG_OSTREAM
330 cout <<
A << std::endl;
333 for (
int i = 0; i <
A.rows(); i++)
340#ifdef BT_DEBUG_OSTREAM
341 cout <<
A << std::endl;
348 for (
int i = 0; i <
vector.size(); i++) {
361 for (
int i = 0; i <
basis.size(); i++) {
const T & btMax(const T &a, const T &b)
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
btScalar btSqrt(btScalar y)
The btAlignedObjectArray template class uses a subset of the stl::vector interface for its methods It...
void push_back(const T &_Val)
int findLexicographicMinimum(const btMatrixXu &A, const int &pivotColIndex)
btVectorXu solve(unsigned int maxloops=0)
solve algorithm adapted from : Fast Implementation of Lemkeās Algorithm for Rigid Body Contact Simula...
bool validBasis(const btAlignedObjectArray< int > &basis)
int info
did the algorithm find a solution
bool greaterZero(const btVectorXu &vector)
int DEBUGLEVEL
define level of debug output
bool LexicographicPositive(const btVectorXu &v)
unsigned int steps
number of steps until the Lemke algorithm found a solution
void GaussJordanEliminationStep(btMatrixXu &A, int pivotRowIndex, int pivotColumnIndex, const btAlignedObjectArray< int > &basis)