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

int Impala::Core::Matrix::VirtualMatrix::Diff ( VirtualMatrix arg  )  [inline]

Definition at line 192 of file VirtualMatrix.h.

References GetRow(), ILOG_DEBUG, ILOG_ERROR, NrCol(), and NrRow().

Referenced by Impala::Core::Training::KernelMatrix::Diff().

00193     {
00194         if (NrRow() != arg->NrRow())
00195         {
00196             ILOG_ERROR("[Diff] NrRow differs: " << NrRow() << " vs " <<
00197                        arg->NrRow());
00198             return 1;
00199         }
00200         if (NrCol() != arg->NrCol())
00201         {
00202             ILOG_ERROR("[Diff] NrCol differs: " << NrCol() << " vs " <<
00203                        arg->NrCol());
00204             return 1;
00205         }
00206         int nDiff = 0;
00207         Real64* row = new Real64[NrCol()];
00208         Real64* rowArg = new Real64[NrCol()];
00209         for (int i=0 ; i<NrRow() ; i++)
00210         {
00211             GetRow(i, row, NrCol());
00212             arg->GetRow(i, rowArg, NrCol());
00213             for (int j=0 ; j<NrCol() ; j++)
00214             {
00215                 if (fabs(row[j] - rowArg[j]) > 0.00001)
00216                 {
00217                     ILOG_DEBUG("elem " << i << "," << j << " differs: "
00218                                << row[j] << " vs " << rowArg[j]);
00219                     nDiff++;
00220                 }
00221             }
00222         }
00223         delete row;
00224         delete rowArg;
00225         if (nDiff > 0)
00226             ILOG_ERROR("Found " << nDiff << " differences");
00227         return nDiff;
00228     }

Here is the call graph for this function:


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