Bullet Collision Detection & Physics Library
|
Go to the documentation of this file.
25 #ifdef BT_DEBUG_OSTREAM
28 #endif //BT_DEBUG_OSTREAM
88 for (
int ix = 0; ix < nn; ix++)
90 if ((*
this)[ix] != 0.0)
92 T absxi =
btFabs((*
this)[ix]);
97 ssq = ssq * (temp * temp) +
BT_ONE;
103 temp = absxi / scale;
108 norm = scale * sqrt(ssq);
151 template <
typename T>
246 for (
int row = 0; row <
rows(); row++)
248 for (
int col = 0; col < row; col++)
250 setElem(col, row, (*
this)(row, col));
281 for (
int row = 0; row <
rows(); row++)
289 printf(
"%s ---------------------\n", msg);
290 for (
int i = 0; i <
rows(); i++)
293 for (
int j = 0; j <
cols(); j++)
295 printf(
"%2.1f\t", (*
this)(i, j));
298 printf(
"\n---------------------\n");
304 for (
int i = 0; i <
rows(); i++)
307 for (
int j = 0; j <
cols(); j++)
309 if ((*
this)(i, j) != 0.f)
321 for (
int i = 0; i <
m_cols; i++)
322 for (
int j = 0; j <
m_rows; j++)
341 for (
int i = 0; i <
rows(); ++i)
344 for (
int j = 0; j < other.
cols(); ++j)
352 for (
int k = 0; k <
cols(); k++)
355 if (other(k, j) != 0.f)
357 dotProd += w * other(k, j);
363 res.setElem(i, j, dotProd);
374 for (
int i = 0; i < numRows; i++)
377 for (
int j = 0; j < numRowsOther; j++)
381 sum += bb[1] * cc[1];
382 sum += bb[2] * cc[2];
383 sum += bb[4] * cc[4];
384 sum += bb[5] * cc[5];
385 sum += bb[6] * cc[6];
395 btAssert(numRows > 0 && numRowsOther > 0 && B && C);
397 for (
int i = 0; i < numRows; i++)
400 for (
int j = 0; j < numRowsOther; j++)
404 sum += bb[1] * cc[1];
405 sum += bb[2] * cc[2];
406 sum += bb[4] * cc[4];
407 sum += bb[5] * cc[5];
408 sum += bb[6] * cc[6];
416 void setSubMatrix(
int rowstart,
int colstart,
int rowend,
int colend,
const T value)
418 int numRows = rowend + 1 - rowstart;
419 int numCols = colend + 1 - colstart;
421 for (
int row = 0; row < numRows; row++)
423 for (
int col = 0; col < numCols; col++)
425 setElem(rowstart + row, colstart + col, value);
434 for (
int row = 0; row < block.
rows(); row++)
436 for (
int col = 0; col < block.
cols(); col++)
438 setElem(rowstart + row, colstart + col, block(row, col));
446 for (
int row = 0; row < block.
rows(); row++)
448 for (
int col = 0; col < block.
cols(); col++)
450 setElem(rowstart + row, colstart + col, block[row]);
458 for (
int i = 0; i <
rows(); i++)
459 for (
int j = 0; j <
cols(); j++)
474 #ifdef BT_DEBUG_OSTREAM
475 template <
typename T>
476 std::ostream& operator<<(std::ostream& os,
const btMatrixX<T>& mat)
480 for (
int i = 0; i < mat.
rows(); i++)
482 for (
int j = 0; j < mat.
cols(); j++)
484 os << std::setw(12) << mat(i, j);
486 if (i != mat.
rows() - 1)
495 template <
typename T>
496 std::ostream& operator<<(std::ostream& os,
const btVectorX<T>& mat)
500 for (
int i = 0; i < mat.
rows(); i++)
502 os << std::setw(12) << mat[i];
503 if (i != mat.rows() - 1)
513 #endif //BT_DEBUG_OSTREAM
525 #ifdef BT_USE_DOUBLE_PRECISION
526 #define btVectorXu btVectorXd
527 #define btMatrixXu btMatrixXd
529 #define btVectorXu btVectorXf
530 #define btMatrixXu btMatrixXf
531 #endif //BT_USE_DOUBLE_PRECISION
533 #endif //BT_MATRIX_H_H
void multiplyAdd2_p8r(const btScalar *B, const btScalar *C, int numRows, int numRowsOther, int row, int col)
btAlignedObjectArray< T > m_storage
btVectorX< double > btVectorXd
void setSubMatrix(int rowstart, int colstart, int rowend, int colend, const T value)
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
void mulElem(int row, int col, T val)
T * getBufferPointerWritable()
btMatrixX operator*(const btMatrixX &other)
void setElem(int row, int col, T val)
void rowComputeNonZeroElements() const
T * getBufferPointerWritable()
btAlignedObjectArray< btAlignedObjectArray< int > > m_rowNonZeroElements1
btVectorX< float > btVectorXf
btScalar btFabs(btScalar x)
void resize(int newsize, const T &fillData=T())
btAlignedObjectArray< T > m_storage
btMatrixX< double > btMatrixXd
original version written by Erwin Coumans, October 2013
void copyLowerToUpperTriangle()
const T * getBufferPointer() const
void resize(int rows, int cols)
The btAlignedObjectArray template class uses a subset of the stl::vector interface for its methods It...
btMatrixX< float > btMatrixXf
void multiply2_p8r(const btScalar *B, const btScalar *C, int numRows, int numRowsOther, int row, int col)
btMatrixX(int rows, int cols)
void btSetZero(T *a, int n)
void addElem(int row, int col, T val)
we don't want this read/write operator(), because we cannot keep track of non-zero elements,...
void setSubMatrix(int rowstart, int colstart, int rowend, int colend, const btVectorX< T > &block)
void printMatrix(const char *msg) const
void setSubMatrix(int rowstart, int colstart, int rowend, int colend, const btMatrixX &block)
btMatrixX transpose() const
void setElem(btMatrixXd &mat, int row, int col, double val)
void push_back(const T &_Val)
T & operator[](int index)
const T & operator()(int row, int col) const
const T & operator[](int index) const
static T sum(const btAlignedObjectArray< T > &items)
const T * getBufferPointer() const
bool operator()(const int &a, const int &b) const