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

void Impala::Application::Util::DoDumpParameter (  ) 

Definition at line 753 of file mainUtil.cpp.

References Impala::Util::DatabaseReadStrings(), Impala::Util::StringParser::Eat(), Impala::CmdOptions::GetArg(), Impala::Util::StringParser::GetDouble(), Impala::CmdOptions::GetInstance(), Impala::Util::Database::GetIOBuffer(), Impala::CmdOptions::GetNrArg(), ILOG_ERROR, ILOG_INFO, ILOG_VAR, Impala::Core::Database::MakeRawDataSet(), and Impala::Util::IOBuffer::ReadLine().

Referenced by mainUtil().

00754 {
00755 #ifndef REPOSITORY_TODO
00756     typedef Core::Database::RawDataSet RawDataSet;
00757     typedef Core::Feature::FeatureDefinition FeatureDef;
00758 
00759     ILOG_VAR(Impala.Application.Util.DoDumpParameter);
00760     CmdOptions& options = CmdOptions::GetInstance();
00761     if (options.GetNrArg() < 5)
00762     {
00763         ILOG_ERROR("Need more parameters");
00764         return;
00765     }
00766     String dataSetName = options.GetArg(1);
00767     String conceptSet = options.GetArg(2);
00768     String model = options.GetArg(3);
00769     FeatureDef featureDef(options.GetArg(4));
00770 
00771     RawDataSet* dataSet = Core::Database::MakeRawDataSet(dataSetName);
00772 
00773     String fName = dataSet->GetFilePathAnnotation(conceptSet, false, false);
00774     if (fName.empty())
00775     {
00776         ILOG_ERROR("unable to read conceptSet " << conceptSet);
00777         return;
00778     }
00779     std::vector<String> concepts;
00780     Impala::Util::Database* db = dataSet->GetDatabase();
00781     Impala::Util::DatabaseReadStrings(concepts, fName, db);
00782     Real64 map = 0;
00783     int nrMap = 0;
00784     std::cout << conceptSet << "  " << model << "  " << featureDef.AsString()
00785               << std::endl;
00786     for (int c=0 ; c<concepts.size() ; c++)
00787     {
00788         String con = concepts[c];
00789         fName = dataSet->GetFilePathConceptModel(conceptSet, model, featureDef,
00790                                                  con + ".best", false, false);
00791         if (fName.empty())
00792         {
00793             ILOG_INFO("no .best found for " << con);
00794             continue;
00795         }
00796         Impala::Util::IOBuffer* ioBuf = db->GetIOBuffer(fName, true, false, "");
00797         String buffer = ioBuf->ReadLine();
00798         Impala::Util::StringParser p(buffer);
00799         p.Eat(':');
00800         Real64 ap = p.GetDouble();
00801         std::cout << con << " " << ap << std::endl;
00802         map += ap;
00803         nrMap++;
00804     }
00805     std::cout << "map = " << map / nrMap << std::endl << std::endl;
00806 #endif
00807 }

Here is the call graph for this function:


Generated on Fri Mar 19 10:52:08 2010 for ImpalaSrc by  doxygen 1.5.1