TwoImpliedConstructors.cpp
Go to the documentation of this file.
1 /* $Id: TwoImpliedConstructors.cpp 501 2011-02-14 17:43:46Z pbelotti $
2  *
3  * Name: TwoImpliedConstructors.cpp
4  * Author: Pietro Belotti
5  * Purpose: Bound Tightening on pairs of linear constraints -- constructors
6  *
7  * (C) Pietro Belotti, 2010.
8  * This file is licensed under the Eclipse Public License (EPL)
9  */
10 
11 #include "OsiCuts.hpp"
12 #include "BonRegisteredOptions.hpp"
13 #include "CouenneTwoImplied.hpp"
14 
15 #include "CglCutGenerator.hpp"
16 #include "CouenneJournalist.hpp"
17 
18 #include "IpOptionsList.hpp"
19 #include "IpJournalist.hpp"
20 
21 using namespace Couenne;
22 
25  JnlstPtr jnlst,
27  problem_ (p),
28  jnlst_ (jnlst),
29  totalTime_ (0.),
30  totalInitTime_ (0.),
31  firstCall_ (true) {
32 
33  options -> GetIntegerValue ("two_implied_max_trials", nMaxTrials_, "couenne.");
34  options -> GetIntegerValue ("twoimpl_depth_level", depthLevelling_, "couenne.");
35  options -> GetIntegerValue ("twoimpl_depth_stop", depthStopSeparate_, "couenne.");
36 }
37 
38 
41 
42  CglCutGenerator (src),
43  problem_ (src.problem_),
44  jnlst_ (src.jnlst_),
45  nMaxTrials_ (src.nMaxTrials_),
46  totalTime_ (src.totalTime_),
47  totalInitTime_ (src.totalInitTime_),
48  firstCall_ (src.firstCall_),
49  depthLevelling_ (src.depthLevelling_),
50  depthStopSeparate_ (src.depthStopSeparate_) {}
51 
52 
55 
56  if (totalTime_ > 1e-5)
57  jnlst_ -> Printf (Ipopt::J_ERROR, J_COUENNE, "TwoImpliedCuts: %g seconds (%g init)\n", totalTime_, totalInitTime_);
58 }
59 
60 
63 
64  roptions -> AddLowerBoundedIntegerOption
65  ("two_implied_bt",
66  "The frequency (in terms of nodes) at which Couenne two-implied bounds are tightened.",
67  -99, 0,
68  "A frequency of 0 (default) means these cuts are never generated. \
69 Any positive number n instructs Couenne to generate them at every n nodes of the B&B tree. \
70 A negative number -n means that generation should be attempted at the root node, and if \
71 successful it can be repeated at every n nodes, otherwise it is stopped altogether."
72  );
73 
74  roptions -> AddLowerBoundedIntegerOption
75  ("two_implied_max_trials",
76  "The number of iteration at each call to the cut generator.",
77  1, 2,
78  "");
79 
80  roptions -> AddLowerBoundedIntegerOption
81  ("twoimpl_depth_level",
82  "Depth of the B&B tree when to start decreasing the chance of running this algorithm.",
83  -1, 5, "This has a similar behavior as log_num_obbt_per_level. "
84  "A value of -1 means that generation can be done at all nodes.");
85 
86  roptions -> AddLowerBoundedIntegerOption
87  ("twoimpl_depth_stop",
88  "Depth of the B&B tree where separation is stopped.",
89  -1, 20, "A value of -1 means that generation can be done at all nodes");
90 }
int depthStopSeparate_
Depth of the BB tree where stop separation.
int depthLevelling_
Depth of the BB tree where to start decreasing chance of running this.
double totalInitTime_
CPU time spent columning the row formulation.
double totalTime_
Total CPU time spent separating cuts.
void fint fint fint real fint real real real real real real real real real * e
Class for MINLP problems with symbolic information.
Cut Generator for implied bounds derived from pairs of linear (in)equalities.
const Ipopt::EJournalCategory J_COUENNE(Ipopt::J_USER8)
static void registerOptions(Ipopt::SmartPtr< Bonmin::RegisteredOptions > roptions)
Add list of options to be read from file.
CouenneTwoImplied(CouenneProblem *, JnlstPtr, const Ipopt::SmartPtr< Ipopt::OptionsList >)
constructor
int nMaxTrials_
maximum number of trials in every call