Exemplo n.º 1
0
        internal double FindMinimum(Key from, Key to)
        {
            if (Predicates.LessOrEqual(from, From) && Predicates.LessOrEqual(To, to))
            {
                return(Minimum);
            }
            if (Predicates.Less(to, From) || Predicates.More(from, To))
            {
                return(double.PositiveInfinity);
            }

            if ((null != FirstChild) && (null != SecondChild))
            {
                double first  = FirstChild.FindMinimum(from, to);
                double second = SecondChild.FindMinimum(from, to);
                double result = Math.Min(first, second);
                return(result);
            }
            if (Predicates.LessOrEqual(from, To))
            {
                return(Close);
            }
            if (Predicates.MoreOrEqual(to, From))
            {
                return(Open);
            }
            return(double.PositiveInfinity);
        }