Package cc.redberry.core.combinatorics

Examples of cc.redberry.core.combinatorics.PermutationsProvider$Util


    public static boolean compareArrays(final Object[] array1, final Object[] array2) {
        int size;
        if ((size = array1.length) != array2.length)
            return false;
        PermutationsProvider provider = generateProvider(array1);
        int[] nonPermutablePositions = PermutationsProvider.Util.getNonpermutablePositions(size, provider);
        for (int i : nonPermutablePositions)
            if (!array1[i].equals(array2[i]))
                return false;
        int[] targetPositions = provider.targetPositions();
        out_for:
        for (Permutation permutation : provider.allPermutations()) {
            for (int i = 0; i < targetPositions.length; ++i)
                if (!array1[targetPositions[i]].equals(array2[targetPositions[permutation.newIndexOf(i)]]))
                    continue out_for;
            return true;
        }
View Full Code Here


    //
    resourceSet
        .getResourceFactoryRegistry()
        .getExtensionToFactoryMap()
        .put(Resource.Factory.Registry.DEFAULT_EXTENSION,
            new _40ResourceFactoryImpl());

    // Register the package to ensure it is available during loading.
    //
    resourceSet.getPackageRegistry().put(_40Package.eNS_URI,
        _40Package.eINSTANCE);
View Full Code Here

    // Register the appropriate resource factory to handle all file
    // extensions.
    //
    resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap()
        .put(Resource.Factory.Registry.DEFAULT_EXTENSION,
            new _40ResourceFactoryImpl());
   
   
    // Register the package to ensure it is available during loading.
    //
    resourceSet.getPackageRegistry().put(_40Package.eNS_URI,
View Full Code Here

    // Register the appropriate resource factory to handle all file
    // extensions.
    //
    resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap()
        .put(Resource.Factory.Registry.DEFAULT_EXTENSION,
            new _40ResourceFactoryImpl());
   
   
    // Register the package to ensure it is available during loading.
    //
    resourceSet.getPackageRegistry().put(_40Package.eNS_URI,
View Full Code Here

TOP

Related Classes of cc.redberry.core.combinatorics.PermutationsProvider$Util

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.