Mercurial > hg > Members > tatsuki > Alice
changeset 229:4ece0dca75e7
minor change
author | sugi |
---|---|
date | Thu, 28 Mar 2013 21:43:42 +0900 |
parents | 9eaaca2b8a57 |
children | 23b062c43041 |
files | src/alice/test/codesegment/local/bitonicsort/DataList.java src/alice/test/codesegment/local/bitonicsort/MakeData.java src/alice/test/codesegment/local/bitonicsort/OddPhase.java src/alice/test/codesegment/local/bitonicsort/SetTask.java |
diffstat | 4 files changed, 21 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/src/alice/test/codesegment/local/bitonicsort/DataList.java Thu Mar 28 21:36:28 2013 +0900 +++ b/src/alice/test/codesegment/local/bitonicsort/DataList.java Thu Mar 28 21:43:42 2013 +0900 @@ -17,7 +17,7 @@ public DataList createDataList(int start, int size){ int[] table2 = new int[size]; - int end = start+size-1; + int end = start+size; for (int i=start,j=0;i<end;i++,j++){ table2[j] = table[i]; } @@ -37,6 +37,22 @@ } System.out.println(); } + + public void showData(int range){ + for(int i = 0;i<range;i++){ + System.out.print(table[i]+ " "); + + } + System.out.println(); + } + + public void showSize(){ + System.out.print("size is "+this.table.length+". "); + } + + public int getSize(){ + return this.table.length; + } public static void merge(DataList list1, DataList list2) { int[] t1 = list1.table;
--- a/src/alice/test/codesegment/local/bitonicsort/MakeData.java Thu Mar 28 21:36:28 2013 +0900 +++ b/src/alice/test/codesegment/local/bitonicsort/MakeData.java Thu Mar 28 21:43:42 2013 +0900 @@ -24,7 +24,7 @@ int size = conf.getLength(); Random rnd = new Random(); for (int i = 0; i < size; i++){ - list.table[i] = rnd.nextInt(100000); + list.table[i] = rnd.nextInt(100000)+10; } ods.update("list", list); }
--- a/src/alice/test/codesegment/local/bitonicsort/OddPhase.java Thu Mar 28 21:36:28 2013 +0900 +++ b/src/alice/test/codesegment/local/bitonicsort/OddPhase.java Thu Mar 28 21:43:42 2013 +0900 @@ -35,8 +35,8 @@ int i = info.range; - Sort.quickSort(list1,0,list1.table.length-1); - Sort.quickSort(list2,0,list2.table.length-1); + Sort.quickSort(list1); + Sort.quickSort(list2); DataList.merge(list1,list2); if (count%2==0&&i==0){
--- a/src/alice/test/codesegment/local/bitonicsort/SetTask.java Thu Mar 28 21:36:28 2013 +0900 +++ b/src/alice/test/codesegment/local/bitonicsort/SetTask.java Thu Mar 28 21:43:42 2013 +0900 @@ -22,10 +22,8 @@ int sort_count = conf.getSplitNum()*2; ods.put("sort_count", sort_count*2); - int block_num = (conf.getLength() + sort_count - 1 ) / sort_count; + int block_num = (conf.getLength() + sort_count- 1) / sort_count; ods.put("block_num", block_num); - int last_block_num = conf.getLength() - (sort_count - 1)*block_num; - ods.put("last_block_num", last_block_num); System.out.println("sort start"); t = System.currentTimeMillis();