混合整数规划框架多次添加变量

This commit is contained in:
2025-08-26 00:04:41 +08:00
parent 9f029ef7e4
commit 3cd5dca89e
3 changed files with 61 additions and 66 deletions

View File

@@ -13,7 +13,7 @@ namespace sv {
LinSolver& operator=(const LinSolver& solver);
Var* addVars(int col, VarType type);
const Var& getVar(int idx);
Var& getVar(int idx);
void addConstr(const Expr& expr, ConstrOper sense, double rhs);
void setObjective(Expr obje, int sense = MDL_MAXIMIZE);
void print();
@@ -29,7 +29,7 @@ namespace sv {
rtn feasible_solution();
void _gaussian(std::pair<size_t, size_t> p);
Var* vars;
std::vector<std::pair<int, Var*>> vars;
matrix table;
matrix ope_table;