haiku/headers/libs/linprog/Constraint.h
Ingo Weinhold a101e99aad Added libalm.so and its dependency liblinprog.so. libalm.so provides a
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
2008-02-06 10:51:44 +00:00

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.&nbsp;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