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

void Impala::Core::Table::SimilarityTableSet::DumpRankingSorted ( Database::RawDataSet set,
Impala::String  OutPath,
int  from = 0,
int  to = -1 
) [inline]

Definition at line 666 of file SimilarityTableSet.h.

References FindQuid(), Impala::Core::Table::TableTem< Col1T, Col2T, Col3T, Col4T, Col5T, Col6T, Col7T, Col8T, Col9T >::Get1(), GetDescription(), GetName(), GetRankTable(), GetSimTable(), ILOG_ERROR, mQuids, NrTables(), Impala::Core::Database::RawDataSet::QuidToString(), Impala::Core::Table::Table::Size(), and TableSize().

00667     {
00668         if (to == -1 || to > TableSize())
00669             to = TableSize();
00670         if (to < from)
00671             to = from;
00672         std::cout << "SimilarityTableSet " << GetDescription() << std::endl;
00673         for (int t=0 ; t<NrTables() ; t++)
00674         {
00675             SimTableType* simTable = GetSimTable(t);
00676             RankTableType* rankTable = GetRankTable(t);
00677             //std::cout << "table " << t << ", name = " << GetName(t) << std::endl;
00678             if (simTable->Size() != mQuids->Size())
00679             {
00680                 ILOG_ERROR("DumpRanking: simtable size doesn't match");
00681                 continue;
00682             }
00683             if (rankTable->Size() != mQuids->Size())
00684             {
00685                 ILOG_ERROR("DumpRanking: ranktable size doesn't match");
00686                 continue;
00687             }
00688 
00689             String ListName = OutPath + GetName(t) + ".txt";
00690             FILE* fp = fopen(ListName.c_str(), "wt");
00691             //std::cout << "rank, i(position), Quid, similarity" << std::endl;
00692             fprintf(fp,"1=rank, 2=position(i), 3=Quid, 4=similarity\n");
00693             for (int i=from ; i<to ; i++)
00694             {
00695                 //Quid quid = mQuids->Get1(i);
00696                 Quid quid = rankTable->Get1(i);
00697                 int rank = FindQuid(quid);
00698                 
00699                 //std::cout << rank << ", ";
00700                 String QuidStr;
00701                 if (set && (quid != 0))
00702                     QuidStr = set->QuidToString(quid, true);
00703                 else
00704                     QuidStr = QuidObj(quid).ToString();
00705                 //std::cout << QuidStr << ", ";
00706 
00707                 Real64 sim = simTable->Get1(rank);
00708                 fprintf(fp,"%d\t%d\t%s\t%f\n",i, rank, QuidStr.c_str(), sim);
00709 
00710                 //std::cout << simTable->Get1(rank) << ", ";
00712                 //std::cout << i << ", ";
00714                 //if ((rank >= 0) && (rank < simTable->Size()))
00715                 //    std::cout << simTable->Get1(rank) << std::endl;
00716                 //else
00717                 //    std::cout << "<no sim>" << std::endl;
00718             }
00719             fclose(fp);
00720             //std::cout << std::endl;
00721         }
00722     }

Here is the call graph for this function:


Generated on Thu Jan 13 09:20:53 2011 for ImpalaSrc by  doxygen 1.5.1