当前位置: 首页>>代码示例>>C++>>正文


C++ SmartPtr::GetNumericValue方法代码示例

本文整理汇总了C++中ipopt::SmartPtr::GetNumericValue方法的典型用法代码示例。如果您正苦于以下问题:C++ SmartPtr::GetNumericValue方法的具体用法?C++ SmartPtr::GetNumericValue怎么用?C++ SmartPtr::GetNumericValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ipopt::SmartPtr的用法示例。


在下文中一共展示了SmartPtr::GetNumericValue方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: 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;
	  }
开发者ID:coin-or,项目名称:Bonmin,代码行数:25,代码来源:BonLpBranchingSolver.cpp

示例2: 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_;
 }
开发者ID:coin-or,项目名称:Bonmin,代码行数:30,代码来源:BonNWayChoose.cpp


注:本文中的ipopt::SmartPtr::GetNumericValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。