Home || Visual Search || Applications || Architecture || Important Messages || OGL || Src

Mat32* Impala::Core::Matrix::MatMul ( Mat32 *  m,
Mat32 *  a 
) [inline]

Definition at line 114 of file MatMul.h.

References ILOG_ERROR, ILOG_VAR, MatE(), MatNrCol(), MatNrRow(), MatTranspose(), Impala::Core::Array::Array2dTem< StorT, elemSize, ArithT >::PB(), and SGEMM.

Referenced by Impala::Core::Feature::MarkovStationaryFeature(), Impala::Core::Feature::InterestPointFeature::ProjectHardIndex(), Impala::Core::Feature::InterestPointFeature::ProjectHardMatrix(), Impala::Core::Feature::InterestPointFeature::ProjectLLC(), Impala::Core::Feature::InterestPointFeature::ProjectUNC(), Impala::Core::Array::Rotate(), and Impala::Core::Tracking::Classifier::UpdateClassifiers().

00115 {
00116     Mat32* res;
00117     ILOG_VAR(Core.Matrix.MatMul);
00118 
00119     if (MatNrCol(m) != MatNrRow(a))
00120     {
00121         ILOG_ERROR("nonconformant MatMul operands.");
00122         return 0;
00123     }
00124     res = MatCreate<Mat32>(MatNrRow(m), MatNrCol(a));
00125 
00126 #ifdef BASE_CBLAS
00127     Mat32* aa = MatTranspose(a);
00128     for (int i=0 ; i<MatNrRow(m) ; i++)
00129     {
00130         Real32* rowM = MatE(m, i, 0);
00131         for (int j=0 ; j<MatNrCol(a) ; j++)
00132         {
00133             Real32* rowAA = MatE(aa, j, 0);
00134             Real32 sum = 0;
00135             for (int k=0 ; k<MatNrCol(m) ; k++)
00136             {
00137                 sum += rowM[k] * rowAA[k];
00138             }
00139             *MatE(res, i, j) = sum;
00140         }
00141     }
00142     delete aa;
00143 #else
00144     SGEMM(CblasNoTrans, CblasNoTrans,
00145           MatNrRow(m), MatNrCol(a), MatNrRow(a),
00146           1.0, m->PB(), MatNrCol(m),
00147           a->PB(), MatNrCol(a),
00148           0.0, res->PB(), MatNrCol(res));
00149 #endif
00150 
00151     return res;
00152 }

Here is the call graph for this function:


Generated on Thu Jan 13 09:20:13 2011 for ImpalaSrc by  doxygen 1.5.1