Ignore:
Timestamp:
Dec 20, 2007 7:20:12 AM (13 years ago)
Author:
forrest
Message:

make useSolution work better

File:
1 edited

Legend:

Unmodified
Added
Removed
  • stable/2.0/Cbc/src/CbcHeuristic.hpp

    r765 r844  
    190190};
    191191
     192/** Partial solution class
     193    If user knows a partial solution this tries to get an integer solution
     194    it uses hotstart information
     195 */
     196
     197class CbcHeuristicPartial : public CbcHeuristic {
     198public:
     199
     200  // Default Constructor
     201  CbcHeuristicPartial ();
     202
     203  /** Constructor with model - assumed before cuts
     204      Fixes all variables with priority <= given
     205      and does given number of nodes
     206  */
     207  CbcHeuristicPartial (CbcModel & model, int fixPriority=10000, int numberNodes=200);
     208 
     209  // Copy constructor
     210  CbcHeuristicPartial ( const CbcHeuristicPartial &);
     211   
     212  // Destructor
     213  ~CbcHeuristicPartial ();
     214 
     215  /// Assignment operator
     216  CbcHeuristicPartial & operator=(const CbcHeuristicPartial& rhs);
     217
     218  /// Clone
     219  virtual CbcHeuristic * clone() const;
     220  /// Create C++ lines to get to current state
     221  virtual void generateCpp( FILE * fp) ;
     222
     223  /// Resets stuff if model changes
     224  virtual void resetModel(CbcModel * model);
     225
     226  /// update model (This is needed if cliques update matrix etc)
     227  virtual void setModel(CbcModel * model);
     228 
     229  using CbcHeuristic::solution ;
     230  /** returns 0 if no solution, 1 if valid solution
     231      with better objective value than one passed in
     232      Sets solution values if good, sets objective value (only if good)
     233      This is called after cuts have been added - so can not add cuts
     234  */
     235  virtual int solution(double & objectiveValue,
     236                       double * newSolution);
     237  /// Validate model i.e. sets when_ to 0 if necessary (may be NULL)
     238  virtual void validate();
     239
     240
     241  /// Set priority level
     242  void setFixPriority(int value)
     243  { fixPriority_ = value;}
     244
     245protected:
     246  // Data
     247
     248  // All variables with abs priority <= this will be fixed
     249  int fixPriority_;
     250};
     251
    192252/** heuristic - just picks up any good solution
    193253    found by solver - see OsiBabSolver
Note: See TracChangeset for help on using the changeset viewer.