Files
haiku-beta6/headers/libs/linprog/Variable.h
T

60 lines
1.1 KiB
C++
Raw Normal View History

2008-02-25 01:54:05 +00:00
/*
* Copyright 2007-2008, Christof Lutteroth, [email protected]
* Copyright 2007-2008, James Kim, [email protected]
* Distributed under the terms of the MIT License.
*/
#ifndef VARIABLE_H
#define VARIABLE_H
#include <SupportDefs.h>
namespace LinearProgramming {
class Constraint;
class LinearSpec;
/**
* Contains minimum and maximum values.
*/
class Variable {
public:
int32 Index();
LinearSpec* LS() const;
2008-02-25 01:54:05 +00:00
void SetLS(LinearSpec* value);
double Value() const;
2008-02-25 01:54:05 +00:00
void SetValue(double value);
double Min() const;
2008-02-25 01:54:05 +00:00
void SetMin(double min);
double Max() const;
2008-02-25 01:54:05 +00:00
void SetMax(double max);
void SetRange(double min, double max);
//~ string ToString();
Constraint* IsEqual(Variable* var);
Constraint* IsSmallerOrEqual(Variable* var);
Constraint* IsGreaterorEqual(Variable* var);
protected:
Variable(LinearSpec* ls);
~Variable();
private:
LinearSpec* fLS;
double fValue;
double fMin;
double fMax;
public:
friend class LinearSpec;
2008-02-25 01:54:05 +00:00
friend class Constraint;
};
} // namespace LinearProgramming
using LinearProgramming::Variable;
#endif // VARIABLE_H