本文整理汇总了C++中VectorKKStr::push_back方法的典型用法代码示例。如果您正苦于以下问题:C++ VectorKKStr::push_back方法的具体用法?C++ VectorKKStr::push_back怎么用?C++ VectorKKStr::push_back使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VectorKKStr
的用法示例。
在下文中一共展示了VectorKKStr::push_back方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: cmdLine
CmdLineExpander::CmdLineExpander (const KKStr& _applicationName,
RunLog& _log,
const KKStr& _cmdLine
):
applicationName (_applicationName),
log (_log)
{
VectorKKStr initialParameters;
KKStr cmdLine (_cmdLine);
cmdLine.TrimLeft ();
while (!cmdLine.Empty ())
{
KKStr nextField = cmdLine.ExtractQuotedStr ("\n\r\t ", false); // false = Do not decode escape characters
nextField.TrimRight ();
if (!nextField.Empty ())
initialParameters.push_back (nextField);
cmdLine.TrimLeft ();
}
BuildCmdLineParameters (initialParameters);
BuildExpandedParameterPairs ();
}
示例2: ExtractParametersFromFile
void CmdLineExpander::ExtractParametersFromFile (const KKStr& cmdFileName,
VectorKKStr& cmdFileParameters,
bool& validFile
)
{
FILE* in = osFOPEN (cmdFileName.Str (), "r");
if (!in)
{
log.Level (-1) << endl << endl << endl
<< "ExtractParametersFromFile *** EROR ***" << endl
<< endl
<< " Invalid CmdFile[" << cmdFileName << "]" << endl
<< endl;
validFile = false;
return;
}
KKStr token;
bool eof = false;
token = osReadNextQuotedStr (in, " \n\r", eof);
while (!eof)
{
cmdFileParameters.push_back (token);
token = osReadNextQuotedStr (in, " \n\r", eof);
}
std::fclose (in);
} /* ExtractParametersFromFile */
示例3: ExpandCmdLine
void CmdLineExpander::ExpandCmdLine (kkint32 argc,
char** argv
)
{
parmsGood = true;
VectorKKStr initialParameters;
{
kkint32 y;
for (y = 1; y < argc; y++)
initialParameters.push_back (argv[y]);
}
BuildCmdLineParameters (initialParameters);
BuildExpandedParameterPairs ();
return;
} /* ExpandCmdLine */
示例4: RegisteredDriverNames
VectorKKStr FeatureFileIO::RegisteredDriverNames (bool canRead,
bool canWrite
)
{
vector<FeatureFileIOPtr>* drivers = RegisteredDrivers ();
VectorKKStr names;
vector<FeatureFileIOPtr>::iterator idx;
for (idx = drivers->begin (); idx != drivers->end (); idx++)
{
FeatureFileIOPtr driver = *idx;
if (canRead && (!driver->CanRead ()))
continue;
if (canWrite && (!driver->CanWrite ()))
continue;
names.push_back (driver->DriverName ());
}
return names;
} /* RegisteredDriverNames */
示例5: Test
void Test ()
{
RunLog log;
DataBasePtr dbConn = new DataBase (log);
// InstrumentDataPtr id = dbConn->InstrumentDataGetByScanLine ("TestCruise_01", 4022);
//{
// ImageFeaturesPtr fv = NULL;
// KKStr imageFileName = "TestCruise_01_00006156_3701";
// DataBaseImagePtr dbi = dbConn->ImageLoad (imageFileName);
// if (dbi)
// fv = dbConn->FeatureDataRecLoad (dbi);
// delete fv;
// delete dbi;
//}
{
SipperCruiseListPtr cruises = dbConn->SipperCruiseLoadAllCruises ();
delete cruises;
}
bool cancelFlag = false;
{
DataBaseImageGroupPtr existingGroup = dbConn->ImageGroupLoad ("TestGroup2");
if (existingGroup)
{
VectorUint* depthStats = dbConn->ImageGetDepthStatistics
(existingGroup,
"", // sipperFileName
10.0f, // depthIncrements,
NULL, // mlClass,
'P', // 'p' = Use Predicted Class
0.0f, 1.0f, // minProb, maxProb,
0, 0 // minSize, maxSize
);
delete depthStats;
depthStats = NULL;
ClassStatisticListPtr stats = dbConn->ImageGetClassStatistics
(existingGroup,
"ETP2008_8A_06",
NULL,
'P', // 'P' = Use Predicted Class
0.0f, 1.0f, // MinProb, MaxProb
0, 0, // MinSize, MaxSize
0.0f, 0.0f // MinDepth, MaxDepth
);
delete stats;
stats = NULL;
}
DataBaseImageListPtr images = dbConn->ImagesQuery (existingGroup, true, cancelFlag);
}
DataBaseImageGroupPtr g = new DataBaseImageGroup (-1, "TestGroup2", "Description of group", 0);
dbConn->ImageGroupInsert (*g);
if (dbConn->DuplicateKey ())
{
DataBaseImageGroupPtr existingGroup = dbConn->ImageGroupLoad (g->Name ());
if (existingGroup)
{
g->ImageGroupId (existingGroup->ImageGroupId ());
dbConn->ImageGroupDelete (existingGroup->ImageGroupId ());
dbConn->ImageGroupInsert (*g);
delete existingGroup;
existingGroup = NULL;
}
}
DataBaseImageListPtr images = dbConn->ImagesQuery (NULL,
"ETP2008", "8", "A", NULL,
'P', // 'P' = Use Predicted Class
0.0f, 1.0f, // MinProb, MaxProb
0, 0, // MinSize, MaxSize
290.0f, 293.0f, // MinDepth, MaxDepth
0, // Restart Image
-1, // unlimited Limit
true, // true=Include ThumbNail
cancelFlag
);
VectorKKStr fileNames;
{
DataBaseImageList::iterator idx;
for (idx = images->begin (); idx != images->end (); idx++)
fileNames.push_back ((*idx)->ImageFileName ());
//.........这里部分代码省略.........
示例6: GenerateFinalResultsReport
//.........这里部分代码省略.........
// Known Counts
for (idx = Jobs ()->begin (); idx != Jobs ()->end (); idx++)
{
RandomSplitJobPtr j = dynamic_cast<RandomSplitJobPtr> (*idx);
if (j->RandomSplitsResults () != NULL)
{
KKStr splitNumStr = StrFormatInt (j->SplitNum (), "ZZZ0");
j->GetClassCounts (classAccs, knownCounts, predCounts, adjCounts, adjCountsStdError, predDelta, adjDelta);
totalCM.AddIn (*(j->RandomSplitsResults ()), log);
totalCmCount++;
KKStr accLine = "Acc By Class\t" + splitNumStr;
KKStr knownLine = "Known\t" + splitNumStr;
KKStr predLine = "Predicted\t" + splitNumStr;
KKStr adjLine = "Adjusted\t" + splitNumStr;
KKStr deltaPredLine = "Delta Pred\t" + splitNumStr;
KKStr deltaAdjLine = "Delta Adj\t" + splitNumStr;
double totalAcc = 0.0;
double totalDeltaPred = 0.0;
double totalDeltaAdj = 0.0;
for (x = 0; x < numClasses; x++)
{
accLine << "\t" << StrFormatDouble (classAccs [x], "zz0.00") << "%";
knownLine << "\t" << StrFormatDouble (knownCounts [x], "-Z,ZZZ,ZZ0.0");
predLine << "\t" << StrFormatDouble (predCounts [x], "-Z,ZZZ,ZZ0.0");
adjLine << "\t" << StrFormatDouble (adjCounts [x], "-Z,ZZZ,ZZ0.0");
deltaPredLine << "\t" << StrFormatDouble (predDelta [x], "-Z,ZZZ,ZZ0.0");
deltaAdjLine << "\t" << StrFormatDouble (adjDelta [x], "-Z,ZZZ,ZZ0.0");
totalAcc += classAccs [x];
totalDeltaPred += fabs (predDelta[x]);
totalDeltaAdj += fabs (adjDelta[x]);
}
accLine << "\t" << StrFormatDouble ((totalAcc / (double)classAccs.size ()), "ZZ0.00") << "%";
deltaPredLine << "\t" << StrFormatDouble ((totalDeltaPred / (double)predDelta.size ()), "ZZ0.00");
deltaAdjLine << "\t" << StrFormatDouble ((totalDeltaAdj / (double)adjDelta.size ()), "ZZ0.00");
accLines.push_back (accLine);
knownCountLines.push_back (knownLine);
predCountLines.push_back (predLine);
adjCountLines.push_back (adjLine);
deltaPredCountLines.push_back (deltaPredLine);
deltaAdjCountLines.push_back (deltaAdjLine);
}
}
double factor = 0.0;
if (totalCmCount > 0)
factor = 1.0 / (double)totalCmCount;
totalCM.FactorCounts (factor);
f << endl << endl
<< "Average Confusion Matrix" << endl
<< endl;
totalCM.PrintConfusionMatrixTabDelimited (f);
f << "" << "\t" << "" << "\t" << l1 << endl
<< "" << "\t" << "Split" << "\t" << l2 << endl
<< "Description" << "\t" << "Num" << "\t" << l3 << endl;
f << endl << endl;
for (x = 0; x < knownCountLines.size (); x++)
f << knownCountLines[x] << endl;
f << endl << endl;
for (x = 0; x < predCountLines.size (); x++)
f << predCountLines[x] << endl;
f << endl << endl;
for (x = 0; x < adjCountLines.size (); x++)
f << adjCountLines[x] << endl;
f << endl << endl;
for (x = 0; x < deltaPredCountLines.size (); x++)
f << deltaPredCountLines[x] << endl;
f << endl << endl;
for (x = 0; x < deltaAdjCountLines.size (); x++)
f << deltaAdjCountLines[x] << endl;
f << endl << endl;
for (x = 0; x < knownCountLines.size (); x++)
f << accLines[x] << endl;
VectorFloat avgAccuracies = totalCM.AccuracyByClass ();
f << "Avg-Accuracies";
for (x = 0; x < avgAccuracies.size (); x++)
f << "\t" << StrFormatDouble (avgAccuracies[x], "zz0.00") << "%";
f << "\t" << StrFormatDouble (totalCM.Accuracy (), "zz0.00") << "%";
f << endl;
f << endl << endl;
f.close ();
} /* GenerateFinalResultsReport */
示例7: classSummaries
//.........这里部分代码省略.........
randomReport,
log
);
randomizeLocations.GenerateReport ();
randomMeanNND = randomizeLocations.NND_Mean ();
randomStdDevNND = randomizeLocations.NND_StdDev ();
realDataU2Stat = randomizeLocations.RealDataU2Stat ();
//double sampleMeanNND = 0.0f;
//double sampleStdDevNND = 0.0f;
double z_Score = Z_Score (sampleMeanNND, randomMeanNND, randomStdDevNND, imagesToRandomize->QueueSize ());
randomReport << endl << endl << endl
<< "Z-Score" << endl
<< "=======" << endl
<< endl
<< "SampleMeanNND " << "\t" << sampleMeanNND << endl
<< "SampleStdDevNND " << "\t" << sampleStdDevNND << endl
<< "RandomMeanNND " << "\t" << randomMeanNND << endl
<< "RandomStdDevNND " << "\t" << randomStdDevNND << endl
<< "------- Z-Score " << "\t" << z_Score << endl
<< endl;
KKStr zScoreSummaryLine = mlClass->Name () + "\t" +
StrFormatDouble (sampleMeanNND, "###,##0.00") + "\t" +
StrFormatDouble (sampleStdDevNND, "###,##0.00") + "\t" +
StrFormatDouble (randomMeanNND, "###,##0.00") + "\t" +
StrFormatDouble (randomStdDevNND, "###,##0.00") + "\t" +
StrFormatDouble (z_Score, "###,##0.000");
zScoreSummaryLines.push_back (zScoreSummaryLine);
// The new instance on 'ClassSummary' that is aboiut to be created will take ownership
// of lloydsBins.
classSummaries.PushOnBack (new ClassSummary (mlClass, lloydsEntries, (float)realDataU2Stat, (float)z_Score));
delete imagesToRandomize; imagesToRandomize = NULL;
}
delete imagesInClass; imagesInClass = NULL;
}
if (!fromPlankton)
{
LLoydsEntryListPtr allClassesLLoydsEntries = DeriveAllLLoydsBins (images);
// Create a report for all classes
KKStr randomReportFileName;
if (reportFileName.Empty ())
randomReportFileName = "RandomDistanceReport_All.txt";
else
randomReportFileName = osRemoveExtension (reportFileName) + "_Random_All.txt";
ofstream randomReport (randomReportFileName.Str ());
randomReport << "Source Directory [" << sourceRootDirPath << "]" << endl;
randomReport << "Class [" << "All" << "]" << endl;
{
// Find the mean and stddev of Nearest Neighbor regardless of class.
NeighborList allClassesNeighbors (images, log);
allClassesNeighbors.FindNearestNeighbors (NeighborType::AnyPlankton, fromPlankton);