public List <U> theNodes = new List <U>(); // 2 or 3 elements in this list public Node(Monoid <V> aMonoid, U u1, U u2) { theMonoid = aMonoid; theNodes.Add(u1); theNodes.Add(u2); PreCalcMeasure = theMonoid.theOp(u1.Measure(), u2.Measure()); }
public V Measure() { V result = theMonoid.zero; foreach (U u in digNodes) { result = theMonoid.theOp(result, u.Measure()); } return(result); }
public Node(Monoid <V> aMonoid, List <U> listU) { theMonoid = aMonoid; theNodes = listU; PreCalcMeasure = theMonoid.zero; foreach (U u in theNodes) { PreCalcMeasure = theMonoid.theOp(PreCalcMeasure, u.Measure()); } }
public Node(Monoid <V> aMonoid, U u1, U u2, U u3) { theMonoid = aMonoid; theNodes.Add(u1); theNodes.Add(u2); theNodes.Add(u3); PreCalcMeasure = theMonoid.zero; foreach (U u in theNodes) { PreCalcMeasure = theMonoid.theOp(PreCalcMeasure, u.Measure()); } }
public DeepFTreeM(Monoid <M> aMonoid, Digit <T, M> frontDig, FTreeM <Node <T, M>, M> innerFT, Digit <T, M> backDig) { if (frontDig.digNodes.Count > 0) { theMonoid = aMonoid; this.frontDig = frontDig; this.innerFT = innerFT; this.backDig = backDig; PreCalcMeasure = theMonoid.zero; PreCalcMeasure = theMonoid.theOp(PreCalcMeasure, frontDig.Measure()); PreCalcMeasure = theMonoid.theOp(PreCalcMeasure, innerFT.Measure()); PreCalcMeasure = theMonoid.theOp(PreCalcMeasure, backDig.Measure()); } else { throw new Exception("The DeepFTree() constructor is passed an empty frontDig !"); } }