Esempio n. 1
0
        public Deep(Measured <T, M> measured, M size, Digit <T, M> prefix, FingerTree <Node <T, M>, M> middle,
                    Digit <T, M> suffix)
            : base(measured, size)
        {
            _mk = new MakeTree <T, M>(measured);

            _prefix = prefix;
            _middle = middle;
            _suffix = suffix;
        }
Esempio n. 2
0
 public DeepFTree(Digit <T> frontDig, FTree <Node <T> > innerFT, Digit <T> backDig)
 {
     if (frontDig.digNodes.Count > 0)
     {
         this.frontDig = frontDig;
         this.innerFT  = innerFT;
         this.backDig  = backDig;
     }
     else
     {
         throw new Exception("The DeepFTree() constructor is passed an empty frontDig !");
     }
 }
Esempio n. 3
0
        static FingerTree <Node <Node <T, M>, M>, M> AddDigits4 <T, M>(Measured <Node <T, M>, M> m,
                                                                       FingerTree <Node <Node <T, M>, M>, M> m1,
                                                                       Digit <Node <T, M>, M> x, Node <T, M> n1, Node <T, M> n2,
                                                                       Node <T, M> n3, Node <T, M> n4, Digit <Node <T, M>, M> y,
                                                                       FingerTree <Node <Node <T, M>, M>, M> m2)
        {
            var mk = new MakeTree <Node <T, M>, M>(m);

            return(x.Match(x1 => y.Match(y1 => Append2(m, m1, mk.Node3(x1.V, n1, n2), mk.Node3(n3, n4, y1.V), m2),
                                         y2 => Append3(m, m1, mk.Node3(x1.V, n1, n2), mk.Node2(n3, n4),
                                                       mk.Node2(y2.V1, y2.V2), m2),
                                         y3 => Append3(m, m1, mk.Node3(x1.V, n1, n2), mk.Node3(n3, n4, y3.V1),
                                                       mk.Node2(y3.V2, y3.V3), m2),
                                         y4 => Append3(m, m1, mk.Node3(x1.V, n1, n2), mk.Node3(n3, n4, y4.V1),
                                                       mk.Node3(y4.V2, y4.V3, y4.V4), m2)),
                           x2 => y.Match(y1 => Append3(m, m1, mk.Node3(x2.V1, x2.V2, n1), mk.Node2(n2, n3),
                                                       mk.Node2(n4, y1.V), m2),
                                         y2 => Append3(m, m1, mk.Node3(x2.V1, x2.V2, n1), mk.Node3(n2, n3, n4),
                                                       mk.Node2(y2.V1, y2.V2), m2),
                                         y3 => Append3(m, m1, mk.Node3(x2.V1, x2.V2, n1), mk.Node3(n2, n3, n4),
                                                       mk.Node3(y3.V1, y3.V2, y3.V3), m2),
                                         y4 => Append4(m, m1, mk.Node3(x2.V1, x2.V2, n1), mk.Node3(n2, n3, n4),
                                                       mk.Node2(y4.V1, y4.V2), mk.Node2(y4.V3, y4.V4), m2)),
                           x3 => y.Match(y1 => Append3(m, m1, mk.Node3(x3.V1, x3.V2, x3.V3), mk.Node3(n1, n2, n3),
                                                       mk.Node2(n4, y1.V), m2),
                                         y2 => Append3(m, m1, mk.Node3(x3.V1, x3.V2, x3.V3), mk.Node3(n1, n2, n3),
                                                       mk.Node3(n4, y2.V1, y2.V2), m2),
                                         y3 => Append4(m, m1, mk.Node3(x3.V1, x3.V2, x3.V3), mk.Node3(n1, n2, n3),
                                                       mk.Node2(n4, y3.V1), mk.Node2(y3.V2, y3.V3), m2),
                                         y4 => Append4(m, m1, mk.Node3(x3.V1, x3.V2, x3.V3), mk.Node3(n1, n2, n3),
                                                       mk.Node3(n4, y4.V1, y4.V2), mk.Node2(y4.V3, y4.V4), m2)),
                           x4 => y.Match(y1 => Append3(m, m1, mk.Node3(x4.V1, x4.V2, x4.V3), mk.Node3(x4.V4, n1, n2),
                                                       mk.Node3(n3, n4, y1.V), m2),
                                         y2 => Append4(m, m1, mk.Node3(x4.V1, x4.V2, x4.V3), mk.Node3(x4.V4, n1, n2),
                                                       mk.Node2(n3, n4), mk.Node2(y2.V1, y2.V2), m2),
                                         y3 => Append4(m, m1, mk.Node3(x4.V1, x4.V2, x4.V3), mk.Node3(x4.V4, n1, n2),
                                                       mk.Node3(n3, n4, y3.V1), mk.Node2(y3.V2, y3.V3), m2),
                                         y4 => Append4(m, m1, mk.Node3(x4.V1, x4.V2, x4.V3), mk.Node3(x4.V4, n1, n2),
                                                       mk.Node3(n3, n4, y4.V1), mk.Node3(y4.V2, y4.V3, y4.V4), m2))));
        }