// private void FirstMakeR1PN() { for (Int16 i = 0; i < m33.Cols; i++) { if (m33.spc[i] == m33.spcmax) { R1pn r1 = new R1pn(rd.tpsn); r1.Add(i); rlist.Add(r1); } } }
// private void FirstMakeR1PN() { for (Int16 i = 0; i < rd.Cols; i++) { if (rd.spc[i] == mid1.maxSPC) { R1pn r1 = new R1pn(rd.tpsn); r1.Add(i); rlist.Add(r1); } } }
// 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); } } } }
public Mid_4_1(ref RawData r) { rd = r; mid4_1 = new int[rd.Cols]; mx_mn = new double[rd.Cols]; rlist = new R1pnList(); Array.Clear(mid4_1, 0, mid4_1.Length); sw = new StreamWriter(Common.debugpath + "\\" + "MID4_1.txt"); Common.printArray("MID4_1 :Rawdata %SP ", rd.PerSP, ref sw); sw.WriteLine("MID4_1: Average %SP : " + rd.APerSP.ToString("#####0.00")); // make mx_mn array for (int i = 0; i < rd.Cols; i++) { mx_mn[i] = rd.APerSP - rd.PerSP[i]; } // get the most number out of + values. int index = Common.MaxIndex(ref mx_mn); double val = mx_mn[index]; R1pn r1 = new R1pn(10); for (Int16 i = 0; i < rd.Cols; i++) { if (mx_mn[i] == val) { mid4_1[i] = 1; r1.Add(i); } } rlist.Add(r1); Common.printArray("MID4_1 :first", mid4_1, ref sw); // get the least number out of - values; index = Common.MinIndex(ref mx_mn); val = mx_mn[index]; r1 = new R1pn(10); for (Int16 i = 0; i < rd.Cols; i++) { if (mx_mn[i] == val) { mid4_1[i] = 1; r1.Add(i); } } rlist.Add(r1); Common.printArray("MID4_1 :second", mid4_1, ref sw); // get the least number out of + values; index = Common.MinIndexOutofPlus(ref mx_mn); val = mx_mn[index]; r1 = new R1pn(10); for (Int16 i = 0; i < rd.Cols; i++) { if (mx_mn[i] == val) { mid4_1[i] = 1; r1.Add(i); } } rlist.Add(r1); Common.printArray("MID4_1 :third", mid4_1, ref sw); // get the most number out of - values; index = Common.MaxIndexOutofMinus(ref mx_mn); val = mx_mn[index]; r1 = new R1pn(10); for (Int16 i = 0; i < rd.Cols; i++) { if (mx_mn[i] == val) { mid4_1[i] = 1; r1.Add(i); } } rlist.Add(r1); Common.printArray("MID4_1 :MX/MN", mx_mn, ref sw); Common.printArray("MID4_1 :MID4_1", mid4_1, ref sw); rlist.print(ref sw); }