2 * Copyright 2007-2008, Christof Lutteroth, lutteroth@cs.auckland.ac.nz
3 * Copyright 2007-2008, James Kim, jkim202@ec.auckland.ac.nz
4 * Distributed under the terms of the MIT License.
10 #include <ObjectList.h>
13 namespace LinearProgramming
{
20 * Contains minimum and maximum values.
25 int32
GlobalIndex() const;
26 LinearSpec
* LS() const;
28 void SetValue(double value
);
30 void SetMin(double min
);
32 void SetMax(double max
);
33 void SetRange(double min
, double max
);
36 void SetLabel(const char* label
);
38 BString
ToString() const;
40 Constraint
* IsEqual(Variable
* var
);
41 Constraint
* IsSmallerOrEqual(Variable
* var
);
42 Constraint
* IsGreaterOrEqual(Variable
* var
);
44 Constraint
* IsEqual(Variable
* var
,
45 double penaltyNeg
, double penaltyPos
);
46 Constraint
* IsSmallerOrEqual(Variable
* var
,
47 double penaltyNeg
, double penaltyPos
);
48 Constraint
* IsGreaterOrEqual(Variable
* var
,
49 double penaltyNeg
, double penaltyPos
);
52 //! Dangerous the variable don't belong to the LinearSpec anymore,
53 //! delete it yourself!
59 Variable(LinearSpec
* ls
);
61 //! returns the ref count
63 int32
RemoveReference();
74 int32 fReferenceCount
;
76 friend class LinearSpec
;
80 typedef BObjectList
<Variable
> VariableList
;
83 } // namespace LinearProgramming
85 using LinearProgramming::Variable
;
86 using LinearProgramming::VariableList
;