本文整理汇总了C++中Benchmark::addSolver方法的典型用法代码示例。如果您正苦于以下问题:C++ Benchmark::addSolver方法的具体用法?C++ Benchmark::addSolver怎么用?C++ Benchmark::addSolver使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Benchmark
的用法示例。
在下文中一共展示了Benchmark::addSolver方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
//.........这里部分代码省略.........
}
// SFMM and SFMM*
else if (name == "sfmm")
solver = new SFMM<grid_t, cell_t>(ctorParams_[i].c_str());
else if (name == "sfmmstar") {
if (p.size() == 1)
solver = new SFMMStar<grid_t, cell_t>(p[0].c_str());
else if (p.size() == 2) {
if (p[1] == "TIME")
solver = new SFMMStar<grid_t, cell_t>(p[0].c_str(), TIME);
else if (p[1] == "DISTANCE")
solver = new SFMMStar<grid_t, cell_t>(p[0].c_str(), DISTANCE);
}
}
// GMM
else if (name == "gmm") {
if (p.size() == 1)
solver = new GMM<grid_t>(p[0].c_str());
else if (p.size() == 2)
solver = new GMM<grid_t>(p[0].c_str(), boost::lexical_cast<double>(p[1]));
}
// FIM
else if (name == "fim") {
if (p.size() == 1)
solver = new FIM<grid_t>(p[0].c_str());
else if (p.size() == 2)
solver = new FIM<grid_t>(p[0].c_str(), boost::lexical_cast<double>(p[1]));
}
// UFMM
else if (name == "ufmm") {
if (p.size() == 1)
solver = new UFMM<grid_t>(p[0].c_str());
else if (p.size() == 2)
solver = new UFMM<grid_t>(p[0].c_str(), boost::lexical_cast<unsigned>(p[1]));
else if (p.size() == 3)
solver = new UFMM<grid_t>(p[0].c_str(), boost::lexical_cast<unsigned>(p[1]), boost::lexical_cast<double>(p[2]));
}
// FSM
else if (name == "fsm") {
if (p.size() == 1)
solver = new FSM<grid_t>(p[0].c_str());
else if (p.size() == 2)
solver = new FSM<grid_t>(p[0].c_str(), boost::lexical_cast<unsigned>(p[1]));
}
// LSM
else if (name == "lsm") {
if (p.size() == 1)
solver = new LSM<grid_t>(p[0].c_str());
else if (p.size() == 2)
solver = new LSM<grid_t>(p[0].c_str(), boost::lexical_cast<unsigned>(p[1]));
}
// DDQM
else if (name == "ddqm") {
solver = new LSM<grid_t>(p[0].c_str());
}
// Add solver here.
else
continue;
}
b.addSolver(solver);
}
constexpr size_t N = grid_t::getNDims();
grid_t * grid = new grid_t();
if (options_.find("grid.file") != options_.end())
MapLoader::loadMapFromImg(options_.find("grid.file")->second.c_str(), *grid);
else if (options_.find("grid.text") != options_.end()) {
if(!MapLoader::loadMapFromText(options_.find("grid.text")->second.c_str(), *grid))
exit(1);
}
else {
const std::string & strToSplit = options_.find("grid.dimsize")->second;
std::array<unsigned int, N> dimSize = splitAndCast<unsigned int, N>(strToSplit);
grid->resize(dimSize);
}
grid->setLeafSize(getValue<double>("grid.leafsize"));
const std::string & strToSplit2 = options_.find("problem.start")->second;
std::array<unsigned int, N> startCoords = splitAndCast<unsigned int, N>(strToSplit2);
unsigned int startIdx;
std::vector<unsigned int> startIndices;
grid->coord2idx(startCoords, startIdx);
startIndices.push_back(startIdx);
const std::string & strToSplit3 = options_.find("problem.goal")->second;
if (strToSplit3 != "nan")
{
unsigned int goalIdx;
std::array<unsigned int, N> goalCoords = splitAndCast<unsigned int, N>(strToSplit3);
grid->coord2idx(goalCoords, goalIdx);
b.setInitialAndGoalPoints(startIndices, goalIdx);
}
else
b.setInitialPoints(startIndices);
b.setEnvironment(grid);
}