本文整理汇总了C#中Mono.CSharp.MyBitVector.MakeShared方法的典型用法代码示例。如果您正苦于以下问题:C# MyBitVector.MakeShared方法的具体用法?C# MyBitVector.MakeShared怎么用?C# MyBitVector.MakeShared使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mono.CSharp.MyBitVector
的用法示例。
在下文中一共展示了MyBitVector.MakeShared方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: And
// <summary>
// Performs an `and' operation on the bit vector. The `new_vector' may have
// a different size than the current one.
// </summary>
private MyBitVector And (MyBitVector new_vector)
{
if (Count == 0)
return this;
var o = new_vector.vector != null ? new_vector.vector : new_vector.shared;
if (o == null) {
for (int i = new_vector.Count; i < Count; ++i)
this [i] = false;
return this;
}
if (o.Count == 0) {
SetAll (false);
return this;
}
if (Count == o.Count) {
if (vector == null) {
if (shared == null) {
shared = new_vector.MakeShared (Count);
return this;
}
initialize_vector ();
}
vector.And (o);
return this;
}
int min = o.Count;
if (Count < min)
min = Count;
for (int i = 0; i < min; i++) {
if (! o [i])
this [i] = false;
}
for (int i = min; i < Count; i++)
this [i] = false;
return this;
}
示例2: MyBitVector
public MyBitVector (MyBitVector InheritsFrom, int Count)
{
if (InheritsFrom != null)
shared = InheritsFrom.MakeShared (Count);
this.Count = Count;
}