Definition at line 624 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::Core::Table::Read(), Impala::Core::Vector::Similarity(), and Impala::Core::Table::Table::Size(). Referenced by mainTable(). 00625 { 00626 typedef Core::Feature::FeatureTable FeatureTable; 00627 typedef Core::Table::SimilarityTableSet SimilarityTableSet; 00628 typedef Core::Table::SimilarityTableSet::SimTableType SimTableType; 00629 00630 ILOG_VAR(Impala.Application.Table.DoSimFeatureTable); 00631 CmdOptions& options = CmdOptions::GetInstance(); 00632 Util::Database* db = &Util::Database::GetInstance(); 00633 if (options.GetNrArg() < 4) 00634 { 00635 ILOG_ERROR("Need more arguments"); 00636 return; 00637 } 00638 String outDir = options.GetArg(1); 00639 String fName1 = options.GetArg(2); 00640 FeatureTable table1(fName1); 00641 ILOG_INFO("Reading " << fName1); 00642 Core::Table::Read(&table1, fName1, db); 00643 String fName2 = options.GetArg(3); 00644 FeatureTable table2(fName2); 00645 ILOG_INFO("Reading " << fName2); 00646 Core::Table::Read(&table2, fName2, db); 00647 00648 std::vector<String> names; 00649 for (int i=0 ; i<table1.Size() ; i++) 00650 names.push_back(QuidObj(table1.Get1(i)).ToString()); 00651 ILOG_INFO("nrNames = " << names.size()); 00652 SimilarityTableSet simSet(names, table2.Size()); 00653 String outPath = outDir + "/"; 00654 simSet.SaveNames(outPath, db); 00655 Core::Table::Copy(simSet.GetQuidTable(), &table2); // copy Quids only 00656 simSet.SaveQuids(outPath, db, true); 00657 for (int i=0 ; i<names.size() ; i++) 00658 { 00659 ILOG_INFO("i = " << i); 00660 SimTableType* simTable = simSet.GetSimTable(i); 00661 Real64* sim = simTable->GetColumn1()->GetData(); 00662 Core::Vector::Similarity(sim, table1.Get2(i), 00663 table2.GetColumn2(), 0, 1, 00664 Core::Vector::Norm1Dist<Real64>); 00665 simTable->SetSize(table2.Size()); 00666 ILOG_INFO(" compute rank"); 00667 simSet.ComputeRank(i, false); 00668 simSet.Save(i, outPath, db, true); 00669 } 00670 }
Here is the call graph for this function:
|