public void EmptyDifference() { IntDomain a = new IntDomain( 8, 55 ); Assert.IsTrue( a.Difference( a ).IsEmpty() ); Assert.AreEqual( a.Difference( new IntDomain() ), a ); }
public void EmptyDifference() { IntDomain a = new IntDomain(8, 55); Assert.IsTrue(a.Difference(a).IsEmpty()); Assert.AreEqual(a.Difference(new IntDomain()), a); }
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); }
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 ); }
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); }