當前位置: 首頁>>代碼示例>>C#>>正文


C# BitSet.Clear方法代碼示例

本文整理匯總了C#中System.Xml.Schema.BitSet.Clear方法的典型用法代碼示例。如果您正苦於以下問題:C# BitSet.Clear方法的具體用法?C# BitSet.Clear怎麽用?C# BitSet.Clear使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.Xml.Schema.BitSet的用法示例。


在下文中一共展示了BitSet.Clear方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: CalculateTotalFollowposForRangeNodes

        private BitSet[] CalculateTotalFollowposForRangeNodes(BitSet firstpos, BitSet[] followpos, out BitSet posWithRangeTerminals) {
            int positionsCount = positions.Count; //terminals
            posWithRangeTerminals = new BitSet(positionsCount);
            
            //Compute followpos for each range node
            //For any range node that is surrounded by an outer range node, its follow positions will include those of the outer range node
            BitSet[] minmaxFollowPos = new BitSet[minMaxNodesCount];
            int localMinMaxNodesCount = 0;
            
            for (int i = positionsCount - 1;  i >= 0; i--) { 
                Position p = positions[i];
                if (p.symbol == -2) { //P is a LeafRangeNode
                    LeafRangeNode lrNode = p.particle as LeafRangeNode;
                    Debug.Assert(lrNode != null);
                    BitSet tempFollowPos = new BitSet(positionsCount);
                    tempFollowPos.Clear();
                    tempFollowPos.Or(followpos[i]); //Add the followpos of the range node
                    if (lrNode.Min != lrNode.Max) { //If they are the same, then followpos cannot include the firstpos
                        tempFollowPos.Or(lrNode.NextIteration); //Add the nextIteration of the range node (this is the firstpos of its parent's leftChild)
                    }

                    //For each position in the bitset, if it is a outer range node (pos > i), then add its followpos as well to the current node's followpos
                    for (int pos = tempFollowPos.NextSet(-1); pos != -1; pos = tempFollowPos.NextSet(pos)) {
                        if (pos > i) {
                            Position p1 = positions[pos];
                            if (p1.symbol == -2) {
                                LeafRangeNode lrNode1 = p1.particle as LeafRangeNode;
                                Debug.Assert(lrNode1 != null);
                                tempFollowPos.Or(minmaxFollowPos[lrNode1.Pos]);
                            }
                        }
                    }
                    //set the followpos built to the index in the BitSet[]
                    minmaxFollowPos[localMinMaxNodesCount] = tempFollowPos; 
                    lrNode.Pos = localMinMaxNodesCount++; 
                    posWithRangeTerminals.Set(i);
                }
            }
            return minmaxFollowPos;
        }
開發者ID:iskiselev,項目名稱:JSIL.NetFramework,代碼行數:40,代碼來源:ContentValidator.cs

示例2: CalculateTotalFollowposForRangeNodes

 private BitSet[] CalculateTotalFollowposForRangeNodes(BitSet firstpos, BitSet[] followpos, out BitSet posWithRangeTerminals)
 {
     int count = this.positions.Count;
     posWithRangeTerminals = new BitSet(count);
     BitSet[] setArray = new BitSet[this.minMaxNodesCount];
     int index = 0;
     for (int i = count - 1; i >= 0; i--)
     {
         Position position = this.positions[i];
         if (position.symbol == -2)
         {
             LeafRangeNode particle = position.particle as LeafRangeNode;
             BitSet set = new BitSet(count);
             set.Clear();
             set.Or(followpos[i]);
             if (particle.Min != particle.Max)
             {
                 set.Or(particle.NextIteration);
             }
             for (int j = set.NextSet(-1); j != -1; j = set.NextSet(j))
             {
                 if (j > i)
                 {
                     Position position2 = this.positions[j];
                     if (position2.symbol == -2)
                     {
                         LeafRangeNode node2 = position2.particle as LeafRangeNode;
                         set.Or(setArray[node2.Pos]);
                     }
                 }
             }
             setArray[index] = set;
             particle.Pos = index++;
             posWithRangeTerminals.Set(i);
         }
     }
     return setArray;
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:38,代碼來源:ParticleContentValidator.cs


注:本文中的System.Xml.Schema.BitSet.Clear方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。