Definition at line 324 of file mainTable.cpp. References Impala::Core::Table::Copy(), 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::Table::TableTem< Col1T, Col2T, Col3T, Col4T, Col5T, Col6T, Col7T, Col8T, Col9T >::GetColumn2(), Impala::Util::Database::GetInstance(), Impala::CmdOptions::GetInstance(), Impala::CmdOptions::GetNrArg(), ILOG_ERROR, ILOG_INFO, ILOG_VAR, Impala::Util::Read(), Impala::Core::Vector::Similarity(), and Impala::Core::Table::Table::Size(). Referenced by mainTable(). 00325 { 00326 typedef Core::Feature::FeatureTable FeatureTable; 00327 typedef Core::Table::SimilarityTableSet SimilarityTableSet; 00328 typedef Core::Table::SimilarityTableSet::SimTableType SimTableType; 00329 00330 ILOG_VAR(Impala.Application.Table.DoSimFeatureTable); 00331 CmdOptions& options = CmdOptions::GetInstance(); 00332 Util::Database* db = &Util::Database::GetInstance(); 00333 if (options.GetNrArg() < 4) 00334 { 00335 ILOG_ERROR("Need more arguments"); 00336 return; 00337 } 00338 String outDir = options.GetArg(1); 00339 String fName1 = options.GetArg(2); 00340 FeatureTable table1(fName1); 00341 ILOG_INFO("Reading " << fName1); 00342 Core::Table::Read(&table1, fName1, db); 00343 String fName2 = options.GetArg(3); 00344 FeatureTable table2(fName2); 00345 ILOG_INFO("Reading " << fName2); 00346 Core::Table::Read(&table2, fName2, db); 00347 00348 std::vector<String> names; 00349 for (int i=0 ; i<table1.Size() ; i++) 00350 names.push_back(QuidObj(table1.Get1(i)).ToString()); 00351 ILOG_INFO("nrNames = " << names.size()); 00352 SimilarityTableSet simSet(names, table2.Size()); 00353 String outPath = outDir + "/"; 00354 simSet.SaveNames(outPath, db); 00355 Core::Table::Copy(simSet.GetQuidTable(), &table2); // copy Quids only 00356 simSet.SaveQuids(outPath, db, true); 00357 for (int i=0 ; i<names.size() ; i++) 00358 { 00359 ILOG_INFO("i = " << i); 00360 SimTableType* simTable = simSet.GetSimTable(i); 00361 Real64* sim = simTable->GetColumn1()->GetData(); 00362 Core::Vector::Similarity(sim, table1.Get2(i), 00363 table2.GetColumn2(), 0, 1, 00364 Core::Vector::Norm1Dist<Real64>); 00365 simTable->SetSize(table2.Size()); 00366 ILOG_INFO(" compute rank"); 00367 simSet.ComputeRank(i, false); 00368 simSet.Save(i, outPath, db, true); 00369 } 00370 }
Here is the call graph for this function: ![]()
|