Package cc.redberry.core.combinatorics

Examples of cc.redberry.core.combinatorics.Permutation


        else
            ArraysUtils.insertionSort(types, sortPermutation);

        final int size = data.size();

        Permutation sort = new Permutation(sortPermutation);

        final Symmetry[] resulting = new Symmetry[symmetries.size() - 1];
        int i, j;
        int[] permutation;
        IntArrayList current;
        //0th is identity identity
        for (i = 1; i < resulting.length + 1; ++i) {
            current = symmetries.get(i).list;
            permutation = new int[size];
            for (j = 0; j < size; ++j)
                permutation[j] = sort.inverse().newIndexOf(current.get(sort.newIndexOf(j)));
            resulting[i - 1] = new Symmetry(permutation, symmetries.get(i).sign);
        }
        SimpleIndices simpleIndices = IndicesFactory.createSimple(indices);
        simpleIndices.getSymmetries().addAllUnsafe(resulting);
        return simpleIndices;
View Full Code Here

TOP

Related Classes of cc.redberry.core.combinatorics.Permutation

Copyright © 2018 www.massapicom. 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.