Beispiel #1
0
 public Iter123(Sym12TernaryTable table) : base(table, 0)
 {
     end = table.Capacity();
     while (table.Arg2OrEmptyMarker(index) == Empty)
     {
         index++;
         if (index == end)
         {
             index = Empty;
             break;
         }
     }
 }
Beispiel #2
0
        //////////////////////////////////////////////////////////////////////////////
        //////////////////////////////////////////////////////////////////////////////

        public static Obj Copy(Sym12TernaryTable[] tables)
        {
            int count = 0;

            for (int i = 0; i < tables.Length; i++)
            {
                count += tables[i].count;
            }

            if (count == 0)
            {
                return(EmptyRelObj.singleton);
            }

            Obj[] col1 = new Obj[count];
            Obj[] col2 = new Obj[count];
            Obj[] col3 = new Obj[count];

            int next = 0;

            for (int iT = 0; iT < tables.Length; iT++)
            {
                Sym12TernaryTable table    = tables[iT];
                SurrObjMapper     mapper12 = table.mapper12;
                SurrObjMapper     mapper3  = table.mapper3;
                int size = table.Capacity();
                for (int iS = 0; iS < size; iS++)
                {
                    int arg2 = table.Arg2OrEmptyMarker(iS);
                    if (arg2 != Empty)
                    {
                        col1[next] = mapper12(table.Arg1OrNext(iS));
                        col2[next] = mapper12(arg2);
                        col3[next] = mapper3(table.Arg3(iS));
                        next++;
                    }
                }
            }
            Debug.Assert(next == count);

            return(Builder.CreateTernRel(col1, col2, col3, count));
        }