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.
|
|
|
|
*/
|
|
|
|
|
2008-02-06 13:51:44 +03:00
|
|
|
#ifndef PENALTY_FUNCTION_H
|
|
|
|
#define PENALTY_FUNCTION_H
|
|
|
|
|
|
|
|
#include <List.h>
|
|
|
|
|
|
|
|
|
|
|
|
namespace LinearProgramming {
|
|
|
|
|
|
|
|
class LinearSpec;
|
|
|
|
class Variable;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Penalty function.
|
|
|
|
*/
|
|
|
|
class PenaltyFunction {
|
|
|
|
|
|
|
|
protected:
|
|
|
|
PenaltyFunction(LinearSpec* ls, Variable* var, BList* xs, BList* gs);
|
|
|
|
|
|
|
|
public:
|
|
|
|
~PenaltyFunction();
|
|
|
|
const Variable* Var() const;
|
2008-03-11 00:43:32 +03:00
|
|
|
const BList* Xs() const;
|
|
|
|
const BList* Gs() const;
|
2008-02-06 13:51:44 +03:00
|
|
|
|
|
|
|
private:
|
|
|
|
LinearSpec* fLS;
|
2008-03-11 00:43:32 +03:00
|
|
|
Variable* fVar;
|
2008-02-06 13:51:44 +03:00
|
|
|
BList* fXs; // double
|
|
|
|
BList* fGs; // double
|
|
|
|
BList* fConstraints;
|
|
|
|
BList* fObjFunctionSummands;
|
|
|
|
|
|
|
|
public:
|
|
|
|
friend class LinearSpec;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace LinearProgramming
|
|
|
|
|
|
|
|
using LinearProgramming::PenaltyFunction;
|
|
|
|
|
|
|
|
#endif // PENALTY_FUNCTION_H
|
2008-03-11 00:43:32 +03:00
|
|
|
|