| 1 |
// Copyright (C) 2007, International Business Machines Corporation and others. |
| 2 |
// All Rights Reserved. |
| 3 |
// This code is published under the Eclipse Public License. |
| 4 |
// |
| 5 |
// Authors : |
| 6 |
// Joao P. Goncalves, International Business Machines Corporation |
| 7 |
// |
| 8 |
// Date : November 12, 2007 |
| 9 |
|
| 10 |
#ifndef BonHeuristicDiveFractional_H |
| 11 |
#define BonHeuristicDiveFractional_H |
| 12 |
|
| 13 |
#include "BonBonminSetup.hpp" |
| 14 |
#include "BonHeuristicDive.hpp" |
| 15 |
|
| 16 |
/** DiveFractional class |
| 17 |
*/ |
| 18 |
|
| 19 |
namespace Bonmin |
| 20 |
{ |
| 21 |
class HeuristicDiveFractional : public HeuristicDive { |
| 22 |
public: |
| 23 |
/// Default Constructor |
| 24 |
HeuristicDiveFractional (); |
| 25 |
|
| 26 |
/// Constructor with setup |
| 27 |
HeuristicDiveFractional(BonminSetup * setup); |
| 28 |
|
| 29 |
/// Copy constructor |
| 30 |
HeuristicDiveFractional(const HeuristicDiveFractional ©); |
| 31 |
|
| 32 |
/// Destructor |
| 33 |
~HeuristicDiveFractional() {} |
| 34 |
|
| 35 |
/// Assignment operator |
| 36 |
HeuristicDiveFractional & operator=(const HeuristicDiveFractional & rhs); |
| 37 |
|
| 38 |
/// Clone |
| 39 |
virtual CbcHeuristic * clone() const; |
| 40 |
|
| 41 |
/** Change setup used for heuristic.*/ |
| 42 |
virtual void setSetup(BonminSetup * setup){ |
| 43 |
HeuristicDive::setSetup(setup); |
| 44 |
Initialize(setup->options()); |
| 45 |
} |
| 46 |
|
| 47 |
/// sets internal variables |
| 48 |
virtual void setInternalVariables(TMINLP2TNLP* minlp); |
| 49 |
|
| 50 |
/// Selects the next variable to branch on |
| 51 |
/** If bestColumn = -1, it means that no variable was found |
| 52 |
*/ |
| 53 |
virtual void selectVariableToBranch(TMINLP2TNLP* minlp, |
| 54 |
const vector<int> & integerColumns, |
| 55 |
const double* newSolution, |
| 56 |
int& bestColumn, |
| 57 |
int& bestRound); |
| 58 |
|
| 59 |
/** Register the options common to all local search based heuristics.*/ |
| 60 |
static void registerOptions(Ipopt::SmartPtr<Bonmin::RegisteredOptions> roptions); |
| 61 |
|
| 62 |
/** Initiaize using passed options.*/ |
| 63 |
void Initialize(Ipopt::SmartPtr<Ipopt::OptionsList> options); |
| 64 |
|
| 65 |
}; |
| 66 |
} |
| 67 |
#endif |