BitSet constructor.
Length for the underlying bitvector or an Iterable
a new BitSet.
Custom name for Object.prototype.toString.call(bitset) === [object BitSet]
Array of 32bit words.
The species of the BitSet. Which is just the BitSet constructor.
Getter for the cardinality of the set. In case of a set it will return a warning.
Getter for the cardinality of the set. In case of a set it will return a warning.
Getter for the length of the underlying bitvector. In case of a set it will return a warning.
Getter for the length of the underlying bitvector. In case of a set it will return a warning.
Alias of cardinality
Alias of cardinality
Alias of Intersection
Calculates the inverse of the set. Any trailing bits outside the length bound will be set to 0. The result will be a new instance of a BitSet.
a new BitSet of the complement.
Prototype Symbol.iterator to make BitSet iterable. Returns a new Iterator object that contains the indices in the BitSet object.
iterable iterator containing the indices.
Adds numbers(indices) to the set. It will resize the set in case the index falls out of bounds.
Indices/numbers to add to the set.
this.
Alias of intersection
Clears the bitset. Length will be maintained.
this.
Creates a clone of the bitset.
clone.
Calculates the inverse of the set. Any trailing bits outside the length bound will be set to 0.
this.
Calculates if the bitset contains a certain bitset. In bitmask terms it will calculate if a bitmask fits a bitset.
Tests if a bitset mask fits. i.e. subset to test containment.
a boolean indicating if the mask fits the bitset (i.e. is a subset).
Iterates over the set bits and calls the callback function with: value=1, index, this. Can be broken prematurely by returning false.
Callback function to be called on each bit.
Context to be called upon the callback function.
a boolean indicating if the loop finished completely=true or was broken=false.
Iterates over all bits and calls the callback function with: value, index, this. Can be broken prematurely by returning false.
Callback function o be called on each bit.
Context to be called upon the callback function.
a boolean indicating if the loop finished completely=true or was broken=false.
Returns a new Iterator object that contains an array of [index, index] for each element in the BitSet object. This is kept similar to the Map object, so that each entry has the same value for its key and value here.
an iterable iterator yielding set indices [index, index].
Tests if 2 bitsets are equal.
Bitset to compare to this.
a boolean indicating if the the 2 bitsets are equal.
Flips a bit in the bitset. In case index will fall out of bounds the bitset is enlarged.
Index of the bit to be flipped.
this.
Gets a specific bit from the bitset.
Index of the bit to get.
the value of the bit at the given index.
Checks is the bitsets has a value/index.
The index/value to check membership for.
a boolean indicating if the bitset has the vale/index.
Initializes the BitSet. Useful for reinitialization in case of pooling.
Length for the underlying bitvector or an iterable object with indices.
this.
Calculates if two bitsets intersect.
The bitset to check intersection with.
a boolean indicating if the two bitsets intersects.
Alias of isSubsetOf
Returns if a set is empty i.e. all words are 0.
a boolean indicating that the set is empty.
Alias of has
Checks if a bitset is contained in another.
BitSet to check for containment.
a boolean indicating if this is contained in bitset.
Returns a new Iterator object that contains the indices of the BitSet.
iterable iterator containing set indices.
Alias of min
Returns the max index in a set.
the max number/index in the set.
Returns the minimum index in a set.
the minimum number/index in the set.
Alias of max
Removes indices/numbers from the bitset.
The indices/numbers to be removed.
this.
Resizes the underlying bitvector to a specific length. Will trim any trailing bits in case length is smaller than the current length.
The new length.
the resized bitset.
Adds a number(index) to the set. It will resize the set in case the index falls out of bounds.
Index/number to add to the set.
Value (0|1) to set.
this.
Alias of toString
Outputs the set as an array.
Type for the array Uint(8|16|32)Array.
an array representing the bitset.
Outputs the underlying bitvector as an array, starting with the least significant bits.
Type for the array Uint(8|16|32)Array.
an bit array representation of the bitset.
Outputs the underlying bitvector as a bitstring, starting with the most significant bit.
Mode for stringification. -1 is used to display the full string including trailing bits.
the stringified bitvector.
Outputs the underlying bitvector as a boolean array, starting with the least significant bits.
a boolean array representing the bitset.
Will output a string version of the bitset or bitstring.
Mode of toString. undefined=bitset | 2=bitstring | -1=full bitstring.
stringified version of the bitset.
Trims the bitset to the most significant bit to save space.
this.
Trims (sets to zero) any trailing bits that fall out of this._length but within this.words.length*WORD_SIZE. Assumes this.length is somewhere in the last word.
this.
Returns a new Iterator object that contains the indices of the BitSet.
iterable iterator containing yielding the indices.
Easy create method avoiding ugly 'new' keywords.
Length for the underlying bitvector or an iterable object with indices.
a new BitSet.
Calculate the hamming weight i.e. the number of ones in a bitstring/word.
Word to get the number of set bits from.
the number of set bits in the word.
Returns the least significant bit in a word. Returns 32 in case the word is 0.
The word to get the least significant bit from.
the least significant bit in w.
Returns the most significant bit in a word.
the word to get the most significant bit from.
the most significant bit in w.
Alias of hammingWeight
Info object to hold general module information.
Generated using TypeDoc
Fast JS BitSet implementation. Beyond 32bit restrictions.