Table of Contents

Class ImmutableBitSet

Namespace
BelNytheraSeiche.TrieDictionary
Assembly
BelNytheraSeiche.TrieDictionary.dll

Represents a read-only, immutable bit set.

public class ImmutableBitSet
Inheritance
ImmutableBitSet
Derived
Inherited Members

Constructors

ImmutableBitSet(ulong[], int)

Represents a read-only, immutable bit set.

public ImmutableBitSet(ulong[] buffer, int count)

Parameters

buffer ulong[]

The underlying ulong array that stores the bits.

count int

The total number of bits in the set.

Properties

Buffer

Gets the underlying ulong array that stores the bits.

public ulong[] Buffer { get; }

Property Value

ulong[]

Count

Gets the total number of bits in the set.

public int Count { get; }

Property Value

int

this[int]

Gets the bit value at the specified index.

public bool this[int index] { get; }

Parameters

index int

The zero-based index of the bit to get.

Property Value

bool

The bit value (true for 1, false for 0).

Exceptions

ArgumentOutOfRangeException

index is out of range.

Methods

At(int)

Gets the bit value at the specified index.

public bool At(int index)

Parameters

index int

The zero-based index of the bit to get.

Returns

bool

The bit value (true for 1, false for 0).

ToRankSelect(ImmutableBitSet, bool)

Creates a new RankSelectBitSet from the specified ImmutableBitSet.

public static RankSelectBitSet ToRankSelect(ImmutableBitSet bitSet, bool createAuxDir = true)

Parameters

bitSet ImmutableBitSet

The source immutable bit set to convert.

createAuxDir bool

A value indicating whether to immediately create the auxiliary directories required for fast Rank and Select operations.

Returns

RankSelectBitSet

A new RankSelectBitSet instance.

Remarks

If createAuxDir is set to false, this method is very fast, but the returned RankSelectBitSet will not be ready for Rank/Select operations until its auxiliary directories are created and set via the SetAuxDir() method. If set to true (the default), the auxiliary directories are created during this call, which takes more processing time but results in a fully initialized and ready-to-use object.

Exceptions

ArgumentNullException

bitSet is null.

ToRankSelect(bool)

Creates a new RankSelectBitSet from the specified ImmutableBitSet.

public RankSelectBitSet ToRankSelect(bool createAuxDir = true)

Parameters

createAuxDir bool

A value indicating whether to immediately create the auxiliary directories required for fast Rank and Select operations.

Returns

RankSelectBitSet

A new RankSelectBitSet instance.

Remarks

If createAuxDir is set to false, this method is very fast, but the returned RankSelectBitSet will not be ready for Rank/Select operations until its auxiliary directories are created and set via the SetAuxDir() method. If set to true (the default), the auxiliary directories are created during this call, which takes more processing time but results in a fully initialized and ready-to-use object.