本文整理汇总了C++中params::erase方法的典型用法代码示例。如果您正苦于以下问题:C++ params::erase方法的具体用法?C++ params::erase怎么用?C++ params::erase使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类params
的用法示例。
在下文中一共展示了params::erase方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: invalid_argument
wrapper(size_t n, params prm = params(),
const backend_params &bprm = backend_params(),
const InnerProduct &inner_product = InnerProduct()
)
: s(prm.get("type", runtime::solver::bicgstab)), handle(0)
{
if (!prm.erase("type")) AMGCL_PARAM_MISSING("type");
switch(s) {
#define AMGCL_RUNTIME_SOLVER(type) \
case type: \
handle = static_cast<void*>(new amgcl::solver::type<Backend, InnerProduct>(n, prm, bprm, inner_product)); \
break
AMGCL_RUNTIME_SOLVER(cg);
AMGCL_RUNTIME_SOLVER(bicgstab);
AMGCL_RUNTIME_SOLVER(bicgstabl);
AMGCL_RUNTIME_SOLVER(gmres);
AMGCL_RUNTIME_SOLVER(lgmres);
AMGCL_RUNTIME_SOLVER(fgmres);
AMGCL_RUNTIME_SOLVER(idrs);
#undef AMGCL_RUNTIME_SOLVER
default:
throw std::invalid_argument("Unsupported solver type");
}
}
示例2: invalid_argument
wrapper(const amgcl::mpi::distributed_matrix<Backend> &A,
params prm, const backend_params &bprm = backend_params())
: r(prm.get("type", runtime::relaxation::spai0)), handle(0)
{
if (!prm.erase("type")) AMGCL_PARAM_MISSING("type");
switch(r) {
#define AMGCL_RELAX_DISTR(type) \
case runtime::relaxation::type: \
handle = static_cast<void*>(new amgcl::mpi::relaxation::type<Backend>(A, prm, bprm)); \
break
#define AMGCL_RELAX_LOCAL_DISTR(type) \
case runtime::relaxation::type: \
handle = call_constructor<amgcl::relaxation::type>(A, prm, bprm); \
break;
#define AMGCL_RELAX_LOCAL_LOCAL(type) \
case runtime::relaxation::type: \
handle = call_constructor<amgcl::relaxation::type>(*A.local(), prm, bprm); \
break;
AMGCL_RELAX_DISTR(spai0);
AMGCL_RELAX_LOCAL_DISTR(chebyshev);
AMGCL_RELAX_LOCAL_LOCAL(damped_jacobi);
AMGCL_RELAX_LOCAL_LOCAL(ilu0);
AMGCL_RELAX_LOCAL_LOCAL(iluk);
AMGCL_RELAX_LOCAL_LOCAL(ilut);
AMGCL_RELAX_LOCAL_LOCAL(spai1);
AMGCL_RELAX_LOCAL_LOCAL(gauss_seidel);
#undef AMGCL_RELAX_LOCAL_LOCAL
#undef AMGCL_RELAX_LOCAL_DISTR
#undef AMGCL_RELAX_DISTR
default:
throw std::invalid_argument("Unsupported relaxation type");
}
}