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
12namespace LinearProgramming {
13
14class LinearSpec;
15class Variable;
16
17/**
18 * A summand of a linear term.
19 */
20class Summand {
21public:
22								Summand(Summand* summand);
23								Summand(double coeff, Variable* var);
24								~Summand();
25
26			double				Coeff();
27			void				SetCoeff(double coeff);
28			Variable*			Var();
29			void				SetVar(Variable* var);
30
31			int32				VariableIndex();
32private:
33			double				fCoeff;
34			Variable*			fVar;
35};
36
37typedef BObjectList<Summand> SummandList;
38
39}	// namespace LinearProgramming
40
41using LinearProgramming::Summand;
42using LinearProgramming::SummandList;
43
44
45#endif	// OBJ_FUNCTION_SUMMAND_H
46
47