org.uacalc.util
Class SequenceGenerator

java.lang.Object
  extended by org.uacalc.util.SequenceGenerator

public final class SequenceGenerator
extends java.lang.Object

This has utility static methods for sequence generation, including nondecreasing sequences. It also includes an in-place ArrayIncrementor.


Constructor Summary
protected SequenceGenerator()
           
 
Method Summary
static ArrayIncrementor increasingSequenceIncrementor(int[] a, int max)
          his increments an array in place through all strictly increasing sequences whose entries lie between 0 and max, inclusive.
static ArrayIncrementor leftSequenceIncrementor(int[] a, int max)
          This just increments the array through all possible tuples with entries between 0 and max from the left.
static void main(java.lang.String[] args)
           
static ArrayIncrementor nondecreasingSequenceIncrementor(int[] a, int max)
          This increments an array in place through all nondecreasing sequences whose entries lie between 0 and max, inclusive.
static ArrayIncrementor nondecreasingSequenceIncrementor(int[] a, int max, int lastMin)
          This increments an array in place through all nondecreasing sequences whose entries lie between 0 and max, inclusive, subject to the restrction that last coordiate is at least lastMin (useful when the first part of a list is known to be closed).
static ArrayIncrementor sequenceIncrementor(int[] a, int max)
          This just increments the array through all possible tuples with entries between 0 and max.
static ArrayIncrementor sequenceIncrementor(int[] a, int max, int min)
          This just increments the array through all possible tuples with entries between 0 and max and having at least one entry at least as large as min.
static ArrayIncrementor sequenceIncrementor(int[] a, int max, int min, int jump)
          This just increments the array through all possible tuples with entries between 0 and max and having at least one entry at least as large as min.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SequenceGenerator

protected SequenceGenerator()
Method Detail

nondecreasingSequenceIncrementor

public static ArrayIncrementor nondecreasingSequenceIncrementor(int[] a,
                                                                int max)
This increments an array in place through all nondecreasing sequences whose entries lie between 0 and max, inclusive.


nondecreasingSequenceIncrementor

public static ArrayIncrementor nondecreasingSequenceIncrementor(int[] a,
                                                                int max,
                                                                int lastMin)
This increments an array in place through all nondecreasing sequences whose entries lie between 0 and max, inclusive, subject to the restrction that last coordiate is at least lastMin (useful when the first part of a list is known to be closed).


increasingSequenceIncrementor

public static ArrayIncrementor increasingSequenceIncrementor(int[] a,
                                                             int max)
his increments an array in place through all strictly increasing sequences whose entries lie between 0 and max, inclusive.

Parameters:
a -
max -
Returns:

sequenceIncrementor

public static ArrayIncrementor sequenceIncrementor(int[] a,
                                                   int max)
This just increments the array through all possible tuples with entries between 0 and max. This increments from the right: [0,0,0], [0,0,1], ...,[max,max,max].


sequenceIncrementor

public static ArrayIncrementor sequenceIncrementor(int[] a,
                                                   int max,
                                                   int min)
This just increments the array through all possible tuples with entries between 0 and max and having at least one entry at least as large as min. This increments from the right: * [0,0,0], [0,0,1], ...,[max,max,max]. Of course min should be at most max.


sequenceIncrementor

public static ArrayIncrementor sequenceIncrementor(int[] a,
                                                   int max,
                                                   int min,
                                                   int jump)
This just increments the array through all possible tuples with entries between 0 and max and having at least one entry at least as large as min. This increments from the right: * [0,0,0], [0,0,1], ...,[max,max,max]. Of course min should be at most max. jump indicates how many times the array will be incremented by each call to increment(). This is used in parallel processing.


leftSequenceIncrementor

public static ArrayIncrementor leftSequenceIncrementor(int[] a,
                                                       int max)
This just increments the array through all possible tuples with entries between 0 and max from the left. This increments from the left: [0,0,0], [1,0,0], ..., [max,max,max].


main

public static void main(java.lang.String[] args)


Copyright 2003 Ralph Freese. All Rights Reserved.