C# Class BitsetsNET.RoaringBitset

Inheritance: IBitset
Show file Open project: BitSetsNet/BitSetsNet Class Usage Examples

Public Methods

Method Description
Add ( int x ) : void

Adds the specified value to the current bitmap

Add ( int rangeStart, int rangeEnd ) : void

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

And ( IBitset otherSet ) : IBitset

Creates a new bitset that is the bitwise AND of this bitset with another

And ( RoaringBitset x1, RoaringBitset x2 ) : RoaringBitset
AndNot ( RoaringBitset otherSet ) : IBitset

Finds members of a bitset that are not in the other set (ANDNOT). This does not modify either bitset.

AndWith ( IBitset otherSet ) : void

Performs an in-place intersection of two Roaring Bitsets.

Cardinality ( ) : int

The number of members of the set

Clone ( ) : IBitset

Create a new bitset that is a deep copy of this one.

Create ( int input ) : RoaringBitset
Deserialize ( Stream stream ) : RoaringBitset

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

Difference ( IBitset otherSet ) : IBitset

Finds members of this bitset that are not in the other set (ANDNOT). This does not modify either bitset.

DifferenceWith ( IBitset otherSet ) : void

Finds members of this bitset that are not in the other set (ANDNOT). Places the results in the current bitset (modifies in place).

Equals ( Object o ) : bool
Flip ( int x ) : void

If the given index is not in the set add it, otherwise remove it.

Flip ( int start, int end ) : void

For indices in the range [start, end) add the index to the set if it does not exists, otherwise remove it.

Get ( int index ) : bool

Return whether the given index is a member of this set

GetEnumerator ( ) : IEnumerator
GetHashCode ( ) : int
GetObjectData ( SerializationInfo info, StreamingContext context ) : void
IAndNot ( RoaringBitset otherSet ) : void

Finds members of this bitset that are not in the other set (ANDNOT). Modifies current bitset in place.

Or ( IBitset otherSet ) : IBitset

Creates a new bitset that is the bitwise OR of this bitset with another

OrWith ( IBitset otherSet ) : void

Computes the in-place bitwise OR of this bitset with another

Remove ( int rangeStart, int rangeEnd ) : void

Remove from the current bitmap all integers in [rangeStart,rangeEnd).

Select ( int j ) : int
Serialize ( Stream stream ) : void

Write a binary serialization of this roaring bitset.

Set ( int index, bool value ) : void

Adds the current index to the set if value is true, otherwise removes it if the set contains it.

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.

ToBitArray ( ) : BitArray

Private Methods

Method Description
AndWith ( RoaringBitset other ) : void

Performs an in-place intersection of two Roaring Bitsets.

IEnumerable ( ) : IEnumerator

Get an enumerator of the set indices of this bitset.

Method Details

Add() public method

Adds the specified value to the current bitmap
public Add ( int x ) : void
x int Value to be added
return void

Add() public method

Add to the current bitmap all integers in [rangeStart,rangeEnd).
public Add ( int rangeStart, int rangeEnd ) : void
rangeStart int Inclusive beginning of range
rangeEnd int Exclusive ending of range
return void

And() public method

Creates a new bitset that is the bitwise AND of this bitset with another
public And ( IBitset otherSet ) : IBitset
otherSet IBitset Other bitset
return IBitset

And() public static method

public static And ( RoaringBitset x1, RoaringBitset x2 ) : RoaringBitset
x1 RoaringBitset
x2 RoaringBitset
return RoaringBitset

AndNot() public method

Finds members of a bitset that are not in the other set (ANDNOT). This does not modify either bitset.
public AndNot ( RoaringBitset otherSet ) : IBitset
otherSet RoaringBitset The set to compare against
return IBitset

AndWith() public method

Performs an in-place intersection of two Roaring Bitsets.
public AndWith ( IBitset otherSet ) : void
otherSet IBitset the second Roaring Bitset to intersect
return void

Cardinality() public method

The number of members of the set
public Cardinality ( ) : int
return int

Clone() public method

Create a new bitset that is a deep copy of this one.
public Clone ( ) : IBitset
return IBitset

Create() public static method

public static Create ( int input ) : RoaringBitset
input int
return RoaringBitset

Deserialize() public static method

Read a binary serialization of a roaring bitset, as written by the Serialize method.
public static Deserialize ( Stream stream ) : RoaringBitset
stream Stream The stream to read from.
return RoaringBitset

Difference() public method

Finds members of this bitset that are not in the other set (ANDNOT). This does not modify either bitset.
public Difference ( IBitset otherSet ) : IBitset
otherSet IBitset The set to compare against
return IBitset

DifferenceWith() public method

Finds members of this bitset that are not in the other set (ANDNOT). Places the results in the current bitset (modifies in place).
public DifferenceWith ( IBitset otherSet ) : void
otherSet IBitset The set to compare against
return void

Equals() public method

public Equals ( Object o ) : bool
o Object
return bool

Flip() public method

If the given index is not in the set add it, otherwise remove it.
public Flip ( int x ) : void
x int
return void

Flip() public method

For indices in the range [start, end) add the index to the set if it does not exists, otherwise remove it.
public Flip ( int start, int end ) : void
start int the index to start from (inclusive)
end int the index to stop at (exclusive)
return void

Get() public method

Return whether the given index is a member of this set
public Get ( int index ) : bool
index int the index to test
return bool

GetEnumerator() public method

public GetEnumerator ( ) : IEnumerator
return IEnumerator

GetHashCode() public method

public GetHashCode ( ) : int
return int

GetObjectData() public method

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

IAndNot() public method

Finds members of this bitset that are not in the other set (ANDNOT). Modifies current bitset in place.
public IAndNot ( RoaringBitset otherSet ) : void
otherSet RoaringBitset The set to compare against
return void

Or() public method

Creates a new bitset that is the bitwise OR of this bitset with another
public Or ( IBitset otherSet ) : IBitset
otherSet IBitset Other bitset
return IBitset

OrWith() public method

Computes the in-place bitwise OR of this bitset with another
public OrWith ( IBitset otherSet ) : void
otherSet IBitset Other bitset
return void

Remove() public method

Remove from the current bitmap all integers in [rangeStart,rangeEnd).
public Remove ( int rangeStart, int rangeEnd ) : void
rangeStart int inclusive beginning of range
rangeEnd int exclusive ending of range
return void

Select() public method

public Select ( int j ) : int
j int
return int

Serialize() public method

Write a binary serialization of this roaring bitset.
public Serialize ( Stream stream ) : void
stream Stream The stream to write to.
return void

Set() public method

Adds the current index to the set if value is true, otherwise removes it if the set contains it.
public Set ( int index, bool value ) : void
index int The index to set
value bool Boolean of whether to add or remove the index
return void

Set() public method

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
return void

ToBitArray() public method

public ToBitArray ( ) : BitArray
return System.Collections.BitArray