pub struct BitSubset64<T: Cast<u64> = u64>{
pub tag: u64,
pub mask: u64,
/* private fields */
}
Expand description
A bit subset of u64
.
This structure represents a subset of bits within a 64-bit unsigned integer,
defined by a specific pattern where each bit is either 0
, 1
, or S
.
0
means the bit is always0
. These bits contribute to both the tag and the mask.1
means the bit is always1
. These bits also contribute to both the tag and the mask.S
represents a superposition state, meaning the bit can be either0
or1
.
The cardinality of the set is calculated as 2^(superposition.count_ones())
, representing
the number of unique combinations possible within the superposition bits.
The following table summarizes how each field is derived:
Property | 0 | 1 | S | Description |
---|---|---|---|---|
union | 0 | 1 | 1 | items.reduce(or) |
tag | 0 | 1 | 0 | items.reduce(and) |
superposition | 0 | 0 | 1 | union ^ tag |
mask | 1 | 1 | 0 | !superposition |
Fields§
§tag: u64
Represents the intersection of all items in the subset. A pattern of bits
where a 1
in each position indicates that the corresponding bit is consistently 1
across all items, and a 0
indicates that it is not consistently 1
.
mask: u64
Identifies the bits that are constant (either 0
or 1
). A 1
in a position
indicates a fixed bit (as per the tag
), and a 0
indicates a superposition bit.