本文整理汇总了C++中ipopt::SmartPtr::GetIntegerValue方法的典型用法代码示例。如果您正苦于以下问题:C++ SmartPtr::GetIntegerValue方法的具体用法?C++ SmartPtr::GetIntegerValue怎么用?C++ SmartPtr::GetIntegerValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ipopt::SmartPtr
的用法示例。
在下文中一共展示了SmartPtr::GetIntegerValue方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OsiChooseVariable
BonNWayChoose::BonNWayChoose(BabSetupBase &b, const OsiSolverInterface* solver):
OsiChooseVariable(solver),
br_depth_(0),
bounds_(),
unit_changes_(),
num_ps_costs_(),
num_eval_(),
geo_means_(0)
{
Ipopt::SmartPtr<Ipopt::OptionsList> options = b.options();
options->GetNumericValue("time_limit", time_limit_, b.prefix());
options->GetNumericValue("cutoff_multiplier", cutoff_multiplier_, b.prefix());
options->GetNumericValue("pseudocost_trust_value", pseudocost_trust_value_, b.prefix());
options->GetIntegerValue("strong_branch_depth", br_depth_, b.prefix());
options->GetIntegerValue("nway_branch_log_level", log_, b.prefix());
options->GetEnumValue("do_fixings", do_fixings_, b.prefix());
options->GetEnumValue("use_geo_means", geo_means_, b.prefix());
/** Set values of standard branching options.*/
int numberObjects = solver_->numberObjects();
std::cout<<"Number objects "<<numberObjects<<std::endl;
start_time_ = CoinCpuTime();
OsiObject ** object = solver->objects();
for (int i=0;i<numberObjects;i++) {
BonNWayObject * nway = dynamic_cast<BonNWayObject *>(object[i]);
if(!nway) continue;
start_nway_ = i;
break;
}
numberObjects -= start_nway_;
}
示例2: StrongBranchingSolver
LpBranchingSolver::LpBranchingSolver(BabSetupBase * b) :
StrongBranchingSolver(b->nonlinearSolver()),
lin_(NULL),
warm_(NULL),
ecp_(NULL)
{
Ipopt::SmartPtr<TNLPSolver> tnlp_solver =
static_cast<TNLPSolver *> (b->nonlinearSolver()->solver());
Ipopt::SmartPtr<Ipopt::OptionsList> options = tnlp_solver->options();
options->GetIntegerValue("ecp_max_rounds_strong",
maxCuttingPlaneIterations_,
b->nonlinearSolver()->prefix());
options->GetNumericValue("ecp_abs_tol_strong",
abs_ecp_tol_,
b->nonlinearSolver()->prefix());
options->GetNumericValue("ecp_rel_tol_strong",
rel_ecp_tol_,
b->nonlinearSolver()->prefix());
int dummy;
options->GetEnumValue("lp_strong_warmstart_method",
dummy,
b->nonlinearSolver()->prefix());
warm_start_mode_ = (WarmStartMethod) dummy;
}