public void getOldList(GRBModel model, GRBConstr constr) { model.Update(); GRBLinExpr linExpr = model.GetRow(constr); oldDict = new Dictionary<GRBVar, double>(); for (int i = 0; i < linExpr.Size; i++) { GRBVar var = linExpr.GetVar(i); double val = linExpr.GetCoeff(i); if (oldDict.ContainsKey(var)) { oldDict[var] += val; } else { oldDict[var] = val; } } constrs = new GRBConstr[1]; constrs[0] = constr; }