120 setElem(col,row, (*
this)(row,col));
150 for (
int i=0;i<
m_rows;i++)
152 for (
int j=0;j<
m_cols;j++)
173 printf(
"%s ---------------------\n",msg);
174 for (
int i=0;i<
rows();i++)
177 for (
int j=0;j<
cols();j++)
179 printf(
"%2.1f\t",(*
this)(i,j));
182 printf(
"\n---------------------\n");
193 int computedNonZero = total-numZeros;
198 if(computedNonZero!=nonZero)
200 printf(
"Error: computedNonZero=%d, but nonZero=%d\n",computedNonZero,nonZero);
203 printf(
"total %d, %d rows, %d cols, %d non-zeros (%f %)\n", total,
rows(),
cols(), nonZero,100.f*(T)nonZero/T(total));
228 for (
int i=0;i<
m_cols;i++)
229 for (
int j=0;j<
m_rows;j++)
273 for (
int j=0; j < res.cols(); ++j)
278 for (
int i=0; i < res.rows(); ++i)
283 int waste=0,waste2=0;
285 bool doubleWalk =
false;
290 for (
int ii=0;ii<numRows;ii++)
295 for (
int ii=0;ii<numOtherCols;ii++)
302 int indexOtherCol = 0;
303 while (indexRow < numRows && indexOtherCol < numOtherCols)
309 dotProd += (*this)(i,vThis) * other(vThis,j);
322 bool useOtherCol =
true;
335 dotProd+=w*other(v,j);
348 dotProd+=w*other(v,j);
355 res.setElem(i,j,dotProd);
366 for (
int i = 0;i<numRows;i++)
369 for (
int j = 0;j<numRowsOther;j++)
387 btAssert (numRows>0 && numRowsOther>0 && B && C);
389 for (
int i = 0;i<numRows;i++)
392 for (
int j = 0;j<numRowsOther;j++)
410 template <
typename T>
494 #ifdef BT_USE_DOUBLE_PRECISION
495 #define btVectorXu btVectorXd
496 #define btMatrixXu btMatrixXd
498 #define btVectorXu btVectorXf
499 #define btMatrixXu btMatrixXf
500 #endif //BT_USE_DOUBLE_PRECISION
504 #endif//BT_MATRIX_H_H
void setElem(int row, int col, T val)
static T sum(const btAlignedObjectArray< T > &items)
btVectorX< double > btVectorXd
void push_back(const T &_Val)
const T * getBufferPointer() const
btAlignedObjectArray< T > m_storage
btAlignedObjectArray< T > m_storage
bool operator()(const int &a, const int &b) const
The btAlignedObjectArray template class uses a subset of the stl::vector interface for its methods It...
btVectorX< float > btVectorXf
const T & operator[](int index) const
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
original version written by Erwin Coumans, October 2013
void printMatrix(const char *msg)
T * getBufferPointerWritable()
void sortColIndexArrays()
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...
int size() const
return the number of elements in the array
T * getBufferPointerWritable()
void btSetZero(T *a, int n)
btMatrixX< double > btMatrixXd
void multiply2_p8r(const btScalar *B, const btScalar *C, int numRows, int numRowsOther, int row, int col)
btMatrixX< float > btMatrixXf
void resize(int newsize, const T &fillData=T())
const T & operator()(int row, int col) const
void setElem(btMatrixXd &mat, int row, int col, double val)
const T * getBufferPointer() const
void multiplyAdd2_p8r(const btScalar *B, const btScalar *C, int numRows, int numRowsOther, int row, int col)
void printNumZeros(const char *msg)
void copyLowerToUpperTriangle()
void resize(int rows, int cols)
btAlignedObjectArray< btAlignedObjectArray< int > > m_colNonZeroElements
void sortRowIndexArrays()
btMatrixX operator*(const btMatrixX &other)
btMatrixX transpose() const
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
void quickSort(const L &CompareFunc)
btAlignedObjectArray< btAlignedObjectArray< int > > m_rowNonZeroElements1
btMatrixX(int rows, int cols)