All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.paukov.combinatorics3.Generator Maven / Gradle / Ivy

There is a newer version: 3.4.0
Show newest version
/**
 * Combinatorics Library 3
 * Copyright 2009-2016 Dmytro Paukov [email protected]
 */
package org.paukov.combinatorics3;


import java.util.Arrays;
import java.util.Collection;
import java.util.List;


public class Generator {

    public static  CombinationGenerator combination(T... args) {
        return new CombinationGenerator<>(Arrays.asList(args));
    }

    public static  CombinationGenerator combination(Collection collection) {
        return new CombinationGenerator<>(collection);
    }

    public static  PermutationGenerator permutation(T... args) {
        return new PermutationGenerator<>(Arrays.asList(args));
    }

    public static  PermutationGenerator permutation(Collection collection) {
        return new PermutationGenerator<>(collection);
    }

    public static  SubSetGenerator subset(Collection collection) {
        return new SubSetGenerator<>(collection);
    }

    public static  SubSetGenerator subset(T... args) {
        return new SubSetGenerator<>(Arrays.asList(args));
    }

    public static IGenerator> partition(Integer value) {
        return new IntegerPartitionGenerator(value);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy