C# 클래스 BitsetsNET.RLEBitset

상속: IBitset
파일 보기 프로젝트 열기: BitSetsNet/BitSetsNet 1 사용 예제들

공개 메소드들

메소드 설명
And ( IBitset otherSet ) : IBitset
AndWith ( IBitset otherSet ) : void

Intersects an IBitset with another IBitset, modifying the first IBitset rather than creating a new IBitset

Cardinality ( ) : int

Returns the number of 1's in the uncompressed set (i.e. 1's only).

Clone ( ) : IBitset

Returns a deep copy of this RLEBitset.

CreateFrom ( BitArray bits ) : IBitset

Creates a RLEBitset from a BitArray.

CreateFrom ( int indices ) : IBitset

Creates a RLEBitset from an array of indices. Each value in the input array represents the position (i.e. index) of a 1.

CreateFrom ( int indices, int capacity ) : IBitset

Creates a RLEBitset from an array of indices and a capacity value. Each value in the input array represents the position (i.e. index) of a 1. The capity represents the length of the uncompressed data.

Deserialize ( System.Stream stream ) : RLEBitset

Read a binary serialization of a RLE bitset, as written by the Serialize method.

Difference ( IBitset otherSet ) : IBitset

Performs the set difference, defined as the set in A and not in B.

DifferenceWith ( IBitset otherSet ) : void

Performs the set difference, defined as the set in A and not in B.

Equals ( object otherSet ) : bool

Determines if the other IBitset is equal to this one.

Flip ( int index ) : void

Flips the bit at the specified index.

Flip ( int start, int end ) : void

Flips each bit in the specified range

Get ( int index ) : bool

Gets the boolean value at the given index.

GetEnumerator ( ) : IEnumerator

Get an enumerator of the set indices of this bitset. Meaning, it returns the indicies where the value is set to "true" or "1".

GetHashCode ( ) : int
GetObjectData ( SerializationInfo info, StreamingContext context ) : void
Length ( ) : int

Returns the length of the uncompressed set (i.e. 1's and 0's).

Not ( ) : IBitset

Inverts all the values in the current IBitset, so that elements set to true are changed to false, and elements set to false are changed to true.

Or ( IBitset otherSet ) : IBitset
OrWith ( IBitset otherSet ) : void
Serialize ( System.Stream stream ) : void

Write a binary serialization of this RLE bitset.

Set ( int index, bool value ) : void

Sets the bit at a specific position in the IBitset to the specified value.

Set ( int start, int end, bool value ) : void

For indices in the range [start, end] add the index to the set if the value is true, otherwise remove it.

SetRange ( int startIndex, int count, bool value ) : void

Sets all bits in the given range to the specified value.

ToBitArray ( ) : BitArray

Returns the contents of this set as a bit array where the value is set to true for each index that is a member of this set

비공개 메소드들

메소드 설명
AddRunToRLE ( RLEBitset &currRLE, Run runToAdd ) : void

Helper function for Or operations. Adds the given run to the run-array by. Either: a) merges it with the previous run if overlap with previous in array b) adds it as next run if no overlap with previous in array

GetRange ( int start, int end ) : List
Merge ( Run &current, Run &next, bool shouldInsert, int index ) : bool
MergeOtherRun ( RLEBitset other, Run &current, int &nextThisIndex, int &nextOtherIndex ) : void
TryCreateIntersection ( Run runA, Run runB, Run &output ) : bool
TryCreateUnion ( Run runA, Run runB, Run &output ) : bool
mergeExistingRun ( Run &current, int &nextIndex ) : void

메소드 상세

And() 공개 메소드

public And ( IBitset otherSet ) : IBitset
otherSet IBitset
리턴 IBitset

AndWith() 공개 메소드

Intersects an IBitset with another IBitset, modifying the first IBitset rather than creating a new IBitset
public AndWith ( IBitset otherSet ) : void
otherSet IBitset the other IBitset
리턴 void

Cardinality() 공개 메소드

Returns the number of 1's in the uncompressed set (i.e. 1's only).
public Cardinality ( ) : int
리턴 int

Clone() 공개 메소드

Returns a deep copy of this RLEBitset.
public Clone ( ) : IBitset
리턴 IBitset

CreateFrom() 공개 정적인 메소드

Creates a RLEBitset from a BitArray.
public static CreateFrom ( BitArray bits ) : IBitset
bits System.Collections.BitArray a BitArray
리턴 IBitset

CreateFrom() 공개 정적인 메소드

Creates a RLEBitset from an array of indices. Each value in the input array represents the position (i.e. index) of a 1.
public static CreateFrom ( int indices ) : IBitset
indices int an array of integers representing the positions of 1's
리턴 IBitset

CreateFrom() 공개 정적인 메소드

Creates a RLEBitset from an array of indices and a capacity value. Each value in the input array represents the position (i.e. index) of a 1. The capity represents the length of the uncompressed data.
public static CreateFrom ( int indices, int capacity ) : IBitset
indices int an array of integers representing the positions of 1's
capacity int the length of the uncompressed array
리턴 IBitset

Deserialize() 공개 정적인 메소드

Read a binary serialization of a RLE bitset, as written by the Serialize method.
public static Deserialize ( System.Stream stream ) : RLEBitset
stream System.Stream The stream to read from.
리턴 RLEBitset

Difference() 공개 메소드

Performs the set difference, defined as the set in A and not in B.
public Difference ( IBitset otherSet ) : IBitset
otherSet IBitset the other IBitset
리턴 IBitset

DifferenceWith() 공개 메소드

Performs the set difference, defined as the set in A and not in B.
public DifferenceWith ( IBitset otherSet ) : void
otherSet IBitset the other IBitset
리턴 void

Equals() 공개 메소드

Determines if the other IBitset is equal to this one.
public Equals ( object otherSet ) : bool
otherSet object the other IBitset
리턴 bool

Flip() 공개 메소드

Flips the bit at the specified index.
public Flip ( int index ) : void
index int Index to be flipped
리턴 void

Flip() 공개 메소드

Flips each bit in the specified range
public Flip ( int start, int end ) : void
start int Start of range
end int End of range
리턴 void

Get() 공개 메소드

Gets the boolean value at the given index.
public Get ( int index ) : bool
index int an index
리턴 bool

GetEnumerator() 공개 메소드

Get an enumerator of the set indices of this bitset. Meaning, it returns the indicies where the value is set to "true" or "1".
public GetEnumerator ( ) : IEnumerator
리턴 IEnumerator

GetHashCode() 공개 메소드

public GetHashCode ( ) : int
리턴 int

GetObjectData() 공개 메소드

public GetObjectData ( SerializationInfo info, StreamingContext context ) : void
info System.Runtime.Serialization.SerializationInfo
context System.Runtime.Serialization.StreamingContext
리턴 void

Length() 공개 메소드

Returns the length of the uncompressed set (i.e. 1's and 0's).
public Length ( ) : int
리턴 int

Not() 공개 메소드

Inverts all the values in the current IBitset, so that elements set to true are changed to false, and elements set to false are changed to true.
public Not ( ) : IBitset
리턴 IBitset

Or() 공개 메소드

public Or ( IBitset otherSet ) : IBitset
otherSet IBitset
리턴 IBitset

OrWith() 공개 메소드

public OrWith ( IBitset otherSet ) : void
otherSet IBitset
리턴 void

Serialize() 공개 메소드

Write a binary serialization of this RLE bitset.
public Serialize ( System.Stream stream ) : void
stream System.Stream The stream to write to.
리턴 void

Set() 공개 메소드

Sets the bit at a specific position in the IBitset to the specified value.
public Set ( int index, bool value ) : void
index int The zero-based index of the bit to set.
value bool The Boolean value to assign to the bit.
리턴 void

Set() 공개 메소드

For indices in the range [start, end] add the index to the set if the value is true, otherwise remove it.
public Set ( int start, int end, bool value ) : void
start int the index to start from (inclusive)
end int the index to stop at (exclusive)
value bool
리턴 void

SetRange() 공개 메소드

Sets all bits in the given range to the specified value.
public SetRange ( int startIndex, int count, bool value ) : void
startIndex int The zero-based start position of the range.
count int The number of bits in the range.
value bool The Boolean value to assign to the bits.
리턴 void

ToBitArray() 공개 메소드

Returns the contents of this set as a bit array where the value is set to true for each index that is a member of this set
public ToBitArray ( ) : BitArray
리턴 System.Collections.BitArray