예제 #1
0
            public static DisInterval EnumValues <Type>(Type t, Func <Type, List <int> > enumranges)
            {
                var ranges = enumranges(t);

                if (ranges != null)
                {
                    return(DisInterval.For(ranges.ConvertAll <Interval>(x => Interval.For(x))));
                }

                return(Ranges.Int32Range);
            }
        public override DisInterval Interval_Not(DisInterval left)
        {
            if (!left.IsNormal)
            {
                return(left);
            }
            // !(!0) is 0
            if (left.IsNotZero)
            {
                return(DisInterval.For(0));
            }
            // !(0) is !=0
            if (left.IsZero)
            {
                return(DisInterval.NotZero);
            }
            // !([0, +oo]) is [-oo, -1]
            if (left.IsPositiveOrZero)
            {
                return(DisInterval.Negative);
            }

            return(left);
        }
 protected override DisInterval ConvertInterval(Interval intv)
 {
     return(DisInterval.For(intv));
 }
 public override DisInterval For(Rational inf, Rational sup)
 {
     return(DisInterval.For(inf, sup));
 }
 public override DisInterval For(Rational r)
 {
     return(DisInterval.For(r));
 }
 public override DisInterval For(uint u)
 {
     return(DisInterval.For(u));
 }
 public override DisInterval For(sbyte s)
 {
     return(DisInterval.For(s));
 }
 public override DisInterval For(long v)
 {
     return(DisInterval.For(v));
 }
 public override DisInterval For(short v)
 {
     return(DisInterval.For(v));
 }
 public override DisInterval For(double d)
 {
     return(DisInterval.For(d));
 }
 public override DisInterval For(byte v)
 {
     return(DisInterval.For(v));
 }
 public override DisInterval IntervalLeftOpen(Rational sup)
 {
     return(DisInterval.For(Rational.MinusInfinity, sup));
 }
 public override DisInterval IntervalRightOpen(Rational inf)
 {
     return(DisInterval.For(inf, Rational.PlusInfinity));
 }
 public override DisInterval IntervalSingleton(Rational val)
 {
     return(DisInterval.For(val));
 }
 protected override DisIntervalEnvironment <Variable, Expression> TestEqualToZero(Variable v)
 {
     return(TestTrueEqualToDisinterval(v, DisInterval.For(0)));
 }