Stay organized with collections
Save and categorize content based on your preferences.
C++ Reference: class SmallRevBitSet
Note: This documentation is automatically generated.
This class represents a small reversible bitset (size <= 64).
This class is useful to maintain supports.
Method |
Cardinality | Return type: int64_t Returns the number of bits set to one.
|
GetFirstOne | Return type: int64_t Gets the index of the first bit set starting from 0.
It returns -1 if the bitset is empty.
|
IsCardinalityOne | Return type: bool Does it contains only one bit set?
|
IsCardinalityZero | Return type: bool Is bitset null?
|
SetToOne | Return type: void Arguments: Solver* const solver, int64_t pos Sets the 'pos' bit.
|
SetToZero | Return type: void Arguments: Solver* const solver, int64_t pos Erases the 'pos' bit.
|
SmallRevBitSet | Return type: explicit Arguments: int64_t size |
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-08-06 UTC.
[null,null,["Last updated 2024-08-06 UTC."],[],["The `SmallRevBitSet` class manages a bitset with a maximum size of 64, used for maintaining supports. Key actions include setting a bit to one (`SetToOne`) or zero (`SetToZero`) at a given position. Information retrieval methods include getting the count of bits set to one (`Cardinality`), finding the first bit set to one (`GetFirstOne`), and checking if only one bit is set (`IsCardinalityOne`) or if all are zero (`IsCardinalityZero`). The constructor takes the bitset size as input.\n"],null,[]]