1 | // $Id$ |
---|

2 | // Copyright (C) 2002, 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/10/2009-- carved out of CbcBranchActual |
---|

7 | |
---|

8 | #ifndef CbcFixVariable_H |
---|

9 | #define CbcFixVariable_H |
---|

10 | |
---|

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

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

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

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

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

16 | |
---|

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

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

19 | |
---|

20 | */ |
---|

21 | |
---|

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

23 | |
---|

24 | public: |
---|

25 | |
---|

26 | // Default Constructor |
---|

27 | CbcFixVariable (); |
---|

28 | |
---|

29 | // One useful Constructor |
---|

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

31 | const int ** lowerColumn, |
---|

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

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

34 | |
---|

35 | // Copy constructor |
---|

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

37 | |
---|

38 | // Assignment operator |
---|

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

40 | |
---|

41 | /// Clone |
---|

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

43 | |
---|

44 | /// Destructor |
---|

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

46 | |
---|

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

48 | */ |
---|

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

50 | |
---|

51 | protected: |
---|

52 | /// Number of states |
---|

53 | int numberStates_; |
---|

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

55 | int * states_; |
---|

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

57 | int * startLower_; |
---|

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

59 | int * startUpper_; |
---|

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

61 | double * newBound_; |
---|

62 | /// Variable |
---|

63 | int * variable_; |
---|

64 | }; |
---|

65 | |
---|

66 | #endif |
---|

67 | |
---|