mirror of
https://review.haiku-os.org/haiku
synced 2025-01-20 21:41:28 +01:00
a101e99aad
BLayout implementation (BALMLayout) using the Auckland Layout Model (ALM). The original ALM was implemented by Christof Lutteroth, the Haiku/C++ version by James Kim. The code needs some review, but the test programs seem to work fine. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23889 a95241bf-73f2-0310-859d-f6bbb57e9c96
54 lines
975 B
C++
54 lines
975 B
C++
#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;
|
|
void SetLS(LinearSpec* value);
|
|
double Value() const;
|
|
void SetValue(double value);
|
|
double Min() const;
|
|
void SetMin(double min);
|
|
double Max() const;
|
|
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;
|
|
friend class SoftConstraint;
|
|
|
|
};
|
|
|
|
} // namespace LinearProgramming
|
|
|
|
using LinearProgramming::Variable;
|
|
|
|
#endif // VARIABLE_H
|