2008-02-25 04:54:05 +03:00
|
|
|
/*
|
|
|
|
* Copyright 2007-2008, Christof Lutteroth, lutteroth@cs.auckland.ac.nz
|
|
|
|
* Copyright 2007-2008, James Kim, jkim202@ec.auckland.ac.nz
|
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*/
|
|
|
|
#ifndef SUMMAND_H
|
|
|
|
#define SUMMAND_H
|
|
|
|
|
2010-09-20 10:09:19 +04:00
|
|
|
#include <ObjectList.h>
|
|
|
|
|
2008-02-25 04:54:05 +03:00
|
|
|
|
|
|
|
namespace LinearProgramming {
|
|
|
|
|
|
|
|
class LinearSpec;
|
|
|
|
class Variable;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* A summand of a linear term.
|
|
|
|
*/
|
|
|
|
class Summand {
|
|
|
|
public:
|
2010-09-20 08:52:30 +04:00
|
|
|
Summand(double coeff, Variable* var);
|
|
|
|
~Summand();
|
2008-02-25 04:54:05 +03:00
|
|
|
|
2010-09-20 08:52:30 +04:00
|
|
|
double Coeff();
|
|
|
|
void SetCoeff(double coeff);
|
|
|
|
Variable* Var();
|
|
|
|
void SetVar(Variable* var);
|
2008-02-25 04:54:05 +03:00
|
|
|
|
2011-01-25 07:59:40 +03:00
|
|
|
int32 VariableIndex();
|
2010-09-20 08:52:30 +04:00
|
|
|
private:
|
|
|
|
double fCoeff;
|
|
|
|
Variable* fVar;
|
|
|
|
bool fUsedInPenaltyFunction; //not set yet
|
2008-02-25 04:54:05 +03:00
|
|
|
};
|
|
|
|
|
2010-09-20 10:09:19 +04:00
|
|
|
typedef BObjectList<Summand> SummandList;
|
|
|
|
|
2008-02-25 04:54:05 +03:00
|
|
|
} // namespace LinearProgramming
|
|
|
|
|
|
|
|
using LinearProgramming::Summand;
|
2010-09-20 10:09:19 +04:00
|
|
|
using LinearProgramming::SummandList;
|
|
|
|
|
2008-02-25 04:54:05 +03:00
|
|
|
|
|
|
|
#endif // OBJ_FUNCTION_SUMMAND_H
|
2008-03-11 00:43:32 +03:00
|
|
|
|