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; }
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_; }