当前位置: 首页>>代码示例>>C#>>正文


C# SortedSet.ExceptWith方法代码示例

本文整理汇总了C#中System.Collections.SortedSet.ExceptWith方法的典型用法代码示例。如果您正苦于以下问题:C# SortedSet.ExceptWith方法的具体用法?C# SortedSet.ExceptWith怎么用?C# SortedSet.ExceptWith使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Collections.SortedSet的用法示例。


在下文中一共展示了SortedSet.ExceptWith方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ExceptWithItself

		public void ExceptWithItself ()
		{
			var set = new SortedSet<int> (new [] { 1, 5 });
			set.ExceptWith (set);
			Assert.AreEqual (0, set.Count);
		}
开发者ID:mesheets,项目名称:Theraot-CF,代码行数:6,代码来源:SortedSetTest.cs

示例2: ExceptWith_Null

		public void ExceptWith_Null ()
		{
			var set = new SortedSet<int> ();
			set.ExceptWith (null);
		}
开发者ID:mesheets,项目名称:Theraot-CF,代码行数:5,代码来源:SortedSetTest.cs

示例3: ExceptWith

		public void ExceptWith ()
		{
			var set = new SortedSet<int> { 1, 3, 5, 7, 9 };
			set.ExceptWith (new [] { 5, 7, 3, 7, 11, 7, 5, 2 });
			Assert.IsTrue (set.SequenceEqual (new [] { 1, 9 }));
		}
开发者ID:mesheets,项目名称:Theraot-CF,代码行数:6,代码来源:SortedSetTest.cs

示例4: CheckOutcomeCore


//.........这里部分代码省略.........
                  if (0 < timedOut.Count)
                  {
                    result = CheckSplit(timedOut, ref popLater, options.TimeLimit, timeLimitPerAssertion, ref queries);
                    if (result == Outcome.Valid)
                    {
                      timedOut.Clear();
                    }
                    else if (result == Outcome.TimeOut)
                    {
                      // Give up and report which assertions were not verified.
                      var cmds = timedOut.Select(id => ctx.TimeoutDiagnosticIDToAssertion[id]);

                      if (cmds.Any())
                      {
                        handler.OnResourceExceeded("timeout after running diagnostics", cmds);
                      }
                    }
                  }
                  else
                  {
                    result = Outcome.Valid;
                  }
                  break;
                }

                // TODO(wuestholz): Try out different ways for splitting up the work (e.g., randomly).
                var cnt = Math.Max(1, rem / frac);
                // It seems like assertions later in the control flow have smaller indexes.
                var split = new SortedSet<int>(unverified.Where((val, idx) => (rem - idx - 1) < cnt));
                Contract.Assert(0 < split.Count);
                var splitRes = CheckSplit(split, ref popLater, timeLimitPerAssertion, timeLimitPerAssertion, ref queries);
                if (splitRes == Outcome.Valid)
                {
                  unverified.ExceptWith(split);
                  frac = 1;
                }
                else if (splitRes == Outcome.Invalid)
                {
                  result = splitRes;
                  break;
                }
                else if (splitRes == Outcome.TimeOut)
                {
                  if (2 <= frac && (4 <= (rem / frac)))
                  {
                    frac *= 4;
                  }
                  else if (2 <= (rem / frac))
                  {
                    frac *= 2;
                  }
                  else
                  {
                    timedOut.UnionWith(split);
                    unverified.ExceptWith(split);
                    frac = 1;
                  }
                }
                else
                {
                  break;
                }
              }

              unverified.UnionWith(timedOut);
开发者ID:qunyanm,项目名称:boogie,代码行数:66,代码来源:ProverInterface.cs


注:本文中的System.Collections.SortedSet.ExceptWith方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。