Definition at line 1030 of file mainTable.cpp. References Impala::Core::Table::TableTem< Col1T, Col2T, Col3T, Col4T, Col5T, Col6T, Col7T, Col8T, Col9T >::Get1(), Impala::CmdOptions::GetArg(), Impala::Util::Database::GetInstance(), Impala::CmdOptions::GetInstance(), Impala::CmdOptions::GetInt(), ILOG_INFO, ILOG_VAR, Impala::Core::Table::SimilarityTableSet::MakeFromFile(), and Impala::Core::Table::Table::Size(). Referenced by mainTable(). 01031 { 01032 typedef Core::Table::SimilarityTableSet SimilarityTableSet; 01033 typedef Core::Table::SimilarityTableSet::SimTableType SimTableType; 01034 typedef Core::Table::SimilarityTableSet::RankTableType RankTableType; 01035 01036 ILOG_VAR(Impala.Application.Table.DoDiffSimilarityTableSet); 01037 CmdOptions& options = CmdOptions::GetInstance(); 01038 Util::Database* db = &Util::Database::GetInstance(); 01039 String fName1 = options.GetArg(1); 01040 SimilarityTableSet* simSet1 = 01041 Core::Table::SimilarityTableSet::MakeFromFile(fName1, db); 01042 String fName2 = options.GetArg(2); 01043 SimilarityTableSet* simSet2 = 01044 Core::Table::SimilarityTableSet::MakeFromFile(fName2, db); 01045 if (simSet1->NrTables() != simSet2->NrTables()) 01046 { 01047 ILOG_INFO("Different nr tables: " << simSet1->NrTables() << " vs " 01048 << simSet2->NrTables()); 01049 return; 01050 } 01051 if (simSet1->TableSize() != simSet2->TableSize()) 01052 { 01053 ILOG_INFO("Different table size: " << simSet1->TableSize() 01054 << " vs " << simSet2->TableSize()); 01055 return; 01056 } 01057 int verb = options.GetInt("verb"); 01058 int nTableDiff = 0; 01059 Core::Table::QuidTable* qTable1 = simSet1->GetQuidTable(); 01060 Core::Table::QuidTable* qTable2 = simSet2->GetQuidTable(); 01061 int qDiff = 0; 01062 for (int i=0 ; i<qTable1->Size() ; i++) 01063 { 01064 if (qTable1->Get1(i) != qTable2->Get1(i)) 01065 { 01066 qDiff++; 01067 if (verb) 01068 ILOG_INFO("quid table diff elem " << i << ": " 01069 << qTable1->Get1(i) << " vs " << qTable2->Get1(i)); 01070 } 01071 } 01072 if (qDiff > 0) 01073 ILOG_INFO("Found " << qDiff << " differences in quid table"); 01074 for (int t=0 ; t<simSet1->NrTables() ; t++) 01075 { 01076 int nDiff = 0; 01077 SimTableType* sTable1 = simSet1->GetSimTable(t); 01078 SimTableType* sTable2 = simSet2->GetSimTable(t); 01079 for (int i=0 ; i<sTable1->Size() ; i++) 01080 { 01081 if (::fabs(sTable1->Get1(i) - sTable2->Get1(i)) > 0.00001) 01082 { 01083 nDiff++; 01084 if (verb) 01085 ILOG_INFO("sim table " << t << ", diff elem " << i << ": " 01086 << sTable1->Get1(i) << " vs " << sTable2->Get1(i)); 01087 } 01088 } 01089 if (nDiff > 0) 01090 ILOG_INFO("Found " << nDiff << " differences in sim table " << 01091 simSet1->GetName(t)); 01092 01093 nDiff = 0; 01094 RankTableType* rTable1 = simSet1->GetRankTable(t); 01095 RankTableType* rTable2 = simSet2->GetRankTable(t); 01096 for (int i=0 ; i<rTable1->Size() ; i++) 01097 { 01098 if (rTable1->Get1(i) != rTable2->Get1(i)) 01099 { 01100 nDiff++; 01101 if (verb) 01102 ILOG_INFO("rank table " << t << ", diff elem " << i << ": " 01103 << rTable1->Get1(i) << " vs " << rTable2->Get1(i)); 01104 } 01105 } 01106 if (nDiff > 0) 01107 ILOG_INFO("Found " << nDiff << " differences in rank table " << 01108 simSet1->GetName(t)); 01109 } 01110 }
Here is the call graph for this function:
|