Exemple #1
0
 public WaveletInner(WaveletInner parent, bool building)
     : base(parent)
 {
     if (building) {
         this.B = new FakeBitmap ();
     }
     this.Left = null;
     this.Right = null;
 }
Exemple #2
0
 void SaveNode(BinaryWriter Output, WaveletNode node)
 {
     var asInner = node as WaveletInner;
     if (asInner != null) {
         // isInner?
         Output.Write (true);
         RankSelectGenericIO.Save (Output, asInner.B);
         // since it uses pointers the extra-space by booleans is a better reflect of the
         // memory usage than a compact representation of the node
         if (asInner.Left == null) {
             Output.Write (false);
         } else {
             Output.Write (true);
             SaveNode (Output, asInner.Left);
         }
         if (asInner.Right == null) {
             Output.Write (false);
         } else {
             Output.Write (true);
             SaveNode (Output, asInner.Right);
         }
     } else {
         Output.Write (false);
         var asLeaf = node as WaveletLeaf;
         Output.Write ((int)asLeaf.Count);
         Output.Write ((int)asLeaf.Symbol);
     }
 }
Exemple #3
0
 public WaveletNode(WaveletNode parent)
 {
     this.Parent = parent;
 }