BlisHeurRound.h
Go to the documentation of this file.
1 /*===========================================================================*
2  * This file is part of the Bcps Linear Solver (BLIS). *
3  * *
4  * BLIS is distributed under the Eclipse Public License as part of the *
5  * COIN-OR repository (http://www.coin-or.org). *
6  * *
7  * Authors: *
8  * *
9  * Yan Xu, Lehigh University *
10  * Ted Ralphs, Lehigh University *
11  * *
12  * Conceptual Design: *
13  * *
14  * Yan Xu, Lehigh University *
15  * Ted Ralphs, Lehigh University *
16  * Laszlo Ladanyi, IBM T.J. Watson Research Center *
17  * Matthew Saltzman, Clemson University *
18  * *
19  * *
20  * Copyright (C) 2001-2013, Lehigh University, Yan Xu, and Ted Ralphs. *
21  * All Rights Reserved. *
22  *===========================================================================*/
23 
24 //#############################################################################
25 // This file is modified from CbcHeuristic.hpp
26 //#############################################################################
27 
28 #ifndef BlisHeurRound_h_
29 #define BlisHeurRound_h_
30 
31 #include <string>
32 #include <vector>
33 
34 #include "CoinPackedMatrix.hpp"
35 #include "OsiCuts.hpp"
36 
37 #include "BlisHeuristic.h"
38 
39 class BlisModel;
40 
41 //#############################################################################
42 
44 class BlisHeurRound : public BlisHeuristic {
45  private:
48 
49  protected:
52 
55 
57  int seed_;
58 
59  public:
62 
64  BlisHeurRound(BlisModel * model, const char *name, int strategy)
65  :
66  BlisHeuristic(model, name, strategy)
67  {
68  assert(model->solver());
69  }
70 
73 
75  BlisHeurRound( const BlisHeurRound &);
76 
78  virtual BlisHeuristic * clone() const;
79 
81  virtual void setModel(BlisModel * model);
82 
88  virtual bool searchSolution(double & objectiveValue,
89  double * newSolution);
90 
92  void setSeed(int value) { seed_ = value; }
93 
94 };
95 #endif
int seed_
Seed for random stuff.
Definition: BlisHeurRound.h:57
Heuristic base class.
Definition: BlisHeuristic.h:46
CoinPackedMatrix matrix_
Column majored matrix.
Definition: BlisHeurRound.h:51
BlisHeurRound & operator=(const BlisHeurRound &rhs)
Illegal Assignment operator.
Sparse Matrix Base Class.
virtual bool searchSolution(double &objectiveValue, double *newSolution)
returns 0 if no solution, 1 if valid solution with better objective value than one passed in Sets sol...
~BlisHeurRound()
Destructor.
Definition: BlisHeurRound.h:72
void setSeed(int value)
Set seed.
Definition: BlisHeurRound.h:92
Rounding Heuristic.
Definition: BlisHeurRound.h:44
virtual void setModel(BlisModel *model)
update model (This is needed if cliques update matrix etc).
virtual OsiSolverInterface * solver()
Get lp solver.
Definition: BlisModel.h:310
const char * name() const
return name of generator.
BlisHeurRound(BlisModel *model, const char *name, int strategy)
Constructor with model - assumed before cuts.
Definition: BlisHeurRound.h:64
virtual BlisHeuristic * clone() const
Clone a rounding heuristic.
CoinPackedMatrix matrixByRow_
Row majored matrix.
Definition: BlisHeurRound.h:54
virtual int strategy()
Get/set strategy.
BlisHeurRound()
Default Constructor.
Definition: BlisHeurRound.h:61