Debian Codegraph @

Bonmin/src/CbcBonmin/Heuristics/BonHeuristicDiveVectorLength.hpp

raw
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 BonHeuristicDiveVectorLength_H
11 #define BonHeuristicDiveVectorLength_H
12
13 #include "BonBonminSetup.hpp"
14 #include "BonHeuristicDive.hpp"
15
16 /** DiveVectorLength class
17 */
18
19 namespace Bonmin
20 {
21 class HeuristicDiveVectorLength : public HeuristicDive {
22 public:
23 /// Default Constructor
24 HeuristicDiveVectorLength ();
25
26 /// Constructor with setup
27 HeuristicDiveVectorLength(BonminSetup * setup);
28
29 /// Copy constructor
30 HeuristicDiveVectorLength(const HeuristicDiveVectorLength &copy);
31
32 /// Destructor
33 ~HeuristicDiveVectorLength()
34 {
35 delete [] columnLength_;
36 }
37
38 /// Assignment operator
39 HeuristicDiveVectorLength & operator=(const HeuristicDiveVectorLength & rhs);
40
41 /// Clone
42 virtual CbcHeuristic * clone() const;
43
44 /** Change setup used for heuristic.*/
45 virtual void setSetup(BonminSetup * setup){
46 HeuristicDive::setSetup(setup);
47 Initialize(setup->options());
48 }
49
50 /// sets internal variables
51 virtual void setInternalVariables(TMINLP2TNLP* minlp);
52
53 /// Selects the next variable to branch on
54 /** If bestColumn = -1, it means that no variable was found
55 */
56 virtual void selectVariableToBranch(TMINLP2TNLP* minlp,
57 const vector<int> & integerColumns,
58 const double* newSolution,
59 int& bestColumn,
60 int& bestRound);
61
62 /** Register the options common to all local search based heuristics.*/
63 static void registerOptions(Ipopt::SmartPtr<Bonmin::RegisteredOptions> roptions);
64
65 /** Initiaize using passed options.*/
66 void Initialize(Ipopt::SmartPtr<Ipopt::OptionsList> options);
67
68 private:
69 /// the number of nonzero elements in each column
70 int* columnLength_;
71
72 };
73 }
74 #endif