Couenne 0.5.8
CouenneChooseStrong.hpp
Go to the documentation of this file.
1/* $Id: CouenneChooseStrong.hpp 792 2012-01-24 17:24:15Z pbelotti $
2 *
3 * Name: CouenneChooseStrong.hpp
4 * Authors: Andreas Waechter, IBM Corp.
5 * Purpose: Strong branching object for Couenne
6 *
7 * (C) Carnegie-Mellon University, 2006-10.
8 * This file is licensed under the Eclipse Public License (EPL)
9 */
10
11#ifndef COUENNECHOOSESTRONG_HPP
12#define COUENNECHOOSESTRONG_HPP
13
14#include "BonChooseVariable.hpp"
15#include "CouenneJournalist.hpp"
16
17namespace Couenne {
18
19class CouenneProblem;
20
21template <class T> class CouenneSolverInterface;
22
24
25public:
26
29
32
35
37 virtual OsiChooseVariable * clone() const;
38
41
44 virtual int setupList (OsiBranchingInformation *info, bool initialize);
45
46 // actually setting up the list
47 int gutsOfSetupList(OsiBranchingInformation *info, bool initialize);
48
60 virtual int doStrongBranching (OsiSolverInterface * OsiSolver,
62 int numberToDo, int returnCriterion);
63
65 virtual bool feasibleSolution (const OsiBranchingInformation * info,
66 const double * solution,
67 int numberObjects,
68 const OsiObject ** objects);
69
71 virtual int chooseVariable (OsiSolverInterface * solver,
73 bool fixVariables);
74
77
78private:
79
82
83 // print object violations
84 void printObjViol(OsiBranchingInformation *info);
85
86 // Due to possible fixing during strong branching, must check
87 // that variable reference vInd for the selected object (if not -1)
88 // is not fixed or has a current value inside bounds.
89 // Return value is:
90 // 0: OsiSimpleInteger with upper[vInd] == lower[vInd]
91 // 1: OsiSimpleInteger with upper[vInd] > lower[vInd] and
92 // info->solution[vInd] outside bounds
93 // 2: CouenneBranchingObject with upper[vInd] == lower[vInd]
94 // 3: otherwise (meaning good object)
95 int goodCandidate(OsiSolverInterface *solver,
97 OsiObject **object, const int iObject, const double prec);
98
100 bool saveBestCand(OsiObject **object, const int iObject,
101 const double value,
102 const double upEstimate,
103 const double downEstimate,
104 double &bestVal1,
105 double &bestVal2, int &bestIndex,
106 int &bestWay);
107
108protected:
109
113 OsiBranchingObject *branch,
114 OsiSolverInterface *solver,
115 Bonmin::HotInfo * result,
116 int direction);
117
120
125
136
139
142};
143
144}
145
146#endif
CouenneProblem * problem_
Pointer to the associated MINLP problem.
JnlstPtr jnlst_
pointer to journalist for detailed information
bool estimateProduct_
Normally, a convex combination of the min/max lower bounds' estimates is taken to select a branching ...
CouenneChooseStrong(const CouenneChooseStrong &)
Copy constructor.
virtual ~CouenneChooseStrong()
Destructor.
int gutsOfSetupList(OsiBranchingInformation *info, bool initialize)
CouenneChooseStrong(Bonmin::BabSetupBase &b, CouenneProblem *problem, JnlstPtr jnlst)
Constructor from solver (so we can set up arrays etc)
virtual int doStrongBranching(OsiSolverInterface *OsiSolver, OsiBranchingInformation *info, int numberToDo, int returnCriterion)
This is a utility function which does strong branching on a list of objects and stores the results in...
int simulateBranch(OsiObject *Object, OsiBranchingInformation *info, OsiBranchingObject *branch, OsiSolverInterface *solver, Bonmin::HotInfo *result, int direction)
does one side of the branching
virtual int setupList(OsiBranchingInformation *info, bool initialize)
Sets up strong list and clears all if initialize is true.
double branchtime_
total time spent in strong branching
CouenneChooseStrong & operator=(const CouenneChooseStrong &rhs)
Assignment operator.
virtual int chooseVariable(OsiSolverInterface *solver, OsiBranchingInformation *info, bool fixVariables)
choose object to branch based on earlier setup
bool pseudoUpdateLP_
should we update the pseudocost multiplier with the distance between the LP point and the solution of...
virtual bool feasibleSolution(const OsiBranchingInformation *info, const double *solution, int numberObjects, const OsiObject **objects)
Returns true if solution looks feasible against given objects.
virtual OsiChooseVariable * clone() const
Clone.
static void registerOptions(Ipopt::SmartPtr< Bonmin::RegisteredOptions > roptions)
Add list of options to be read from file.
Class for MINLP problems with symbolic information.
general include file for different compilers