示例#1
0
        // process a subset.
        private void Find_Next_R1pn_Set(R1pn r1)
        {
            // make subtable and SPC
            int[] spc = new int[m33.Cols];
            Array.Clear(spc, 0, spc.Length);
            for (int i = 0; i < m33.Rows; i++)
            {
                if (IsAllofR1pn_1(i, r1))
                {
                    for (int j = 0; j < m33.Cols; j++)
                    {
                        if (m33.rawdata[i, j] > 0)
                        {
                            spc[j] += m33.rawdata[i, j];
                        }
                    }
                }
            }

            //Common.printArray("Find_Next_R1pn_Set:SPC(1)", ref spc, ref sw);

            // clear prev reference
            R1pn prev = rlist.rList[r1.indexofbaseR1pn];

            for (int i = 0; i < prev.cp; i++)
            {
                spc[prev.r1pn[i]] = 0;
            }

            //Common.printArray("Find_Next_R1pn_Set:SPC(2)", ref spc, ref sw);

            // get the spcs with the maximum value.
            int max = Common.MaxValue(ref spc);

            // make next R1pn with checking the same R1pn in the rlist.
            // put new R1pns' into the rnext list
            for (Int16 i = 0; i < spc.Length; i++)
            {
                if (spc[i] == max && max >= 1)  // 중요한 부분임...   threshhold값에 따라 결과가 많이 달라짐.
                {
                    R1pn new1 = new R1pn(rd.tpsn);
                    new1.CopyFrom(prev);
                    new1.Add(i);
                    if (!rnext.IsExist(ref new1))
                    {
                        rnext.Add(new1);
                    }
                }
            }
        }
示例#2
0
        // Make subset list from the R1pn.
        // for example,  (11,25, 39, 20)  => {(11,25,39,20), (25,39,20), (39,20), (20)}
        private void MakeSubsetofR1pn(ref R1pnList rsubset, int indexofbaseR1pn, R1pn r1)
        {
            int  count = r1.cp;
            R1pn r2    = new R1pn(r1.r1pn.Length);

            r2.CopyFrom(r1);
            for (int i = 0; i < count; i++)
            {
                if (!rsubset.IsExist(ref r2))  //check if rsubset already has the r2.
                {
                    R1pn new1 = new R1pn(r1.r1pn.Length);
                    new1.CopyFrom(r2);
                    new1.indexofbaseR1pn = indexofbaseR1pn;
                    rsubset.Add(new1);
                }
                r2.ShiftLeft_1();
                if (r2.cp <= 0)
                {
                    break;
                }
            }
        }