分支定界法基本框架
This commit is contained in:
@ -87,17 +87,28 @@ namespace sv {
|
||||
EQUAL
|
||||
};
|
||||
|
||||
|
||||
enum class VarType {
|
||||
CONTINUOUS,
|
||||
BINARY,
|
||||
INTEGER,
|
||||
};
|
||||
|
||||
class Var {
|
||||
public:
|
||||
Var(double coef = 1) :col(0), val(0), coeffs(coef) {};
|
||||
friend class Model;
|
||||
friend class LinSolver;
|
||||
friend class Expr;
|
||||
|
||||
Var(double coef = 1, VarType type_ = VarType::CONTINUOUS);
|
||||
double get(DoubleAttr attr);
|
||||
int get(IntAttr attr);
|
||||
friend class Model;
|
||||
friend class Expr;
|
||||
|
||||
private:
|
||||
double coeffs;
|
||||
double val;
|
||||
int col;
|
||||
VarType type;
|
||||
};
|
||||
|
||||
Expr operator+(const Expr& x, const Expr& y);
|
||||
@ -131,7 +142,7 @@ namespace sv {
|
||||
Expr(double constant = 0.0);
|
||||
Expr(Var var, double coeff = 1.0);
|
||||
|
||||
friend class Model;
|
||||
friend class LinSolver;
|
||||
|
||||
friend Expr operator+(const Expr& x, const Expr& y);
|
||||
friend Expr operator+(const Expr& x);
|
||||
|
Reference in New Issue
Block a user