xref: /haiku/headers/libs/linprog/Summand.h (revision 922e7ba1f3228e6f28db69b0ded8f86eb32dea17)
1 /*
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.
5  */
6 #ifndef	SUMMAND_H
7 #define	SUMMAND_H
8 
9 #include <ObjectList.h>
10 
11 
12 namespace LinearProgramming {
13 
14 class LinearSpec;
15 class Variable;
16 
17 /**
18  * A summand of a linear term.
19  */
20 class Summand {
21 public:
22 								Summand(double coeff, Variable* var);
23 								~Summand();
24 
25 			double				Coeff();
26 			void				SetCoeff(double coeff);
27 			Variable*			Var();
28 			void				SetVar(Variable* var);
29 
30 			int32				VariableIndex();
31 private:
32 			double				fCoeff;
33 			Variable*			fVar;
34 			bool    			fUsedInPenaltyFunction;  //not set yet
35 };
36 
37 typedef BObjectList<Summand> SummandList;
38 
39 }	// namespace LinearProgramming
40 
41 using LinearProgramming::Summand;
42 using LinearProgramming::SummandList;
43 
44 
45 #endif	// OBJ_FUNCTION_SUMMAND_H
46 
47