Пример #1
0
 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);
     }
 }
Пример #2
0
        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;
                }
            }
        }