Stay organized with collections
Save and categorize content based on your preferences.
C++ Reference: class UnsortedNullableRevBitset
Note: This documentation is automatically generated.
This class represents a reversible bitset. It is meant to represent a set of
active bits. It does not offer direct access, but just methods that can
reversibly subtract another bitset, or check if the current active bitset
intersects with another bitset.
This method returns true iff the mask and the active bitset have a non
null intersection. support_index is used as an accelerator:
- The first word tested to check the intersection will be the
'*support_index'th one.
- If the intersection is not null, the support_index will be filled with
the index of the word that does intersect with the mask. This can be
reused later to speed-up the check.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-08-06 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eUnsortedNullableRevBitset\u003c/code\u003e class in C++ represents a reversible bitset used to track active bits without direct access.\u003c/p\u003e\n"],["\u003cp\u003eIt primarily offers methods to reversibly modify the bitset (subtract, intersect) and check its state (empty, active words).\u003c/p\u003e\n"],["\u003cp\u003eThe bitset is initialized with a specific size and can be modified using masks.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eRevAnd\u003c/code\u003e, \u003ccode\u003eRevSubtract\u003c/code\u003e, and \u003ccode\u003eIntersects\u003c/code\u003e are key methods for manipulating and querying the bitset's active bits.\u003c/p\u003e\n"],["\u003cp\u003eThe class is designed for efficiency, using techniques like support indices to speed up intersection checks.\u003c/p\u003e\n"]]],["The `UnsortedNullableRevBitset` class represents a set of active bits, allowing reversible operations. Key actions include: initializing the bitset with `Init`, subtracting (`RevSubtract`) or performing a bitwise AND (`RevAnd`) with a mask, and checking for intersections (`Intersects`) with a mask. The class also provides methods to query the bitset's state, including if it is `Empty`, the `bit_size`, the `word_size`, `ActiveWordSize` and the `active_words`. It does not allow direct bit access.\n"],null,["# UnsortedNullableRevBitset\n\nC++ Reference: class UnsortedNullableRevBitset\n==============================================\n\n\nNote: This documentation is automatically generated.\nThis class represents a reversible bitset. It is meant to represent a set of active bits. It does not offer direct access, but just methods that can reversibly subtract another bitset, or check if the current active bitset intersects with another bitset.\n\n| Method ||\n|-----------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [`active_words`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/constraint_solveri.h#L2833) | Return type: `const RevIntSet\u003cint\u003e& ` Returns the set of active word indices. |\n| [`ActiveWordSize`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/constraint_solveri.h#L2814) | Return type: `int ` This method returns the number of non null 64 bit words in the bitset representation. |\n| [`bit_size`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/constraint_solveri.h#L2829) | Return type: `int64_t ` Returns the number of bits given in the constructor of the bitset. |\n| [`Empty`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/constraint_solveri.h#L2817) | Return type: `bool ` This method returns true if the active bitset is null. |\n| [`Init`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/constraint_solveri.h#L2802) | Return type: `void ` Arguments: `Solver* const solver, const std::vector\u003cuint64_t\u003e& mask` This methods overwrites the active bitset with the mask. This method should be called only once. |\n| [`Intersects`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/constraint_solveri.h#L2826) | Return type: `bool ` Arguments: `const std::vector\u003cuint64_t\u003e& mask, int* support_index` This method returns true iff the mask and the active bitset have a non null intersection. support_index is used as an accelerator: - The first word tested to check the intersection will be the '\\*support_index'th one. - If the intersection is not null, the support_index will be filled with the index of the word that does intersect with the mask. This can be reused later to speed-up the check. |\n| [`RevAnd`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/constraint_solveri.h#L2810) | Return type: `bool ` Arguments: `Solver* const solver, const std::vector\u003cuint64_t\u003e& mask` This method ANDs the mask with the active bitset. It returns true if the active bitset was changed in the process. |\n| [`RevSubtract`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/constraint_solveri.h#L2806) | Return type: `bool ` Arguments: `Solver* const solver, const std::vector\u003cuint64_t\u003e& mask` This method subtracts the mask from the active bitset. It returns true if the active bitset was changed in the process. |\n| [`UnsortedNullableRevBitset`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/constraint_solveri.h#L2796) | Return type: `explicit ` Arguments: `int bit_size` Size is the number of bits to store in the bitset. |\n| [`~UnsortedNullableRevBitset`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/constraint_solveri.h#L2798) | \u003cbr /\u003e |\n| [`word_size`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/constraint_solveri.h#L2831) | Return type: `int64_t ` Returns the number of 64 bit words used to store the bitset. |"]]