public static void AddConstr(this GRBModel _m, GRBTempConstr _constr) { try { _m.AddConstr(_constr, null); } catch (GRBException _e) when(_e.ErrorCode == 10003) { _m.AddQConstr(_constr, null); } }
public static void AddConstr(this GRBModel _m, GRBTempConstr _constr) { try { _m.AddConstr(_constr, null); } catch (GRBException _e) { switch (_e.ErrorCode) { case 10003: _m.AddQConstr(_constr, null); break; case 20001: _m.Update(); _m.AddConstr(_constr); break; } } }