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

template<class T>
void Impala::Core::Table::DumpSimilarityAndTruthData ( FILE *  fp,
T *  rank,
Core::Table::SimilarityTableSet::SimTableType *  sim,
AnnotationTable *  groundTruth,
Core::Table::QuidTable *  qTable,
int  topN = -1 
)

Definition at line 226 of file AveragePrecisionSpeedup.h.

References Impala::Core::Table::TableTem< Col1T, Col2T, Col3T, Col4T, Col5T, Col6T, Col7T, Col8T, Col9T >::Capacity(), Impala::Core::Column::Find(), 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 >::GetColumn1(), ILOG_VAR, Impala::Core::Table::AnnotationTable::IsNegative(), and Impala::Core::Table::AnnotationTable::IsPositive().

00230 {
00231     ILOG_VAR(Impala.Core.Table.DumpSimilarityAndTruthData);
00232     //Real64 ap = 0;
00233 
00234     //int totalPositive = groundTruth->GetNrPositive();
00235     //if ( 0 == totalPositive)
00236     //    return -1;
00237 
00238     int positiveCount = 0;
00239     if (topN == -1)
00240         topN = rank->Size();
00241 
00242     int size = qTable->Capacity();
00243 
00244     //T* rank = simSet->GetRankTable(index);
00245 
00246     for (int i=0 ; i<topN ; i++)
00247     {
00248         Quid q = rank->Get1(i);
00249         //std::cout << QuidObj(q) << std::endl;
00250 
00251         // Note: groundTruth maybe have different size with rank table.
00252         //int curPos111 = groundTruth->GetIndex(q);
00253 
00254         //int curPos = Core::Table::SimilarityTableSet::FindQuid(q);
00255         int curPos = Column::Find(qTable->GetColumn1(), q);
00256 
00257         if (curPos == size)
00258         {
00259             // if returned index is equal to table size, it mean that quid is not found.
00260             std::cout << "Can NOT find the Quid: " << QuidObj(q) << std::endl;
00261             continue;
00262         }
00263 
00264         double prob = sim->Get1(curPos);
00265         
00266         if (groundTruth->IsPositive(q))
00267         {
00268             //fprintf(fp,"%d\t%d\n", i, 1);
00269             fprintf(fp,"%.17f\t%d\n", prob, 1);
00270         }
00271         else if (groundTruth->IsNegative(q))
00272         {
00273             //fprintf(fp,"%d\t%d\n", i, 0);
00274             fprintf(fp,"%.17f\t%d\n", prob, 0);
00275         }
00276         else
00277         {
00278             //skipped shots are ignored.
00279         }
00280     }
00281 
00282     int x = 0;
00283 }

Here is the call graph for this function:


Generated on Fri Mar 19 11:19:17 2010 for ImpalaSrc by  doxygen 1.5.1