1 | // Edwin 11/10/2009-- carved out of CbcBranchActual |
---|

2 | #ifndef CbcFixVariable_H |
---|

3 | #define CbcFixVariable_H |
---|

4 | |
---|

5 | #include "CbcBranchBase.hpp" |
---|

6 | /** Class for consequent bounds. |
---|

7 | When a variable is branched on it normally interacts with other variables by |
---|

8 | means of equations. There are cases where we want to step outside LP and do something |
---|

9 | more directly e.g. fix bounds. This class is for that. |
---|

10 | |
---|

11 | A state of -9999 means at LB, +9999 means at UB, |
---|

12 | others mean if fixed to that value. |
---|

13 | |
---|

14 | */ |
---|

15 | |
---|

16 | class CbcFixVariable : public CbcConsequence { |
---|

17 | |
---|

18 | public: |
---|

19 | |
---|

20 | // Default Constructor |
---|

21 | CbcFixVariable (); |
---|

22 | |
---|

23 | // One useful Constructor |
---|

24 | CbcFixVariable (int numberStates, const int * states, const int * numberNewLower, const int ** newLowerValue, |
---|

25 | const int ** lowerColumn, |
---|

26 | const int * numberNewUpper, const int ** newUpperValue, |
---|

27 | const int ** upperColumn); |
---|

28 | |
---|

29 | // Copy constructor |
---|

30 | CbcFixVariable ( const CbcFixVariable & rhs); |
---|

31 | |
---|

32 | // Assignment operator |
---|

33 | CbcFixVariable & operator=( const CbcFixVariable & rhs); |
---|

34 | |
---|

35 | /// Clone |
---|

36 | virtual CbcConsequence * clone() const; |
---|

37 | |
---|

38 | /// Destructor |
---|

39 | virtual ~CbcFixVariable (); |
---|

40 | |
---|

41 | /** Apply to an LP solver. Action depends on state |
---|

42 | */ |
---|

43 | virtual void applyToSolver(OsiSolverInterface * solver, int state) const; |
---|

44 | |
---|

45 | protected: |
---|

46 | /// Number of states |
---|

47 | int numberStates_; |
---|

48 | /// Values of integers for various states |
---|

49 | int * states_; |
---|

50 | /// Start of information for each state (setting new lower) |
---|

51 | int * startLower_; |
---|

52 | /// Start of information for each state (setting new upper) |
---|

53 | int * startUpper_; |
---|

54 | /// For each variable new bounds |
---|

55 | double * newBound_; |
---|

56 | /// Variable |
---|

57 | int * variable_; |
---|

58 | }; |
---|

59 | |
---|

60 | #endif |
---|

61 | |
---|