Пример #1
0
        ///<summary>
        /// Add this constraint to the octagon
        ///</summary>
        override public bool AddToOctagon(CoreOctagon oct, IMutableSet <int> affectedDimensions)
        {
            int j = 2 * this.x + 1;
            int i = 2 * this.x;

            affectedDimensions.Add(this.x);

            try
            {
                Rational c = this.c * 2;

                if (Rational.Min(c, oct.octagon[Matpos2(i, j)]) == c)
                {
                    oct.octagon[Matpos2(i, j)] = c;
                    return(true);
                }
            }
            catch (ArithmeticExceptionRational)
            {
                // We could not add the constraint because of an arithmetic exception

                return(false);
            }

            return(false);
        }
Пример #2
0
        override public bool AddToOctagon(CoreOctagon oct, IMutableSet <int> affectedDimensions)
        {
            bool bInf = this.inf.AddToOctagon(oct, affectedDimensions);
            bool bSup = this.sup.AddToOctagon(oct, affectedDimensions);

            return(bInf || bSup);
        }
Пример #3
0
        override public bool AddToOctagon(CoreOctagon oct, IMutableSet <int> affectedDimensions)
        {
            bool b1 = cachedXLeqY.AddToOctagon(oct, affectedDimensions);
            bool b2 = cachedYLeqX.AddToOctagon(oct, affectedDimensions);

            return(b1 || b2);
        }
Пример #4
0
        override public bool AddToOctagon(CoreOctagon oct, IMutableSet <int> affectedDimensions)
        {
            int j = 2 * this.x + 1;
            int i = 2 * this.y;

            affectedDimensions.Add(this.x);
            affectedDimensions.Add(this.y);

            if (this.c <= oct.octagon[Matpos2(i, j)])
            {
                oct.octagon[Matpos2(i, j)] = this.c;
                return(true);
            }
            return(false);
        }
Пример #5
0
    ///<summary>
    /// Add this constraint to the octagon
    ///</summary>
    override public bool AddToOctagon(CoreOctagon oct, IMutableSet<int> affectedDimensions)
    {
      int j = 2 * this.x + 1;
      int i = 2 * this.x;

      affectedDimensions.Add(this.x);

      try
      {
        Rational c = this.c * 2;

        if (Rational.Min(c, oct.octagon[Matpos2(i, j)]) == c)
        {
          oct.octagon[Matpos2(i, j)] = c;
          return true;
        }
      }
      catch (ArithmeticExceptionRational)
      {
        // We could not add the constraint because of an arithmetic exception

        return false;
      }

      return false;
    }
Пример #6
0
    override public bool AddToOctagon(CoreOctagon oct, IMutableSet<int> affectedDimensions)
    {
      bool bInf = this.inf.AddToOctagon(oct, affectedDimensions);
      bool bSup = this.sup.AddToOctagon(oct, affectedDimensions);

      return bInf || bSup;
    }
Пример #7
0
    override public bool AddToOctagon(CoreOctagon oct, IMutableSet<int> affectedDimensions)
    {
      bool b1 = this.cachedXLeqY.AddToOctagon(oct, affectedDimensions);
      bool b2 = this.cachedYLeqX.AddToOctagon(oct, affectedDimensions);

      return b1 || b2;
    }
Пример #8
0
    override public bool AddToOctagon(CoreOctagon oct, IMutableSet<int> affectedDimensions)
    {
      int j = 2 * this.x + 1;
      int i = 2 * this.y;

      affectedDimensions.Add(this.x);
      affectedDimensions.Add(this.y);

      if (this.c <= oct.octagon[Matpos2(i, j)])
      {
        oct.octagon[Matpos2(i, j)] = this.c;
        return true;
      }
      return false;
    }
Пример #9
0
 ///<summary>
 /// Add this constraint to the octagon passed as parameter
 /// </summary>
 ///<param name="oct">the octagon where to add the constraint</param>
 ///<param name="affectedDimensions">The dimensions affected by the constraints</param>
 ///<returns>true iff the constraint has been added</returns>
 abstract public bool AddToOctagon(CoreOctagon oct, IMutableSet<int> affectedDimensions);
Пример #10
0
 ///<summary>
 /// Add this constraint to the octagon passed as a parameter
 ///</summary>
 ///<param name="oct">The octagon where to add the constraints</param>
 ///<returns>True iff the constraint has been added</returns>
 public bool AddToOctagon(CoreOctagon oct)
 {
   return this.AddToOctagon(oct, new Set<int>());
 }
Пример #11
0
 ///<summary>
 /// Add this constraint to the octagon passed as parameter
 /// </summary>
 ///<param name="oct">the octagon where to add the constraint</param>
 ///<param name="affectedDimensions">The dimensions affected by the constraints</param>
 ///<returns>true iff the constraint has been added</returns>
 abstract public bool AddToOctagon(CoreOctagon oct, IMutableSet <int> affectedDimensions);
Пример #12
0
 ///<summary>
 /// Add this constraint to the octagon passed as a parameter
 ///</summary>
 ///<param name="oct">The octagon where to add the constraints</param>
 ///<returns>True iff the constraint has been added</returns>
 public bool AddToOctagon(CoreOctagon oct)
 {
     return(this.AddToOctagon(oct, new Set <int>()));
 }