Package gnu.trove.list.array

Examples of gnu.trove.list.array.TIntArrayList.shuffle()


//        graph[i][start] = true;
        TIntArrayList nodes = new TIntArrayList(size);
        for (int i = 0; i < size; i++) {
            nodes.add(i);
        }
        nodes.shuffle(rand);
        for (int i = 0; i < size - 1; i++) {
            graph[nodes.get(i)][nodes.get(i + 1)] = true;
        }
        graph[nodes.get(size - 1)][nodes.get(0)] = true;
    }
View Full Code Here


    public static Domain buildSetDomain(int ds, Random r, double density, boolean homogeneou) {
        int[] env = buildFullDomains(1, 0, ds, r, density, homogeneou)[0];
        int nbK = r.nextInt(env.length);
        TIntArrayList l = new TIntArrayList(env);
        l.shuffle(r);
        int[] ker = new int[nbK];
        for (int i = 0; i < nbK; i++) {
            ker[i] = l.get(i);
        }
        return new Domain(env, ker);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.