view src/alice/test/codesegment/local/mergesort/SortStart.java @ 155:0979827c859b working

Add bitonic sort. But can not execute.
author sugi
date Mon, 10 Dec 2012 19:36:39 +0900
parents src/alice/test/codesegment/local/mergesort/StartSort.java@d6afa779dd49
children 4fd7d0caf7e3
line wrap: on
line source

package alice.test.codesegment.local.mergesort;

import java.io.IOException;
import java.util.Random;

import alice.codesegment.CodeSegment;
import alice.codesegment.SingletonMessage;

public class SortStart extends CodeSegment{
	public static long t;
	SortConfig conf;
	public SortStart(SortConfig conf){
		this.conf = conf;
	}
	
	@Override
	public void run() {
		int size = conf.size;
		int[] array = new int[size];
		for (int i=0;i< size; i++){
			Random rnd = new Random();
			array[i] = rnd.nextInt(Integer.MAX_VALUE);
		}
		if (conf.flag){
			try {
				System.out.println(SingletonMessage.getInstance().unconvert(array));
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
		String key = Integer.toString(0);
		ods.put("local", key, array);
	
		new SeparateArray(0);
		new ShowResult(0);
		t = System.currentTimeMillis();
	}

}