mirror of
https://review.haiku-os.org/haiku
synced 2025-01-19 21:11: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
57 lines
1.0 KiB
C++
57 lines
1.0 KiB
C++
#ifndef CONSTRAINT_H
|
|
#define CONSTRAINT_H
|
|
|
|
#include "OperatorType.h"
|
|
|
|
#include <List.h>
|
|
#include <String.h>
|
|
#include <SupportDefs.h>
|
|
|
|
|
|
namespace LinearProgramming {
|
|
|
|
class LinearSpec;
|
|
|
|
/**
|
|
* Hard linear constraint, i.e. one that must be satisfied.
|
|
* May render a specification infeasible.
|
|
*/
|
|
class Constraint {
|
|
|
|
public:
|
|
int32 Index();
|
|
BList* Coeffs();
|
|
BList* Vars();
|
|
virtual void ChangeLeftSide(BList* coeffs, BList* vars);
|
|
virtual OperatorType Op();
|
|
virtual void SetOp(OperatorType value);
|
|
double RightSide();
|
|
void SetRightSide(double value);
|
|
BString ToString();
|
|
virtual ~Constraint();
|
|
|
|
protected:
|
|
Constraint();
|
|
|
|
private:
|
|
Constraint(LinearSpec* ls, BList* coeffs, BList* vars,
|
|
OperatorType op, double rightSide);
|
|
|
|
protected:
|
|
LinearSpec* fLS;
|
|
BList* fCoeffs;
|
|
BList* fVars;
|
|
OperatorType fOp;
|
|
double fRightSide;
|
|
|
|
public:
|
|
friend class LinearSpec;
|
|
|
|
};
|
|
|
|
} // namespace LinearProgramming
|
|
|
|
using LinearProgramming::Constraint;
|
|
|
|
#endif // CONSTRAINT_H
|