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