Exemplo n.º 1
0
        Pair <OrderedSequence <T, M>, OrderedSequence <T, M> > Partition(M vK)
        {
            Pair <FTreeM <OrderedElement <T, M>, M>, FTreeM <OrderedElement <T, M>, M> > baseSeqSplit = _tree.SeqSplit(new MPredicate <M>(FP.Curry <M, M, bool>(LessThanOrEqual2, vK)));

            var left = new OrderedSequence <T, M>(_key, baseSeqSplit.First);

            var right = new OrderedSequence <T, M>(_key, baseSeqSplit.Second);

            return(new Pair <OrderedSequence <T, M>, OrderedSequence <T, M> >(left, right));
        }
Exemplo n.º 2
0
        public OrderedSequence <T, M> DeleteAll(T t)
        {
            M vK = _key.Accessor(t);             // the Key of t

            Pair <OrderedSequence <T, M>, OrderedSequence <T, M> > tPart = Partition(vK);

            OrderedSequence <T, M> seqPrecedestheEl   = tPart.First;
            OrderedSequence <T, M> seqStartsWiththeEl = tPart.Second;

            Pair <FTreeM <OrderedElement <T, M>, M>, FTreeM <OrderedElement <T, M>, M> > lastTreeSplit
                = seqStartsWiththeEl._tree.SeqSplit(new MPredicate <M>(FP.Curry <M, M, bool>(LessThan2, vK)));

            //OrderedSequence<T, V> seqBeyondtheEl =
            //    new OrderedSequence<T, V>(KeyObj, lastTreeSplit.second);

            return(new OrderedSequence <T, M>(_key, seqPrecedestheEl._tree.Merge(lastTreeSplit.Second)));
        }
Exemplo n.º 3
0
        public OrderedSequence <T, M> Merge(OrderedSequence <T, M> other)
        {
            FTreeM <OrderedElement <T, M>, M> merged = OrdMerge(_tree, other._tree);

            return(new OrderedSequence <T, M>(_key, merged));
        }