Class PowerSet


  • public class PowerSet
    extends Object
    Given a set of ranges, {0..1,0..1,0..2}, say, generate all possible lists of values 0,0,0 0,0,1 0,0,2 0,1,0 0,1,1 0,1,2 1,0,0 1,0,1 1,0,2 1,1,0 1,1,1 1,1,2 The ranges are all assumed to run from 0 upto but not including some max, so above would be generated from {2,2,3}.
    • Field Detail

      • DEBUG

        protected static boolean DEBUG
      • powerset

        protected long[][] powerset
      • sizes

        protected long[] sizes
      • rank

        protected int rank
      • totalsize

        protected long totalsize
    • Constructor Detail

      • PowerSet

        public PowerSet​(long[] sizes)
      • PowerSet

        public PowerSet​(long[] sizes,
                        int count)
    • Method Detail

      • getTotalSize

        public long getTotalSize()
      • getPowerSet

        public long[][] getPowerSet()
      • generate

        protected void generate()
      • main

        public static void main​(String[] argv)