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

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

/*
 * Combinatorics Library 3
 * Copyright 2009-2016 Dmytro Paukov [email protected]
 */
package org.paukov.combinatorics3;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;


class PermutationWithRepetitionGenerator implements IGenerator> {

  final List originalVector;
  final int permutationLength;

  PermutationWithRepetitionGenerator(
      Collection originalVector, int permutationLength) {
    this.originalVector = new ArrayList<>(originalVector);
    this.permutationLength = permutationLength;
  }

  @Override
  public Iterator> iterator() {
    return new PermutationWithRepetitionIterator<>(this);
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy