Exemplo n.º 1
0
        public static Obj CreateMap(Obj[] keys, Obj[] vals, long count)
        {
            Obj binRel = CreateBinRel(keys, vals, count);

            if (!binRel.IsEmptyRel() && !binRel.IsNeMap())
            {
                BinRelIter iter = binRel.GetBinRelIter();
                //## REMOVE WHEN DONE
                while (!iter.Done())
                {
                    Console.WriteLine(iter.Get1().ToString());
                    iter.Next();
                }
                throw new Exception();
            }
            return(binRel);
        }
Exemplo n.º 2
0
        public void Set(Obj value, bool flipped)
        {
            Clear();
            Miscellanea.Assert(insertList.Count == 0);
            BinRelIter it = value.GetBinRelIter();

            while (!it.Done())
            {
                Obj val1  = flipped ? it.Get2() : it.Get1();
                Obj val2  = flipped ? it.Get1() : it.Get2();
                int surr1 = store1.LookupValueEx(val1);
                if (surr1 == -1)
                {
                    surr1 = store1.Insert(val1);
                }
                int surr2 = store2.LookupValueEx(val2);
                if (surr2 == -1)
                {
                    surr2 = store2.Insert(val2);
                }
                insertList.Add(new Tuple((uint)surr1, (uint)surr2));
                it.Next();
            }
        }