本文整理汇总了C#中BitSet.And方法的典型用法代码示例。如果您正苦于以下问题:C# BitSet.And方法的具体用法?C# BitSet.And怎么用?C# BitSet.And使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BitSet
的用法示例。
在下文中一共展示了BitSet.And方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: computeClasses
private static void computeClasses(Spec spec)
{
SimplifyNfa.original_charset_size = spec.dtrans_ncols;
SimplifyNfa.ccls = new char[SimplifyNfa.original_charset_size];
char c = '\u0001';
BitSet bitSet = new BitSet();
BitSet bitSet2 = new BitSet();
Dictionary<char, char> dictionary = new Dictionary<char, char>();
Console.WriteLine("Working on character classes.");
for (int i = 0; i < spec.nfa_states.Count; i++)
{
Nfa nfa = spec.nfa_states[i];
if (nfa.Edge != '�' && nfa.Edge != '')
{
bitSet.ClearAll();
bitSet2.ClearAll();
for (int j = 0; j < SimplifyNfa.ccls.Length; j++)
{
if ((int)nfa.Edge == j || (nfa.Edge == '' && nfa.GetCharSet().contains(j)))
{
bitSet.Set((int)SimplifyNfa.ccls[j], true);
}
else
{
bitSet2.Set((int)SimplifyNfa.ccls[j], true);
}
}
bitSet.And(bitSet2);
if (bitSet.GetLength() != 0)
{
dictionary.Clear();
for (int k = 0; k < SimplifyNfa.ccls.Length; k++)
{
if (bitSet.Get((int)SimplifyNfa.ccls[k]) && ((int)nfa.Edge == k || (nfa.Edge == '' && nfa.GetCharSet().contains(k))))
{
char c2 = SimplifyNfa.ccls[k];
if (!dictionary.ContainsKey(c2))
{
Dictionary<char, char> arg_14F_0 = dictionary;
char arg_14F_1 = c2;
char expr_14A = c;
c = (char)(expr_14A + '\u0001');
arg_14F_0.Add(arg_14F_1, expr_14A);
}
SimplifyNfa.ccls[k] = dictionary[c2];
}
}
}
}
}
SimplifyNfa.mapped_charset_size = (int)c;
}