本文整理汇总了C++中ParameterMap::value方法的典型用法代码示例。如果您正苦于以下问题:C++ ParameterMap::value方法的具体用法?C++ ParameterMap::value怎么用?C++ ParameterMap::value使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ParameterMap
的用法示例。
在下文中一共展示了ParameterMap::value方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DistanceFunction
ForceIdentityDistance::ForceIdentityDistance(const PointLayout& layout,
const ParameterMap& params)
: DistanceFunction(layout, params) {
validParams = QStringList() << "distance" << "params";
_dist = MetricFactory::create(params.value("distance"),
layout,
params.value("params", ParameterMap()).toParameterMap());
}
示例2: main
int main(int argc, char* argv[]) {
QCoreApplication app(argc, argv);
gaia2::verbose = true;
// get command-line options
ParameterMap options = parseOptions(argc, argv);
yaml::Node filelist = yaml::loadFromFile(options.value("inputFiles"));
const yaml::Mapping& tracks = filelist.mapping();
// convert our yaml::Map to a QMap we can give to mergeFiles
QMap<QString, QString> sigfiles;
yaml::Mapping::const_iterator it = tracks.constBegin();
for (; it != tracks.constEnd(); ++it) {
sigfiles.insert(it.key().toString(), it.value().toString());
}
//qDebug() << "Found" << tracks.size() << "in filelist";
// do the actual merging
DataSet* dataset = DataSet::mergeFiles(sigfiles,
descs_select, descs_exclude,
options.value("start").toInt(),
options.value("end").toInt(),
layout);
// save dataset & clean up stuff
qDebug() << "Saving dataset...";
dataset->save(options.value("dataset"));
qDebug() << "Dataset successfully saved!";
// let the OS reclaim the memory itself, much faster than deleting the dataset here...
//delete dataset;
return 0;
}
示例3: main
int main(int argc, char* argv[]) {
QCoreApplication app(argc, argv);
ParameterMap options = parseOptions(argc, argv);
gaia2::init();
gaia2::verbose = true;
if (options.value("verbose").toBool()) {
setDebugLevel(GTools);
}
DataSet dataset;
int npoints;
int dimension;
try {
G_INFO("Loading dataset: " << options.value("dataset"));
dataset.load(options.value("dataset"));
npoints = dataset.size();
dimension = dataset.layout().correspondingRegion().dimension();
}
catch (GaiaException& e) {
G_ERROR(e.msg());
exit(1);
}
G_INFO("DataSet name: " << dataset.name());
G_INFO("Total number of points: " << npoints);
G_INFO("Dimension: " << dimension);
G_INFO("");
// ---------------------------------------------------------------------------
G_INFO("Copying data into SuperMatrix (naive FrozenDataset)...");
G_INFO("fixed real data dimension = " << dataset[0]->frealData().size());
G_INFO("(note: should be 175 for gaiabench)");
G_INFO("");
float* frozenDataSet = new float[npoints*dimension];
for (int i=0; i<npoints; i++) {
const int offset = i*dimension;
const RealDescriptor& d = dataset[i]->frealData();
for (int j=0; j<dimension; j++) {
frozenDataSet[offset+j] = d[j];
}
}
float* frozenDataSet2 = new float[npoints*25];
for (int i=0; i<npoints; i++) {
const int offset = i*25;
const RealDescriptor& d = dataset[i]->frealData();
for (int j=0; j<25; j++) {
frozenDataSet2[offset+j] = d[150+j];
}
}
G_INFO("Copying data into gaia::FrozenDataSet...");
FrozenDataSet frozenDS;
frozenDS.fromDataSet(dataset);
gaia2::verbose = false;
ParameterMap eucp;
eucp.insert("descriptorNames", "pca");
DataSet* eucds = transform(&dataset, "select", eucp);
FrozenDataSet frozeuc;
frozeuc.fromDataSet(*eucds);
delete eucds;
gaia2::verbose = true;
G_INFO("FrozenDataSets ready");
G_INFO("");
// ---------------------------------------------------------------------------
G_INFO(G_HLINE "\n");
const char* hybridDistanceParams =
"colfilter: \n"
" weight: 0.4 \n"
" distance: cosineangle \n"
" params: \n"
" descriptorNames: colfilter \n"
" defaultValue: 0.0 \n"
" \n"
"context: \n"
" weight: 0.4 \n"
" distance: cosineangle \n"
" params: \n"
" descriptorNames: context \n"
" defaultValue: 0.0 \n"
" \n"
"content: \n"
" weight: 0.2 \n"
" distance: euclidean \n"
" params: \n"
" descriptorNames: pca \n"
" \n";
//.........这里部分代码省略.........