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

template<class ColElemT>
void Impala::Application::Table::DoDiff ( String  fName1,
String  fName2 
)

Definition at line 61 of file mainTable.cpp.

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

00062 {
00063     typedef Core::Column::ColumnTem<ColElemT> ColumnType;
00064     typedef Core::Table::TableTem<ColumnType> TableType;
00065 
00066     ILOG_VAR(Impala.Application.Table.DoDiff);
00067     CmdOptions& options = CmdOptions::GetInstance();
00068     Util::Database* db = &Util::Database::GetInstance();
00069     TableType table1(0);
00070     Core::Table::Read(&table1, fName1, db);
00071     TableType table2(0);
00072     Core::Table::Read(&table2, fName2, db);
00073     if (table1.Size() != table2.Size())
00074     {
00075         ILOG_INFO("Different table sizes: " << table1.Size() << " vs "
00076                   << table2.Size());
00077         return;
00078     }
00079     int verb = options.GetInt("verb");
00080     int nDiff = 0;
00081     for (int i=0 ; i<table1.Size() ; i++)
00082     {
00083         //if (table1.Get1(i) != table2.Get1(i))
00084         if ((table1.Get1(i) - table2.Get1(i)) > 0.00001)
00085         {
00086             nDiff++;
00087             if (verb)
00088                 ILOG_INFO("diff elem " << i << ": " << table1.Get1(i)
00089                           << " vs " << table2.Get1(i));
00090         }
00091     }
00092     if (nDiff > 0)
00093         ILOG_INFO("Found " << nDiff << " differences");
00094 }

Here is the call graph for this function:


Generated on Thu Jan 13 09:16:18 2011 for ImpalaSrc by  doxygen 1.5.1