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

void Impala::Application::Table::DoDiffAnnotationTable (  ) 

Definition at line 850 of file mainTable.cpp.

References Impala::CmdOptions::GetArg(), Impala::CmdOptions::GetBool(), Impala::Util::Database::GetInstance(), Impala::CmdOptions::GetInstance(), Impala::CmdOptions::GetInt(), ILOG_INFO, ILOG_VAR, and Impala::Core::Table::Read().

Referenced by mainTable().

00851 {
00852     typedef Core::Table::AnnotationTable AnnotationTable;
00853 
00854     ILOG_VAR(Impala.Application.Table.DoDiffAnnotationTable);
00855     CmdOptions& options = CmdOptions::GetInstance();
00856     Util::Database* db = &Util::Database::GetInstance();
00857     String fName1 = options.GetArg(1);
00858     AnnotationTable table1;
00859     Core::Table::Read(&table1, fName1, db);
00860     String fName2 = options.GetArg(2);
00861     AnnotationTable table2;
00862     Core::Table::Read(&table2, fName2, db);
00863     if (table1.Size() != table2.Size())
00864     {
00865         ILOG_INFO("Different table sizes: " << table1.Size() << " vs "
00866                   << table2.Size());
00867         return;
00868     }
00869     int verb = options.GetInt("verb");
00870     int bOrder = options.GetBool("order", false); 
00871     if (bOrder)
00872     {
00873         table1.UpdateQuidMap();
00874         table2.UpdateQuidMap();
00875         ILOG_INFO("Resorting annotation tables before comparsion");
00876     }
00877     int nDiff = 0;
00878     for (int i=0 ; i<table1.Size() ; i++)
00879     {
00880         if (table1.Get1(i) != table2.Get1(i))
00881         {
00882             nDiff++;
00883             if (verb)
00884                 ILOG_INFO("diff elem " << i << ": " << table1.Get1(i)
00885                           << " vs " << table2.Get1(i));
00886         }
00887         if (table1.Get2(i) != table2.Get2(i))
00888         {
00889             nDiff++;
00890             if (verb)
00891                 ILOG_INFO("diff elem " << i << ": " << table1.Get2(i)
00892                           << " vs " << table2.Get2(i));
00893         }
00894     }
00895     if (nDiff > 0)
00896         ILOG_INFO("Found " << nDiff << " differences");
00897 }

Here is the call graph for this function:


Generated on Fri Mar 19 10:51:04 2010 for ImpalaSrc by  doxygen 1.5.1