pub fn Array(comptime MaskIntType: type, comptime size: usize) type
A bit set with static size, which is backed by an array of usize.
- Kind
- type function
- Module
std.bit_set
The number of items in this bit set.
- Kind
- constant
- Module
std.bit_set
pub fn capacity(self: Self) usize
Returns the number of bits in this bit set.
- Kind
- function
- Module
std.bit_set
pub fn complement(self: Self) Self
Returns the complement bit sets.
- Kind
- function
- Module
std.bit_set
pub fn count(self: Self) usize
Returns the total number of set bits in this bit set.
- Kind
- function
- Module
std.bit_set
pub fn differenceWith(self: Self, other: Self) Self
Returns the difference of two bit sets.
- Kind
- function
- Module
std.bit_set
A bit set with no elements present.
- Kind
- constant
- Module
std.bit_set
pub fn eql(self: Self, other: Self) bool
Returns true iff every corresponding bit in both bit sets are the same.
- Kind
- function
- Module
std.bit_set
pub fn findFirstSet(self: Self) ?usize
Finds the index of the first set bit.
- Kind
- function
- Module
std.bit_set
pub fn findLastSet(self: Self) ?usize
Finds the index of the last set bit.
- Kind
- function
- Module
std.bit_set
A bit set with all elements present.
- Kind
- constant
- Module
std.bit_set
pub fn intersectWith(self: Self, other: Self) Self
Returns the intersection of two bit sets.
- Kind
- function
- Module
std.bit_set
pub fn isSet(self: Self, index: usize) bool
Returns true if the bit at the specified index is present in the set, false otherwise.
- Kind
- function
- Module
std.bit_set
pub fn Iterator(comptime options: IteratorOptions) type
- Kind
- type function
- Module
std.bit_set
pub fn iterator(self: *const Self, comptime options: IteratorOptions) Iterator(options)
Iterates through the items in the set, according to the options.
- Kind
- function
- Module
std.bit_set
- Kind
- constant
- Module
std.bit_set
The integer type used to represent a mask in this bit set.
- Kind
- type
- Module
std.bit_set
pub fn set(self: *Self, index: usize) void
Adds a specific bit to the bit set.
- Kind
- function
- Module
std.bit_set
pub fn setAll(self: *Self) void
Set all bits to 1.
- Kind
- function
- Module
std.bit_set
pub fn setIntersection(self: *Self, other: Self) void
Performs an intersection of two bit sets, and stores the result in the first one.
- Kind
- function
- Module
std.bit_set
pub fn setRangeValue(self: *Self, range: Range, value: bool) void
Changes the value of all bits in the specified range to match the passed boolean.
- Kind
- function
- Module
std.bit_set
pub fn setUnion(self: *Self, other: Self) void
Performs a union of two bit sets, and stores the result in the first one.
- Kind
- function
- Module
std.bit_set
pub fn setValue(self: *Self, index: usize, value: bool) void
Changes the value of the specified bit of the bit set to match the passed boolean.
- Kind
- function
- Module
std.bit_set
The integer type used to shift a mask in this bit set.
- Kind
- type
- Module
std.bit_set
pub fn subsetOf(self: Self, other: Self) bool
Returns true iff the first bit set is the subset of the second one.
- Kind
- function
- Module
std.bit_set
pub fn supersetOf(self: Self, other: Self) bool
Returns true iff the first bit set is the superset of the second one.
- Kind
- function
- Module
std.bit_set
pub fn toggle(self: *Self, index: usize) void
Flips a specific bit in the bit set.
- Kind
- function
- Module
std.bit_set
pub fn toggleAll(self: *Self) void
Flips every bit in the bit set.
- Kind
- function
- Module
std.bit_set
pub fn toggleFirstSet(self: *Self) ?usize
Finds the index of the first set bit, and unsets it.
- Kind
- function
- Module
std.bit_set
pub fn toggleSet(self: *Self, toggles: Self) void
Flips all bits in this bit set which are present in the toggles bit set.
- Kind
- function
- Module
std.bit_set
pub fn unionWith(self: Self, other: Self) Self
Returns the union of two bit sets.
- Kind
- function
- Module
std.bit_set
pub fn unset(self: *Self, index: usize) void
Removes a specific bit from the bit set.
- Kind
- function
- Module
std.bit_set
pub fn unsetAll(self: *Self) void
Set all bits to 0.
- Kind
- function
- Module
std.bit_set
pub fn xorWith(self: Self, other: Self) Self
Returns the xor of two bit sets.
- Kind
- function
- Module
std.bit_set
A bit set with runtime-known size, backed by an allocated slice of usize.
- Kind
- struct
- Module
std.bit_set
pub fn capacity(self: Self) usize
Returns the number of bits in this bit set.
- Kind
- function
- Module
std.bit_set
pub fn clone(self: *const Self, new_allocator: Allocator) !Self
Creates a duplicate of this bit set, using the new allocator.
- Kind
- function
- Module
std.bit_set
pub fn count(self: Self) usize
Returns the total number of set bits in this bit set.
- Kind
- function
- Module
std.bit_set
pub fn deinit(self: *Self, allocator: Allocator) void
Deinitializes the array and releases its memory.
- Kind
- function
- Module
std.bit_set
pub fn eql(self: Self, other: Self) bool
Returns true iff every corresponding bit in both bit sets are the same.
- Kind
- function
- Module
std.bit_set
pub fn findFirstSet(self: Self) ?usize
Finds the index of the first set bit.
- Kind
- function
- Module
std.bit_set
pub fn findLastSet(self: Self) ?usize
Finds the index of the last set bit.
- Kind
- function
- Module
std.bit_set
pub fn initEmpty(allocator: Allocator, bit_length: usize) !Self
Creates a bit set with no elements present.
- Kind
- function
- Module
std.bit_set
pub fn initFull(allocator: Allocator, bit_length: usize) !Self
Creates a bit set with all elements present.
- Kind
- function
- Module
std.bit_set
pub fn isSet(self: Self, index: usize) bool
Returns true if the bit at the specified index is present in the set, false otherwise.
- Kind
- function
- Module
std.bit_set
pub fn Iterator(comptime options: IteratorOptions) type
- Kind
- type function
- Module
std.bit_set
pub fn iterator(self: *const Self, comptime options: IteratorOptions) Iterator(options)
Iterates through the items in the set, according to the options.
- Kind
- function
- Module
std.bit_set
The integer type used to represent a mask in this bit set.
- Kind
- type
- Module
std.bit_set
pub fn resize(self: *@This(), allocator: Allocator, new_len: usize, fill: bool) !void
Resizes to a new bit_length.
- Kind
- function
- Module
std.bit_set
pub fn set(self: *Self, index: usize) void
Adds a specific bit to the bit set.
- Kind
- function
- Module
std.bit_set
pub fn setAll(self: *Self) void
Set all bits to 1.
- Kind
- function
- Module
std.bit_set
pub fn setIntersection(self: *Self, other: Self) void
Performs an intersection of two bit sets, and stores the result in the first one.
- Kind
- function
- Module
std.bit_set
pub fn setRangeValue(self: *Self, range: Range, value: bool) void
Changes the value of all bits in the specified range to match the passed boolean.
- Kind
- function
- Module
std.bit_set
pub fn setUnion(self: *Self, other: Self) void
Performs a union of two bit sets, and stores the result in the first one.
- Kind
- function
- Module
std.bit_set
pub fn setValue(self: *Self, index: usize, value: bool) void
Changes the value of the specified bit of the bit set to match the passed boolean.
- Kind
- function
- Module
std.bit_set
The integer type used to shift a mask in this bit set.
- Kind
- type
- Module
std.bit_set
pub fn subsetOf(self: Self, other: Self) bool
Returns true iff the first bit set is the subset of the second one.
- Kind
- function
- Module
std.bit_set
pub fn supersetOf(self: Self, other: Self) bool
Returns true iff the first bit set is the superset of the second one.
- Kind
- function
- Module
std.bit_set
pub fn toggle(self: *Self, index: usize) void
Flips a specific bit in the bit set.
- Kind
- function
- Module
std.bit_set
pub fn toggleAll(self: *Self) void
Flips every bit in the bit set.
- Kind
- function
- Module
std.bit_set
pub fn toggleFirstSet(self: *Self) ?usize
Finds the index of the first set bit, and unsets it.
- Kind
- function
- Module
std.bit_set
pub fn toggleSet(self: *Self, toggles: Self) void
Flips all bits in this bit set which are present in the toggles bit set.
- Kind
- function
- Module
std.bit_set
pub fn unset(self: *Self, index: usize) void
Removes a specific bit from the bit set.
- Kind
- function
- Module
std.bit_set
pub fn unsetAll(self: *Self) void
Set all bits to 0.
- Kind
- function
- Module
std.bit_set
A bit set with runtime-known size, backed by an allocated slice of usize.
- Kind
- struct
- Module
std.bit_set
pub fn capacity(self: Self) usize
Returns the number of bits in this bit set.
- Kind
- function
- Module
std.bit_set
pub fn clone(self: *const Self, new_allocator: Allocator) !Self
Creates a duplicate of this bit set, using the new allocator.
- Kind
- function
- Module
std.bit_set
pub fn count(self: Self) usize
Returns the total number of set bits in this bit set.
- Kind
- function
- Module
std.bit_set
pub fn deinit(self: *Self) void
Deinitializes the array and releases its memory.
- Kind
- function
- Module
std.bit_set
pub fn eql(self: Self, other: Self) bool
Returns true iff every corresponding bit in both bit sets are the same.
- Kind
- function
- Module
std.bit_set
pub fn findFirstSet(self: Self) ?usize
Finds the index of the first set bit.
- Kind
- function
- Module
std.bit_set
pub fn findLastSet(self: Self) ?usize
Finds the index of the last set bit.
- Kind
- function
- Module
std.bit_set
pub fn initEmpty(allocator: Allocator, bit_length: usize) !Self
Creates a bit set with no elements present.
- Kind
- function
- Module
std.bit_set
pub fn initFull(allocator: Allocator, bit_length: usize) !Self
Creates a bit set with all elements present.
- Kind
- function
- Module
std.bit_set
pub fn isSet(self: Self, index: usize) bool
Returns true if the bit at the specified index is present in the set, false otherwise.
- Kind
- function
- Module
std.bit_set
- Kind
- type
- Module
std.bit_set
pub fn iterator(self: *const Self, comptime options: IteratorOptions) Iterator(options)
Iterates through the items in the set, according to the options.
- Kind
- function
- Module
std.bit_set
The integer type used to represent a mask in this bit set.
- Kind
- type
- Module
std.bit_set
pub fn resize(self: *@This(), new_len: usize, fill: bool) !void
Resizes to a new length.
- Kind
- function
- Module
std.bit_set
pub fn set(self: *Self, index: usize) void
Adds a specific bit to the bit set.
- Kind
- function
- Module
std.bit_set
pub fn setAll(self: *Self) void
Set all bits to 1.
- Kind
- function
- Module
std.bit_set
pub fn setIntersection(self: *Self, other: Self) void
Performs an intersection of two bit sets, and stores the result in the first one.
- Kind
- function
- Module
std.bit_set
pub fn setRangeValue(self: *Self, range: Range, value: bool) void
Changes the value of all bits in the specified range to match the passed boolean.
- Kind
- function
- Module
std.bit_set
pub fn setUnion(self: *Self, other: Self) void
Performs a union of two bit sets, and stores the result in the first one.
- Kind
- function
- Module
std.bit_set
pub fn setValue(self: *Self, index: usize, value: bool) void
Changes the value of the specified bit of the bit set to match the passed boolean.
- Kind
- function
- Module
std.bit_set
The integer type used to shift a mask in this bit set.
- Kind
- type
- Module
std.bit_set
pub fn toggle(self: *Self, index: usize) void
Flips a specific bit in the bit set.
- Kind
- function
- Module
std.bit_set
pub fn toggleAll(self: *Self) void
Flips every bit in the bit set.
- Kind
- function
- Module
std.bit_set
pub fn toggleFirstSet(self: *Self) ?usize
Finds the index of the first set bit, and unsets it.
- Kind
- function
- Module
std.bit_set
pub fn toggleSet(self: *Self, toggles: Self) void
Flips all bits in this bit set which are present in the toggles bit set.
- Kind
- function
- Module
std.bit_set
pub fn unset(self: *Self, index: usize) void
Removes a specific bit from the bit set.
- Kind
- function
- Module
std.bit_set
pub fn unsetAll(self: *Self) void
Set all bits to 0.
- Kind
- function
- Module
std.bit_set
pub fn Integer(comptime size: u16) type
A bit set with static size, which is backed by a single integer.
- Kind
- type function
- Module
std.bit_set
The number of items in this bit set.
- Kind
- constant
- Module
std.bit_set
pub fn capacity(self: Self) usize
Returns the number of bits in this bit set.
- Kind
- function
- Module
std.bit_set
pub fn complement(self: Self) Self
Returns the complement bit sets.
- Kind
- function
- Module
std.bit_set
pub fn count(self: Self) usize
Returns the total number of set bits in this bit set.
- Kind
- function
- Module
std.bit_set
pub fn differenceWith(self: Self, other: Self) Self
Returns the difference of two bit sets.
- Kind
- function
- Module
std.bit_set
A bit set with no elements present.
- Kind
- constant
- Module
std.bit_set
pub fn eql(self: Self, other: Self) bool
Returns true iff every corresponding bit in both bit sets are the same.
- Kind
- function
- Module
std.bit_set
pub fn findFirstSet(self: Self) ?usize
Finds the index of the first set bit.
- Kind
- function
- Module
std.bit_set
pub fn findLastSet(self: Self) ?usize
Finds the index of the last set bit.
- Kind
- function
- Module
std.bit_set
A bit set with all elements present.
- Kind
- constant
- Module
std.bit_set
pub fn intersectWith(self: Self, other: Self) Self
Returns the intersection of two bit sets.
- Kind
- function
- Module
std.bit_set
pub fn isSet(self: Self, index: usize) bool
Returns true if the bit at the specified index is present in the set, false otherwise.
- Kind
- function
- Module
std.bit_set
pub fn Iterator(comptime options: IteratorOptions) type
- Kind
- type function
- Module
std.bit_set
pub fn iterator(self: *const Self, comptime options: IteratorOptions) Iterator(options)
Iterates through the items in the set, according to the options.
- Kind
- function
- Module
std.bit_set
The integer type used to represent a mask in this bit set.
- Kind
- type
- Module
std.bit_set
pub fn set(self: *Self, index: usize) void
Adds a specific bit to the bit set.
- Kind
- function
- Module
std.bit_set
pub fn setAll(self: *Self) void
Set all bits to 1.
- Kind
- function
- Module
std.bit_set
pub fn setIntersection(self: *Self, other: Self) void
Performs an intersection of two bit sets, and stores the result in the first one.
- Kind
- function
- Module
std.bit_set
pub fn setRangeValue(self: *Self, range: Range, value: bool) void
Changes the value of all bits in the specified range to match the passed boolean.
- Kind
- function
- Module
std.bit_set
pub fn setUnion(self: *Self, other: Self) void
Performs a union of two bit sets, and stores the result in the first one.
- Kind
- function
- Module
std.bit_set
pub fn setValue(self: *Self, index: usize, value: bool) void
Changes the value of the specified bit of the bit set to match the passed boolean.
- Kind
- function
- Module
std.bit_set
The integer type used to shift a mask in this bit set.
- Kind
- type
- Module
std.bit_set
pub fn subsetOf(self: Self, other: Self) bool
Returns true iff the first bit set is the subset of the second one.
- Kind
- function
- Module
std.bit_set
pub fn supersetOf(self: Self, other: Self) bool
Returns true iff the first bit set is the superset of the second one.
- Kind
- function
- Module
std.bit_set
pub fn toggle(self: *Self, index: usize) void
Flips a specific bit in the bit set.
- Kind
- function
- Module
std.bit_set
pub fn toggleAll(self: *Self) void
Flips every bit in the bit set.
- Kind
- function
- Module
std.bit_set
pub fn toggleFirstSet(self: *Self) ?usize
Finds the index of the first set bit, and unsets it.
- Kind
- function
- Module
std.bit_set
pub fn toggleSet(self: *Self, toggles: Self) void
Flips all bits in this bit set which are present in the toggles bit set.
- Kind
- function
- Module
std.bit_set
pub fn unionWith(self: Self, other: Self) Self
Returns the union of two bit sets.
- Kind
- function
- Module
std.bit_set
pub fn unset(self: *Self, index: usize) void
Removes a specific bit from the bit set.
- Kind
- function
- Module
std.bit_set
pub fn unsetAll(self: *Self) void
Set all bits to 0.
- Kind
- function
- Module
std.bit_set
pub fn xorWith(self: Self, other: Self) Self
Returns the xor of two bit sets.
- Kind
- function
- Module
std.bit_set
Options for configuring an iterator over a bit set.
- Kind
- struct
- Module
std.bit_set
- Kind
- enum
- Module
std.bit_set
- Kind
- enum
- Module
std.bit_set
A range of indices within a bitset.
- Kind
- struct
- Module
std.bit_set
pub fn Static(comptime size: usize) type
Returns the optimal static bit set type for the specified number of elements: either `IntegerBitSet` or `ArrayBitSet`, both of which fulfill the same interface.
- Kind
- type function
- Module
std.bit_set