Definition at line 377 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(). 00378 { 00379 if (NrTables() != arg->NrTables()) 00380 { 00381 ILOG_ERROR("Diff: NrTables differs: " << NrTables() << " vs " 00382 << arg->NrTables()); 00383 return 1; 00384 } 00385 if (TableSize() != arg->TableSize()) 00386 { 00387 ILOG_ERROR("Diff: TableSize differs: " << TableSize() << " vs " 00388 << arg->TableSize()); 00389 return 1; 00390 } 00391 QuidTable* qTable1 = GetQuidTable(); 00392 QuidTable* qTable2 = arg->GetQuidTable(); 00393 int qDiff = 0; 00394 for (int i=0 ; i<qTable1->Size() ; i++) 00395 { 00396 if (qTable1->Get1(i) != qTable2->Get1(i)) 00397 { 00398 qDiff++; 00399 ILOG_DEBUG("Diff: quid elem " << i << ": " 00400 << qTable1->Get1(i) << " vs " << qTable2->Get1(i)); 00401 } 00402 } 00403 if (qDiff > 0) 00404 { 00405 ILOG_ERROR("Diff: " << qDiff << " differences in quid table"); 00406 return qDiff; 00407 } 00408 00409 int totalDiff = 0; 00410 for (int t=0 ; t<NrTables() ; t++) 00411 { 00412 int nDiff = 0; 00413 SimTableType* sTable1 = GetSimTable(t); 00414 SimTableType* sTable2 = arg->GetSimTable(t); 00415 for (int i=0 ; i<sTable1->Size() ; i++) 00416 { 00417 if (::fabs(sTable1->Get1(i) - sTable2->Get1(i)) > 0.00001) 00418 { 00419 nDiff++; 00420 ILOG_DEBUG("Diff: sim table " << t << ", elem " << i << 00421 ": " << sTable1->Get1(i) << " vs " << 00422 sTable2->Get1(i)); 00423 } 00424 } 00425 if (nDiff > 0) 00426 ILOG_ERROR("Diff: " << nDiff << " differences in sim table " << 00427 GetName(t)); 00428 totalDiff += nDiff; 00429 00430 if (!doDiffRank) 00431 continue; 00432 00433 nDiff = 0; 00434 RankTableType* rTable1 = GetRankTable(t); 00435 RankTableType* rTable2 = arg->GetRankTable(t); 00436 for (int i=0 ; i<rTable1->Size() ; i++) 00437 { 00438 if (rTable1->Get1(i) != rTable2->Get1(i)) 00439 { 00440 nDiff++; 00441 ILOG_DEBUG("Diff: rank table " << t << ", elem " << i << 00442 ": " << rTable1->Get1(i) << " vs " << 00443 rTable2->Get1(i)); 00444 } 00445 } 00446 if (nDiff > 0) 00447 ILOG_ERROR("Diff: " << nDiff << " differences in rank table " << 00448 GetName(t)); 00449 totalDiff += nDiff; 00450 } 00451 00452 if (totalDiff > 0) 00453 ILOG_ERROR("Diff: total of " << totalDiff << " differences"); 00454 return totalDiff; 00455 }
Here is the call graph for this function:
|