示例#1
0
        public void EmptyDifference()
        {
            IntDomain a	= new IntDomain( 8, 55 );

            Assert.IsTrue( a.Difference( a ).IsEmpty() );
            Assert.AreEqual( a.Difference( new IntDomain() ), a );
        }
示例#2
0
        public void EmptyDifference()
        {
            IntDomain a = new IntDomain(8, 55);

            Assert.IsTrue(a.Difference(a).IsEmpty());
            Assert.AreEqual(a.Difference(new IntDomain()), a);
        }
示例#3
0
            static private bool Update(IntDomain[] domArray, int index)
            {
                int val = domArray[index].Interval.Min;

                for (int idx = 0; idx < domArray.Length; ++idx)
                {
                    IntDomain dom = domArray[idx];

                    if (idx != index &&
                        dom.Contains(val))
                    {
                        dom = dom.Difference(val);

                        if (dom.IsEmpty())
                        {
                            return(true);
                        }

                        domArray[idx] = dom;

                        if (dom.Interval.IsBound())
                        {
                            if (Update(domArray, idx))
                            {
                                return(true);
                            }
                        }
                    }
                }

                return(false);
            }
示例#4
0
 public void Difference6()
 {
     IntDomain c	= new IntDomain( 16, 47 );
     IntDomain a	= new IntDomain( c );
     IntDomain r	= a.Difference( new IntDomain( 48, 63 ) );
     Assert.AreEqual( r, c );
 }
示例#5
0
        public void Difference6()
        {
            IntDomain c = new IntDomain(16, 47);
            IntDomain a = new IntDomain(c);
            IntDomain r = a.Difference(new IntDomain(48, 63));

            Assert.AreEqual(r, c);
        }