net.ericaro.neoitertools.generators.combinatorics
Class FixedSumNumber

java.lang.Object
  extended by net.ericaro.neoitertools.generators.combinatorics.BigNumber
      extended by net.ericaro.neoitertools.generators.combinatorics.FixedSumNumber
All Implemented Interfaces:
Generator<int[]>

public class FixedSumNumber
extends BigNumber

A Combinatorial Number is a BigNumber where the sum of all digits must be <= total -size. There are combination(total, size) of them (what a coincidence ;-) ). Digits can be seen as the distance between two successive indices on a combination.

Author:
eric
See Also:
FixedSumNumber's wiki page, neoitertools site

Field Summary
 
Fields inherited from class net.ericaro.neoitertools.generators.combinatorics.BigNumber
base, size
 
Constructor Summary
FixedSumNumber(int total, int size)
           
 
Method Summary
protected  void inc()
          increment this big number by one
 
Methods inherited from class net.ericaro.neoitertools.generators.combinatorics.BigNumber
next, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FixedSumNumber

public FixedSumNumber(int total,
                      int size)
Method Detail

inc

protected void inc()
Description copied from class: BigNumber
increment this big number by one

Specified by:
inc in class BigNumber


Copyright © 2011. All Rights Reserved.