Mercurial > hg > Members > tatsuki > Alice
changeset 208:a645cece5edc working
before use Flip in no arraylist
author | sugi |
---|---|
date | Tue, 26 Mar 2013 17:08:32 +0900 |
parents | 7dddff9fa7f3 |
children | 96110f25adcc |
files | src/alice/test/codesegment/local/bitonicsort/noarraylist/EvenPhase.java src/alice/test/codesegment/local/bitonicsort/noarraylist/MakeData.java src/alice/test/codesegment/local/bitonicsort/noarraylist/OddPhase.java src/alice/test/codesegment/local/bitonicsort/noarraylist/SetTask.java src/alice/test/codesegment/local/bitonicsort/noarraylist/ShowData.java src/alice/test/codesegment/local/bitonicsort/noarraylist/Sort.java |
diffstat | 6 files changed, 22 insertions(+), 23 deletions(-) [+] |
line wrap: on
line diff
--- a/src/alice/test/codesegment/local/bitonicsort/noarraylist/EvenPhase.java Tue Mar 26 13:08:45 2013 +0900 +++ b/src/alice/test/codesegment/local/bitonicsort/noarraylist/EvenPhase.java Tue Mar 26 17:08:32 2013 +0900 @@ -44,11 +44,11 @@ if (info2==null){ DataList list = (DataList)info1.obj; if (count > sort_count){ - info1.flip(CommandType.UPDATE, "array"+info.range, list ,false); + ods.update("array"+info.range, list ,false); return; } - info1.flip(CommandType.PUT, info.range+"f", "dummy"); - info3.flip(CommandType.PUT, info.range+"b", list, false); + ods.put(info.range+"f", "dummy"); + ods.put(info.range+"b", list, false); //System.out.println("next Odd "+info.range+" "+info.range+"b"+" "+(info.range+1)+"f"); new OddPhase(info0.key,info.range+"b",(info.range+1)+"f",count,info6.key); } else { @@ -60,25 +60,25 @@ System.arraycopy(list2.table, 0, list3.table, list1.table.length, list2.table.length); if (count > sort_count){ - info1.flip(CommandType.UPDATE, "array"+info.range, list3 ,false); + ods.update("array"+info.range, list3 ,false); return; } int block_num = info3.asInteger(); Sort.quickSort(list3, 0, list3.table.length-1); if (!info.lastFlag){ - info1.flip(CommandType.PUT, info.range+"f", list3.createDataList(0, block_num/2) ,false); - info2.flip(CommandType.PUT, info.range+"b", list3.createDataList(block_num/2, block_num/2),false); + ods.put(info.range+"f", list3.createDataList(0, block_num/2) ,false); + ods.put(info.range+"b", list3.createDataList(block_num/2, block_num/2),false); //System.out.println("next Odd "+info.range+" "+ info.range+"b"+" "+(info.range+1)+"f"); new OddPhase(info0.key,info.range+"b",(info.range+1)+"f",count,info6.key); } else { int last_block_num = info4.asInteger(); - info1.flip(CommandType.PUT, info.range+"f", list3.createDataList(0, block_num/2) ,false); - info2.flip(CommandType.PUT, info.range+"b", list3.createDataList(block_num/2, last_block_num) ,false); + ods.put(info.range+"f", list3.createDataList(0, block_num/2) ,false); + ods.put(info.range+"b", list3.createDataList(block_num/2, last_block_num) ,false); //System.out.println("next Odd "+info.range+" "+ info.range+"b"); new OddPhase(info0.key ,info.range+"b",count,info6.key); } } - info6.flip(CommandType.UPDATE, info6.key, count+1); + ods.update(info6.key, count+1); } }
--- a/src/alice/test/codesegment/local/bitonicsort/noarraylist/MakeData.java Tue Mar 26 13:08:45 2013 +0900 +++ b/src/alice/test/codesegment/local/bitonicsort/noarraylist/MakeData.java Tue Mar 26 17:08:32 2013 +0900 @@ -25,6 +25,6 @@ for (int i = 0; i < size; i++){ list.table[i] = rnd.nextInt(100000); } - info2.flip(CommandType.UPDATE, "list", list, false); + ods.update("list", list, false); } }
--- a/src/alice/test/codesegment/local/bitonicsort/noarraylist/OddPhase.java Tue Mar 26 13:08:45 2013 +0900 +++ b/src/alice/test/codesegment/local/bitonicsort/noarraylist/OddPhase.java Tue Mar 26 17:08:32 2013 +0900 @@ -43,13 +43,13 @@ if (info2==null){ DataList list = (DataList)info1.obj; if (count > sort_count){ - info1.flip(CommandType.UPDATE, "array"+info.range, list, false); + ods.update("array"+info.range, list, false); return; } Sort.quickSort(list,0,list.table.length-1); if (!info.lastFlag){ - info1.flip(CommandType.PUT, info.range+"f", list.createDataList(0, block_num/2) ,false); - info3.flip(CommandType.PUT, info.range+"b", list.createDataList(block_num/2, block_num/2) ,false); + ods.put(info.range+"f", list.createDataList(0, block_num/2) ,false); + ods.put(info.range+"b", list.createDataList(block_num/2, block_num/2) ,false); if (info.range==0){ //System.out.println("next Even "+info.range+" "+info.range+"f"); @@ -59,8 +59,8 @@ new EvenPhase(info0.key,(info.range-1)+"b",info.range+"f",count,info6.key); } } else { - info1.flip(CommandType.PUT, info.range+"f",list, false); - info3.flip(CommandType.PUT, info.range+"b","dummy"); + ods.put(info.range+"f",list, false); + ods.put(info.range+"b","dummy"); //System.out.println("next Even "+info.range+" "+ (info.range-1)+"b"+" "+(info.range)+"f"); new EvenPhase(info0.key,(info.range-1)+"b",info.range+"f",count,info6.key); } @@ -74,13 +74,13 @@ System.arraycopy(list2.table, 0, list3.table, list1.table.length, list2.table.length); if (count > sort_count){ - info1.flip(CommandType.UPDATE, "array"+info.range, list3, false); + ods.update("array"+info.range, list3, false); return; } Sort.quickSort(list3,0,list3.table.length-1); - info1.flip(CommandType.PUT, info.range+"f", list3.createDataList(0, block_num/2) ,false); - info2.flip(CommandType.PUT, info.range+"b", list3.createDataList(block_num/2, block_num/2) ,false); + ods.put(info.range+"f", list3.createDataList(0, block_num/2) ,false); + ods.put(info.range+"b", list3.createDataList(block_num/2, block_num/2) ,false); if (info.range==0){ //System.out.println("next Even2b "+info.range+" "+ info.range+"f"); @@ -90,7 +90,7 @@ new EvenPhase(info0.key,(info.range-1)+"b",info.range+"f",count,info6.key); } } - info6.flip(CommandType.UPDATE, info6.key, count+1); + ods.update(info6.key, count+1); } }
--- a/src/alice/test/codesegment/local/bitonicsort/noarraylist/SetTask.java Tue Mar 26 13:08:45 2013 +0900 +++ b/src/alice/test/codesegment/local/bitonicsort/noarraylist/SetTask.java Tue Mar 26 17:08:32 2013 +0900 @@ -21,7 +21,6 @@ int sort_count = conf.getSplitNum(); ods.put("sort_count", sort_count*2); - int block_num = (conf.getLength() + conf.getSplitNum() - 1 ) / sort_count; ods.put("block_num", block_num);
--- a/src/alice/test/codesegment/local/bitonicsort/noarraylist/ShowData.java Tue Mar 26 13:08:45 2013 +0900 +++ b/src/alice/test/codesegment/local/bitonicsort/noarraylist/ShowData.java Tue Mar 26 17:08:32 2013 +0900 @@ -34,7 +34,7 @@ int start = 0; for (int i= 0;i < cnt; i++){ - DataList dlist = (DataList)info[i].obj; + DataList dlist = (DataList)info[i].obj; System.arraycopy(dlist.table, 0, list.table, start, dlist.table.length); start += dlist.table.length; }
--- a/src/alice/test/codesegment/local/bitonicsort/noarraylist/Sort.java Tue Mar 26 13:08:45 2013 +0900 +++ b/src/alice/test/codesegment/local/bitonicsort/noarraylist/Sort.java Tue Mar 26 17:08:32 2013 +0900 @@ -9,7 +9,7 @@ int p = 0; while(true){ while(begin < end){ - if (end-begin< 200){ + if (end-begin< 150){ bubbleSort(data,begin,end); break; } else { @@ -53,7 +53,7 @@ System.out.println("checking ...."); for (int i = 0; i< data.table.length-1; i++){ if (data.table[i] > data.table[i+1]){ - System.out.println("MISS "+data.table[i]+" > "+data.table[i+1]+" Position is "+i); + System.out.println("MISS "+data.table[i]+" > "+data.table[i+1]+"Position is "+i); return; } }