code: private int increment(int[] setTo, int max, int curCount)
      {
          setTo[0]++;
          curCount++;
          
          if(curCount <= max)
              return curCount;
          
          int carryPos = 0;
          
          while(carryPos < setTo.length-1 && curCount > max)
          {
              curCount-=setTo[carryPos];
              setTo[carryPos] = 0;
              setTo[++carryPos]++;
              curCount++;
          }
          
          return curCount;
      }
docs: Increments the array to contain representation of the next combination of
  values in the polynomial
  
  @param setTo the array of values marking how many multiples of that value
  will be used in construction of the point
  @param max the degree of the polynomial
  @param curCount the current sum of all counts in the array <tt>setTo</tt>
  @return the new value of <tt>curCount</tt>