A wavelet tree (implementation with pointers/references)
Inheritance: Sequence
Example #1
0
        public static SequenceBuilder GetWT(
			BitmapFromBitStream bitmap_builder = null,
			Func<int, IIEncoder32> get_coder = null
		)
        {
            if (bitmap_builder == null) {
                bitmap_builder = BitmapBuilders.GetGGMN_wt(16);
            }
            return delegate (IList<int> seq, int sigma) {
                var wt = new WaveletTree ();
                wt.BitmapBuilder = bitmap_builder;
                // var enc = new BinaryCoding (numbits);
                IIEncoder32 enc;
                if (get_coder == null) {
                    int numbits = (int)Math.Ceiling (Math.Log (sigma, 2));
                    enc = new BinaryCoding (numbits);
                } else {
                    enc = get_coder(sigma);
                }
                wt.Build (seq, sigma, enc);
                return wt;
            };
        }
Example #2
0
 public static SequenceBuilder GetWT_BinaryCoding(BitmapFromBitStream bitmap_builder)
 {
     return delegate (IList<int> seq, int sigma) {
         var wt = new WaveletTree ();
         wt.BitmapBuilder = bitmap_builder;
         int numbits = (int)Math.Ceiling (Math.Log (sigma, 2));
         var enc = new BinaryCoding (numbits);
         wt.Build (enc, sigma, seq);
         return wt;
     };
 }
Example #3
0
        public static SequenceBuilder GetWT_GGMN_BinaryCoding(short b)
        {
            return delegate (IList<int> seq, int sigma) {
                var wt = new WaveletTree ();
                wt.BitmapBuilder = BitmapBuilders.GetGGMN_wt (b);
                int numbits = (int)Math.Ceiling (Math.Log (sigma, 2));
                var enc = new BinaryCoding (numbits);
                wt.Build (enc, sigma, seq);
                return wt;

            };
        }
Example #4
0
        public static SequenceBuilder GetWT(
			BitmapFromBitStream bitmap_builder,
			Func<int, IIEncoder32> get_coder
		)
        {
            return delegate (IList<int> seq, int sigma) {
                var wt = new WaveletTree ();
                wt.BitmapBuilder = bitmap_builder;
                var enc = get_coder (sigma);
                // var enc = new BinaryCoding (numbits);
                wt.Build (enc, sigma, seq);
                return wt;

            };
        }