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

int Impala::Core::Table::SimilarityTableSet::Diff ( SimilarityTableSet arg,
bool  doDiffRank = false 
) const [inline]

Definition at line 387 of file SimilarityTableSet.h.

References Impala::Core::Table::TableTem< Col1T, Col2T, Col3T, Col4T, Col5T, Col6T, Col7T, Col8T, Col9T >::Get1(), GetName(), GetQuidTable(), GetRankTable(), GetSimTable(), ILOG_DEBUG, ILOG_ERROR, NrTables(), Impala::Core::Table::Table::Size(), and TableSize().

00388     {
00389         if (NrTables() != arg->NrTables())
00390         {
00391             ILOG_ERROR("Diff: NrTables differs: " << NrTables() << " vs "
00392                        << arg->NrTables());
00393             return 1;
00394         }
00395         if (TableSize() != arg->TableSize())
00396         {
00397             ILOG_ERROR("Diff: TableSize differs: " << TableSize() << " vs "
00398                        << arg->TableSize());
00399             return 1;
00400         }
00401         QuidTable* qTable1 = GetQuidTable();
00402         QuidTable* qTable2 = arg->GetQuidTable();
00403         int qDiff = 0;
00404         for (int i=0 ; i<qTable1->Size() ; i++)
00405         {
00406             if (qTable1->Get1(i) != qTable2->Get1(i))
00407             {
00408                 qDiff++;
00409                 ILOG_DEBUG("Diff: quid elem " << i << ": "
00410                            << qTable1->Get1(i) << " vs " << qTable2->Get1(i));
00411             }
00412         }
00413         if (qDiff > 0)
00414         {
00415             ILOG_ERROR("Diff: " << qDiff << " differences in quid table");
00416             return qDiff;
00417         }
00418 
00419         int totalDiff = 0;
00420         for (int t=0 ; t<NrTables() ; t++)
00421         {
00422             int nDiff = 0;
00423             SimTableType* sTable1 = GetSimTable(t);
00424             SimTableType* sTable2 = arg->GetSimTable(t);
00425             for (int i=0 ; i<sTable1->Size() ; i++)
00426             {
00427                 if (::fabs(sTable1->Get1(i) - sTable2->Get1(i)) > 0.00001)
00428                 {
00429                     nDiff++;
00430                     ILOG_DEBUG("Diff: sim table " << t << ", elem " << i <<
00431                                ": " << sTable1->Get1(i) << " vs " <<
00432                                sTable2->Get1(i));
00433                 }
00434             }
00435             if (nDiff > 0)
00436                 ILOG_ERROR("Diff: " << nDiff << " differences in sim table " <<
00437                            GetName(t));
00438             totalDiff += nDiff;
00439 
00440             if (!doDiffRank)
00441                 continue;
00442 
00443             nDiff = 0;
00444             RankTableType* rTable1 = GetRankTable(t);
00445             RankTableType* rTable2 = arg->GetRankTable(t);
00446             for (int i=0 ; i<rTable1->Size() ; i++)
00447             {
00448                 if (rTable1->Get1(i) != rTable2->Get1(i))
00449                 {
00450                     nDiff++;
00451                     ILOG_DEBUG("Diff: rank table " << t << ", elem " << i <<
00452                                ": " << rTable1->Get1(i) << " vs " <<
00453                                rTable2->Get1(i));
00454                 }
00455             }
00456             if (nDiff > 0)
00457                 ILOG_ERROR("Diff: " << nDiff << " differences in rank table " <<
00458                            GetName(t));
00459             totalDiff += nDiff;
00460         }
00461 
00462         if (totalDiff > 0)
00463             ILOG_ERROR("Diff: total of " << totalDiff << " differences");
00464         return totalDiff;
00465     }

Here is the call graph for this function:


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