C# 클래스 BitsetsNET.BitsetContainer

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

공개 프로퍼티들

프로퍼티 타입 설명
Bitmap long[]
Cardinality int

보호된 프로퍼티들

프로퍼티 타입 설명
MAX_CAPACITY int

공개 메소드들

메소드 설명
Add ( ushort x ) : Container

Add a short to the container. May generate a new container.

Add ( ushort rangeStart, ushort rangeEnd ) : Container

Add to the current bitmap all integers in [rangeStart,rangeEnd).

And ( ArrayContainer x ) : Container

Computes the bitwise AND of this container with another (intersection). This container as well as the provided container are left unaffected.

And ( BitsetContainer x ) : Container

Computes the bitwise AND of this container with another (intersection). This container as well as the provided container are left unaffected.

AndNot ( ArrayContainer x ) : Container

Returns the elements of this BitsetContainer that are not in the ArrayContainer.

AndNot ( BitsetContainer x ) : Container

Returns the elements of this BitsetContainer that are not in the other BitsetContainer.

BitsetContainer ( ) : System
BitsetContainer ( int cardinality, long bitmap ) : System
Clone ( ) : Container

Creates a deep copy of this bitset container.

Contains ( ushort x ) : bool

Checks whether the container contains the provided value.

Deserialize ( BinaryReader reader, int cardinality ) : BitsetContainer

Deserialize a container from binary format, as written by the Serialize method minus the first 32 bits giving the cardinality.

Equals ( Object o ) : bool
FillArray ( ushort array ) : void

Fill the array with set bits.

FillLeastSignificant16bits ( int x, int i, int mask ) : void

Fill the least significant 16 bits of the integer array, starting at index i, with the short values from this container. The caller is responsible to allocate enough room. The most significant 16 bits of each integer are given by the most significant bits of the provided mask.

Flip ( ushort i ) : Container

Add a short to the container if it is not present, otherwise remove it. May generate a new container.

GetCardinality ( ) : int

Computes the distinct number of short values in the container. Can be expected to run in constant time.

GetEnumerator ( ) : IEnumerator
GetHashCode ( ) : int
IAdd ( ushort begin, ushort end ) : Container

Add all shorts in [begin,end) using an unsigned interpretation. May generate a new container.

IAnd ( ArrayContainer other ) : Container

Performs an "in-place" intersection with an ArrayContainer. Since no in-place operation is actually possible, this method defaults to calling ArrayContainer's and() method with this as input.

IAnd ( BitsetContainer other ) : Container

Performs an intersection with another BitsetContainer. Depending on the cardinality of the result, this will either modify the container in place or return a new ArrayContainer.

IAndNot ( ArrayContainer x ) : Container

Returns the elements of this BitsetContainer that are not in the ArrayContainer by modifying the current container in place.

IAndNot ( BitsetContainer x ) : Container

Returns the elements of this BitsetContainer that are not in the other BitsetContainer. Depending on the cardinality of the result, this will either modify the container in place or return a new ArrayContainer.

INot ( int rangeStart, int rangeEnd ) : Container

Computes the in-place bitwise NOT of this container (complement). Only those bits within the range are affected.The current container is generally modified.May generate a new container.

IOr ( ArrayContainer x ) : Container

Computes the in-place bitwise OR of this container with another (union). The current container is generally modified, whereas the provided container(x) is unaffected.May generate a new container.

IOr ( BitsetContainer x ) : Container

Computes the in-place bitwise OR of this container with another (union). The current container is generally modified, whereas the provided container(x) is unaffected.May generate a new container.

Intersects ( ArrayContainer x ) : bool

Returns true if the current container intersects the other container.

Intersects ( BitsetContainer x ) : bool

Returns true if the current container intersects the other container.

LoadData ( ArrayContainer arrayContainer ) : void
Or ( ArrayContainer x ) : Container

Computes the bitwise OR of this container with another (union). This container as well as the provided container are left unaffected.

Or ( BitsetContainer x ) : Container

Computes the bitwise OR of this container with another (union). This container as well as the provided container are left unaffected.

Remove ( ushort x ) : Container

Remove specified short from this container. May create a new container.

Remove ( ushort begin, ushort end ) : Container

Remove shorts in [begin,end) using an unsigned interpretation. May generate a new container.

Select ( int j ) : ushort

Return the jth value of the container.

Serialize ( BinaryWriter writer ) : void

Serialize this container in a binary format.

The format of the serialization is the cardinality of this container as a 32-bit integer, followed by the bit array. The cardinality is used in deserialization to distinguish BitsetContainers from ArrayContainers.

ToArrayContainer ( ) : ArrayContainer

Copies the data to an array container

보호된 메소드들

메소드 설명
ComputeCardinality ( ) : void

Recomputes the cardinality of the bitmap.

메소드 상세

Add() 공개 메소드

Add a short to the container. May generate a new container.
public Add ( ushort x ) : Container
x ushort short to be added
리턴 Container

Add() 공개 메소드

Add to the current bitmap all integers in [rangeStart,rangeEnd).
public Add ( ushort rangeStart, ushort rangeEnd ) : Container
rangeStart ushort inclusive beginning of range
rangeEnd ushort exclusive ending of range
리턴 Container

And() 공개 메소드

Computes the bitwise AND of this container with another (intersection). This container as well as the provided container are left unaffected.
public And ( ArrayContainer x ) : Container
x ArrayContainer Other container
리턴 Container

And() 공개 메소드

Computes the bitwise AND of this container with another (intersection). This container as well as the provided container are left unaffected.
public And ( BitsetContainer x ) : Container
x BitsetContainer Other container
리턴 Container

AndNot() 공개 메소드

Returns the elements of this BitsetContainer that are not in the ArrayContainer.
public AndNot ( ArrayContainer x ) : Container
x ArrayContainer the ArrayContainer to compare against
리턴 Container

AndNot() 공개 메소드

Returns the elements of this BitsetContainer that are not in the other BitsetContainer.
public AndNot ( BitsetContainer x ) : Container
x BitsetContainer the other BitsetContainer
리턴 Container

BitsetContainer() 공개 메소드

public BitsetContainer ( ) : System
리턴 System

BitsetContainer() 공개 메소드

public BitsetContainer ( int cardinality, long bitmap ) : System
cardinality int
bitmap long
리턴 System

Clone() 공개 메소드

Creates a deep copy of this bitset container.
public Clone ( ) : Container
리턴 Container

ComputeCardinality() 보호된 메소드

Recomputes the cardinality of the bitmap.
protected ComputeCardinality ( ) : void
리턴 void

Contains() 공개 메소드

Checks whether the container contains the provided value.
public Contains ( ushort x ) : bool
x ushort Value to check
리턴 bool

Deserialize() 공개 정적인 메소드

Deserialize a container from binary format, as written by the Serialize method minus the first 32 bits giving the cardinality.
public static Deserialize ( BinaryReader reader, int cardinality ) : BitsetContainer
reader System.IO.BinaryReader The reader to deserialize from.
cardinality int
리턴 BitsetContainer

Equals() 공개 메소드

public Equals ( Object o ) : bool
o Object
리턴 bool

FillArray() 공개 메소드

Fill the array with set bits.
public FillArray ( ushort array ) : void
array ushort Container (should be sufficiently large)
리턴 void

FillLeastSignificant16bits() 공개 메소드

Fill the least significant 16 bits of the integer array, starting at index i, with the short values from this container. The caller is responsible to allocate enough room. The most significant 16 bits of each integer are given by the most significant bits of the provided mask.
public FillLeastSignificant16bits ( int x, int i, int mask ) : void
x int Provided array
i int Starting index
mask int Indicates most significant bits
리턴 void

Flip() 공개 메소드

Add a short to the container if it is not present, otherwise remove it. May generate a new container.
public Flip ( ushort i ) : Container
i ushort short to be added
리턴 Container

GetCardinality() 공개 메소드

Computes the distinct number of short values in the container. Can be expected to run in constant time.
public GetCardinality ( ) : int
리턴 int

GetEnumerator() 공개 메소드

public GetEnumerator ( ) : IEnumerator
리턴 IEnumerator

GetHashCode() 공개 메소드

public GetHashCode ( ) : int
리턴 int

IAdd() 공개 메소드

Add all shorts in [begin,end) using an unsigned interpretation. May generate a new container.
public IAdd ( ushort begin, ushort end ) : Container
begin ushort Start of range
end ushort End of range
리턴 Container

IAnd() 공개 메소드

Performs an "in-place" intersection with an ArrayContainer. Since no in-place operation is actually possible, this method defaults to calling ArrayContainer's and() method with this as input.
public IAnd ( ArrayContainer other ) : Container
other ArrayContainer the ArrayContainer to intersect
리턴 Container

IAnd() 공개 메소드

Performs an intersection with another BitsetContainer. Depending on the cardinality of the result, this will either modify the container in place or return a new ArrayContainer.
public IAnd ( BitsetContainer other ) : Container
other BitsetContainer the other BitsetContainer to intersect
리턴 Container

IAndNot() 공개 메소드

Returns the elements of this BitsetContainer that are not in the ArrayContainer by modifying the current container in place.
public IAndNot ( ArrayContainer x ) : Container
x ArrayContainer the ArrayContainer to compare against
리턴 Container

IAndNot() 공개 메소드

Returns the elements of this BitsetContainer that are not in the other BitsetContainer. Depending on the cardinality of the result, this will either modify the container in place or return a new ArrayContainer.
public IAndNot ( BitsetContainer x ) : Container
x BitsetContainer the other BitsetContainer
리턴 Container

INot() 공개 메소드

Computes the in-place bitwise NOT of this container (complement). Only those bits within the range are affected.The current container is generally modified.May generate a new container.
public INot ( int rangeStart, int rangeEnd ) : Container
rangeStart int beginning of range (inclusive); 0 is beginning of this container.
rangeEnd int ending of range (exclusive)
리턴 Container

IOr() 공개 메소드

Computes the in-place bitwise OR of this container with another (union). The current container is generally modified, whereas the provided container(x) is unaffected.May generate a new container.
public IOr ( ArrayContainer x ) : Container
x ArrayContainer Other container
리턴 Container

IOr() 공개 메소드

Computes the in-place bitwise OR of this container with another (union). The current container is generally modified, whereas the provided container(x) is unaffected.May generate a new container.
public IOr ( BitsetContainer x ) : Container
x BitsetContainer Other container
리턴 Container

Intersects() 공개 메소드

Returns true if the current container intersects the other container.
public Intersects ( ArrayContainer x ) : bool
x ArrayContainer Other container
리턴 bool

Intersects() 공개 메소드

Returns true if the current container intersects the other container.
public Intersects ( BitsetContainer x ) : bool
x BitsetContainer Other container
리턴 bool

LoadData() 공개 메소드

public LoadData ( ArrayContainer arrayContainer ) : void
arrayContainer ArrayContainer
리턴 void

Or() 공개 메소드

Computes the bitwise OR of this container with another (union). This container as well as the provided container are left unaffected.
public Or ( ArrayContainer x ) : Container
x ArrayContainer Other container
리턴 Container

Or() 공개 메소드

Computes the bitwise OR of this container with another (union). This container as well as the provided container are left unaffected.
public Or ( BitsetContainer x ) : Container
x BitsetContainer Other container
리턴 Container

Remove() 공개 메소드

Remove specified short from this container. May create a new container.
public Remove ( ushort x ) : Container
x ushort Short to be removed
리턴 Container

Remove() 공개 메소드

Remove shorts in [begin,end) using an unsigned interpretation. May generate a new container.
public Remove ( ushort begin, ushort end ) : Container
begin ushort Start of range (inclusive)
end ushort End of range (exclusive)
리턴 Container

Select() 공개 메소드

Return the jth value of the container.
public Select ( int j ) : ushort
j int Index of the value
리턴 ushort

Serialize() 공개 메소드

Serialize this container in a binary format.
The format of the serialization is the cardinality of this container as a 32-bit integer, followed by the bit array. The cardinality is used in deserialization to distinguish BitsetContainers from ArrayContainers.
public Serialize ( BinaryWriter writer ) : void
writer System.IO.BinaryWriter The writer to which to serialize this container.
리턴 void

ToArrayContainer() 공개 메소드

Copies the data to an array container
public ToArrayContainer ( ) : ArrayContainer
리턴 ArrayContainer

프로퍼티 상세

Bitmap 공개적으로 프로퍼티

public long[] Bitmap
리턴 long[]

Cardinality 공개적으로 프로퍼티

public int Cardinality
리턴 int

MAX_CAPACITY 보호되어 있는 정적으로 프로퍼티

protected static int MAX_CAPACITY
리턴 int