source: trunk/Cbc/src/CbcBranchAllDifferent.hpp

Last change on this file was 2465, checked in by unxusr, 5 months ago

script to format sources

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 1.5 KB
Line 
1// $Id: CbcBranchAllDifferent.hpp 2465 2019-01-03 19:26:52Z forrest $
2// Copyright (C) 2004, International Business Machines
3// Corporation and others.  All Rights Reserved.
4// This code is licensed under the terms of the Eclipse Public License (EPL).
5
6// Edwin 11/13/2009-- carved out of CbcBranchCut
7
8#ifndef CbcBranchAllDifferent_H
9#define CbcBranchAllDifferent_H
10
11#include "CbcBranchBase.hpp"
12#include "OsiRowCut.hpp"
13#include "CoinPackedMatrix.hpp"
14#include "CbcBranchCut.hpp"
15
16/** Define a branch class that branches so that it is only satsified if all
17    members have different values
18    So cut is x <= y-1 or x >= y+1
19*/
20
21class CbcBranchAllDifferent : public CbcBranchCut {
22
23public:
24  // Default Constructor
25  CbcBranchAllDifferent();
26
27  /** Useful constructor - passed set of integer variables which must all be different
28    */
29  CbcBranchAllDifferent(CbcModel *model, int number, const int *which);
30
31  // Copy constructor
32  CbcBranchAllDifferent(const CbcBranchAllDifferent &);
33
34  /// Clone
35  virtual CbcObject *clone() const;
36
37  // Assignment operator
38  CbcBranchAllDifferent &operator=(const CbcBranchAllDifferent &rhs);
39
40  // Destructor
41  ~CbcBranchAllDifferent();
42
43  /// Infeasibility - large is 0.5
44  virtual double infeasibility(const OsiBranchingInformation *info,
45    int &preferredWay) const;
46
47  /// Creates a branching object
48  virtual CbcBranchingObject *createCbcBranch(OsiSolverInterface *solver, const OsiBranchingInformation *info, int way);
49
50protected:
51  /// data
52
53  /// Number of entries
54  int numberInSet_;
55  /// Which variables
56  int *which_;
57};
58#endif
59
60/* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
61*/
Note: See TracBrowser for help on using the repository browser.