public static Codec<int[], IntegerGene> ofVector(final IntRange... domains) {
		if (domains.length == 0) {
			throw new IllegalArgumentException("Domains must not be empty.");
		}

		final ISeq<IntegerChromosome> chromosomes = Stream.of(domains)
			.peek(Objects::requireNonNull)
			.map(IntegerGene::of)
			.map(IntegerChromosome::of)
			.collect(ISeq.toISeq());

		return Codec.of(
			Genotype.of(chromosomes),
			gt -> {
				final int[] args = new int[gt.length()];
				for (int i = gt.length(); --i >= 0;) {
					args[i] = gt.getChromosome(i).getGene().intValue();
				}
				return args;
			}
		);
	}
public static Codec < int [ ] , IntegerGene > ofVector ( final IntRange ... domains ) { if ( domains . length == 0 ) { throw new IllegalArgumentException ( "Domains must not be empty." ) ; } final ISeq < IntegerChromosome > chromosomes = Stream . of ( domains ) . peek ( Objects :: requireNonNull ) . map ( IntegerGene :: of ) . map ( IntegerChromosome :: of ) . collect ( ISeq . toISeq ( ) ) ; return Codec . of ( Genotype . of ( chromosomes ) , gt -> { final int [ ] args = new int [ gt . length ( ) ] ; for ( int i = gt . length ( ) ; -- i >= 0 ; ) { args [ i ] = gt . getChromosome ( i ) . getGene ( ) . intValue ( ) ; } return args ; } ) ; }
Create a vector {@code Codec} for the given ranges. Each vector element
might have a different domain. The vector length is equal to the number
of domains.

@param domains the domain ranges
@return a new vector {@code Codec}
@throws NullPointerException if one of the arguments is {@code null}
@throws IllegalArgumentException if the {@code domains} array is empty