Definition at line 572 of file mainTable.cpp. References Impala::Core::Table::TableTem< Col1T, Col2T, Col3T, Col4T, Col5T, Col6T, Col7T, Col8T, Col9T >::Get1(), Impala::Core::Table::TableTem< Col1T, Col2T, Col3T, Col4T, Col5T, Col6T, Col7T, Col8T, Col9T >::Get2(), Impala::CmdOptions::GetArg(), Impala::Core::Feature::FeatureTable::GetFeatureVectorLength(), Impala::Util::Database::GetInstance(), Impala::CmdOptions::GetInstance(), Impala::CmdOptions::GetInt(), ILOG_INFO, ILOG_VAR, Impala::IsNan(), Impala::Core::Vector::Norm1Dist(), Impala::Core::Table::Read(), and Impala::Core::Table::Table::Size(). Referenced by mainTable(). 00573 { 00574 typedef Core::Feature::FeatureTable FeatureTable; 00575 00576 ILOG_VAR(Impala.Application.Table.DoDiffFeatureTable); 00577 CmdOptions& options = CmdOptions::GetInstance(); 00578 Util::Database* db = &Util::Database::GetInstance(); 00579 String fName1 = options.GetArg(1); 00580 FeatureTable table1(fName1); 00581 Core::Table::Read(&table1, fName1, db); 00582 String fName2 = options.GetArg(2); 00583 FeatureTable table2(fName2); 00584 Core::Table::Read(&table2, fName2, db); 00585 if (table1.Size() != table2.Size()) 00586 { 00587 ILOG_INFO("Different table sizes: " << table1.Size() << " vs " 00588 << table2.Size()); 00589 return; 00590 } 00591 if (table1.GetFeatureVectorLength() != table2.GetFeatureVectorLength()) 00592 { 00593 ILOG_INFO("Different vector length: " << table1.GetFeatureVectorLength() 00594 << " vs " << table2.GetFeatureVectorLength()); 00595 return; 00596 } 00597 int verb = options.GetInt("verb"); 00598 int nDiff = 0; 00599 for (int i=0 ; i<table1.Size() ; i++) 00600 { 00601 if (table1.Get1(i) != table2.Get1(i)) 00602 { 00603 nDiff++; 00604 if (verb) 00605 ILOG_INFO("diff elem " << i << ": " << table1.Get1(i) 00606 << " vs " << table2.Get1(i)); 00607 } 00608 FeatureTable::VectorReal64 v1(table1.Get2(i)); 00609 FeatureTable::VectorReal64 v2(table2.Get2(i)); 00610 Real64 dist = Core::Vector::Norm1Dist(v1, v2); 00611 if (IsNan(dist) || (dist > 0.00001)) 00612 { 00613 nDiff++; 00614 if (verb) 00615 ILOG_INFO("diff elem " << i << ": " << table1.Get2(i) 00616 << " vs " << table2.Get2(i)); 00617 } 00618 } 00619 if (nDiff > 0) 00620 ILOG_INFO("Found " << nDiff << " differences"); 00621 }
Here is the call graph for this function:
|