本文整理匯總了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;
}